@zyzgroup/core-web 0.1.97 → 0.1.98

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.
@@ -26,7 +26,7 @@ Content-Type: `+f.type+`\r
26
26
  `):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
27
27
  `+e.join("--"+t.boundary+`\r
28
28
  `)+"--"+t.boundary+`--\r
29
- `,t}function su(n){const t=[];for(let e=0,i=qc.length;e<i;e++){const s=Ct(qc[e]+n);t.push(s)}return t}function wi(n,t,e){const i=gh(n);return i.props.style=i.props.style||{},t?i.props.style[t]||i.props.style[zh(t)]||i.props.style[Ct(t)]||"":i.props.style}function jn(n,t,e){Gr(n,i=>{i.props.style=i.props.style||{},typeof t=="string"&&e?i.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(s=>{i.props.style[s]=t[s]})}),yh()}function Ho(n,t=!1){const e={};if(!t)if(getComputedStyle){const i=getComputedStyle(n);for(let s=0,r=i.length;s<r;s++){const o=i[s];e[o]=i.getPropertyValue(o)}}else{const i=n.style||n.currentStyle;for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return n.style.cssText&&n.style.cssText.split(";").filter(i=>!!i).forEach(i=>{const[s,r]=i.split(":").map(o=>o.trim());s&&r&&(e[s]=r)}),e}function Hy(n,t){const e=su(t),i=e.length;let s="";for(let r=0;r<i;r++){const o=e[r];if(s=n[o]||"",s)return s}return s}function qy(n,t,e){const i=su(t),s=i.length;let r="";for(let o=0;o<s;o++){const a=i[o];if(r="style"in n&&n.style[a]||"currentStyle"in n&&n.currentStyle[a]||"",r)return r}if(getComputedStyle){const o=getComputedStyle(n,e);for(let a=0;a<s;a++){const c=i[a];if(r=o.getPropertyValue(c).trim(),r)return r}}return r}function vi(n,t,e){if(t)if(typeof t=="string"&&e)try{n.style.setProperty(t,e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":"")}catch{n.style[t]=e}else t instanceof Object&&Object.keys(t).forEach(i=>{vi(n,i,t[i])})}function qo(n,t){typeof t=="string"?n.style.removeProperty(Ct(t)):Object.keys(t).forEach(e=>{qo(n,e)})}function ru(n,t){let e;if(typeof t=="string"){const i=document.querySelector(t)?.shadowRoot;i?e=i:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const i=document.createElement("style");return i.innerHTML=n,e.appendChild(i),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(i)}}else{const i=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(i)}}}class Jy{selector;name;value;constructor(t,e,i){this.selector=t,this.name=e,this.value=i}toString(){return`${this.selector} { ${this.name}: ${this.value} }`}}class Ky{propertyName;values=[];constructor(t){this.propertyName=t}add(t,e){this.values.push(new Jy(t,this.propertyName,e))}}async function ou(){const n=[],t=document.querySelectorAll("style, link");for(let e=0,i=t.length;e<i;e++){const s=t[e];let r=s.innerHTML;switch(s.nodeName.toLowerCase()){case"style":break;case"link":r=await iu(s.href,{method:"GET",responseType:"text"});break}r=r.replace(/\/\/.+?(?=\n|\r|$)|\/\*[\s\S]+?\*\//g,"").replace(/@[^{};]*;|@[^{};]*\{[^}]*\}/g,"").replace(/[\\n\n]+(?<=[\\n\n]+)\s+/g,""),n.push(r)}return n}async function Zy(){const n={},t=await ou();for(let e=0,i=t.length;e<i;e++){const r=t[e].match(/[^{]*{[^}]*}/g);if(r)for(let o=0,a=r.length;o<a;o++){const c=r[o].split(/[{}]/g),h=c[0].trim(),u=c[1].split(";");for(let d=0;d<u.length;d++)if(u[d].trim()!=""){const f=u[d].split(":"),p=f[0].trim().toLowerCase(),m=f[1];n[p]||(n[p]=new Ky(p)),m&&n[p].add(h,m.trim())}}}return n}function Ke(n,t,e){if(t===void 0&&e===void 0)return Jo(n);if(typeof t=="string"&&e===void 0)return au(n,t);typeof t=="object"?Gr(n,i=>{for(const s in t)s=="style"?jn(n,s,t[s]):Object.prototype.hasOwnProperty.call(t,s)&&(i.props[s]=""+t[s])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?jn(n,t,e):Gr(n,i=>{i.props[t]=""+e})),yh()}function Jo(n){const t={};for(let e=0,i=n.attributes,s=i.length;e<s;e++){const r=i[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Ho(n,!0):t[r.nodeName]=r.nodeValue)}return t}function au(n,t){return t==="style"?Ho(n,!0):n.getAttribute(Ct(t))}function Sn(n,t,e){return n.setAttribute(Ct(t),""+e)}function Qy(n,t){t.split(/[,\s]+/i).forEach(e=>{const i=Ct(e.trim());i!=""&&n.removeAttribute(i)})}function cu(n,t){for(const e in t){const i=t[e];switch(e){case"fill":i!=="none"&&(n.fillStyle=i);break;case"stroke":i!=="none"&&(n.strokeStyle=i);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(i);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=i;break;case"stroke-linejoin":case"strokeLinejoin":switch(i){case"round":case"bevel":case"miter":n.lineJoin=i;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(i);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(i);break;case"stroke-dasharray":case"strokeDasharray":typeof i=="string"&&n.setLineDash(i.split(/\s+/).map(s=>Number(s)));break;case"cursor":break;case"font":typeof i=="string"&&(n.font=i);break;case"font-size":case"fontSize":n.font+=` ${i}`;break;case"font-family":case"fontFamily":n.font+=` ${i}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(i){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=i;break;default:n.textBaseline="alphabetic";break}break}}}var Ko=function(n,t){return Ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])},Ko(n,t)};function xe(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ko(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function t1(n,t,e,i){function s(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(l){try{h(i.next(l))}catch(u){o(u)}}function c(l){try{h(i.throw(l))}catch(u){o(u)}}function h(l){l.done?r(l.value):s(l.value).then(a,c)}h((i=i.apply(n,t||[])).next())})}function hu(n,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return c([h,l])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(e=0)),e;)try{if(i=1,s&&(r=h[0]&2?s.return:h[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,h[1])).done)return r;switch(s=0,r&&(h=[h[0]&2,r.value]),h[0]){case 0:case 1:r=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,s=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(h[0]===6||h[0]===2)){e=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){e.label=h[1];break}if(h[0]===6&&e.label<r[1]){e.label=r[1],r=h;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(h);break}r[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(n,e)}catch(l){h=[6,l],s=0}finally{i=r=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Cn(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ke(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var i=e.call(n),s,r=[],o;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)r.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return r}function Ze(n,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,r;i<s;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return n.concat(r||Array.prototype.slice.call(t))}function Wn(n){return this instanceof Wn?(this.v=n,this):new Wn(n)}function e1(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),s,r=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(p){return Promise.resolve(p).then(f,u)}}function a(f,p){i[f]&&(s[f]=function(m){return new Promise(function(v,y){r.push([f,m,v,y])>1||c(f,m)})},p&&(s[f]=p(s[f])))}function c(f,p){try{h(i[f](p))}catch(m){d(r[0][3],m)}}function h(f){f.value instanceof Wn?Promise.resolve(f.value.v).then(l,u):d(r[0][2],f)}function l(f){c("next",f)}function u(f){c("throw",f)}function d(f,p){f(p),r.shift(),r.length&&c(r[0][0],r[0][1])}}function n1(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Cn=="function"?Cn(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=n[r]&&function(o){return new Promise(function(a,c){o=n[r](o),s(a,c,o.done,o.value)})}}function s(r,o,a,c){Promise.resolve(c).then(function(h){r({value:h,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function nt(n){return typeof n=="function"}function Zo(n){var t=function(i){Error.call(i),i.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Qo=Zo(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
29
+ `,t}function su(n){const t=[];for(let e=0,i=qc.length;e<i;e++){const s=Ct(qc[e]+n);t.push(s)}return t}function wi(n,t,e){const i=gh(n);return i.props.style=i.props.style||{},t?i.props.style[t]||i.props.style[zh(t)]||i.props.style[Ct(t)]||"":i.props.style}function jn(n,t,e){Gr(n,i=>{i.props.style=i.props.style||{},typeof t=="string"&&e?i.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(s=>{i.props.style[s]=t[s]})}),yh()}function Ho(n,t=!1){const e={};if(!t)if(getComputedStyle){const i=getComputedStyle(n);for(let s=0,r=i.length;s<r;s++){const o=i[s];e[o]=i.getPropertyValue(o)}}else{const i=n.style||n.currentStyle;for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return n.style.cssText&&n.style.cssText.split(";").filter(i=>!!i).forEach(i=>{const[s,r]=i.split(":").map(o=>o.trim());s&&r&&(e[s]=r)}),e}function Hy(n,t){const e=su(t),i=e.length;let s="";for(let r=0;r<i;r++){const o=e[r];if(s=n[o]||"",s)return s}return s}function qy(n,t,e){const i=su(t),s=i.length;let r="";for(let o=0;o<s;o++){const a=i[o];if(r="style"in n&&n.style[a]||"currentStyle"in n&&n.currentStyle[a]||"",r)return r}if(getComputedStyle){const o=getComputedStyle(n,e);for(let a=0;a<s;a++){const c=i[a];if(r=o.getPropertyValue(c).trim(),r)return r}}return r}function vi(n,t,e){if(t)if(typeof t=="string"&&e)try{n.style.setProperty(t,e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":"")}catch{n.style[t]=e}else t instanceof Object&&Object.keys(t).forEach(i=>{vi(n,i,t[i])})}function qo(n,t){typeof t=="string"?n.style.removeProperty(Ct(t)):Object.keys(t).forEach(e=>{qo(n,e)})}function ru(n,t){if(!document)return()=>{};let e;if(typeof t=="string"){const i=document.querySelector(t)?.shadowRoot;i?e=i:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const i=document.createElement("style");return i.innerHTML=n,e.appendChild(i),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(i)}}else{const i=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(i)}}}class Jy{selector;name;value;constructor(t,e,i){this.selector=t,this.name=e,this.value=i}toString(){return`${this.selector} { ${this.name}: ${this.value} }`}}class Ky{propertyName;values=[];constructor(t){this.propertyName=t}add(t,e){this.values.push(new Jy(t,this.propertyName,e))}}async function ou(){const n=[],t=document.querySelectorAll("style, link");for(let e=0,i=t.length;e<i;e++){const s=t[e];let r=s.innerHTML;switch(s.nodeName.toLowerCase()){case"style":break;case"link":r=await iu(s.href,{method:"GET",responseType:"text"});break}r=r.replace(/\/\/.+?(?=\n|\r|$)|\/\*[\s\S]+?\*\//g,"").replace(/@[^{};]*;|@[^{};]*\{[^}]*\}/g,"").replace(/[\\n\n]+(?<=[\\n\n]+)\s+/g,""),n.push(r)}return n}async function Zy(){const n={},t=await ou();for(let e=0,i=t.length;e<i;e++){const r=t[e].match(/[^{]*{[^}]*}/g);if(r)for(let o=0,a=r.length;o<a;o++){const c=r[o].split(/[{}]/g),h=c[0].trim(),u=c[1].split(";");for(let d=0;d<u.length;d++)if(u[d].trim()!=""){const f=u[d].split(":"),p=f[0].trim().toLowerCase(),m=f[1];n[p]||(n[p]=new Ky(p)),m&&n[p].add(h,m.trim())}}}return n}function Ke(n,t,e){if(t===void 0&&e===void 0)return Jo(n);if(typeof t=="string"&&e===void 0)return au(n,t);typeof t=="object"?Gr(n,i=>{for(const s in t)s=="style"?jn(n,s,t[s]):Object.prototype.hasOwnProperty.call(t,s)&&(i.props[s]=""+t[s])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?jn(n,t,e):Gr(n,i=>{i.props[t]=""+e})),yh()}function Jo(n){const t={};for(let e=0,i=n.attributes,s=i.length;e<s;e++){const r=i[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Ho(n,!0):t[r.nodeName]=r.nodeValue)}return t}function au(n,t){return t==="style"?Ho(n,!0):n.getAttribute(Ct(t))}function Sn(n,t,e){return n.setAttribute(Ct(t),""+e)}function Qy(n,t){t.split(/[,\s]+/i).forEach(e=>{const i=Ct(e.trim());i!=""&&n.removeAttribute(i)})}function cu(n,t){for(const e in t){const i=t[e];switch(e){case"fill":i!=="none"&&(n.fillStyle=i);break;case"stroke":i!=="none"&&(n.strokeStyle=i);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(i);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=i;break;case"stroke-linejoin":case"strokeLinejoin":switch(i){case"round":case"bevel":case"miter":n.lineJoin=i;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(i);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(i);break;case"stroke-dasharray":case"strokeDasharray":typeof i=="string"&&n.setLineDash(i.split(/\s+/).map(s=>Number(s)));break;case"cursor":break;case"font":typeof i=="string"&&(n.font=i);break;case"font-size":case"fontSize":n.font+=` ${i}`;break;case"font-family":case"fontFamily":n.font+=` ${i}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(i){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=i;break;default:n.textBaseline="alphabetic";break}break}}}var Ko=function(n,t){return Ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])},Ko(n,t)};function xe(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ko(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function t1(n,t,e,i){function s(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(l){try{h(i.next(l))}catch(u){o(u)}}function c(l){try{h(i.throw(l))}catch(u){o(u)}}function h(l){l.done?r(l.value):s(l.value).then(a,c)}h((i=i.apply(n,t||[])).next())})}function hu(n,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(l){return c([h,l])}}function c(h){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(e=0)),e;)try{if(i=1,s&&(r=h[0]&2?s.return:h[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,h[1])).done)return r;switch(s=0,r&&(h=[h[0]&2,r.value]),h[0]){case 0:case 1:r=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,s=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(h[0]===6||h[0]===2)){e=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){e.label=h[1];break}if(h[0]===6&&e.label<r[1]){e.label=r[1],r=h;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(h);break}r[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(n,e)}catch(l){h=[6,l],s=0}finally{i=r=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Cn(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],i=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ke(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var i=e.call(n),s,r=[],o;try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)r.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return r}function Ze(n,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,r;i<s;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return n.concat(r||Array.prototype.slice.call(t))}function Wn(n){return this instanceof Wn?(this.v=n,this):new Wn(n)}function e1(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(n,t||[]),s,r=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(f){return function(p){return Promise.resolve(p).then(f,u)}}function a(f,p){i[f]&&(s[f]=function(m){return new Promise(function(v,y){r.push([f,m,v,y])>1||c(f,m)})},p&&(s[f]=p(s[f])))}function c(f,p){try{h(i[f](p))}catch(m){d(r[0][3],m)}}function h(f){f.value instanceof Wn?Promise.resolve(f.value.v).then(l,u):d(r[0][2],f)}function l(f){c("next",f)}function u(f){c("throw",f)}function d(f,p){f(p),r.shift(),r.length&&c(r[0][0],r[0][1])}}function n1(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof Cn=="function"?Cn(n):n[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(r){e[r]=n[r]&&function(o){return new Promise(function(a,c){o=n[r](o),s(a,c,o.done,o.value)})}}function s(r,o,a,c){Promise.resolve(c).then(function(h){r({value:h,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function nt(n){return typeof n=="function"}function Zo(n){var t=function(i){Error.call(i),i.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Qo=Zo(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
30
30
  `+e.map(function(i,s){return s+1+") "+i.toString()}).join(`
31
31
  `):"",this.name="UnsubscriptionError",this.errors=e}});function xi(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var Hn=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,i,s,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Cn(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(nt(l))try{l()}catch(m){r=m instanceof Qo?m.errors:[m]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Cn(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{fu(p)}catch(m){r=r??[],m instanceof Qo?r=Ze(Ze([],ke(r)),ke(m.errors)):r.push(m)}}}catch(m){i={error:m}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}}if(r)throw new Qo(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)fu(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&xi(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&xi(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}(),lu=Hn.EMPTY;function uu(n){return n instanceof Hn||n&&"closed"in n&&nt(n.remove)&&nt(n.add)&&nt(n.unsubscribe)}function fu(n){nt(n)?n():n.unsubscribe()}var du={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ta={setTimeout:function(n,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var s=ta.delegate;return s?.setTimeout?s.setTimeout.apply(s,Ze([n,t],ke(e))):setTimeout.apply(void 0,Ze([n,t],ke(e)))},clearTimeout:function(n){var t=ta.delegate;return(t?.clearTimeout||clearTimeout)(n)},delegate:void 0};function mu(n){ta.setTimeout(function(){throw n})}function _i(){}function Ls(n){n()}var ea=function(n){xe(t,n);function t(e){var i=n.call(this)||this;return i.isStopped=!1,e?(i.destination=e,uu(e)&&e.add(i)):i.destination=o1,i}return t.create=function(e,i,s){return new qn(e,i,s)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Hn),i1=Function.prototype.bind;function na(n,t){return i1.call(n,t)}var s1=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(i){zs(i)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(i){zs(i)}else zs(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){zs(e)}},n}(),qn=function(n){xe(t,n);function t(e,i,s){var r=n.call(this)||this,o;if(nt(e)||!e)o={next:e??void 0,error:i??void 0,complete:s??void 0};else{var a;r&&du.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&na(e.next,a),error:e.error&&na(e.error,a),complete:e.complete&&na(e.complete,a)}):o=e}return r.destination=new s1(o),r}return t}(ea);function zs(n){mu(n)}function r1(n){throw n}var o1={closed:!0,next:_i,error:r1,complete:_i},ia=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function En(n){return n}function a1(n){return n.length===0?En:n.length===1?n[0]:function(e){return n.reduce(function(i,s){return s(i)},e)}}var ft=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,i){var s=this,r=h1(t)?t:new qn(t,e,i);return Ls(function(){var o=s,a=o.operator,c=o.source;r.add(a?a.call(r,c):c?s._subscribe(r):s._trySubscribe(r))}),r},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var i=this;return e=pu(e),new e(function(s,r){var o=new qn({next:function(a){try{t(a)}catch(c){r(c),o.unsubscribe()}},error:r,complete:s});i.subscribe(o)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[ia]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return a1(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=pu(t),new t(function(i,s){var r;e.subscribe(function(o){return r=o},function(o){return s(o)},function(){return i(r)})})},n.create=function(t){return new n(t)},n}();function pu(n){var t;return(t=n??du.Promise)!==null&&t!==void 0?t:Promise}function c1(n){return n&&nt(n.next)&&nt(n.error)&&nt(n.complete)}function h1(n){return n&&n instanceof ea||c1(n)&&uu(n)}function l1(n){return nt(n?.lift)}function Ft(n){return function(t){if(l1(t))return t.lift(function(e){try{return n(e,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function wt(n,t,e,i,s){return new u1(n,t,e,i,s)}var u1=function(n){xe(t,n);function t(e,i,s,r,o,a){var c=n.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=i?function(h){try{i(h)}catch(l){e.error(l)}}:n.prototype._next,c._error=r?function(h){try{r(h)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,c._complete=s?function(){try{s()}catch(h){e.error(h)}finally{this.unsubscribe()}}:n.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;n.prototype.unsubscribe.call(this),!i&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(ea),f1=Zo(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Re=function(n){xe(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var i=new gu(this,this);return i.operator=e,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new f1},t.prototype.next=function(e){var i=this;Ls(function(){var s,r;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var o=Cn(i.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){s={error:h}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}}})},t.prototype.error=function(e){var i=this;Ls(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=e;for(var s=i.observers;s.length;)s.shift().error(e)}})},t.prototype.complete=function(){var e=this;Ls(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var i=e.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var i=this,s=this,r=s.hasError,o=s.isStopped,a=s.observers;return r||o?lu:(this.currentObservers=null,a.push(e),new Hn(function(){i.currentObservers=null,xi(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var i=this,s=i.hasError,r=i.thrownError,o=i.isStopped;s?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new ft;return e.source=this,e},t.create=function(e,i){return new gu(e,i)},t}(ft),gu=function(n){xe(t,n);function t(e,i){var s=n.call(this)||this;return s.destination=e,s.source=i,s}return t.prototype.next=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.next)===null||s===void 0||s.call(i,e)},t.prototype.error=function(e){var i,s;(s=(i=this.destination)===null||i===void 0?void 0:i.error)===null||s===void 0||s.call(i,e)},t.prototype.complete=function(){var e,i;(i=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||i===void 0||i.call(e)},t.prototype._subscribe=function(e){var i,s;return(s=(i=this.source)===null||i===void 0?void 0:i.subscribe(e))!==null&&s!==void 0?s:lu},t}(Re),Ns=function(n){xe(t,n);function t(e){var i=n.call(this)||this;return i._value=e,i}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var i=n.prototype._subscribe.call(this,e);return!i.closed&&e.next(this._value),i},t.prototype.getValue=function(){var e=this,i=e.hasError,s=e.thrownError,r=e._value;if(i)throw s;return this._throwIfClosed(),r},t.prototype.next=function(e){n.prototype.next.call(this,this._value=e)},t}(Re),sa={now:function(){return(sa.delegate||Date).now()},delegate:void 0},d1=function(n){xe(t,n);function t(e,i,s){e===void 0&&(e=1/0),i===void 0&&(i=1/0),s===void 0&&(s=sa);var r=n.call(this)||this;return r._bufferSize=e,r._windowTime=i,r._timestampProvider=s,r._buffer=[],r._infiniteTimeWindow=!0,r._infiniteTimeWindow=i===1/0,r._bufferSize=Math.max(1,e),r._windowTime=Math.max(1,i),r}return t.prototype.next=function(e){var i=this,s=i.isStopped,r=i._buffer,o=i._infiniteTimeWindow,a=i._timestampProvider,c=i._windowTime;s||(r.push(e),!o&&r.push(a.now()+c)),this._trimBuffer(),n.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var i=this._innerSubscribe(e),s=this,r=s._infiniteTimeWindow,o=s._buffer,a=o.slice(),c=0;c<a.length&&!e.closed;c+=r?1:2)e.next(a[c]);return this._checkFinalizedStatuses(e),i},t.prototype._trimBuffer=function(){var e=this,i=e._bufferSize,s=e._timestampProvider,r=e._buffer,o=e._infiniteTimeWindow,a=(o?1:2)*i;if(i<1/0&&a<r.length&&r.splice(0,r.length-a),!o){for(var c=s.now(),h=0,l=1;l<r.length&&r[l]<=c;l+=2)h=l;h&&r.splice(0,h+1)}},t}(Re),m1=function(n){xe(t,n);function t(e,i){return n.call(this)||this}return t.prototype.schedule=function(e,i){return this},t}(Hn),Fs={setInterval:function(n,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];var s=Fs.delegate;return s?.setInterval?s.setInterval.apply(s,Ze([n,t],ke(e))):setInterval.apply(void 0,Ze([n,t],ke(e)))},clearInterval:function(n){var t=Fs.delegate;return(t?.clearInterval||clearInterval)(n)},delegate:void 0},p1=function(n){xe(t,n);function t(e,i){var s=n.call(this,e,i)||this;return s.scheduler=e,s.work=i,s.pending=!1,s}return t.prototype.schedule=function(e,i){var s;if(i===void 0&&(i=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,i)),this.pending=!0,this.delay=i,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,i),this},t.prototype.requestAsyncId=function(e,i,s){return s===void 0&&(s=0),Fs.setInterval(e.flush.bind(e,this),s)},t.prototype.recycleAsyncId=function(e,i,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return i;i!=null&&Fs.clearInterval(i)},t.prototype.execute=function(e,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(e,i);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,i){var s=!1,r;try{this.work(e)}catch(o){s=!0,r=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,i=e.id,s=e.scheduler,r=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,xi(r,this),i!=null&&(this.id=this.recycleAsyncId(s,i,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},t}(m1),yu=function(){function n(t,e){e===void 0&&(e=n.now),this.schedulerActionCtor=t,this.now=e}return n.prototype.schedule=function(t,e,i){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(i,e)},n.now=sa.now,n}(),g1=function(n){xe(t,n);function t(e,i){i===void 0&&(i=yu.now);var s=n.call(this,e,i)||this;return s.actions=[],s._active=!1,s}return t.prototype.flush=function(e){var i=this.actions;if(this._active){i.push(e);return}var s;this._active=!0;do if(s=e.execute(e.state,e.delay))break;while(e=i.shift());if(this._active=!1,s){for(;e=i.shift();)e.unsubscribe();throw s}},t}(yu),ra=new g1(p1),y1=ra,bu=new ft(function(n){return n.complete()});function wu(n){return n&&nt(n.schedule)}function oa(n){return n[n.length-1]}function b1(n){return nt(oa(n))?n.pop():void 0}function Si(n){return wu(oa(n))?n.pop():void 0}function w1(n,t){return typeof oa(n)=="number"?n.pop():t}var aa=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function vu(n){return nt(n?.then)}function xu(n){return nt(n[ia])}function _u(n){return Symbol.asyncIterator&&nt(n?.[Symbol.asyncIterator])}function Su(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function v1(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Cu=v1();function Eu(n){return nt(n?.[Cu])}function Tu(n){return e1(this,arguments,function(){var e,i,s,r;return hu(this,function(o){switch(o.label){case 0:e=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Wn(e.read())];case 3:return i=o.sent(),s=i.value,r=i.done,r?[4,Wn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Wn(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Pu(n){return nt(n?.getReader)}function xt(n){if(n instanceof ft)return n;if(n!=null){if(xu(n))return x1(n);if(aa(n))return _1(n);if(vu(n))return S1(n);if(_u(n))return Au(n);if(Eu(n))return C1(n);if(Pu(n))return E1(n)}throw Su(n)}function x1(n){return new ft(function(t){var e=n[ia]();if(nt(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function _1(n){return new ft(function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}function S1(n){return new ft(function(t){n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,mu)})}function C1(n){return new ft(function(t){var e,i;try{for(var s=Cn(n),r=s.next();!r.done;r=s.next()){var o=r.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}t.complete()})}function Au(n){return new ft(function(t){T1(n,t).catch(function(e){return t.error(e)})})}function E1(n){return Au(Tu(n))}function T1(n,t){var e,i,s,r;return t1(this,void 0,void 0,function(){var o,a;return hu(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),e=n1(n),c.label=1;case 1:return[4,e.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(o=i.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),s={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Le(n,t,e,i,s){i===void 0&&(i=0),s===void 0&&(s=!1);var r=t.schedule(function(){e(),s?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(r),!s)return r}function Mu(n,t){return t===void 0&&(t=0),Ft(function(e,i){e.subscribe(wt(i,function(s){return Le(i,n,function(){return i.next(s)},t)},function(){return Le(i,n,function(){return i.complete()},t)},function(s){return Le(i,n,function(){return i.error(s)},t)}))})}function ca(n,t){return t===void 0&&(t=0),Ft(function(e,i){i.add(n.schedule(function(){return e.subscribe(i)},t))})}function P1(n,t){return xt(n).pipe(ca(t),Mu(t))}function A1(n,t){return xt(n).pipe(ca(t),Mu(t))}function M1(n,t){return new ft(function(e){var i=0;return t.schedule(function(){i===n.length?e.complete():(e.next(n[i++]),e.closed||this.schedule())})})}function D1(n,t){return new ft(function(e){var i;return Le(e,t,function(){i=n[Cu](),Le(e,t,function(){var s,r,o;try{s=i.next(),r=s.value,o=s.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return nt(i?.return)&&i.return()}})}function Du(n,t){if(!n)throw new Error("Iterable cannot be null");return new ft(function(e){Le(e,t,function(){var i=n[Symbol.asyncIterator]();Le(e,t,function(){i.next().then(function(s){s.done?e.complete():e.next(s.value)})},0,!0)})})}function I1(n,t){return Du(Tu(n),t)}function O1(n,t){if(n!=null){if(xu(n))return P1(n,t);if(aa(n))return M1(n,t);if(vu(n))return A1(n,t);if(_u(n))return Du(n,t);if(Eu(n))return D1(n,t);if(Pu(n))return I1(n,t)}throw Su(n)}function Ci(n,t){return t?O1(n,t):xt(n)}function k1(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Si(n);return Ci(n,e)}var R1=Zo(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function L1(n,t){var e=typeof t=="object";return new Promise(function(i,s){var r=new qn({next:function(o){i(o),r.unsubscribe()},error:s,complete:function(){e?i(t.defaultValue):s(new R1)}});n.subscribe(r)})}function z1(n){return n instanceof Date&&!isNaN(n)}function dt(n,t){return Ft(function(e,i){var s=0;e.subscribe(wt(i,function(r){i.next(n.call(t,r,s++))}))})}var N1=Array.isArray;function F1(n,t){return N1(t)?n.apply(void 0,Ze([],ke(t))):n(t)}function ha(n){return dt(function(t){return F1(n,t)})}var B1=Array.isArray,U1=Object.getPrototypeOf,V1=Object.prototype,Y1=Object.keys;function $1(n){if(n.length===1){var t=n[0];if(B1(t))return{args:t,keys:null};if(G1(t)){var e=Y1(t);return{args:e.map(function(i){return t[i]}),keys:e}}}return{args:n,keys:null}}function G1(n){return n&&typeof n=="object"&&U1(n)===V1}function X1(n,t){return n.reduce(function(e,i,s){return e[i]=t[s],e},{})}function j1(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Si(n),i=b1(n),s=$1(n),r=s.args,o=s.keys;if(r.length===0)return Ci([],e);var a=new ft(W1(r,e,o?function(c){return X1(o,c)}:En));return i?a.pipe(ha(i)):a}function W1(n,t,e){return e===void 0&&(e=En),function(i){Iu(t,function(){for(var s=n.length,r=new Array(s),o=s,a=s,c=function(l){Iu(t,function(){var u=Ci(n[l],t),d=!1;u.subscribe(wt(i,function(f){r[l]=f,d||(d=!0,a--),a||i.next(e(r.slice()))},function(){--o||i.complete()}))},i)},h=0;h<s;h++)c(h)},i)}}function Iu(n,t,e){n?Le(e,n,t):t()}function H1(n,t,e,i,s,r,o,a){var c=[],h=0,l=0,u=!1,d=function(){u&&!c.length&&!h&&t.complete()},f=function(m){return h<i?p(m):c.push(m)},p=function(m){r&&t.next(m),h++;var v=!1;xt(e(m,l++)).subscribe(wt(t,function(y){s?.(y),r?f(y):t.next(y)},function(){v=!0},void 0,function(){if(v)try{h--;for(var y=function(){var b=c.shift();o?Le(t,o,function(){return p(b)}):p(b)};c.length&&h<i;)y();d()}catch(b){t.error(b)}}))};return n.subscribe(wt(t,f,function(){u=!0,d()})),function(){a?.()}}function la(n,t,e){return e===void 0&&(e=1/0),nt(t)?la(function(i,s){return dt(function(r,o){return t(i,r,s,o)})(xt(n(i,s)))},e):(typeof t=="number"&&(e=t),Ft(function(i,s){return H1(i,s,n,e)}))}function Ou(n){return n===void 0&&(n=1/0),la(En,n)}function q1(){return Ou(1)}function ku(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return q1()(Ci(n,Si(n)))}var J1=["addListener","removeListener"],K1=["addEventListener","removeEventListener"],Z1=["on","off"];function ua(n,t,e,i){if(nt(e)&&(i=e,e=void 0),i)return ua(n,t,e).pipe(ha(i));var s=ke(eb(n)?K1.map(function(a){return function(c){return n[a](t,c,e)}}):Q1(n)?J1.map(Ru(n,t)):tb(n)?Z1.map(Ru(n,t)):[],2),r=s[0],o=s[1];if(!r&&aa(n))return la(function(a){return ua(a,t,e)})(xt(n));if(!r)throw new TypeError("Invalid event target");return new ft(function(a){var c=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];return a.next(1<h.length?h:h[0])};return r(c),function(){return o(c)}})}function Ru(n,t){return function(e){return function(i){return n[e](t,i)}}}function Q1(n){return nt(n.addListener)&&nt(n.removeListener)}function tb(n){return nt(n.on)&&nt(n.off)}function eb(n){return nt(n.addEventListener)&&nt(n.removeEventListener)}function ut(n,t,e){return e?ut(n,t).pipe(ha(e)):new ft(function(i){var s=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return i.next(o.length===1?o[0]:o)},r=n(s);return nt(t)?function(){return t(s,r)}:void 0})}function nb(n,t,e){n===void 0&&(n=0),e===void 0&&(e=y1);var i=-1;return t!=null&&(wu(t)?e=t:i=t),new ft(function(s){var r=z1(n)?+n-e.now():n;r<0&&(r=0);var o=0;return e.schedule(function(){s.closed||(s.next(o++),0<=i?this.schedule(void 0,i):s.complete())},r)})}function Bs(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Si(n),i=w1(n,1/0),s=n;return s.length?s.length===1?xt(s[0]):Ou(i)(Ci(s,e)):bu}var ib=Array.isArray;function sb(n){return n.length===1&&ib(n[0])?n[0]:n}function fa(n,t){return Ft(function(e,i){var s=0;e.subscribe(wt(i,function(r){return n.call(t,r,s++)&&i.next(r)}))})}function Us(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n=sb(n),n.length===1?xt(n[0]):new ft(rb(n))}function rb(n){return function(t){for(var e=[],i=function(r){e.push(xt(n[r]).subscribe(wt(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==r&&e[a].unsubscribe();e=null}t.next(o)})))},s=0;e&&!t.closed&&s<n.length;s++)i(s)}}function Lu(n){return Ft(function(t,e){var i=null,s=!1,r;i=t.subscribe(wt(e,void 0,void 0,function(o){r=xt(n(o,Lu(n)(t))),i?(i.unsubscribe(),i=null,r.subscribe(e)):s=!0})),s&&(i.unsubscribe(),i=null,r.subscribe(e))})}function Qe(n,t){return t===void 0&&(t=En),n=n??ob,Ft(function(e,i){var s,r=!0;e.subscribe(wt(i,function(o){var a=t(o);(r||!n(s,a))&&(r=!1,s=a,i.next(o))}))})}function ob(n,t){return n===t}function zu(n,t){return t?function(e){return e.pipe(zu(function(i,s){return xt(n(i,s)).pipe(dt(function(r,o){return t(i,r,s,o)}))}))}:Ft(function(e,i){var s=0,r=null,o=!1;e.subscribe(wt(i,function(a){r||(r=wt(i,void 0,function(){r=null,o&&i.complete()}),xt(n(a,s++)).subscribe(r))},function(){o=!0,!r&&i.complete()}))})}function ab(n){n===void 0&&(n={});var t=n.connector,e=t===void 0?function(){return new Re}:t,i=n.resetOnError,s=i===void 0?!0:i,r=n.resetOnComplete,o=r===void 0?!0:r,a=n.resetOnRefCountZero,c=a===void 0?!0:a;return function(h){var l,u,d,f=0,p=!1,m=!1,v=function(){u?.unsubscribe(),u=void 0},y=function(){v(),l=d=void 0,p=m=!1},b=function(){var x=l;y(),x?.unsubscribe()};return Ft(function(x,w){f++,!m&&!p&&v();var C=d=d??e();w.add(function(){f--,f===0&&!m&&!p&&(u=da(b,c))}),C.subscribe(w),!l&&f>0&&(l=new qn({next:function(S){return C.next(S)},error:function(S){m=!0,v(),u=da(y,s,S),C.error(S)},complete:function(){p=!0,v(),u=da(y,o),C.complete()}}),xt(x).subscribe(l))})(h)}}function da(n,t){for(var e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];if(t===!0){n();return}if(t!==!1){var s=new qn({next:function(){s.unsubscribe(),n()}});return xt(t.apply(void 0,Ze([],ke(e)))).subscribe(s)}}function Nu(n,t,e){var i,s,r,o,a=!1;return n&&typeof n=="object"?(i=n.bufferSize,o=i===void 0?1/0:i,s=n.windowTime,t=s===void 0?1/0:s,r=n.refCount,a=r===void 0?!1:r,e=n.scheduler):o=n??1/0,ab({connector:function(){return new d1(o,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function Tn(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Si(n);return Ft(function(i,s){(e?ku(n,i,e):ku(n,i)).subscribe(s)})}function Vs(n,t){return Ft(function(e,i){var s=null,r=0,o=!1,a=function(){return o&&!s&&i.complete()};e.subscribe(wt(i,function(c){s?.unsubscribe();var h=0,l=r++;xt(n(c,l)).subscribe(s=wt(i,function(u){return i.next(t?t(c,u,l,h++):u)},function(){s=null,a()}))},function(){o=!0,a()}))})}function cb(){return Vs(En)}function ma(n){return Ft(function(t,e){xt(n).subscribe(wt(e,function(){return e.complete()},_i)),!e.closed&&t.subscribe(e)})}function Pn(n,t,e){var i=nt(n)||t||e?{next:n,error:t,complete:e}:n;return i?Ft(function(s,r){var o;(o=i.subscribe)===null||o===void 0||o.call(i);var a=!0;s.subscribe(wt(r,function(c){var h;(h=i.next)===null||h===void 0||h.call(i,c),r.next(c)},function(){var c;a=!1,(c=i.complete)===null||c===void 0||c.call(i),r.complete()},function(c){var h;a=!1,(h=i.error)===null||h===void 0||h.call(i,c),r.error(c)},function(){var c,h;a&&((c=i.unsubscribe)===null||c===void 0||c.call(i)),(h=i.finalize)===null||h===void 0||h.call(i)}))}):En}function hb(n,t){return Ft(function(e,i){var s=t??{},r=s.leading,o=r===void 0?!0:r,a=s.trailing,c=a===void 0?!1:a,h=!1,l=null,u=null,d=!1,f=function(){u?.unsubscribe(),u=null,c&&(v(),d&&i.complete())},p=function(){u=null,d&&i.complete()},m=function(y){return u=xt(n(y)).subscribe(wt(i,f,p))},v=function(){if(h){h=!1;var y=l;l=null,i.next(y),!d&&m(y)}};e.subscribe(wt(i,function(y){h=!0,l=y,!(u&&!u.closed)&&(o?v():m(y))},function(){d=!0,!(c&&h&&u&&!u.closed)&&i.complete()}))})}function lb(n,t,e){t===void 0&&(t=ra);var i=nb(n,t);return hb(function(){return i},e)}function ub(n,t){return Ft(function(e,i){var s=[],r=function(o){for(;0<s.length;)s.shift().error(o);i.error(o)};xt(n).subscribe(wt(i,function(o){var a=new Re;s.push(a);var c=new Hn,h=function(){xi(s,a),a.complete(),c.unsubscribe()},l;try{l=xt(t(o))}catch(u){r(u);return}i.next(a.asObservable()),c.add(l.subscribe(wt(i,h,_i,r)))},_i)),e.subscribe(wt(i,function(o){var a,c,h=s.slice();try{for(var l=Cn(h),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(o)}}catch(f){a={error:f}}finally{try{u&&!u.done&&(c=l.return)&&c.call(l)}finally{if(a)throw a.error}}},function(){for(;0<s.length;)s.shift().complete();i.complete()},r,function(){for(;0<s.length;)s.shift().unsubscribe()}))})}function fb(n){return n.toElement?n.toElement:n.currentTarget?n.currentTarget:n.srcElement?n.srcElement:null}function it(n,t,e,i=!1){const s=async r=>{await e(r)};try{n.addEventListener(t,s,i)}catch{n.attachEvent("on"+t,s)}return()=>{try{n.removeEventListener(t,s,i)}catch{n.detachEvent("on"+t,s)}}}function db(n,t,e,i,s=!1){return it(n||document.body,e,r=>{r.target===t&&i(r)},s)}function mb(n){n.replaceWith(n.cloneNode(!0))}function $(n,t,e=!1){return ua(n,t,{capture:e})}function pb(n){const t=ut(e=>n.register(e),(e,i)=>{n.unregister?.(e,...i||[])},(...e)=>[...e]);return n.share?t.pipe(Nu({bufferSize:n.bufferSize||1,refCount:!0})):t}function Fu(n){if(n.stopPropagation){n.stopPropagation();return}try{n.cancelBubble=!0}catch{}}function tn(n){if(n.preventDefault){n.preventDefault();return}try{n.returnValue=!1}catch{}}const gb=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],yb=["keydown","keyup","keypress"],bb=["touchstart","touchend","touchcancel","touchmove"],wb=["pointerdown","pointerup","pointercancel","pointermove"],vb=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],xb=["change"];function Ys(n,t={bubbles:!0,detail:{}}){let e;try{const i=Object.assign({bubbles:!0,cancelable:!0,view:window,detail:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},t);gb.includes(n)?e=new MouseEvent(n,i):yb.includes(n)?e=new KeyboardEvent(n,i):bb.includes(n)?e=new TouchEvent(n,i):wb.includes(n)?e=new PointerEvent(n,i):vb.includes(n)?e=new DragEvent(n,i):xb.includes(n)?e=new Event(n,i):e=new CustomEvent(n,i)}catch{document.createEvent?e=document.createEvent("Event").initEvent(n,!0,!0):document.createEventObject&&(e=document.createEventObject())}return e}function pa(n,t,e){if(n)if(n.dispatchEvent)n.dispatchEvent(e);else if(n.fireEvent&&document.createEventObject)n.fireEvent("on"+t,e);else throw new Error(`Can't dispatch event : ${t}`)}function _b(n,t){const e=n.target,i=Ys(t);pa(e,t,i)}function Sb(n){const t=n.target,e="click";if(!/(SELECT|INPUT|TEXTAREA)/i.test(t.tagName)){const i=Ys(e);i.view=n.view||window,i.detail=1,i.screenX=t.screenX||0,i.screenY=t.screenY||0,i.clientX=t.clientX||0,i.clientY=t.clientY||0,i.pageX=n.pageX,i.pageY=n.pageY,i.ctrlKey=!!n.ctrlKey,i.altKey=!!n.altKey,i.shiftKey=!!n.shiftKey,i.metaKey=!!n.metaKey,i.button=0,i.relatedTarget=null,i._constructed=!0,pa(t,e,i)}}function Cb(n,t){const e=n.changedTouches[0];return Ys(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Eb(n,t,e,i,s){const r=t/e;let o=0,a=0;switch(n){case"aspectFit":r>=1?(o=i,a=o/r,a>s&&(a=s,o=a*r)):(a=s,o=a*r,o>i&&(o=i,a=o/r));break;case"aspectFill":r>=1?(a=s,o=a*r):(o=i,a=o/r);break;case"widthFix":o=i,a=o/r;break;case"heightFix":a=s,o=a*r;break;case"scaleToFill":default:o=i,a=s;break}return{width:o,height:a}}function Bu(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const Tb=n=>{const t=n.width,e=n.height,i=t*e*3,s=i+54,r=[66,77,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,54,0,0,0],o=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,c=n.data;let h="";const l=t<<2;let u=e;const d=String.fromCharCode;do{const p=l*(u-1);let m="";for(let v=0;v<t;v++){const y=v<<2;m+=d(c[p+y+2])+d(c[p+y+1])+d(c[p+y])}for(let v=0;v<a;v++)m+=String.fromCharCode(0);h+=m}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let m="";if(typeof p=="string")m=p;else for(let v=0;v<p.length;v++)m+=String.fromCharCode(p[v]);return btoa(m)}return f(r.concat(o))+f(h)};function Pb(n){const{width:t,height:e}=n,i=document.createElement("canvas"),s=i.getContext("2d");return i.width=t,i.height=e,s.putImageData(n,0,0,0,0,t,e),i.toDataURL("image/png")}const Ab=(n,t,e)=>{const{width:i,height:s}=n,r=document.createElement("canvas"),o=r.getContext("2d");r.width=i,r.height=s,o.putImageData(n,0,0,0,0,i,s);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(c=>{e?.(null,c)},a,1)};function Mb(n,t){return createImageBitmap(n,t)}function Db(n){const t=[],e=[],i=[];let s=0;for(let c=0,h=n.data.length;c<h;c+=4)t[s]=n.data[c],e[s]=n.data[c+1],i[s]=n.data[c+2],s+=1;const r=ga(t),o=ga(e),a=ga(i);return"rgb("+r+","+o+","+a+")"}function ga(n){const t={},e=[],i=[];for(let a=0;a<n.length;a++)t[n[a]]?e.push(n[a]):t[n[a]]=1;let s=0;for(let a=0;a<e.length;a++){s=0;for(let c=0;c<e.length;c++)e[a]===e[c]&&(s+=1),i[a]=s}const r=Math.max.apply(null,i);let o=0;for(;o<i.length;o++)if(i[o]===r)return;return e[o]}const Ib=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=t[(o*e+e-a-1)*4],s[c+1]=t[(o*e+e-a-1)*4+1],s[c+2]=t[(o*e+e-a-1)*4+2],s[c+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(s,e,i)},Ob=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=t[((i-o-1)*e+a)*4],s[c+1]=t[((i-o-1)*e+a)*4+1],s[c+2]=t[((i-o-1)*e+a)*4+2],s[c+3]=t[((i-o-1)*e+a)*4+3]}return new ImageData(s,e,i)},kb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<i;a++){const c=(o*i+a)*4;s[c]=t[(a*e+e-o-1)*4],s[c+1]=t[(a*e+e-o-1)*4+1],s[c+2]=t[(a*e+e-o-1)*4+2],s[c+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(s,i,e)},Rb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<i;a++){const c=(o*i+a)*4;s[c]=t[((i-a-1)*e+o)*4],s[c+1]=t[((i-a-1)*e+o)*4+1],s[c+2]=t[((i-a-1)*e+o)*4+2],s[c+3]=t[((i-a-1)*e+o)*4+3]}return new ImageData(s,i,e)},Lb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+1]+t[c+2])/3;s[c]=h,s[c+1]=h,s[c+2]=h,s[c+3]=t[c+3]}return new ImageData(s,e,i)},zb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=.2126*t[c]+.7152*t[c+1]+.0722*t[c+2];s[c]=h,s[c+1]=h,s[c+2]=h,s[c+3]=t[c+3]}return new ImageData(s,e,i)},Nb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,l=(t[c]+t[c+1]+t[c+2])/3>127?255:0;s[c]=l,s[c+1]=l,s[c+2]=l,s[c+3]=t[c+3]}return new ImageData(s,e,i)},Fb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=255-t[c],s[c+1]=255-t[c+1],s[c+2]=255-t[c+2],s[c+3]=t[c+3]}return new ImageData(s,e,i)},Bb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=t[c],s[c+1]=0,s[c+2]=0,s[c+3]=t[c+3]}return new ImageData(s,e,i)},Ub=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=0,s[c+1]=t[c+1],s[c+2]=0,s[c+3]=t[c+3]}return new ImageData(s,e,i)},Vb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=0,s[c+1]=0,s[c+2]=t[c+2],s[c+3]=t[c+3]}return new ImageData(s,e,i)},Yb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=t[c],s[c+1]=t[c+1],s[c+2]=0,s[c+3]=t[c+3]}return new ImageData(s,e,i)},$b=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=t[c],s[c+1]=0,s[c+2]=t[c+1],s[c+3]=t[c+3]}return new ImageData(s,e,i)},Gb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=0,s[c+1]=t[c+1],s[c+2]=t[c+1],s[c+3]=t[c+3]}return new ImageData(s,e,i)},Xb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c+1]+t[c+2])/2;s[c]=t[c],s[c+1]=h,s[c+2]=h,s[c+3]=t[c+3]}return new ImageData(s,e,i)},jb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+2])/2;s[c]=h,s[c+1]=t[c+1],s[c+2]=h,s[c+3]=t[c+3]}return new ImageData(s,e,i)},Wb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+1])/2;s[c]=h,s[c+1]=h,s[c+2]=t[c+2],s[c+3]=t[c+3]}return new ImageData(s,e,i)},Hb=n=>Uu(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),qb=n=>Uu(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Jb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;s[c]=t[c],s[c+1]=t[c+1],s[c+2]=t[c+2],s[c+3]=255}return new ImageData(s,e,i)},Kb=n=>{const{data:t,width:e,height:i}=n,s=new Uint8ClampedArray(t.length);for(let o=0;o<i;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;if(t[c+3]===0)s[c]=255,s[c+1]=255,s[c+2]=255,s[c+3]=255;else{const h=Vu([t[c],t[c+1],t[c+2],t[c+3]],[255,255,255,255]);s[c]=h[0],s[c+1]=h[1],s[c+2]=h[2],s[c+3]=h[3]}}return new ImageData(s,e,i)};function Zb(n,t,e,i,s,r=!1,o){const{data:a,width:c,height:h}=n;let l=s,u=i,d=t,f=e;if(l<0?l=0:l>c&&(l=c),u<0?u=0:u>h&&(u=h),d<1?d=1:d>c&&(d=c),f<1?f=1:f>h&&(f=h),l+d>c&&(d=c-l),u+f>h&&(f=h-u),r){const p=new Uint8ClampedArray(a.length);for(let v=0;v<h;v++)for(let y=0;y<c;y++){const b=(v*c+y)*4;y>=l&&y<=l+d&&v>=u&&v<=u+f?(p[b]=a[b],p[b+1]=a[b+1],p[b+2]=a[b+2],p[b+3]=a[b+3]):(p[b]=255,p[b+1]=255,p[b+2]=255,p[b+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,c,h)}else{const p=new Uint8ClampedArray(d*f*4);for(let v=u;v<=u+f;v++)for(let y=l;y<=l+d;y++){const b=((v-u)*d+y-l)*4,x=(v*c+y)*4;p[b]=a[x],p[b+1]=a[x+1],p[b+2]=a[x+2],p[b+3]=a[x+3]}return new ImageData(p,d,f)}}function Qb(n,t,e,i){const{data:s,width:r,height:o}=n;let a=t;a>Math.floor(r/2)&&(a=Math.floor(r/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const c=new Uint8ClampedArray(s.length);for(let l=0;l<o;l++)for(let u=0;u<r;u++){const d=(l*r+u)*4;let f=-1;u<a?l<a?f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(l-(o-a),2))):u>r-a-1&&(l<a?f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(l-(o-a),2)))),Math.round(f)>a?(c[d]=255,c[d+1]=255,c[d+2]=255,c[d+3]=i||e.toUpperCase()==="PNG"?0:255):(c[d]=s[d],c[d+1]=s[d+1],c[d+2]=s[d+2],c[d+3]=i||e.toUpperCase()==="PNG"?s[d+3]:255)}return new ImageData(c,r,o)}function tw(n,t,e,i,s,r=1e4){const o=new Image;o.src=n;const a=document.createElement("canvas"),c=a.getContext("2d");return a.width=r,a.height=r,c.drawImage(o,0,0,t,e,0,0,i,s),c.getImageData(0,0,i,s)}function ew(n,t){const{data:e,width:i,height:s}=n,r=new Uint8ClampedArray(e.length);for(let a=0;a<s;a++)for(let c=0;c<i;c++){const h=(a*i+c)*4;r[h]=Math.max(Math.min(e[h]+t,255),0),r[h+1]=Math.max(Math.min(e[h+1]+t,255),0),r[h+2]=Math.max(Math.min(e[h+2]+t,255),0),r[h+3]=e[h+3]}return new ImageData(r,i,s)}function nw(n,t,e=!1){const{data:i,width:s,height:r}=n,o=new Uint8ClampedArray(i.length);for(let c=0;c<r;c++)for(let h=0;h<s;h++){const l=(c*s+h)*4;i[l+3]===0?(o[l]=255,o[l+1]=255,o[l+2]=255):(o[l]=i[l],o[l+1]=i[l+1],o[l+2]=i[l+2]);let u=i[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),o[l+3]=u}return new ImageData(o,s,r)}function iw(n,t,e,i){const{data:s,width:r,height:o}=n,{data:a,width:c,height:h}=t;let l=e,u=i;e+h>o&&(l=o-h),i+c>r&&(u=r-c);const d=new Uint8ClampedArray(s.length);for(let p=0;p<o;p++)for(let m=0;m<r;m++){const v=(p*r+m)*4;if(m<u||m>u+c||p<=l||p>=l+h)d[v]=s[v],d[v+1]=s[v+1],d[v+2]=s[v+2],d[v+3]=s[v+3];else{const y=(p*r+m-((l+1)*r+(p-(l+1))*(r-c))+c-u-1)*4,b=[a[y],a[y+1],a[y+2],a[y+3]],x=[s[v],s[v+1],s[v+2],s[v+3]],w=Vu(b,x);d[v]=w[0],d[v+1]=w[1],d[v+2]=w[2],d[v+3]=w[3]}}return new ImageData(d,r,o)}function sw(n,t,e,i,s,r=10){const{data:o,width:a,height:c}=n;let h=s,l=i,u=t,d=e;h<0?h=0:h>a&&(h=a),l<0?l=0:l>c&&(l=c),u<1?u=1:u>a&&(u=a),d<1?d=1:d>c&&(d=c),h+u>a&&(u=a-h),l+d>c&&(d=c-l);const f=new Uint8ClampedArray(o.length);for(let m=0;m<c;m++)for(let v=0;v<a;v++){const y=(m*a+v)*4;if(v>=h&&v<=h+u&&m>=l&&m<=l+d){const b=Math.floor((v-h)/r),x=Math.floor((m-l)/r);let w=Math.floor(r*(b+1)-r/2+h),C=Math.floor(r*(x+1)-r/2+l);w>a-1&&(w=a-1),C>c-1&&(C=c-1);const S=(C*a+w)*4;f[y]=o[S],f[y+1]=o[S+1],f[y+2]=o[S+2],f[y+3]=o[S+3]}else f[y]=o[y],f[y+1]=o[y+1],f[y+2]=o[y+2],f[y+3]=o[y+3]}return new ImageData(f,a,c)}function rw(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:i,width:s,height:r}=n,{data:o}=t,a=new Uint8ClampedArray(i.length),{backgroundColor:c,changeIntoColor:h}=e;for(let u=0;u<r;u++)for(let d=0;d<s;d++){const f=(u*s+d)*4,p=o[f],m=o[f+1],v=o[f+2],y=o[f+3];p===c.r&&m===c.g&&v===c.b&&y===c.a&&h.a!==0?(a[f]=h.r,a[f+1]=h.g,a[f+2]=h.b,a[f+3]=h.a):(a[f]=i[f],a[f+1]=i[f+1],a[f+2]=i[f+2],a[f+3]=i[f+3])}return new ImageData(a,s,r)}return n}function Uu(n,t){const{data:e,width:i,height:s}=n,r=new Uint8ClampedArray(e.length);for(let a=0;a<s;a++)for(let c=0;c<i;c++){const h=(a*i+c)*4;for(let l=0;l<3;l++){const u=h+l;c===0||c===i-1||a===0||a===s-1?r[u]=e[u]:r[u]=t[0]*e[u-i*4-4]+t[1]*e[u-i*4]+t[2]*e[u-i*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+i*4-4]+t[7]*e[u+i*4]+t[8]*e[u+i*4+4]}r[h+3]=e[h+3]}return new ImageData(r,i,s)}function Vu(n,t){if(n&&n.length===4&&t&&t.length===4){const e=n[3],i=t[3];if(e===255||i===0)return n;if(e===0)return t;{const s=e/255,r=i/255,o=Math.max(Math.min(Math.floor(n[0]*s+t[0]*r*(1-s)),255),0),a=Math.max(Math.min(Math.floor(n[1]*s+t[1]*r*(1-s)),255),0),c=Math.max(Math.min(Math.floor(n[2]*s+t[2]*r*(1-s)),255),0),h=Math.max(Math.min(Math.floor((s+r*(1-s))*255),255),0);return[o,a,c,h]}}return[255,255,255,255]}const ya=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,i=t.length){for(let s=0;s<i;s++)this.writeByte(t[s+e])},writeString(t){for(let e=0,i=t.length;e<i;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,i=n.length;e<i;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},Yu=function(){let n=0,t=0,e=0,i="";const s=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},r=function(o){i+=String.fromCharCode(s(o&63))};return{writeByte(o){for(n=n<<8|o&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)i+="="}},toString(){return i}}},$u=function(n,t,e){const i=new Array(n*n),s=function(a){const c=a;let h=0,l=0;return{write(u,d){if(u>>>d)throw new Error("length over");for(;h+d>=8;)c.writeByte(255&(u<<h|l)),d-=8-h,u>>>=8-h,l=0,h=0;l=u<<h|l,h=h+d},flush(){h>0&&c.writeByte(l)}}},r=function(a){const c=1<<a,h=(1<<a)+1;let l=a+1;const u=o();for(let v=0;v<c;v++)u.add(String.fromCharCode(v));u.add(String.fromCharCode(c)),u.add(String.fromCharCode(h));const d=ya(),f=s(d);f.write(c,l);let p=0,m=String.fromCharCode(i[p]);for(p+=1;p<i.length;){const v=String.fromCharCode(i[p]);p+=1,u.contains(m+v)?m=m+v:(f.write(u.indexOf(m),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(m+v)),m=v)}return f.write(u.indexOf(m),l),f.write(h,l),f.flush(),d.toByteArray()},o=function(){const a={};let c=0;return{add(h){if(this.contains(h))throw new Error("dup key:"+h);a[h]=c,c+=1},size(){return c},indexOf(h){return a[h]},contains(h){return typeof a[h]<"u"}}};return{setPixel(a,c,h){i[c*n+a]=h},write(a){a.writeString("GIF87a"),a.writeShort(n),a.writeShort(n),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(Un("0x"+t[1]+t[2])),a.writeByte(Un("0x"+t[3]+t[4])),a.writeByte(Un("0x"+t[5]+t[6])),a.writeByte(Un("0x"+e[1]+e[2])),a.writeByte(Un("0x"+e[3]+e[4])),a.writeByte(Un("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(n),a.writeShort(n),a.writeByte(0);const c=2,h=r(c);a.writeByte(c);let l=0;for(;h.length-l>255;)a.writeByte(255),a.writeBytes(h,l,255),l+=255;a.writeByte(h.length-l),a.writeBytes(h,l,h.length-l),a.writeByte(0),a.writeString(";")}}},Gu=function(n,t,e,i){const s=$u(n,t,e);for(let h=0;h<n;h++)for(let l=0;l<n;l++)s.setPixel(l,h,i(l,h));const r=ya();s.write(r);const o=Yu(),a=r.toByteArray();for(let h=0,l=a.length;h<l;h++)o.writeByte(a[h]);o.flush();let c="";return c+="data:image/gif;base64,",c+=o,c},Zt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ei={M:0,L:1,H:2,Q:3},en={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Et={glog:function(n){if(n<1)throw new Error("glog("+n+")");return Et.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return Et.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)Et.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)Et.EXP_TABLE[n]=Et.EXP_TABLE[n-4]^Et.EXP_TABLE[n-5]^Et.EXP_TABLE[n-6]^Et.EXP_TABLE[n-8];for(let n=0;n<255;n++)Et.LOG_TABLE[Et.EXP_TABLE[n]]=n;const ht={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){let t=n<<10;for(;ht.getBCHDigit(t)-ht.getBCHDigit(ht.G15)>=0;)t^=ht.G15<<ht.getBCHDigit(t)-ht.getBCHDigit(ht.G15);return(n<<10|t)^ht.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;ht.getBCHDigit(t)-ht.getBCHDigit(ht.G18)>=0;)t^=ht.G18<<ht.getBCHDigit(t)-ht.getBCHDigit(ht.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return ht.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case en.PATTERN000:return(t+e)%2==0;case en.PATTERN001:return t%2==0;case en.PATTERN010:return e%3==0;case en.PATTERN011:return(t+e)%3==0;case en.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case en.PATTERN101:return t*e%2+t*e%3==0;case en.PATTERN110:return(t*e%2+t*e%3)%2==0;case en.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new Jn([1],0);for(let e=0;e<n;e++)t=t.multiply(new Jn([1,Et.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Zt.MODE_NUMBER:return 10;case Zt.MODE_ALPHA_NUM:return 9;case Zt.MODE_8BIT_BYTE:return 8;case Zt.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Zt.MODE_NUMBER:return 12;case Zt.MODE_ALPHA_NUM:return 11;case Zt.MODE_8BIT_BYTE:return 16;case Zt.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Zt.MODE_NUMBER:return 14;case Zt.MODE_ALPHA_NUM:return 13;case Zt.MODE_8BIT_BYTE:return 16;case Zt.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const c=n.isDark(r,o);for(let h=-1;h<=1;h++)if(!(r+h<0||t<=r+h))for(let l=-1;l<=1;l++)o+l<0||t<=o+l||h==0&&l==0||c==n.isDark(r+h,o+l)&&a++;a>5&&(e+=3+a-5)}for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){let a=0;n.isDark(r,o)&&a++,n.isDark(r+1,o)&&a++,n.isDark(r,o+1)&&a++,n.isDark(r+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)n.isDark(r,o)&&!n.isDark(r,o+1)&&n.isDark(r,o+2)&&n.isDark(r,o+3)&&n.isDark(r,o+4)&&!n.isDark(r,o+5)&&n.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)n.isDark(o,r)&&!n.isDark(o+1,r)&&n.isDark(o+2,r)&&n.isDark(o+3,r)&&n.isDark(o+4,r)&&!n.isDark(o+5,r)&&n.isDark(o+6,r)&&(e+=40);let i=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)n.isDark(o,r)&&i++;const s=Math.abs(100*i/t/t-50)/5;return e+=s*10,e}};class Jn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let i=0;for(;i<t.length&&t[i]==0;)i++;this.num=new Array(t.length-i+e);for(let s=0;s<t.length-i;s++)this.num[s]=t[s+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let s=0;s<t.getLength();s++)e[i+s]^=Et.gexp(Et.glog(this.get(i))+Et.glog(t.get(s)));return new Jn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=Et.glog(this.get(0))-Et.glog(t.get(0)),i=new Array(this.getLength());for(let s=0;s<this.getLength();s++)i[s]=this.get(s);for(let s=0;s<t.getLength();s++)i[s]^=Et.gexp(Et.glog(t.get(s))+e);return new Jn(i,0).mod(t)}}class ze{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const i=ze.getRsBlockTable(t,e);if(i==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const s=i.length/3,r=[];for(let o=0;o<s;o++){const a=i[o*3+0],c=i[o*3+1],h=i[o*3+2];for(let l=0;l<a;l++)r.push(new ze(c,h))}return r}static getRsBlockTable(t,e){switch(e){case Ei.L:return ze.RS_BLOCK_TABLE[(t-1)*4+0];case Ei.M:return ze.RS_BLOCK_TABLE[(t-1)*4+1];case Ei.Q:return ze.RS_BLOCK_TABLE[(t-1)*4+2];case Ei.H:return ze.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Xu{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let i=0;i<e;i++)this.putBit((t>>>e-i-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class ow{mode;data;constructor(t){this.mode=Zt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data.charCodeAt(e),8)}}class nn{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Ei[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new ow(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=ze.getRSBlocks(t,this.errorCorrectLevel),i=new Xu;let s=0;for(let r=0;r<e.length;r++)s+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const o=this.dataList[r];i.put(o.mode,4),i.put(o.getLength(),ht.getLengthInBits(o.mode,t)),o.write(i)}if(i.getLengthInBits()<=s*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++)this.modules[i][s]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=nn.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let s=-1;s<=7;s++)e+s<=-1||this.moduleCount<=e+s||(0<=i&&i<=6&&(s==0||s==6)||0<=s&&s<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=s&&s<=4?this.modules[t+i][e+s]=!0:this.modules[t+i][e+s]=!1)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const s=ht.getLostPoint(this);(i==0||t>s)&&(t=s,e=i)}return e}createMovieClip(t,e,i){const s=t.createEmptyMovieClip(e,i),r=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*r;for(let c=0;c<this.modules[o].length;c++){const h=c*r;this.modules[o][c]&&(s.beginFill(0,100),s.moveTo(h,a),s.lineTo(h+r,a),s.lineTo(h+r,a+r),s.lineTo(h,a+r),s.endFill())}}return s}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=ht.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const s=t[e],r=t[i];if(this.modules[s][r]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[s+o][r+a]=!0:this.modules[s+o][r+a]=!1}}setupTypeNumber(t){const e=ht.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const s=!t&&(e>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=s}for(let i=0;i<18;i++){const s=!t&&(e>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=s}}setupTypeInfo(t,e){const i=this.errorCorrectLevel<<3|e,s=ht.getBCHTypeInfo(i);for(let r=0;r<15;r++){const o=!t&&(s>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(let r=0;r<15;r++){const o=!t&&(s>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,s=this.moduleCount-1,r=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let c=0;c<2;c++)if(this.modules[s][a-c]==null){let h=!1;o<t.length&&(h=(t[o]>>>r&1)==1),ht.getMask(e,s,a-c)&&(h=!h),this.modules[s][a-c]=h,r--,r==-1&&(o++,r=7)}if(s+=i,s<0||this.moduleCount<=s){s-=i,i=-i;break}}}static createData(t,e,i){const s=ze.getRSBlocks(t,e),r=new Xu;for(let a=0;a<i.length;a++){const c=i[a];r.put(c.mode,4),r.put(c.getLength(),ht.getLengthInBits(c.mode,t)),c.write(r)}let o=0;for(let a=0;a<s.length;a++)o+=s[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(nn.PAD0,8),r.getLengthInBits()>=o*8));)r.put(nn.PAD1,8);return nn.createBytes(r,s)}static createBytes(t,e){let i=0,s=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let u=0;u<e.length;u++){const d=e[u].dataCount,f=e[u].totalCount-d;s=Math.max(s,d),r=Math.max(r,f),o[u]=new Array(d);for(let y=0;y<o[u].length;y++)o[u][y]=255&t.buffer[y+i];i+=d;const p=ht.getErrorCorrectPolynomial(f),v=new Jn(o[u],p.getLength()-1).mod(p);a[u]=new Array(p.getLength()-1);for(let y=0;y<a[u].length;y++){const b=y+v.getLength()-a[u].length;a[u][y]=b>=0?v.get(b):0}}let c=0;for(let u=0;u<e.length;u++)c+=e[u].totalCount;const h=new Array(c);let l=0;for(let u=0;u<s;u++)for(let d=0;d<e.length;d++)u<o[d].length&&(h[l++]=o[d][u]);for(let u=0;u<r;u++)for(let d=0;d<e.length;d++)u<a[d].length&&(h[l++]=a[d][u]);return h}}const ju=Math.ceil,Ti=Math.floor,Wu=Math.round;function aw(n,t){const e=Nh(n),i=t?.ecc||"H",s=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",c=t?.background||"#ffffff",h=new nn(r,i);h.addData(e),h.make();const l=h.getModuleCount(),u=(s-o*2)/l,d=o,f=s-o;return Gu(s,a,c,function(p,m){if(d<=p&&p<f&&d<=m&&m<f){const v=Ti((p-d)/u),y=Ti((m-d)/u);return h.isDark(y,v)?0:1}else return 1})}function cw(n,t){const e=t.x||0,i=t.y||0,s=Nh(n),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Ti(t.size):256,c=t.padding||0,h=-1,l=t.color||"#000000",u=t.background||"#ffffff",d=new nn(h,o);d.addData(s),d.make();const f=d.getModuleCount(),p=(a-c*2)/f;r.fillStyle=u,r.fillRect(e,i,a,a);for(let m=0;m<f;m++)for(let v=0;v<f;v++){const y=ju((v+1)*p)-Ti(v*p),b=ju((m+1)*p)-Ti(m*p);r.fillStyle=d.isDark(m,v)?l:u,r.fillRect(e+Wu(v*p)+c,i+Wu(m*p)+c,y,b)}}function q(n){return n*Math.PI/180}function Tt(n){return n*180/Math.PI}function Kn(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function sn(n,t,e,i){return Kn(e-n,i-t)}function Qt(n,t,e,i){let s=Math.atan2(i-t,e-n);return s<0&&(s+=Math.PI*2),s}function rn(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function hw(n,t,e){if(typeof e=="number"){const i=Kn(n,t,e);return{x:n/=i,y:t/=i,z:e/=i}}else{const i=Kn(n,t);return{x:n/=i,y:t/=i}}}function lw(n,t,e,i,s=10){if(Math.abs(e-n)<s&&Math.abs(i-t)<s)return"no";const r=Tt(Qt(n,t,e,i));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}class $s{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new $s(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y;return this.x=t.m11*e+t.m21*i+t.m31,this.y=t.m12*e+t.m22*i+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Y(this.x,t.x,e.x),this.y=Y(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=Y(this.x,t,e),this.y=Y(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Y(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}perpendOnVector(t){return Hu.copy(this).projectOnVector(t),this.sub(Hu)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Y(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}rotateAround(t,e){const i=Math.cos(e),s=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*s+t.x,this.y=r*s+o*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class _e{x=0;y=0;z=0;constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}set(t=0,e=0,i=0){return this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new _e(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyMatrix3(t){const e=this.x,i=this.y,s=this.z,r=t.value;return this.x=r[0]*e+r[3]*i+r[6]*s,this.y=r[1]*e+r[4]*i+r[7]*s,this.z=r[2]*e+r[5]*i+r[8]*s,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=t.value,o=1/(r[3]*e+r[7]*i+r[11]*s+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*s+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*s+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*s+r[14])*o,this}transformDirection(t){const e=this.x,i=this.y,s=this.z,r=t.value;return this.x=r[0]*e+r[4]*i+r[8]*s,this.y=r[1]*e+r[5]*i+r[9]*s,this.z=r[2]*e+r[6]*i+r[10]*s,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Y(this.x,t.x,e.x),this.y=Y(this.y,t.y,e.y),this.z=Y(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=Y(this.x,t,e),this.y=Y(this.y,t,e),this.z=Y(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Y(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,s=t.y,r=t.z,o=e.x,a=e.y,c=e.z;return this.x=s*c-r*a,this.y=r*o-i*c,this.z=i*a-s*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}perpendOnVector(t){return wa.copy(this).projectOnVector(t),this.sub(wa)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(wa.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Y(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,s=this.z-t.z;return e*e+i*i+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),i=this.setFromMatrix4Column(t,1).length(),s=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=i,this.z=s,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class ba{x=0;y=0;z=0;w=1;constructor(t=0,e=0,i=0,s=1){this.x=t,this.y=e,this.z=i,this.w=s}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,i=0,s=1){return this.x=t,this.y=e,this.z=i,this.w=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new ba(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,s=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*i+o[8]*s+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*s+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*s+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*s+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromRotationMatrix4(t){let e,i,s,r;const c=t.value,h=c[0],l=c[4],u=c[8],d=c[1],f=c[5],p=c[9],m=c[2],v=c[6],y=c[10];if(Math.abs(l-d)<.01&&Math.abs(u-m)<.01&&Math.abs(p-v)<.01){if(Math.abs(l+d)<.1&&Math.abs(u+m)<.1&&Math.abs(p+v)<.1&&Math.abs(h+f+y-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const x=(h+1)/2,w=(f+1)/2,C=(y+1)/2,S=(l+d)/4,D=(u+m)/4,L=(p+v)/4;return x>w&&x>C?x<.01?(i=0,s=.707106781,r=.707106781):(i=Math.sqrt(x),s=S/i,r=D/i):w>C?w<.01?(i=.707106781,s=0,r=.707106781):(s=Math.sqrt(w),i=S/s,r=L/s):C<.01?(i=.707106781,s=.707106781,r=0):(r=Math.sqrt(C),i=D/r,s=L/r),this.set(i,s,r,e),this}let b=Math.sqrt((v-p)*(v-p)+(u-m)*(u-m)+(d-l)*(d-l));return Math.abs(b)<.001&&(b=1),this.x=(v-p)/b,this.y=(u-m)/b,this.z=(d-l)/b,this.w=Math.acos((h+f+y-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Y(this.x,t.x,e.x),this.y=Y(this.y,t.y,e.y),this.z=Y(this.z,t.z,e.z),this.w=Y(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=Y(this.x,t,e),this.y=Y(this.y,t,e),this.z=Y(this.z,t,e),this.w=Y(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Y(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const Hu=new $s,wa=new _e,qu=uw("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function uw(n,t=10){const e={},i=n.split(",");for(let s=0;s<i.length;s+=2){const r="&"+i[s+1]+";",o=parseInt(i[s],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Bt(n,t){const e=Object.keys(t);for(let i=0;i<e.length;i++)n=n.replace(new RegExp("{"+e[i]+"}","gi"),""+t[e[i]]);return n}function Gs(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=i[Math.floor(Math.random()*i.length)];while(n[t]);return t}function fw(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function dw(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Pi={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};let Xs=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const i=this.__ctx.__createElement("stop");if(i.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(i.setAttribute("stop-color",Bt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),i.setAttribute("stop-opacity",r[4]))}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}},va=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Ju=class Mh{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:i=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=i),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Pi);for(let e=0,i=t.length;e<i;e++){const s=t[e];this[s]=Pi[s].canvas}}__getStyleState(){const t={},e=Object.keys(Pi);for(let i=0,s=e.length;i<s;i++){const r=e[i];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let i=0,s=e.length;i<s;i++){const r=e[i];this[r]=t[r]}}__createElement(t,e={},i=!1){const s=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);i&&(s.setAttribute("fill","none"),s.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];s.setAttribute(a,e[a])}return s}__applyStyleToCurrentElement(t){let e=this.__currentElement;const i=this.__currentElementsToStyle;i&&(e.setAttribute(t,""),e=i.element,i.children.forEach(r=>{r.setAttribute(t,"")}));const s=Object.keys(Pi);for(let r=0;r<s.length;r++){const o=Pi[s[r]],a=this[s[r]];if(o.apply){if(a instanceof va){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const c=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Bt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Xs)e.setAttribute(o.apply,Bt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(h){e.setAttribute(o.svgAttr,Bt("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let l=parseFloat(h[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}else{let c=o.svgAttr;if(s[r]==="globalAlpha"&&(c=t+"-"+o.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const s=Object.keys(qu);for(let r=0,o=s.length;r<o;r++){const a=s[r],c=qu[a],h=new RegExp(a,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const s=this.__createElement("g");e.appendChild(s),this.__currentElement=s}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Bt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Bt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Bt("translate({x},{y})",{x:t,y:e}))}transform(t,e,i,s,r,o){this.__addTransform(Bt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:i,d:s,e:r,f:o}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Bt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Bt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Bt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,i,s,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Bt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:i,cp2y:s,x:r,y:o}))}quadraticCurveTo(t,e,i,s){this.__currentPosition={x:i,y:s},this.__addPathCommand(Bt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:i,y:s}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,i,s,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===i&&e===s||r===0){this.lineTo(t,e);return}const c=this.normalize([o-t,a-e]),h=this.normalize([i-t,s-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const l=c[0]*h[0]+c[1]*h[1],u=Math.acos(Math.abs(l)),d=this.normalize([c[0]+h[0],c[1]+h[1]]),f=r/Math.sin(u/2),p=t+f*d[0],m=e+f*d[1],v=[-c[1],c[0]],y=[h[1],-h[0]],b=function(C){const S=C[0];return C[1]>=0?Math.acos(S):-Math.acos(S)},x=b(v),w=b(y);this.lineTo(p+v[0]*r,m+v[1]*r),this.arc(p,m,r,x,w)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,i,s){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.lineTo(t,e),this.closePath()}fillRect(t,e,i,s){const r=this.__createElement("rect",{x:t,y:e,width:i,height:s},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,i,s){const r=this.__createElement("rect",{x:t,y:e,width:i,height:s},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],s=i.childNodes;for(let r=s.length-1;r>=0;r--)s[r]&&i.removeChild(s[r]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,i,s){if(t===0&&e===0&&i===this.width&&s===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:i,height:s,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,i,s){const r=this.__createElement("linearGradient",{id:Gs(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:s+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Xs(r,this)}createRadialGradient(t,e,i,s,r,o){const a=this.__createElement("radialGradient",{id:Gs(this.__ids),cx:s+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Xs(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),i={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(t,e){if(t.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e}__applyText(t,e,i,s){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:i,"text-anchor":fw(this.textAlign),"dominant-baseline":dw(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(s),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,i){this.__applyText(t,e,i,"fill")}strokeText(t,e,i){this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,s,r,o){if(s===r)return;s=s%(2*Math.PI),r=r%(2*Math.PI),s===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+i*Math.cos(r),c=e+i*Math.sin(r),h=t+i*Math.cos(s),l=e+i*Math.sin(s),u=o?0:1;let d=0,f=r-s;f<0&&(f+=2*Math.PI),o?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(Bt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:a,endY:c})),this.__currentPosition={x:a,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),i=Gs(this.__ids),s=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",i),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Bt("url(#{id})",{id:i})),t.appendChild(s),this.__currentElement=s}drawImage(...t){let e=t[0],i,s,r,o,a=0,c=0,h,l,u,d,f,p,m,v;if(t.length===3)i=t[1],s=t[2],h=e.width,l=e.height,r=h,o=l;else if(t.length===5)i=t[1],s=t[2],r=t[3],o=t[4],h=e.width,l=e.height;else if(t.length===9)a=t[1],c=t[2],h=t[3],l=t[4],i=t[5],s=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const y=this.__closestGroupOrSvg();this.__currentElement;const b="translate("+i+", "+s+")";if(e instanceof Mh){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)v=d.childNodes[0].getAttribute("id"),this.__ids[v]=v,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const x=f.getAttribute("transform");let w;x?w=x+" "+b:w=b,f.setAttribute("transform",w),y.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||c||h!==e.width||l!==e.height)&&(m=this.__document.createElement("canvas"),m.width=r,m.height=o,m.getContext("2d")?.drawImage(e,a,c,h,l,0,0,r,o),e=m),p.setAttribute("transform",b),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(p))}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),s=Gs(this.__ids);let r;return i.setAttribute("id",s),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),i.appendChild(r),this.__SVGdefs.appendChild(i)):t instanceof Mh&&(i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new va(i,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},xa=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,i,s=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),s&&(this.customContext=new Ju({canvas:this.canvas,width:e||this.canvas.width,height:i||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,i,s){return this.context.fillRect(t,e,i,s),this.customContext&&this.customContext.fillRect(t,e,i,s),this}fillText(t,e,i,s){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,i,s),this.customContext&&this.customContext.fillText(t,e,i),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,i,s){return this.context.strokeText(t,e,i,s),this.customContext&&this.customContext.strokeText(t,e,i),this}strokeRect(t,e,i,s){return this.context.strokeRect(t,e,i,s),this.customContext&&this.customContext.strokeRect(t,e,i,s),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,i=this.canvas.width,s=this.canvas.height){return this.context.clearRect(t,e,i,s),this.customContext&&this.customContext.clearRect(t,e,i,s),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const i=new Path2D;i.addPath(t,e),this.currentPath2D=i}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,i=0){return this.translate(e,i),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-i),this.changePath2D(),this}scale(t,e=t,i=0,s=0){return this.translate(i,s),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-i,-s),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,i,s,r,o){return this.context.arc(t,e,i,s,r,o),this.customContext&&this.customContext.arc(t,e,i,s,r,o?-1:1),this.currentPath2D.arc(t,e,i,s,r,o),this}arcTo(t,e,i,s,r){return this.context.arcTo(t,e,i,s,r),this.customContext&&this.customContext.arcTo(t,e,i,s,r),this.currentPath2D.arcTo(t,e,i,s,r),this}ellipse(t,e,i,s,r,o,a,c){return this.context.ellipse(t,e,i,s,r,o,a,c),this.currentPath2D.ellipse(t,e,i,s,r,o,a,c),this}quadraticCurveTo(t,e,i,s){return this.context.quadraticCurveTo(t,e,i,s),this.customContext&&this.customContext.quadraticCurveTo(t,e,i,s),this.currentPath2D.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,r,o){return this.context.bezierCurveTo(t,e,i,s,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,i,s,r,o),this.currentPath2D.bezierCurveTo(t,e,i,s,r,o),this}rect(t,e,i,s){return this.context.rect(t,e,i,s),this.customContext&&this.customContext.rect(t,e,i,s),this.currentPath2D.rect(t,e,i,s),this}createLinearGradient(t,e,i,s,r){const o=this.context.createLinearGradient(t,e,i,s);return r&&Object.entries(r).forEach(([a,c])=>{o.addColorStop(parseFloat(a),c)}),o}createRadialGradient(t,e,i,s,r,o,a){const c=this.context.createRadialGradient(t,e,i,s,r,o);return a&&Object.entries(a).forEach(([h,l])=>{c.addColorStop(parseFloat(h),l)}),c}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const i=e[0],s=e[1];this.context.drawImage(t,i,s)}else if(e.length===4){const i=e[0],s=e[1],r=e[2],o=e[3];this.context.drawImage(t,i,s,r,o)}else if(e.length===8){const i=e[0],s=e[1],r=e[2],o=e[3],a=e[4],c=e[5],h=e[6],l=e[7];this.context.drawImage(t,i,s,r,o,a,c,h,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,i=this.canvas.width,s=this.canvas.height,r){return this.context.getImageData(t,e,i,s,r)}putImageData(t,e=0,i=0){return this.context.putImageData(t,e,i)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}},_a=class{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=Qt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),i=Math.min(this.y,this.toY),s=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:i,width:s-e,height:r-i}}else{const e=Math.sin(t),i=Math.cos(t),s=i*this.x-e*this.y,r=i*this.toX-e*this.toY,o=i*this.y+e*this.x,a=i*this.toY+e*this.toX;return{x:Math.min(s,r),y:Math.min(o,a),width:Math.max(s,r)-Math.min(s,r),height:Math.max(o,a)-Math.min(o,a)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,i=this.y,s=t.toX,r=t.toY,o=this.toX-e,a=t.x-s;if(!o&&!a)return null;const c=(this.toY-i)/o,h=(t.y-r)/a;if(o){if(!a)return{x:s,y:c*(s-e)+i}}else return{x:e,y:h*(e-s)+r};const l=(-h*s+r+c*e-i)/(c-h),u=c*(l-e)+i;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const mw=class extends _a{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,i,s,r,o,a,c]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,i,s,r,o,a,c,!this.sweepFlag)}convert(t,e,i,s,r,o,a,c,h){const l=a/180*Math.PI,u=(t-i)/2,d=(e-s)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,m=f*f/(r*r)+p*p/(o*o);if(m>1){const U=Math.sqrt(m);throw r=U*r,o=U*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const v=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),y=c!=h?1:-1,b=y*v*r*p/o,x=y*v*-o*f/r,w=(t+i)/2,C=(e+s)/2,S=Math.cos(l)*b-Math.sin(l)*x+w,D=Math.sin(l)*b+Math.cos(l)*x+C,L=(U,X,Z,at)=>(U*at>=X*Z?1:-1)*Math.acos((U*Z+X*at)/(Math.sqrt(U*U+X*X)*Math.sqrt(Z*Z+at*at))),I=L(1,0,t-S,e-D)-l,F=L(t-S,e-D,i-S,s-D);return[S,D,r,o,l,I,I+F]}},pw=class extends _a{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,i=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,i,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let i,s,r,o;for(let h=0;h<2;++h)i=h==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,s=h==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=h==0?this.x:this.y,Math.abs(i)>1e-12&&(o=-s/(2*i),0<o&&o<1&&[t,e][h].push(i*o*o+s*o+r));const a={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},c={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:a.x,y:a.y,width:c.x-a.x,height:c.y-a.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}},on=class os extends _a{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),i=this.x-this.c1x,s=(-e+Math.sqrt(e*e-4*t*i))/2/t,r=(-e-Math.sqrt(e*e-4*t*i))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let c;const h=[];Math.abs(s)>1e12&&(s=.5),Math.abs(r)>1e12&&(r=.5),s>=0&&s<=1&&(c=this.interpolate(s),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),i=this.y-this.c1y,s=(-e+Math.sqrt(e*e-4*t*i))/2/t,r=(-e-Math.sqrt(e*e-4*t*i))/2/t,Math.abs(s)>1e12&&(s=.5),Math.abs(r)>1e12&&(r=.5),s>=0&&s<=1&&(c=this.interpolate(s),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y}));const l=[],u=h.length;for(let p=0;p<u;p++){for(let m=p+1;m<u;m++)h[p].X===h[m].X&&h[p].Y===h[m].Y&&(m=++p);l.push({X:h[p].X,Y:h[p].Y})}const d={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,i,s,r){const o=-3*e+9*i-9*s+3*r,a=t*o+6*e-12*i+6*s;return t*a-3*e+3*i}static bezlen(t,e,i,s,r,o,a,c,h=1){h=Math.max(0,Math.min(h,1));const l=h/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const m=l*u[p]+l,v=this.base3(m,t,i,r,a),y=this.base3(m,e,s,o,c);f+=d[p]*Math.sqrt(v*v+y*y)}return l*f}length(t=1){return os.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,i=this.y,s=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,c=this.toX,h=this.toY;if(t<0||os.bezlen(e,i,s,r,o,a,c,h)<t)return 0;const l=1;let u=l/2,d=l-u,f=os.bezlen(e,i,s,r,o,a,c,h,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=os.bezlen(e,i,s,r,o,a,c,h,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),i=1-e,s=Math.pow(i,3),r=Math.pow(i,2),o=e*e,a=o*e,c=s*this.x+r*3*e*this.c1x+i*3*e*e*this.c2x+a*this.toX,h=s*this.y+r*3*e*this.c1y+i*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=i*this.x+e*this.c1x,m=i*this.y+e*this.c1y,v=i*this.c2x+e*this.toX,y=i*this.c2y+e*this.toY,b=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:c,y:h,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:m},end:{x:v,y},alpha:b}}},Ai=Math.PI*2;function Ku(n,t,e,i){const s=n*i-t*e<0?-1:1;let r=n*e+t*i;return r>1&&(r=1),r<-1&&(r=-1),s*Math.acos(r)}function gw(n,t,e,i,s,r,o,a,c,h){const l=h*(n-e)/2+c*(t-i)/2,u=-c*(n-e)/2+h*(t-i)/2,d=o*o,f=a*a,p=l*l,m=u*u;let v=d*f-d*m-f*p;v<0&&(v=0),v/=d*m+f*p,v=Math.sqrt(v)*(s===r?-1:1);const y=v*o/a*u,b=v*-a/o*l,x=h*y-c*b+(n+e)/2,w=c*y+h*b+(t+i)/2,C=(l-y)/o,S=(u-b)/a,D=(-l-y)/o,L=(-u-b)/a,I=Ku(1,0,C,S);let F=Ku(C,S,D,L);return r===0&&F>0&&(F-=Ai),r===1&&F<0&&(F+=Ai),[x,w,I,F]}function yw(n,t){const e=1.3333333333333333*Math.tan(t/4),i=Math.cos(n),s=Math.sin(n),r=Math.cos(n+t),o=Math.sin(n+t);return[i,s,i-s*e,s+i*e,r+o*e,o-r*e,r,o]}function js(n,t,e,i,s,r,o,a,c){const h=Math.sin(c*Ai/360),l=Math.cos(c*Ai/360),u=l*(n-e)/2+h*(t-i)/2,d=-h*(n-e)/2+l*(t-i)/2;if(u===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=gw(n,t,e,i,s,r,o,a,h,l),m=[];let v=p[2],y=p[3];const b=Math.max(Math.ceil(Math.abs(y)/(Ai/4)),1);y/=b;for(let x=0;x<b;x++)m.push(yw(v,y)),v+=y;return m.map(x=>{for(let w=0;w<x.length;w+=2){let C=x[w+0],S=x[w+1];C*=o,S*=a;const D=l*C-h*S,L=h*C+l*S;x[w+0]=D+p[0],x[w+1]=L+p[1]}return x})}function Zu(n,t,e,i,s,r,o,a,c,h){const l=Math.PI*120/180,u=Math.PI/180*(+s||0);let d=[],f;const p=function(et,st,Q){const St=et*Math.cos(Q)-st*Math.sin(Q),z=et*Math.sin(Q)+st*Math.cos(Q);return{x:St,y:z}};let m,v,y,b;if(h)m=h[0],v=h[1],y=h[2],b=h[3];else{f=p(n,t,-u),n=f.x,t=f.y,f=p(a,c,-u),a=f.x,c=f.y;const et=(n-a)/2,st=(t-c)/2;let Q=et*et/(e*e)+st*st/(i*i);Q>1&&(Q=Math.sqrt(Q),e=Q*e,i=Q*i);const St=e*e,z=i*i,R=(r==o?-1:1)*Math.sqrt(Math.abs((St*z-St*st*st-z*et*et)/(St*st*st+z*et*et)));y=R*e*st/i+(n+a)/2,b=R*-i*et/e+(t+c)/2,m=Math.asin(Number(((t-b)/i).toFixed(9))),v=Math.asin(Number(((c-b)/i).toFixed(9))),m=n<y?Math.PI-m:m,v=a<y?Math.PI-v:v,m<0&&(m=Math.PI*2+m),v<0&&(v=Math.PI*2+v),o&&m>v&&(m=m-Math.PI*2),!o&&v>m&&(v=v-Math.PI*2)}let x=v-m;if(Math.abs(x)>l){const et=v,st=a,Q=c;v=m+l*(o&&v>m?1:-1),a=y+e*Math.cos(v),c=b+i*Math.sin(v),d=Zu(a,c,e,i,s,0,o,st,Q,[v,et,y,b])}x=v-m;const w=Math.cos(m),C=Math.sin(m),S=Math.cos(v),D=Math.sin(v),L=Math.tan(x/4),I=4/3*e*L,F=4/3*i*L,U=[n,t],X=[n+I*C,t-F*w],Z=[a+I*D,c-F*S],at=[a,c];return X[0]=2*U[0]-X[0],X[1]=2*U[1]-X[1],h?[[...X,...Z,...at]].concat(d):[[...X,...Z,...at]].concat(d).map(et=>{const st=[];for(let Q=0,St=et.length;Q<St;Q++)st[Q]=Q%2?p(et[Q-1],et[Q],u).y:p(et[Q],et[Q+1],u).x;return st})}function Mi(n,t,e,i,s,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*i,s/3+.6666666666666666*e,r/3+.6666666666666666*i,s,r]}function An(n,t,e,i){return[n,t,e,i,e,i]}const Di={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function an(n="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",n)}function Sa(){return an("path")}const Qu=n=>n instanceof SVGElement&&n.tagName==="path";function tf(n,t="shape"){return Zc(Ql(n),`${t}.svg`)}function bw(n,t="shape"){return Zc(so(n),`${t}.svg`)}function ww(n){return jo(n)}function Ca(n){return typeof n!="string"?!1:(n=n.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(n)&&/[\dz]$/i.test(n))}function Ea(n){return n.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function Ws(n){const t=[];return Ca(n)&&n.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,i,s)=>{let r=i.toLowerCase();const o=Gh(s);for(r=="m"&&o.length>Di[r]&&(t.push([i,...o.splice(0,Di[r])]),r="l",i=i=="m"?"l":"L");o.length;){if(o.length<Di[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${i} } args:{ ${o} }`);t.push([i,...o.splice(0,Di[r])])}return r=="z"&&t.push([i]),""}),t}function Hs(n){let t=0,e=0,i=0,s=0;return n.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=i,r[7]+=s;break;case"v":r[1]+=s;break;case"h":r[1]+=i;break;default:for(let c=1;c<r.length;)r[c++]+=i,r[c++]+=s}switch(a){case"Z":i=t,s=e;break;case"H":i=r[1];break;case"V":s=r[1];break;case"M":i=t=r[1],s=e=r[2];break;default:i=r[r.length-2],s=r[r.length-1]}return r})}function vw(n){let t=0,e=0,i=0,s=0;return n.map(function(r){const o=r[0],a=o.toLowerCase();if(o!=a)switch(r[0]=a,o){case"A":r[6]-=i,r[7]-=s;break;case"V":r[1]-=s;break;case"H":r[1]-=i;break;default:for(let c=1;c<r.length;)r[c++]-=i,r[c++]-=s}switch(a){case"z":i=t,s=e;break;case"h":i+=r[1];break;case"v":s+=r[1];break;case"m":i+=r[1],s+=r[2],t+=r[1],e+=r[2];break;default:i+=r[r.length-2],s+=r[r.length-1]}return r})}function Ta(n){const t=[];let e=0,i=0,s=0,r=0,o=0,a=0,c=0,h=0,l;for(let u=0,d=n.length;u<d;u++){let f=n[u];const p=f[0];switch(p){case"M":e=f[1],i=f[2];break;case"A":const m=js(s,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!m.length)continue;m.forEach((b,x)=>{const[w,C,S,D,L,I,F,U]=b;f=["C",S,D,L,I,F,U],x<m.length-1&&t.push(f)});break;case"S":let v=s,y=r;(l=="C"||l=="S")&&(v+=v-c,y+=y-h),f=["C",v,y,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(o=s*2-o,a=r*2-a):(o=s,a=r),f=["C",...Mi(s,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...Mi(s,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...An(s,r,f[1],f[2])];break;case"H":f=["C",...An(s,r,f[1],r)];break;case"V":f=["C",...An(s,r,s,f[1])];break;case"Z":f=["C",...An(s,r,e,i)];break}l=p,s=f[f.length-2],r=f[f.length-1],f.length>4?(c=f[f.length-4],h=f[f.length-3]):(c=s,h=r),t.push(f)}return t}function xw(n){const t=[];for(let e=0,i=n.length;i-2>e;e+=2){let s;e==0?s=[{x:n[e],y:n[e+1]},{x:n[e],y:n[e+1]},{x:n[e+2],y:n[e+3]},{x:n[e+4],y:n[e+5]}]:i-4==e?s=[{x:n[e-2],y:n[e-1]},{x:n[e],y:n[e+1]},{x:n[e+2],y:n[e+3]},{x:n[e+2],y:n[e+3]}]:s=[{x:n[e-2],y:n[e-1]},{x:n[e],y:n[e+1]},{x:n[e+2],y:n[e+3]},{x:n[e+4],y:n[e+5]}];const r=[{x:s[1].x,y:s[1].y},{x:(-s[0].x+6*s[1].x+s[2].x)/6,y:(-s[0].y+6*s[1].y+s[2].y)/6},{x:(s[1].x+6*s[2].x-s[3].x)/6,y:(s[1].y+6*s[2].y-s[3].y)/6},{x:s[2].x,y:s[2].y}];t.push(["C",r[1].x,r[1].y,r[2].x,r[2].y,r[3].x,r[3].y])}return t}function _w(n){const t=[];let e=["L",0,0],i;for(let s=0,r=n.length;s<r;s++){const o=n[s];switch(o[0]){case"M":e=["L",o[1],o[2]],t.push(o);break;case"Z":t.push(e);break;case"H":i=t[t.length-1]||["L",0,0],t.push(["L",o[1],i[i.length-1]]);break;case"V":i=t[t.length-1]||["L",0,0],t.push(["L",i[i.length-2],o[1]]);break;default:t.push(o)}}return t}function Sw(n){const t={S:{to:"C",x:3},T:{to:"Q",x:1}};let e,i=0,s=0;for(let r=0,o=n.length;r<o;r++){const a=n[r],c=t[a[0]];c&&(a[0]=c.to,e&&(e[0]===c.to?(i=2*Number(e[c.x+2])-Number(e[c.x]),s=2*Number(e[c.x+3])-Number(e[c.x+1])):(i=Number(e[e.length-2]),s=Number(e[e.length-1]))),a.splice(1,0,i,s)),e=a}return n}let Cw=class qe{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(Ws(t),e):t instanceof qe?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const i=Ta(Hs(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let s=!1;for(let r=0,o=i.length;r<o;r++){const a=i[r];if(a[0]=="M"){s||(s=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new on({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new qe;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let i=2,s=t.length;i+5<s;i+=6)e.appendLine(new on({c1x:t[i],c1y:t[i+1],c2x:t[i+2],c2y:t[i+3],toX:t[i+4],toY:t[i+5]}));return e}static fromLines(t){const e=new qe;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let i=0,s=t.length;i<s;i++)e.appendLine(t[i]);return e}appendLine(t){if(t instanceof mw){js(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(h=>{const[l,u,d,f,p,m,v,y]=h;this.normalizedLines.push(new on({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:m,toX:v,toY:y})),this.prevPathX=v,this.prevPathY=y});return}let e,i,s,r,o,a;t instanceof on?(e=t.c1x,i=t.c1y,s=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof pw?[e,i,s,r,o,a]=Mi(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,i,s,r,o,a]=An(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new on({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:i,c2x:s,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:i}=this.updateTransform(),s=[];s.push(["M",t,e]);for(let r=0,o=i.length;r<o;r++)s.push(...i[r].toSVGPathData());return s}toSVGPathD(){return Ea(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:i,normalizedLines:s}=this.updateTransform();t.beginPath(),t.moveTo(e,i),s.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],i=[];if(t.forEach(c=>{const h=c.getBoundingClientRect();e.push(h.x,h.x+h.width),i.push(h.y,h.y+h.height)}),e.length==0||i.length==0)return{x:0,y:0,width:0,height:0};const s=Math.min.apply(0,e),r=Math.min.apply(0,i),o=Math.max.apply(0,e),a=Math.max.apply(0,i);return{x:s,y:r,width:o-s,height:a-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new It;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,i=this.startPathY;({x:e,y:i}=t.transformPoint({x:e,y:i}));const s=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,c=r.c1x,h=r.c1y,l=r.c2x,u=r.c2y,d=r.toX,f=r.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:c,y:h}=t.transformPoint({x:c,y:h}),{x:l,y:u}=t.transformPoint({x:l,y:u}),{x:d,y:f}=t.transformPoint({x:d,y:f}),s.push(new on({x:o,y:a,c1x:c,c1y:h,c2x:l,c2y:u,toX:d,toY:f}))}),{startPathX:e,startPathY:i,normalizedLines:s}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,i)=>e+=i.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let i=0;const s=e.length;for(let r=0;r<s;r++){const o=e[r],a=o.length();if(i+a>=t)return o.getPointAtSegmentLength(t-i);i+=a}return e[s-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:i,normalizedLines:s}=this.updateTransform(),r=s.length;if(r===0)return{x:e,y:i};if(r===1)return s[0].interpolate(t);{let o=t*r,a=s[0];if(o--,o>1)for(let c=1;c<r&&(a=s[c],o>1);c++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const i=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(i,t):i}}getSubpathsAtLength(t,e,i){const{startPathX:s,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,c=0;const h=new qe;h.prevPathX=h.startPathX=s,h.prevPathY=h.startPathY=r;for(let l=0,u=o.length;l<u;l++){const d=o[l],f=d.length();if(c+f>e&&!a){const p=d.getPointAtSegmentLength(e-c);if(h.appendLine(new on({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),i)return h;a=h,h.appendLine(new on({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:d.x,toY:d.y})),c+=f;continue}c+=f,h.appendLine(d)}return h}closestPoint(t,e){const i=this.getTotalLength();let s={x:t,y:e},r=0,o=1/0,a=8;for(let h=0;h<=i;h+=a){const l=this.getPointAtLength(h),u=Math.pow(sn(l.x,l.y,t,e),2);u<o&&(s=l,r=h,o=u)}for(a/=2;a>.5;){const h=r-a,l=this.getPointAtLength(h),u=Math.pow(sn(l.x,l.y,t,e),2),d=r+a,f=this.getPointAtLength(d),p=Math.pow(sn(f.x,f.y,t,e),2);h>=0&&u<o?(s=l,r=h,o=u):d<=i&&p<o?(s=f,r=d,o=p):a/=2}const c=this.getPointAtLength(r+(r===i?-.1:.1));return{point:s,rotation:r>=i?Qt(c.x,c.y,s.x,s.y):Qt(s.x,s.y,c.x,c.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:i}=this.updateTransform();return[t,e].concat(i.reduce((s,r)=>s.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let i=t[e-2],s=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=sn(t[o],t[o+1],i,s),i=t[o],s=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,i=e.length;let s=t-i;const r=Math.ceil(t/i),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=i-1;){const c=e[a++],h=e[a++],l=e[a++],u=e[a++],d=e[a++],f=e[a++];o.push(["C",c,h,l,u,d,f]);let p=0;for(;p<r&&s>0;)o.push(["C",d,f,d,f,d,f]),s-=6,p++}return o}static mixPoints(t,e,i){const s=t.length,r=new Array(s);for(let o=0;o<s;o++)r[o]=G(t[o]+(e[o]-t[o])*i,6);return r}static getPathInterpolator(t,e){return i=>Math.abs(i-0)<Number.EPSILON?t:Math.abs(i-1)<Number.EPSILON?e:qe.fromPolymorphPoints(qe.mixPoints(new qe({d:t}).polymorphPoints,new qe({d:e}).polymorphPoints,i)).toSVGPathData()}};class Ii{static _nextId=0;static nextId(){return Ii._nextId++}}const N={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)},style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)},style:"cubic-bezier(0.1, 0.57, 0.1, 1)"},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)},style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"},Bounce:{In:function(n){return 1-N.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?N.Bounce.In(n*2)*.5:N.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(i){return t*Math.random()+e*n(i)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function ef(n){switch(n){case N.Quadratic.In:return N.Quadratic.Out;case N.Quadratic.Out:return N.Quadratic.In;case N.Quadratic.InOut:return N.Quadratic.InOut;case N.Cubic.In:return N.Cubic.Out;case N.Cubic.Out:return N.Cubic.In;case N.Cubic.InOut:return N.Cubic.InOut;case N.Quartic.In:return N.Quartic.Out;case N.Quartic.Out:return N.Quartic.In;case N.Quartic.InOut:return N.Quartic.InOut;case N.Quintic.In:return N.Quintic.Out;case N.Quintic.Out:return N.Quintic.In;case N.Quintic.InOut:return N.Quintic.InOut;case N.Sinusoidal.In:return N.Sinusoidal.Out;case N.Sinusoidal.Out:return N.Sinusoidal.In;case N.Sinusoidal.InOut:return N.Sinusoidal.InOut;case N.Exponential.In:return N.Exponential.Out;case N.Exponential.Out:return N.Exponential.In;case N.Exponential.InOut:return N.Exponential.InOut;case N.Circular.In:return N.Circular.Out;case N.Circular.Out:return N.Circular.In;case N.Circular.InOut:return N.Circular.InOut;case N.Elastic.In:return N.Elastic.Out;case N.Elastic.Out:return N.Elastic.In;case N.Elastic.InOut:return N.Elastic.InOut;case N.Back.In:return N.Back.Out;case N.Back.Out:return N.Back.In;case N.Back.InOut:return N.Back.InOut;case N.Bounce.In:return N.Bounce.Out;case N.Bounce.Out:return N.Bounce.In;case N.Bounce.InOut:return N.Bounce.InOut;default:return n}}const Ew=4,Tw=.001,Pw=1e-7,Aw=10,Oi=11,qs=1/(Oi-1),Mw=typeof Float32Array=="function";function nf(n,t){return 1-3*t+3*n}function sf(n,t){return 3*t-6*n}function rf(n){return 3*n}function Js(n,t,e){return((nf(t,e)*n+sf(t,e))*n+rf(t))*n}function of(n,t,e){return 3*nf(t,e)*n*n+2*sf(t,e)*n+rf(t)}function Dw(n,t,e,i,s){let r,o,a=0;do o=t+(e-t)/2,r=Js(o,i,s)-n,r>0?e=o:t=o;while(Math.abs(r)>Pw&&++a<Aw);return o}function Iw(n,t,e,i){for(let s=0;s<Ew;++s){const r=of(t,e,i);if(r===0)return t;const o=Js(t,e,i)-n;t-=o/r}return t}function Ow(n){return n}function Pa(n,t,e,i){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===i)return Ow;const s=Mw?new Float32Array(Oi):new Array(Oi);for(let o=0;o<Oi;++o)s[o]=Js(o*qs,n,e);function r(o){let a=0,c=1;const h=Oi-1;for(;c!==h&&s[c]<=o;++c)a+=qs;--c;const l=(o-s[c])/(s[c+1]-s[c]),u=a+l*qs,d=of(u,n,e);return d>=Tw?Iw(o,u,n,e):d===0?u:Dw(o,a,a+qs,n,e)}return o=>o===0||o===1?o:Js(r(o),t,i)}function Aa(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function af(n){const[t,e,i,s]=Aa(n);return[1-i,1-s,1-t,1-e]}function kw(n){return Pa(...Aa(n))}function Rw(n){return Pa(...af(n))}const Ne={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let i=t;i>1;i--)e*=i;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Ne.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,i,s){const r=(e-n)*.5,o=(i-t)*.5,a=s*s,c=s*a;return(2*t-2*e+r+o)*c+(-3*t+3*e-2*r-o)*a+r*s+t},QuadraticBezier:(n,t,e,i)=>{const s=1-i;return s*s*n+2*s*i*t+i*i*e},CubicBezier:(n,t,e,i,s)=>{const r=1-s;return r*r*r*n+3*r*r*s*t+3*r*s*s*e+s*s*s*i}},Linear:function(n,t){const e=n.length-1,i=e*t,s=Math.floor(i),r=Ne.Utils.Linear;return t<0?r(n[0],n[1],i):t>1?r(n[e],n[e-1],e-i):r(n[s],n[s+1>e?e:s+1],i-s)},Bezier:function(n,t){let e=0;const i=n.length-1,s=Math.pow,r=Ne.Utils.Bernstein;for(let o=0;o<=i;o++)e+=s(1-t,i-o)*s(t,o)*n[o]*r(i,o);return e},CatmullRom:function(n,t){const e=n.length-1;let i=e*t,s=Math.floor(i);const r=Ne.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(s=Math.floor(i=e*(1+t))),r(n[(s-1+e)%e],n[s],n[(s+1)%e],n[(s+2)%e],i-s)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],i-e)-n[e]):r(n[s?s-1:0],n[s],n[e<s+1?e:s+1],n[e<s+2?e:s+2],i-s)}};class cf{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=lt(),e=!1){const i=Object.keys(this._tweens);for(let s=0;s<i.length;s++){const r=this._tweens[i[s]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[i[s]]}return!!Object.keys(this._tweens).length}}const oe=new cf;class Ma{constructor(t,e=oe){this._object=t,this._group=e}_id=Ii.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=N.Linear.None;_interpolationFunction=Ne.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=lt()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,i,s){for(const r in i){const o=t[r],a=Array.isArray(o),c=a?"array":typeof o,h=!a&&Array.isArray(i[r]);if(!(c==="undefined"||c==="function")){if(h){let l=i[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,o)),i[r]=[o].concat(l)}if((c==="object"||a)&&o&&!h){e[r]=a?[]:{};for(const l in o)e[r][l]=o[l];s[r]=a?[]:{},this._setupProperties(o,e[r],i[r],s[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),h?s[r]=i[r].slice().reverse():s[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=lt()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=lt()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=oe){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=N.Linear.None){return this._easingFunction=t,this}interpolation(t=Ne.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=lt(),e=!0){if(this._isPaused)return!0;let i,s;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),s=(t-this._startTime)/this._durationTime,s=this._durationTime===0||s>1?1:s;const o=this._easingFunction(s);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,s),s===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,i,s){for(const r in i){if(e[r]===void 0)continue;const o=e[r]||0;let a=i[r];const c=Array.isArray(t[r]),h=Array.isArray(a);!c&&h?t[r]=this._interpolationFunction(a,s):typeof a=="object"&&a?this._updateProperties(t[r],o,a,s):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[r]=o+(a-o)*s))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=i,this._valuesEnd[t]=e}}const Lw=Ii.nextId,zw=oe.getAll.bind(oe),Nw=oe.removeAll.bind(oe),Fw=oe.add.bind(oe),Bw=oe.remove.bind(oe),Uw=oe.update.bind(oe),Vw={now:lt,Sequence:Ii,Easing:N,Interpolation:Ne,Group:cf,Tween:Ma,nextId:Lw,getAll:zw,removeAll:Nw,add:Fw,remove:Bw,update:Uw};class Da{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=lt(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=lt();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class ki{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Uy(this.tweens,(e,i)=>t?e.delay>i.delay:e.delay<=i.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(i=>{const s={...i};delete s.tween,s.fromValues={...s.fromValues},s.toValues={...s.toValues},e.push(s)}),e}addTween(t,e,i){const s={fromValues:t,toValues:e,frames:typeof i?.frames=="number"?i.frames:1,delay:typeof i?.delay=="number"?i.delay:this.tweens.length,easeFunction:i?.easeFunction||N.Linear.None,interpolationFunction:i?.interpolationFunction||Ne.Linear,repeat:typeof i?.repeat=="number"?i.repeat:0,yoyo:i?.yoyo||!1,onStart:i?.onStart||(()=>{}),onUpdate:i?.onUpdate||(()=>{}),onComplete:i?.onComplete||(()=>{})};return this.tweens.push(s),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Da,i=this.frameDuration;return new Promise(s=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Eg(r=>{if(!this.isPaused){const a=Math.max(0,r-this.pausedDuration),c=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(h=>h.delay*i<=c).forEach(h=>{h.tween||(h.tween=new Ma({...h.fromValues}).to({...h.toValues},h.frames*i).easing(h.easeFunction).interpolation(h.interpolationFunction).repeat(h.repeat).yoyo(h.yoyo).onStart(h.onStart).onUpdate(h.onUpdate).onComplete(h.onComplete),h.tween.start(a)),(h.delay+h.frames*(h.repeat+1))*i>c?h.tween.update(a):(h.tween.isPlaying()&&h.tween.end(),jh(t,h))})}const o=!!t.length;return o||(this.onGroupComplete?.(),s()),o})})}isPaused=!1;pausedClock=new Da;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(i=>{e=Math.max(e,i.delay+i.frames),i.easeFunction=ef(i.easeFunction);const s={...i.toValues};i.toValues={...i.fromValues},i.fromValues={...s}}),t.forEach(i=>{i.delay=e-i.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}/**
32
32
  * @vue/shared v3.5.13
@@ -103,7 +103,7 @@ Content-Type: `+f.type+`\r
103
103
  --sab:env(safe-area-inset-bottom, 0px);
104
104
  --sal:env(safe-area-inset-left, 0px);
105
105
  }
106
- `))}CS();function ES(){return rh(document.documentElement).pipe(ca(ra),dt(()=>{const n=getComputedStyle(document.documentElement);return{bottom:n.getPropertyValue("--sab"),top:n.getPropertyValue("--sat"),right:n.getPropertyValue("--sar"),left:n.getPropertyValue("--sal")}}))}function TS(n={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new ft(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((i,s)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),i()},r=>{s(r)})}).then(()=>{e=navigator.geolocation.watchPosition(i=>{t.next({longitude:i.coords.longitude,latitude:i.coords.latitude})},i=>{t.error(i)},n)}).catch(i=>{t.error(i)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function Pm(n,t={},e=[]){return typeof n=="string"?{tag:n,props:t,children:typeof e=="string"?e:e.filter(i=>typeof i!="boolean")}:n(t)}function Vr(n){const t=Pm(n.tagName,Jo(n),Array.from(n.children).map(e=>Vr(e)));return t.el=n,t}function Xe(n,t=document.documentElement){if(typeof n=="string"){const i=document.createTextNode(n);return t.appendChild(i),i}if(n.el)return n.el;const e=n.tag=="path"?Sa():document.createElement(n.tag);if(n.props)for(const[i,s]of Object.entries(n.props))i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),s):i==="style"?vi(e,s):Sn(e,i,s);return t.appendChild(e),n.el=e,n.children&&(typeof n.children=="string"?Xe(n.children,e):n.children.forEach(i=>{Xe(i,e)})),e}function es(n,t){typeof n=="string"||!n.el||(Array.isArray(n.children)&&n.children.forEach(e=>{n.el&&es(e,n.el)}),t.removeChild(n.el))}function Yr(n,t,e){if(!n.el||!t.el)return;e=e||n.el.parentElement||document.body||document.documentElement;const i=n.props.key,s=t.props.key;if(n.tag!==t.tag||n.el!==t.el||(s||i)&&s!==i){e.replaceChild(Xe(t,e),n.el);return}const r=t.el=n.el,o=n.props,a=t.props;for(const l in o)l in a||(l.startsWith("on")?r.removeEventListener(l.slice(2).toLowerCase(),o[l]):r.removeAttribute(l));for(const l in a){const u=o[l],d=a[l];if(d!=u)if(l.startsWith("on")){const f=l.slice(2).toLowerCase();r.removeEventListener(f,u),r.addEventListener(f,d)}else if(l==="style"){for(const f in u)f in d||qo(r,f);vi(r,d)}else Sn(r,l,d)}const c=n.children||[],h=t.children||[];if(typeof h=="string")r.innerHTML="",Xe(h,r);else if(typeof c=="string")r.innerHTML="",h.forEach(l=>{Xe(l,r)});else{const l=Math.min(c.length,h.length);for(let u=0;u<l;u++)Yr(c[u],h[u],r);h.length>c.length?h.slice(c.length).forEach(u=>{Xe(u,r)}):h.length<c.length&&c.slice(h.length).forEach(u=>{es(u,r)})}}function Am(n=document.documentElement,t,e){t.el?!e||!e.el?(es(t,n),Xe(t,n)):Yr(e,t,n):(e&&es(e,n),Xe(t,n))}const $r=new Map;function gh(n,t=$r){let e=t.get(n);return e||(e=Vr(n),t.set(n,e),e)}function Gr(n,t,e=$r){const i=gh(n,e);i.alternate||(i.alternate=Vr(n),Vn(i.alternate.props,i.props,!0)),t(i.alternate)}function Mm(n=$r){const t=Array.from(n.entries());for(const[e,i]of t){const s=i.alternate;s&&(Yr(i,s),i.props=s.props,i.alternate=void 0)}}function yh(n=$r){Mg(()=>Mm(n),50)}function PS(){const n=new Map;let t=null;const e=new Set;let i=!1;function s(p){const m=t,v=m.stateIndex;v in m.states||(m.states[v]=p);function y(b){let x;typeof b=="function"?x=b(m.states[v]):x=b,m.states[v]!==x&&(m.states[v]=x,l(m))}return m.stateIndex++,[m.states[v],y]}function r(p){const[m,v]=s({current:p});return m}function o(p,m){const v=t,y=v.effectIndex;v.pendingEffects||(v.pendingEffects=[]),v.pendingEffects.push({effect:p,deps:m,idx:y}),v.effectIndex++}function a(p){p.pendingEffects&&(p.pendingEffects.forEach(({effect:m,deps:v,idx:y})=>{const b=p.effects[y];if(!v||!b||!b.deps||v.length!==b.deps.length||v.some((w,C)=>w!==b.deps[C])){b.cleanup?.();const w=m();if(w instanceof Promise)throw new Error("useEffect callback must not return Promise");p.effects[y]={deps:v?[...v]:void 0,cleanup:w}}}),p.pendingEffects=[])}function c(p){const m=r(p);return m.current=p,h((...v)=>m.current(...v),[])}function h(p,m){const v=t,y=v.callbackIndex,b=v.callbacks[y]||{fn:p,deps:void 0};return(!m||!b.deps||m.length!==b.deps.length||m.some((w,C)=>w!==b.deps[C]))&&(b.fn=p,b.deps=m?[...m]:void 0),v.callbacks[y]=b,v.callbackIndex++,b.fn}function l(p){e.add(p),i||(i=!0,setTimeout(u,0))}function u(){for(;e.size;){const p=[...e];e.clear(),p.forEach(m=>{d(m.component,m.container,m.props)})}i=!1}function d(p,m,v={}){let y=n.get(m);!y||y.component!==p?(y={component:p,props:v,states:[],stateIndex:0,effects:[],effectIndex:0,pendingEffects:[],callbacks:[],callbackIndex:0,children:[],mounted:!1,container:m,vnode:void 0},n.set(m,y)):y.props=v,t=y,y.stateIndex=0,y.effectIndex=0,y.callbackIndex=0;const b=p(v);return Am(m,b,y.vnode),y.vnode=b,y.mounted=!0,t=null,a(y),y}function f(p){p.effects.forEach(m=>m.cleanup?.()),p.children&&p.children.forEach(f),p.container&&"innerHTML"in p.container&&(p.container.innerHTML=""),n.delete(p.container)}return{useState:s,useRef:r,useEffect:o,useEffectEvent:c,useCallback:h,render:d,unmount:f,scheduleRender:l}}function Dm(){let n;function t(d){n=d,d(),n=null}class e{subscribers=new Set;add(){n&&!this.subscribers.has(n)&&this.subscribers.add(n)}notify(){this.subscribers.forEach(f=>f())}}const i=new WeakMap;function s(d,f){let p=i.get(d);p||(p=new Map,i.set(d,p));let m=p.get(f);return m||(m=new e,p.set(f,m)),m}function r(d,f,p=o){if(!Array.isArray(d))return;const m=Array.prototype,v=Object.create(m);["push","pop","shift","unshift","splice","sort","reverse"].forEach(y=>{v[y]=function(...b){return["push","unshift","splice"].includes(y)&&(y==="splice"?b.slice(2):b).forEach((w,C)=>{bn(w)&&(b[C]=p(w)),f.add()}),m[y].apply(this,b),this.slice()}}),Object.setPrototypeOf(d,v),d.forEach((y,b)=>{bn(y)&&(d[b]=p(y)),f.add()})}function o(d){return Object.keys(d).forEach(f=>{const p=s(d,f);let m=d[f];Object.defineProperty(d,f,{configurable:!0,enumerable:!0,get(){return bn(m)&&(Array.isArray(m)?r(m,p,o):o(m)),p.add(),m},set(v){m!==v&&(m=v,p.notify())}})}),d}function a(d){return o({value:d})}const c=h;function h(d){if(!bn(d))return d;const f={get(m,v,y){let b=Reflect.get(m,v,y);const x=s(m,v);if(bn(b)&&!("isYZProxy"in b)){const w=h(b);Array.isArray(b)&&(w.YZProxyArrayDep=x),b=w}return x.add(),b},set(m,v,y,b){const x=Reflect.get(m,v,b),w=Reflect.set(m,v,y,b);if(v=="YZProxyArrayDep")return w;if(x!==y){let C;Array.isArray(m)?C=m.YZProxyArrayDep:C=s(m,v),C.notify()}return w},deleteProperty(m,v){if(!(v in m))return!1;let b=typeof v=="symbol"?void 0:m[v];bn(b)&&(b=Array.isArray(b)?[...b]:{...b});const x=Reflect.deleteProperty(m,v);if(x){let w;Array.isArray(m)?w=m.YZProxyArrayDep:w=s(m,v),w.notify()}return x},has(m,v){return v==="isYZProxy"||v in m}};return new Proxy(d,f)}function l(d,f){const p=h(d);return u(p,f),p}function u(d,f){f.childNodes.forEach(p=>{switch(p.nodeType){case 1:const m=p;[...m.attributes].forEach(x=>{const w=x.name,C=x.value;if(w==="v-model")if(ih(m)){const S=m;t(()=>{S.checked=Me(d,C)==S.value}),S.addEventListener("change",D=>{oo(d,C,D.target.value)})}else if(nh(m)){const S=m;t(()=>{S.checked=Xh(Me(d,C),S.value)}),S.addEventListener("change",D=>{const L=D.target,I=L.value;L.checked?ng(Me(d,C),I):jh(Me(d,C),I)})}else if(eh(m)){const S=m;t(()=>{S.value=Me(d,C)}),S.addEventListener("change",D=>{oo(d,C,D.target.value)})}else{const S=m;t(()=>{S.value=Me(d,C)});const D=L=>{oo(d,C,L.target.value)};S.addEventListener("input",D)}else w==="v-text"?t(()=>{m.innerText=Me(d,C)}):w==="v-html"&&t(()=>{m.innerHTML=Me(d,C)})}),m.childNodes.length>0&&u(d,m);break;case 3:const v=p.textContent||"",y=/\{\{\s*([^{}\s]+)\s*\}\}/g,b=y.exec(v);b&&b[1]&&t(()=>{p.textContent=v.replace(y,Me(d,b[1]))});break}})}return{watchEffect:t,reactiveVue2:o,ref:a,reactiveVue3:h,reactive:c,mvvm:l}}const AS=Dm();function Im(n,t,e){return new WebSocket(n)}function MS(n){return`${n}eventbus/${Sp(3)}/${Lh(8)}/websocket`}class Ce{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=Ce.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||Im,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=Ce.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===Ce.CONNECTING||this.socket?.readyState===Ce.OPEN||(this.state=Ce.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{Je(`(${this.url}) onopen`),this.state=Ce.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:i,wasClean:s}=t;Je(`(${this.url}) onclose: code(${e}) reason(${i}) wasClean(${s})`),this.state=Ce.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),ug(this.reconnectAttempts++)))},this.socket.onerror=t=>{Je(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(Je(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const i=t.data.substring(1);try{e=JSON.parse(i)}catch(s){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:s.toString(),message:i})]}e.forEach(s=>{const r=JSON.parse(s);if(r.body&&Object.prototype.hasOwnProperty.call(r.body,"requestid")){const o=this.waitings[r.body.requestid];o?o.resolve?.(r.body):re(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[r.address]){const o=this.listeners[r.address];for(let a=0;a<o.length;a++)r.type==="err"?o[a]({failureCode:r.failureCode,failureType:r.failureType,message:r.message}):o[a](null,r.body)}else this.onunhandled(r)})}else t.data instanceof ArrayBuffer?re(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&re(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===Ce.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,i={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1)})),this.listeners[t].push(e)}unregister(t,e,i={}){const s=this.listeners[t];if(s){const r=s.indexOf(e);r!=-1&&(s.splice(r,1),s.length===0&&(this._send({type:"unregister",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1)}),delete this.listeners[t]))}}publish(t,e,i={}){this._send({type:"publish",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1),body:e})}async send(t,e,i={},s=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,c)=>{r.resolve=a,this._send({type:"send",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1),body:{requestid:r.requestid,...e}}),setTimeout(()=>{c(`(${this.url}) send(${r.requestid}: ${ps(e)}) Timeout!`)},s)});return delete this.waitings[r.requestid],o}}function DS(n=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let i=100;const s=function(){t.style.height=window.innerHeight+"px";const r=t.clientWidth;t.dataset.width=r,t.dataset.layout=r>n?"pc":"mobile",t.dataset.rem=i=Math.min(100,Math.round(100*(r/n))),t.style.fontSize=i+"px"};s(),window.rem2px=function(r){return parseFloat(r)*i},window.px2rem=function(r){return parseFloat(r)/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",s,!1)}class IS{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new ts(t),this.remoteVideoUtil=new ts(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const s=void 0,r=new RTCPeerConnection(s);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(s);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const s=new RTCIceCandidate(i),r=this.getOtherPeer(e);r&&(r.addIceCandidate(s).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
106
+ `))}function ES(){return CS(),rh(document.documentElement).pipe(ca(ra),dt(()=>{const n=getComputedStyle(document.documentElement);return{bottom:n.getPropertyValue("--sab"),top:n.getPropertyValue("--sat"),right:n.getPropertyValue("--sar"),left:n.getPropertyValue("--sal")}}))}function TS(n={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new ft(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((i,s)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),i()},r=>{s(r)})}).then(()=>{e=navigator.geolocation.watchPosition(i=>{t.next({longitude:i.coords.longitude,latitude:i.coords.latitude})},i=>{t.error(i)},n)}).catch(i=>{t.error(i)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function Pm(n,t={},e=[]){return typeof n=="string"?{tag:n,props:t,children:typeof e=="string"?e:e.filter(i=>typeof i!="boolean")}:n(t)}function Vr(n){const t=Pm(n.tagName,Jo(n),Array.from(n.children).map(e=>Vr(e)));return t.el=n,t}function Xe(n,t=document.documentElement){if(typeof n=="string"){const i=document.createTextNode(n);return t.appendChild(i),i}if(n.el)return n.el;const e=n.tag=="path"?Sa():document.createElement(n.tag);if(n.props)for(const[i,s]of Object.entries(n.props))i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),s):i==="style"?vi(e,s):Sn(e,i,s);return t.appendChild(e),n.el=e,n.children&&(typeof n.children=="string"?Xe(n.children,e):n.children.forEach(i=>{Xe(i,e)})),e}function es(n,t){typeof n=="string"||!n.el||(Array.isArray(n.children)&&n.children.forEach(e=>{n.el&&es(e,n.el)}),t.removeChild(n.el))}function Yr(n,t,e){if(!n.el||!t.el)return;e=e||n.el.parentElement||document.body||document.documentElement;const i=n.props.key,s=t.props.key;if(n.tag!==t.tag||n.el!==t.el||(s||i)&&s!==i){e.replaceChild(Xe(t,e),n.el);return}const r=t.el=n.el,o=n.props,a=t.props;for(const l in o)l in a||(l.startsWith("on")?r.removeEventListener(l.slice(2).toLowerCase(),o[l]):r.removeAttribute(l));for(const l in a){const u=o[l],d=a[l];if(d!=u)if(l.startsWith("on")){const f=l.slice(2).toLowerCase();r.removeEventListener(f,u),r.addEventListener(f,d)}else if(l==="style"){for(const f in u)f in d||qo(r,f);vi(r,d)}else Sn(r,l,d)}const c=n.children||[],h=t.children||[];if(typeof h=="string")r.innerHTML="",Xe(h,r);else if(typeof c=="string")r.innerHTML="",h.forEach(l=>{Xe(l,r)});else{const l=Math.min(c.length,h.length);for(let u=0;u<l;u++)Yr(c[u],h[u],r);h.length>c.length?h.slice(c.length).forEach(u=>{Xe(u,r)}):h.length<c.length&&c.slice(h.length).forEach(u=>{es(u,r)})}}function Am(n=document.documentElement,t,e){t.el?!e||!e.el?(es(t,n),Xe(t,n)):Yr(e,t,n):(e&&es(e,n),Xe(t,n))}const $r=new Map;function gh(n,t=$r){let e=t.get(n);return e||(e=Vr(n),t.set(n,e),e)}function Gr(n,t,e=$r){const i=gh(n,e);i.alternate||(i.alternate=Vr(n),Vn(i.alternate.props,i.props,!0)),t(i.alternate)}function Mm(n=$r){const t=Array.from(n.entries());for(const[e,i]of t){const s=i.alternate;s&&(Yr(i,s),i.props=s.props,i.alternate=void 0)}}function yh(n=$r){Mg(()=>Mm(n),50)}function PS(){const n=new Map;let t=null;const e=new Set;let i=!1;function s(p){const m=t,v=m.stateIndex;v in m.states||(m.states[v]=p);function y(b){let x;typeof b=="function"?x=b(m.states[v]):x=b,m.states[v]!==x&&(m.states[v]=x,l(m))}return m.stateIndex++,[m.states[v],y]}function r(p){const[m,v]=s({current:p});return m}function o(p,m){const v=t,y=v.effectIndex;v.pendingEffects||(v.pendingEffects=[]),v.pendingEffects.push({effect:p,deps:m,idx:y}),v.effectIndex++}function a(p){p.pendingEffects&&(p.pendingEffects.forEach(({effect:m,deps:v,idx:y})=>{const b=p.effects[y];if(!v||!b||!b.deps||v.length!==b.deps.length||v.some((w,C)=>w!==b.deps[C])){b.cleanup?.();const w=m();if(w instanceof Promise)throw new Error("useEffect callback must not return Promise");p.effects[y]={deps:v?[...v]:void 0,cleanup:w}}}),p.pendingEffects=[])}function c(p){const m=r(p);return m.current=p,h((...v)=>m.current(...v),[])}function h(p,m){const v=t,y=v.callbackIndex,b=v.callbacks[y]||{fn:p,deps:void 0};return(!m||!b.deps||m.length!==b.deps.length||m.some((w,C)=>w!==b.deps[C]))&&(b.fn=p,b.deps=m?[...m]:void 0),v.callbacks[y]=b,v.callbackIndex++,b.fn}function l(p){e.add(p),i||(i=!0,setTimeout(u,0))}function u(){for(;e.size;){const p=[...e];e.clear(),p.forEach(m=>{d(m.component,m.container,m.props)})}i=!1}function d(p,m,v={}){let y=n.get(m);!y||y.component!==p?(y={component:p,props:v,states:[],stateIndex:0,effects:[],effectIndex:0,pendingEffects:[],callbacks:[],callbackIndex:0,children:[],mounted:!1,container:m,vnode:void 0},n.set(m,y)):y.props=v,t=y,y.stateIndex=0,y.effectIndex=0,y.callbackIndex=0;const b=p(v);return Am(m,b,y.vnode),y.vnode=b,y.mounted=!0,t=null,a(y),y}function f(p){p.effects.forEach(m=>m.cleanup?.()),p.children&&p.children.forEach(f),p.container&&"innerHTML"in p.container&&(p.container.innerHTML=""),n.delete(p.container)}return{useState:s,useRef:r,useEffect:o,useEffectEvent:c,useCallback:h,render:d,unmount:f,scheduleRender:l}}function Dm(){let n;function t(d){n=d,d(),n=null}class e{subscribers=new Set;add(){n&&!this.subscribers.has(n)&&this.subscribers.add(n)}notify(){this.subscribers.forEach(f=>f())}}const i=new WeakMap;function s(d,f){let p=i.get(d);p||(p=new Map,i.set(d,p));let m=p.get(f);return m||(m=new e,p.set(f,m)),m}function r(d,f,p=o){if(!Array.isArray(d))return;const m=Array.prototype,v=Object.create(m);["push","pop","shift","unshift","splice","sort","reverse"].forEach(y=>{v[y]=function(...b){return["push","unshift","splice"].includes(y)&&(y==="splice"?b.slice(2):b).forEach((w,C)=>{bn(w)&&(b[C]=p(w)),f.add()}),m[y].apply(this,b),this.slice()}}),Object.setPrototypeOf(d,v),d.forEach((y,b)=>{bn(y)&&(d[b]=p(y)),f.add()})}function o(d){return Object.keys(d).forEach(f=>{const p=s(d,f);let m=d[f];Object.defineProperty(d,f,{configurable:!0,enumerable:!0,get(){return bn(m)&&(Array.isArray(m)?r(m,p,o):o(m)),p.add(),m},set(v){m!==v&&(m=v,p.notify())}})}),d}function a(d){return o({value:d})}const c=h;function h(d){if(!bn(d))return d;const f={get(m,v,y){let b=Reflect.get(m,v,y);const x=s(m,v);if(bn(b)&&!("isYZProxy"in b)){const w=h(b);Array.isArray(b)&&(w.YZProxyArrayDep=x),b=w}return x.add(),b},set(m,v,y,b){const x=Reflect.get(m,v,b),w=Reflect.set(m,v,y,b);if(v=="YZProxyArrayDep")return w;if(x!==y){let C;Array.isArray(m)?C=m.YZProxyArrayDep:C=s(m,v),C.notify()}return w},deleteProperty(m,v){if(!(v in m))return!1;let b=typeof v=="symbol"?void 0:m[v];bn(b)&&(b=Array.isArray(b)?[...b]:{...b});const x=Reflect.deleteProperty(m,v);if(x){let w;Array.isArray(m)?w=m.YZProxyArrayDep:w=s(m,v),w.notify()}return x},has(m,v){return v==="isYZProxy"||v in m}};return new Proxy(d,f)}function l(d,f){const p=h(d);return u(p,f),p}function u(d,f){f.childNodes.forEach(p=>{switch(p.nodeType){case 1:const m=p;[...m.attributes].forEach(x=>{const w=x.name,C=x.value;if(w==="v-model")if(ih(m)){const S=m;t(()=>{S.checked=Me(d,C)==S.value}),S.addEventListener("change",D=>{oo(d,C,D.target.value)})}else if(nh(m)){const S=m;t(()=>{S.checked=Xh(Me(d,C),S.value)}),S.addEventListener("change",D=>{const L=D.target,I=L.value;L.checked?ng(Me(d,C),I):jh(Me(d,C),I)})}else if(eh(m)){const S=m;t(()=>{S.value=Me(d,C)}),S.addEventListener("change",D=>{oo(d,C,D.target.value)})}else{const S=m;t(()=>{S.value=Me(d,C)});const D=L=>{oo(d,C,L.target.value)};S.addEventListener("input",D)}else w==="v-text"?t(()=>{m.innerText=Me(d,C)}):w==="v-html"&&t(()=>{m.innerHTML=Me(d,C)})}),m.childNodes.length>0&&u(d,m);break;case 3:const v=p.textContent||"",y=/\{\{\s*([^{}\s]+)\s*\}\}/g,b=y.exec(v);b&&b[1]&&t(()=>{p.textContent=v.replace(y,Me(d,b[1]))});break}})}return{watchEffect:t,reactiveVue2:o,ref:a,reactiveVue3:h,reactive:c,mvvm:l}}const AS=Dm();function Im(n,t,e){return new WebSocket(n)}function MS(n){return`${n}eventbus/${Sp(3)}/${Lh(8)}/websocket`}class Ce{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=Ce.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||Im,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=Ce.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===Ce.CONNECTING||this.socket?.readyState===Ce.OPEN||(this.state=Ce.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{Je(`(${this.url}) onopen`),this.state=Ce.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:i,wasClean:s}=t;Je(`(${this.url}) onclose: code(${e}) reason(${i}) wasClean(${s})`),this.state=Ce.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),ug(this.reconnectAttempts++)))},this.socket.onerror=t=>{Je(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(Je(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const i=t.data.substring(1);try{e=JSON.parse(i)}catch(s){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:s.toString(),message:i})]}e.forEach(s=>{const r=JSON.parse(s);if(r.body&&Object.prototype.hasOwnProperty.call(r.body,"requestid")){const o=this.waitings[r.body.requestid];o?o.resolve?.(r.body):re(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[r.address]){const o=this.listeners[r.address];for(let a=0;a<o.length;a++)r.type==="err"?o[a]({failureCode:r.failureCode,failureType:r.failureType,message:r.message}):o[a](null,r.body)}else this.onunhandled(r)})}else t.data instanceof ArrayBuffer?re(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&re(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===Ce.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,i={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1)})),this.listeners[t].push(e)}unregister(t,e,i={}){const s=this.listeners[t];if(s){const r=s.indexOf(e);r!=-1&&(s.splice(r,1),s.length===0&&(this._send({type:"unregister",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1)}),delete this.listeners[t]))}}publish(t,e,i={}){this._send({type:"publish",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1),body:e})}async send(t,e,i={},s=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,c)=>{r.resolve=a,this._send({type:"send",address:t,headers:Vn(i,this.socketCreatorOptions.headers,!1),body:{requestid:r.requestid,...e}}),setTimeout(()=>{c(`(${this.url}) send(${r.requestid}: ${ps(e)}) Timeout!`)},s)});return delete this.waitings[r.requestid],o}}function DS(n=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let i=100;const s=function(){t.style.height=window.innerHeight+"px";const r=t.clientWidth;t.dataset.width=r,t.dataset.layout=r>n?"pc":"mobile",t.dataset.rem=i=Math.min(100,Math.round(100*(r/n))),t.style.fontSize=i+"px"};s(),window.rem2px=function(r){return parseFloat(r)*i},window.px2rem=function(r){return parseFloat(r)/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",s,!1)}class IS{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new ts(t),this.remoteVideoUtil=new ts(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const s=void 0,r=new RTCPeerConnection(s);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(s);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const s=new RTCIceCandidate(i),r=this.getOtherPeer(e);r&&(r.addIceCandidate(s).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
107
107
  ${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
108
108
  ${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
109
109
  ${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection: