@mindbowser_inc/ui-feedback-plugin 0.5.0 → 0.6.0

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.
@@ -1,4 +1,4 @@
1
- (function(mt,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(mt=typeof globalThis<"u"?globalThis:mt||self,et(mt.UIFeedbackPlugin={}))})(this,function(mt){"use strict";var bk=Object.defineProperty;var Uk=(mt,et,Qt)=>et in mt?bk(mt,et,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):mt[et]=Qt;var ut=(mt,et,Qt)=>Uk(mt,typeof et!="symbol"?et+"":et,Qt);var Nt,bt,pr,wr,an,mr;const et=new Set;let Qt={active:!1,userName:null,comments:[],replies:new Map,selectedCommentId:null,panelOpen:!1,filter:"open",config:{}};function AA(){return Qt}function Ie(A){Qt={...Qt,...A},et.forEach(e=>e(Qt))}function xu(A){return et.add(A),()=>et.delete(A)}function ku(){if(Qt.userName)return Qt.userName;const A=localStorage.getItem("ufp_user_name");return A?(Ie({userName:A}),A):null}function Lu(A){localStorage.setItem("ufp_user_name",A),Ie({userName:A})}function Du(A){try{const e=new URL(A);return e.origin+e.pathname}catch{return A}}function yB(A){return`
1
+ (function(mt,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(mt=typeof globalThis<"u"?globalThis:mt||self,et(mt.UIFeedbackPlugin={}))})(this,function(mt){"use strict";var bk=Object.defineProperty;var Uk=(mt,et,Qt)=>et in mt?bk(mt,et,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):mt[et]=Qt;var ut=(mt,et,Qt)=>Uk(mt,typeof et!="symbol"?et+"":et,Qt);var Nt,bt,pr,wr,cn,mr;const et=new Set;let Qt={active:!1,userName:null,comments:[],replies:new Map,selectedCommentId:null,panelOpen:!1,filter:"open",config:{}};function AA(){return Qt}function Ie(A){Qt={...Qt,...A},et.forEach(e=>e(Qt))}function xu(A){return et.add(A),()=>et.delete(A)}function ku(){if(Qt.userName)return Qt.userName;const A=localStorage.getItem("ufp_user_name");return A?(Ie({userName:A}),A):null}function Lu(A){localStorage.setItem("ufp_user_name",A),Ie({userName:A})}function Du(A){try{const e=new URL(A);return e.origin+e.pathname}catch{return A}}function yB(A){return`
2
2
  :host {
3
3
  --ufp-primary: ${A};
4
4
  --ufp-primary-dark: color-mix(in srgb, ${A} 80%, black);
@@ -577,17 +577,17 @@
577
577
  <button class="ufp-btn ufp-btn-primary" id="ufp-name-submit" disabled>Continue</button>
578
578
  </div>
579
579
  </div>
580
- `,A.appendChild(t);const r=t.querySelector("#ufp-name-input"),n=t.querySelector("#ufp-name-submit");r.addEventListener("input",()=>{n.disabled=r.value.trim().length===0});const s=()=>{const i=r.value.trim();i&&(Lu(i),t.remove(),e(i))};n.addEventListener("click",s),r.addEventListener("keydown",i=>{i.key==="Enter"&&s()}),requestAnimationFrame(()=>r.focus())})}const Kt="#6366f1",wA=3;function vr(A,e=1,t=1){switch(A.type){case"pen":{const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",UB(A.points,e,t)),r.setAttribute("stroke",A.color),r.setAttribute("stroke-width",String(A.width*Math.min(e,t))),r.setAttribute("fill","none"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r}case"rect":{const r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("x",String(A.x*e)),r.setAttribute("y",String(A.y*t)),r.setAttribute("width",String(A.width*e)),r.setAttribute("height",String(A.height*t)),r.setAttribute("stroke",A.color),r.setAttribute("stroke-width",String(A.strokeWidth*Math.min(e,t))),r.setAttribute("fill","none"),r.setAttribute("rx","3"),r}case"circle":{const r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",String(A.cx*e)),r.setAttribute("cy",String(A.cy*t)),r.setAttribute("rx",String(A.rx*e)),r.setAttribute("ry",String(A.ry*t)),r.setAttribute("stroke",A.color),r.setAttribute("stroke-width",String(A.strokeWidth*Math.min(e,t))),r.setAttribute("fill","none"),r}case"arrow":{const r=document.createElementNS("http://www.w3.org/2000/svg","g"),n=document.createElementNS("http://www.w3.org/2000/svg","line");return n.setAttribute("x1",String(A.x1*e)),n.setAttribute("y1",String(A.y1*t)),n.setAttribute("x2",String(A.x2*e)),n.setAttribute("y2",String(A.y2*t)),n.setAttribute("stroke",A.color),n.setAttribute("stroke-width",String(A.width*Math.min(e,t))),n.setAttribute("marker-end","url(#ufp-arrowhead)"),r.appendChild(n),r}}}function bB(A,e,t,r){const n=t/e.pageWidth,s=r/e.pageHeight;A.innerHTML="";const i=document.createElementNS("http://www.w3.org/2000/svg","defs");i.innerHTML=`
580
+ `,A.appendChild(t);const r=t.querySelector("#ufp-name-input"),n=t.querySelector("#ufp-name-submit");r.addEventListener("input",()=>{n.disabled=r.value.trim().length===0});const s=()=>{const i=r.value.trim();i&&(Lu(i),t.remove(),e(i))};n.addEventListener("click",s),r.addEventListener("keydown",i=>{i.key==="Enter"&&s()}),requestAnimationFrame(()=>r.focus())})}const Kt="#6366f1",wA=3;function br(A,e=1,t=1){switch(A.type){case"pen":{const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",UB(A.points,e,t)),r.setAttribute("stroke",A.color),r.setAttribute("stroke-width",String(A.width*Math.min(e,t))),r.setAttribute("fill","none"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r}case"rect":{const r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("x",String(A.x*e)),r.setAttribute("y",String(A.y*t)),r.setAttribute("width",String(A.width*e)),r.setAttribute("height",String(A.height*t)),r.setAttribute("stroke",A.color),r.setAttribute("stroke-width",String(A.strokeWidth*Math.min(e,t))),r.setAttribute("fill","none"),r.setAttribute("rx","3"),r}case"circle":{const r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",String(A.cx*e)),r.setAttribute("cy",String(A.cy*t)),r.setAttribute("rx",String(A.rx*e)),r.setAttribute("ry",String(A.ry*t)),r.setAttribute("stroke",A.color),r.setAttribute("stroke-width",String(A.strokeWidth*Math.min(e,t))),r.setAttribute("fill","none"),r}case"arrow":{const r=document.createElementNS("http://www.w3.org/2000/svg","g"),n=document.createElementNS("http://www.w3.org/2000/svg","line");return n.setAttribute("x1",String(A.x1*e)),n.setAttribute("y1",String(A.y1*t)),n.setAttribute("x2",String(A.x2*e)),n.setAttribute("y2",String(A.y2*t)),n.setAttribute("stroke",A.color),n.setAttribute("stroke-width",String(A.width*Math.min(e,t))),n.setAttribute("marker-end","url(#ufp-arrowhead)"),r.appendChild(n),r}}}function bB(A,e,t,r){const n=t/e.pageWidth,s=r/e.pageHeight;A.innerHTML="";const i=document.createElementNS("http://www.w3.org/2000/svg","defs");i.innerHTML=`
581
581
  <marker id="ufp-arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
582
582
  <polygon points="0 0, 10 3.5, 0 7" fill="${Kt}" />
583
583
  </marker>
584
- `,A.appendChild(i),e.shapes.forEach(o=>{A.appendChild(vr(o,n,s))})}function UB(A,e,t){if(A.length===0)return"";if(A.length===1){const n=A[0];return`M ${n.x*e} ${n.y*t}`}let r=`M ${A[0].x*e} ${A[0].y*t}`;for(let n=1;n<A.length;n++)r+=` L ${A[n].x*e} ${A[n].y*t}`;return r}function QB(A,e,t){if(window.scrollY===0)return null;const r=window.innerWidth,n=window.innerHeight,s=document.elementsFromPoint(A,e).find(i=>i!==t);for(let i=s??null;i&&i!==document.documentElement;i=i.parentElement){const o=getComputedStyle(i);if(o.position!=="fixed"&&o.position!=="sticky")continue;const a=i.getBoundingClientRect();if(!(a.width>=r*.9&&a.height>=n*.9)){if(o.position==="sticky"){if(a.top<n*.25)return"top";continue}return n-a.bottom<a.top?"bottom":"top"}}return null}function IB(A,e){if(!e)return A;switch(A.type){case"pen":return{...A,points:A.points.map(t=>({x:t.x,y:t.y+e}))};case"rect":return{...A,y:A.y+e};case"circle":return{...A,cy:A.cy+e};case"arrow":return{...A,y1:A.y1+e,y2:A.y2+e}}}function FB(A){return new Promise(e=>{let t="pen";const r=[];let n=!1,s=0,i=0,o=[],a=null,l=null,u=!1,d=0;const g=[];let p=null;const w=()=>p?{x:0,y:0}:{x:window.scrollX,y:window.scrollY},y=document.createElement("div");y.style.cssText="position:fixed;inset:0;z-index:2147483645;cursor:crosshair;background:rgba(99,102,241,0.04);touch-action:none;user-select:none;-webkit-user-select:none;";const B=document.createElementNS("http://www.w3.org/2000/svg","svg");B.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;",B.innerHTML=`
584
+ `,A.appendChild(i),e.shapes.forEach(o=>{A.appendChild(br(o,n,s))})}function UB(A,e,t){if(A.length===0)return"";if(A.length===1){const n=A[0];return`M ${n.x*e} ${n.y*t}`}let r=`M ${A[0].x*e} ${A[0].y*t}`;for(let n=1;n<A.length;n++)r+=` L ${A[n].x*e} ${A[n].y*t}`;return r}function QB(A,e,t){if(window.scrollX===0&&window.scrollY===0)return null;const r=window.innerWidth,n=window.innerHeight,s=document.elementsFromPoint(A,e).find(i=>i!==t);for(let i=s??null;i&&i!==document.documentElement;i=i.parentElement){const o=getComputedStyle(i);if(o.position!=="fixed"&&o.position!=="sticky")continue;const a=i.getBoundingClientRect();if(!(a.width>=r*.9&&a.height>=n*.9)){if(o.position==="sticky"){if(a.top<n*.25)return"top";continue}return n-a.bottom<a.top?"bottom":"top"}}return null}function IB(A,e,t){if(!e&&!t)return A;switch(A.type){case"pen":return{...A,points:A.points.map(r=>({x:r.x+e,y:r.y+t}))};case"rect":return{...A,x:A.x+e,y:A.y+t};case"circle":return{...A,cx:A.cx+e,cy:A.cy+t};case"arrow":return{...A,x1:A.x1+e,y1:A.y1+t,x2:A.x2+e,y2:A.y2+t}}}function FB(A){return new Promise(e=>{let t="pen";const r=[];let n=!1,s=0,i=0,o=[],a=null,l=null,u=!1,d=0;const g=[];let p=null;const w=()=>p?{x:0,y:0}:{x:window.scrollX,y:window.scrollY},y=document.createElement("div");y.style.cssText="position:fixed;inset:0;z-index:2147483645;cursor:crosshair;background:rgba(99,102,241,0.04);touch-action:none;user-select:none;-webkit-user-select:none;";const B=document.createElementNS("http://www.w3.org/2000/svg","svg");B.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;",B.innerHTML=`
585
585
  <defs>
586
586
  <marker id="ufp-arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
587
587
  <polygon points="0 0, 10 3.5, 0 7" fill="${Kt}" />
588
588
  </marker>
589
589
  </defs>
590
- `,y.appendChild(B);const b=document.createElementNS("http://www.w3.org/2000/svg","g");B.appendChild(b);const S=document.createElementNS("http://www.w3.org/2000/svg","g");B.appendChild(S);const I=()=>b.setAttribute("transform",`translate(${-window.scrollX} ${-window.scrollY})`);I(),window.addEventListener("scroll",I,{passive:!0});function R(){window.removeEventListener("scroll",I);for(const j of U)window.removeEventListener(j,Ce,!0);for(const j of Q)window.removeEventListener(j,E,!0);y.remove(),v.remove(),l==null||l.remove()}function K(){b.innerHTML="",S.innerHTML="",r.forEach((j,re)=>(g[re]?S:b).appendChild(vr(j)))}function P(){let j=0,re=0,ce=0;return r.forEach((Y,le)=>{const te=g[le]?0:window.scrollX,Mt=g[le]?0:window.scrollY;if(Y.type==="pen"&&Y.points.length){const Ut=Y.points[Y.points.length-1];j+=Ut.x-te,re+=Ut.y-Mt,ce++}else Y.type==="rect"?(j+=Y.x+Y.width-te,re+=Y.y+Y.height-Mt,ce++):Y.type==="circle"?(j+=Y.cx-te,re+=Y.cy-Mt,ce++):Y.type==="arrow"&&(j+=Y.x2-te,re+=Y.y2-Mt,ce++)}),{anchorX:ce>0?j/ce:window.innerWidth/2,anchorY:ce>0?re/ce:window.innerHeight/2}}function _(){u=!0,n=!1,y.style.pointerEvents="none",v.style.pointerEvents="none",C()}function C(){l&&l.remove();const{anchorX:j,anchorY:re}=P(),ce=300,Y=12;let le=j+Y,te=re+Y;le+ce>window.innerWidth-Y&&(le=j-ce-Y),le<Y&&(le=Y),te+210>window.innerHeight-Y&&(te=window.innerHeight-210-Y),te<Y&&(te=Y),l=document.createElement("div"),l.style.cssText=`
590
+ `,y.appendChild(B);const b=document.createElementNS("http://www.w3.org/2000/svg","g");B.appendChild(b);const S=document.createElementNS("http://www.w3.org/2000/svg","g");B.appendChild(S);const I=()=>b.setAttribute("transform",`translate(${-window.scrollX} ${-window.scrollY})`);I(),window.addEventListener("scroll",I,{passive:!0});function R(){window.removeEventListener("scroll",I);for(const j of U)window.removeEventListener(j,Ce,!0);for(const j of Q)window.removeEventListener(j,E,!0);y.remove(),v.remove(),l==null||l.remove()}function K(){b.innerHTML="",S.innerHTML="",r.forEach((j,re)=>(g[re]?S:b).appendChild(br(j)))}function P(){let j=0,re=0,ce=0;return r.forEach((Y,le)=>{const te=g[le]?0:window.scrollX,Mt=g[le]?0:window.scrollY;if(Y.type==="pen"&&Y.points.length){const Ut=Y.points[Y.points.length-1];j+=Ut.x-te,re+=Ut.y-Mt,ce++}else Y.type==="rect"?(j+=Y.x+Y.width-te,re+=Y.y+Y.height-Mt,ce++):Y.type==="circle"?(j+=Y.cx-te,re+=Y.cy-Mt,ce++):Y.type==="arrow"&&(j+=Y.x2-te,re+=Y.y2-Mt,ce++)}),{anchorX:ce>0?j/ce:window.innerWidth/2,anchorY:ce>0?re/ce:window.innerHeight/2}}function _(){u=!0,n=!1,y.style.pointerEvents="none",v.style.pointerEvents="none",C()}function C(){l&&l.remove();const{anchorX:j,anchorY:re}=P(),ce=300,Y=12;let le=j+Y,te=re+Y;le+ce>window.innerWidth-Y&&(le=j-ce-Y),le<Y&&(le=Y),te+210>window.innerHeight-Y&&(te=window.innerHeight-210-Y),te<Y&&(te=Y),l=document.createElement("div"),l.style.cssText=`
591
591
  position:fixed;left:${le}px;top:${te}px;z-index:2147483647;
592
592
  background:#fff;border-radius:12px;padding:16px;width:${ce}px;
593
593
  box-shadow:0 4px 24px rgba(0,0,0,0.18);
@@ -609,7 +609,7 @@
609
609
  font-family:inherit;cursor:pointer;background:#6366f1;border:none;
610
610
  color:#fff;opacity:0.45;transition:opacity 0.15s;">Submit</button>
611
611
  </div>
612
- `,A.appendChild(l);const Mt=l.querySelector("#ufp-inline-text"),Ut=l.querySelector("#ufp-popup-submit"),ou=l.querySelector("#ufp-popup-cancel");Mt.addEventListener("input",()=>{const tA=Mt.value.trim().length>0;Ut.disabled=!tA,Ut.style.opacity=tA?"1":"0.45"}),Ut.addEventListener("click",()=>{const tA=Mt.value.trim();if(!tA)return;const au=P();R();const cu=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),cn=r.map((ln,Ts)=>IB(ln,g[Ts]==="bottom"?cu:0));e({shapes:cn,text:tA,...au})}),ou.addEventListener("click",()=>{R(),e(null)}),requestAnimationFrame(()=>Mt.focus())}const v=TB(A,j=>{t=j},()=>{R(),e(null)},()=>{r.length!==0&&(l&&(l.remove(),l=null,y.style.pointerEvents="auto",v.style.pointerEvents="auto",u=!1),r.pop(),g.pop(),K())});A.appendChild(y);const U=["pointerdown","pointermove","pointerup","pointercancel"],Q=["mousedown","mouseup","click","dblclick","auxclick","touchstart","touchmove","contextmenu","dragstart","selectstart"];function F(j){const re=j.composedPath();return re.includes(A.host)&&!re.includes(y)}function E(j){F(j)||u&&performance.now()>d||(j.preventDefault(),j.stopPropagation())}function Ce(j){if(u||F(j))return;j.stopPropagation();const re=j;j.type==="pointerdown"?pt(re):j.type==="pointermove"?fA(re):j.type==="pointerup"?Br(re):j.type==="pointercancel"&&(n=!1,a&&(a.remove(),a=null))}function pt(j){if(j.button===0){j.preventDefault();try{y.setPointerCapture(j.pointerId)}catch{}n=!0,p=QB(j.clientX,j.clientY,A.host),s=j.clientX+w().x,i=j.clientY+w().y,t==="pen"&&(o=[{x:s,y:i}])}}function fA(j){if(!n)return;const re=j.clientX+w().x,ce=j.clientY+w().y;if(a&&a.remove(),t==="pen")o.push({x:re,y:ce}),a=vr({type:"pen",points:[...o],color:Kt,width:wA});else if(t==="rect"){const Y={type:"rect",x:Math.min(s,re),y:Math.min(i,ce),width:Math.abs(re-s),height:Math.abs(ce-i),color:Kt,strokeWidth:wA};a=vr(Y)}else if(t==="circle"){const Y=Math.abs(re-s)/2,le=Math.abs(ce-i)/2,te={type:"circle",cx:Math.min(s,re)+Y,cy:Math.min(i,ce)+le,rx:Y,ry:le,color:Kt,strokeWidth:wA};a=vr(te)}else t==="arrow"&&(a=vr({type:"arrow",x1:s,y1:i,x2:re,y2:ce,color:Kt,width:wA}));a&&(p?S:b).appendChild(a)}function Br(j){if(!n)return;d=performance.now()+400,n=!1,a&&(a.remove(),a=null);const re=j.clientX+w().x,ce=j.clientY+w().y;let Y=!1;if(t==="pen"&&o.length>1)r.push({type:"pen",points:[...o],color:Kt,width:wA}),o=[],Y=!0;else if(t==="rect"){const le=Math.abs(re-s),te=Math.abs(ce-i);le>4&&te>4&&(r.push({type:"rect",x:Math.min(s,re),y:Math.min(i,ce),width:le,height:te,color:Kt,strokeWidth:wA}),Y=!0)}else if(t==="circle"){const le=Math.abs(re-s)/2,te=Math.abs(ce-i)/2;le>4&&te>4&&(r.push({type:"circle",cx:Math.min(s,re)+le,cy:Math.min(i,ce)+te,rx:le,ry:te,color:Kt,strokeWidth:wA}),Y=!0)}else t==="arrow"&&Math.sqrt((re-s)**2+(ce-i)**2)>10&&(r.push({type:"arrow",x1:s,y1:i,x2:re,y2:ce,color:Kt,width:wA}),Y=!0);Y&&(g.push(p),K(),_())}for(const j of U)window.addEventListener(j,Ce,{capture:!0,passive:!1});for(const j of Q)window.addEventListener(j,E,{capture:!0,passive:!1})})}function TB(A,e,t,r){const n=document.createElement("div");return n.className="ufp-toolbar",n.innerHTML=`
612
+ `,A.appendChild(l);const Mt=l.querySelector("#ufp-inline-text"),Ut=l.querySelector("#ufp-popup-submit"),iu=l.querySelector("#ufp-popup-cancel");Mt.addEventListener("input",()=>{const tA=Mt.value.trim().length>0;Ut.disabled=!tA,Ut.style.opacity=tA?"1":"0.45"}),Ut.addEventListener("click",()=>{const tA=Mt.value.trim();if(!tA)return;const ou=P();R();const au=r.map((yr,ln)=>g[ln]?yr:IB(yr,-window.scrollX,-window.scrollY));e({shapes:au,text:tA,...ou})}),iu.addEventListener("click",()=>{R(),e(null)}),requestAnimationFrame(()=>Mt.focus())}const v=TB(A,j=>{t=j},()=>{R(),e(null)},()=>{r.length!==0&&(l&&(l.remove(),l=null,y.style.pointerEvents="auto",v.style.pointerEvents="auto",u=!1),r.pop(),g.pop(),K())});A.appendChild(y);const U=["pointerdown","pointermove","pointerup","pointercancel"],Q=["mousedown","mouseup","click","dblclick","auxclick","touchstart","touchmove","contextmenu","dragstart","selectstart"];function F(j){const re=j.composedPath();return re.includes(A.host)&&!re.includes(y)}function E(j){F(j)||u&&performance.now()>d||(j.preventDefault(),j.stopPropagation())}function Ce(j){if(u||F(j))return;j.stopPropagation();const re=j;j.type==="pointerdown"?pt(re):j.type==="pointermove"?fA(re):j.type==="pointerup"?Br(re):j.type==="pointercancel"&&(n=!1,a&&(a.remove(),a=null))}function pt(j){if(j.button===0){j.preventDefault();try{y.setPointerCapture(j.pointerId)}catch{}n=!0,p=QB(j.clientX,j.clientY,A.host),s=j.clientX+w().x,i=j.clientY+w().y,t==="pen"&&(o=[{x:s,y:i}])}}function fA(j){if(!n)return;const re=j.clientX+w().x,ce=j.clientY+w().y;if(a&&a.remove(),t==="pen")o.push({x:re,y:ce}),a=br({type:"pen",points:[...o],color:Kt,width:wA});else if(t==="rect"){const Y={type:"rect",x:Math.min(s,re),y:Math.min(i,ce),width:Math.abs(re-s),height:Math.abs(ce-i),color:Kt,strokeWidth:wA};a=br(Y)}else if(t==="circle"){const Y=Math.abs(re-s)/2,le=Math.abs(ce-i)/2,te={type:"circle",cx:Math.min(s,re)+Y,cy:Math.min(i,ce)+le,rx:Y,ry:le,color:Kt,strokeWidth:wA};a=br(te)}else t==="arrow"&&(a=br({type:"arrow",x1:s,y1:i,x2:re,y2:ce,color:Kt,width:wA}));a&&(p?S:b).appendChild(a)}function Br(j){if(!n)return;d=performance.now()+400,n=!1,a&&(a.remove(),a=null);const re=j.clientX+w().x,ce=j.clientY+w().y;let Y=!1;if(t==="pen"&&o.length>1)r.push({type:"pen",points:[...o],color:Kt,width:wA}),o=[],Y=!0;else if(t==="rect"){const le=Math.abs(re-s),te=Math.abs(ce-i);le>4&&te>4&&(r.push({type:"rect",x:Math.min(s,re),y:Math.min(i,ce),width:le,height:te,color:Kt,strokeWidth:wA}),Y=!0)}else if(t==="circle"){const le=Math.abs(re-s)/2,te=Math.abs(ce-i)/2;le>4&&te>4&&(r.push({type:"circle",cx:Math.min(s,re)+le,cy:Math.min(i,ce)+te,rx:le,ry:te,color:Kt,strokeWidth:wA}),Y=!0)}else t==="arrow"&&Math.sqrt((re-s)**2+(ce-i)**2)>10&&(r.push({type:"arrow",x1:s,y1:i,x2:re,y2:ce,color:Kt,width:wA}),Y=!0);Y&&(g.push(p),K(),_())}for(const j of U)window.addEventListener(j,Ce,{capture:!0,passive:!1});for(const j of Q)window.addEventListener(j,E,{capture:!0,passive:!1})})}function TB(A,e,t,r){const n=document.createElement("div");return n.className="ufp-toolbar",n.innerHTML=`
613
613
  <span class="ufp-toolbar-label">Draw to annotate</span>
614
614
  <div class="ufp-toolbar-sep"></div>
615
615
  <button class="ufp-btn-icon active" data-tool="pen" title="Pen">
@@ -636,11 +636,11 @@
636
636
  </button>
637
637
  <div class="ufp-toolbar-sep"></div>
638
638
  <button class="ufp-btn ufp-btn-ghost" id="ufp-cancel-btn">Cancel</button>
639
- `,n.querySelectorAll("[data-tool]").forEach(s=>{s.addEventListener("click",()=>{n.querySelectorAll("[data-tool]").forEach(i=>i.classList.remove("active")),s.classList.add("active"),e(s.dataset.tool)})}),n.querySelector("#ufp-undo-btn").addEventListener("click",r),n.querySelector("#ufp-cancel-btn").addEventListener("click",t),A.appendChild(n),n}function oa(A){const e=Date.now()-A,t=Math.floor(e/1e3);if(t<60)return"just now";const r=Math.floor(t/60);if(r<60)return`${r}m ago`;const n=Math.floor(r/60);if(n<24)return`${n}h ago`;const s=Math.floor(n/24);return s<7?`${s}d ago`:new Date(A).toLocaleDateString()}function aa(A){return A.split(" ").filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join("")}function NA(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function SB(A,e,t,r){let n=[...e];const s=document.createElement("div");s.className="ufp-replies";const i=p=>{const w=s.querySelector(".ufp-replies-list");w&&w.remove();const y=document.createElement("div");if(y.className="ufp-replies-list",y.style.cssText="display:flex;flex-direction:column;gap:12px;",p.length>0){const B=document.createElement("div");B.className="ufp-replies-title",B.textContent=`${p.length} ${p.length===1?"Reply":"Replies"}`,y.appendChild(B),p.forEach(b=>{const S=document.createElement("div");S.className="ufp-reply",S.innerHTML=`
639
+ `,n.querySelectorAll("[data-tool]").forEach(s=>{s.addEventListener("click",()=>{n.querySelectorAll("[data-tool]").forEach(i=>i.classList.remove("active")),s.classList.add("active"),e(s.dataset.tool)})}),n.querySelector("#ufp-undo-btn").addEventListener("click",r),n.querySelector("#ufp-cancel-btn").addEventListener("click",t),A.appendChild(n),n}function ia(A){const e=Date.now()-A,t=Math.floor(e/1e3);if(t<60)return"just now";const r=Math.floor(t/60);if(r<60)return`${r}m ago`;const n=Math.floor(r/60);if(n<24)return`${n}h ago`;const s=Math.floor(n/24);return s<7?`${s}d ago`:new Date(A).toLocaleDateString()}function oa(A){return A.split(" ").filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join("")}function NA(A){return A.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function SB(A,e,t,r){let n=[...e];const s=document.createElement("div");s.className="ufp-replies";const i=p=>{const w=s.querySelector(".ufp-replies-list");w&&w.remove();const y=document.createElement("div");if(y.className="ufp-replies-list",y.style.cssText="display:flex;flex-direction:column;gap:12px;",p.length>0){const B=document.createElement("div");B.className="ufp-replies-title",B.textContent=`${p.length} ${p.length===1?"Reply":"Replies"}`,y.appendChild(B),p.forEach(b=>{const S=document.createElement("div");S.className="ufp-reply",S.innerHTML=`
640
640
  <div class="ufp-reply-meta">
641
- <div class="ufp-avatar" style="width:22px;height:22px;font-size:10px;">${aa(b.authorName)}</div>
641
+ <div class="ufp-avatar" style="width:22px;height:22px;font-size:10px;">${oa(b.authorName)}</div>
642
642
  <span class="ufp-reply-author">${NA(b.authorName)}</span>
643
- <span class="ufp-reply-time">${oa(b.createdAt)}</span>
643
+ <span class="ufp-reply-time">${ia(b.createdAt)}</span>
644
644
  </div>
645
645
  <div class="ufp-reply-text">${NA(b.text)}</div>
646
646
  `,y.appendChild(S)})}s.insertBefore(y,s.querySelector(".ufp-reply-input-area"))},o=document.createElement("div");o.className="ufp-reply-input-area";const a=ku();o.innerHTML=`
@@ -696,10 +696,10 @@
696
696
  <div class="ufp-detail-body">
697
697
  <div class="ufp-detail-comment">
698
698
  <div class="ufp-comment-meta">
699
- <div class="ufp-avatar">${aa(e.authorName)}</div>
699
+ <div class="ufp-avatar">${oa(e.authorName)}</div>
700
700
  <div>
701
701
  <div class="ufp-comment-author">${NA(e.authorName)}</div>
702
- <div class="ufp-comment-time">${oa(e.createdAt)}</div>
702
+ <div class="ufp-comment-time">${ia(e.createdAt)}</div>
703
703
  </div>
704
704
  </div>
705
705
  <div class="ufp-detail-comment-text">${NA(e.text)}</div>
@@ -747,10 +747,10 @@
747
747
  `;return}for(const u of l){if(!s.has(u.id))try{s.set(u.id,await e.getReplies(u.id))}catch{s.set(u.id,[])}n.appendChild(kB(u,s,A,e))}};return xu(async o=>{r.classList.toggle("open",o.panelOpen),o.panelOpen&&await i(o.comments,o.filter)}),r}function kB(A,e,t,r,n){const s=e.get(A.id)??[],i=document.createElement("div");return i.className="ufp-comment-card",i.dataset.id=A.id,i.innerHTML=`
748
748
  <div class="ufp-comment-card-header">
749
749
  <div class="ufp-comment-meta">
750
- <div class="ufp-avatar">${aa(A.authorName)}</div>
750
+ <div class="ufp-avatar">${oa(A.authorName)}</div>
751
751
  <div>
752
752
  <div class="ufp-comment-author">${NA(A.authorName)}</div>
753
- <div class="ufp-comment-time">${oa(A.createdAt)}</div>
753
+ <div class="ufp-comment-time">${ia(A.createdAt)}</div>
754
754
  </div>
755
755
  </div>
756
756
  ${A.resolved?'<span class="ufp-resolved-badge">Resolved</span>':""}
@@ -762,23 +762,23 @@
762
762
  ${s.length>0?`${s.length} ${s.length===1?"reply":"replies"}`:"No replies yet — click to reply"}
763
763
  </span>
764
764
  </div>
765
- `,i.addEventListener("click",async()=>{let o=e.get(A.id)??[];try{o=await r.getReplies(A.id),e.set(A.id,o)}catch(a){console.error("[ui-feedback-plugin] Failed to fetch replies:",a)}RB(t,A,o,r,a=>{const l=AA();Ie({comments:l.comments.map(u=>u.id===a?{...u,resolved:!0}:u)})},a=>{const l=AA();Ie({comments:l.comments.map(u=>u.id===a?{...u,resolved:!1}:u)})},a=>{const l=AA();Ie({comments:l.comments.filter(u=>u.id!==a)}),e.delete(a)},a=>{const l=e.get(A.id)??[];e.set(A.id,[...l,a]);const u=AA();Ie({comments:[...u.comments]})})}),i}async function LB(){try{const A=await DB();return await HB(A)}catch(A){return console.error("[ui-feedback-plugin] capturePageScreenshot failed:",A),OB()}}async function DB(){return(await Promise.resolve().then(()=>eU)).default}async function HB(A){const e=window.scrollX,t=window.scrollY;window.scrollTo(0,0);try{return(await A(document.body,{allowTaint:!1,useCORS:!0,logging:!1,scale:Math.min(window.devicePixelRatio,2),width:document.documentElement.scrollWidth,height:document.documentElement.scrollHeight,windowWidth:document.documentElement.scrollWidth,windowHeight:document.documentElement.scrollHeight,x:0,y:0,ignoreElements:n=>n.tagName==="UI-FEEDBACK-PLUGIN"})).toDataURL("image/png")}finally{window.scrollTo(e,t)}}function OB(){const A=document.createElement("canvas");A.width=window.innerWidth,A.height=window.innerHeight;const e=A.getContext("2d");return e.fillStyle="#f3f4f6",e.fillRect(0,0,A.width,A.height),e.fillStyle="#9ca3af",e.font="16px -apple-system, sans-serif",e.textAlign="center",e.fillText("Screenshot unavailable",A.width/2,A.height/2),A.toDataURL("image/png")}async function PB(A,e){try{const t=await new Promise((a,l)=>{const u=new Image;u.onload=()=>a(u),u.onerror=()=>l(new Error("screenshot failed to load")),u.src=A}),r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const n=r.getContext("2d");n.drawImage(t,0,0);const s=r.width/e.pageWidth,i=r.height/e.pageHeight,o=Math.min(s,i);n.lineCap="round",n.lineJoin="round";for(const a of e.shapes)switch(n.strokeStyle=a.color,n.fillStyle=a.color,n.beginPath(),a.type){case"pen":{n.lineWidth=a.width*o,a.points.forEach((l,u)=>u===0?n.moveTo(l.x*s,l.y*i):n.lineTo(l.x*s,l.y*i)),n.stroke();break}case"rect":{n.lineWidth=a.strokeWidth*o,n.roundRect(a.x*s,a.y*i,a.width*s,a.height*i,3*o),n.stroke();break}case"circle":{n.lineWidth=a.strokeWidth*o,n.ellipse(a.cx*s,a.cy*i,a.rx*s,a.ry*i,0,0,Math.PI*2),n.stroke();break}case"arrow":{const l=a.width*o,u=a.x1*s,d=a.y1*i,g=a.x2*s,p=a.y2*i;n.lineWidth=l,n.lineCap="butt",n.moveTo(u,d),n.lineTo(g,p),n.stroke(),n.lineCap="round";const w=Math.hypot(g-u,p-d)||1,y=(g-u)/w,B=(p-d)/w,b=g+y*l,S=p+B*l,I=b-y*10*l,R=S-B*10*l;n.beginPath(),n.moveTo(b,S),n.lineTo(I-B*3.5*l,R+y*3.5*l),n.lineTo(I+B*3.5*l,R-y*3.5*l),n.closePath(),n.fill();break}}return r.toDataURL("image/png")}catch(t){return console.error("[ui-feedback-plugin] drawAnnotationsOnScreenshot failed:",t),A}}const ca="ui-feedback-plugin";async function NB(A){const{backend:e}=A;if(e.provider==="firebase"){const{FirebaseAdapter:t}=await Promise.resolve().then(()=>GS),r=new t(e);return{db:r,screenshot:r}}if(e.provider==="supabase"){const{SupabaseAdapter:t}=await Promise.resolve().then(()=>YS),r=new t(e.url,e.anonKey);return{db:r,screenshot:r}}if(e.provider==="aws"){const{AWSAdapter:t}=await Promise.resolve().then(()=>eR),r=new t(e);return{db:r,screenshot:r}}if(e.provider==="local"){const{LocalAdapter:t}=await Promise.resolve().then(()=>AR),r=new t;return{db:r,screenshot:r}}throw new Error("[ui-feedback-plugin] Unknown backend provider")}function MB(A){var i;if(customElements.get(ca))return console.warn("[ui-feedback-plugin] Already initialized."),()=>{};const e=((i=A.theme)==null?void 0:i.primaryColor)??"#6366f1",t=A.projectKey??"default",r=A.position??"bottom-right";Ie({config:A});class n extends HTMLElement{constructor(){super();ut(this,"shadow");ut(this,"db");ut(this,"screenshot");ut(this,"unsubscribe",null);this.shadow=this.attachShadow({mode:"open"})}async connectedCallback(){const l=document.createElement("style");l.textContent=yB(e),this.shadow.appendChild(l);try{const u=await NB(A);this.db=u.db,this.screenshot=u.screenshot}catch(u){console.error("[ui-feedback-plugin] Failed to initialise backend:",u);return}this.mount()}disconnectedCallback(){var l;(l=this.unsubscribe)==null||l.call(this)}mount(){const l=Du(window.location.href);xB(this.shadow,this.db,()=>this.startAnnotation()),_B(this.shadow,r,()=>this.startAnnotation(),()=>Ie({panelOpen:!AA().panelOpen})),this.unsubscribe=this.db.subscribeToComments(l,t,u=>{Ie({comments:u})})}async startAnnotation(){let l=ku();if(!l&&(l=await vB(this.shadow),!l))return;Ie({active:!0,panelOpen:!1});const u=await FB(this.shadow);if(!u){Ie({active:!1});return}Ie({active:!1}),this.showToast("Saving comment…","info");try{await this.saveComment(l,u.text,u.shapes),this.showToast("Comment saved!","success")}catch(d){console.error("[ui-feedback-plugin] Failed to save comment:",d),this.showToast("Failed to save — check the browser console for details.","error");return}Ie({panelOpen:!0})}async saveComment(l,u,d){const g=Du(window.location.href),p={shapes:d,pageWidth:document.documentElement.scrollWidth,pageHeight:document.documentElement.scrollHeight};this.style.visibility="hidden";let w;try{w=await LB()}finally{this.style.visibility=""}w=await PB(w,p);const y={pageUrl:g,projectKey:t,authorName:l,text:u,screenshotUrl:"",annotation:p,resolved:!1,createdAt:Date.now()},B=await this.db.addComment(y),b=await this.screenshot.uploadScreenshot(B,w);await this.db.updateComment(B,{screenshotUrl:b})}showToast(l,u){const d=this.shadow.querySelector(".ufp-toast");d==null||d.remove();const g={info:"#6366f1",success:"#10b981",error:"#ef4444"},p=document.createElement("div");p.className="ufp-toast",p.style.cssText=`
765
+ `,i.addEventListener("click",async()=>{let o=e.get(A.id)??[];try{o=await r.getReplies(A.id),e.set(A.id,o)}catch(a){console.error("[ui-feedback-plugin] Failed to fetch replies:",a)}RB(t,A,o,r,a=>{const l=AA();Ie({comments:l.comments.map(u=>u.id===a?{...u,resolved:!0}:u)})},a=>{const l=AA();Ie({comments:l.comments.map(u=>u.id===a?{...u,resolved:!1}:u)})},a=>{const l=AA();Ie({comments:l.comments.filter(u=>u.id!==a)}),e.delete(a)},a=>{const l=e.get(A.id)??[];e.set(A.id,[...l,a]);const u=AA();Ie({comments:[...u.comments]})})}),i}async function LB(){try{const A=await DB();return await HB(A)}catch(A){return console.error("[ui-feedback-plugin] capturePageScreenshot failed:",A),OB()}}async function DB(){return(await Promise.resolve().then(()=>eU)).default}async function HB(A){const e=document.documentElement.clientWidth,t=window.innerHeight;return(await A(document.body,{allowTaint:!1,useCORS:!0,logging:!1,scale:Math.min(window.devicePixelRatio,2),x:window.scrollX,y:window.scrollY,width:e,height:t,windowWidth:e,windowHeight:t,ignoreElements:n=>n.tagName==="UI-FEEDBACK-PLUGIN"})).toDataURL("image/png")}function OB(){const A=document.createElement("canvas");A.width=window.innerWidth,A.height=window.innerHeight;const e=A.getContext("2d");return e.fillStyle="#f3f4f6",e.fillRect(0,0,A.width,A.height),e.fillStyle="#9ca3af",e.font="16px -apple-system, sans-serif",e.textAlign="center",e.fillText("Screenshot unavailable",A.width/2,A.height/2),A.toDataURL("image/png")}async function PB(A,e){try{const t=await new Promise((a,l)=>{const u=new Image;u.onload=()=>a(u),u.onerror=()=>l(new Error("screenshot failed to load")),u.src=A}),r=document.createElement("canvas");r.width=t.naturalWidth,r.height=t.naturalHeight;const n=r.getContext("2d");n.drawImage(t,0,0);const s=r.width/e.pageWidth,i=r.height/e.pageHeight,o=Math.min(s,i);n.lineCap="round",n.lineJoin="round";for(const a of e.shapes)switch(n.strokeStyle=a.color,n.fillStyle=a.color,n.beginPath(),a.type){case"pen":{n.lineWidth=a.width*o,a.points.forEach((l,u)=>u===0?n.moveTo(l.x*s,l.y*i):n.lineTo(l.x*s,l.y*i)),n.stroke();break}case"rect":{n.lineWidth=a.strokeWidth*o,n.roundRect(a.x*s,a.y*i,a.width*s,a.height*i,3*o),n.stroke();break}case"circle":{n.lineWidth=a.strokeWidth*o,n.ellipse(a.cx*s,a.cy*i,a.rx*s,a.ry*i,0,0,Math.PI*2),n.stroke();break}case"arrow":{const l=a.width*o,u=a.x1*s,d=a.y1*i,g=a.x2*s,p=a.y2*i;n.lineWidth=l,n.lineCap="butt",n.moveTo(u,d),n.lineTo(g,p),n.stroke(),n.lineCap="round";const w=Math.hypot(g-u,p-d)||1,y=(g-u)/w,B=(p-d)/w,b=g+y*l,S=p+B*l,I=b-y*10*l,R=S-B*10*l;n.beginPath(),n.moveTo(b,S),n.lineTo(I-B*3.5*l,R+y*3.5*l),n.lineTo(I+B*3.5*l,R-y*3.5*l),n.closePath(),n.fill();break}}return r.toDataURL("image/png")}catch(t){return console.error("[ui-feedback-plugin] drawAnnotationsOnScreenshot failed:",t),A}}const aa="ui-feedback-plugin";async function NB(A){const{backend:e}=A;if(e.provider==="firebase"){const{FirebaseAdapter:t}=await Promise.resolve().then(()=>GS),r=new t(e);return{db:r,screenshot:r}}if(e.provider==="supabase"){const{SupabaseAdapter:t}=await Promise.resolve().then(()=>YS),r=new t(e.url,e.anonKey);return{db:r,screenshot:r}}if(e.provider==="aws"){const{AWSAdapter:t}=await Promise.resolve().then(()=>eR),r=new t(e);return{db:r,screenshot:r}}if(e.provider==="local"){const{LocalAdapter:t}=await Promise.resolve().then(()=>AR),r=new t;return{db:r,screenshot:r}}throw new Error("[ui-feedback-plugin] Unknown backend provider")}function MB(A){var i;if(customElements.get(aa))return console.warn("[ui-feedback-plugin] Already initialized."),()=>{};const e=((i=A.theme)==null?void 0:i.primaryColor)??"#6366f1",t=A.projectKey??"default",r=A.position??"bottom-right";Ie({config:A});class n extends HTMLElement{constructor(){super();ut(this,"shadow");ut(this,"db");ut(this,"screenshot");ut(this,"unsubscribe",null);this.shadow=this.attachShadow({mode:"open"})}async connectedCallback(){const l=document.createElement("style");l.textContent=yB(e),this.shadow.appendChild(l);try{const u=await NB(A);this.db=u.db,this.screenshot=u.screenshot}catch(u){console.error("[ui-feedback-plugin] Failed to initialise backend:",u);return}this.mount()}disconnectedCallback(){var l;(l=this.unsubscribe)==null||l.call(this)}mount(){const l=Du(window.location.href);xB(this.shadow,this.db,()=>this.startAnnotation()),_B(this.shadow,r,()=>this.startAnnotation(),()=>Ie({panelOpen:!AA().panelOpen})),this.unsubscribe=this.db.subscribeToComments(l,t,u=>{Ie({comments:u})})}async startAnnotation(){let l=ku();if(!l&&(l=await vB(this.shadow),!l))return;Ie({active:!0,panelOpen:!1});const u=await FB(this.shadow);if(!u){Ie({active:!1});return}Ie({active:!1}),this.showToast("Saving comment…","info");try{await this.saveComment(l,u.text,u.shapes),this.showToast("Comment saved!","success")}catch(d){console.error("[ui-feedback-plugin] Failed to save comment:",d),this.showToast("Failed to save — check the browser console for details.","error");return}Ie({panelOpen:!0})}async saveComment(l,u,d){const g=Du(window.location.href),p={shapes:d,pageWidth:document.documentElement.clientWidth,pageHeight:window.innerHeight};this.style.visibility="hidden";let w;try{w=await LB()}finally{this.style.visibility=""}w=await PB(w,p);const y={pageUrl:g,projectKey:t,authorName:l,text:u,screenshotUrl:"",annotation:p,resolved:!1,createdAt:Date.now()},B=await this.db.addComment(y),b=await this.screenshot.uploadScreenshot(B,w);await this.db.updateComment(B,{screenshotUrl:b})}showToast(l,u){const d=this.shadow.querySelector(".ufp-toast");d==null||d.remove();const g={info:"#6366f1",success:"#10b981",error:"#ef4444"},p=document.createElement("div");p.className="ufp-toast",p.style.cssText=`
766
766
  position:fixed;bottom:80px;left:50%;transform:translateX(-50%);
767
767
  background:${g[u]};color:white;padding:10px 20px;border-radius:8px;
768
768
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
769
769
  font-size:13px;font-weight:500;z-index:2147483647;
770
770
  box-shadow:0 4px 12px rgba(0,0,0,0.2);pointer-events:none;
771
771
  max-width:360px;text-align:center;
772
- `,p.textContent=l,this.shadow.appendChild(p),setTimeout(()=>p.remove(),u==="error"?6e3:2500)}}customElements.define(ca,n);const s=document.createElement(ca);return document.body.appendChild(s),()=>s.remove()}/*!
772
+ `,p.textContent=l,this.shadow.appendChild(p),setTimeout(()=>p.remove(),u==="error"?6e3:2500)}}customElements.define(aa,n);const s=document.createElement(aa);return document.body.appendChild(s),()=>s.remove()}/*!
773
773
  * html2canvas-pro 2.2.1 <https://yorickshan.github.io/html2canvas-pro/>
774
774
  * Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
775
775
  * Released under MIT License
776
776
  */var Mu=class Ru{constructor(e={}){const t=e.window||(typeof window<"u"?window:void 0);if(!t)throw new Error("Window object is required but not available");this.window=t,this.cspNonce=e.cspNonce,this.cache=e.cache}static fromElement(e,t={}){const r=e.ownerDocument;if(!r)throw new Error("Element is not attached to a document");const n=r.defaultView;if(!n)throw new Error("Document is not attached to a window");return new Ru({window:n,...t})}clone(e={}){return new Ru({window:e.window||this.window,cspNonce:e.cspNonce??this.cspNonce,cache:e.cache??this.cache})}},Vu=class{constructor(A={}){this.config={maxImageTimeout:3e5,allowDataUrls:!0,...A}}validateUrl(A,e="general"){if(!A||typeof A!="string")return{valid:!1,error:"URL must be a non-empty string"};if(A.startsWith("data:"))return this.config.allowDataUrls?{valid:!0,sanitized:A}:{valid:!1,error:"Data URLs are not allowed"};if(A.startsWith("blob:"))return{valid:!0,sanitized:A};try{const t=new URL(A);if(!["http:","https:"].includes(t.protocol))return{valid:!1,error:`Protocol ${t.protocol} is not allowed. Only http and https are permitted.`};if(e==="proxy"&&this.config.allowedProxyDomains&&this.config.allowedProxyDomains.length>0){const r=t.hostname.toLowerCase();if(!this.config.allowedProxyDomains.some(n=>{const s=n.toLowerCase();return r===s||r.endsWith("."+s)}))return{valid:!1,error:`Proxy domain ${t.hostname} is not in the allowed list`}}if(e==="proxy"){if(!this.config.allowLocalhostProxy){const r=t.hostname.toLowerCase();if(r==="localhost"||r==="127.0.0.1"||r==="::1")return{valid:!1,error:"Localhost is not allowed for proxy URLs"};if(this.isPrivateIP(r))return{valid:!1,error:"Private IP addresses are not allowed for proxy URLs"};if(r.startsWith("169.254.")||r.startsWith("fe80:"))return{valid:!1,error:"Link-local addresses are not allowed for proxy URLs"}}return{valid:!0,sanitized:A,requiresRuntimeCheck:!0}}return{valid:!0,sanitized:A}}catch(t){return{valid:!1,error:`Invalid URL format: ${t instanceof Error?t.message:"Unknown error"}`}}}isPrivateIP(A){return[/^0\./,/^10\./,/^100\.(6[4-9]|[7-9][0-9]|1[0-1][0-9]|12[0-7])\./,/^127\./,/^169\.254\./,/^172\.(1[6-9]|2[0-9]|3[0-1])\./,/^192\.0\.0\./,/^192\.0\.2\./,/^192\.168\./,/^198\.(1[8-9])\./,/^198\.51\.100\./,/^203\.0\.113\./,/^2(2[4-9]|3[0-9])\./,/^24[0-9]\./,/^255\.255\.255\.255$/].some(e=>e.test(A))?!0:A.includes(":")?this.isPrivateIPv6(A):!1}isPrivateIPv6(A){const e=A.toLowerCase().trim().replace(/^\[|\]$/g,"").split("%")[0];if(/^(0:){7}1$/.test(e)||e==="::1"||/^(0:){7}0$/.test(e)||e==="::")return!0;const t=this.expandIPv6(e);if(!t)return this.isPrivateIPv6Prefix(e);const r=parseInt(t.substring(0,2),16);if(r>=252&&r<=253)return!0;if(r===254){const n=parseInt(t.substring(2,4),16);if(n>=128&&n<=191)return!0}return r===255}expandIPv6(A){try{if(A.includes("::")){const e=A.split("::");if(e.length>2)return null;const t=e[0]?e[0].split(":"):[],r=e[1]?e[1].split(":"):[],n=8-t.length-r.length;if(n<0)return null;const s=Array(n).fill("0000");return[...t,...s,...r].map(i=>i.padStart(4,"0")).join(":")}else{const e=A.split(":");return e.length!==8?null:e.map(t=>t.padStart(4,"0")).join(":")}}catch{return null}}isPrivateIPv6Prefix(A){return!!(/^fc[0-9a-f]{0,2}:?/i.test(A)||/^fd[0-9a-f]{0,2}:?/i.test(A)||/^fe[89ab][0-9a-f]:?/i.test(A)||/^ff[0-9a-f]{0,2}:?/i.test(A))}validateCspNonce(A){return!A||typeof A!="string"?{valid:!1,error:"CSP nonce must be a non-empty string"}:A.length<16?{valid:!1,error:"CSP nonce is too short (minimum 16 characters recommended)"}:/^[A-Za-z0-9+/=_-]+$/.test(A)?{valid:!0,sanitized:A}:{valid:!1,error:"CSP nonce contains invalid characters"}}validateImageTimeout(A){return typeof A!="number"||isNaN(A)?{valid:!1,error:"Image timeout must be a number"}:A<0?{valid:!1,error:"Image timeout cannot be negative"}:this.config.maxImageTimeout&&A>this.config.maxImageTimeout?{valid:!1,error:`Image timeout ${A}ms exceeds maximum allowed ${this.config.maxImageTimeout}ms`}:{valid:!0,sanitized:A}}validateDimensions(A,e){if(typeof A!="number"||typeof e!="number")return{valid:!1,error:"Dimensions must be numbers"};if(isNaN(A)||isNaN(e))return{valid:!1,error:"Dimensions cannot be NaN"};if(A<=0||e<=0)return{valid:!1,error:"Dimensions must be positive"};const t=32767;return A>t||e>t?{valid:!1,error:`Dimensions exceed maximum allowed (${t}px)`}:{valid:!0,sanitized:{width:A,height:e}}}validateScale(A){return typeof A!="number"||isNaN(A)?{valid:!1,error:"Scale must be a number"}:A<=0?{valid:!1,error:"Scale must be positive"}:A>10?{valid:!1,error:"Scale factor too large (maximum 10x)"}:{valid:!0,sanitized:A}}validateElement(A){if(!A)return{valid:!1,error:"Element is required"};if(typeof A!="object")return{valid:!1,error:"Element must be an object"};const e=A;return typeof HTMLElement<"u"&&A instanceof HTMLElement?A.ownerDocument?{valid:!0}:{valid:!1,error:"Element must be attached to a document"}:e.ownerDocument?e.ownerDocument.defaultView?{valid:!0}:{valid:!1,error:"Document must be attached to a window (ownerDocument.defaultView required)"}:{valid:!1,error:"Element must be attached to a document (ownerDocument required)"}}validateOptions(A){const e=[],t=A.proxy;if(t!=null&&typeof t=="string"&&t.length>0){const r=this.validateUrl(t,"proxy");r.valid||e.push(`Proxy: ${r.error}`)}if(A.imageTimeout!==void 0){const r=this.validateImageTimeout(A.imageTimeout);r.valid||e.push(`Image timeout: ${r.error}`)}if(A.width!==void 0||A.height!==void 0){const r=A.width??800,n=A.height??600,s=this.validateDimensions(r,n);s.valid||e.push(`Dimensions: ${s.error}`)}if(A.scale!==void 0){const r=this.validateScale(A.scale);r.valid||e.push(`Scale: ${r.error}`)}if(A.cspNonce!==void 0){const r=this.validateCspNonce(A.cspNonce);r.valid||e.push(`CSP nonce: ${r.error}`)}if(this.config.customValidator){const r=this.config.customValidator(A,"options");r.valid||e.push(`Custom validation: ${r.error}`)}return e.length>0?{valid:!1,error:e.join("; ")}:{valid:!0}}};function Ku(A={}){return new Vu({allowDataUrls:!0,maxImageTimeout:3e5,...A})}var $u=class{constructor(A,e=!0){this.context=A,this.activeMetrics=new Map,this.completedMetrics=[],this.enabled=e,this.getTime=typeof performance<"u"&&typeof performance.now=="function"?()=>performance.now():()=>Date.now()}start(A,e){var t;this.enabled&&(this.activeMetrics.has(A)&&((t=this.context)==null||t.logger.warn(`Performance metric '${A}' already started. Overwriting.`)),this.activeMetrics.set(A,{name:A,startTime:this.getTime(),metadata:e}))}end(A){var t,r;if(!this.enabled)return;const e=this.activeMetrics.get(A);if(!e){(t=this.context)==null||t.logger.warn(`Performance metric '${A}' not found. Was start() called?`);return}return e.endTime=this.getTime(),e.duration=e.endTime-e.startTime,this.completedMetrics.push(e),this.activeMetrics.delete(A),(r=this.context)==null||r.logger.debug(`⏱️ ${A}: ${e.duration.toFixed(2)}ms`,e.metadata),e}measure(A,e,t){this.start(A,t);try{const r=e();return this.end(A),r}catch(r){throw this.end(A),r}}async measureAsync(A,e,t){this.start(A,t);try{const r=await e();return this.end(A),r}catch(r){throw this.end(A),r}}getMetrics(){return[...this.completedMetrics]}getMetric(A){return this.completedMetrics.find(e=>e.name===A)}getSummary(){const A=this.completedMetrics.reduce((t,r)=>t+(r.duration||0),0),e=this.completedMetrics.map(t=>({name:t.name,duration:t.duration||0,percentage:A>0?((t.duration||0)/A*100).toFixed(1)+"%":"0%"}));return{totalDuration:A,metrics:this.getMetrics(),breakdown:e}}logSummary(){if(!this.enabled||this.completedMetrics.length===0||!this.context)return;const A=this.getSummary();this.context.logger.info(`
777
- 📊 Performance Summary (Total: ${A.totalDuration.toFixed(2)}ms):`),A.breakdown.sort((e,t)=>t.duration-e.duration).forEach(e=>{this.context.logger.info(` ${e.name.padEnd(20)} ${e.duration.toFixed(2).padStart(8)}ms ${e.percentage.padStart(6)}`)})}clear(){this.activeMetrics.clear(),this.completedMetrics.splice(0)}isEnabled(){return this.enabled}getActiveMetrics(){return Array.from(this.activeMetrics.keys())}},rA=(Nt=class{constructor(e,t,r,n){this.left=e,this.top=t,this.width=r,this.height=n}add(e,t,r,n){return new Nt(this.left+e,this.top+t,this.width+r,this.height+n)}static fromClientRect(e,t){return new Nt(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)}static fromDOMRectList(e,t){const r=Array.from(t);let n=r.find(s=>s.width!==0);return n||(n=r.find(s=>s.height!==0)),!n&&r.length>0&&(n=r[0]),n?new Nt(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):Nt.EMPTY}},Nt.EMPTY=new Nt(0,0,0,0),Nt);const Gs=(A,e)=>rA.fromClientRect(A,e.getBoundingClientRect()),VB=A=>{const e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");return new rA(0,0,Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight)))};for(var Ws=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var s=A.charCodeAt(t++);(s&64512)===56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)}else e.push(n)}return e},Ee=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,s="";++n<t;){var i=A[n];i<=65535?r.push(i):(i-=65536,r.push((i>>10)+55296,i%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},ju="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",KB=typeof Uint8Array>"u"?[]:new Uint8Array(256),qs=0;qs<ju.length;qs++)KB[ju.charCodeAt(qs)]=qs;for(var Gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Js=0;Js<Gu.length;Js++)pn[Gu.charCodeAt(Js)]=Js;for(var $B=function(A){var e=A.length*.75,t=A.length,r,n=0,s,i,o,a;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<t;r+=4)s=pn[A.charCodeAt(r)],i=pn[A.charCodeAt(r+1)],o=pn[A.charCodeAt(r+2)],a=pn[A.charCodeAt(r+3)],u[n++]=s<<2|i>>4,u[n++]=(i&15)<<4|o>>2,u[n++]=(o&3)<<6|a&63;return l},jB=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},GB=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t},MA=5,la=11,ua=2,WB=la-MA,Wu=65536>>MA,ha=(1<<MA)-1,qB=Wu+(1024>>MA)+32,JB=65536>>la,zB=(1<<WB)-1,qu=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},XB=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},YB=function(A,e){var t=$B(A),r=Array.isArray(t)?GB(t):new Uint32Array(t),n=Array.isArray(t)?jB(t):new Uint16Array(t),s=24,i=qu(n,s/2,r[4]/2),o=r[5]===2?qu(n,(s+r[4])/2):XB(r,Math.ceil((s+r[4])/4));return new ZB(r[0],r[1],r[2],r[3],i,o)},ZB=function(){function A(e,t,r,n,s,i){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=s,this.data=i}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>MA],t=(t<<ua)+(e&ha),this.data[t];if(e<=65535)return t=this.index[Wu+(e-55296>>MA)],t=(t<<ua)+(e&ha),this.data[t];if(e<this.highStart)return t=qB-JB+(e>>la),t=this.index[t],t+=e>>MA&zB,t=this.index[t],t=(t<<ua)+(e&ha),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Ju="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ey=typeof Uint8Array>"u"?[]:new Uint8Array(256),zs=0;zs<Ju.length;zs++)ey[Ju.charCodeAt(zs)]=zs;var ty="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",zu=50,Ay=1,Xu=2,Yu=3,ry=4,ny=5,Zu=7,eh=8,th=9,mA=10,da=11,Ah=12,fa=13,sy=14,wn=15,ga=16,Xs=17,mn=18,iy=19,rh=20,pa=21,Bn=22,wa=23,br=24,ht=25,yn=26,Cn=27,Ur=28,oy=29,VA=30,ay=31,Ys=32,Zs=33,ma=34,Ba=35,ya=36,_n=37,Ca=38,ei=39,ti=40,_a=41,nh=42,cy=43,ly=[9001,65288],sh="!",Z="×",Ai="÷",Ea=YB(ty),nA=[VA,ya],va=[Ay,Xu,Yu,ny],ih=[mA,eh],oh=[Cn,yn],uy=va.concat(ih),ah=[Ca,ei,ti,ma,Ba],hy=[wn,fa],dy=function(A,e){e===void 0&&(e="strict");var t=[],r=[],n=[];return A.forEach(function(s,i){var o=Ea.get(s);if(o>zu?(n.push(!0),o-=zu):n.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return r.push(i),t.push(ga);if(o===ry||o===da){if(i===0)return r.push(i),t.push(VA);var a=t[i-1];return uy.indexOf(a)===-1?(r.push(r[i-1]),t.push(a)):(r.push(i),t.push(VA))}if(r.push(i),o===ay)return t.push(e==="strict"?pa:_n);if(o===nh||o===oy)return t.push(VA);if(o===cy)return s>=131072&&s<=196605||s>=196608&&s<=262141?t.push(_n):t.push(VA);t.push(o)}),[r,t,n]},ba=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?A.indexOf(n)!==-1:A===n)for(var s=t;s<=r.length;){s++;var i=r[s];if(i===e)return!0;if(i!==mA)break}if(n===mA)for(var s=t;s>0;){s--;var o=r[s];if(Array.isArray(A)?A.indexOf(o)!==-1:A===o)for(var a=t;a<=r.length;){a++;var i=r[a];if(i===e)return!0;if(i!==mA)break}if(o!==mA)break}return!1},ch=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r===mA)t--;else return r}return 0},fy=function(A,e,t,r,n){if(t[r]===0)return Z;var s=r-1;if(Array.isArray(n)&&n[s]===!0)return Z;var i=s-1,o=s+1,a=e[s],l=i>=0?e[i]:0,u=e[o];if(a===Xu&&u===Yu)return Z;if(va.indexOf(a)!==-1)return sh;if(va.indexOf(u)!==-1||ih.indexOf(u)!==-1)return Z;if(ch(s,e)===eh)return Ai;if(Ea.get(A[s])===da||(a===Ys||a===Zs)&&Ea.get(A[o])===da||a===Zu||u===Zu||a===th||[mA,fa,wn].indexOf(a)===-1&&u===th||[Xs,mn,iy,br,Ur].indexOf(u)!==-1||ch(s,e)===Bn||ba(wa,Bn,s,e)||ba([Xs,mn],pa,s,e)||ba(Ah,Ah,s,e))return Z;if(a===mA)return Ai;if(a===wa||u===wa)return Z;if(u===ga||a===ga)return Ai;if([fa,wn,pa].indexOf(u)!==-1||a===sy||l===ya&&hy.indexOf(a)!==-1||a===Ur&&u===ya||u===rh||nA.indexOf(u)!==-1&&a===ht||nA.indexOf(a)!==-1&&u===ht||a===Cn&&[_n,Ys,Zs].indexOf(u)!==-1||[_n,Ys,Zs].indexOf(a)!==-1&&u===yn||nA.indexOf(a)!==-1&&oh.indexOf(u)!==-1||oh.indexOf(a)!==-1&&nA.indexOf(u)!==-1||[Cn,yn].indexOf(a)!==-1&&(u===ht||[Bn,wn].indexOf(u)!==-1&&e[o+1]===ht)||[Bn,wn].indexOf(a)!==-1&&u===ht||a===ht&&[ht,Ur,br].indexOf(u)!==-1)return Z;if([ht,Ur,br,Xs,mn].indexOf(u)!==-1)for(var d=s;d>=0;){var g=e[d];if(g===ht)return Z;if([Ur,br].indexOf(g)!==-1)d--;else break}if([Cn,yn].indexOf(u)!==-1)for(var d=[Xs,mn].indexOf(a)!==-1?i:s;d>=0;){var g=e[d];if(g===ht)return Z;if([Ur,br].indexOf(g)!==-1)d--;else break}if(Ca===a&&[Ca,ei,ma,Ba].indexOf(u)!==-1||[ei,ma].indexOf(a)!==-1&&[ei,ti].indexOf(u)!==-1||[ti,Ba].indexOf(a)!==-1&&u===ti||ah.indexOf(a)!==-1&&[rh,yn].indexOf(u)!==-1||ah.indexOf(u)!==-1&&a===Cn||nA.indexOf(a)!==-1&&nA.indexOf(u)!==-1||a===br&&nA.indexOf(u)!==-1||nA.concat(ht).indexOf(a)!==-1&&u===Bn&&ly.indexOf(A[o])===-1||nA.concat(ht).indexOf(u)!==-1&&a===mn)return Z;if(a===_a&&u===_a){for(var p=t[s],w=1;p>0&&(p--,e[p]===_a);)w++;if(w%2!==0)return Z}return a===Ys&&u===Zs?Z:Ai},gy=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=dy(A,e.lineBreak),r=t[0],n=t[1],s=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(n=n.map(function(o){return[ht,VA,nh].indexOf(o)!==-1?_n:o}));var i=e.wordBreak==="keep-all"?s.map(function(o,a){return o&&A[a]>=19968&&A[a]<=40959}):void 0;return[r,n,i]},py=function(){function A(e,t,r,n){this.codePoints=e,this.required=t===sh,this.start=r,this.end=n}return A.prototype.slice=function(){return Ee.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),wy=function(A,e){var t=Ws(A),r=gy(t,e),n=r[0],s=r[1],i=r[2],o=t.length,a=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var u=Z;l<o&&(u=fy(t,s,n,++l,i))===Z;);if(u!==Z||l===o){var d=new py(t,u,a,l);return a=l,{value:d,done:!1}}return{done:!0,value:null}}}};const ri=10,lh=47,En=92,my=9,By=32,ni=34,vn=61,yy=35,Cy=36,_y=37,si=39,ii=40,bn=41,Ey=95,nt=45,vy=33,by=60,Uy=62,Qy=64,Iy=91,Fy=93,Ty=61,Sy=123,oi=63,Ry=125,uh=124,xy=126,ky=128,hh=65533,Ua=42,KA=43,Ly=44,Dy=58,Hy=59,Un=46,Oy=0,Py=8,Ny=11,My=14,Vy=31,Ky=127,$t=-1,dh=48,fh=97,gh=101,$y=102,jy=117,Gy=122,ph=65,wh=69,mh=70,Wy=85,qy=90,Ge=A=>A>=dh&&A<=57,Jy=A=>A>=55296&&A<=57343,Qr=A=>Ge(A)||A>=ph&&A<=mh||A>=fh&&A<=$y,zy=A=>A>=fh&&A<=Gy,Xy=A=>A>=ph&&A<=qy,Yy=A=>zy(A)||Xy(A),Zy=A=>A>=ky,ai=A=>A===ri||A===my||A===By,ci=A=>Yy(A)||Zy(A)||A===Ey,Bh=A=>ci(A)||Ge(A)||A===nt,eC=A=>A>=Oy&&A<=Py||A===Ny||A>=My&&A<=Vy||A===Ky,BA=(A,e)=>A!==En?!1:e!==ri,li=(A,e,t)=>A===nt?ci(e)||BA(e,t):ci(A)?!0:!!(A===En&&BA(A,e)),Qa=(A,e,t)=>A===KA||A===nt?Ge(e)?!0:e===Un&&Ge(t):Ge(A===Un?e:A),tC=A=>{let e=0,t=1;(A[e]===KA||A[e]===nt)&&(A[e]===nt&&(t=-1),e++);const r=[];for(;Ge(A[e]);)r.push(A[e++]);const n=r.length?parseInt(Ee(...r),10):0;A[e]===Un&&e++;const s=[];for(;Ge(A[e]);)s.push(A[e++]);const i=s.length,o=i?parseInt(Ee(...s),10):0;(A[e]===wh||A[e]===gh)&&e++;let a=1;(A[e]===KA||A[e]===nt)&&(A[e]===nt&&(a=-1),e++);const l=[];for(;Ge(A[e]);)l.push(A[e++]);const u=l.length?parseInt(Ee(...l),10):0;return t*(n+o*Math.pow(10,-i))*Math.pow(10,a*u)},AC={type:2},rC={type:3},nC={type:4},sC={type:13},iC={type:8},oC={type:21},aC={type:9},cC={type:10},lC={type:11},uC={type:12},hC={type:14},ui={type:23},dC={type:1},fC={type:25},gC={type:24},pC={type:26},wC={type:27},mC={type:28},BC={type:29},yC={type:31},Ia={type:32};var Fa=(bt=class{static get(){return bt._pool.pop()||new bt}static release(e){bt._pool.length<bt.MAX_POOL_SIZE&&(e._reset(),bt._pool.push(e))}constructor(){this._value=[]}_reset(){this._value=[]}write(e){this._value=this._value.concat(Ws(e))}read(){const e=[];let t=this.consumeToken();for(;t!==Ia;)e.push(t),t=this.consumeToken();return e}consumeToken(){const e=this.consumeCodePoint();switch(e){case ni:return this.consumeStringToken(ni);case yy:const t=this.peekCodePoint(0),r=this.peekCodePoint(1),n=this.peekCodePoint(2);if(Bh(t)||BA(r,n)){const u=li(t,r,n)?2:1;return{type:5,value:this.consumeName(),flags:u}}break;case Cy:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),sC;break;case si:return this.consumeStringToken(si);case ii:return AC;case bn:return rC;case Ua:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),hC;break;case KA:if(Qa(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Ly:return nC;case nt:const s=e,i=this.peekCodePoint(0),o=this.peekCodePoint(1);if(Qa(s,i,o))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(li(s,i,o))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(i===nt&&o===Uy)return this.consumeCodePoint(),this.consumeCodePoint(),gC;break;case Un:if(Qa(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case lh:if(this.peekCodePoint(0)===Ua)for(this.consumeCodePoint();;){let u=this.consumeCodePoint();if(u===Ua&&(u=this.consumeCodePoint(),u===lh))return this.consumeToken();if(u===$t)return this.consumeToken()}break;case Dy:return pC;case Hy:return wC;case by:if(this.peekCodePoint(0)===vy&&this.peekCodePoint(1)===nt&&this.peekCodePoint(2)===nt)return this.consumeCodePoint(),this.consumeCodePoint(),fC;break;case Qy:if(li(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2)))return{type:7,value:this.consumeName()};break;case Iy:return mC;case En:if(BA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case Fy:return BC;case Ty:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),iC;break;case Sy:return lC;case Ry:return uC;case jy:case Wy:const a=this.peekCodePoint(0),l=this.peekCodePoint(1);return a===KA&&(Qr(l)||l===oi)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case uh:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),aC;if(this.peekCodePoint(0)===uh)return this.consumeCodePoint(),oC;break;case xy:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),cC;break;case $t:return Ia}return ai(e)?(this.consumeWhiteSpace(),yC):Ge(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):ci(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:Ee(e)}}consumeCodePoint(){const e=this._value.shift();return typeof e>"u"?-1:e}reconsumeCodePoint(e){this._value.unshift(e)}peekCodePoint(e){return e>=this._value.length?-1:this._value[e]}consumeUnicodeRangeToken(){const e=[];let t=this.consumeCodePoint();for(;Qr(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();let r=!1;for(;t===oi&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r)return{type:30,start:parseInt(Ee(...e.map(s=>s===oi?dh:s)),16),end:parseInt(Ee(...e.map(s=>s===oi?mh:s)),16)};const n=parseInt(Ee(...e),16);if(this.peekCodePoint(0)===nt&&Qr(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();const s=[];for(;Qr(t)&&s.length<6;)s.push(t),t=this.consumeCodePoint();return{type:30,start:n,end:parseInt(Ee(...s),16)}}else return{type:30,start:n,end:n}}consumeIdentLikeToken(){const e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===ii?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ii?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}}consumeUrlToken(){const e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===$t)return{type:22,value:""};const t=this.peekCodePoint(0);if(t===si||t===ni){const r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===$t||this.peekCodePoint(0)===bn)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),ui)}for(;;){const r=this.consumeCodePoint();if(r===$t||r===bn)return{type:22,value:Ee(...e)};if(ai(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===$t||this.peekCodePoint(0)===bn?(this.consumeCodePoint(),{type:22,value:Ee(...e)}):(this.consumeBadUrlRemnants(),ui);if(r===ni||r===si||r===ii||eC(r))return this.consumeBadUrlRemnants(),ui;if(r===En)if(BA(r,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),ui;else e.push(r)}}consumeWhiteSpace(){for(;ai(this.peekCodePoint(0));)this.consumeCodePoint()}consumeBadUrlRemnants(){for(;;){const e=this.consumeCodePoint();if(e===bn||e===$t)return;BA(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}}consumeStringSlice(e){let r="";for(;e>0;){const n=Math.min(5e4,e);r+=Ee(...this._value.splice(0,n)),e-=n}return this._value.shift(),r}consumeStringToken(e){let t="",r=0;do{const n=this._value[r];if(n===$t||n===void 0||n===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(n===ri)return this._value.splice(0,r),dC;if(n===En){const s=this._value[r+1];s!==$t&&s!==void 0&&(s===ri?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):BA(n,s)&&(t+=this.consumeStringSlice(r),t+=Ee(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)}consumeNumber(){const e=[];let t=4,r=this.peekCodePoint(0);for((r===KA||r===nt)&&e.push(this.consumeCodePoint());Ge(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);let n=this.peekCodePoint(1);if(r===Un&&Ge(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Ge(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),n=this.peekCodePoint(1);const s=this.peekCodePoint(2);if((r===wh||r===gh)&&((n===KA||n===nt)&&Ge(s)||Ge(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Ge(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[tC(e),t]}consumeNumericToken(){const[e,t]=this.consumeNumber(),r=this.peekCodePoint(0);return li(r,this.peekCodePoint(1),this.peekCodePoint(2))?{type:15,number:e,flags:t,unit:this.consumeName()}:r===_y?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}}consumeEscapedCodePoint(){const e=this.consumeCodePoint();if(Qr(e)){let t=Ee(e);for(;Qr(this.peekCodePoint(0))&&t.length<6;)t+=Ee(this.consumeCodePoint());ai(this.peekCodePoint(0))&&this.consumeCodePoint();const r=parseInt(t,16);return r===0||Jy(r)||r>1114111?hh:r}return e===$t?hh:e}consumeName(){let e="";for(;;){const t=this.consumeCodePoint();if(Bh(t))e+=Ee(t);else if(BA(t,this.peekCodePoint(0)))e+=Ee(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}}},bt._pool=[],bt.MAX_POOL_SIZE=40,bt),yh=class ia{constructor(e){this._tokens=e}static create(e){const t=new Fa;return t.write(e),new ia(t.read())}static parseValue(e){return ia.create(e).parseComponentValue()}static parseValues(e){return ia.create(e).parseComponentValues()}parseComponentValue(){let e=this.consumeToken();for(;e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);const t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")}parseComponentValues(){const e=[];for(;;){const t=this.consumeComponentValue();if(t.type===32)return e;e.push(t)}}consumeComponentValue(){const e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e}consumeSimpleBlock(e){const t={type:e,values:[]};let r=this.consumeToken();for(;;){if(r.type===32||_C(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}}consumeFunction(e){const t={name:e.value,values:[],type:18};for(;;){const r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}}consumeToken(){const e=this._tokens.shift();return typeof e>"u"?Ia:e}reconsumeToken(e){this._tokens.unshift(e)}};const jt=A=>A.type===15,xe=A=>A.type===17,J=A=>A.type===20,CC=A=>A.type===0,Qn=(A,e)=>J(A)&&A.value===e,In=A=>A.type!==31,ke=A=>A.type!==31&&A.type!==4,It=A=>{const e=[];let t=[];return A.forEach(r=>{if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},_C=(A,e)=>e===11&&A.type===12||e===28&&A.type===29?!0:e===2&&A.type===3,EC=/(\d+(?:\.\d+)?|[+\-*/()])/g,Ch=A=>{const e=A.match(EC);if(!e)return NaN;const t=[],r=[],n={"+":1,"-":1,"*":2,"/":2};for(const i of e)if(/^\d+(?:\.\d+)?$/.test(i))t.push(parseFloat(i));else if(i==="(")r.push(i);else if(i===")"){for(;r.length&&r[r.length-1]!=="(";)t.push(r.pop());if(!r.length)return NaN;r.pop()}else{for(;r.length&&n[r[r.length-1]]>=n[i];)t.push(r.pop());r.push(i)}for(;r.length;){const i=r.pop();if(i==="(")return NaN;t.push(i)}const s=[];for(const i of t)if(typeof i=="number")s.push(i);else{const o=s.pop(),a=s.pop();if(a===void 0||o===void 0)return NaN;switch(i){case"+":s.push(a+o);break;case"-":s.push(a-o);break;case"*":s.push(a*o);break;case"/":s.push(o===0?NaN:a/o);break;default:return NaN}}return s.length===1?s[0]:NaN},we=(A,e,t)=>Math.min(Math.max(A,e),t),st=(A,e)=>[A[0]*e[0]+A[1]*e[1]+A[2]*e[2],A[3]*e[0]+A[4]*e[1]+A[5]*e[2],A[6]*e[0]+A[7]*e[1]+A[8]*e[2]],yA=A=>st([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A),Ta=A=>st([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A),$A=A=>A.map(e=>{const t=e<0?-1:1,r=Math.abs(e);return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),Sa=A=>A.map(e=>{const t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),vC=A=>{const[e,t,r]=$A(yA([A[0],A[1],A[2]]));return[e,t,r,A[3]]},bC=A=>{const[e,t,r]=yA([A[0],A[1],A[2]]);return[we(Math.round(e*255),0,255),we(Math.round(t*255),0,255),we(Math.round(r*255),0,255),A[3]]},CA=A=>A.type===17||A.type===15,oe=A=>A.type===16||CA(A),UC=A=>A.type===18&&A.name==="calc",QC=(A,e=0)=>{const t=r=>{let n="";for(const s of r)if(s.type!==31){if(s.type===18)if(s.name==="calc"){const i=t(s.values);if(i===null)return null;n+=`(${i})`}else return null;else if(s.type===17)n+=s.number.toString();else if(s.type===15)s.unit==="px"?n+=s.number.toString():s.unit==="rem"||s.unit==="em"?n+=(s.number*16).toString():n+=s.number.toString();else if(s.type===16)n+=(s.number/100*e).toString();else if(s.type===6){const i=s.value;i==="+"||i==="-"||i==="*"||i==="/"?n+=` ${i} `:i==="("?n+="(":i===")"&&(n+=")")}}return n};try{const r=t(A.values);if(r===null||r.trim()==="")return null;const n=Ch(r);if(typeof n=="number"&&!isNaN(n))return{type:17,number:n,flags:4}}catch{return null}return null},_h=A=>A.length>1?[A[0],A[1]]:[A[0]],ve={type:17,number:0,flags:4},sA={type:16,number:50,flags:4},Ft={type:16,number:100,flags:4},Fn=(A,e,t)=>{const[r,n]=A;return[G(r,e),G(typeof n<"u"?n:r,t)]},G=(A,e)=>{if(A.type===16)return A.number/100*e;if(jt(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Eh="deg",vh="grad",bh="rad",Uh="turn",Ir={name:"angle",parse:(A,e)=>{if(e.type===15)switch(e.unit){case Eh:return Math.PI*e.number/180;case vh:return Math.PI/200*e.number;case bh:return e.number;case Uh:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},Qh=A=>A.type===15&&(A.unit===Eh||A.unit===vh||A.unit===bh||A.unit===Uh),Ih=A=>{switch(A.filter(J).map(e=>e.value).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ve,ve];case"to top":case"bottom":return Bt(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ve,Ft];case"to right":case"left":return Bt(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Ft,Ft];case"to bottom":case"top":return Bt(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Ft,ve];case"to left":case"right":return Bt(270)}return 0},Bt=A=>Math.PI*A/180,_A=A=>(255&A)===0,me=A=>{const e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?`rgba(${n},${r},${t},${e/255})`:`rgb(${n},${r},${t})`},Tt=(A,e,t,r)=>(A<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0,EA=(A,e)=>{if(A.type===17)return A.number;if(A.type===16){const t=e===3?1:255;return e===3?A.number/100*t:Math.round(A.number/100*t)}return 0},jA=A=>(A[0].type===20?A[0].value:"unknown")==="from",IC=A=>Tt(we(Math.round(A[0]*255),0,255),we(Math.round(A[1]*255),0,255),we(Math.round(A[2]*255),0,255),we(A[3],0,1)),Ra=([A,e,t,r])=>{const n=$A([A,e,t]);return Tt(we(Math.round(n[0]*255),0,255),we(Math.round(n[1]*255),0,255),we(Math.round(n[2]*255),0,255),r)},Tn=A=>{const e=yA([A[0],A[1],A[2]]);return Ra([e[0],e[1],e[2],A[3]])},FC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for lab()");const[t,r,n,s]=hi(e),i=$A(yA(gi([t,r,n])));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},TC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for oklab()");const[t,r,n,s]=hi(e),i=$A(yA(fi([t,r,n])));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},SC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for oklch()");const[t,r,n,s]=Rh(e),i=$A(yA(fi(di([t,r,n]))));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},RC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for lch()");const[t,r,n,s]=Sh(e),i=$A(yA(gi(di([t,r,n]))));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},Fh=(A,e)=>{const[t,r,n,s]=e.filter(ke);return[(t.type===17?Bt(t.number):Ir.parse(A,t))/(Math.PI*2),oe(r)?r.number/100:0,oe(n)?n.number/100:0,typeof s<"u"&&oe(s)?G(s,1):1]},Th=(A,e)=>{if(jA(e))throw new Error("Relative color not supported for hsl()");const[t,r,n,s]=Fh(A,e),i=kh([t,r,n]);return Tt(i[0]*255,i[1]*255,i[2]*255,r===0?1:s)},Sh=A=>{const e=A.filter(ke);return[oe(e[0])?e[0].number:0,oe(e[1])?e[1].number:0,xe(e[2])||jt(e[2])?e[2].number:0,typeof e[4]<"u"&&oe(e[4])?G(e[4],1):1]},hi=A=>{const e=A.filter(ke);return[e[0].type===16?e[0].number/100:xe(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:xe(e[1])?e[1].number:0,xe(e[2])||jt(e[2])?e[2].number:0,typeof e[4]<"u"&&oe(e[4])?G(e[4],1):1]},Rh=A=>{const e=A.filter(ke);return[e[0].type===16?e[0].number/100:xe(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:xe(e[1])?e[1].number:0,xe(e[2])||jt(e[2])?e[2].number:0,typeof e[4]<"u"&&oe(e[4])?G(e[4],1):1]},xh=A=>st([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A),xa=A=>st([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A),ka=(A,e,t)=>(t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<1/2?e:t<2/3?(e-A)*6*(2/3-t)+A:A),kh=([A,e,t])=>{if(e===0)return[t*255,t*255,t*255];const r=t<=.5?t*(e+1):t+e-t*e,n=t*2-r;return[ka(n,r,A+1/3),ka(n,r,A),ka(n,r,A-1/3)]},di=([A,e,t])=>(e<0&&(e=0),isNaN(t)&&(t=0),[A,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]),fi=A=>st([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],st([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map(e=>e**3)),gi=A=>{const e=(A[0]+16)/116,t=A[1]/500+e,r=e-A[2]/200,n=24389/27,s=24/116,i=[(t>s?t**3:(116*t-16)/n)*.3457/.3585,A[0]>8?e**3:A[0]/n,(r>s?r**3:(116*r-16)/n)*.2958/.3585];return xa([i[0],i[1],i[2]])},xC=(A,e)=>{const t=e.filter(ke);if(t.length===3){const[r,n,s]=t.map(EA),i=Sa([r/255,n/255,s/255]),[o,a,l]=Ta([i[0],i[1],i[2]]);return[o,a,l,1]}if(t.length===4){const[r,n,s,i]=t.map(EA),o=Sa([r/255,n/255,s/255]),[a,l,u]=Ta([o[0],o[1],o[2]]);return[a,l,u,i]}return[0,0,0,1]},kC=(A,e)=>{const[t,r,n,s]=Fh(A,e),i=Sa(kh([t,r,n])),[o,a,l]=Ta([i[0],i[1],i[2]]);return[o,a,l,s]},LC=(A,e)=>{const[t,r,n,s]=hi(e),[i,o,a]=gi([t,r,n]);return[i,o,a,s]},DC=(A,e)=>{const[t,r,n,s]=Sh(e),[i,o,a]=gi(di([t,r,n]));return[i,o,a,s]},HC=(A,e)=>{const[t,r,n,s]=Rh(e),[i,o,a]=fi(di([t,r,n]));return[i,o,a,s]},OC=(A,e)=>{const[t,r,n,s]=hi(e),[i,o,a]=fi([t,r,n]);return[i,o,a,s]},PC=A=>xa([A[0],A[1],A[2]]),Lh=A=>A,NC=A=>{const[e,t,r]=xh([A[0],A[2],A[3]]);return[e,t,r,A[3]]},Dh=A=>Tn([A[0],A[1],A[2],A[3]]),MC=A=>{const e=PC([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},VC=A=>st([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],A),KC=A=>st([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],A),$C=A=>A.map(e=>{const t=e<0?-1:1;return e*t<=.04045?e/12.92:t*((e+.055)/1.055)**2.4||0}),jC=A=>$A(A),GC=A=>{const e=$C([A[0],A[1],A[2]]);return VC([e[0],e[1],e[2]])},WC=A=>{const[e,t,r]=jC(KC([A[0],A[1],A[2]]));return[e,t,r,A[3]]},qC=A=>{const e=GC([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},JC=A=>st([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],A),zC=A=>st([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],A),XC=A=>{const e=A.map(t=>(t<0?-1:1)*Math.abs(t)**2.19921875);return[e[0],e[1],e[2]]},YC=A=>{const e=A.map(t=>(t<0?-1:1)*Math.abs(t)**.4547069271758437);return[e[0],e[1],e[2]]},ZC=A=>{const[e,t,r]=YC(JC([A[0],A[1],A[2]]));return[e,t,r,A[3]]},e_=A=>{const e=yA(zC(XC([A[0],A[1],A[2]])));return Ra([e[0],e[1],e[2],A[3]])},t_=A=>st([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],A),A_=A=>st([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],A),r_=A=>A.map(e=>e<16/512?e/16:e**1.8),n_=A=>A.map(e=>e>1/512?e**(1/1.8):e*16),s_=A=>{const e=r_([A[0],A[1],A[2]]);return xa(t_([e[0],e[1],e[2]]))},i_=A=>{const[e,t,r]=n_(A_(xh([A[0],A[1],A[2]])));return[e,t,r,A[3]]},o_=A=>{const e=s_([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},pi=1.09929682680944,Hh=.018053968510807,a_=A=>A.map(function(e){return e<Hh*4.5?e/4.5:Math.pow((e+pi-1)/pi,1/.45)}),c_=A=>A.map(function(e){return e>=Hh?pi*Math.pow(e,.45)-(pi-1):4.5*e}),l_=A=>st([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],A),u_=A=>st([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],A),h_=A=>{const e=a_([A[0],A[1],A[2]]);return l_([e[0],e[1],e[2]])},d_=A=>{const[e,t,r]=c_(u_([A[0],A[1],A[2]]));return[e,t,r,A[3]]},f_=A=>{const e=h_([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},vA={name:"color",parse:(A,e)=>{if(e.type===18){const t=m_[e.name];if(typeof t>"u")throw new Error(`Attempting to parse an unsupported color function "${e.name}"`);return t(A,e.values)}if(e.type===5){const[t,r,n,s]=Oh(e);return Tt(t,r,n,s)}if(e.type===20){const t=Gt[e.value.toUpperCase()];if(typeof t<"u")return t}return Gt.TRANSPARENT}},Oh=A=>{if(A.value.length===3){const e=A.value.substring(0,1),t=A.value.substring(1,2),r=A.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),1]}if(A.value.length===4){const e=A.value.substring(0,1),t=A.value.substring(1,2),r=A.value.substring(2,3),n=A.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16)/255]}if(A.value.length===6){const e=A.value.substring(0,2),t=A.value.substring(2,4),r=A.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),1]}if(A.value.length===8){const e=A.value.substring(0,2),t=A.value.substring(2,4),r=A.value.substring(4,6),n=A.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),parseInt(n,16)/255]}return[0,0,0,1]},Ph=(A,e)=>{const t=e.filter(ke);if(jA(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){const[r,n,s]=t.map(EA);return Tt(r,n,s,1)}if(t.length===4){const[r,n,s,i]=t.map(EA);return Tt(r,n,s,i)}return t.length===5&&t[3].type===6&&t[3].value==="/"?Tt(EA(t[0],0),EA(t[1],1),EA(t[2],2),EA(t[4],3)):0},g_=(A,e)=>{const t=e.filter(ke),r=t[0].type===20?t[0].value:"unknown";if(jA(t)){const n=(B,b)=>{if(xe(b))return b.number;const S=R=>R==="r"||R==="x"?0:R==="g"||R==="y"?1:2;if(J(b))return B[S(b.value)];const I=R=>{const K=R.filter(ke);let P="(";for(const _ of K)P+=_.type===18&&_.name==="calc"?I(_.values):xe(_)?_.number:_.type===6||J(_)?_.value:"";return P+=")",P};if(b.type===18){const R=b.values.filter(ke);if(b.name==="calc")return Ch(I(R).replace(/r|x/,B[0].toString()).replace(/g|y/,B[1].toString()).replace(/b|z/,B[2].toString()))}return null},s=t[1].type===18?t[1].name:J(t[1])||t[1].type===5?"rgb":"unknown",i=J(t[2])?t[2].value:"unknown";let o=t[1].type===18?t[1].values:J(t[1])?[t[1]]:[];if(J(t[1])){if(typeof Gt[t[1].value.toUpperCase()]>"u")throw new Error("Attempting to use unknown color in relative color 'from'");{const B=Fr(A,t[1].value),b=255&B,S=255&B>>8,I=255&B>>16;o=[{type:17,number:255&B>>24,flags:1},{type:17,number:I,flags:1},{type:17,number:S,flags:1},{type:17,number:b>1?b/255:b,flags:1}]}}else if(t[1].type===5){const[B,b,S,I]=Oh(t[1]);o=[{type:17,number:B,flags:1},{type:17,number:b,flags:1},{type:17,number:S,flags:1},{type:17,number:I>1?I/255:I,flags:1}]}if(o.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(i==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");const a=p_[s],l=w_[i],u=Nh[i];if(typeof a>"u")throw new Error(`Attempting to parse an unsupported color space "${s}" for color() function`);if(typeof l>"u")throw new Error(`Attempting to parse an unsupported color space "${i}" for color() function`);const d=l(a(A,o)),g=n(d,t[3]),p=n(d,t[4]),w=n(d,t[5]),y=t.length>6&&t[6].type===6&&t[6].value==="/"&&xe(t[7])?t[7].number:1;if(g===null||p===null||w===null)throw new Error("Invalid relative color in color() function");return u([g,p,w,y])}else{const n=r,s=Nh[n];if(typeof s>"u")throw new Error(`Attempting to parse an unsupported color space "${n}" for color() function`);return s([xe(t[1])?t[1].number:0,xe(t[2])?t[2].number:0,xe(t[3])?t[3].number:0,t.length>4&&t[4].type===6&&t[4].value==="/"&&xe(t[5])?t[5].number:1])}},Nh={srgb:IC,"srgb-linear":Ra,"display-p3":qC,"a98-rgb":e_,"prophoto-rgb":o_,xyz:Dh,"xyz-d50":MC,"xyz-d65":Dh,rec2020:f_},p_={rgb:xC,hsl:kC,lab:LC,lch:DC,oklab:OC,oklch:HC},w_={srgb:vC,"srgb-linear":bC,"display-p3":WC,"a98-rgb":ZC,"prophoto-rgb":i_,xyz:Lh,"xyz-d50":NC,"xyz-d65":Lh,rec2020:d_},m_={hsl:Th,hsla:Th,rgb:Ph,rgba:Ph,lch:RC,oklch:SC,oklab:TC,lab:FC,color:g_},Fr=(A,e)=>vA.parse(A,yh.create(e).parseComponentValue()),Gt={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},B_={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:(A,e)=>e.map(t=>{if(J(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})},y_={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wi=(A,e)=>{const t=vA.parse(A,e[0]),r=e[1];return r&&oe(r)?{color:t,stop:r}:{color:t,stop:null}},La=(A,e)=>{const t=A[0],r=A[A.length-1];t.stop===null&&(t.stop=ve),r.stop===null&&(r.stop=Ft);const n=[];let s=0;for(let o=0;o<A.length;o++){const a=A[o].stop;if(a!==null){const l=G(a,e);l>s?n.push(l):n.push(s),s=l}else n.push(null)}let i=null;for(let o=0;o<n.length;o++){const a=n[o];if(a===null)i===null&&(i=o);else if(i!==null){const l=o-i,u=(a-n[i-1])/(l+1);for(let d=1;d<=l;d++)n[i+d-1]=u*d;i=null}}return A.map(({color:o},a)=>({color:o,stop:Math.max(Math.min(1,n[a]/e),0)}))},C_=(A,e,t)=>{const r=e/2,n=t/2,s=G(A[0],e)-r,i=n-G(A[1],t);return(Math.atan2(i,s)+Math.PI*2)%(Math.PI*2)},Mh=(A,e,t)=>{const r=typeof A=="number"?A:C_(A,e,t),n=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),s=e/2,i=t/2,o=n/2,a=Math.sin(r-Math.PI/2)*o,l=Math.cos(r-Math.PI/2)*o;return[n,s-l,s+l,i-a,i+a]},St=(A,e)=>Math.sqrt(A*A+e*e),Vh=(A,e,t,r,n)=>[[0,0],[0,e],[A,0],[A,e]].reduce((s,i)=>{const[o,a]=i,l=St(t-o,r-a);return(n?l<s.optimumDistance:l>s.optimumDistance)?{optimumCorner:i,optimumDistance:l}:s},{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner,__=(A,e,t,r,n)=>{let s=0,i=0;switch(A.size){case 0:A.shape===0?s=i=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===1&&(s=Math.min(Math.abs(e),Math.abs(e-r)),i=Math.min(Math.abs(t),Math.abs(t-n)));break;case 2:if(A.shape===0)s=i=Math.min(St(e,t),St(e,t-n),St(e-r,t),St(e-r,t-n));else if(A.shape===1){const o=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),[a,l]=Vh(r,n,e,t,!0);s=St(a-e,(l-t)/o),i=o*s}break;case 1:A.shape===0?s=i=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===1&&(s=Math.max(Math.abs(e),Math.abs(e-r)),i=Math.max(Math.abs(t),Math.abs(t-n)));break;case 3:if(A.shape===0)s=i=Math.max(St(e,t),St(e,t-n),St(e-r,t),St(e-r,t-n));else if(A.shape===1){const o=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r)),[a,l]=Vh(r,n,e,t,!1);s=St(a-e,(l-t)/o),i=o*s}break}return Array.isArray(A.size)&&(s=G(A.size[0],r),i=A.size.length===2?G(A.size[1],n):s),[s,i]},Kh=(A,e)=>{let t=Bt(180);const r=[];return It(e).forEach((n,s)=>{if(s===0){const o=n[0];if(o.type===20&&o.value==="to"){t=Ih(n);return}else if(Qh(o)){t=Ir.parse(A,o);return}}const i=wi(A,n);r.push(i)}),{angle:t,stops:r,type:1}},mi=(A,e)=>{let t=Bt(180);const r=[];return It(e).forEach((n,s)=>{if(s===0){const o=n[0];if(o.type===20&&["top","left","right","bottom"].indexOf(o.value)!==-1){t=Ih(n);return}else if(Qh(o)){t=(Ir.parse(A,o)+Bt(270))%Bt(360);return}}const i=wi(A,n);r.push(i)}),{angle:t,stops:r,type:1}},E_=(A,e)=>{const t=Bt(180),r=[];let n=1;const s=0,i=3,o=[];return It(e).forEach((a,l)=>{const u=a[0];if(l===0){if(J(u)&&u.value==="linear"){n=1;return}else if(J(u)&&u.value==="radial"){n=2;return}}if(u.type===18){if(u.name==="from"){const d=vA.parse(A,u.values[0]);r.push({stop:ve,color:d})}else if(u.name==="to"){const d=vA.parse(A,u.values[0]);r.push({stop:Ft,color:d})}else if(u.name==="color-stop"){const d=u.values.filter(ke);if(d.length===2){const g=vA.parse(A,d[1]),p=d[0];xe(p)&&r.push({stop:{type:16,number:p.number*100,flags:p.flags},color:g})}}}}),n===1?{angle:(t+Bt(180))%Bt(360),stops:r,type:n}:{size:i,shape:s,stops:r,position:o,type:n}},$h="closest-side",jh="farthest-side",Gh="closest-corner",Wh="farthest-corner",qh="circle",Jh="ellipse",zh="cover",Xh="contain",v_=(A,e)=>{let t=0,r=3;const n=[],s=[];return It(e).forEach((i,o)=>{let a=!0;if(o===0){let l=!1;a=i.reduce((u,d)=>{if(l)if(J(d))switch(d.value){case"center":return s.push(sA),u;case"top":case"left":return s.push(ve),u;case"right":case"bottom":return s.push(Ft),u}else(oe(d)||CA(d))&&s.push(d);else if(J(d))switch(d.value){case qh:return t=0,!1;case Jh:return t=1,!1;case"at":return l=!0,!1;case $h:return r=0,!1;case zh:case jh:return r=1,!1;case Xh:case Gh:return r=2,!1;case Wh:return r=3,!1}else if(CA(d)||oe(d))return Array.isArray(r)||(r=[]),r.push(d),!1;return u},a)}if(a){const l=wi(A,i);n.push(l)}}),{size:r,shape:t,stops:n,position:s,type:2}},Bi=(A,e)=>{let t=0,r=3;const n=[],s=[];return It(e).forEach((i,o)=>{let a=!0;if(o===0?a=i.reduce((l,u)=>{if(J(u))switch(u.value){case"center":return s.push(sA),!1;case"top":case"left":return s.push(ve),!1;case"right":case"bottom":return s.push(Ft),!1}else if(oe(u)||CA(u))return s.push(u),!1;return l},a):o===1&&(a=i.reduce((l,u)=>{if(J(u))switch(u.value){case qh:return t=0,!1;case Jh:return t=1,!1;case Xh:case $h:return r=0,!1;case jh:return r=1,!1;case Gh:return r=2,!1;case zh:case Wh:return r=3,!1}else if(CA(u)||oe(u))return Array.isArray(r)||(r=[]),r.push(u),!1;return l},a)),a){const l=wi(A,i);n.push(l)}}),{size:r,shape:t,stops:n,position:s,type:2}},Sn=(A,e)=>({...Kh(A,e),type:3}),b_=A=>A.type===1,U_=A=>A.type===2,Q_=A=>A.type===3,yi={name:"image",parse:(A,e)=>{if(e.type===22){const t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(e.type===18){const t=Zh[e.name];if(typeof t>"u")throw new Error(`Attempting to parse an unsupported image function "${e.name}"`);return t(A,e.values)}throw new Error(`Unsupported image type ${e.type}`)}};function Yh(A){return!(A.type===20&&A.value==="none")&&(A.type!==18||!!Zh[A.name])}const Zh={"linear-gradient":Kh,"-moz-linear-gradient":mi,"-ms-linear-gradient":mi,"-o-linear-gradient":mi,"-webkit-linear-gradient":mi,"radial-gradient":v_,"-moz-radial-gradient":Bi,"-ms-radial-gradient":Bi,"-o-radial-gradient":Bi,"-webkit-radial-gradient":Bi,"-webkit-gradient":E_,"repeating-linear-gradient":Sn,"-webkit-repeating-linear-gradient":Sn,"-moz-repeating-linear-gradient":Sn,"-ms-repeating-linear-gradient":Sn,"-o-repeating-linear-gradient":Sn},I_={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>{if(e.length===0)return[];const t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(r=>ke(r)&&Yh(r)).map(r=>yi.parse(A,r))}},F_={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:(A,e)=>e.map(t=>{if(J(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})},T_={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:(A,e)=>It(e).map(t=>t.map(r=>UC(r)?QC(r,0):oe(r)?r:null).filter(r=>r!==null)).map(_h)},S_={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:(A,e)=>It(e).map(t=>t.filter(J).map(r=>r.value).join(" ")).map(R_)},R_=A=>{switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},x_={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:(A,e)=>It(e).map(t=>t.filter(k_))},k_=A=>J(A)||oe(A),Ci=A=>({name:`border-${A}-color`,initialValue:"transparent",prefix:!1,type:3,format:"color"}),L_=Ci("top"),D_=Ci("right"),H_=Ci("bottom"),O_=Ci("left"),_i=A=>({name:`border-${A}-radius`,initialValue:"0 0",prefix:!1,type:1,parse:(e,t)=>_h(t.filter(oe))}),P_=_i("top-left"),N_=_i("top-right"),M_=_i("bottom-right"),V_=_i("bottom-left"),Ei=A=>({name:`border-${A}-style`,initialValue:"solid",prefix:!1,type:2,parse:(e,t)=>{switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}),K_=Ei("top"),$_=Ei("right"),j_=Ei("bottom"),G_=Ei("left"),vi=A=>({name:`border-${A}-width`,initialValue:"0",type:0,prefix:!1,parse:(e,t)=>jt(t)?t.number:0}),W_=vi("top"),q_=vi("right"),J_=vi("bottom"),z_=vi("left"),Da={type:0},Ha=A=>{const[e]=A;return e?J(e)?e.value==="farthest-side"?"farthest-side":"closest-side":oe(e)?e:"closest-side":"closest-side"},ed=A=>{let e=null,t=null;for(const r of A)if(J(r))switch(r.value){case"left":e=ve;break;case"right":e=Ft;break;case"top":t=ve;break;case"bottom":t=Ft;break;case"center":e===null?e=sA:t===null&&(t=sA);break}else oe(r)&&(e===null?e=r:t===null&&(t=r));return{cx:e??sA,cy:t??sA}},X_=A=>{const e=[];for(const n of A)if(n.type!==31){if(J(n)&&n.value==="round")break;oe(n)&&e.push(n)}const t=e[0]??ve,r=e[1]??t;return{type:1,top:t,right:r,bottom:e[2]??t,left:e[3]??r}},Y_=A=>{const e=A.filter(In),t=e.findIndex(s=>Qn(s,"at")),r=t===-1?e:e.slice(0,t),n=t===-1?[]:e.slice(t+1);return{type:2,radius:Ha(r),...ed(n)}},Z_=A=>{const e=A.filter(In),t=e.findIndex(s=>Qn(s,"at")),r=t===-1?e:e.slice(0,t),n=t===-1?[]:e.slice(t+1);return{type:3,rx:Ha(r.slice(0,1)),ry:Ha(r.slice(1,2)),...ed(n)}},e0=A=>{const e=It(A),t=[];for(const r of e){if(r.length===1&&J(r[0]))continue;const n=r.filter(oe);n.length>=2&&t.push([n[0],n[1]])}return{type:4,points:t}},t0=A=>{const e=A.find(t=>t.type===0);return e?{type:5,d:e.value}:Da},A0={name:"clip-path",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>{if(J(e)&&e.value==="none")return Da;if(e.type===18)switch(e.name){case"inset":return X_(e.values);case"circle":return Y_(e.values);case"ellipse":return Z_(e.values);case"polygon":return e0(e.values);case"path":return t0(e.values)}return Da}},r0={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},n0={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"rtl":return 1;default:return 0}}},s0={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:(A,e)=>e.filter(J).reduce((t,r)=>t|i0(r.value),0)},i0=A=>{switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},td={name:"float",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},o0={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:(A,e)=>e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0},a0={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"strict":return"strict";default:return"normal"}}},c0={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ad=(A,e)=>J(A)&&A.value==="normal"?1.2*e:A.type===17?e*A.number:oe(A)?G(A,e):e,l0={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:(A,e)=>e.type===20&&e.value==="none"?null:yi.parse(A,e)},u0={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"inside":return 0;default:return 1}}},Oa={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},bi=A=>({name:`margin-${A}`,initialValue:"0",prefix:!1,type:4}),h0=bi("top"),d0=bi("right"),f0=bi("bottom"),g0=bi("left"),rd={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:(A,e)=>e.filter(J).map(t=>{switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})},p0={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-word":return"break-word";default:return"normal"}}},Ui=A=>({name:`padding-${A}`,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}),w0=Ui("top"),m0=Ui("right"),B0=Ui("bottom"),y0=Ui("left"),C0={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},_0={name:"position",initialValue:"static",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},E0={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&Qn(e[0],"none")?[]:It(e).map(t=>{const r={color:Gt.TRANSPARENT,offsetX:ve,offsetY:ve,blur:ve};let n=0;for(let s=0;s<t.length;s++){const i=t[s];CA(i)?(n===0?r.offsetX=i:n===1?r.offsetY=i:r.blur=i,n++):r.color=vA.parse(A,i)}return r})},v0={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},b0={name:"transform",initialValue:"none",prefix:!0,type:0,parse:(A,e)=>{if(e.type===20&&e.value==="none")return null;if(e.type===18){const t=U0[e.name];if(typeof t>"u")throw new Error(`Attempting to parse an unsupported transform function "${e.name}"`);return t(A,e.values)}return null}},U0={matrix:(A,e)=>{const t=e.filter(r=>r.type===17).map(r=>r.number);return t.length===6?t:null},matrix3d:(A,e)=>{const t=e.filter(l=>l.type===17).map(l=>l.number),[r,n,{},{},s,i,{},{},{},{},{},{},o,a]=t;return t.length===16?[r,n,s,i,o,a]:null},rotate:(A,e)=>{if(e.length!==1)return null;const t=e[0];let r=0;if(t.type===17&&t.number===0)r=0;else if(t.type===15)r=Ir.parse(A,t);else return null;const n=Math.cos(r),s=Math.sin(r);return[n,s,-s,n,0,0]}},nd={type:16,number:50,flags:4},Q0=[nd,nd],I0={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:(A,e)=>{const t=e.filter(oe);return t.length!==2?Q0:[t[0],t[1]]}},F0={name:"rotate",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>e.type===20&&e.value==="none"?null:e.type===17&&e.number===0?0:e.type===15?Ir.parse(A,e)*180/Math.PI:null},T0={name:"visibility",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}},S0={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-all":return"break-all";case"keep-all":return"keep-all";default:return"normal"}}},Pa=A=>A!==0,R0=A=>A===3||A===4,x0={name:"writing-mode",initialValue:"horizontal-tb",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"vertical-rl":return 1;case"vertical-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4;default:return 0}}},k0={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(e.type===20)return{auto:!0,order:0};if(xe(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},sd={name:"time",parse:(A,e)=>{if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},L0={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>xe(e)?e.number:1},id={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},od={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>e.filter(J).map(t=>{switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(t=>t!==0)},D0={name:"text-decoration-style",initialValue:"solid",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4;default:return 0}}},H0={name:"text-decoration-thickness",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(J(e))switch(e.value){case"auto":return"auto";case"from-font":return"from-font"}return jt(e)?e.number:"auto"}},O0={name:"text-underline-offset",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>J(e)&&e.value==="auto"?"auto":jt(e)?e.number:"auto"},P0={name:"font-family",initialValue:"",prefix:!1,type:1,parse:(A,e)=>{const t=[],r=[];return e.forEach(n=>{switch(n.type){case 20:case 0:t.push(n.value);break;case 17:t.push(n.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(n=>n.indexOf(" ")===-1?n:`'${n}'`)}},N0={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},M0={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:(A,e)=>{if(xe(e))return e.number;if(J(e))switch(e.value){case"bold":return 700;default:return 400}return 400}},V0={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.filter(J).map(t=>t.value)},K0={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},Pe=(A,e)=>(A&e)!==0,$0={name:"content",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>{if(e.length===0)return[];const t=e[0];return t.type===20&&t.value==="none"?[]:e}},ad=(A,e)=>{const t=[],r=A.filter(In);for(let n=0;n<r.length;n++){const s=r[n],i=r[n+1];if(s.type===20){const o=i&&xe(i)?i.number:e;t.push([s.value,o])}}return t},j0={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e[0];return t.type===20&&t.value==="none"?null:ad(e,1).map(([r,n])=>({counter:r,increment:n}))}},G0={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>e.length===0?[]:ad(e,0).filter(([t])=>t!=="none").map(([t,r])=>({counter:t,reset:r}))},W0={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:(A,e)=>e.filter(jt).map(t=>sd.parse(A,t))},q0={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e[0];if(t.type===20&&t.value==="none")return null;const r=[],n=e.filter(CC);if(n.length%2!==0)return null;for(let s=0;s<n.length;s+=2){const i=n[s].value,o=n[s+1].value;r.push({open:i,close:o})}return r}},cd=(A,e,t)=>{if(!A)return"";const r=A[Math.min(e,A.length-1)];return r?t?r.open:r.close:""},J0={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&Qn(e[0],"none")?[]:It(e).map(t=>{const r={color:255,offsetX:ve,offsetY:ve,blur:ve,spread:ve,inset:!1};let n=0;for(let s=0;s<t.length;s++){const i=t[s];Qn(i,"inset")?r.inset=!0:CA(i)?(n===0?r.offsetX=i:n===1?r.offsetY=i:n===2?r.blur=i:r.spread=i,n++):r.color=vA.parse(A,i)}return r})},z0={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:(A,e)=>{const t=[0,1,2],r=[];return e.filter(J).forEach(n=>{switch(n.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(n=>{r.indexOf(n)===-1&&r.push(n)}),r}},X0={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Y0={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:(A,e)=>jt(e)?e.number:0},Z0={name:"-webkit-line-clamp",initialValue:"none",prefix:!0,type:0,parse:(A,e)=>e.type===20&&e.value==="none"?0:e.type===17?Math.max(0,Math.floor(e.number)):0},eE={name:"object-fit",initialValue:"fill",prefix:!1,type:1,parse:(A,e)=>e.filter(J).reduce((t,r)=>t|tE(r.value),0)},tE=A=>{switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},AE={name:"text-overflow",initialValue:"clip",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"ellipsis":return 1;default:return 0}}},rE={name:"image-rendering",initialValue:"auto",prefix:!1,type:2,parse:(A,e)=>{switch(e.toLowerCase()){case"crisp-edges":case"-webkit-crisp-edges":case"-moz-crisp-edges":return 1;case"pixelated":case"-webkit-optimize-contrast":return 2;case"smooth":case"high-quality":return 3;default:return 0}}},Le={NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten",COLOR_DODGE:"color-dodge",COLOR_BURN:"color-burn",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"},nE=new Set(Object.values(Le)),sE={name:"mix-blend-mode",initialValue:"normal",type:2,prefix:!1,parse:(A,e)=>nE.has(e)?e:Le.NORMAL},iE={name:"filter",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>{if(e.length===1&&e[0].type===20&&e[0].value==="none")return null;const t=[];for(const r of e)if(r.type===18){const n=r,s=oE(n.values);switch(n.name){case"blur":t.push(`blur(${s}px)`);break;case"brightness":case"contrast":case"invert":case"opacity":case"saturate":case"sepia":t.push(`${n.name}(${s})`);break;case"grayscale":t.push(`grayscale(${s})`);break;case"hue-rotate":t.push(`hue-rotate(${s}deg)`);break;case"drop-shadow":t.push(`drop-shadow(${s})`);break}}return t.length>0?t.join(" "):null}},oE=A=>{const e=[];for(const t of A)t.type!==31&&(t.type===15?e.push(`${t.number}${t.unit}`):t.type===17?e.push(`${t.number}`):t.type===16?e.push(`${t.number}%`):t.type===20?e.push(t.value):t.type===5&&e.push(`#${t.value}`));return e.join(" ")},aE={name:"font-variant-ligatures",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"none":return 1;case"common-ligatures":return 2;case"no-common-ligatures":return 3;case"discretionary-ligatures":return 4;case"no-discretionary-ligatures":return 5;case"historical-ligatures":return 6;case"no-historical-ligatures":return 7;case"contextual":return 8;case"no-contextual":return 9;default:return 0}}},cE={name:"zoom",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>e.type===16?Math.max(0,e.number/100):e.type===17?Math.max(0,e.number):1},lE={name:"object-position",initialValue:"50% 50%",prefix:!1,type:1,parse:(A,e)=>{const t=[];let r=0;for(;r<e.length&&t.length<2;){const n=e[r];if(J(n))switch(n.value){case"left":case"top":t.push(ve);break;case"center":t.push(sA);break;case"right":case"bottom":t.push(Ft);break}else oe(n)&&t.push(n);r++}for(;t.length<2;)t.push(sA);return[t[0],t[1]]}},uE=new Set(Object.values({NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten",COLOR_DODGE:"color-dodge",COLOR_BURN:"color-burn",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"})),hE={name:"background-blend-mode",initialValue:"normal",prefix:!1,type:1,parse:(A,e)=>{const t=[],r=e.filter(ke);for(const n of r)J(n)&&uE.has(n.value)&&t.push(n.value);return t.length>0?t:["normal"]}},dE={name:"border-image-source",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e.filter(r=>ke(r)&&Yh(r));return t.length===0?null:yi.parse(A,t[0])}},fE=A=>{const e=[...A];return e.length===1?e.push(e[0],e[0],e[0]):e.length===2?e.push(e[0],e[1]):e.length===3&&e.push(e[1]),e.slice(0,4)},gE={name:"border-image-slice",initialValue:"100%",prefix:!1,type:1,parse:(A,e)=>{const t=e.filter(In),r=[];let n=!1,s="percent";for(const u of t){if(J(u)&&u.value==="fill"){n=!0;continue}u.type===17?(r.push(u.number),s="number"):u.type===16&&(r.push(u.number),s="percent")}const[i,o,a,l]=fE(r.length>0?r:[100]);return{top:i,right:o,bottom:a,left:l,fill:n,unit:s}}},pE=A=>{switch(A){case"repeat":return 1;case"round":return 2;case"space":return 3;default:return 0}},wE={name:"border-image-repeat",initialValue:"stretch",prefix:!1,type:1,parse:(A,e)=>{const t=e.filter(In),r=[];for(const s of t)J(s)&&r.push(pE(s.value));const n=r[0]??0;return{horizontal:n,vertical:r[1]??n}}},mE={name:"box-decoration-break",initialValue:"slice",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"clone":return 1;default:return 0}}};var BE=class{constructor(A){this.styles=A}get topColor(){return this.styles.borderTopColor}get rightColor(){return this.styles.borderRightColor}get bottomColor(){return this.styles.borderBottomColor}get leftColor(){return this.styles.borderLeftColor}get topStyle(){return this.styles.borderTopStyle}get rightStyle(){return this.styles.borderRightStyle}get bottomStyle(){return this.styles.borderBottomStyle}get leftStyle(){return this.styles.borderLeftStyle}get topWidth(){return this.styles.borderTopWidth}get rightWidth(){return this.styles.borderRightWidth}get bottomWidth(){return this.styles.borderBottomWidth}get leftWidth(){return this.styles.borderLeftWidth}get topLeftRadius(){return this.styles.borderTopLeftRadius}get topRightRadius(){return this.styles.borderTopRightRadius}get bottomRightRadius(){return this.styles.borderBottomRightRadius}get bottomLeftRadius(){return this.styles.borderBottomLeftRadius}get imageSource(){return this.styles.borderImageSource}get imageSlice(){return this.styles.borderImageSlice}get imageRepeat(){return this.styles.borderImageRepeat}get boxShadow(){return this.styles.boxShadow}},yE=class{constructor(A){this.styles=A}get color(){return this.styles.backgroundColor}get image(){return this.styles.backgroundImage}get clip(){return this.styles.backgroundClip}get origin(){return this.styles.backgroundOrigin}get position(){return this.styles.backgroundPosition}get repeat(){return this.styles.backgroundRepeat}get size(){return this.styles.backgroundSize}get blendMode(){return this.styles.backgroundBlendMode}},CE=class{constructor(A){this.styles=A}get family(){return this.styles.fontFamily}get size(){return this.styles.fontSize}get style(){return this.styles.fontStyle}get variant(){return this.styles.fontVariant}get weight(){return this.styles.fontWeight}get ligatures(){return this.styles.fontVariantLigatures}get color(){return this.styles.color}get letterSpacing(){return this.styles.letterSpacing}get lineHeight(){return this.styles.lineHeight}get textAlign(){return this.styles.textAlign}get textTransform(){return this.styles.textTransform}get textOverflow(){return this.styles.textOverflow}get textShadow(){return this.styles.textShadow}get textDecorationColor(){return this.styles.textDecorationColor}get textDecorationLine(){return this.styles.textDecorationLine}get textDecorationStyle(){return this.styles.textDecorationStyle}get textDecorationThickness(){return this.styles.textDecorationThickness}get textUnderlineOffset(){return this.styles.textUnderlineOffset}get wordBreak(){return this.styles.wordBreak}get lineBreak(){return this.styles.lineBreak}get overflowWrap(){return this.styles.overflowWrap}get writingMode(){return this.styles.writingMode}get direction(){return this.styles.direction}get webkitTextStrokeColor(){return this.styles.webkitTextStrokeColor}get webkitTextStrokeWidth(){return this.styles.webkitTextStrokeWidth}get webkitLineClamp(){return this.styles.webkitLineClamp}get paintOrder(){return this.styles.paintOrder}},_E=class{constructor(A){this.styles=A}get display(){return this.styles.display}get position(){return this.styles.position}get float(){return this.styles.float}get zIndex(){return this.styles.zIndex}get marginTop(){return this.styles.marginTop}get marginRight(){return this.styles.marginRight}get marginBottom(){return this.styles.marginBottom}get marginLeft(){return this.styles.marginLeft}get paddingTop(){return this.styles.paddingTop}get paddingRight(){return this.styles.paddingRight}get paddingBottom(){return this.styles.paddingBottom}get paddingLeft(){return this.styles.paddingLeft}get overflowX(){return this.styles.overflowX}get overflowY(){return this.styles.overflowY}get opacity(){return this.styles.opacity}get visibility(){return this.styles.visibility}get transform(){return this.styles.transform}get transformOrigin(){return this.styles.transformOrigin}get rotate(){return this.styles.rotate}get zoom(){return this.styles.zoom}get clipPath(){return this.styles.clipPath}get mixBlendMode(){return this.styles.mixBlendMode}get filter(){return this.styles.filter}get imageRendering(){return this.styles.imageRendering}get objectFit(){return this.styles.objectFit}get objectPosition(){return this.styles.objectPosition}get boxDecorationBreak(){return this.styles.boxDecorationBreak}get listStyleImage(){return this.styles.listStyleImage}get listStylePosition(){return this.styles.listStylePosition}get listStyleType(){return this.styles.listStyleType}get animationDuration(){return this.styles.animationDuration}isVisible(){return this.styles.isVisible()}isTransparent(){return this.styles.isTransparent()}isTransformed(){return this.styles.isTransformed()}isPositioned(){return this.styles.isPositioned()}isPositionedWithZIndex(){return this.styles.isPositionedWithZIndex()}isFloating(){return this.styles.isFloating()}isInlineLevel(){return this.styles.isInlineLevel()}},EE=(pr=class{get border(){return this._border??(this._border=new BE(this))}get background(){return this._background??(this._background=new yE(this))}get font(){return this._font??(this._font=new CE(this))}get layout(){return this._layout??(this._layout=new _E(this))}constructor(e,t){const r=pr.standardProps;if(t.display==="none"){this.display=0;for(const[i,o]of r)i!=="display"&&(this[i]=it(e,o,void 0));this.float=it(e,td,void 0),this.textDecorationColor=it(e,id,void 0),this.textDecorationLine=it(e,od,void 0);const s=it(e,rd,void 0);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0];return}for(const[s,i,o]of r)this[s]=it(e,i,t[o]);this.float=it(e,td,t.cssFloat),this.textDecorationColor=it(e,id,t.textDecorationColor??t.color),this.textDecorationLine=it(e,od,t.textDecorationLine??t.textDecoration);const n=it(e,rd,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0]}isVisible(){return this.display>0&&this.opacity>0&&this.visibility===0}isTransparent(){return _A(this.backgroundColor)}isTransformed(){return this.transform!==null||this.rotate!==null}isPositioned(){return this.position!==0}isPositionedWithZIndex(){return this.isPositioned()&&!this.zIndex.auto}isFloating(){return this.float!==0}isInlineLevel(){return Pe(this.display,4)||Pe(this.display,33554432)||Pe(this.display,268435456)||Pe(this.display,536870912)||Pe(this.display,67108864)||Pe(this.display,134217728)}},pr.standardProps=[["animationDuration",W0,"animationDuration"],["backgroundClip",B_,"backgroundClip"],["backgroundColor",y_,"backgroundColor"],["backgroundImage",I_,"backgroundImage"],["backgroundOrigin",F_,"backgroundOrigin"],["backgroundPosition",T_,"backgroundPosition"],["backgroundRepeat",S_,"backgroundRepeat"],["backgroundSize",x_,"backgroundSize"],["borderTopColor",L_,"borderTopColor"],["borderRightColor",D_,"borderRightColor"],["borderBottomColor",H_,"borderBottomColor"],["borderLeftColor",O_,"borderLeftColor"],["borderTopLeftRadius",P_,"borderTopLeftRadius"],["borderTopRightRadius",N_,"borderTopRightRadius"],["borderBottomRightRadius",M_,"borderBottomRightRadius"],["borderBottomLeftRadius",V_,"borderBottomLeftRadius"],["borderTopStyle",K_,"borderTopStyle"],["borderRightStyle",$_,"borderRightStyle"],["borderBottomStyle",j_,"borderBottomStyle"],["borderLeftStyle",G_,"borderLeftStyle"],["borderTopWidth",W_,"borderTopWidth"],["borderRightWidth",q_,"borderRightWidth"],["borderBottomWidth",J_,"borderBottomWidth"],["borderLeftWidth",z_,"borderLeftWidth"],["boxShadow",J0,"boxShadow"],["clipPath",A0,"clipPath"],["color",r0,"color"],["direction",n0,"direction"],["display",s0,"display"],["fontFamily",P0,"fontFamily"],["fontSize",N0,"fontSize"],["fontStyle",K0,"fontStyle"],["fontVariant",V0,"fontVariant"],["fontWeight",M0,"fontWeight"],["letterSpacing",o0,"letterSpacing"],["lineBreak",a0,"lineBreak"],["lineHeight",c0,"lineHeight"],["listStyleImage",l0,"listStyleImage"],["listStylePosition",u0,"listStylePosition"],["listStyleType",Oa,"listStyleType"],["marginTop",h0,"marginTop"],["marginRight",d0,"marginRight"],["marginBottom",f0,"marginBottom"],["marginLeft",g0,"marginLeft"],["opacity",L0,"opacity"],["overflowWrap",p0,"overflowWrap"],["paddingTop",w0,"paddingTop"],["paddingRight",m0,"paddingRight"],["paddingBottom",B0,"paddingBottom"],["paddingLeft",y0,"paddingLeft"],["paintOrder",z0,"paintOrder"],["position",_0,"position"],["textAlign",C0,"textAlign"],["textDecorationStyle",D0,"textDecorationStyle"],["textDecorationThickness",H0,"textDecorationThickness"],["textUnderlineOffset",O0,"textUnderlineOffset"],["textShadow",E0,"textShadow"],["textTransform",v0,"textTransform"],["textOverflow",AE,"textOverflow"],["transform",b0,"transform"],["transformOrigin",I0,"transformOrigin"],["rotate",F0,"rotate"],["visibility",T0,"visibility"],["webkitTextStrokeColor",X0,"webkitTextStrokeColor"],["webkitTextStrokeWidth",Y0,"webkitTextStrokeWidth"],["webkitLineClamp",Z0,"webkitLineClamp"],["wordBreak",S0,"wordBreak"],["writingMode",x0,"writingMode"],["zIndex",k0,"zIndex"],["objectFit",eE,"objectFit"],["imageRendering",rE,"imageRendering"],["mixBlendMode",sE,"mixBlendMode"],["filter",iE,"filter"],["fontVariantLigatures",aE,"fontVariantLigatures"],["zoom",cE,"zoom"],["objectPosition",lE,"objectPosition"],["backgroundBlendMode",hE,"backgroundBlendMode"],["borderImageSource",dE,"borderImageSource"],["borderImageSlice",gE,"borderImageSlice"],["borderImageRepeat",wE,"borderImageRepeat"],["boxDecorationBreak",mE,"boxDecorationBreak"]],pr),vE=class{constructor(A,e){this.content=it(A,$0,e.content),this.quotes=it(A,q0,e.quotes)}},ld=class{constructor(A,e){this.counterIncrement=it(A,j0,e.counterIncrement),this.counterReset=it(A,G0,e.counterReset)}};const ud=new Map,it=(A,e,t)=>{const r=t!==null&&typeof t<"u"?t.toString():e.initialValue;let n=ud.get(e);if(n){const a=n.get(r);if(a!==void 0)return n.delete(r),n.set(r,a),a}const s=Fa.get();s.write(r);const i=new yh(s.read());Fa.release(s);const o=(()=>{switch(e.type){case 2:{const a=i.parseComponentValue();return e.parse(A,J(a)?a.value:e.initialValue)}case 0:return e.parse(A,i.parseComponentValue());case 1:return e.parse(A,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(e.format){case"angle":return Ir.parse(A,i.parseComponentValue());case"color":return vA.parse(A,i.parseComponentValue());case"image":return yi.parse(A,i.parseComponentValue());case"length":{const a=i.parseComponentValue();return CA(a)?a:ve}case"length-percentage":{const a=i.parseComponentValue();return oe(a)?a:ve}case"time":return sd.parse(A,i.parseComponentValue())}}})();if(n||(n=new Map,ud.set(e,n)),!(e.type===3&&e.format==="image")){if(n.size>=200){const a=n.keys().next().value;n.delete(a)}n.set(r,o)}return o},GA=A=>A.nodeType===Node.ELEMENT_NODE,hd=A=>A.nodeType===Node.TEXT_NODE,WA=A=>typeof A.className=="object",Rn=A=>GA(A)&&typeof A.style<"u"&&!WA(A),bE=A=>A.tagName==="INPUT",UE=A=>A.tagName==="HTML",dd=A=>A.tagName==="svg",Na=A=>A.tagName==="BODY",fd=A=>A.tagName==="CANVAS",gd=A=>A.tagName==="VIDEO",Ma=A=>A.tagName==="IMG",pd=A=>A.tagName==="IFRAME",wd=A=>A.tagName==="STYLE",QE=A=>A.tagName==="SCRIPT",Qi=A=>A.tagName==="TEXTAREA",Ii=A=>A.tagName==="SELECT",xn=A=>A.tagName==="SLOT",IE=A=>A.tagName==="LI",FE=A=>A.tagName==="OL",md=A=>!WA(A)&&A.tagName.indexOf("-")>0,TE=new Set(["IMG","VIDEO","AUDIO","CANVAS","IFRAME","INPUT","TEXTAREA","SELECT","BR","HR","META","LINK","BASE","COL","SOURCE","TRACK","WBR","AREA","PARAM","EMBED","OBJECT"]),SE=A=>!WA(A)&&!TE.has(A.tagName),RE="data-html2canvas-debug",xE=A=>{if(typeof A.getAttribute!="function")return 0;switch(A.getAttribute(RE)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Va=(A,e)=>{const t=xE(A);return t===1||e===t};for(var Bd=class{static normalizeElement(A,e){const t={};return Rn(A)&&(e.animationDuration.some(r=>r>0)&&(t.animationDuration=A.style.animationDuration,A.style.animationDuration="0s"),e.transform!==null&&(t.transform=A.style.transform,A.style.transform="translate(0, 0)"),e.rotate!==null&&(t.rotate=A.style.rotate,A.style.rotate="0deg",t.transform===void 0&&(t.transform=A.style.transform,A.style.transform="translate(0, 0)"))),t}static restoreElement(A,e){Rn(A)&&(e.animationDuration!==void 0&&(A.style.animationDuration=e.animationDuration),e.transform!==void 0&&(A.style.transform=e.transform),e.rotate!==void 0&&(A.style.rotate=e.rotate))}},Wt=class{constructor(A,e,t={}){if(this.context=A,this.textNodes=[],this.elements=[],this.createsStackingContext=!1,this.createsRealStackingContext=!1,this.isListOwner=!1,this.debugRender=!1,Va(e,3))debugger;this.styles=new EE(A,A.config.window.getComputedStyle(e,null)),t.normalizeDom!==!1&&Rn(e)&&(this.originalStyles=Bd.normalizeElement(e,this.styles),this.originalElement=e),this.bounds=Gs(this.context,e),Va(e,4)&&(this.debugRender=!0)}restore(){this.originalStyles&&this.originalElement&&(Bd.restoreElement(this.originalElement,this.originalStyles),this.originalStyles=void 0,this.originalElement=void 0)}restoreTree(){this.restore();for(const A of this.elements)A.restoreTree()}},kE="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",yd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Fi=0;Fi<yd.length;Fi++)kn[yd.charCodeAt(Fi)]=Fi;for(var LE=function(A){var e=A.length*.75,t=A.length,r,n=0,s,i,o,a;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<t;r+=4)s=kn[A.charCodeAt(r)],i=kn[A.charCodeAt(r+1)],o=kn[A.charCodeAt(r+2)],a=kn[A.charCodeAt(r+3)],u[n++]=s<<2|i>>4,u[n++]=(i&15)<<4|o>>2,u[n++]=(o&3)<<6|a&63;return l},DE=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},HE=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t},qA=5,Ka=11,$a=2,OE=Ka-qA,Cd=65536>>qA,ja=(1<<qA)-1,PE=Cd+(1024>>qA)+32,NE=65536>>Ka,ME=(1<<OE)-1,_d=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},VE=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},KE=function(A,e){var t=LE(A),r=Array.isArray(t)?HE(t):new Uint32Array(t),n=Array.isArray(t)?DE(t):new Uint16Array(t),s=24,i=_d(n,s/2,r[4]/2),o=r[5]===2?_d(n,(s+r[4])/2):VE(r,Math.ceil((s+r[4])/4));return new $E(r[0],r[1],r[2],r[3],i,o)},$E=function(){function A(e,t,r,n,s,i){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=s,this.data=i}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>qA],t=(t<<$a)+(e&ja),this.data[t];if(e<=65535)return t=this.index[Cd+(e-55296>>qA)],t=(t<<$a)+(e&ja),this.data[t];if(e<this.highStart)return t=PE-NE+(e>>Ka),t=this.index[t],t+=e>>qA&ME,t=this.index[t],t=(t<<$a)+(e&ja),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Ed="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jE=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ti=0;Ti<Ed.length;Ti++)jE[Ed.charCodeAt(Ti)]=Ti;var GE=1,Ga=2,Wa=3,vd=4,bd=5,WE=7,Ud=8,qa=9,Ja=10,Qd=11,Id=12,Fd=13,Td=14,za=15,qE=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var s=A.charCodeAt(t++);(s&64512)===56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)}else e.push(n)}return e},JE=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,s="";++n<t;){var i=A[n];i<=65535?r.push(i):(i-=65536,r.push((i>>10)+55296,i%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},zE=KE(kE),yt="×",Xa="÷",XE=function(A){return zE.get(A)},YE=function(A,e,t){var r=t-2,n=e[r],s=e[t-1],i=e[t];if(s===Ga&&i===Wa)return yt;if(s===Ga||s===Wa||s===vd||i===Ga||i===Wa||i===vd)return Xa;if(s===Ud&&[Ud,qa,Qd,Id].indexOf(i)!==-1||(s===Qd||s===qa)&&(i===qa||i===Ja)||(s===Id||s===Ja)&&i===Ja||i===Fd||i===bd||i===WE||s===GE)return yt;if(s===Fd&&i===Td){for(;n===bd;)n=e[--r];if(n===Td)return yt}if(s===za&&i===za){for(var o=0;n===za;)o++,n=e[--r];if(o%2===0)return yt}return Xa},ZE=function(A){var e=qE(A),t=e.length,r=0,n=0,s=e.map(XE);return{next:function(){if(r>=t)return{done:!0,value:null};for(var i=yt;r<t&&(i=YE(e,s,++r))===yt;);if(i!==yt||r===t){var o=JE.apply(null,e.slice(n,r));return n=r,{value:o,done:!1}}return{done:!0,value:null}}}},ev=function(A){for(var e=ZE(A),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t};const tv=A=>{if(A.createRange){const t=A.createRange();if(t.getBoundingClientRect){const r=A.createElement("boundtest");r.style.height="123px",r.style.display="block",A.body.appendChild(r),t.selectNode(r);const n=t.getBoundingClientRect(),s=Math.round(n.height);if(A.body.removeChild(r),s===123)return!0}}return!1},Av=A=>{const e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);const t=A.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";const r=e.firstChild,n=Ws(r.data).map(a=>Ee(a));let s=0,i={};const o=n.every((a,l)=>{t.setStart(r,s),t.setEnd(r,s+a.length);const u=t.getBoundingClientRect();s+=a.length;const d=u.x>i.x||u.y>i.y;return i=u,l===0?!0:d});return A.body.removeChild(e),o},rv=()=>typeof new Image().crossOrigin<"u",nv=()=>typeof new XMLHttpRequest().responseType=="string",sv=A=>{const e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},Sd=A=>A[0]===0&&A[1]===255&&A[2]===0&&A[3]===255,iv=A=>{const e=A.createElement("canvas"),t=100;e.width=t,e.height=t;const r=e.getContext("2d");if(!r)return Promise.reject(new Error("Failed to get 2D rendering context"));r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);const n=new Image,s=e.toDataURL();n.src=s;const i=Ya(t,t,0,0,n);return r.fillStyle="red",r.fillRect(0,0,t,t),Za(i).then(o=>{r.drawImage(o,0,0);const a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);const l=A.createElement("div");return l.style.backgroundImage=`url(${s})`,l.style.height=`${t}px`,Sd(a)?Za(Ya(t,t,0,0,l)):Promise.reject(new Error("ForeignObject rendering not supported"))}).then(o=>(r.drawImage(o,0,0),Sd(r.getImageData(0,0,t,t).data))).catch(()=>!1)},Ya=(A,e,t,r,n)=>{const s="http://www.w3.org/2000/svg",i=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return i.setAttributeNS(null,"width",A.toString()),i.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),i.appendChild(o),o.appendChild(n),i},Za=A=>new Promise((e,t)=>{const r=new Image;r.onload=()=>e(r),r.onerror=t,r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(A))}`}),Ne={get SUPPORT_RANGE_BOUNDS(){const A=tv(document);return Object.defineProperty(Ne,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){const A=Ne.SUPPORT_RANGE_BOUNDS&&Av(document);return Object.defineProperty(Ne,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){const A=sv(document);return Object.defineProperty(Ne,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){const A=typeof Array.from=="function"&&typeof window.fetch=="function"?iv(document):Promise.resolve(!1);return Object.defineProperty(Ne,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){const A=rv();return Object.defineProperty(Ne,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){const A=nv();return Object.defineProperty(Ne,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){const A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ne,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){const A=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Ne,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}};var JA=class{constructor(A,e){this.text=A,this.bounds=e}};const ov=(A,e,t,r)=>{const n=lv(e,t),s=[];let i=0;return n.forEach(o=>{if(t.textDecorationLine.length||o.trim().length>0)if(Ne.SUPPORT_RANGE_BOUNDS){const a=Rd(r,i,o.length).getClientRects();if(a.length>1){const l=Tr(o);let u=0;l.forEach(d=>{s.push(new JA(d,rA.fromDOMRectList(A,Rd(r,u+i,d.length).getClientRects()))),u+=d.length})}else s.push(new JA(o,rA.fromDOMRectList(A,a)))}else{const a=r.splitText(o.length);s.push(new JA(o,av(A,r))),r=a}else Ne.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));i+=o.length}),s},av=(A,e)=>{const t=e.ownerDocument;if(t){const r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));const n=e.parentNode;if(n){n.replaceChild(r,e);const s=Gs(A,r);return r.firstChild&&n.replaceChild(r.firstChild,r),s}}return rA.EMPTY},Rd=(A,e,t)=>{const r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");const n=r.createRange();return n.setStart(A,e),n.setEnd(A,e+t),n},Tr=A=>{if(Ne.SUPPORT_NATIVE_TEXT_SEGMENTATION){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(t=>t.segment)}return ev(A)},cv=(A,e)=>{if(Ne.SUPPORT_NATIVE_TEXT_SEGMENTATION){const t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(r=>r.segment)}return hv(A,e)},lv=(A,e)=>Pa(e.writingMode)||e.letterSpacing!==0?Tr(A):cv(A,e),uv=[32,160,4961,65792,65793,4153,4241],hv=(A,e)=>{const t=wy(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[];let n;for(;!(n=t.next()).done;)if(n.value){const s=Ws(n.value.slice());let i="";s.forEach(o=>{uv.indexOf(o)===-1?i+=Ee(o):(i.length&&r.push(i),r.push(Ee(o)),i="")}),i.length&&r.push(i)}return r};var dv=class{constructor(A,e,t){this.text=fv(e.data,t.textTransform),this.text.length!==e.data.length&&(e.data=this.text),this.textBounds=ov(A,this.text,t,e)}};const fv=(A,e)=>{switch(e){case 1:return A.toLowerCase();case 3:return A.replace(gv,pv);case 2:return A.toUpperCase();default:return A}},gv=/(^|\s|:|-|\(|\))([a-z])/g,pv=(A,e,t)=>A.length>0?e+t.toUpperCase():A;var xd=class extends Wt{constructor(A,e){super(A,e),this.src=e.currentSrc||e.src,this.intrinsicWidth=e.naturalWidth,this.intrinsicHeight=e.naturalHeight,this.context.cache.addImage(this.src)}},kd=class extends Wt{constructor(A,e){super(A,e),this.canvas=e,this.intrinsicWidth=e.width,this.intrinsicHeight=e.height}},Ld=class extends Wt{constructor(A,e){super(A,e);const t=new XMLSerializer,r=Gs(A,e);e.setAttribute("width",`${r.width}px`),e.setAttribute("height",`${r.height}px`),this.svg=`data:image/svg+xml,${encodeURIComponent(t.serializeToString(e))}`,this.intrinsicWidth=e.width.baseVal.value,this.intrinsicHeight=e.height.baseVal.value,this.context.cache.addImage(this.svg)}},Dd=class extends Wt{constructor(A,e){super(A,e),this.value=e.value}},ec=class extends Wt{constructor(A,e){super(A,e),this.start=e.start,this.reversed=typeof e.reversed=="boolean"&&e.reversed===!0}};const wv=[{type:15,flags:0,unit:"px",number:3}],mv=[{type:16,flags:0,number:50}],Bv=A=>A.width>A.height?new rA(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new rA(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A,yv=A=>{const e=A.type==="password"?new Array(A.value.length+1).join("•"):A.value;return e.length===0?A.placeholder||"":e},Cv=A=>A.value.length===0&&!!A.placeholder,_v="checkbox",Ev="radio",Hd=707406591,vv=1970632191;var Ln=class extends Wt{constructor(A,e){switch(super(A,e),this.type=e.type.toLowerCase(),this.checked=e.checked,this.value=yv(e),this.isPlaceholder=Cv(e),(this.type==="checkbox"||this.type==="radio")&&(this.styles.backgroundColor=3739148031,this.styles.borderTopColor=this.styles.borderRightColor=this.styles.borderBottomColor=this.styles.borderLeftColor=2779096575,this.styles.borderTopWidth=this.styles.borderRightWidth=this.styles.borderBottomWidth=this.styles.borderLeftWidth=1,this.styles.borderTopStyle=this.styles.borderRightStyle=this.styles.borderBottomStyle=this.styles.borderLeftStyle=1,this.styles.backgroundClip=[0],this.styles.backgroundOrigin=[0],this.bounds=Bv(this.bounds)),this.type){case _v:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=wv;break;case Ev:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=mv;break}}},Od=class extends Wt{constructor(A,e){super(A,e);const t=e.options[e.selectedIndex||0];this.value=t&&t.text||""}},Pd=class extends Wt{constructor(A,e){super(A,e),this.value=e.value}},Nd=class extends Wt{constructor(A,e,t){super(A,e),this.src=e.src,this.width=parseInt(e.width,10)||0,this.height=parseInt(e.height,10)||0,this.backgroundColor=this.styles.backgroundColor,this.parseTreeFn=t;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&this.parseTreeFn){this.tree=this.parseTreeFn(A,e.contentWindow.document.documentElement);const r=e.contentWindow.document.documentElement?Fr(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):Gt.TRANSPARENT,n=e.contentWindow.document.body?Fr(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):Gt.TRANSPARENT;this.backgroundColor=_A(r)?_A(n)?this.styles.backgroundColor:n:r}}catch{}}};const bv=["OL","UL","MENU"],Si=(A,e,t,r)=>{for(let n=e.firstChild,s;n;n=s)if(s=n.nextSibling,hd(n)&&n.data.length>0)t.textNodes.push(new dv(A,n,t.styles));else if(GA(n))if(xn(n)&&n.assignedNodes)n.assignedNodes().forEach(i=>Si(A,i,t,r));else{const i=Md(A,n);i.styles.isVisible()&&(Uv(n,i,r)?i.createsRealStackingContext=!0:Qv(i.styles)&&(i.createsStackingContext=!0),bv.indexOf(n.tagName)!==-1&&(i.isListOwner=!0),t.elements.push(i),n.shadowRoot?Si(A,n.shadowRoot,i,r):!Qi(n)&&!dd(n)&&!Ii(n)&&Si(A,n,i,r))}},Md=(A,e)=>Ma(e)?new xd(A,e):fd(e)?new kd(A,e):dd(e)?new Ld(A,e):IE(e)?new Dd(A,e):FE(e)?new ec(A,e):bE(e)?new Ln(A,e):Ii(e)?new Od(A,e):Qi(e)?new Pd(A,e):pd(e)?new Nd(A,e,Vd):new Wt(A,e),Vd=(A,e)=>{const t=Md(A,e);return t.createsRealStackingContext=!0,Si(A,e,t,t),t},Uv=(A,e,t)=>e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Na(A)&&t.styles.isTransparent(),Qv=A=>A.isPositioned()||A.isFloating()?!0:Pe(A.display,268435456)||Pe(A.display,33554432)||Pe(A.display,536870912)||Pe(A.display,134217728);var Iv=class{constructor(){this.counters={}}getCounterValue(A){const e=this.counters[A];return e&&e.length?e[e.length-1]:1}getCounterValues(A){const e=this.counters[A];return e||[]}pop(A){A.forEach(e=>this.counters[e].pop())}parse(A){const e=A.counterIncrement,t=A.counterReset;let r=!0;e!==null&&e.forEach(s=>{const i=this.counters[s.counter];i&&s.increment!==0&&(r=!1,i.length||i.push(1),i[Math.max(0,i.length-1)]+=s.increment)});const n=[];return r&&t.forEach(s=>{let i=this.counters[s.counter];n.push(s.counter),i||(i=this.counters[s.counter]=[]),i.push(s.reset)}),n}};const Kd={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},$d={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Fv={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Tv={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Sr=(A,e,t,r,n,s)=>A<e||A>t?Dn(A,n,s.length>0):r.integers.reduce((i,o,a)=>{for(;A>=o;)A-=o,i+=r.values[a];return i},"")+s,jd=(A,e,t,r)=>{let n="";do t||A--,n=r(A)+n,A/=e;while(A*e>=e);return n},be=(A,e,t,r,n)=>{const s=t-e+1;return(A<0?"-":"")+(jd(Math.abs(A),s,r,i=>Ee(Math.floor(i%s)+e))+n)},zA=(A,e,t=". ")=>{const r=e.length;return jd(Math.abs(A),r,!1,n=>e[Math.floor(n%r)])+t},Sv=1,Rv=2,xv=4,kv=8,iA=(A,e,t,r,n,s)=>{if(A<-9999||A>9999)return Dn(A,4,n.length>0);let i=Math.abs(A),o=n;if(i===0)return e[0]+o;for(let a=0;i>0&&a<=4;a++){const l=i%10;l===0&&Pe(s,Sv)&&o!==""?o=e[l]+o:l>1||l===1&&a===0||l===1&&a===1&&Pe(s,Rv)||l===1&&a===1&&Pe(s,xv)&&A>100||l===1&&a>1&&Pe(s,kv)?o=e[l]+(a>0?t[a-1]:"")+o:l===1&&a>0&&(o=t[a-1]+o),i=Math.floor(i/10)}return(A<0?r:"")+o},Gd="十百千萬",Wd="拾佰仟萬",qd="マイナス",tc="마이너스",Dn=(A,e,t)=>{const r=t?". ":"",n=t?"、":"",s=t?", ":"",i=t?" ":"";switch(e){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:const o=be(A,48,57,!0,r);return o.length<4?`0${o}`:o;case 4:return zA(A,"〇一二三四五六七八九",n);case 6:return Sr(A,1,3999,Kd,3,r).toLowerCase();case 7:return Sr(A,1,3999,Kd,3,r);case 8:return be(A,945,969,!1,r);case 9:return be(A,97,122,!1,r);case 10:return be(A,65,90,!1,r);case 11:return be(A,1632,1641,!0,r);case 12:case 49:return Sr(A,1,9999,$d,3,r);case 35:return Sr(A,1,9999,$d,3,r).toLowerCase();case 13:return be(A,2534,2543,!0,r);case 14:case 30:return be(A,6112,6121,!0,r);case 15:return zA(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return zA(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return iA(A,"零一二三四五六七八九",Gd,"負",n,14);case 47:return iA(A,"零壹貳參肆伍陸柒捌玖",Wd,"負",n,15);case 42:return iA(A,"零一二三四五六七八九",Gd,"负",n,14);case 41:return iA(A,"零壹贰叁肆伍陆柒捌玖",Wd,"负",n,15);case 26:return iA(A,"〇一二三四五六七八九","十百千万",qd,n,0);case 25:return iA(A,"零壱弐参四伍六七八九","拾百千万",qd,n,7);case 31:return iA(A,"영일이삼사오육칠팔구","십백천만",tc,s,7);case 33:return iA(A,"零一二三四五六七八九","十百千萬",tc,s,0);case 32:return iA(A,"零壹貳參四五六七八九","拾百千",tc,s,7);case 18:return be(A,2406,2415,!0,r);case 20:return Sr(A,1,19999,Tv,3,r);case 21:return be(A,2790,2799,!0,r);case 22:return be(A,2662,2671,!0,r);case 52:return Sr(A,1,10999,Fv,3,r);case 23:return zA(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return zA(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return be(A,3302,3311,!0,r);case 28:return zA(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return zA(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return be(A,3792,3801,!0,r);case 37:return be(A,6160,6169,!0,r);case 38:return be(A,4160,4169,!0,r);case 39:return be(A,2918,2927,!0,r);case 40:return be(A,1776,1785,!0,r);case 43:return be(A,3046,3055,!0,r);case 44:return be(A,3174,3183,!0,r);case 45:return be(A,3664,3673,!0,r);case 46:return be(A,3872,3881,!0,r);default:return be(A,48,57,!0,r)}},Lv="data-html2canvas-ignore";var Dv=class{constructor(A,e,t){this.cloneNodeFn=A,this.options=e,this.context=t}appendChildNode(A,e,t){this.safeAppendClonedChild(A,e,t)}cloneChildNodes(A,e,t){A.shadowRoot&&e.shadowRoot?(this.cloneShadowDOMChildren(A.shadowRoot,e.shadowRoot,t),this.cloneLightDOMChildren(A,e,t)):A.shadowRoot&&!e.shadowRoot?this.cloneShadowDOMAsLightDOM(A.shadowRoot,e,t):this.cloneLightDOMChildren(A,e,t)}shouldCloneChild(A){return!GA(A)||!QE(A)&&!A.hasAttribute("data-html2canvas-ignore")&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(A))}shouldCloneStyleElement(A){return!this.options.copyStyles||!GA(A)||!wd(A)}safeAppendClonedChild(A,e,t){this.shouldCloneChild(e)&&this.shouldCloneStyleElement(e)&&A.appendChild(this.cloneNodeFn(e,t))}cloneAssignedNodes(A,e,t){A.forEach(r=>{this.safeAppendClonedChild(e,r,t)})}cloneSlotFallbackContent(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)this.safeAppendClonedChild(e,r,t)}cloneSlotElement(A,e,t){if(!xn(A))return;const r=A;if(typeof r.assignedNodes!="function"){this.context.logger.warn("HTMLSlotElement.assignedNodes is not available",A),this.cloneSlotFallbackContent(A,e,t);return}const n=r.assignedNodes();if(!n||!Array.isArray(n)){this.context.logger.warn("assignedNodes() did not return a valid array",A),this.cloneSlotFallbackContent(A,e,t);return}n.length>0?this.cloneAssignedNodes(n,e,t):this.cloneSlotFallbackContent(A,e,t)}cloneShadowDOMChildren(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)GA(r)&&xn(r)?this.cloneSlotElement(r,e,t):this.safeAppendClonedChild(e,r,t)}cloneLightDOMChildren(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)this.appendChildNode(e,r,t)}cloneSlotElementAsLightDOM(A,e,t){if(!xn(A))return;const r=A;if(typeof r.assignedNodes!="function"){for(let s=A.firstChild;s;s=s.nextSibling)this.appendChildNode(e,s,t);return}const n=r.assignedNodes();if(n&&Array.isArray(n)&&n.length>0)n.forEach(s=>this.appendChildNode(e,s,t));else for(let s=A.firstChild;s;s=s.nextSibling)this.appendChildNode(e,s,t)}cloneShadowDOMAsLightDOM(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)GA(r)&&xn(r)?this.cloneSlotElementAsLightDOM(r,e,t):this.appendChildNode(e,r,t)}};const Hv=A=>{let e=A;for(;e;){if(e.parentNode&&e.parentNode.host)return e.parentNode;const t=e.getRootNode();if(t&&t!==e.ownerDocument&&t.host)return t;e=e.parentNode}return null};var Ac=class{constructor(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Iv,this.quoteDepth=0,this.slotCloner=new Dv((r,n)=>this.cloneNode(r,n),{ignoreElements:t.ignoreElements,copyStyles:t.copyStyles??!0},A),!e.ownerDocument)throw new Error("Cloned element does not have an owner document");if(!this.options.iframeContainer){const r=Hv(e);r&&(this.options.iframeContainer=r)}this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}toIFrame(A,e){var d,g;const t=Ov(A,e,this.options.iframeContainer);if(!t.contentWindow)throw new Error("Unable to find iframe window");const r=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,s=t.contentWindow,i=s.document,o=Mv(t).then(async()=>{this.scrolledElements.forEach(jv),s&&(s.scrollTo(e.left,e.top),/AppleWebKit/g.test(navigator.userAgent)&&(s.scrollY!==e.top||s.scrollX!==e.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0)));const p=this.options.onclone,w=this.clonedReferenceElement;if(typeof w>"u")throw new Error(`Error finding the ${this.referenceElement.nodeName} in the cloned document`);return i.fonts&&i.fonts.ready&&await i.fonts.ready,/(AppleWebKit)/g.test(navigator.userAgent)&&await Nv(i),typeof p=="function"?Promise.resolve().then(()=>p(i,w)).then(()=>t):t}),a=A.baseURI;i.open();const l=Kv(document.doctype)+"<html></html>";try{const p=(d=this.referenceElement.ownerDocument)==null?void 0:d.defaultView,w=p&&p.trustedTypes;let y=(g=w==null?void 0:w.getPolicy)==null?void 0:g.call(w,"html2canvas-pro");!y&&w&&(y=w.createPolicy("html2canvas-pro",{createHTML:b=>b}));const B=y?y.createHTML(l):l;i.write(B)}catch{i.write(l)}$v(this.referenceElement.ownerDocument,r,n),i.close();const u=i.adoptNode(this.documentElement);return zv(u,a),i.replaceChild(u,i.documentElement),o}createElementClone(A){if(Va(A,2))debugger;if(fd(A))return this.createCanvasClone(A);if(gd(A))return this.createVideoClone(A);if(wd(A))return this.createStyleClone(A);const e=A.cloneNode(!1);return Ma(e)&&(Ma(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager")),md(e)&&!WA(e)?this.createCustomElementClone(e):e}createCustomElementClone(A){const e=document.createElement("div");if(e.className=A.className,rc(A.style,e),A.shadowRoot)try{e.attachShadow({mode:"open"})}catch(t){this.context.logger.error("Failed to attach shadow root to custom element clone:",t)}return e}createStyleClone(A){try{const t=A.sheet;if(t&&t.cssRules){const r=[].slice.call(t.cssRules,0).reduce((s,i)=>i&&typeof i.cssText=="string"?s+i.cssText:s,""),n=A.cloneNode(!1);return n.textContent=r,this.options.cspNonce&&(n.nonce=this.options.cspNonce),n}}catch(t){if(this.context.logger.error("Unable to access cssRules property",t),t.name!=="SecurityError")throw t}const e=A.cloneNode(!1);return this.options.cspNonce&&(e.nonce=this.options.cspNonce),e}createCanvasClone(A){var t;if(this.options.inlineImages&&A.ownerDocument){const r=A.ownerDocument.createElement("img");try{return r.src=A.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}const e=A.cloneNode(!1);try{e.width=A.width,e.height=A.height;const r=A.getContext("2d"),n=e.getContext("2d",{willReadFrequently:!0});if(n)if(!this.options.allowTaint&&r)n.putImageData(r.getImageData(0,0,A.width,A.height),0,0);else{const s=A.getContext("webgl2")??A.getContext("webgl");s&&((t=s.getContextAttributes())==null?void 0:t.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A),n.drawImage(A,0,0)}return e}catch{this.context.logger.info("Unable to clone canvas as it is tainted",A)}return e}createVideoClone(A){const e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;const t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch{this.context.logger.info("Unable to clone video as it is tainted",A)}const r=A.ownerDocument.createElement("canvas");return r.width=A.offsetWidth,r.height=A.offsetHeight,r}appendChildNode(A,e,t){this.slotCloner.appendChildNode(A,e,t)}cloneChildNodes(A,e,t){this.slotCloner.cloneChildNodes(A,e,t)}cloneNode(A,e){if(hd(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);const t=A.ownerDocument.defaultView;if(t&&GA(A)&&(Rn(A)||WA(A))){const r=this.createElementClone(A);r.style.transitionProperty="none";const n=t.getComputedStyle(A),s=SE(A);this.referenceElement===A&&Rn(r)&&(this.clonedReferenceElement=r),Na(r)&&qv(r,this.options.cspNonce);const i=this.counters.parse(new ld(this.context,n));if(s){const o=t.getComputedStyle(A,":before"),a=this.resolvePseudoContent(A,r,o,0);a&&r.insertBefore(a,r.firstChild);const l=t.getComputedStyle(A,":after"),u=this.resolvePseudoContent(A,r,l,1);u&&r.appendChild(u)}return md(A)&&(e=!0),gd(A)||this.cloneChildNodes(A,r,e),this.counters.pop(i),(n&&(this.options.copyStyles||WA(A))&&!pd(A)||e)&&rc(n,r),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(Qi(A)||Ii(A))&&(Qi(r)||Ii(r))&&(r.value=A.value),r}return A.cloneNode(!1)}resolvePseudoContent(A,e,t,r){if(!t)return;const n=t.content,s=e.ownerDocument;if(!s||!n||n==="none"||n==="-moz-alt-content"||t.display==="none")return;this.counters.parse(new ld(this.context,t));const i=new vE(this.context,t),o=s.createElement("html2canvaspseudoelement");rc(t,o),i.content.forEach(l=>{if(l.type===0)o.appendChild(s.createTextNode(l.value));else if(l.type===22){const u=s.createElement("img");u.src=l.value,u.style.opacity="1",o.appendChild(u)}else if(l.type===18){if(l.name==="attr"){const u=l.values.filter(J);u.length&&o.appendChild(s.createTextNode(A.getAttribute(u[0].value)||""))}else if(l.name==="counter"){const[u,d]=l.values.filter(ke);if(u&&J(u)){const g=this.counters.getCounterValue(u.value),p=d&&J(d)?Oa.parse(this.context,d.value):3;o.appendChild(s.createTextNode(Dn(g,p,!1)))}}else if(l.name==="counters"){const[u,d,g]=l.values.filter(ke);if(u&&J(u)){const p=this.counters.getCounterValues(u.value),w=g&&J(g)?Oa.parse(this.context,g.value):3,y=d&&d.type===0?d.value:"",B=p.map(b=>Dn(b,w,!1)).join(y);o.appendChild(s.createTextNode(B))}}}else if(l.type===20)switch(l.value){case"open-quote":o.appendChild(s.createTextNode(cd(i.quotes,this.quoteDepth++,!0)));break;case"close-quote":o.appendChild(s.createTextNode(cd(i.quotes,--this.quoteDepth,!1)));break;default:o.appendChild(s.createTextNode(l.value))}}),o.className=`${nc} ${sc}`;const a=r===0?` ${nc}`:` ${sc}`;return WA(e)?e.className.baseValue+=a:e.className+=a,o}static destroy(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1}};const Ov=(A,e,t)=>{const r=A.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=e.width.toString(),r.height=e.height.toString(),r.scrolling="no",r.setAttribute(Lv,"true"),(t||A.body).appendChild(r),r},Pv=A=>new Promise(e=>{if(A.complete){e();return}if(!A.src){e();return}A.onload=e,A.onerror=e}),Nv=A=>Promise.all([].slice.call(A.images,0).map(Pv)),Mv=A=>new Promise((e,t)=>{const r=A.contentWindow;if(!r)return t("No window assigned for iframe");const n=r.document;r.onload=A.onload=()=>{r.onload=A.onload=null;const s=600;let i=0;const o=setInterval(()=>{i++,(n.body.childNodes.length>0&&n.readyState==="complete"||i>=s)&&(clearInterval(o),e(A))},50)}}),Vv=["all","d","content"],rc=(A,e)=>{const t=[];for(let r=A.length-1;r>=0;r--){const n=A.item(r);if(Vv.indexOf(n)===-1&&!n.startsWith("--")){const s=A.getPropertyValue(n);if(s){const i=A.getPropertyPriority(n);t.push(i?`${n}:${s} !${i}`:`${n}:${s}`)}}}return t.length>0&&(e.style.cssText=t.join(";")+";"),e},Kv=A=>{let e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=" "+A.internalSubset.replace(/"/g,"&quot;").replace(/>/g,"&gt;")),A.publicId?(e+=' PUBLIC "'+A.publicId.replace(/"/g,"&quot;")+'"',A.systemId&&(e+=' "'+A.systemId.replace(/"/g,"&quot;")+'"')):A.systemId&&(e+=' SYSTEM "'+A.systemId.replace(/"/g,"&quot;")+'"'),e+=">"),e},$v=(A,e,t)=>{A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},jv=([A,e,t])=>{A.scrollLeft=e,A.scrollTop=t},Gv=":before",Wv=":after",nc="___html2canvas___pseudoelement_before",sc="___html2canvas___pseudoelement_after",Jd=`{
777
+ 📊 Performance Summary (Total: ${A.totalDuration.toFixed(2)}ms):`),A.breakdown.sort((e,t)=>t.duration-e.duration).forEach(e=>{this.context.logger.info(` ${e.name.padEnd(20)} ${e.duration.toFixed(2).padStart(8)}ms ${e.percentage.padStart(6)}`)})}clear(){this.activeMetrics.clear(),this.completedMetrics.splice(0)}isEnabled(){return this.enabled}getActiveMetrics(){return Array.from(this.activeMetrics.keys())}},rA=(Nt=class{constructor(e,t,r,n){this.left=e,this.top=t,this.width=r,this.height=n}add(e,t,r,n){return new Nt(this.left+e,this.top+t,this.width+r,this.height+n)}static fromClientRect(e,t){return new Nt(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)}static fromDOMRectList(e,t){const r=Array.from(t);let n=r.find(s=>s.width!==0);return n||(n=r.find(s=>s.height!==0)),!n&&r.length>0&&(n=r[0]),n?new Nt(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):Nt.EMPTY}},Nt.EMPTY=new Nt(0,0,0,0),Nt);const js=(A,e)=>rA.fromClientRect(A,e.getBoundingClientRect()),VB=A=>{const e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");return new rA(0,0,Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight)))};for(var Gs=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var s=A.charCodeAt(t++);(s&64512)===56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)}else e.push(n)}return e},Ee=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,s="";++n<t;){var i=A[n];i<=65535?r.push(i):(i-=65536,r.push((i>>10)+55296,i%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},ju="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",KB=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ws=0;Ws<ju.length;Ws++)KB[ju.charCodeAt(Ws)]=Ws;for(var Gu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pn=typeof Uint8Array>"u"?[]:new Uint8Array(256),qs=0;qs<Gu.length;qs++)pn[Gu.charCodeAt(qs)]=qs;for(var $B=function(A){var e=A.length*.75,t=A.length,r,n=0,s,i,o,a;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<t;r+=4)s=pn[A.charCodeAt(r)],i=pn[A.charCodeAt(r+1)],o=pn[A.charCodeAt(r+2)],a=pn[A.charCodeAt(r+3)],u[n++]=s<<2|i>>4,u[n++]=(i&15)<<4|o>>2,u[n++]=(o&3)<<6|a&63;return l},jB=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},GB=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t},MA=5,ca=11,la=2,WB=ca-MA,Wu=65536>>MA,ua=(1<<MA)-1,qB=Wu+(1024>>MA)+32,JB=65536>>ca,zB=(1<<WB)-1,qu=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},XB=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},YB=function(A,e){var t=$B(A),r=Array.isArray(t)?GB(t):new Uint32Array(t),n=Array.isArray(t)?jB(t):new Uint16Array(t),s=24,i=qu(n,s/2,r[4]/2),o=r[5]===2?qu(n,(s+r[4])/2):XB(r,Math.ceil((s+r[4])/4));return new ZB(r[0],r[1],r[2],r[3],i,o)},ZB=function(){function A(e,t,r,n,s,i){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=s,this.data=i}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>MA],t=(t<<la)+(e&ua),this.data[t];if(e<=65535)return t=this.index[Wu+(e-55296>>MA)],t=(t<<la)+(e&ua),this.data[t];if(e<this.highStart)return t=qB-JB+(e>>ca),t=this.index[t],t+=e>>MA&zB,t=this.index[t],t=(t<<la)+(e&ua),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Ju="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ey=typeof Uint8Array>"u"?[]:new Uint8Array(256),Js=0;Js<Ju.length;Js++)ey[Ju.charCodeAt(Js)]=Js;var ty="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",zu=50,Ay=1,Xu=2,Yu=3,ry=4,ny=5,Zu=7,eh=8,th=9,mA=10,ha=11,Ah=12,da=13,sy=14,wn=15,fa=16,zs=17,mn=18,iy=19,rh=20,ga=21,Bn=22,pa=23,Ur=24,ht=25,yn=26,Cn=27,Qr=28,oy=29,VA=30,ay=31,Xs=32,Ys=33,wa=34,ma=35,Ba=36,_n=37,ya=38,Zs=39,ei=40,Ca=41,nh=42,cy=43,ly=[9001,65288],sh="!",Z="×",ti="÷",_a=YB(ty),nA=[VA,Ba],Ea=[Ay,Xu,Yu,ny],ih=[mA,eh],oh=[Cn,yn],uy=Ea.concat(ih),ah=[ya,Zs,ei,wa,ma],hy=[wn,da],dy=function(A,e){e===void 0&&(e="strict");var t=[],r=[],n=[];return A.forEach(function(s,i){var o=_a.get(s);if(o>zu?(n.push(!0),o-=zu):n.push(!1),["normal","auto","loose"].indexOf(e)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return r.push(i),t.push(fa);if(o===ry||o===ha){if(i===0)return r.push(i),t.push(VA);var a=t[i-1];return uy.indexOf(a)===-1?(r.push(r[i-1]),t.push(a)):(r.push(i),t.push(VA))}if(r.push(i),o===ay)return t.push(e==="strict"?ga:_n);if(o===nh||o===oy)return t.push(VA);if(o===cy)return s>=131072&&s<=196605||s>=196608&&s<=262141?t.push(_n):t.push(VA);t.push(o)}),[r,t,n]},va=function(A,e,t,r){var n=r[t];if(Array.isArray(A)?A.indexOf(n)!==-1:A===n)for(var s=t;s<=r.length;){s++;var i=r[s];if(i===e)return!0;if(i!==mA)break}if(n===mA)for(var s=t;s>0;){s--;var o=r[s];if(Array.isArray(A)?A.indexOf(o)!==-1:A===o)for(var a=t;a<=r.length;){a++;var i=r[a];if(i===e)return!0;if(i!==mA)break}if(o!==mA)break}return!1},ch=function(A,e){for(var t=A;t>=0;){var r=e[t];if(r===mA)t--;else return r}return 0},fy=function(A,e,t,r,n){if(t[r]===0)return Z;var s=r-1;if(Array.isArray(n)&&n[s]===!0)return Z;var i=s-1,o=s+1,a=e[s],l=i>=0?e[i]:0,u=e[o];if(a===Xu&&u===Yu)return Z;if(Ea.indexOf(a)!==-1)return sh;if(Ea.indexOf(u)!==-1||ih.indexOf(u)!==-1)return Z;if(ch(s,e)===eh)return ti;if(_a.get(A[s])===ha||(a===Xs||a===Ys)&&_a.get(A[o])===ha||a===Zu||u===Zu||a===th||[mA,da,wn].indexOf(a)===-1&&u===th||[zs,mn,iy,Ur,Qr].indexOf(u)!==-1||ch(s,e)===Bn||va(pa,Bn,s,e)||va([zs,mn],ga,s,e)||va(Ah,Ah,s,e))return Z;if(a===mA)return ti;if(a===pa||u===pa)return Z;if(u===fa||a===fa)return ti;if([da,wn,ga].indexOf(u)!==-1||a===sy||l===Ba&&hy.indexOf(a)!==-1||a===Qr&&u===Ba||u===rh||nA.indexOf(u)!==-1&&a===ht||nA.indexOf(a)!==-1&&u===ht||a===Cn&&[_n,Xs,Ys].indexOf(u)!==-1||[_n,Xs,Ys].indexOf(a)!==-1&&u===yn||nA.indexOf(a)!==-1&&oh.indexOf(u)!==-1||oh.indexOf(a)!==-1&&nA.indexOf(u)!==-1||[Cn,yn].indexOf(a)!==-1&&(u===ht||[Bn,wn].indexOf(u)!==-1&&e[o+1]===ht)||[Bn,wn].indexOf(a)!==-1&&u===ht||a===ht&&[ht,Qr,Ur].indexOf(u)!==-1)return Z;if([ht,Qr,Ur,zs,mn].indexOf(u)!==-1)for(var d=s;d>=0;){var g=e[d];if(g===ht)return Z;if([Qr,Ur].indexOf(g)!==-1)d--;else break}if([Cn,yn].indexOf(u)!==-1)for(var d=[zs,mn].indexOf(a)!==-1?i:s;d>=0;){var g=e[d];if(g===ht)return Z;if([Qr,Ur].indexOf(g)!==-1)d--;else break}if(ya===a&&[ya,Zs,wa,ma].indexOf(u)!==-1||[Zs,wa].indexOf(a)!==-1&&[Zs,ei].indexOf(u)!==-1||[ei,ma].indexOf(a)!==-1&&u===ei||ah.indexOf(a)!==-1&&[rh,yn].indexOf(u)!==-1||ah.indexOf(u)!==-1&&a===Cn||nA.indexOf(a)!==-1&&nA.indexOf(u)!==-1||a===Ur&&nA.indexOf(u)!==-1||nA.concat(ht).indexOf(a)!==-1&&u===Bn&&ly.indexOf(A[o])===-1||nA.concat(ht).indexOf(u)!==-1&&a===mn)return Z;if(a===Ca&&u===Ca){for(var p=t[s],w=1;p>0&&(p--,e[p]===Ca);)w++;if(w%2!==0)return Z}return a===Xs&&u===Ys?Z:ti},gy=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=dy(A,e.lineBreak),r=t[0],n=t[1],s=t[2];(e.wordBreak==="break-all"||e.wordBreak==="break-word")&&(n=n.map(function(o){return[ht,VA,nh].indexOf(o)!==-1?_n:o}));var i=e.wordBreak==="keep-all"?s.map(function(o,a){return o&&A[a]>=19968&&A[a]<=40959}):void 0;return[r,n,i]},py=function(){function A(e,t,r,n){this.codePoints=e,this.required=t===sh,this.start=r,this.end=n}return A.prototype.slice=function(){return Ee.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),wy=function(A,e){var t=Gs(A),r=gy(t,e),n=r[0],s=r[1],i=r[2],o=t.length,a=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var u=Z;l<o&&(u=fy(t,s,n,++l,i))===Z;);if(u!==Z||l===o){var d=new py(t,u,a,l);return a=l,{value:d,done:!1}}return{done:!0,value:null}}}};const Ai=10,lh=47,En=92,my=9,By=32,ri=34,vn=61,yy=35,Cy=36,_y=37,ni=39,si=40,bn=41,Ey=95,nt=45,vy=33,by=60,Uy=62,Qy=64,Iy=91,Fy=93,Ty=61,Sy=123,ii=63,Ry=125,uh=124,xy=126,ky=128,hh=65533,ba=42,KA=43,Ly=44,Dy=58,Hy=59,Un=46,Oy=0,Py=8,Ny=11,My=14,Vy=31,Ky=127,$t=-1,dh=48,fh=97,gh=101,$y=102,jy=117,Gy=122,ph=65,wh=69,mh=70,Wy=85,qy=90,Ge=A=>A>=dh&&A<=57,Jy=A=>A>=55296&&A<=57343,Ir=A=>Ge(A)||A>=ph&&A<=mh||A>=fh&&A<=$y,zy=A=>A>=fh&&A<=Gy,Xy=A=>A>=ph&&A<=qy,Yy=A=>zy(A)||Xy(A),Zy=A=>A>=ky,oi=A=>A===Ai||A===my||A===By,ai=A=>Yy(A)||Zy(A)||A===Ey,Bh=A=>ai(A)||Ge(A)||A===nt,eC=A=>A>=Oy&&A<=Py||A===Ny||A>=My&&A<=Vy||A===Ky,BA=(A,e)=>A!==En?!1:e!==Ai,ci=(A,e,t)=>A===nt?ai(e)||BA(e,t):ai(A)?!0:!!(A===En&&BA(A,e)),Ua=(A,e,t)=>A===KA||A===nt?Ge(e)?!0:e===Un&&Ge(t):Ge(A===Un?e:A),tC=A=>{let e=0,t=1;(A[e]===KA||A[e]===nt)&&(A[e]===nt&&(t=-1),e++);const r=[];for(;Ge(A[e]);)r.push(A[e++]);const n=r.length?parseInt(Ee(...r),10):0;A[e]===Un&&e++;const s=[];for(;Ge(A[e]);)s.push(A[e++]);const i=s.length,o=i?parseInt(Ee(...s),10):0;(A[e]===wh||A[e]===gh)&&e++;let a=1;(A[e]===KA||A[e]===nt)&&(A[e]===nt&&(a=-1),e++);const l=[];for(;Ge(A[e]);)l.push(A[e++]);const u=l.length?parseInt(Ee(...l),10):0;return t*(n+o*Math.pow(10,-i))*Math.pow(10,a*u)},AC={type:2},rC={type:3},nC={type:4},sC={type:13},iC={type:8},oC={type:21},aC={type:9},cC={type:10},lC={type:11},uC={type:12},hC={type:14},li={type:23},dC={type:1},fC={type:25},gC={type:24},pC={type:26},wC={type:27},mC={type:28},BC={type:29},yC={type:31},Qa={type:32};var Ia=(bt=class{static get(){return bt._pool.pop()||new bt}static release(e){bt._pool.length<bt.MAX_POOL_SIZE&&(e._reset(),bt._pool.push(e))}constructor(){this._value=[]}_reset(){this._value=[]}write(e){this._value=this._value.concat(Gs(e))}read(){const e=[];let t=this.consumeToken();for(;t!==Qa;)e.push(t),t=this.consumeToken();return e}consumeToken(){const e=this.consumeCodePoint();switch(e){case ri:return this.consumeStringToken(ri);case yy:const t=this.peekCodePoint(0),r=this.peekCodePoint(1),n=this.peekCodePoint(2);if(Bh(t)||BA(r,n)){const u=ci(t,r,n)?2:1;return{type:5,value:this.consumeName(),flags:u}}break;case Cy:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),sC;break;case ni:return this.consumeStringToken(ni);case si:return AC;case bn:return rC;case ba:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),hC;break;case KA:if(Ua(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Ly:return nC;case nt:const s=e,i=this.peekCodePoint(0),o=this.peekCodePoint(1);if(Ua(s,i,o))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(ci(s,i,o))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(i===nt&&o===Uy)return this.consumeCodePoint(),this.consumeCodePoint(),gC;break;case Un:if(Ua(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case lh:if(this.peekCodePoint(0)===ba)for(this.consumeCodePoint();;){let u=this.consumeCodePoint();if(u===ba&&(u=this.consumeCodePoint(),u===lh))return this.consumeToken();if(u===$t)return this.consumeToken()}break;case Dy:return pC;case Hy:return wC;case by:if(this.peekCodePoint(0)===vy&&this.peekCodePoint(1)===nt&&this.peekCodePoint(2)===nt)return this.consumeCodePoint(),this.consumeCodePoint(),fC;break;case Qy:if(ci(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2)))return{type:7,value:this.consumeName()};break;case Iy:return mC;case En:if(BA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case Fy:return BC;case Ty:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),iC;break;case Sy:return lC;case Ry:return uC;case jy:case Wy:const a=this.peekCodePoint(0),l=this.peekCodePoint(1);return a===KA&&(Ir(l)||l===ii)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case uh:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),aC;if(this.peekCodePoint(0)===uh)return this.consumeCodePoint(),oC;break;case xy:if(this.peekCodePoint(0)===vn)return this.consumeCodePoint(),cC;break;case $t:return Qa}return oi(e)?(this.consumeWhiteSpace(),yC):Ge(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):ai(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:Ee(e)}}consumeCodePoint(){const e=this._value.shift();return typeof e>"u"?-1:e}reconsumeCodePoint(e){this._value.unshift(e)}peekCodePoint(e){return e>=this._value.length?-1:this._value[e]}consumeUnicodeRangeToken(){const e=[];let t=this.consumeCodePoint();for(;Ir(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();let r=!1;for(;t===ii&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r)return{type:30,start:parseInt(Ee(...e.map(s=>s===ii?dh:s)),16),end:parseInt(Ee(...e.map(s=>s===ii?mh:s)),16)};const n=parseInt(Ee(...e),16);if(this.peekCodePoint(0)===nt&&Ir(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();const s=[];for(;Ir(t)&&s.length<6;)s.push(t),t=this.consumeCodePoint();return{type:30,start:n,end:parseInt(Ee(...s),16)}}else return{type:30,start:n,end:n}}consumeIdentLikeToken(){const e=this.consumeName();return e.toLowerCase()==="url"&&this.peekCodePoint(0)===si?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===si?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}}consumeUrlToken(){const e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===$t)return{type:22,value:""};const t=this.peekCodePoint(0);if(t===ni||t===ri){const r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===$t||this.peekCodePoint(0)===bn)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),li)}for(;;){const r=this.consumeCodePoint();if(r===$t||r===bn)return{type:22,value:Ee(...e)};if(oi(r))return this.consumeWhiteSpace(),this.peekCodePoint(0)===$t||this.peekCodePoint(0)===bn?(this.consumeCodePoint(),{type:22,value:Ee(...e)}):(this.consumeBadUrlRemnants(),li);if(r===ri||r===ni||r===si||eC(r))return this.consumeBadUrlRemnants(),li;if(r===En)if(BA(r,this.peekCodePoint(0)))e.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),li;else e.push(r)}}consumeWhiteSpace(){for(;oi(this.peekCodePoint(0));)this.consumeCodePoint()}consumeBadUrlRemnants(){for(;;){const e=this.consumeCodePoint();if(e===bn||e===$t)return;BA(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}}consumeStringSlice(e){let r="";for(;e>0;){const n=Math.min(5e4,e);r+=Ee(...this._value.splice(0,n)),e-=n}return this._value.shift(),r}consumeStringToken(e){let t="",r=0;do{const n=this._value[r];if(n===$t||n===void 0||n===e)return t+=this.consumeStringSlice(r),{type:0,value:t};if(n===Ai)return this._value.splice(0,r),dC;if(n===En){const s=this._value[r+1];s!==$t&&s!==void 0&&(s===Ai?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):BA(n,s)&&(t+=this.consumeStringSlice(r),t+=Ee(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)}consumeNumber(){const e=[];let t=4,r=this.peekCodePoint(0);for((r===KA||r===nt)&&e.push(this.consumeCodePoint());Ge(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);let n=this.peekCodePoint(1);if(r===Un&&Ge(n))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Ge(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),n=this.peekCodePoint(1);const s=this.peekCodePoint(2);if((r===wh||r===gh)&&((n===KA||n===nt)&&Ge(s)||Ge(n)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Ge(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[tC(e),t]}consumeNumericToken(){const[e,t]=this.consumeNumber(),r=this.peekCodePoint(0);return ci(r,this.peekCodePoint(1),this.peekCodePoint(2))?{type:15,number:e,flags:t,unit:this.consumeName()}:r===_y?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}}consumeEscapedCodePoint(){const e=this.consumeCodePoint();if(Ir(e)){let t=Ee(e);for(;Ir(this.peekCodePoint(0))&&t.length<6;)t+=Ee(this.consumeCodePoint());oi(this.peekCodePoint(0))&&this.consumeCodePoint();const r=parseInt(t,16);return r===0||Jy(r)||r>1114111?hh:r}return e===$t?hh:e}consumeName(){let e="";for(;;){const t=this.consumeCodePoint();if(Bh(t))e+=Ee(t);else if(BA(t,this.peekCodePoint(0)))e+=Ee(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(t),e}}},bt._pool=[],bt.MAX_POOL_SIZE=40,bt),yh=class sa{constructor(e){this._tokens=e}static create(e){const t=new Ia;return t.write(e),new sa(t.read())}static parseValue(e){return sa.create(e).parseComponentValue()}static parseValues(e){return sa.create(e).parseComponentValues()}parseComponentValue(){let e=this.consumeToken();for(;e.type===31;)e=this.consumeToken();if(e.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);const t=this.consumeComponentValue();do e=this.consumeToken();while(e.type===31);if(e.type===32)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")}parseComponentValues(){const e=[];for(;;){const t=this.consumeComponentValue();if(t.type===32)return e;e.push(t)}}consumeComponentValue(){const e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e}consumeSimpleBlock(e){const t={type:e,values:[]};let r=this.consumeToken();for(;;){if(r.type===32||_C(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}}consumeFunction(e){const t={name:e.value,values:[],type:18};for(;;){const r=this.consumeToken();if(r.type===32||r.type===3)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}}consumeToken(){const e=this._tokens.shift();return typeof e>"u"?Qa:e}reconsumeToken(e){this._tokens.unshift(e)}};const jt=A=>A.type===15,xe=A=>A.type===17,J=A=>A.type===20,CC=A=>A.type===0,Qn=(A,e)=>J(A)&&A.value===e,In=A=>A.type!==31,ke=A=>A.type!==31&&A.type!==4,It=A=>{const e=[];let t=[];return A.forEach(r=>{if(r.type===4){if(t.length===0)throw new Error("Error parsing function args, zero tokens for arg");e.push(t),t=[];return}r.type!==31&&t.push(r)}),t.length&&e.push(t),e},_C=(A,e)=>e===11&&A.type===12||e===28&&A.type===29?!0:e===2&&A.type===3,EC=/(\d+(?:\.\d+)?|[+\-*/()])/g,Ch=A=>{const e=A.match(EC);if(!e)return NaN;const t=[],r=[],n={"+":1,"-":1,"*":2,"/":2};for(const i of e)if(/^\d+(?:\.\d+)?$/.test(i))t.push(parseFloat(i));else if(i==="(")r.push(i);else if(i===")"){for(;r.length&&r[r.length-1]!=="(";)t.push(r.pop());if(!r.length)return NaN;r.pop()}else{for(;r.length&&n[r[r.length-1]]>=n[i];)t.push(r.pop());r.push(i)}for(;r.length;){const i=r.pop();if(i==="(")return NaN;t.push(i)}const s=[];for(const i of t)if(typeof i=="number")s.push(i);else{const o=s.pop(),a=s.pop();if(a===void 0||o===void 0)return NaN;switch(i){case"+":s.push(a+o);break;case"-":s.push(a-o);break;case"*":s.push(a*o);break;case"/":s.push(o===0?NaN:a/o);break;default:return NaN}}return s.length===1?s[0]:NaN},we=(A,e,t)=>Math.min(Math.max(A,e),t),st=(A,e)=>[A[0]*e[0]+A[1]*e[1]+A[2]*e[2],A[3]*e[0]+A[4]*e[1]+A[5]*e[2],A[6]*e[0]+A[7]*e[1]+A[8]*e[2]],yA=A=>st([3.2409699419045226,-1.537383177570094,-.4986107602930034,-.9692436362808796,1.8759675015077202,.04155505740717559,.05563007969699366,-.20397695888897652,1.0569715142428786],A),Fa=A=>st([.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],A),$A=A=>A.map(e=>{const t=e<0?-1:1,r=Math.abs(e);return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),Ta=A=>A.map(e=>{const t=e<0?-1:1,r=Math.abs(e);return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),vC=A=>{const[e,t,r]=$A(yA([A[0],A[1],A[2]]));return[e,t,r,A[3]]},bC=A=>{const[e,t,r]=yA([A[0],A[1],A[2]]);return[we(Math.round(e*255),0,255),we(Math.round(t*255),0,255),we(Math.round(r*255),0,255),A[3]]},CA=A=>A.type===17||A.type===15,oe=A=>A.type===16||CA(A),UC=A=>A.type===18&&A.name==="calc",QC=(A,e=0)=>{const t=r=>{let n="";for(const s of r)if(s.type!==31){if(s.type===18)if(s.name==="calc"){const i=t(s.values);if(i===null)return null;n+=`(${i})`}else return null;else if(s.type===17)n+=s.number.toString();else if(s.type===15)s.unit==="px"?n+=s.number.toString():s.unit==="rem"||s.unit==="em"?n+=(s.number*16).toString():n+=s.number.toString();else if(s.type===16)n+=(s.number/100*e).toString();else if(s.type===6){const i=s.value;i==="+"||i==="-"||i==="*"||i==="/"?n+=` ${i} `:i==="("?n+="(":i===")"&&(n+=")")}}return n};try{const r=t(A.values);if(r===null||r.trim()==="")return null;const n=Ch(r);if(typeof n=="number"&&!isNaN(n))return{type:17,number:n,flags:4}}catch{return null}return null},_h=A=>A.length>1?[A[0],A[1]]:[A[0]],ve={type:17,number:0,flags:4},sA={type:16,number:50,flags:4},Ft={type:16,number:100,flags:4},Fn=(A,e,t)=>{const[r,n]=A;return[G(r,e),G(typeof n<"u"?n:r,t)]},G=(A,e)=>{if(A.type===16)return A.number/100*e;if(jt(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},Eh="deg",vh="grad",bh="rad",Uh="turn",Fr={name:"angle",parse:(A,e)=>{if(e.type===15)switch(e.unit){case Eh:return Math.PI*e.number/180;case vh:return Math.PI/200*e.number;case bh:return e.number;case Uh:return Math.PI*2*e.number}throw new Error("Unsupported angle type")}},Qh=A=>A.type===15&&(A.unit===Eh||A.unit===vh||A.unit===bh||A.unit===Uh),Ih=A=>{switch(A.filter(J).map(e=>e.value).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ve,ve];case"to top":case"bottom":return Bt(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ve,Ft];case"to right":case"left":return Bt(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Ft,Ft];case"to bottom":case"top":return Bt(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Ft,ve];case"to left":case"right":return Bt(270)}return 0},Bt=A=>Math.PI*A/180,_A=A=>(255&A)===0,me=A=>{const e=255&A,t=255&A>>8,r=255&A>>16,n=255&A>>24;return e<255?`rgba(${n},${r},${t},${e/255})`:`rgb(${n},${r},${t})`},Tt=(A,e,t,r)=>(A<<24|e<<16|t<<8|Math.round(r*255)<<0)>>>0,EA=(A,e)=>{if(A.type===17)return A.number;if(A.type===16){const t=e===3?1:255;return e===3?A.number/100*t:Math.round(A.number/100*t)}return 0},jA=A=>(A[0].type===20?A[0].value:"unknown")==="from",IC=A=>Tt(we(Math.round(A[0]*255),0,255),we(Math.round(A[1]*255),0,255),we(Math.round(A[2]*255),0,255),we(A[3],0,1)),Sa=([A,e,t,r])=>{const n=$A([A,e,t]);return Tt(we(Math.round(n[0]*255),0,255),we(Math.round(n[1]*255),0,255),we(Math.round(n[2]*255),0,255),r)},Tn=A=>{const e=yA([A[0],A[1],A[2]]);return Sa([e[0],e[1],e[2],A[3]])},FC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for lab()");const[t,r,n,s]=ui(e),i=$A(yA(fi([t,r,n])));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},TC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for oklab()");const[t,r,n,s]=ui(e),i=$A(yA(di([t,r,n])));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},SC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for oklch()");const[t,r,n,s]=Rh(e),i=$A(yA(di(hi([t,r,n]))));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},RC=(A,e)=>{if(jA(e.filter(ke)))throw new Error("Relative color not supported for lch()");const[t,r,n,s]=Sh(e),i=$A(yA(fi(hi([t,r,n]))));return Tt(we(Math.round(i[0]*255),0,255),we(Math.round(i[1]*255),0,255),we(Math.round(i[2]*255),0,255),s)},Fh=(A,e)=>{const[t,r,n,s]=e.filter(ke);return[(t.type===17?Bt(t.number):Fr.parse(A,t))/(Math.PI*2),oe(r)?r.number/100:0,oe(n)?n.number/100:0,typeof s<"u"&&oe(s)?G(s,1):1]},Th=(A,e)=>{if(jA(e))throw new Error("Relative color not supported for hsl()");const[t,r,n,s]=Fh(A,e),i=kh([t,r,n]);return Tt(i[0]*255,i[1]*255,i[2]*255,r===0?1:s)},Sh=A=>{const e=A.filter(ke);return[oe(e[0])?e[0].number:0,oe(e[1])?e[1].number:0,xe(e[2])||jt(e[2])?e[2].number:0,typeof e[4]<"u"&&oe(e[4])?G(e[4],1):1]},ui=A=>{const e=A.filter(ke);return[e[0].type===16?e[0].number/100:xe(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:xe(e[1])?e[1].number:0,xe(e[2])||jt(e[2])?e[2].number:0,typeof e[4]<"u"&&oe(e[4])?G(e[4],1):1]},Rh=A=>{const e=A.filter(ke);return[e[0].type===16?e[0].number/100:xe(e[0])?e[0].number:0,e[1].type===16?e[1].number/100:xe(e[1])?e[1].number:0,xe(e[2])||jt(e[2])?e[2].number:0,typeof e[4]<"u"&&oe(e[4])?G(e[4],1):1]},xh=A=>st([1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],A),Ra=A=>st([.955473421488075,-.02309845494876471,.06325924320057072,-.0283697093338637,1.0099953980813041,.021041441191917323,.012314014864481998,-.020507649298898964,1.330365926242124],A),xa=(A,e,t)=>(t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<1/2?e:t<2/3?(e-A)*6*(2/3-t)+A:A),kh=([A,e,t])=>{if(e===0)return[t*255,t*255,t*255];const r=t<=.5?t*(e+1):t+e-t*e,n=t*2-r;return[xa(n,r,A+1/3),xa(n,r,A),xa(n,r,A-1/3)]},hi=([A,e,t])=>(e<0&&(e=0),isNaN(t)&&(t=0),[A,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]),di=A=>st([1.2268798758459243,-.5578149944602171,.2813910456659647,-.0405757452148008,1.112286803280317,-.0717110580655164,-.0763729366746601,-.4214933324022432,1.5869240198367816],st([1,.3963377773761749,.2158037573099136,1,-.1055613458156586,-.0638541728258133,1,-.0894841775298119,-1.2914855480194092],A).map(e=>e**3)),fi=A=>{const e=(A[0]+16)/116,t=A[1]/500+e,r=e-A[2]/200,n=24389/27,s=24/116,i=[(t>s?t**3:(116*t-16)/n)*.3457/.3585,A[0]>8?e**3:A[0]/n,(r>s?r**3:(116*r-16)/n)*.2958/.3585];return Ra([i[0],i[1],i[2]])},xC=(A,e)=>{const t=e.filter(ke);if(t.length===3){const[r,n,s]=t.map(EA),i=Ta([r/255,n/255,s/255]),[o,a,l]=Fa([i[0],i[1],i[2]]);return[o,a,l,1]}if(t.length===4){const[r,n,s,i]=t.map(EA),o=Ta([r/255,n/255,s/255]),[a,l,u]=Fa([o[0],o[1],o[2]]);return[a,l,u,i]}return[0,0,0,1]},kC=(A,e)=>{const[t,r,n,s]=Fh(A,e),i=Ta(kh([t,r,n])),[o,a,l]=Fa([i[0],i[1],i[2]]);return[o,a,l,s]},LC=(A,e)=>{const[t,r,n,s]=ui(e),[i,o,a]=fi([t,r,n]);return[i,o,a,s]},DC=(A,e)=>{const[t,r,n,s]=Sh(e),[i,o,a]=fi(hi([t,r,n]));return[i,o,a,s]},HC=(A,e)=>{const[t,r,n,s]=Rh(e),[i,o,a]=di(hi([t,r,n]));return[i,o,a,s]},OC=(A,e)=>{const[t,r,n,s]=ui(e),[i,o,a]=di([t,r,n]);return[i,o,a,s]},PC=A=>Ra([A[0],A[1],A[2]]),Lh=A=>A,NC=A=>{const[e,t,r]=xh([A[0],A[2],A[3]]);return[e,t,r,A[3]]},Dh=A=>Tn([A[0],A[1],A[2],A[3]]),MC=A=>{const e=PC([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},VC=A=>st([.4865709486482162,.26566769316909306,.1982172852343625,.2289745640697488,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],A),KC=A=>st([2.493496911941425,-.9313836179191239,-.40271078445071684,-.8294889695615747,1.7626640603183463,.023624685841943577,.03584583024378447,-.07617238926804182,.9568845240076872],A),$C=A=>A.map(e=>{const t=e<0?-1:1;return e*t<=.04045?e/12.92:t*((e+.055)/1.055)**2.4||0}),jC=A=>$A(A),GC=A=>{const e=$C([A[0],A[1],A[2]]);return VC([e[0],e[1],e[2]])},WC=A=>{const[e,t,r]=jC(KC([A[0],A[1],A[2]]));return[e,t,r,A[3]]},qC=A=>{const e=GC([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},JC=A=>st([2.0415879038107465,-.5650069742788596,-.34473135077832956,-.9692436362808795,1.8759675015077202,.04155505740717557,.013444280632031142,-.11836239223101838,1.0151749943912054],A),zC=A=>st([.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.0752914584939978,.02703136138641234,.07068885253582723,.9913375368376388],A),XC=A=>{const e=A.map(t=>(t<0?-1:1)*Math.abs(t)**2.19921875);return[e[0],e[1],e[2]]},YC=A=>{const e=A.map(t=>(t<0?-1:1)*Math.abs(t)**.4547069271758437);return[e[0],e[1],e[2]]},ZC=A=>{const[e,t,r]=YC(JC([A[0],A[1],A[2]]));return[e,t,r,A[3]]},e_=A=>{const e=yA(zC(XC([A[0],A[1],A[2]])));return Sa([e[0],e[1],e[2],A[3]])},t_=A=>st([.7977666449006423,.13518129740053308,.0313477341283922,.2880748288194013,.711835234241873,8993693872564e-17,0,0,.8251046025104602],A),A_=A=>st([1.3457868816471583,-.25557208737979464,-.05110186497554526,-.5446307051249019,1.5082477428451468,.02052744743642139,0,0,1.2119675456389452],A),r_=A=>A.map(e=>e<16/512?e/16:e**1.8),n_=A=>A.map(e=>e>1/512?e**(1/1.8):e*16),s_=A=>{const e=r_([A[0],A[1],A[2]]);return Ra(t_([e[0],e[1],e[2]]))},i_=A=>{const[e,t,r]=n_(A_(xh([A[0],A[1],A[2]])));return[e,t,r,A[3]]},o_=A=>{const e=s_([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},gi=1.09929682680944,Hh=.018053968510807,a_=A=>A.map(function(e){return e<Hh*4.5?e/4.5:Math.pow((e+gi-1)/gi,1/.45)}),c_=A=>A.map(function(e){return e>=Hh?gi*Math.pow(e,.45)-(gi-1):4.5*e}),l_=A=>st([.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.060985057710791],A),u_=A=>st([1.716651187971268,-.355670783776392,-.25336628137366,-.666684351832489,1.616481236634939,.0157685458139111,.017639857445311,-.042770613257809,.942103121235474],A),h_=A=>{const e=a_([A[0],A[1],A[2]]);return l_([e[0],e[1],e[2]])},d_=A=>{const[e,t,r]=c_(u_([A[0],A[1],A[2]]));return[e,t,r,A[3]]},f_=A=>{const e=h_([A[0],A[1],A[2]]);return Tn([e[0],e[1],e[2],A[3]])},vA={name:"color",parse:(A,e)=>{if(e.type===18){const t=m_[e.name];if(typeof t>"u")throw new Error(`Attempting to parse an unsupported color function "${e.name}"`);return t(A,e.values)}if(e.type===5){const[t,r,n,s]=Oh(e);return Tt(t,r,n,s)}if(e.type===20){const t=Gt[e.value.toUpperCase()];if(typeof t<"u")return t}return Gt.TRANSPARENT}},Oh=A=>{if(A.value.length===3){const e=A.value.substring(0,1),t=A.value.substring(1,2),r=A.value.substring(2,3);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),1]}if(A.value.length===4){const e=A.value.substring(0,1),t=A.value.substring(1,2),r=A.value.substring(2,3),n=A.value.substring(3,4);return[parseInt(e+e,16),parseInt(t+t,16),parseInt(r+r,16),parseInt(n+n,16)/255]}if(A.value.length===6){const e=A.value.substring(0,2),t=A.value.substring(2,4),r=A.value.substring(4,6);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),1]}if(A.value.length===8){const e=A.value.substring(0,2),t=A.value.substring(2,4),r=A.value.substring(4,6),n=A.value.substring(6,8);return[parseInt(e,16),parseInt(t,16),parseInt(r,16),parseInt(n,16)/255]}return[0,0,0,1]},Ph=(A,e)=>{const t=e.filter(ke);if(jA(t))throw new Error("Relative color not supported for rgb()");if(t.length===3){const[r,n,s]=t.map(EA);return Tt(r,n,s,1)}if(t.length===4){const[r,n,s,i]=t.map(EA);return Tt(r,n,s,i)}return t.length===5&&t[3].type===6&&t[3].value==="/"?Tt(EA(t[0],0),EA(t[1],1),EA(t[2],2),EA(t[4],3)):0},g_=(A,e)=>{const t=e.filter(ke),r=t[0].type===20?t[0].value:"unknown";if(jA(t)){const n=(B,b)=>{if(xe(b))return b.number;const S=R=>R==="r"||R==="x"?0:R==="g"||R==="y"?1:2;if(J(b))return B[S(b.value)];const I=R=>{const K=R.filter(ke);let P="(";for(const _ of K)P+=_.type===18&&_.name==="calc"?I(_.values):xe(_)?_.number:_.type===6||J(_)?_.value:"";return P+=")",P};if(b.type===18){const R=b.values.filter(ke);if(b.name==="calc")return Ch(I(R).replace(/r|x/,B[0].toString()).replace(/g|y/,B[1].toString()).replace(/b|z/,B[2].toString()))}return null},s=t[1].type===18?t[1].name:J(t[1])||t[1].type===5?"rgb":"unknown",i=J(t[2])?t[2].value:"unknown";let o=t[1].type===18?t[1].values:J(t[1])?[t[1]]:[];if(J(t[1])){if(typeof Gt[t[1].value.toUpperCase()]>"u")throw new Error("Attempting to use unknown color in relative color 'from'");{const B=Tr(A,t[1].value),b=255&B,S=255&B>>8,I=255&B>>16;o=[{type:17,number:255&B>>24,flags:1},{type:17,number:I,flags:1},{type:17,number:S,flags:1},{type:17,number:b>1?b/255:b,flags:1}]}}else if(t[1].type===5){const[B,b,S,I]=Oh(t[1]);o=[{type:17,number:B,flags:1},{type:17,number:b,flags:1},{type:17,number:S,flags:1},{type:17,number:I>1?I/255:I,flags:1}]}if(o.length===0)throw new Error("Attempting to use unknown color in relative color 'from'");if(i==="unknown")throw new Error("Attempting to use unknown colorspace in relative color 'to'");const a=p_[s],l=w_[i],u=Nh[i];if(typeof a>"u")throw new Error(`Attempting to parse an unsupported color space "${s}" for color() function`);if(typeof l>"u")throw new Error(`Attempting to parse an unsupported color space "${i}" for color() function`);const d=l(a(A,o)),g=n(d,t[3]),p=n(d,t[4]),w=n(d,t[5]),y=t.length>6&&t[6].type===6&&t[6].value==="/"&&xe(t[7])?t[7].number:1;if(g===null||p===null||w===null)throw new Error("Invalid relative color in color() function");return u([g,p,w,y])}else{const n=r,s=Nh[n];if(typeof s>"u")throw new Error(`Attempting to parse an unsupported color space "${n}" for color() function`);return s([xe(t[1])?t[1].number:0,xe(t[2])?t[2].number:0,xe(t[3])?t[3].number:0,t.length>4&&t[4].type===6&&t[4].value==="/"&&xe(t[5])?t[5].number:1])}},Nh={srgb:IC,"srgb-linear":Sa,"display-p3":qC,"a98-rgb":e_,"prophoto-rgb":o_,xyz:Dh,"xyz-d50":MC,"xyz-d65":Dh,rec2020:f_},p_={rgb:xC,hsl:kC,lab:LC,lch:DC,oklab:OC,oklch:HC},w_={srgb:vC,"srgb-linear":bC,"display-p3":WC,"a98-rgb":ZC,"prophoto-rgb":i_,xyz:Lh,"xyz-d50":NC,"xyz-d65":Lh,rec2020:d_},m_={hsl:Th,hsla:Th,rgb:Ph,rgba:Ph,lch:RC,oklch:SC,oklab:TC,lab:FC,color:g_},Tr=(A,e)=>vA.parse(A,yh.create(e).parseComponentValue()),Gt={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},B_={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:(A,e)=>e.map(t=>{if(J(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})},y_={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pi=(A,e)=>{const t=vA.parse(A,e[0]),r=e[1];return r&&oe(r)?{color:t,stop:r}:{color:t,stop:null}},ka=(A,e)=>{const t=A[0],r=A[A.length-1];t.stop===null&&(t.stop=ve),r.stop===null&&(r.stop=Ft);const n=[];let s=0;for(let o=0;o<A.length;o++){const a=A[o].stop;if(a!==null){const l=G(a,e);l>s?n.push(l):n.push(s),s=l}else n.push(null)}let i=null;for(let o=0;o<n.length;o++){const a=n[o];if(a===null)i===null&&(i=o);else if(i!==null){const l=o-i,u=(a-n[i-1])/(l+1);for(let d=1;d<=l;d++)n[i+d-1]=u*d;i=null}}return A.map(({color:o},a)=>({color:o,stop:Math.max(Math.min(1,n[a]/e),0)}))},C_=(A,e,t)=>{const r=e/2,n=t/2,s=G(A[0],e)-r,i=n-G(A[1],t);return(Math.atan2(i,s)+Math.PI*2)%(Math.PI*2)},Mh=(A,e,t)=>{const r=typeof A=="number"?A:C_(A,e,t),n=Math.abs(e*Math.sin(r))+Math.abs(t*Math.cos(r)),s=e/2,i=t/2,o=n/2,a=Math.sin(r-Math.PI/2)*o,l=Math.cos(r-Math.PI/2)*o;return[n,s-l,s+l,i-a,i+a]},St=(A,e)=>Math.sqrt(A*A+e*e),Vh=(A,e,t,r,n)=>[[0,0],[0,e],[A,0],[A,e]].reduce((s,i)=>{const[o,a]=i,l=St(t-o,r-a);return(n?l<s.optimumDistance:l>s.optimumDistance)?{optimumCorner:i,optimumDistance:l}:s},{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner,__=(A,e,t,r,n)=>{let s=0,i=0;switch(A.size){case 0:A.shape===0?s=i=Math.min(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===1&&(s=Math.min(Math.abs(e),Math.abs(e-r)),i=Math.min(Math.abs(t),Math.abs(t-n)));break;case 2:if(A.shape===0)s=i=Math.min(St(e,t),St(e,t-n),St(e-r,t),St(e-r,t-n));else if(A.shape===1){const o=Math.min(Math.abs(t),Math.abs(t-n))/Math.min(Math.abs(e),Math.abs(e-r)),[a,l]=Vh(r,n,e,t,!0);s=St(a-e,(l-t)/o),i=o*s}break;case 1:A.shape===0?s=i=Math.max(Math.abs(e),Math.abs(e-r),Math.abs(t),Math.abs(t-n)):A.shape===1&&(s=Math.max(Math.abs(e),Math.abs(e-r)),i=Math.max(Math.abs(t),Math.abs(t-n)));break;case 3:if(A.shape===0)s=i=Math.max(St(e,t),St(e,t-n),St(e-r,t),St(e-r,t-n));else if(A.shape===1){const o=Math.max(Math.abs(t),Math.abs(t-n))/Math.max(Math.abs(e),Math.abs(e-r)),[a,l]=Vh(r,n,e,t,!1);s=St(a-e,(l-t)/o),i=o*s}break}return Array.isArray(A.size)&&(s=G(A.size[0],r),i=A.size.length===2?G(A.size[1],n):s),[s,i]},Kh=(A,e)=>{let t=Bt(180);const r=[];return It(e).forEach((n,s)=>{if(s===0){const o=n[0];if(o.type===20&&o.value==="to"){t=Ih(n);return}else if(Qh(o)){t=Fr.parse(A,o);return}}const i=pi(A,n);r.push(i)}),{angle:t,stops:r,type:1}},wi=(A,e)=>{let t=Bt(180);const r=[];return It(e).forEach((n,s)=>{if(s===0){const o=n[0];if(o.type===20&&["top","left","right","bottom"].indexOf(o.value)!==-1){t=Ih(n);return}else if(Qh(o)){t=(Fr.parse(A,o)+Bt(270))%Bt(360);return}}const i=pi(A,n);r.push(i)}),{angle:t,stops:r,type:1}},E_=(A,e)=>{const t=Bt(180),r=[];let n=1;const s=0,i=3,o=[];return It(e).forEach((a,l)=>{const u=a[0];if(l===0){if(J(u)&&u.value==="linear"){n=1;return}else if(J(u)&&u.value==="radial"){n=2;return}}if(u.type===18){if(u.name==="from"){const d=vA.parse(A,u.values[0]);r.push({stop:ve,color:d})}else if(u.name==="to"){const d=vA.parse(A,u.values[0]);r.push({stop:Ft,color:d})}else if(u.name==="color-stop"){const d=u.values.filter(ke);if(d.length===2){const g=vA.parse(A,d[1]),p=d[0];xe(p)&&r.push({stop:{type:16,number:p.number*100,flags:p.flags},color:g})}}}}),n===1?{angle:(t+Bt(180))%Bt(360),stops:r,type:n}:{size:i,shape:s,stops:r,position:o,type:n}},$h="closest-side",jh="farthest-side",Gh="closest-corner",Wh="farthest-corner",qh="circle",Jh="ellipse",zh="cover",Xh="contain",v_=(A,e)=>{let t=0,r=3;const n=[],s=[];return It(e).forEach((i,o)=>{let a=!0;if(o===0){let l=!1;a=i.reduce((u,d)=>{if(l)if(J(d))switch(d.value){case"center":return s.push(sA),u;case"top":case"left":return s.push(ve),u;case"right":case"bottom":return s.push(Ft),u}else(oe(d)||CA(d))&&s.push(d);else if(J(d))switch(d.value){case qh:return t=0,!1;case Jh:return t=1,!1;case"at":return l=!0,!1;case $h:return r=0,!1;case zh:case jh:return r=1,!1;case Xh:case Gh:return r=2,!1;case Wh:return r=3,!1}else if(CA(d)||oe(d))return Array.isArray(r)||(r=[]),r.push(d),!1;return u},a)}if(a){const l=pi(A,i);n.push(l)}}),{size:r,shape:t,stops:n,position:s,type:2}},mi=(A,e)=>{let t=0,r=3;const n=[],s=[];return It(e).forEach((i,o)=>{let a=!0;if(o===0?a=i.reduce((l,u)=>{if(J(u))switch(u.value){case"center":return s.push(sA),!1;case"top":case"left":return s.push(ve),!1;case"right":case"bottom":return s.push(Ft),!1}else if(oe(u)||CA(u))return s.push(u),!1;return l},a):o===1&&(a=i.reduce((l,u)=>{if(J(u))switch(u.value){case qh:return t=0,!1;case Jh:return t=1,!1;case Xh:case $h:return r=0,!1;case jh:return r=1,!1;case Gh:return r=2,!1;case zh:case Wh:return r=3,!1}else if(CA(u)||oe(u))return Array.isArray(r)||(r=[]),r.push(u),!1;return l},a)),a){const l=pi(A,i);n.push(l)}}),{size:r,shape:t,stops:n,position:s,type:2}},Sn=(A,e)=>({...Kh(A,e),type:3}),b_=A=>A.type===1,U_=A=>A.type===2,Q_=A=>A.type===3,Bi={name:"image",parse:(A,e)=>{if(e.type===22){const t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(e.type===18){const t=Zh[e.name];if(typeof t>"u")throw new Error(`Attempting to parse an unsupported image function "${e.name}"`);return t(A,e.values)}throw new Error(`Unsupported image type ${e.type}`)}};function Yh(A){return!(A.type===20&&A.value==="none")&&(A.type!==18||!!Zh[A.name])}const Zh={"linear-gradient":Kh,"-moz-linear-gradient":wi,"-ms-linear-gradient":wi,"-o-linear-gradient":wi,"-webkit-linear-gradient":wi,"radial-gradient":v_,"-moz-radial-gradient":mi,"-ms-radial-gradient":mi,"-o-radial-gradient":mi,"-webkit-radial-gradient":mi,"-webkit-gradient":E_,"repeating-linear-gradient":Sn,"-webkit-repeating-linear-gradient":Sn,"-moz-repeating-linear-gradient":Sn,"-ms-repeating-linear-gradient":Sn,"-o-repeating-linear-gradient":Sn},I_={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>{if(e.length===0)return[];const t=e[0];return t.type===20&&t.value==="none"?[]:e.filter(r=>ke(r)&&Yh(r)).map(r=>Bi.parse(A,r))}},F_={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:(A,e)=>e.map(t=>{if(J(t))switch(t.value){case"padding-box":return 1;case"content-box":return 2}return 0})},T_={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:(A,e)=>It(e).map(t=>t.map(r=>UC(r)?QC(r,0):oe(r)?r:null).filter(r=>r!==null)).map(_h)},S_={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:(A,e)=>It(e).map(t=>t.filter(J).map(r=>r.value).join(" ")).map(R_)},R_=A=>{switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},x_={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:(A,e)=>It(e).map(t=>t.filter(k_))},k_=A=>J(A)||oe(A),yi=A=>({name:`border-${A}-color`,initialValue:"transparent",prefix:!1,type:3,format:"color"}),L_=yi("top"),D_=yi("right"),H_=yi("bottom"),O_=yi("left"),Ci=A=>({name:`border-${A}-radius`,initialValue:"0 0",prefix:!1,type:1,parse:(e,t)=>_h(t.filter(oe))}),P_=Ci("top-left"),N_=Ci("top-right"),M_=Ci("bottom-right"),V_=Ci("bottom-left"),_i=A=>({name:`border-${A}-style`,initialValue:"solid",prefix:!1,type:2,parse:(e,t)=>{switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}),K_=_i("top"),$_=_i("right"),j_=_i("bottom"),G_=_i("left"),Ei=A=>({name:`border-${A}-width`,initialValue:"0",type:0,prefix:!1,parse:(e,t)=>jt(t)?t.number:0}),W_=Ei("top"),q_=Ei("right"),J_=Ei("bottom"),z_=Ei("left"),La={type:0},Da=A=>{const[e]=A;return e?J(e)?e.value==="farthest-side"?"farthest-side":"closest-side":oe(e)?e:"closest-side":"closest-side"},ed=A=>{let e=null,t=null;for(const r of A)if(J(r))switch(r.value){case"left":e=ve;break;case"right":e=Ft;break;case"top":t=ve;break;case"bottom":t=Ft;break;case"center":e===null?e=sA:t===null&&(t=sA);break}else oe(r)&&(e===null?e=r:t===null&&(t=r));return{cx:e??sA,cy:t??sA}},X_=A=>{const e=[];for(const n of A)if(n.type!==31){if(J(n)&&n.value==="round")break;oe(n)&&e.push(n)}const t=e[0]??ve,r=e[1]??t;return{type:1,top:t,right:r,bottom:e[2]??t,left:e[3]??r}},Y_=A=>{const e=A.filter(In),t=e.findIndex(s=>Qn(s,"at")),r=t===-1?e:e.slice(0,t),n=t===-1?[]:e.slice(t+1);return{type:2,radius:Da(r),...ed(n)}},Z_=A=>{const e=A.filter(In),t=e.findIndex(s=>Qn(s,"at")),r=t===-1?e:e.slice(0,t),n=t===-1?[]:e.slice(t+1);return{type:3,rx:Da(r.slice(0,1)),ry:Da(r.slice(1,2)),...ed(n)}},e0=A=>{const e=It(A),t=[];for(const r of e){if(r.length===1&&J(r[0]))continue;const n=r.filter(oe);n.length>=2&&t.push([n[0],n[1]])}return{type:4,points:t}},t0=A=>{const e=A.find(t=>t.type===0);return e?{type:5,d:e.value}:La},A0={name:"clip-path",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>{if(J(e)&&e.value==="none")return La;if(e.type===18)switch(e.name){case"inset":return X_(e.values);case"circle":return Y_(e.values);case"ellipse":return Z_(e.values);case"polygon":return e0(e.values);case"path":return t0(e.values)}return La}},r0={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},n0={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"rtl":return 1;default:return 0}}},s0={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:(A,e)=>e.filter(J).reduce((t,r)=>t|i0(r.value),0)},i0=A=>{switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},td={name:"float",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},o0={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:(A,e)=>e.type===20&&e.value==="normal"?0:e.type===17||e.type===15?e.number:0},a0={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"strict":return"strict";default:return"normal"}}},c0={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ad=(A,e)=>J(A)&&A.value==="normal"?1.2*e:A.type===17?e*A.number:oe(A)?G(A,e):e,l0={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:(A,e)=>e.type===20&&e.value==="none"?null:Bi.parse(A,e)},u0={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"inside":return 0;default:return 1}}},Ha={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 52;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},vi=A=>({name:`margin-${A}`,initialValue:"0",prefix:!1,type:4}),h0=vi("top"),d0=vi("right"),f0=vi("bottom"),g0=vi("left"),rd={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:(A,e)=>e.filter(J).map(t=>{switch(t.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})},p0={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-word":return"break-word";default:return"normal"}}},bi=A=>({name:`padding-${A}`,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}),w0=bi("top"),m0=bi("right"),B0=bi("bottom"),y0=bi("left"),C0={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},_0={name:"position",initialValue:"static",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},E0={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&Qn(e[0],"none")?[]:It(e).map(t=>{const r={color:Gt.TRANSPARENT,offsetX:ve,offsetY:ve,blur:ve};let n=0;for(let s=0;s<t.length;s++){const i=t[s];CA(i)?(n===0?r.offsetX=i:n===1?r.offsetY=i:r.blur=i,n++):r.color=vA.parse(A,i)}return r})},v0={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},b0={name:"transform",initialValue:"none",prefix:!0,type:0,parse:(A,e)=>{if(e.type===20&&e.value==="none")return null;if(e.type===18){const t=U0[e.name];if(typeof t>"u")throw new Error(`Attempting to parse an unsupported transform function "${e.name}"`);return t(A,e.values)}return null}},U0={matrix:(A,e)=>{const t=e.filter(r=>r.type===17).map(r=>r.number);return t.length===6?t:null},matrix3d:(A,e)=>{const t=e.filter(l=>l.type===17).map(l=>l.number),[r,n,{},{},s,i,{},{},{},{},{},{},o,a]=t;return t.length===16?[r,n,s,i,o,a]:null},rotate:(A,e)=>{if(e.length!==1)return null;const t=e[0];let r=0;if(t.type===17&&t.number===0)r=0;else if(t.type===15)r=Fr.parse(A,t);else return null;const n=Math.cos(r),s=Math.sin(r);return[n,s,-s,n,0,0]}},nd={type:16,number:50,flags:4},Q0=[nd,nd],I0={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:(A,e)=>{const t=e.filter(oe);return t.length!==2?Q0:[t[0],t[1]]}},F0={name:"rotate",initialValue:"none",prefix:!1,type:0,parse:(A,e)=>e.type===20&&e.value==="none"?null:e.type===17&&e.number===0?0:e.type===15?Fr.parse(A,e)*180/Math.PI:null},T0={name:"visibility",initialValue:"none",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}},S0={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"break-all":return"break-all";case"keep-all":return"keep-all";default:return"normal"}}},Oa=A=>A!==0,R0=A=>A===3||A===4,x0={name:"writing-mode",initialValue:"horizontal-tb",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"vertical-rl":return 1;case"vertical-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4;default:return 0}}},k0={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(e.type===20)return{auto:!0,order:0};if(xe(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},sd={name:"time",parse:(A,e)=>{if(e.type===15)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},L0={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>xe(e)?e.number:1},id={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},od={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>e.filter(J).map(t=>{switch(t.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(t=>t!==0)},D0={name:"text-decoration-style",initialValue:"solid",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4;default:return 0}}},H0={name:"text-decoration-thickness",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>{if(J(e))switch(e.value){case"auto":return"auto";case"from-font":return"from-font"}return jt(e)?e.number:"auto"}},O0={name:"text-underline-offset",initialValue:"auto",prefix:!1,type:0,parse:(A,e)=>J(e)&&e.value==="auto"?"auto":jt(e)?e.number:"auto"},P0={name:"font-family",initialValue:"",prefix:!1,type:1,parse:(A,e)=>{const t=[],r=[];return e.forEach(n=>{switch(n.type){case 20:case 0:t.push(n.value);break;case 17:t.push(n.number.toString());break;case 4:r.push(t.join(" ")),t.length=0;break}}),t.length&&r.push(t.join(" ")),r.map(n=>n.indexOf(" ")===-1?n:`'${n}'`)}},N0={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},M0={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:(A,e)=>{if(xe(e))return e.number;if(J(e))switch(e.value){case"bold":return 700;default:return 400}return 400}},V0={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.filter(J).map(t=>t.value)},K0={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},Pe=(A,e)=>(A&e)!==0,$0={name:"content",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>{if(e.length===0)return[];const t=e[0];return t.type===20&&t.value==="none"?[]:e}},ad=(A,e)=>{const t=[],r=A.filter(In);for(let n=0;n<r.length;n++){const s=r[n],i=r[n+1];if(s.type===20){const o=i&&xe(i)?i.number:e;t.push([s.value,o])}}return t},j0={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e[0];return t.type===20&&t.value==="none"?null:ad(e,1).map(([r,n])=>({counter:r,increment:n}))}},G0={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>e.length===0?[]:ad(e,0).filter(([t])=>t!=="none").map(([t,r])=>({counter:t,reset:r}))},W0={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:(A,e)=>e.filter(jt).map(t=>sd.parse(A,t))},q0={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e[0];if(t.type===20&&t.value==="none")return null;const r=[],n=e.filter(CC);if(n.length%2!==0)return null;for(let s=0;s<n.length;s+=2){const i=n[s].value,o=n[s+1].value;r.push({open:i,close:o})}return r}},cd=(A,e,t)=>{if(!A)return"";const r=A[Math.min(e,A.length-1)];return r?t?r.open:r.close:""},J0={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:(A,e)=>e.length===1&&Qn(e[0],"none")?[]:It(e).map(t=>{const r={color:255,offsetX:ve,offsetY:ve,blur:ve,spread:ve,inset:!1};let n=0;for(let s=0;s<t.length;s++){const i=t[s];Qn(i,"inset")?r.inset=!0:CA(i)?(n===0?r.offsetX=i:n===1?r.offsetY=i:n===2?r.blur=i:r.spread=i,n++):r.color=vA.parse(A,i)}return r})},z0={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:(A,e)=>{const t=[0,1,2],r=[];return e.filter(J).forEach(n=>{switch(n.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),t.forEach(n=>{r.indexOf(n)===-1&&r.push(n)}),r}},X0={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Y0={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:(A,e)=>jt(e)?e.number:0},Z0={name:"-webkit-line-clamp",initialValue:"none",prefix:!0,type:0,parse:(A,e)=>e.type===20&&e.value==="none"?0:e.type===17?Math.max(0,Math.floor(e.number)):0},eE={name:"object-fit",initialValue:"fill",prefix:!1,type:1,parse:(A,e)=>e.filter(J).reduce((t,r)=>t|tE(r.value),0)},tE=A=>{switch(A){case"contain":return 2;case"cover":return 4;case"none":return 8;case"scale-down":return 16}return 0},AE={name:"text-overflow",initialValue:"clip",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"ellipsis":return 1;default:return 0}}},rE={name:"image-rendering",initialValue:"auto",prefix:!1,type:2,parse:(A,e)=>{switch(e.toLowerCase()){case"crisp-edges":case"-webkit-crisp-edges":case"-moz-crisp-edges":return 1;case"pixelated":case"-webkit-optimize-contrast":return 2;case"smooth":case"high-quality":return 3;default:return 0}}},Le={NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten",COLOR_DODGE:"color-dodge",COLOR_BURN:"color-burn",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"},nE=new Set(Object.values(Le)),sE={name:"mix-blend-mode",initialValue:"normal",type:2,prefix:!1,parse:(A,e)=>nE.has(e)?e:Le.NORMAL},iE={name:"filter",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>{if(e.length===1&&e[0].type===20&&e[0].value==="none")return null;const t=[];for(const r of e)if(r.type===18){const n=r,s=oE(n.values);switch(n.name){case"blur":t.push(`blur(${s}px)`);break;case"brightness":case"contrast":case"invert":case"opacity":case"saturate":case"sepia":t.push(`${n.name}(${s})`);break;case"grayscale":t.push(`grayscale(${s})`);break;case"hue-rotate":t.push(`hue-rotate(${s}deg)`);break;case"drop-shadow":t.push(`drop-shadow(${s})`);break}}return t.length>0?t.join(" "):null}},oE=A=>{const e=[];for(const t of A)t.type!==31&&(t.type===15?e.push(`${t.number}${t.unit}`):t.type===17?e.push(`${t.number}`):t.type===16?e.push(`${t.number}%`):t.type===20?e.push(t.value):t.type===5&&e.push(`#${t.value}`));return e.join(" ")},aE={name:"font-variant-ligatures",initialValue:"normal",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"none":return 1;case"common-ligatures":return 2;case"no-common-ligatures":return 3;case"discretionary-ligatures":return 4;case"no-discretionary-ligatures":return 5;case"historical-ligatures":return 6;case"no-historical-ligatures":return 7;case"contextual":return 8;case"no-contextual":return 9;default:return 0}}},cE={name:"zoom",initialValue:"1",type:0,prefix:!1,parse:(A,e)=>e.type===16?Math.max(0,e.number/100):e.type===17?Math.max(0,e.number):1},lE={name:"object-position",initialValue:"50% 50%",prefix:!1,type:1,parse:(A,e)=>{const t=[];let r=0;for(;r<e.length&&t.length<2;){const n=e[r];if(J(n))switch(n.value){case"left":case"top":t.push(ve);break;case"center":t.push(sA);break;case"right":case"bottom":t.push(Ft);break}else oe(n)&&t.push(n);r++}for(;t.length<2;)t.push(sA);return[t[0],t[1]]}},uE=new Set(Object.values({NORMAL:"normal",MULTIPLY:"multiply",SCREEN:"screen",OVERLAY:"overlay",DARKEN:"darken",LIGHTEN:"lighten",COLOR_DODGE:"color-dodge",COLOR_BURN:"color-burn",HARD_LIGHT:"hard-light",SOFT_LIGHT:"soft-light",DIFFERENCE:"difference",EXCLUSION:"exclusion",HUE:"hue",SATURATION:"saturation",COLOR:"color",LUMINOSITY:"luminosity"})),hE={name:"background-blend-mode",initialValue:"normal",prefix:!1,type:1,parse:(A,e)=>{const t=[],r=e.filter(ke);for(const n of r)J(n)&&uE.has(n.value)&&t.push(n.value);return t.length>0?t:["normal"]}},dE={name:"border-image-source",initialValue:"none",prefix:!1,type:1,parse:(A,e)=>{if(e.length===0)return null;const t=e.filter(r=>ke(r)&&Yh(r));return t.length===0?null:Bi.parse(A,t[0])}},fE=A=>{const e=[...A];return e.length===1?e.push(e[0],e[0],e[0]):e.length===2?e.push(e[0],e[1]):e.length===3&&e.push(e[1]),e.slice(0,4)},gE={name:"border-image-slice",initialValue:"100%",prefix:!1,type:1,parse:(A,e)=>{const t=e.filter(In),r=[];let n=!1,s="percent";for(const u of t){if(J(u)&&u.value==="fill"){n=!0;continue}u.type===17?(r.push(u.number),s="number"):u.type===16&&(r.push(u.number),s="percent")}const[i,o,a,l]=fE(r.length>0?r:[100]);return{top:i,right:o,bottom:a,left:l,fill:n,unit:s}}},pE=A=>{switch(A){case"repeat":return 1;case"round":return 2;case"space":return 3;default:return 0}},wE={name:"border-image-repeat",initialValue:"stretch",prefix:!1,type:1,parse:(A,e)=>{const t=e.filter(In),r=[];for(const s of t)J(s)&&r.push(pE(s.value));const n=r[0]??0;return{horizontal:n,vertical:r[1]??n}}},mE={name:"box-decoration-break",initialValue:"slice",prefix:!1,type:2,parse:(A,e)=>{switch(e){case"clone":return 1;default:return 0}}};var BE=class{constructor(A){this.styles=A}get topColor(){return this.styles.borderTopColor}get rightColor(){return this.styles.borderRightColor}get bottomColor(){return this.styles.borderBottomColor}get leftColor(){return this.styles.borderLeftColor}get topStyle(){return this.styles.borderTopStyle}get rightStyle(){return this.styles.borderRightStyle}get bottomStyle(){return this.styles.borderBottomStyle}get leftStyle(){return this.styles.borderLeftStyle}get topWidth(){return this.styles.borderTopWidth}get rightWidth(){return this.styles.borderRightWidth}get bottomWidth(){return this.styles.borderBottomWidth}get leftWidth(){return this.styles.borderLeftWidth}get topLeftRadius(){return this.styles.borderTopLeftRadius}get topRightRadius(){return this.styles.borderTopRightRadius}get bottomRightRadius(){return this.styles.borderBottomRightRadius}get bottomLeftRadius(){return this.styles.borderBottomLeftRadius}get imageSource(){return this.styles.borderImageSource}get imageSlice(){return this.styles.borderImageSlice}get imageRepeat(){return this.styles.borderImageRepeat}get boxShadow(){return this.styles.boxShadow}},yE=class{constructor(A){this.styles=A}get color(){return this.styles.backgroundColor}get image(){return this.styles.backgroundImage}get clip(){return this.styles.backgroundClip}get origin(){return this.styles.backgroundOrigin}get position(){return this.styles.backgroundPosition}get repeat(){return this.styles.backgroundRepeat}get size(){return this.styles.backgroundSize}get blendMode(){return this.styles.backgroundBlendMode}},CE=class{constructor(A){this.styles=A}get family(){return this.styles.fontFamily}get size(){return this.styles.fontSize}get style(){return this.styles.fontStyle}get variant(){return this.styles.fontVariant}get weight(){return this.styles.fontWeight}get ligatures(){return this.styles.fontVariantLigatures}get color(){return this.styles.color}get letterSpacing(){return this.styles.letterSpacing}get lineHeight(){return this.styles.lineHeight}get textAlign(){return this.styles.textAlign}get textTransform(){return this.styles.textTransform}get textOverflow(){return this.styles.textOverflow}get textShadow(){return this.styles.textShadow}get textDecorationColor(){return this.styles.textDecorationColor}get textDecorationLine(){return this.styles.textDecorationLine}get textDecorationStyle(){return this.styles.textDecorationStyle}get textDecorationThickness(){return this.styles.textDecorationThickness}get textUnderlineOffset(){return this.styles.textUnderlineOffset}get wordBreak(){return this.styles.wordBreak}get lineBreak(){return this.styles.lineBreak}get overflowWrap(){return this.styles.overflowWrap}get writingMode(){return this.styles.writingMode}get direction(){return this.styles.direction}get webkitTextStrokeColor(){return this.styles.webkitTextStrokeColor}get webkitTextStrokeWidth(){return this.styles.webkitTextStrokeWidth}get webkitLineClamp(){return this.styles.webkitLineClamp}get paintOrder(){return this.styles.paintOrder}},_E=class{constructor(A){this.styles=A}get display(){return this.styles.display}get position(){return this.styles.position}get float(){return this.styles.float}get zIndex(){return this.styles.zIndex}get marginTop(){return this.styles.marginTop}get marginRight(){return this.styles.marginRight}get marginBottom(){return this.styles.marginBottom}get marginLeft(){return this.styles.marginLeft}get paddingTop(){return this.styles.paddingTop}get paddingRight(){return this.styles.paddingRight}get paddingBottom(){return this.styles.paddingBottom}get paddingLeft(){return this.styles.paddingLeft}get overflowX(){return this.styles.overflowX}get overflowY(){return this.styles.overflowY}get opacity(){return this.styles.opacity}get visibility(){return this.styles.visibility}get transform(){return this.styles.transform}get transformOrigin(){return this.styles.transformOrigin}get rotate(){return this.styles.rotate}get zoom(){return this.styles.zoom}get clipPath(){return this.styles.clipPath}get mixBlendMode(){return this.styles.mixBlendMode}get filter(){return this.styles.filter}get imageRendering(){return this.styles.imageRendering}get objectFit(){return this.styles.objectFit}get objectPosition(){return this.styles.objectPosition}get boxDecorationBreak(){return this.styles.boxDecorationBreak}get listStyleImage(){return this.styles.listStyleImage}get listStylePosition(){return this.styles.listStylePosition}get listStyleType(){return this.styles.listStyleType}get animationDuration(){return this.styles.animationDuration}isVisible(){return this.styles.isVisible()}isTransparent(){return this.styles.isTransparent()}isTransformed(){return this.styles.isTransformed()}isPositioned(){return this.styles.isPositioned()}isPositionedWithZIndex(){return this.styles.isPositionedWithZIndex()}isFloating(){return this.styles.isFloating()}isInlineLevel(){return this.styles.isInlineLevel()}},EE=(pr=class{get border(){return this._border??(this._border=new BE(this))}get background(){return this._background??(this._background=new yE(this))}get font(){return this._font??(this._font=new CE(this))}get layout(){return this._layout??(this._layout=new _E(this))}constructor(e,t){const r=pr.standardProps;if(t.display==="none"){this.display=0;for(const[i,o]of r)i!=="display"&&(this[i]=it(e,o,void 0));this.float=it(e,td,void 0),this.textDecorationColor=it(e,id,void 0),this.textDecorationLine=it(e,od,void 0);const s=it(e,rd,void 0);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0];return}for(const[s,i,o]of r)this[s]=it(e,i,t[o]);this.float=it(e,td,t.cssFloat),this.textDecorationColor=it(e,id,t.textDecorationColor??t.color),this.textDecorationLine=it(e,od,t.textDecorationLine??t.textDecoration);const n=it(e,rd,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0]}isVisible(){return this.display>0&&this.opacity>0&&this.visibility===0}isTransparent(){return _A(this.backgroundColor)}isTransformed(){return this.transform!==null||this.rotate!==null}isPositioned(){return this.position!==0}isPositionedWithZIndex(){return this.isPositioned()&&!this.zIndex.auto}isFloating(){return this.float!==0}isInlineLevel(){return Pe(this.display,4)||Pe(this.display,33554432)||Pe(this.display,268435456)||Pe(this.display,536870912)||Pe(this.display,67108864)||Pe(this.display,134217728)}},pr.standardProps=[["animationDuration",W0,"animationDuration"],["backgroundClip",B_,"backgroundClip"],["backgroundColor",y_,"backgroundColor"],["backgroundImage",I_,"backgroundImage"],["backgroundOrigin",F_,"backgroundOrigin"],["backgroundPosition",T_,"backgroundPosition"],["backgroundRepeat",S_,"backgroundRepeat"],["backgroundSize",x_,"backgroundSize"],["borderTopColor",L_,"borderTopColor"],["borderRightColor",D_,"borderRightColor"],["borderBottomColor",H_,"borderBottomColor"],["borderLeftColor",O_,"borderLeftColor"],["borderTopLeftRadius",P_,"borderTopLeftRadius"],["borderTopRightRadius",N_,"borderTopRightRadius"],["borderBottomRightRadius",M_,"borderBottomRightRadius"],["borderBottomLeftRadius",V_,"borderBottomLeftRadius"],["borderTopStyle",K_,"borderTopStyle"],["borderRightStyle",$_,"borderRightStyle"],["borderBottomStyle",j_,"borderBottomStyle"],["borderLeftStyle",G_,"borderLeftStyle"],["borderTopWidth",W_,"borderTopWidth"],["borderRightWidth",q_,"borderRightWidth"],["borderBottomWidth",J_,"borderBottomWidth"],["borderLeftWidth",z_,"borderLeftWidth"],["boxShadow",J0,"boxShadow"],["clipPath",A0,"clipPath"],["color",r0,"color"],["direction",n0,"direction"],["display",s0,"display"],["fontFamily",P0,"fontFamily"],["fontSize",N0,"fontSize"],["fontStyle",K0,"fontStyle"],["fontVariant",V0,"fontVariant"],["fontWeight",M0,"fontWeight"],["letterSpacing",o0,"letterSpacing"],["lineBreak",a0,"lineBreak"],["lineHeight",c0,"lineHeight"],["listStyleImage",l0,"listStyleImage"],["listStylePosition",u0,"listStylePosition"],["listStyleType",Ha,"listStyleType"],["marginTop",h0,"marginTop"],["marginRight",d0,"marginRight"],["marginBottom",f0,"marginBottom"],["marginLeft",g0,"marginLeft"],["opacity",L0,"opacity"],["overflowWrap",p0,"overflowWrap"],["paddingTop",w0,"paddingTop"],["paddingRight",m0,"paddingRight"],["paddingBottom",B0,"paddingBottom"],["paddingLeft",y0,"paddingLeft"],["paintOrder",z0,"paintOrder"],["position",_0,"position"],["textAlign",C0,"textAlign"],["textDecorationStyle",D0,"textDecorationStyle"],["textDecorationThickness",H0,"textDecorationThickness"],["textUnderlineOffset",O0,"textUnderlineOffset"],["textShadow",E0,"textShadow"],["textTransform",v0,"textTransform"],["textOverflow",AE,"textOverflow"],["transform",b0,"transform"],["transformOrigin",I0,"transformOrigin"],["rotate",F0,"rotate"],["visibility",T0,"visibility"],["webkitTextStrokeColor",X0,"webkitTextStrokeColor"],["webkitTextStrokeWidth",Y0,"webkitTextStrokeWidth"],["webkitLineClamp",Z0,"webkitLineClamp"],["wordBreak",S0,"wordBreak"],["writingMode",x0,"writingMode"],["zIndex",k0,"zIndex"],["objectFit",eE,"objectFit"],["imageRendering",rE,"imageRendering"],["mixBlendMode",sE,"mixBlendMode"],["filter",iE,"filter"],["fontVariantLigatures",aE,"fontVariantLigatures"],["zoom",cE,"zoom"],["objectPosition",lE,"objectPosition"],["backgroundBlendMode",hE,"backgroundBlendMode"],["borderImageSource",dE,"borderImageSource"],["borderImageSlice",gE,"borderImageSlice"],["borderImageRepeat",wE,"borderImageRepeat"],["boxDecorationBreak",mE,"boxDecorationBreak"]],pr),vE=class{constructor(A,e){this.content=it(A,$0,e.content),this.quotes=it(A,q0,e.quotes)}},ld=class{constructor(A,e){this.counterIncrement=it(A,j0,e.counterIncrement),this.counterReset=it(A,G0,e.counterReset)}};const ud=new Map,it=(A,e,t)=>{const r=t!==null&&typeof t<"u"?t.toString():e.initialValue;let n=ud.get(e);if(n){const a=n.get(r);if(a!==void 0)return n.delete(r),n.set(r,a),a}const s=Ia.get();s.write(r);const i=new yh(s.read());Ia.release(s);const o=(()=>{switch(e.type){case 2:{const a=i.parseComponentValue();return e.parse(A,J(a)?a.value:e.initialValue)}case 0:return e.parse(A,i.parseComponentValue());case 1:return e.parse(A,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(e.format){case"angle":return Fr.parse(A,i.parseComponentValue());case"color":return vA.parse(A,i.parseComponentValue());case"image":return Bi.parse(A,i.parseComponentValue());case"length":{const a=i.parseComponentValue();return CA(a)?a:ve}case"length-percentage":{const a=i.parseComponentValue();return oe(a)?a:ve}case"time":return sd.parse(A,i.parseComponentValue())}}})();if(n||(n=new Map,ud.set(e,n)),!(e.type===3&&e.format==="image")){if(n.size>=200){const a=n.keys().next().value;n.delete(a)}n.set(r,o)}return o},GA=A=>A.nodeType===Node.ELEMENT_NODE,hd=A=>A.nodeType===Node.TEXT_NODE,WA=A=>typeof A.className=="object",Rn=A=>GA(A)&&typeof A.style<"u"&&!WA(A),bE=A=>A.tagName==="INPUT",UE=A=>A.tagName==="HTML",dd=A=>A.tagName==="svg",Pa=A=>A.tagName==="BODY",fd=A=>A.tagName==="CANVAS",gd=A=>A.tagName==="VIDEO",Na=A=>A.tagName==="IMG",pd=A=>A.tagName==="IFRAME",wd=A=>A.tagName==="STYLE",QE=A=>A.tagName==="SCRIPT",Ui=A=>A.tagName==="TEXTAREA",Qi=A=>A.tagName==="SELECT",xn=A=>A.tagName==="SLOT",IE=A=>A.tagName==="LI",FE=A=>A.tagName==="OL",md=A=>!WA(A)&&A.tagName.indexOf("-")>0,TE=new Set(["IMG","VIDEO","AUDIO","CANVAS","IFRAME","INPUT","TEXTAREA","SELECT","BR","HR","META","LINK","BASE","COL","SOURCE","TRACK","WBR","AREA","PARAM","EMBED","OBJECT"]),SE=A=>!WA(A)&&!TE.has(A.tagName),RE="data-html2canvas-debug",xE=A=>{if(typeof A.getAttribute!="function")return 0;switch(A.getAttribute(RE)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Ma=(A,e)=>{const t=xE(A);return t===1||e===t};for(var Bd=class{static normalizeElement(A,e){const t={};return Rn(A)&&(e.animationDuration.some(r=>r>0)&&(t.animationDuration=A.style.animationDuration,A.style.animationDuration="0s"),e.transform!==null&&(t.transform=A.style.transform,A.style.transform="translate(0, 0)"),e.rotate!==null&&(t.rotate=A.style.rotate,A.style.rotate="0deg",t.transform===void 0&&(t.transform=A.style.transform,A.style.transform="translate(0, 0)"))),t}static restoreElement(A,e){Rn(A)&&(e.animationDuration!==void 0&&(A.style.animationDuration=e.animationDuration),e.transform!==void 0&&(A.style.transform=e.transform),e.rotate!==void 0&&(A.style.rotate=e.rotate))}},Wt=class{constructor(A,e,t={}){if(this.context=A,this.textNodes=[],this.elements=[],this.createsStackingContext=!1,this.createsRealStackingContext=!1,this.isListOwner=!1,this.debugRender=!1,Ma(e,3))debugger;this.styles=new EE(A,A.config.window.getComputedStyle(e,null)),t.normalizeDom!==!1&&Rn(e)&&(this.originalStyles=Bd.normalizeElement(e,this.styles),this.originalElement=e),this.bounds=js(this.context,e),Ma(e,4)&&(this.debugRender=!0)}restore(){this.originalStyles&&this.originalElement&&(Bd.restoreElement(this.originalElement,this.originalStyles),this.originalStyles=void 0,this.originalElement=void 0)}restoreTree(){this.restore();for(const A of this.elements)A.restoreTree()}},kE="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",yd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kn=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ii=0;Ii<yd.length;Ii++)kn[yd.charCodeAt(Ii)]=Ii;for(var LE=function(A){var e=A.length*.75,t=A.length,r,n=0,s,i,o,a;A[A.length-1]==="="&&(e--,A[A.length-2]==="="&&e--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(e):new Array(e),u=Array.isArray(l)?l:new Uint8Array(l);for(r=0;r<t;r+=4)s=kn[A.charCodeAt(r)],i=kn[A.charCodeAt(r+1)],o=kn[A.charCodeAt(r+2)],a=kn[A.charCodeAt(r+3)],u[n++]=s<<2|i>>4,u[n++]=(i&15)<<4|o>>2,u[n++]=(o&3)<<6|a&63;return l},DE=function(A){for(var e=A.length,t=[],r=0;r<e;r+=2)t.push(A[r+1]<<8|A[r]);return t},HE=function(A){for(var e=A.length,t=[],r=0;r<e;r+=4)t.push(A[r+3]<<24|A[r+2]<<16|A[r+1]<<8|A[r]);return t},qA=5,Va=11,Ka=2,OE=Va-qA,Cd=65536>>qA,$a=(1<<qA)-1,PE=Cd+(1024>>qA)+32,NE=65536>>Va,ME=(1<<OE)-1,_d=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},VE=function(A,e,t){return A.slice?A.slice(e,t):new Uint32Array(Array.prototype.slice.call(A,e,t))},KE=function(A,e){var t=LE(A),r=Array.isArray(t)?HE(t):new Uint32Array(t),n=Array.isArray(t)?DE(t):new Uint16Array(t),s=24,i=_d(n,s/2,r[4]/2),o=r[5]===2?_d(n,(s+r[4])/2):VE(r,Math.ceil((s+r[4])/4));return new $E(r[0],r[1],r[2],r[3],i,o)},$E=function(){function A(e,t,r,n,s,i){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=n,this.index=s,this.data=i}return A.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=this.index[e>>qA],t=(t<<Ka)+(e&$a),this.data[t];if(e<=65535)return t=this.index[Cd+(e-55296>>qA)],t=(t<<Ka)+(e&$a),this.data[t];if(e<this.highStart)return t=PE-NE+(e>>Va),t=this.index[t],t+=e>>qA&ME,t=this.index[t],t=(t<<Ka)+(e&$a),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Ed="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jE=typeof Uint8Array>"u"?[]:new Uint8Array(256),Fi=0;Fi<Ed.length;Fi++)jE[Ed.charCodeAt(Fi)]=Fi;var GE=1,ja=2,Ga=3,vd=4,bd=5,WE=7,Ud=8,Wa=9,qa=10,Qd=11,Id=12,Fd=13,Td=14,Ja=15,qE=function(A){for(var e=[],t=0,r=A.length;t<r;){var n=A.charCodeAt(t++);if(n>=55296&&n<=56319&&t<r){var s=A.charCodeAt(t++);(s&64512)===56320?e.push(((n&1023)<<10)+(s&1023)+65536):(e.push(n),t--)}else e.push(n)}return e},JE=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var r=[],n=-1,s="";++n<t;){var i=A[n];i<=65535?r.push(i):(i-=65536,r.push((i>>10)+55296,i%1024+56320)),(n+1===t||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},zE=KE(kE),yt="×",za="÷",XE=function(A){return zE.get(A)},YE=function(A,e,t){var r=t-2,n=e[r],s=e[t-1],i=e[t];if(s===ja&&i===Ga)return yt;if(s===ja||s===Ga||s===vd||i===ja||i===Ga||i===vd)return za;if(s===Ud&&[Ud,Wa,Qd,Id].indexOf(i)!==-1||(s===Qd||s===Wa)&&(i===Wa||i===qa)||(s===Id||s===qa)&&i===qa||i===Fd||i===bd||i===WE||s===GE)return yt;if(s===Fd&&i===Td){for(;n===bd;)n=e[--r];if(n===Td)return yt}if(s===Ja&&i===Ja){for(var o=0;n===Ja;)o++,n=e[--r];if(o%2===0)return yt}return za},ZE=function(A){var e=qE(A),t=e.length,r=0,n=0,s=e.map(XE);return{next:function(){if(r>=t)return{done:!0,value:null};for(var i=yt;r<t&&(i=YE(e,s,++r))===yt;);if(i!==yt||r===t){var o=JE.apply(null,e.slice(n,r));return n=r,{value:o,done:!1}}return{done:!0,value:null}}}},ev=function(A){for(var e=ZE(A),t=[],r;!(r=e.next()).done;)r.value&&t.push(r.value.slice());return t};const tv=A=>{if(A.createRange){const t=A.createRange();if(t.getBoundingClientRect){const r=A.createElement("boundtest");r.style.height="123px",r.style.display="block",A.body.appendChild(r),t.selectNode(r);const n=t.getBoundingClientRect(),s=Math.round(n.height);if(A.body.removeChild(r),s===123)return!0}}return!1},Av=A=>{const e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);const t=A.createRange();e.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";const r=e.firstChild,n=Gs(r.data).map(a=>Ee(a));let s=0,i={};const o=n.every((a,l)=>{t.setStart(r,s),t.setEnd(r,s+a.length);const u=t.getBoundingClientRect();s+=a.length;const d=u.x>i.x||u.y>i.y;return i=u,l===0?!0:d});return A.body.removeChild(e),o},rv=()=>typeof new Image().crossOrigin<"u",nv=()=>typeof new XMLHttpRequest().responseType=="string",sv=A=>{const e=new Image,t=A.createElement("canvas"),r=t.getContext("2d");if(!r)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(e,0,0),t.toDataURL()}catch{return!1}return!0},Sd=A=>A[0]===0&&A[1]===255&&A[2]===0&&A[3]===255,iv=A=>{const e=A.createElement("canvas"),t=100;e.width=t,e.height=t;const r=e.getContext("2d");if(!r)return Promise.reject(new Error("Failed to get 2D rendering context"));r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,t,t);const n=new Image,s=e.toDataURL();n.src=s;const i=Xa(t,t,0,0,n);return r.fillStyle="red",r.fillRect(0,0,t,t),Ya(i).then(o=>{r.drawImage(o,0,0);const a=r.getImageData(0,0,t,t).data;r.fillStyle="red",r.fillRect(0,0,t,t);const l=A.createElement("div");return l.style.backgroundImage=`url(${s})`,l.style.height=`${t}px`,Sd(a)?Ya(Xa(t,t,0,0,l)):Promise.reject(new Error("ForeignObject rendering not supported"))}).then(o=>(r.drawImage(o,0,0),Sd(r.getImageData(0,0,t,t).data))).catch(()=>!1)},Xa=(A,e,t,r,n)=>{const s="http://www.w3.org/2000/svg",i=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return i.setAttributeNS(null,"width",A.toString()),i.setAttributeNS(null,"height",e.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),i.appendChild(o),o.appendChild(n),i},Ya=A=>new Promise((e,t)=>{const r=new Image;r.onload=()=>e(r),r.onerror=t,r.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(A))}`}),Ne={get SUPPORT_RANGE_BOUNDS(){const A=tv(document);return Object.defineProperty(Ne,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){const A=Ne.SUPPORT_RANGE_BOUNDS&&Av(document);return Object.defineProperty(Ne,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){const A=sv(document);return Object.defineProperty(Ne,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){const A=typeof Array.from=="function"&&typeof window.fetch=="function"?iv(document):Promise.resolve(!1);return Object.defineProperty(Ne,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){const A=rv();return Object.defineProperty(Ne,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){const A=nv();return Object.defineProperty(Ne,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){const A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ne,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){const A=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Ne,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}};var JA=class{constructor(A,e){this.text=A,this.bounds=e}};const ov=(A,e,t,r)=>{const n=lv(e,t),s=[];let i=0;return n.forEach(o=>{if(t.textDecorationLine.length||o.trim().length>0)if(Ne.SUPPORT_RANGE_BOUNDS){const a=Rd(r,i,o.length).getClientRects();if(a.length>1){const l=Sr(o);let u=0;l.forEach(d=>{s.push(new JA(d,rA.fromDOMRectList(A,Rd(r,u+i,d.length).getClientRects()))),u+=d.length})}else s.push(new JA(o,rA.fromDOMRectList(A,a)))}else{const a=r.splitText(o.length);s.push(new JA(o,av(A,r))),r=a}else Ne.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));i+=o.length}),s},av=(A,e)=>{const t=e.ownerDocument;if(t){const r=t.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));const n=e.parentNode;if(n){n.replaceChild(r,e);const s=js(A,r);return r.firstChild&&n.replaceChild(r.firstChild,r),s}}return rA.EMPTY},Rd=(A,e,t)=>{const r=A.ownerDocument;if(!r)throw new Error("Node has no owner document");const n=r.createRange();return n.setStart(A,e),n.setEnd(A,e+t),n},Sr=A=>{if(Ne.SUPPORT_NATIVE_TEXT_SEGMENTATION){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(t=>t.segment)}return ev(A)},cv=(A,e)=>{if(Ne.SUPPORT_NATIVE_TEXT_SEGMENTATION){const t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(r=>r.segment)}return hv(A,e)},lv=(A,e)=>Oa(e.writingMode)||e.letterSpacing!==0?Sr(A):cv(A,e),uv=[32,160,4961,65792,65793,4153,4241],hv=(A,e)=>{const t=wy(A,{lineBreak:e.lineBreak,wordBreak:e.overflowWrap==="break-word"?"break-word":e.wordBreak}),r=[];let n;for(;!(n=t.next()).done;)if(n.value){const s=Gs(n.value.slice());let i="";s.forEach(o=>{uv.indexOf(o)===-1?i+=Ee(o):(i.length&&r.push(i),r.push(Ee(o)),i="")}),i.length&&r.push(i)}return r};var dv=class{constructor(A,e,t){this.text=fv(e.data,t.textTransform),this.text.length!==e.data.length&&(e.data=this.text),this.textBounds=ov(A,this.text,t,e)}};const fv=(A,e)=>{switch(e){case 1:return A.toLowerCase();case 3:return A.replace(gv,pv);case 2:return A.toUpperCase();default:return A}},gv=/(^|\s|:|-|\(|\))([a-z])/g,pv=(A,e,t)=>A.length>0?e+t.toUpperCase():A;var xd=class extends Wt{constructor(A,e){super(A,e),this.src=e.currentSrc||e.src,this.intrinsicWidth=e.naturalWidth,this.intrinsicHeight=e.naturalHeight,this.context.cache.addImage(this.src)}},kd=class extends Wt{constructor(A,e){super(A,e),this.canvas=e,this.intrinsicWidth=e.width,this.intrinsicHeight=e.height}},Ld=class extends Wt{constructor(A,e){super(A,e);const t=new XMLSerializer,r=js(A,e);e.setAttribute("width",`${r.width}px`),e.setAttribute("height",`${r.height}px`),this.svg=`data:image/svg+xml,${encodeURIComponent(t.serializeToString(e))}`,this.intrinsicWidth=e.width.baseVal.value,this.intrinsicHeight=e.height.baseVal.value,this.context.cache.addImage(this.svg)}},Dd=class extends Wt{constructor(A,e){super(A,e),this.value=e.value}},Za=class extends Wt{constructor(A,e){super(A,e),this.start=e.start,this.reversed=typeof e.reversed=="boolean"&&e.reversed===!0}};const wv=[{type:15,flags:0,unit:"px",number:3}],mv=[{type:16,flags:0,number:50}],Bv=A=>A.width>A.height?new rA(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width<A.height?new rA(A.left,A.top+(A.height-A.width)/2,A.width,A.width):A,yv=A=>{const e=A.type==="password"?new Array(A.value.length+1).join("•"):A.value;return e.length===0?A.placeholder||"":e},Cv=A=>A.value.length===0&&!!A.placeholder,_v="checkbox",Ev="radio",Hd=707406591,vv=1970632191;var Ln=class extends Wt{constructor(A,e){switch(super(A,e),this.type=e.type.toLowerCase(),this.checked=e.checked,this.value=yv(e),this.isPlaceholder=Cv(e),(this.type==="checkbox"||this.type==="radio")&&(this.styles.backgroundColor=3739148031,this.styles.borderTopColor=this.styles.borderRightColor=this.styles.borderBottomColor=this.styles.borderLeftColor=2779096575,this.styles.borderTopWidth=this.styles.borderRightWidth=this.styles.borderBottomWidth=this.styles.borderLeftWidth=1,this.styles.borderTopStyle=this.styles.borderRightStyle=this.styles.borderBottomStyle=this.styles.borderLeftStyle=1,this.styles.backgroundClip=[0],this.styles.backgroundOrigin=[0],this.bounds=Bv(this.bounds)),this.type){case _v:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=wv;break;case Ev:this.styles.borderTopRightRadius=this.styles.borderTopLeftRadius=this.styles.borderBottomRightRadius=this.styles.borderBottomLeftRadius=mv;break}}},Od=class extends Wt{constructor(A,e){super(A,e);const t=e.options[e.selectedIndex||0];this.value=t&&t.text||""}},Pd=class extends Wt{constructor(A,e){super(A,e),this.value=e.value}},Nd=class extends Wt{constructor(A,e,t){super(A,e),this.src=e.src,this.width=parseInt(e.width,10)||0,this.height=parseInt(e.height,10)||0,this.backgroundColor=this.styles.backgroundColor,this.parseTreeFn=t;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement&&this.parseTreeFn){this.tree=this.parseTreeFn(A,e.contentWindow.document.documentElement);const r=e.contentWindow.document.documentElement?Tr(A,getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):Gt.TRANSPARENT,n=e.contentWindow.document.body?Tr(A,getComputedStyle(e.contentWindow.document.body).backgroundColor):Gt.TRANSPARENT;this.backgroundColor=_A(r)?_A(n)?this.styles.backgroundColor:n:r}}catch{}}};const bv=["OL","UL","MENU"],Ti=(A,e,t,r)=>{for(let n=e.firstChild,s;n;n=s)if(s=n.nextSibling,hd(n)&&n.data.length>0)t.textNodes.push(new dv(A,n,t.styles));else if(GA(n))if(xn(n)&&n.assignedNodes)n.assignedNodes().forEach(i=>Ti(A,i,t,r));else{const i=Md(A,n);i.styles.isVisible()&&(Uv(n,i,r)?i.createsRealStackingContext=!0:Qv(i.styles)&&(i.createsStackingContext=!0),bv.indexOf(n.tagName)!==-1&&(i.isListOwner=!0),t.elements.push(i),n.shadowRoot?Ti(A,n.shadowRoot,i,r):!Ui(n)&&!dd(n)&&!Qi(n)&&Ti(A,n,i,r))}},Md=(A,e)=>Na(e)?new xd(A,e):fd(e)?new kd(A,e):dd(e)?new Ld(A,e):IE(e)?new Dd(A,e):FE(e)?new Za(A,e):bE(e)?new Ln(A,e):Qi(e)?new Od(A,e):Ui(e)?new Pd(A,e):pd(e)?new Nd(A,e,Vd):new Wt(A,e),Vd=(A,e)=>{const t=Md(A,e);return t.createsRealStackingContext=!0,Ti(A,e,t,t),t},Uv=(A,e,t)=>e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Pa(A)&&t.styles.isTransparent(),Qv=A=>A.isPositioned()||A.isFloating()?!0:Pe(A.display,268435456)||Pe(A.display,33554432)||Pe(A.display,536870912)||Pe(A.display,134217728);var Iv=class{constructor(){this.counters={}}getCounterValue(A){const e=this.counters[A];return e&&e.length?e[e.length-1]:1}getCounterValues(A){const e=this.counters[A];return e||[]}pop(A){A.forEach(e=>this.counters[e].pop())}parse(A){const e=A.counterIncrement,t=A.counterReset;let r=!0;e!==null&&e.forEach(s=>{const i=this.counters[s.counter];i&&s.increment!==0&&(r=!1,i.length||i.push(1),i[Math.max(0,i.length-1)]+=s.increment)});const n=[];return r&&t.forEach(s=>{let i=this.counters[s.counter];n.push(s.counter),i||(i=this.counters[s.counter]=[]),i.push(s.reset)}),n}};const Kd={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},$d={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Fv={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Tv={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Rr=(A,e,t,r,n,s)=>A<e||A>t?Dn(A,n,s.length>0):r.integers.reduce((i,o,a)=>{for(;A>=o;)A-=o,i+=r.values[a];return i},"")+s,jd=(A,e,t,r)=>{let n="";do t||A--,n=r(A)+n,A/=e;while(A*e>=e);return n},be=(A,e,t,r,n)=>{const s=t-e+1;return(A<0?"-":"")+(jd(Math.abs(A),s,r,i=>Ee(Math.floor(i%s)+e))+n)},zA=(A,e,t=". ")=>{const r=e.length;return jd(Math.abs(A),r,!1,n=>e[Math.floor(n%r)])+t},Sv=1,Rv=2,xv=4,kv=8,iA=(A,e,t,r,n,s)=>{if(A<-9999||A>9999)return Dn(A,4,n.length>0);let i=Math.abs(A),o=n;if(i===0)return e[0]+o;for(let a=0;i>0&&a<=4;a++){const l=i%10;l===0&&Pe(s,Sv)&&o!==""?o=e[l]+o:l>1||l===1&&a===0||l===1&&a===1&&Pe(s,Rv)||l===1&&a===1&&Pe(s,xv)&&A>100||l===1&&a>1&&Pe(s,kv)?o=e[l]+(a>0?t[a-1]:"")+o:l===1&&a>0&&(o=t[a-1]+o),i=Math.floor(i/10)}return(A<0?r:"")+o},Gd="十百千萬",Wd="拾佰仟萬",qd="マイナス",ec="마이너스",Dn=(A,e,t)=>{const r=t?". ":"",n=t?"、":"",s=t?", ":"",i=t?" ":"";switch(e){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:const o=be(A,48,57,!0,r);return o.length<4?`0${o}`:o;case 4:return zA(A,"〇一二三四五六七八九",n);case 6:return Rr(A,1,3999,Kd,3,r).toLowerCase();case 7:return Rr(A,1,3999,Kd,3,r);case 8:return be(A,945,969,!1,r);case 9:return be(A,97,122,!1,r);case 10:return be(A,65,90,!1,r);case 11:return be(A,1632,1641,!0,r);case 12:case 49:return Rr(A,1,9999,$d,3,r);case 35:return Rr(A,1,9999,$d,3,r).toLowerCase();case 13:return be(A,2534,2543,!0,r);case 14:case 30:return be(A,6112,6121,!0,r);case 15:return zA(A,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return zA(A,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return iA(A,"零一二三四五六七八九",Gd,"負",n,14);case 47:return iA(A,"零壹貳參肆伍陸柒捌玖",Wd,"負",n,15);case 42:return iA(A,"零一二三四五六七八九",Gd,"负",n,14);case 41:return iA(A,"零壹贰叁肆伍陆柒捌玖",Wd,"负",n,15);case 26:return iA(A,"〇一二三四五六七八九","十百千万",qd,n,0);case 25:return iA(A,"零壱弐参四伍六七八九","拾百千万",qd,n,7);case 31:return iA(A,"영일이삼사오육칠팔구","십백천만",ec,s,7);case 33:return iA(A,"零一二三四五六七八九","十百千萬",ec,s,0);case 32:return iA(A,"零壹貳參四五六七八九","拾百千",ec,s,7);case 18:return be(A,2406,2415,!0,r);case 20:return Rr(A,1,19999,Tv,3,r);case 21:return be(A,2790,2799,!0,r);case 22:return be(A,2662,2671,!0,r);case 52:return Rr(A,1,10999,Fv,3,r);case 23:return zA(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return zA(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return be(A,3302,3311,!0,r);case 28:return zA(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return zA(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return be(A,3792,3801,!0,r);case 37:return be(A,6160,6169,!0,r);case 38:return be(A,4160,4169,!0,r);case 39:return be(A,2918,2927,!0,r);case 40:return be(A,1776,1785,!0,r);case 43:return be(A,3046,3055,!0,r);case 44:return be(A,3174,3183,!0,r);case 45:return be(A,3664,3673,!0,r);case 46:return be(A,3872,3881,!0,r);default:return be(A,48,57,!0,r)}},Lv="data-html2canvas-ignore";var Dv=class{constructor(A,e,t){this.cloneNodeFn=A,this.options=e,this.context=t}appendChildNode(A,e,t){this.safeAppendClonedChild(A,e,t)}cloneChildNodes(A,e,t){A.shadowRoot&&e.shadowRoot?(this.cloneShadowDOMChildren(A.shadowRoot,e.shadowRoot,t),this.cloneLightDOMChildren(A,e,t)):A.shadowRoot&&!e.shadowRoot?this.cloneShadowDOMAsLightDOM(A.shadowRoot,e,t):this.cloneLightDOMChildren(A,e,t)}shouldCloneChild(A){return!GA(A)||!QE(A)&&!A.hasAttribute("data-html2canvas-ignore")&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(A))}shouldCloneStyleElement(A){return!this.options.copyStyles||!GA(A)||!wd(A)}safeAppendClonedChild(A,e,t){this.shouldCloneChild(e)&&this.shouldCloneStyleElement(e)&&A.appendChild(this.cloneNodeFn(e,t))}cloneAssignedNodes(A,e,t){A.forEach(r=>{this.safeAppendClonedChild(e,r,t)})}cloneSlotFallbackContent(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)this.safeAppendClonedChild(e,r,t)}cloneSlotElement(A,e,t){if(!xn(A))return;const r=A;if(typeof r.assignedNodes!="function"){this.context.logger.warn("HTMLSlotElement.assignedNodes is not available",A),this.cloneSlotFallbackContent(A,e,t);return}const n=r.assignedNodes();if(!n||!Array.isArray(n)){this.context.logger.warn("assignedNodes() did not return a valid array",A),this.cloneSlotFallbackContent(A,e,t);return}n.length>0?this.cloneAssignedNodes(n,e,t):this.cloneSlotFallbackContent(A,e,t)}cloneShadowDOMChildren(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)GA(r)&&xn(r)?this.cloneSlotElement(r,e,t):this.safeAppendClonedChild(e,r,t)}cloneLightDOMChildren(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)this.appendChildNode(e,r,t)}cloneSlotElementAsLightDOM(A,e,t){if(!xn(A))return;const r=A;if(typeof r.assignedNodes!="function"){for(let s=A.firstChild;s;s=s.nextSibling)this.appendChildNode(e,s,t);return}const n=r.assignedNodes();if(n&&Array.isArray(n)&&n.length>0)n.forEach(s=>this.appendChildNode(e,s,t));else for(let s=A.firstChild;s;s=s.nextSibling)this.appendChildNode(e,s,t)}cloneShadowDOMAsLightDOM(A,e,t){for(let r=A.firstChild;r;r=r.nextSibling)GA(r)&&xn(r)?this.cloneSlotElementAsLightDOM(r,e,t):this.appendChildNode(e,r,t)}};const Hv=A=>{let e=A;for(;e;){if(e.parentNode&&e.parentNode.host)return e.parentNode;const t=e.getRootNode();if(t&&t!==e.ownerDocument&&t.host)return t;e=e.parentNode}return null};var tc=class{constructor(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Iv,this.quoteDepth=0,this.slotCloner=new Dv((r,n)=>this.cloneNode(r,n),{ignoreElements:t.ignoreElements,copyStyles:t.copyStyles??!0},A),!e.ownerDocument)throw new Error("Cloned element does not have an owner document");if(!this.options.iframeContainer){const r=Hv(e);r&&(this.options.iframeContainer=r)}this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}toIFrame(A,e){var d,g;const t=Ov(A,e,this.options.iframeContainer);if(!t.contentWindow)throw new Error("Unable to find iframe window");const r=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,s=t.contentWindow,i=s.document,o=Mv(t).then(async()=>{this.scrolledElements.forEach(jv),s&&(s.scrollTo(e.left,e.top),/AppleWebKit/g.test(navigator.userAgent)&&(s.scrollY!==e.top||s.scrollX!==e.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.scrollY-e.top,0,0)));const p=this.options.onclone,w=this.clonedReferenceElement;if(typeof w>"u")throw new Error(`Error finding the ${this.referenceElement.nodeName} in the cloned document`);return i.fonts&&i.fonts.ready&&await i.fonts.ready,/(AppleWebKit)/g.test(navigator.userAgent)&&await Nv(i),typeof p=="function"?Promise.resolve().then(()=>p(i,w)).then(()=>t):t}),a=A.baseURI;i.open();const l=Kv(document.doctype)+"<html></html>";try{const p=(d=this.referenceElement.ownerDocument)==null?void 0:d.defaultView,w=p&&p.trustedTypes;let y=(g=w==null?void 0:w.getPolicy)==null?void 0:g.call(w,"html2canvas-pro");!y&&w&&(y=w.createPolicy("html2canvas-pro",{createHTML:b=>b}));const B=y?y.createHTML(l):l;i.write(B)}catch{i.write(l)}$v(this.referenceElement.ownerDocument,r,n),i.close();const u=i.adoptNode(this.documentElement);return zv(u,a),i.replaceChild(u,i.documentElement),o}createElementClone(A){if(Ma(A,2))debugger;if(fd(A))return this.createCanvasClone(A);if(gd(A))return this.createVideoClone(A);if(wd(A))return this.createStyleClone(A);const e=A.cloneNode(!1);return Na(e)&&(Na(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager")),md(e)&&!WA(e)?this.createCustomElementClone(e):e}createCustomElementClone(A){const e=document.createElement("div");if(e.className=A.className,Ac(A.style,e),A.shadowRoot)try{e.attachShadow({mode:"open"})}catch(t){this.context.logger.error("Failed to attach shadow root to custom element clone:",t)}return e}createStyleClone(A){try{const t=A.sheet;if(t&&t.cssRules){const r=[].slice.call(t.cssRules,0).reduce((s,i)=>i&&typeof i.cssText=="string"?s+i.cssText:s,""),n=A.cloneNode(!1);return n.textContent=r,this.options.cspNonce&&(n.nonce=this.options.cspNonce),n}}catch(t){if(this.context.logger.error("Unable to access cssRules property",t),t.name!=="SecurityError")throw t}const e=A.cloneNode(!1);return this.options.cspNonce&&(e.nonce=this.options.cspNonce),e}createCanvasClone(A){var t;if(this.options.inlineImages&&A.ownerDocument){const r=A.ownerDocument.createElement("img");try{return r.src=A.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}const e=A.cloneNode(!1);try{e.width=A.width,e.height=A.height;const r=A.getContext("2d"),n=e.getContext("2d",{willReadFrequently:!0});if(n)if(!this.options.allowTaint&&r)n.putImageData(r.getImageData(0,0,A.width,A.height),0,0);else{const s=A.getContext("webgl2")??A.getContext("webgl");s&&((t=s.getContextAttributes())==null?void 0:t.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A),n.drawImage(A,0,0)}return e}catch{this.context.logger.info("Unable to clone canvas as it is tainted",A)}return e}createVideoClone(A){const e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;const t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch{this.context.logger.info("Unable to clone video as it is tainted",A)}const r=A.ownerDocument.createElement("canvas");return r.width=A.offsetWidth,r.height=A.offsetHeight,r}appendChildNode(A,e,t){this.slotCloner.appendChildNode(A,e,t)}cloneChildNodes(A,e,t){this.slotCloner.cloneChildNodes(A,e,t)}cloneNode(A,e){if(hd(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);const t=A.ownerDocument.defaultView;if(t&&GA(A)&&(Rn(A)||WA(A))){const r=this.createElementClone(A);r.style.transitionProperty="none";const n=t.getComputedStyle(A),s=SE(A);this.referenceElement===A&&Rn(r)&&(this.clonedReferenceElement=r),Pa(r)&&qv(r,this.options.cspNonce);const i=this.counters.parse(new ld(this.context,n));if(s){const o=t.getComputedStyle(A,":before"),a=this.resolvePseudoContent(A,r,o,0);a&&r.insertBefore(a,r.firstChild);const l=t.getComputedStyle(A,":after"),u=this.resolvePseudoContent(A,r,l,1);u&&r.appendChild(u)}return md(A)&&(e=!0),gd(A)||this.cloneChildNodes(A,r,e),this.counters.pop(i),(n&&(this.options.copyStyles||WA(A))&&!pd(A)||e)&&Ac(n,r),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([r,A.scrollLeft,A.scrollTop]),(Ui(A)||Qi(A))&&(Ui(r)||Qi(r))&&(r.value=A.value),r}return A.cloneNode(!1)}resolvePseudoContent(A,e,t,r){if(!t)return;const n=t.content,s=e.ownerDocument;if(!s||!n||n==="none"||n==="-moz-alt-content"||t.display==="none")return;this.counters.parse(new ld(this.context,t));const i=new vE(this.context,t),o=s.createElement("html2canvaspseudoelement");Ac(t,o),i.content.forEach(l=>{if(l.type===0)o.appendChild(s.createTextNode(l.value));else if(l.type===22){const u=s.createElement("img");u.src=l.value,u.style.opacity="1",o.appendChild(u)}else if(l.type===18){if(l.name==="attr"){const u=l.values.filter(J);u.length&&o.appendChild(s.createTextNode(A.getAttribute(u[0].value)||""))}else if(l.name==="counter"){const[u,d]=l.values.filter(ke);if(u&&J(u)){const g=this.counters.getCounterValue(u.value),p=d&&J(d)?Ha.parse(this.context,d.value):3;o.appendChild(s.createTextNode(Dn(g,p,!1)))}}else if(l.name==="counters"){const[u,d,g]=l.values.filter(ke);if(u&&J(u)){const p=this.counters.getCounterValues(u.value),w=g&&J(g)?Ha.parse(this.context,g.value):3,y=d&&d.type===0?d.value:"",B=p.map(b=>Dn(b,w,!1)).join(y);o.appendChild(s.createTextNode(B))}}}else if(l.type===20)switch(l.value){case"open-quote":o.appendChild(s.createTextNode(cd(i.quotes,this.quoteDepth++,!0)));break;case"close-quote":o.appendChild(s.createTextNode(cd(i.quotes,--this.quoteDepth,!1)));break;default:o.appendChild(s.createTextNode(l.value))}}),o.className=`${rc} ${nc}`;const a=r===0?` ${rc}`:` ${nc}`;return WA(e)?e.className.baseValue+=a:e.className+=a,o}static destroy(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1}};const Ov=(A,e,t)=>{const r=A.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=e.width.toString(),r.height=e.height.toString(),r.scrolling="no",r.setAttribute(Lv,"true"),(t||A.body).appendChild(r),r},Pv=A=>new Promise(e=>{if(A.complete){e();return}if(!A.src){e();return}A.onload=e,A.onerror=e}),Nv=A=>Promise.all([].slice.call(A.images,0).map(Pv)),Mv=A=>new Promise((e,t)=>{const r=A.contentWindow;if(!r)return t("No window assigned for iframe");const n=r.document;r.onload=A.onload=()=>{r.onload=A.onload=null;const s=600;let i=0;const o=setInterval(()=>{i++,(n.body.childNodes.length>0&&n.readyState==="complete"||i>=s)&&(clearInterval(o),e(A))},50)}}),Vv=["all","d","content"],Ac=(A,e)=>{const t=[];for(let r=A.length-1;r>=0;r--){const n=A.item(r);if(Vv.indexOf(n)===-1&&!n.startsWith("--")){const s=A.getPropertyValue(n);if(s){const i=A.getPropertyPriority(n);t.push(i?`${n}:${s} !${i}`:`${n}:${s}`)}}}return t.length>0&&(e.style.cssText=t.join(";")+";"),e},Kv=A=>{let e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=" "+A.internalSubset.replace(/"/g,"&quot;").replace(/>/g,"&gt;")),A.publicId?(e+=' PUBLIC "'+A.publicId.replace(/"/g,"&quot;")+'"',A.systemId&&(e+=' "'+A.systemId.replace(/"/g,"&quot;")+'"')):A.systemId&&(e+=' SYSTEM "'+A.systemId.replace(/"/g,"&quot;")+'"'),e+=">"),e},$v=(A,e,t)=>{A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},jv=([A,e,t])=>{A.scrollLeft=e,A.scrollTop=t},Gv=":before",Wv=":after",rc="___html2canvas___pseudoelement_before",nc="___html2canvas___pseudoelement_after",Jd=`{
778
778
  content: "" !important;
779
779
  display: none !important;
780
- }`,qv=(A,e)=>{Jv(A,`.${nc}${Gv}${Jd}
781
- .${sc}${Wv}${Jd}`,e)},Jv=(A,e,t)=>{const r=A.ownerDocument;if(r){const n=r.createElement("style");n.textContent=e,t&&(n.nonce=t),A.appendChild(n)}},zv=(A,e)=>{const t=A.ownerDocument.createElement("base");t.href=e;const r=A.getElementsByTagName("head").item(0);r==null||r.insertBefore(t,(r==null?void 0:r.firstChild)??null)},zd=(A,e)=>A.length===e.length?A.some((t,r)=>t===e[r]):!1,Xv=(A,e,t,r,n)=>A.map((s,i)=>{switch(i){case 0:return s.add(e,t);case 1:return s.add(e+r,t);case 2:return s.add(e+r,t+n);case 3:return s.add(e,t+n)}return s});var O=class pB{constructor(e,t){this.type=0,this.x=e,this.y=t}add(e,t){return new pB(this.x+e,this.y+t)}};const Rr=(A,e,t)=>new O(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t);var Ri=class $s{constructor(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}subdivide(e,t){const r=Rr(this.start,this.startControl,e),n=Rr(this.startControl,this.endControl,e),s=Rr(this.endControl,this.end,e),i=Rr(r,n,e),o=Rr(n,s,e),a=Rr(i,o,e);return t?new $s(this.start,r,i,a):new $s(a,o,s,this.end)}add(e,t){return new $s(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))}reverse(){return new $s(this.end,this.endControl,this.startControl,this.start)}};const Ct=A=>A.type===1;var Yv=class{constructor(A){const e=A.styles,t=A.bounds;let[r,n]=Fn(e.borderTopLeftRadius,t.width,t.height),[s,i]=Fn(e.borderTopRightRadius,t.width,t.height),[o,a]=Fn(e.borderBottomRightRadius,t.width,t.height),[l,u]=Fn(e.borderBottomLeftRadius,t.width,t.height);const d=[];d.push((r+s)/t.width),d.push((l+o)/t.width),d.push((n+u)/t.height),d.push((i+a)/t.height);const g=Math.max(...d);g>1&&(r/=g,n/=g,s/=g,i/=g,o/=g,a/=g,l/=g,u/=g);const p=t.width-s,w=t.height-a,y=t.width-o,B=t.height-u,b=e.borderTopWidth,S=e.borderRightWidth,I=e.borderBottomWidth,R=e.borderLeftWidth,K=G(e.paddingTop,A.bounds.width),P=G(e.paddingRight,A.bounds.width),_=G(e.paddingBottom,A.bounds.width),C=G(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||n>0?ge(t.left+R/3,t.top+b/3,r-R/3,n-b/3,0):new O(t.left+R/3,t.top+b/3),this.topRightBorderDoubleOuterBox=r>0||n>0?ge(t.left+p,t.top+b/3,s-S/3,i-b/3,1):new O(t.left+t.width-S/3,t.top+b/3),this.bottomRightBorderDoubleOuterBox=o>0||a>0?ge(t.left+y,t.top+w,o-S/3,a-I/3,2):new O(t.left+t.width-S/3,t.top+t.height-I/3),this.bottomLeftBorderDoubleOuterBox=l>0||u>0?ge(t.left+R/3,t.top+B,l-R/3,u-I/3,3):new O(t.left+R/3,t.top+t.height-I/3),this.topLeftBorderDoubleInnerBox=r>0||n>0?ge(t.left+R*2/3,t.top+b*2/3,r-R*2/3,n-b*2/3,0):new O(t.left+R*2/3,t.top+b*2/3),this.topRightBorderDoubleInnerBox=r>0||n>0?ge(t.left+p,t.top+b*2/3,s-S*2/3,i-b*2/3,1):new O(t.left+t.width-S*2/3,t.top+b*2/3),this.bottomRightBorderDoubleInnerBox=o>0||a>0?ge(t.left+y,t.top+w,o-S*2/3,a-I*2/3,2):new O(t.left+t.width-S*2/3,t.top+t.height-I*2/3),this.bottomLeftBorderDoubleInnerBox=l>0||u>0?ge(t.left+R*2/3,t.top+B,l-R*2/3,u-I*2/3,3):new O(t.left+R*2/3,t.top+t.height-I*2/3),this.topLeftBorderStroke=r>0||n>0?ge(t.left+R/2,t.top+b/2,r-R/2,n-b/2,0):new O(t.left+R/2,t.top+b/2),this.topRightBorderStroke=r>0||n>0?ge(t.left+p,t.top+b/2,s-S/2,i-b/2,1):new O(t.left+t.width-S/2,t.top+b/2),this.bottomRightBorderStroke=o>0||a>0?ge(t.left+y,t.top+w,o-S/2,a-I/2,2):new O(t.left+t.width-S/2,t.top+t.height-I/2),this.bottomLeftBorderStroke=l>0||u>0?ge(t.left+R/2,t.top+B,l-R/2,u-I/2,3):new O(t.left+R/2,t.top+t.height-I/2),this.topLeftBorderBox=r>0||n>0?ge(t.left,t.top,r,n,0):new O(t.left,t.top),this.topRightBorderBox=s>0||i>0?ge(t.left+p,t.top,s,i,1):new O(t.left+t.width,t.top),this.bottomRightBorderBox=o>0||a>0?ge(t.left+y,t.top+w,o,a,2):new O(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=l>0||u>0?ge(t.left,t.top+B,l,u,3):new O(t.left,t.top+t.height),this.topLeftPaddingBox=r>0||n>0?ge(t.left+R,t.top+b,Math.max(0,r-R),Math.max(0,n-b),0):new O(t.left+R,t.top+b),this.topRightPaddingBox=s>0||i>0?ge(t.left+Math.min(p,t.width-S),t.top+b,p>t.width+S?0:Math.max(0,s-S),Math.max(0,i-b),1):new O(t.left+t.width-S,t.top+b),this.bottomRightPaddingBox=o>0||a>0?ge(t.left+Math.min(y,t.width-R),t.top+Math.min(w,t.height-I),Math.max(0,o-S),Math.max(0,a-I),2):new O(t.left+t.width-S,t.top+t.height-I),this.bottomLeftPaddingBox=l>0||u>0?ge(t.left+R,t.top+Math.min(B,t.height-I),Math.max(0,l-R),Math.max(0,u-I),3):new O(t.left+R,t.top+t.height-I),this.topLeftContentBox=r>0||n>0?ge(t.left+R+C,t.top+b+K,Math.max(0,r-(R+C)),Math.max(0,n-(b+K)),0):new O(t.left+R+C,t.top+b+K),this.topRightContentBox=s>0||i>0?ge(t.left+Math.min(p,t.width+R+C),t.top+b+K,p>t.width+R+C?0:s-R+C,i-(b+K),1):new O(t.left+t.width-(S+P),t.top+b+K),this.bottomRightContentBox=o>0||a>0?ge(t.left+Math.min(y,t.width-(R+C)),t.top+Math.min(w,t.height+b+K),Math.max(0,o-(S+P)),a-(I+_),2):new O(t.left+t.width-(S+P),t.top+t.height-(I+_)),this.bottomLeftContentBox=l>0||u>0?ge(t.left+R+C,t.top+B,Math.max(0,l-(R+C)),u-(I+_),3):new O(t.left+R+C,t.top+t.height-(I+_))}};const ge=(A,e,t,r,n)=>{const s=4*((Math.sqrt(2)-1)/3),i=t*s,o=r*s,a=A+t,l=e+r;switch(n){case 0:return new Ri(new O(A,l),new O(A,l-o),new O(a-i,e),new O(a,e));case 1:return new Ri(new O(A,e),new O(A+i,e),new O(a,l-o),new O(a,l));case 2:return new Ri(new O(a,e),new O(a,e+o),new O(A+i,l),new O(A,l));default:return new Ri(new O(a,l),new O(a-i,l),new O(A,e+o),new O(A,e))}},xi=A=>[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox],Zv=A=>[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox],ki=A=>[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox];var ic=class{constructor(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}},Li=class{constructor(A,e){this.path=A,this.target=e,this.type=1}},eb=class{constructor(A){this.opacity=A,this.type=2,this.target=6}},Hn=class{constructor(A){this.applyClip=A,this.type=3,this.target=6}};const tb={[Le.NORMAL]:"source-over",[Le.MULTIPLY]:"multiply",[Le.SCREEN]:"screen",[Le.OVERLAY]:"overlay",[Le.DARKEN]:"darken",[Le.LIGHTEN]:"lighten",[Le.COLOR_DODGE]:"color-dodge",[Le.COLOR_BURN]:"color-burn",[Le.HARD_LIGHT]:"hard-light",[Le.SOFT_LIGHT]:"soft-light",[Le.DIFFERENCE]:"difference",[Le.EXCLUSION]:"exclusion",[Le.HUE]:"hue",[Le.SATURATION]:"saturation",[Le.COLOR]:"color",[Le.LUMINOSITY]:"luminosity"};var Ab=class{constructor(A){this.mixBlendMode=A,this.type=4,this.target=6,this.compositeOperation=tb[A]}},rb=class{constructor(A){this.filterString=A,this.type=5,this.target=6}};const nb=A=>A.type===0,Xd=A=>A.type===1,sb=A=>A.type===2,ib=A=>A.type===3,ob=A=>A.type===4,ab=A=>A.type===5;var Yd=class{constructor(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}},Zd=class{constructor(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Yv(this.container),this.container.styles.opacity<1&&this.effects.push(new eb(this.container.styles.opacity)),this.container.styles.rotate!==null){const t=this.container.styles.transformOrigin,r=this.container.bounds.left+G(t[0],this.container.bounds.width),n=this.container.bounds.top+G(t[1],this.container.bounds.height),s=this.container.styles.rotate*Math.PI/180,i=Math.cos(s),o=Math.sin(s),a=[i,o,-o,i,0,0];this.effects.push(new ic(r,n,a))}if(this.container.styles.transform!==null){const t=this.container.styles.transformOrigin,r=this.container.bounds.left+G(t[0],this.container.bounds.width),n=this.container.bounds.top+G(t[1],this.container.bounds.height),s=this.container.styles.transform;this.effects.push(new ic(r,n,s))}if(ef(this.container.styles)){const t=xi(this.curves),r=ki(this.curves);zd(t,r)?this.effects.push(new Li(t,6)):(this.effects.push(new Li(t,2)),this.effects.push(new Li(r,4)))}if(this.container.styles.clipPath.type!==0){const t=cb(this.container.styles.clipPath,this.container.bounds);t&&this.effects.push(t)}if(this.container.styles.mixBlendMode!==Le.NORMAL&&this.effects.push(new Ab(this.container.styles.mixBlendMode)),this.container.styles.filter!==null&&this.effects.push(new rb(this.container.styles.filter)),this.container.styles.zoom!==1){const t=this.container.styles.transformOrigin,r=this.container.bounds.left+G(t[0],this.container.bounds.width),n=this.container.bounds.top+G(t[1],this.container.bounds.height),s=this.container.styles.zoom,i=[s,0,0,s,0,0];this.effects.push(new ic(r,n,i))}}getEffects(A){let e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent;const r=this.effects.slice(0);for(;t;){const n=t.effects.filter(s=>!Xd(s));if(e||t.container.styles.position!==0||!t.parent){if(e=[2,3].indexOf(t.container.styles.position)===-1,ef(t.container.styles)){const s=xi(t.curves),i=ki(t.curves);zd(s,i)||r.unshift(new Li(i,6))}r.unshift(...n)}else r.unshift(...n);t=t.parent}return r.filter(n=>Pe(n.target,A))}};const ef=A=>A.overflowX!==0||A.overflowY!==0,tf=(A,e,t,r,n)=>A==="closest-side"?Math.min(e-t,r-e):A==="farthest-side"?Math.max(e-t,r-e):G(A,n),cb=(A,e)=>{const{left:t,top:r,width:n,height:s}=e;switch(A.type){case 1:{const i=G(A.left,n),o=G(A.top,s),a=t+i,l=r+o,u=Math.max(0,n-i-G(A.right,n)),d=Math.max(0,s-o-G(A.bottom,s));return new Hn(g=>{g.beginPath(),g.rect(a,l,u,d),g.clip()})}case 2:{const i=t+G(A.cx,n),o=r+G(A.cy,s);let a;return A.radius==="closest-side"?a=Math.min(i-t,o-r,t+n-i,r+s-o):A.radius==="farthest-side"?a=Math.max(i-t,o-r,t+n-i,r+s-o):a=G(A.radius,Math.sqrt(n*n+s*s)/Math.SQRT2),new Hn(l=>{l.beginPath(),l.arc(i,o,Math.max(0,a),0,Math.PI*2),l.clip()})}case 3:{const i=t+G(A.cx,n),o=r+G(A.cy,s),a=tf(A.rx,i,t,t+n,n),l=tf(A.ry,o,r,r+s,s);return new Hn(u=>{u.beginPath(),u.ellipse(i,o,Math.max(0,a),Math.max(0,l),0,0,Math.PI*2),u.clip()})}case 4:{const i=A.points.map(([o,a])=>[t+G(o,n),r+G(a,s)]);return new Hn(o=>{if(o.beginPath(),i.length>0){o.moveTo(i[0][0],i[0][1]);for(let a=1;a<i.length;a++)o.lineTo(i[a][0],i[a][1]);o.closePath()}o.clip()})}case 5:{const{d:i}=A;let o=null;return new Hn(a=>{try{o||(o=new Path2D(i));const l=a.getTransform();a.translate(t,r),a.clip(o),a.setTransform(l)}catch{}})}case 0:return null;default:return null}},oc=(A,e,t,r)=>{A.container.elements.forEach(n=>{const s=n.createsRealStackingContext,i=n.createsStackingContext,o=new Zd(n,A);Pe(n.styles.display,2048)&&r.push(o);const a=n.isListOwner?[]:r;if(s||i){const l=s||n.styles.isPositioned()?t:e,u=new Yd(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){const d=n.styles.zIndex.order;if(d<0){let g=0;l.negativeZIndex.some((p,w)=>d>p.element.container.styles.zIndex.order?(g=w,!1):g>0),l.negativeZIndex.splice(g,0,u)}else if(d>0){let g=0;l.positiveZIndex.some((p,w)=>d>=p.element.container.styles.zIndex.order?(g=w+1,!1):g>0),l.positiveZIndex.splice(g,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else n.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);oc(o,u,s?u:t,a)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),oc(o,e,t,a);n.isListOwner&&Af(n,a)})},Af=(A,e)=>{let t=A instanceof ec?A.start:1;const r=A instanceof ec?A.reversed:!1;for(let n=0;n<e.length;n++){const s=e[n];s.container instanceof Dd&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=Dn(t,s.container.styles.listStyleType,!0),t+=r?-1:1}},lb=A=>{const e=new Zd(A,null),t=new Yd(e),r=[];return oc(e,t,t,r),Af(e.container,r),t},rf=A=>{const e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},On=A=>{const e=A.styles,t=A.bounds,r=G(e.paddingLeft,t.width),n=G(e.paddingRight,t.width),s=G(e.paddingTop,t.width),i=G(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+s+i))},ub=(A,e)=>A===0?e.bounds:A===2?On(e):rf(e),hb=(A,e)=>A===0?e.bounds:A===2?On(e):rf(e),Di=(A,e,t)=>{const r=ub(kr(A.styles.backgroundOrigin,e),A),n=hb(kr(A.styles.backgroundClip,e),A),s=db(kr(A.styles.backgroundSize,e),t,r);let[i,o]=s;const a=Fn(kr(A.styles.backgroundPosition,e),r.width-i,r.height-o),l=fb(kr(A.styles.backgroundRepeat,e),a,s,r,n),u=Math.round(r.left+a[0]),d=Math.round(r.top+a[1]);return i=Math.max(1,i),o=Math.max(1,o),[l,u,d,i,o]},xr=A=>J(A)&&A.value==="auto",Hi=A=>typeof A=="number",db=(A,[e,t,r],n)=>{const[s,i]=A;if(!s)return[0,0];if(oe(s)&&i&&oe(i))return[G(s,n.width),G(i,n.height)];const o=Hi(r);if(J(s)&&(s.value==="contain"||s.value==="cover"))return Hi(r)?n.width/n.height<r!=(s.value==="cover")?[n.width,n.width/r]:[n.height*r,n.height]:[n.width,n.height];const a=Hi(e),l=Hi(t),u=a||l;if(xr(s)&&(!i||xr(i)))return a&&l?[e,t]:!o&&!u?[n.width,n.height]:u&&o?[a?e:t*r,l?t:e/r]:[a?e:n.width,l?t:n.height];if(o){let p=0,w=0;return oe(s)?p=G(s,n.width):oe(i)&&(w=G(i,n.height)),xr(s)?p=w*r:(!i||xr(i))&&(w=p/r),[p,w]}let d=null,g=null;if(oe(s)?d=G(s,n.width):i&&oe(i)&&(g=G(i,n.height)),d!==null&&(!i||xr(i))&&(g=a&&l?d/e*t:n.height),g!==null&&xr(s)&&(d=a&&l?g/t*e:n.width),d!==null&&g!==null)return[d,g];throw new Error("Unable to calculate background-size for element")},kr=(A,e)=>{const t=A[e];return typeof t>"u"?A[0]:t},fb=(A,[e,t],[r,n],s,i)=>{switch(A){case 2:return[new O(Math.round(s.left),Math.round(s.top+t)),new O(Math.round(s.left+s.width),Math.round(s.top+t)),new O(Math.round(s.left+s.width),Math.round(n+s.top+t)),new O(Math.round(s.left),Math.round(n+s.top+t))];case 3:return[new O(Math.round(s.left+e),Math.round(s.top)),new O(Math.round(s.left+e+r),Math.round(s.top)),new O(Math.round(s.left+e+r),Math.round(s.height+s.top)),new O(Math.round(s.left+e),Math.round(s.height+s.top))];case 1:return[new O(Math.round(s.left+e),Math.round(s.top+t)),new O(Math.round(s.left+e+r),Math.round(s.top+t)),new O(Math.round(s.left+e+r),Math.round(s.top+t+n)),new O(Math.round(s.left+e),Math.round(s.top+t+n))];default:return[new O(Math.round(i.left),Math.round(i.top)),new O(Math.round(i.left+i.width),Math.round(i.top)),new O(Math.round(i.left+i.width),Math.round(i.height+i.top)),new O(Math.round(i.left),Math.round(i.height+i.top))]}},gb="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",nf="Hidden Text";var pb=class{constructor(A){this._data={},this._document=A}parseMetrics(A,e){const t=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),s=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",s.appendChild(t),r.src=gb,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(nf)),t.appendChild(n),t.appendChild(r);const i=r.offsetTop-n.offsetTop+2;t.removeChild(n),t.appendChild(this._document.createTextNode(nf)),t.style.lineHeight="normal",r.style.verticalAlign="super";const o=r.offsetTop-t.offsetTop+2;return s.removeChild(t),{baseline:i,middle:o}}getMetrics(A,e){const t=`${A} ${e}`;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]}},wb=class{constructor(A){this.ctx=A}render(A,e){this.ctx.fillStyle=me(e.textDecorationColor||e.color);let t=1;typeof e.textDecorationThickness=="number"?t=e.textDecorationThickness:e.textDecorationThickness==="from-font"&&(t=Math.max(1,Math.floor(e.fontSize.number*.05)));let r=0;typeof e.textUnderlineOffset=="number"&&(r=e.textUnderlineOffset);const n=e.textDecorationStyle;e.textDecorationLine.forEach(s=>{let i=0;switch(s){case 1:i=A.top+A.height-t+r;break;case 2:i=A.top;break;case 3:i=A.top+(A.height/2-t/2);break;default:return}this.draw(A.left,i,A.width,t,n)})}draw(A,e,t,r,n){switch(n){case 0:this.ctx.fillRect(A,e,t,r);break;case 1:{const s=Math.max(1,r);this.ctx.fillRect(A,e,t,r),this.ctx.fillRect(A,e+r+s,t,r);break}case 2:this.drawPattern(A,e,t,r,[r,r*2]);break;case 3:this.drawPattern(A,e,t,r,[r*3,r*2]);break;case 4:this.drawWavy(A,e,t,r);break;default:this.ctx.fillRect(A,e,t,r)}}drawPattern(A,e,t,r,n){this.ctx.save(),this.ctx.beginPath(),this.ctx.setLineDash(n),this.ctx.lineWidth=r,this.ctx.strokeStyle=this.ctx.fillStyle,this.ctx.moveTo(A,e+r/2),this.ctx.lineTo(A+t,e+r/2),this.ctx.stroke(),this.ctx.restore()}drawWavy(A,e,t,r){this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=r,this.ctx.strokeStyle=this.ctx.fillStyle;const n=r*2,s=r*4;let i=A;for(this.ctx.moveTo(i,e+r/2);i<A+t;){const o=Math.min(i+s/2,A+t);if(this.ctx.quadraticCurveTo(i+s/4,e+r/2-n,o,e+r/2),i=o,i<A+t){const a=Math.min(i+s/2,A+t);this.ctx.quadraticCurveTo(i+s/4,e+r/2+n,a,e+r/2),i=a}}this.ctx.stroke(),this.ctx.restore()}};const mb=["-apple-system","system-ui"],Bb=/[\u2E80-\u2FFF\u3000-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFFEF]/,ac=A=>Bb.test(A),yb=()=>{if(typeof navigator>"u")return null;const A=navigator.userAgent,e=/iPhone|iPad|iPod/.test(A),t=/Macintosh/.test(A)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1;if(!e&&!t)return null;for(const r of[/(?:iPhone|CPU(?:\siPhone)?)\sOS\s(\d+)[\._](\d+)/,/Version\/(\d+)\.(\d+)/]){const n=A.match(r);if(n&&n[1])return parseInt(n[1],10)}return null},Cb=A=>{const e=yb();return e!==null&&e>=15&&e<17?A.map(t=>mb.indexOf(t)!==-1?'-apple-system, "Helvetica Neue", Arial, sans-serif':t):A},_b=()=>{var A;return(A=typeof window<"u"?window:void 0)!=null&&A.chrome?"miter":"round"};var Eb=class{constructor(A){this.ctx=A.ctx,this.options=A.options,this.decorationRenderer=new wb(A.ctx)}iterateLettersWithLetterSpacing(A,e,t,r,n){if(Pa(r)){this.iterateVerticalGlyphs(A,e,t,r,n);return}const s=Tr(A.text),i=A.bounds.top+t;let o=A.bounds.left;for(const a of s){if(ac(a)){const l=this.ctx.textBaseline;this.ctx.textBaseline="ideographic",n(a,o,i),this.ctx.textBaseline=l}else n(a,o,i);o+=this.ctx.measureText(a).width+e}}iterateVerticalGlyphs(A,e,t,r,n){const s=Tr(A.text);let i=A.bounds.top;for(const o of s){if(R0(r)||!ac(o)&&o.trim().length>0)this.ctx.save(),this.ctx.translate(A.bounds.left+t,i),this.ctx.rotate(r===4?-Math.PI/2:Math.PI/2),n(o,0,0),this.ctx.restore();else{const a=this.ctx.textBaseline;ac(o)&&(this.ctx.textBaseline="ideographic"),n(o,A.bounds.left,i+t),this.ctx.textBaseline=a}i+=this.ctx.measureText(o).width+e}}renderTextWithLetterSpacing(A,e,t,r=0){this.renderFillText(A,e,t,r)}canRenderWholeText(A,e){return A===0&&!Pa(e)}renderFillText(A,e,t,r){this.canRenderWholeText(e,r)?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):this.iterateLettersWithLetterSpacing(A,e,t,r,(n,s,i)=>{this.ctx.fillText(n,s,i)})}renderStrokeText(A,e,t,r){this.canRenderWholeText(e,r)?this.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+t):this.iterateLettersWithLetterSpacing(A,e,t,r,(n,s,i)=>{this.ctx.strokeText(n,s,i)})}renderTextStrokeWithStyle(A,e){!e.webkitTextStrokeWidth||!A.text.trim().length||(this.ctx.strokeStyle=me(e.webkitTextStrokeColor),this.ctx.lineWidth=e.webkitTextStrokeWidth,this.ctx.lineJoin=_b(),this.renderStrokeText(A,e.letterSpacing,e.fontSize.number,e.writingMode),this.ctx.strokeStyle="",this.ctx.lineWidth=0,this.ctx.lineJoin="miter")}renderTextFillWithShadows(A,e){this.ctx.fillStyle=me(e.color),this.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number,e.writingMode);const t=e.textShadow;t.length&&A.text.trim().length&&(t.slice(0).reverse().forEach(r=>{this.ctx.shadowColor=me(r.color),this.ctx.shadowOffsetX=r.offsetX.number*this.options.scale,this.ctx.shadowOffsetY=r.offsetY.number*this.options.scale,this.ctx.shadowBlur=r.blur.number,this.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number,e.writingMode)}),this.ctx.shadowColor="",this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.ctx.shadowBlur=0)}renderTextBoundWithPaintOrder(A,e,t){t.forEach(r=>{switch(r){case 0:this.ctx.fillStyle=me(e.color),this.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number,e.writingMode);break;case 1:this.renderTextStrokeWithStyle(A,e);break}})}renderTextDecoration(A,e){this.decorationRenderer.render(A,e)}truncateTextWithEllipsis(A,e,t){const r="…",n=this.ctx.measureText(r).width,s=Tr(A);if(t===0){const i=l=>this.ctx.measureText(s.slice(0,l).join("")).width+n<=e;let o=0,a=s.length;for(;o<a;){const l=o+a+1>>1;i(l)?o=l:a=l-1}return s.slice(0,o).join("")+r}else{let i=n;const o=[];for(const a of s){const l=this.ctx.measureText(a).width;if(i+l>e)break;o.push(a),i+=l+t}return o.join("")+r}}createFontStyle(A){const e=A.fontVariant.filter(n=>n==="normal"||n==="small-caps").join(""),t=Cb(A.fontFamily).join(", "),r=jt(A.fontSize)?`${A.fontSize.number}${A.fontSize.unit}`:`${A.fontSize.number}px`;return[[A.fontStyle,e,A.fontWeight,r,t].join(" "),t,r]}renderLineClampedText(A,e,t,r){const n=e.fontSize.number*1.5,s=[];let i=[],o=A.textBounds[0].bounds.top;A.textBounds.forEach(u=>{Math.abs(u.bounds.top-o)>=n*.5?(i.length>0&&s.push(i),i=[u],o=u.bounds.top):i.push(u)}),i.length>0&&s.push(i);const a=e.webkitLineClamp;if(s.length<=a)return!1;for(let u=0;u<a-1;u++)s[u].forEach(d=>this.renderTextBoundWithPaintOrder(d,e,t));const l=s[a-1];if(l!=null&&l.length&&r){const u=l.map(w=>w.text).join(""),d=l[0],g=r.width-(d.bounds.left-r.left),p=new JA(this.truncateTextWithEllipsis(u,g,e.letterSpacing),d.bounds);for(const w of t)w===0?(this.ctx.fillStyle=me(e.color),this.renderTextWithLetterSpacing(p,e.letterSpacing,e.fontSize.number,e.writingMode)):w===1&&this.renderTextStrokeWithStyle(p,e)}return!0}renderEllipsisText(A,e,t,r){const n=e.fontSize.number*1.5,s=A.textBounds[0].bounds.top;if(!A.textBounds.every(a=>Math.abs(a.bounds.top-s)<n*.5))return!1;let i=A.textBounds.map(a=>a.text).join("").replace(/\s+/g," ").trim();if(this.ctx.measureText(i).width<=r.width)return!1;const o=new JA(this.truncateTextWithEllipsis(i,r.width,e.letterSpacing),A.textBounds[0].bounds);for(const a of t)a===0?this.renderTextFillWithShadows(o,e):a===1&&this.renderTextStrokeWithStyle(o,e);return!0}async renderTextNode(A,e,t){this.ctx.font=this.createFontStyle(e)[0],this.ctx.direction=e.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic";const r=e.paintOrder;e.webkitLineClamp>0&&e.display&2&&e.overflowY===1&&A.textBounds.length>0&&this.renderLineClampedText(A,e,r,t)||e.textOverflow===1&&t&&e.overflowX===1&&A.textBounds.length>0&&this.renderEllipsisText(A,e,r,t)||A.textBounds.forEach(n=>{r.forEach(s=>{s===0?(this.renderTextFillWithShadows(n,e),e.textDecorationLine.length&&this.renderTextDecoration(n.bounds,e)):s===1&&this.renderTextStrokeWithStyle(n,e)})})}};const sf=(A,e)=>{e.forEach((t,r)=>{const n=Ct(t)?t.start:t;r===0?A.moveTo(n.x,n.y):A.lineTo(n.x,n.y),Ct(t)&&A.bezierCurveTo(t.startControl.x,t.startControl.y,t.endControl.x,t.endControl.y,t.end.x,t.end.y)})},of=(A,e)=>{A.beginPath(),sf(A,e),A.closePath()};var vb=(wr=class{constructor(e){this.patternCache=new Map,this.ctx=e.ctx,this.context=e.context,this.canvas=e.canvas}async renderBackgroundImage(e){let t=e.styles.backgroundImage.length-1;const r=e.styles.backgroundBlendMode;let n=0;for(const s of e.styles.backgroundImage.slice(0).reverse()){if(n>0){const i=r[n]??r[0]??"normal";i!=="normal"&&(this.ctx.save(),this.ctx.globalCompositeOperation=i)}s.type===0?await this.renderBackgroundURLImage(e,s,t):b_(s)?this.renderLinearGradient(e,s,t):Q_(s)?this.renderRepeatingLinearGradient(e,s,t):U_(s)&&this.renderRadialGradient(e,s,t),n>0&&(r[n]??r[0]??"normal")!=="normal"&&this.ctx.restore(),t--,n++}}async renderBackgroundURLImage(e,t,r){var i,o;let n;const s=t.url;try{n=await this.context.cache.match(s)}catch(a){this.context.logger.error(`Error loading background-image ${s}`),(o=(i=this.context).onError)==null||o.call(i,a instanceof Error?a:new Error(String(a)))}if(n){const a=isNaN(n.width)||n.width===0?1:n.width,l=isNaN(n.height)||n.height===0?1:n.height,[u,d,g,p,w]=Di(e,r,[a,l,a/l]),y=`${s}|${Math.round(p)}x${Math.round(w)}|${e.styles.imageRendering}`;let B=this.lruGet(this.patternCache,y);if(!B){const b=this.resizeImage(n,p,w,e.styles.imageRendering);B=this.ctx.createPattern(b,"repeat"),this.lruSet(this.patternCache,y,B)}this.renderRepeat(u,B,d,g)}}renderRepeatingLinearGradient(e,t,r){const[n,s,i,o,a]=Di(e,r,[null,null,null]),[l,u,d,g,p]=Mh(t.angle,o,a),w=La(t.stops,l||1),y=w[w.length-1],B=w[0],b=y.stop-B.stop;if(b<=0){this.renderLinearGradient(e,t,r);return}const S=d-u,I=p-g,R=b/(Math.sqrt(S*S+I*I)||1),K=u,P=g,_=u+S*R,C=g+I*R,v=this.canvas.ownerDocument??document,U=`rlg|${t.angle}|${Math.round(b)}|${JSON.stringify(t.stops)}`;let Q=this.lruGet(this.patternCache,U);if(!Q){const F=v.createElement("canvas"),E=Math.max(1,Math.ceil(b));F.width=E,F.height=E;const Ce=F.getContext("2d");if(!Ce)return;const pt=Ce.createLinearGradient(K-s,P-i,_-s,C-i);w.forEach(fA=>{pt.addColorStop((fA.stop-B.stop)/b,me(fA.color))}),Ce.fillStyle=pt,Ce.fillRect(0,0,E,E),E>0&&(Q=this.ctx.createPattern(F,"repeat"),this.lruSet(this.patternCache,U,Q))}Q&&this.renderRepeat(n,Q,s,i)}renderLinearGradient(e,t,r){const[n,s,i,o,a]=Di(e,r,[null,null,null]),[l,u,d,g,p]=Mh(t.angle,o,a),w=`lg|${t.angle}|${Math.round(o)}x${Math.round(a)}|${JSON.stringify(t.stops)}`;let y=this.lruGet(this.patternCache,w);if(!y){const B=(this.canvas.ownerDocument??document).createElement("canvas");B.width=o,B.height=a;const b=B.getContext("2d");if(!b)return;const S=b.createLinearGradient(u,g,d,p);La(t.stops,l||1).forEach(I=>S.addColorStop(I.stop,me(I.color))),b.fillStyle=S,b.fillRect(0,0,o,a),o>0&&a>0&&(y=this.ctx.createPattern(B,"repeat"),this.lruSet(this.patternCache,w,y))}y&&this.renderRepeat(n,y,s,i)}renderRadialGradient(e,t,r){const[n,s,i,o,a]=Di(e,r,[null,null,null]),l=t.position.length===0?[sA]:t.position,u=G(l[0],o),d=G(l[l.length-1],a);let[g,p]=__(t,u,d,o,a);if((g===0||p===0)&&(g=Math.max(g,.01),p=Math.max(p,.01)),g>0&&p>0){const w=`rg|${Math.round(u)}x${Math.round(d)}|${Math.round(g)}x${Math.round(p)}|${JSON.stringify(t.stops)}`;let y=this.lruGet(this.patternCache,w);if(!y){const B=this.canvas.ownerDocument??document,b=Math.ceil(Math.max(g,p)*2),S=B.createElement("canvas");S.width=b,S.height=b;const I=S.getContext("2d");if(I){const R=Math.max(g,p),K=I.createRadialGradient(R,R,0,R,R,R);La(t.stops,R*2).forEach(P=>K.addColorStop(P.stop,me(P.color))),I.fillStyle=K,g!==p&&I.scale(1,p/g),I.fillRect(0,0,R*2,R*2),y=this.ctx.createPattern(S,"no-repeat"),this.lruSet(this.patternCache,w,y)}}y&&(this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.translate(s+u-Math.max(g,p),i+d-Math.max(g,p)),this.ctx.fillStyle=y,this.ctx.fillRect(0,0,Math.max(g,p)*2,Math.max(g,p)*2),this.ctx.restore())}}renderRepeat(e,t,r,n){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(r,n),this.ctx.fill(),this.ctx.translate(-r,-n)}resizeImage(e,t,r,n){const s=(this.canvas.ownerDocument??document).createElement("canvas");s.width=Math.max(1,t),s.height=Math.max(1,r);const i=s.getContext("2d");return i?(n===2||n===1?(this.context.logger.debug("Disabling image smoothing for background image due to CSS image-rendering"),i.imageSmoothingEnabled=!1):n===3?(this.context.logger.debug("Enabling image smoothing for background image due to CSS image-rendering: smooth"),i.imageSmoothingEnabled=!0):i.imageSmoothingEnabled=this.ctx.imageSmoothingEnabled,this.ctx.imageSmoothingQuality&&(i.imageSmoothingQuality=this.ctx.imageSmoothingQuality),i.drawImage(e,0,0,e.width,e.height,0,0,t,r),s):e}path(e){of(this.ctx,e)}lruGet(e,t){const r=e.get(t);return r!==void 0&&(e.delete(t),e.set(t,r)),r}lruSet(e,t,r){if(e.size>=wr.PATTERN_CACHE_MAX){const n=e.keys().next().value;e.delete(n)}e.set(t,r)}},wr.PATTERN_CACHE_MAX=50,wr);const af=(A,e)=>{switch(e){case 0:return _t(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return _t(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return _t(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return _t(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},bb=(A,e)=>{switch(e){case 0:return _t(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return _t(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return _t(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return _t(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Ub=(A,e)=>{switch(e){case 0:return _t(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return _t(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return _t(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return _t(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},Qb=(A,e)=>{switch(e){case 0:return Oi(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Oi(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Oi(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return Oi(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},Oi=(A,e)=>{const t=[];return Ct(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ct(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},_t=(A,e,t,r)=>{const n=[];return Ct(A)?n.push(A.subdivide(.5,!1)):n.push(A),Ct(t)?n.push(t.subdivide(.5,!0)):n.push(t),Ct(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),Ct(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n};var Ib=class{constructor(A,e){this.ctx=A.ctx,this.pathCallbacks=e}async renderSolidBorder(A,e,t){this.pathCallbacks.path(af(t,e)),this.ctx.fillStyle=me(A),this.ctx.fill()}async renderDoubleBorder(A,e,t,r){if(e<3){await this.renderSolidBorder(A,t,r);return}const n=bb(r,t);this.pathCallbacks.path(n),this.ctx.fillStyle=me(A),this.ctx.fill();const s=Ub(r,t);this.pathCallbacks.path(s),this.ctx.fill()}async renderDashedDottedBorder(A,e,t,r,n){this.ctx.save();const s=Qb(r,t),i=af(r,t);n===2&&(this.pathCallbacks.path(i),this.ctx.clip());let o,a,l,u;Ct(i[0])?(o=i[0].start.x,a=i[0].start.y):(o=i[0].x,a=i[0].y),Ct(i[1])?(l=i[1].end.x,u=i[1].end.y):(l=i[1].x,u=i[1].y);let d;t===0||t===2?d=Math.abs(o-l):d=Math.abs(a-u),this.ctx.beginPath(),n===3?this.pathCallbacks.formatPath(s):this.pathCallbacks.formatPath(i.slice(0,2));let g=e<3?e*3:e*2,p=e<3?e*2:e;n===3&&(g=e,p=e);let w=!0;if(d<=g*2)w=!1;else if(d<=g*2+p){const y=d/(2*g+p);g*=y,p*=y}else{const y=Math.floor((d+p)/(g+p)),B=(d-y*g)/(y-1),b=(d-(y+1)*g)/y;p=b<=0||Math.abs(p-B)<Math.abs(p-b)?B:b}if(w&&(n===3?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),n===3?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=e*2+1.1,this.ctx.strokeStyle=me(A),this.ctx.stroke(),this.ctx.setLineDash([]),n===2){if(Ct(i[0])){const y=i[3],B=i[0];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(y.end.x,y.end.y),new O(B.start.x,B.start.y)]),this.ctx.stroke()}if(Ct(i[1])){const y=i[1],B=i[2];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(y.end.x,y.end.y),new O(B.start.x,B.start.y)]),this.ctx.stroke()}}this.ctx.restore()}},Fb=class{constructor(A){this.ctx=A}renderBorderImage(A,e,t,r,n,s,i,o){const a=e.naturalWidth||e.width,l=e.naturalHeight||e.height;if(a<=0||l<=0)return;const u=Math.min(t.unit==="percent"?t.top/100*l:Math.min(t.top,l),l),d=Math.min(t.unit==="percent"?t.right/100*a:Math.min(t.right,a),a),g=Math.min(t.unit==="percent"?t.bottom/100*l:Math.min(t.bottom,l),l),p=Math.min(t.unit==="percent"?t.left/100*a:Math.min(t.left,a),a),{left:w,top:y,width:B,height:b}=A;if(B<=0||b<=0)return;const S=Math.min(n,b),I=Math.min(s,B),R=Math.min(i,b-S),K=Math.min(o,B-I);this.drawRegion(e,0,0,p,u,w,y,K,S),this.drawRegion(e,a-d,0,d,u,w+B-I,y,I,S),this.drawRegion(e,a-d,l-g,d,g,w+B-I,y+b-R,I,R),this.drawRegion(e,0,l-g,p,g,w,y+b-R,K,R);const P=[{sx:p,sy:0,sw:a-p-d,sh:u,dx:w+K,dy:y,dw:B-K-I,dh:S,repeat:r.horizontal},{sx:a-d,sy:u,sw:d,sh:l-u-g,dx:w+B-I,dy:y+S,dw:I,dh:b-S-R,repeat:r.vertical},{sx:p,sy:l-g,sw:a-p-d,sh:g,dx:w+K,dy:y+b-R,dw:B-K-I,dh:R,repeat:r.horizontal},{sx:0,sy:u,sw:p,sh:l-u-g,dx:w,dy:y+S,dw:K,dh:b-S-R,repeat:r.vertical}];for(const _ of P){if(_.sw<=0||_.sh<=0||_.dw<=0||_.dh<=0)continue;const C=_.dw>=_.dh;_.repeat===0?this.ctx.drawImage(e,_.sx,_.sy,_.sw,_.sh,_.dx,_.dy,_.dw,_.dh):(_.repeat===1||_.repeat===2)&&this.drawRepeatedEdge(e,_,C,_.repeat===2)}if(t.fill){const _=p,C=u,v=a-p-d,U=l-u-g,Q=w+K,F=y+S,E=B-K-I,Ce=b-S-R;this.drawRegion(e,_,C,v,U,Q,F,E,Ce)}}drawRegion(A,e,t,r,n,s,i,o,a){r>0&&n>0&&o>0&&a>0&&this.ctx.drawImage(A,e,t,r,n,s,i,o,a)}drawRepeatedEdge(A,e,t,r){const n=t?e.sw:e.sh,s=t?e.dw:e.dh;if(n<=0||s<=0)return;let i,o;r?(o=Math.max(1,Math.round(s/n)),i=s/o):(i=n,o=Math.ceil(s/i)),this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(e.dx,e.dy,e.dw,e.dh),this.ctx.clip();for(let a=0;a<o;a++){const l=a*i,u=s-l,d=Math.min(i,u);if(d<=0)break;t?this.ctx.drawImage(A,e.sx,e.sy,e.sw,e.sh,e.dx+l,e.dy,d,e.dh):this.ctx.drawImage(A,e.sx,e.sy,e.sw,e.sh,e.dx,e.dy+l,e.dw,d)}this.ctx.restore()}},Tb=class{constructor(A,e){this.activeEffects=[],this.ctx=A.ctx,this.pathCallback=e}applyEffects(A){for(;this.activeEffects.length;)this.popEffect();A.forEach(e=>this.applyEffect(e))}applyEffect(A){if(this.ctx.save(),sb(A))this.ctx.globalAlpha=A.opacity;else if(nb(A))this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY);else if(Xd(A))this.pathCallback.path(A.path),this.ctx.clip();else if(ib(A))A.applyClip(this.ctx);else if(ob(A))this.ctx.globalCompositeOperation=A.compositeOperation;else if(ab(A)){const e=A.filterString.replace(/drop-shadow\([^)]+\)\s*/g,"").trim();this.ctx.filter=e||"none"}this.activeEffects.push(A)}popEffect(){this.activeEffects.pop(),this.ctx.restore()}getActiveEffectCount(){return this.activeEffects.length}hasActiveEffects(){return this.activeEffects.length>0}};const Sb=(A,e,t,r,n)=>{let s=0,i=0,o=A,a=e,l=t.left,u=t.top,d=t.width,g=t.height;const p=d/g,w=o/a,y=n?G(n[0],1):.5,B=n?G(n[1],1):.5;return r===2?w>p?(g=d/w,u+=(t.height-g)*B):(d=g*w,l+=(t.width-d)*y):r===4?w>p?(o=a*p,s+=(A-o)*y):(a=o/p,i+=(e-a)*B):r===8?(o>d?(s+=(o-d)*y,o=d):(l+=(d-o)*y,d=o),a>g?(i+=(a-g)*B,a=g):(u+=(g-a)*B,g=a)):r===16&&((w>p?d:g*w)<(o>d?o:d)?w>p?(g=d/w,u+=(t.height-g)*B):(d=g*w,l+=(t.width-d)*y):(o>d?(s+=(o-d)*y,o=d):(l+=(d-o)*y,d=o),a>g?(i+=(a-g)*B,a=g):(u+=(g-a)*B,g=a))),{sx:s,sy:i,sw:o,sh:a,dx:l,dy:u,dw:d,dh:g}};async function Rb(A,e,t,r,n,s,i,o){var a,l;if(n instanceof xd)try{const u=await e.cache.match(n.src),d=A.imageSmoothingEnabled;i.imageRendering===2||i.imageRendering===1?A.imageSmoothingEnabled=!1:i.imageRendering===3&&(A.imageSmoothingEnabled=!0),o(n,s,u),A.imageSmoothingEnabled=d}catch(u){e.logger.error(`Error loading image ${n.src}`),(a=e.onError)==null||a.call(e,u instanceof Error?u:new Error(String(u)))}if(n instanceof kd&&o(n,s,n.canvas),n instanceof Ld)try{o(n,s,await e.cache.match(n.svg))}catch(u){e.logger.error(`Error loading svg ${n.svg.substring(0,255)}`),(l=e.onError)==null||l.call(e,u instanceof Error?u:new Error(String(u)))}if(n instanceof Nd&&n.tree){const u=await r(e,{scale:t.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}).render(n.tree);n.width&&n.height&&A.drawImage(u,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height)}}function xb(A,e,t,r,n,s){if(n instanceof Ln){const i=Math.min(n.bounds.width,n.bounds.height);n.type==="checkbox"&&n.checked?(A.save(),r([new O(n.bounds.left+i*.39363,n.bounds.top+i*.79),new O(n.bounds.left+i*.16,n.bounds.top+i*.5549),new O(n.bounds.left+i*.27347,n.bounds.top+i*.44071),new O(n.bounds.left+i*.39694,n.bounds.top+i*.5649),new O(n.bounds.left+i*.72983,n.bounds.top+i*.23),new O(n.bounds.left+i*.84,n.bounds.top+i*.34085),new O(n.bounds.left+i*.39363,n.bounds.top+i*.79)]),A.fillStyle=me(Hd),A.fill(),A.restore()):n.type==="radio"&&n.checked&&(A.save(),A.beginPath(),A.arc(n.bounds.left+i/2,n.bounds.top+i/2,i/4,0,Math.PI*2,!0),A.fillStyle=me(Hd),A.fill(),A.restore())}if(Lb(n)&&n.value.length){const[i,o,a]=t.createFontStyle(s),{baseline:l}=e.getMetrics(o,a);A.font=i,A.fillStyle=n instanceof Ln&&n.isPlaceholder?me(vv):me(s.color),A.textBaseline="alphabetic",A.textAlign=Db(n.styles.textAlign);const u=On(n);let d=0;switch(n.styles.textAlign){case 1:d+=u.width/2;break;case 2:d+=u.width;break}let g=0;if(n instanceof Ln){const w=G(s.fontSize,0);g=(u.height-w)/2}const p=u.add(d,g,0,0);A.save(),r([new O(u.left,u.top),new O(u.left+u.width,u.top),new O(u.left+u.width,u.top+u.height),new O(u.left,u.top+u.height)]),A.clip(),t.renderTextWithLetterSpacing(new JA(n.value,p),s.letterSpacing,l,s.writingMode),A.restore(),A.textBaseline="alphabetic",A.textAlign="left"}}async function kb(A,e,t,r,n,s){var i;if(Pe(n.styles.display,2048)){if(n.styles.listStyleImage!==null){const o=n.styles.listStyleImage;if(o.type===0){const a=o.url;try{const l=await e.cache.match(a);A.drawImage(l,n.bounds.left-(l.width+10),n.bounds.top)}catch(l){e.logger.error(`Error loading list-style-image ${a}`),(i=e.onError)==null||i.call(e,l instanceof Error?l:new Error(String(l)))}}}else if(r.listValue&&n.styles.listStyleType!==-1){const[o]=t.createFontStyle(s);A.font=o,A.fillStyle=me(s.color),A.textBaseline="middle",A.textAlign="right";const a=new rA(n.bounds.left,n.bounds.top+G(n.styles.paddingTop,n.bounds.width),n.bounds.width,Ad(s.lineHeight,s.fontSize.number)/2+1);t.renderTextWithLetterSpacing(new JA(r.listValue,a),s.letterSpacing,Ad(s.lineHeight,s.fontSize.number)/2+2,s.writingMode),A.textBaseline="bottom",A.textAlign="left"}}}const Lb=A=>A instanceof Pd||A instanceof Od?!0:A instanceof Ln&&A.type!=="radio"&&A.type!=="checkbox",Db=A=>{switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Hb=1e4;var Ob=class wB{constructor(e,t){this.context=e,this.options=t,this.canvas=t.canvas?t.canvas:document.createElement("canvas");const r=this.canvas.getContext("2d");if(!r)throw new Error("Failed to get 2D rendering context from canvas");this.ctx=r,t.canvas||(this.canvas.width=Math.floor(t.width*t.scale),this.canvas.height=Math.floor(t.height*t.scale),this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`),this.fontMetrics=new pb(document),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-t.x,-t.y),this.ctx.textBaseline="bottom",t.imageSmoothing!==void 0&&(this.ctx.imageSmoothingEnabled=t.imageSmoothing),t.imageSmoothingQuality&&(this.ctx.imageSmoothingQuality=t.imageSmoothingQuality),this.backgroundRenderer=new vb({ctx:this.ctx,context:this.context,canvas:this.canvas,options:{width:t.width,height:t.height,scale:t.scale}}),this.borderRenderer=new Ib({ctx:this.ctx},{path:n=>this.path(n),formatPath:n=>this.formatPath(n)}),this.borderImageRenderer=new Fb(this.ctx),this.effectsRenderer=new Tb({ctx:this.ctx},{path:n=>this.path(n)}),this.textRenderer=new Eb({ctx:this.ctx,context:this.context,options:{scale:t.scale}}),this.context.logger.debug(`Canvas renderer initialized (${t.width}x${t.height}) with scale ${t.scale}`)}async renderStack(e){e.element.container.styles.isVisible()&&await this.renderStackContent(e)}async renderNode(e){if(e.container.debugRender)debugger;e.container.styles.isVisible()&&(await this.renderNodeBackgroundAndBorders(e),await this.renderNodeContent(e))}renderReplacedElement(e,t,r){const n=r.naturalWidth||e.intrinsicWidth,s=r.naturalHeight||e.intrinsicHeight;if(r&&n>0&&s>0){const i=On(e),o=ki(t);this.path(o),this.ctx.save(),this.ctx.clip();const{sx:a,sy:l,sw:u,sh:d,dx:g,dy:p,dw:w,dh:y}=Sb(n,s,i,e.styles.objectFit,e.styles.objectPosition);this.ctx.drawImage(r,a,l,u,d,g,p,w,y),this.ctx.restore()}}async renderNodeContent(e){this.effectsRenderer.applyEffects(e.getEffects(4));const t=e.container,r=e.curves,n=t.styles,s=On(t);for(const i of t.textNodes)await this.textRenderer.renderTextNode(i,n,s);await Rb(this.ctx,this.context,{scale:this.options.scale,backgroundColor:this.options.backgroundColor,x:this.options.x,y:this.options.y,width:this.options.width,height:this.options.height},(i,o)=>new wB(i,o),t,r,n,(i,o,a)=>this.renderReplacedElement(i,o,a)),xb(this.ctx,this.fontMetrics,this.textRenderer,this.path.bind(this),t,n),await kb(this.ctx,this.context,this.textRenderer,e,t,n)}async renderStackContent(e){if(e.element.container.debugRender)debugger;const t=this.options.signal;await this.renderNodeBackgroundAndBorders(e.element);for(const r of e.negativeZIndex){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderNodeContent(e.element);for(const r of e.nonInlineLevel)await this.renderNode(r);for(const r of e.nonPositionedFloats){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}for(const r of e.nonPositionedInlineLevel){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}for(const r of e.inlineLevel)await this.renderNode(r);for(const r of e.zeroOrAutoZIndexOrTransformedOrOpacity){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}for(const r of e.positiveZIndex){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}}mask(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.options.width,0),this.ctx.lineTo(this.options.width,this.options.height),this.ctx.lineTo(0,this.options.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()}path(e){of(this.ctx,e)}formatPath(e){sf(this.ctx,e)}async renderNodeBackgroundAndBorders(e){this.effectsRenderer.applyEffects(e.getEffects(2));const t=e.container.styles,r=!_A(t.backgroundColor)||t.backgroundImage.length,n=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],s=Pb(kr(t.backgroundClip,0),e.curves);if((r||t.boxShadow.length)&&(this.ctx.save(),this.path(s),this.ctx.clip(),_A(t.backgroundColor)||(this.ctx.fillStyle=me(t.backgroundColor),this.ctx.fill()),await this.backgroundRenderer.renderBackgroundImage(e.container),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(o=>{this.ctx.save();const a=xi(e.curves),l=o.inset?0:Hb,u=Xv(a,-l+(o.inset?1:-1)*o.spread.number,(o.inset?1:-1)*o.spread.number,o.spread.number*(o.inset?-2:2),o.spread.number*(o.inset?-2:2));o.inset?(this.path(a),this.ctx.clip(),this.mask(u)):(this.mask(a),this.ctx.clip(),this.path(u)),this.ctx.shadowOffsetX=o.offsetX.number+l,this.ctx.shadowOffsetY=o.offsetY.number,this.ctx.shadowColor=me(o.color),this.ctx.shadowBlur=o.blur.number,this.ctx.fillStyle=o.inset?me(o.color):"rgba(0,0,0,1)",this.ctx.fill(),this.ctx.restore()})),t.borderImageSource){const o=t.borderImageSource;if(o.type===0){const a=o.url;try{const l=await this.context.cache.match(a);if(l){const u=e.container.bounds;this.borderImageRenderer.renderBorderImage(u,l,t.borderImageSlice,t.borderImageRepeat,Math.max(0,t.borderTopWidth),Math.max(0,t.borderRightWidth),Math.max(0,t.borderBottomWidth),Math.max(0,t.borderLeftWidth))}}catch{this.context.logger.error(`Error loading border-image ${a}`)}}return}let i=0;for(const o of n)o.style!==0&&!_A(o.color)&&o.width>0&&(o.style===2?await this.borderRenderer.renderDashedDottedBorder(o.color,o.width,i,e.curves,2):o.style===3?await this.borderRenderer.renderDashedDottedBorder(o.color,o.width,i,e.curves,3):o.style===4?await this.borderRenderer.renderDoubleBorder(o.color,o.width,i,e.curves):await this.borderRenderer.renderSolidBorder(o.color,i,e.curves)),i++}async render(e){this.options.backgroundColor&&(this.ctx.fillStyle=me(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height));const t=lb(e);return await this.renderStack(t),this.effectsRenderer.applyEffects([]),this.canvas}};const Pb=(A,e)=>{switch(A){case 0:return xi(e);case 2:return Zv(e);default:return ki(e)}};var Nb=class{constructor(A,e){this.context=A,this.options=e,this.canvas=e.canvas?e.canvas:document.createElement("canvas");const t=this.canvas.getContext("2d");if(!t)throw new Error("Failed to get 2D rendering context from canvas");this.ctx=t,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.context.logger.debug(`EXPERIMENTAL ForeignObject renderer initialized (${e.width}x${e.height} at ${e.x},${e.y}) with scale ${e.scale}`)}async render(A){var t;if((t=this.options.signal)!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");const e=await Za(Ya(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A));return this.options.backgroundColor&&(this.ctx.fillStyle=me(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),this.canvas}},Mb=(an=class{constructor({id:e,enabled:t}){this.id=e,this.enabled=t,this.start=Date.now()}debug(...e){this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug(this.id,`${this.getTime()}ms`,...e):this.info(...e))}getTime(){return Date.now()-this.start}info(...e){this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info(this.id,`${this.getTime()}ms`,...e)}warn(...e){this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn(this.id,`${this.getTime()}ms`,...e):this.info(...e))}error(...e){this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error(this.id,`${this.getTime()}ms`,...e):this.info(...e))}},an.instances={},an),Vb=class{constructor(A,e){if(this.context=A,this._options=e,this._cache=new Map,this._pendingOperations=new Map,this.maxSize=e.maxCacheSize??100,this.maxSize<1)throw new Error("Cache maxSize must be at least 1");this.maxSize>1e4&&this.context.logger.warn(`Cache maxSize ${this.maxSize} is very large and may cause memory issues. Consider using a smaller value (recommended: 100-1000).`)}addImage(A){const e=this._pendingOperations.get(A);if(e)return e;if(this.has(A)){const t=this._cache.get(A);return this._cache.delete(A),this._cache.set(A,t),Promise.resolve()}if(lc(A)||Gb(A)){const t=this._addImageInternal(A);return this._pendingOperations.set(A,t),t.finally(()=>{this._pendingOperations.delete(A)}),t}return Promise.resolve()}async _addImageInternal(A){const e=this._options.imageTimeout??15e3,t=this.withTimeout(this.loadImage(A),e,`Timed out (${e}ms) loading image`);t.catch(r=>{this.context.logger.error(`Failed to load image ${A}: ${r instanceof Error?r.message:"Unknown error"}`)}),this.set(A,t)}withTimeout(A,e,t){if(e<=0)return A;let r;const n=new Promise((s,i)=>{r=setTimeout(()=>i(new Error(t)),e)});return Promise.race([A,n]).finally(()=>{r!==void 0&&clearTimeout(r)})}match(A){const e=this._cache.get(A);if(e)return this._cache.delete(A),this._cache.set(A,e),e.value}set(A,e){if(this._cache.has(A))this._cache.delete(A);else if(this._cache.size>=this.maxSize){const t=this._cache.keys().next().value;t!==void 0&&(this._cache.delete(t),this.context.logger.debug(`Cache: Evicted LRU entry: ${t}`))}this._cache.set(A,{value:e})}size(){return this._cache.size}getMaxSize(){return this.maxSize}clear(){this._cache.clear()}async loadImage(A){const e=this.context.originChecker,t=o=>e.isSameOrigin(o),r=typeof this._options.customIsSameOrigin=="function"?await this._options.customIsSameOrigin(A,t):t(A),n=!cc(A)&&this._options.useCORS===!0&&Ne.SUPPORT_CORS_IMAGES&&!r,s=!cc(A)&&!r&&!lc(A)&&typeof this._options.proxy=="string"&&Ne.SUPPORT_CORS_XHR&&!n;if(!r&&this._options.allowTaint===!1&&!cc(A)&&!lc(A)&&!s&&!n)return;let i=A;return s&&(i=await this.proxy(i)),this.context.logger.debug(`Added image ${A.substring(0,256)}`),await new Promise((o,a)=>{const l=new Image;l.onload=()=>o(l),l.onerror=a,(Wb(i)||n)&&(l.crossOrigin="anonymous"),l.src=i,l.complete===!0&&setTimeout(()=>o(l),500)})}has(A){return this._cache.has(A)}keys(){return Promise.resolve(Array.from(this._cache.keys()))}proxy(A){const e=this._options.proxy;if(!e)throw new Error("No proxy defined");const t=A.substring(0,256);return new Promise((r,n)=>{const s=Ne.SUPPORT_RESPONSE_TYPE?"blob":"text",i=new XMLHttpRequest;i.onload=()=>{if(i.status===200)if(s==="text")r(i.response);else{const a=new FileReader;a.addEventListener("load",()=>r(a.result),!1),a.addEventListener("error",l=>n(l),!1),a.readAsDataURL(i.response)}else n(`Failed to proxy resource ${t} with status code ${i.status}`)},i.onerror=n;const o=e.indexOf("?")>-1?"&":"?";if(i.open("GET",`${e}${o}url=${encodeURIComponent(A)}&responseType=${s}`),s!=="text"&&i instanceof XMLHttpRequest&&(i.responseType=s),this._options.imageTimeout){const a=this._options.imageTimeout;i.timeout=a,i.ontimeout=()=>n(`Timed out (${a}ms) proxying ${t}`)}i.send()})}};const Kb=/^data:image\/svg\+xml/i,$b=/^data:image\/.*;base64,/i,jb=/^data:image\/.*/i,Gb=A=>Ne.SUPPORT_SVG_DRAWING||!qb(A),cc=A=>jb.test(A),Wb=A=>$b.test(A),lc=A=>A.substring(0,4)==="blob",qb=A=>A.slice(-3).toLowerCase()==="svg"||Kb.test(A);var Jb=class{constructor(A){if(!A||!A.document)throw new Error("Valid window object required for OriginChecker");if(!A.location||!A.location.href)throw new Error("Window object must have valid location");this.link=A.document.createElement("a"),this.origin=this.getOrigin(A.location.href)}getOrigin(A){return this.link.href=A,this.link.href=this.link.href,this.link.protocol+this.link.hostname+this.link.port}isSameOrigin(A){return this.getOrigin(A)===this.origin}getContextOrigin(){return this.origin}},zb=(mr=class{constructor(e,t,r){this.windowBounds=t,this.instanceName=`#${mr.instanceCount++}`,this.config=r,this.logger=new Mb({id:this.instanceName,enabled:e.logging}),this.originChecker=new Jb(r.window),this.cache=e.cache??r.cache??new Vb(this,e),this.onError=e.onError}},mr.instanceCount=1,mr);const Xb=A=>{["scale","width","height","imageTimeout","x","y","windowWidth","windowHeight","scrollX","scrollY"].forEach(e=>{const t=A[e];if(t!=null&&typeof t!="number"){const r=Number(t);Number.isNaN(r)||(A[e]=r)}})},Yb=async(A,e,t)=>{if(Xb(e),!e.skipValidation){const Ce=e.validator||Ku(),pt=Ce.validateElement(A);if(!pt.valid)throw new Error(pt.error);const fA=Ce.validateOptions(e);if(!fA.valid)throw new Error(`Invalid options: ${fA.error}`)}if(!A||typeof A!="object")throw new Error("Invalid element provided as first argument");const r=A.ownerDocument;if(!r)throw new Error("Element is not attached to a Document");const n=r.defaultView;if(!n)throw new Error("Document is not attached to a Window");const s={allowTaint:e.allowTaint??!1,imageTimeout:e.imageTimeout??15e3,proxy:e.proxy,useCORS:e.useCORS??!1,customIsSameOrigin:e.customIsSameOrigin,maxCacheSize:e.maxCacheSize},i={logging:e.logging??!0,cache:e.cache??t.cache,...s},o=800,a=600,l=0,u=n,d={windowWidth:e.windowWidth??u.innerWidth??o,windowHeight:e.windowHeight??u.innerHeight??a,scrollX:e.scrollX??u.pageXOffset??l,scrollY:e.scrollY??u.pageYOffset??l},g=new rA(d.scrollX,d.scrollY,d.windowWidth,d.windowHeight),p=new zb(i,g,t),w=e.enablePerformanceMonitoring??e.logging??!1,y=new $u(p,w);y.start("total",{width:d.windowWidth,height:d.windowHeight});const B=e.signal;if(B!=null&&B.aborted)throw new DOMException("The operation was aborted.","AbortError");const b=e.foreignObjectRendering??!1,S={allowTaint:e.allowTaint??!1,onclone:e.onclone,ignoreElements:e.ignoreElements,iframeContainer:e.iframeContainer,inlineImages:b,copyStyles:b,cspNonce:e.cspNonce??t.cspNonce};p.logger.debug(`Starting document clone with size ${g.width}x${g.height} scrolled to ${-g.left},${-g.top}`),y.start("clone");const I=new Ac(p,A,S),R=I.clonedReferenceElement;if(!R)throw new Error("Unable to find element in cloned iframe");const K=await I.toIFrame(r,g);if(y.end("clone"),B!=null&&B.aborted)throw(e.removeContainer??!0)&&Ac.destroy(K),new DOMException("The operation was aborted.","AbortError");const{width:P,height:_,left:C,top:v}=Na(R)||UE(R)?VB(R.ownerDocument):Gs(p,R),U=Zb(p,R,e.backgroundColor),Q={canvas:e.canvas,backgroundColor:U,signal:B,scale:e.scale??n.devicePixelRatio??1,x:(e.x??0)+C,y:(e.y??0)+v,width:e.width??Math.ceil(P),height:e.height??Math.ceil(_),imageSmoothing:e.imageSmoothing,imageSmoothingQuality:e.imageSmoothingQuality};let F,E;try{if(b)p.logger.debug("Document cloned, using foreign object rendering"),y.start("render-foreignobject"),F=await new Nb(p,Q).render(R),y.end("render-foreignobject");else{if(p.logger.debug(`Document cloned, element located at ${C},${v} with size ${P}x${_} using computed rendering`),p.logger.debug("Starting DOM parsing"),y.start("parse"),B!=null&&B.aborted)throw new DOMException("The operation was aborted.","AbortError");if(E=Vd(p,R),y.end("parse"),U===E.styles.backgroundColor&&(E.styles.backgroundColor=Gt.TRANSPARENT),p.logger.debug(`Starting renderer for element at ${Q.x},${Q.y} with size ${Q.width}x${Q.height}`),y.start("render"),B!=null&&B.aborted)throw new DOMException("The operation was aborted.","AbortError");F=await new Ob(p,Q).render(E),y.end("render")}return y.start("cleanup"),(e.removeContainer??!0)&&(Ac.destroy(K)||p.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),y.end("cleanup"),y.end("total"),p.logger.debug("Finished rendering"),w&&y.logSummary(),F}finally{E&&E.restoreTree()}},Zb=(A,e,t)=>{const r=e.ownerDocument,n=r.documentElement?Fr(A,getComputedStyle(r.documentElement).backgroundColor):Gt.TRANSPARENT,s=r.body?Fr(A,getComputedStyle(r.body).backgroundColor):Gt.TRANSPARENT,i=typeof t=="string"?Fr(A,t):t===null?Gt.TRANSPARENT:4294967295;return e===r.documentElement?_A(n)?_A(s)?i:s:n:i},cf=(A,e={},t)=>Yb(A,e,t||Mu.fromElement(A,{cspNonce:e.cspNonce,cache:e.cache})),eU=Object.freeze(Object.defineProperty({__proto__:null,Html2CanvasConfig:Mu,PerformanceMonitor:$u,Validator:Vu,createDefaultValidator:Ku,default:cf,html2canvas:cf},Symbol.toStringTag,{value:"Module"}));/**
780
+ }`,qv=(A,e)=>{Jv(A,`.${rc}${Gv}${Jd}
781
+ .${nc}${Wv}${Jd}`,e)},Jv=(A,e,t)=>{const r=A.ownerDocument;if(r){const n=r.createElement("style");n.textContent=e,t&&(n.nonce=t),A.appendChild(n)}},zv=(A,e)=>{const t=A.ownerDocument.createElement("base");t.href=e;const r=A.getElementsByTagName("head").item(0);r==null||r.insertBefore(t,(r==null?void 0:r.firstChild)??null)},zd=(A,e)=>A.length===e.length?A.some((t,r)=>t===e[r]):!1,Xv=(A,e,t,r,n)=>A.map((s,i)=>{switch(i){case 0:return s.add(e,t);case 1:return s.add(e+r,t);case 2:return s.add(e+r,t+n);case 3:return s.add(e,t+n)}return s});var O=class pB{constructor(e,t){this.type=0,this.x=e,this.y=t}add(e,t){return new pB(this.x+e,this.y+t)}};const xr=(A,e,t)=>new O(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t);var Si=class Ks{constructor(e,t,r,n){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=n}subdivide(e,t){const r=xr(this.start,this.startControl,e),n=xr(this.startControl,this.endControl,e),s=xr(this.endControl,this.end,e),i=xr(r,n,e),o=xr(n,s,e),a=xr(i,o,e);return t?new Ks(this.start,r,i,a):new Ks(a,o,s,this.end)}add(e,t){return new Ks(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))}reverse(){return new Ks(this.end,this.endControl,this.startControl,this.start)}};const Ct=A=>A.type===1;var Yv=class{constructor(A){const e=A.styles,t=A.bounds;let[r,n]=Fn(e.borderTopLeftRadius,t.width,t.height),[s,i]=Fn(e.borderTopRightRadius,t.width,t.height),[o,a]=Fn(e.borderBottomRightRadius,t.width,t.height),[l,u]=Fn(e.borderBottomLeftRadius,t.width,t.height);const d=[];d.push((r+s)/t.width),d.push((l+o)/t.width),d.push((n+u)/t.height),d.push((i+a)/t.height);const g=Math.max(...d);g>1&&(r/=g,n/=g,s/=g,i/=g,o/=g,a/=g,l/=g,u/=g);const p=t.width-s,w=t.height-a,y=t.width-o,B=t.height-u,b=e.borderTopWidth,S=e.borderRightWidth,I=e.borderBottomWidth,R=e.borderLeftWidth,K=G(e.paddingTop,A.bounds.width),P=G(e.paddingRight,A.bounds.width),_=G(e.paddingBottom,A.bounds.width),C=G(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||n>0?ge(t.left+R/3,t.top+b/3,r-R/3,n-b/3,0):new O(t.left+R/3,t.top+b/3),this.topRightBorderDoubleOuterBox=r>0||n>0?ge(t.left+p,t.top+b/3,s-S/3,i-b/3,1):new O(t.left+t.width-S/3,t.top+b/3),this.bottomRightBorderDoubleOuterBox=o>0||a>0?ge(t.left+y,t.top+w,o-S/3,a-I/3,2):new O(t.left+t.width-S/3,t.top+t.height-I/3),this.bottomLeftBorderDoubleOuterBox=l>0||u>0?ge(t.left+R/3,t.top+B,l-R/3,u-I/3,3):new O(t.left+R/3,t.top+t.height-I/3),this.topLeftBorderDoubleInnerBox=r>0||n>0?ge(t.left+R*2/3,t.top+b*2/3,r-R*2/3,n-b*2/3,0):new O(t.left+R*2/3,t.top+b*2/3),this.topRightBorderDoubleInnerBox=r>0||n>0?ge(t.left+p,t.top+b*2/3,s-S*2/3,i-b*2/3,1):new O(t.left+t.width-S*2/3,t.top+b*2/3),this.bottomRightBorderDoubleInnerBox=o>0||a>0?ge(t.left+y,t.top+w,o-S*2/3,a-I*2/3,2):new O(t.left+t.width-S*2/3,t.top+t.height-I*2/3),this.bottomLeftBorderDoubleInnerBox=l>0||u>0?ge(t.left+R*2/3,t.top+B,l-R*2/3,u-I*2/3,3):new O(t.left+R*2/3,t.top+t.height-I*2/3),this.topLeftBorderStroke=r>0||n>0?ge(t.left+R/2,t.top+b/2,r-R/2,n-b/2,0):new O(t.left+R/2,t.top+b/2),this.topRightBorderStroke=r>0||n>0?ge(t.left+p,t.top+b/2,s-S/2,i-b/2,1):new O(t.left+t.width-S/2,t.top+b/2),this.bottomRightBorderStroke=o>0||a>0?ge(t.left+y,t.top+w,o-S/2,a-I/2,2):new O(t.left+t.width-S/2,t.top+t.height-I/2),this.bottomLeftBorderStroke=l>0||u>0?ge(t.left+R/2,t.top+B,l-R/2,u-I/2,3):new O(t.left+R/2,t.top+t.height-I/2),this.topLeftBorderBox=r>0||n>0?ge(t.left,t.top,r,n,0):new O(t.left,t.top),this.topRightBorderBox=s>0||i>0?ge(t.left+p,t.top,s,i,1):new O(t.left+t.width,t.top),this.bottomRightBorderBox=o>0||a>0?ge(t.left+y,t.top+w,o,a,2):new O(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=l>0||u>0?ge(t.left,t.top+B,l,u,3):new O(t.left,t.top+t.height),this.topLeftPaddingBox=r>0||n>0?ge(t.left+R,t.top+b,Math.max(0,r-R),Math.max(0,n-b),0):new O(t.left+R,t.top+b),this.topRightPaddingBox=s>0||i>0?ge(t.left+Math.min(p,t.width-S),t.top+b,p>t.width+S?0:Math.max(0,s-S),Math.max(0,i-b),1):new O(t.left+t.width-S,t.top+b),this.bottomRightPaddingBox=o>0||a>0?ge(t.left+Math.min(y,t.width-R),t.top+Math.min(w,t.height-I),Math.max(0,o-S),Math.max(0,a-I),2):new O(t.left+t.width-S,t.top+t.height-I),this.bottomLeftPaddingBox=l>0||u>0?ge(t.left+R,t.top+Math.min(B,t.height-I),Math.max(0,l-R),Math.max(0,u-I),3):new O(t.left+R,t.top+t.height-I),this.topLeftContentBox=r>0||n>0?ge(t.left+R+C,t.top+b+K,Math.max(0,r-(R+C)),Math.max(0,n-(b+K)),0):new O(t.left+R+C,t.top+b+K),this.topRightContentBox=s>0||i>0?ge(t.left+Math.min(p,t.width+R+C),t.top+b+K,p>t.width+R+C?0:s-R+C,i-(b+K),1):new O(t.left+t.width-(S+P),t.top+b+K),this.bottomRightContentBox=o>0||a>0?ge(t.left+Math.min(y,t.width-(R+C)),t.top+Math.min(w,t.height+b+K),Math.max(0,o-(S+P)),a-(I+_),2):new O(t.left+t.width-(S+P),t.top+t.height-(I+_)),this.bottomLeftContentBox=l>0||u>0?ge(t.left+R+C,t.top+B,Math.max(0,l-(R+C)),u-(I+_),3):new O(t.left+R+C,t.top+t.height-(I+_))}};const ge=(A,e,t,r,n)=>{const s=4*((Math.sqrt(2)-1)/3),i=t*s,o=r*s,a=A+t,l=e+r;switch(n){case 0:return new Si(new O(A,l),new O(A,l-o),new O(a-i,e),new O(a,e));case 1:return new Si(new O(A,e),new O(A+i,e),new O(a,l-o),new O(a,l));case 2:return new Si(new O(a,e),new O(a,e+o),new O(A+i,l),new O(A,l));default:return new Si(new O(a,l),new O(a-i,l),new O(A,e+o),new O(A,e))}},Ri=A=>[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox],Zv=A=>[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox],xi=A=>[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox];var sc=class{constructor(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}},ki=class{constructor(A,e){this.path=A,this.target=e,this.type=1}},eb=class{constructor(A){this.opacity=A,this.type=2,this.target=6}},Hn=class{constructor(A){this.applyClip=A,this.type=3,this.target=6}};const tb={[Le.NORMAL]:"source-over",[Le.MULTIPLY]:"multiply",[Le.SCREEN]:"screen",[Le.OVERLAY]:"overlay",[Le.DARKEN]:"darken",[Le.LIGHTEN]:"lighten",[Le.COLOR_DODGE]:"color-dodge",[Le.COLOR_BURN]:"color-burn",[Le.HARD_LIGHT]:"hard-light",[Le.SOFT_LIGHT]:"soft-light",[Le.DIFFERENCE]:"difference",[Le.EXCLUSION]:"exclusion",[Le.HUE]:"hue",[Le.SATURATION]:"saturation",[Le.COLOR]:"color",[Le.LUMINOSITY]:"luminosity"};var Ab=class{constructor(A){this.mixBlendMode=A,this.type=4,this.target=6,this.compositeOperation=tb[A]}},rb=class{constructor(A){this.filterString=A,this.type=5,this.target=6}};const nb=A=>A.type===0,Xd=A=>A.type===1,sb=A=>A.type===2,ib=A=>A.type===3,ob=A=>A.type===4,ab=A=>A.type===5;var Yd=class{constructor(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}},Zd=class{constructor(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Yv(this.container),this.container.styles.opacity<1&&this.effects.push(new eb(this.container.styles.opacity)),this.container.styles.rotate!==null){const t=this.container.styles.transformOrigin,r=this.container.bounds.left+G(t[0],this.container.bounds.width),n=this.container.bounds.top+G(t[1],this.container.bounds.height),s=this.container.styles.rotate*Math.PI/180,i=Math.cos(s),o=Math.sin(s),a=[i,o,-o,i,0,0];this.effects.push(new sc(r,n,a))}if(this.container.styles.transform!==null){const t=this.container.styles.transformOrigin,r=this.container.bounds.left+G(t[0],this.container.bounds.width),n=this.container.bounds.top+G(t[1],this.container.bounds.height),s=this.container.styles.transform;this.effects.push(new sc(r,n,s))}if(ef(this.container.styles)){const t=Ri(this.curves),r=xi(this.curves);zd(t,r)?this.effects.push(new ki(t,6)):(this.effects.push(new ki(t,2)),this.effects.push(new ki(r,4)))}if(this.container.styles.clipPath.type!==0){const t=cb(this.container.styles.clipPath,this.container.bounds);t&&this.effects.push(t)}if(this.container.styles.mixBlendMode!==Le.NORMAL&&this.effects.push(new Ab(this.container.styles.mixBlendMode)),this.container.styles.filter!==null&&this.effects.push(new rb(this.container.styles.filter)),this.container.styles.zoom!==1){const t=this.container.styles.transformOrigin,r=this.container.bounds.left+G(t[0],this.container.bounds.width),n=this.container.bounds.top+G(t[1],this.container.bounds.height),s=this.container.styles.zoom,i=[s,0,0,s,0,0];this.effects.push(new sc(r,n,i))}}getEffects(A){let e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent;const r=this.effects.slice(0);for(;t;){const n=t.effects.filter(s=>!Xd(s));if(e||t.container.styles.position!==0||!t.parent){if(e=[2,3].indexOf(t.container.styles.position)===-1,ef(t.container.styles)){const s=Ri(t.curves),i=xi(t.curves);zd(s,i)||r.unshift(new ki(i,6))}r.unshift(...n)}else r.unshift(...n);t=t.parent}return r.filter(n=>Pe(n.target,A))}};const ef=A=>A.overflowX!==0||A.overflowY!==0,tf=(A,e,t,r,n)=>A==="closest-side"?Math.min(e-t,r-e):A==="farthest-side"?Math.max(e-t,r-e):G(A,n),cb=(A,e)=>{const{left:t,top:r,width:n,height:s}=e;switch(A.type){case 1:{const i=G(A.left,n),o=G(A.top,s),a=t+i,l=r+o,u=Math.max(0,n-i-G(A.right,n)),d=Math.max(0,s-o-G(A.bottom,s));return new Hn(g=>{g.beginPath(),g.rect(a,l,u,d),g.clip()})}case 2:{const i=t+G(A.cx,n),o=r+G(A.cy,s);let a;return A.radius==="closest-side"?a=Math.min(i-t,o-r,t+n-i,r+s-o):A.radius==="farthest-side"?a=Math.max(i-t,o-r,t+n-i,r+s-o):a=G(A.radius,Math.sqrt(n*n+s*s)/Math.SQRT2),new Hn(l=>{l.beginPath(),l.arc(i,o,Math.max(0,a),0,Math.PI*2),l.clip()})}case 3:{const i=t+G(A.cx,n),o=r+G(A.cy,s),a=tf(A.rx,i,t,t+n,n),l=tf(A.ry,o,r,r+s,s);return new Hn(u=>{u.beginPath(),u.ellipse(i,o,Math.max(0,a),Math.max(0,l),0,0,Math.PI*2),u.clip()})}case 4:{const i=A.points.map(([o,a])=>[t+G(o,n),r+G(a,s)]);return new Hn(o=>{if(o.beginPath(),i.length>0){o.moveTo(i[0][0],i[0][1]);for(let a=1;a<i.length;a++)o.lineTo(i[a][0],i[a][1]);o.closePath()}o.clip()})}case 5:{const{d:i}=A;let o=null;return new Hn(a=>{try{o||(o=new Path2D(i));const l=a.getTransform();a.translate(t,r),a.clip(o),a.setTransform(l)}catch{}})}case 0:return null;default:return null}},ic=(A,e,t,r)=>{A.container.elements.forEach(n=>{const s=n.createsRealStackingContext,i=n.createsStackingContext,o=new Zd(n,A);Pe(n.styles.display,2048)&&r.push(o);const a=n.isListOwner?[]:r;if(s||i){const l=s||n.styles.isPositioned()?t:e,u=new Yd(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){const d=n.styles.zIndex.order;if(d<0){let g=0;l.negativeZIndex.some((p,w)=>d>p.element.container.styles.zIndex.order?(g=w,!1):g>0),l.negativeZIndex.splice(g,0,u)}else if(d>0){let g=0;l.positiveZIndex.some((p,w)=>d>=p.element.container.styles.zIndex.order?(g=w+1,!1):g>0),l.positiveZIndex.splice(g,0,u)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else n.styles.isFloating()?l.nonPositionedFloats.push(u):l.nonPositionedInlineLevel.push(u);ic(o,u,s?u:t,a)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),ic(o,e,t,a);n.isListOwner&&Af(n,a)})},Af=(A,e)=>{let t=A instanceof Za?A.start:1;const r=A instanceof Za?A.reversed:!1;for(let n=0;n<e.length;n++){const s=e[n];s.container instanceof Dd&&typeof s.container.value=="number"&&s.container.value!==0&&(t=s.container.value),s.listValue=Dn(t,s.container.styles.listStyleType,!0),t+=r?-1:1}},lb=A=>{const e=new Zd(A,null),t=new Yd(e),r=[];return ic(e,t,t,r),Af(e.container,r),t},rf=A=>{const e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},On=A=>{const e=A.styles,t=A.bounds,r=G(e.paddingLeft,t.width),n=G(e.paddingRight,t.width),s=G(e.paddingTop,t.width),i=G(e.paddingBottom,t.width);return t.add(r+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+r+n),-(e.borderTopWidth+e.borderBottomWidth+s+i))},ub=(A,e)=>A===0?e.bounds:A===2?On(e):rf(e),hb=(A,e)=>A===0?e.bounds:A===2?On(e):rf(e),Li=(A,e,t)=>{const r=ub(Lr(A.styles.backgroundOrigin,e),A),n=hb(Lr(A.styles.backgroundClip,e),A),s=db(Lr(A.styles.backgroundSize,e),t,r);let[i,o]=s;const a=Fn(Lr(A.styles.backgroundPosition,e),r.width-i,r.height-o),l=fb(Lr(A.styles.backgroundRepeat,e),a,s,r,n),u=Math.round(r.left+a[0]),d=Math.round(r.top+a[1]);return i=Math.max(1,i),o=Math.max(1,o),[l,u,d,i,o]},kr=A=>J(A)&&A.value==="auto",Di=A=>typeof A=="number",db=(A,[e,t,r],n)=>{const[s,i]=A;if(!s)return[0,0];if(oe(s)&&i&&oe(i))return[G(s,n.width),G(i,n.height)];const o=Di(r);if(J(s)&&(s.value==="contain"||s.value==="cover"))return Di(r)?n.width/n.height<r!=(s.value==="cover")?[n.width,n.width/r]:[n.height*r,n.height]:[n.width,n.height];const a=Di(e),l=Di(t),u=a||l;if(kr(s)&&(!i||kr(i)))return a&&l?[e,t]:!o&&!u?[n.width,n.height]:u&&o?[a?e:t*r,l?t:e/r]:[a?e:n.width,l?t:n.height];if(o){let p=0,w=0;return oe(s)?p=G(s,n.width):oe(i)&&(w=G(i,n.height)),kr(s)?p=w*r:(!i||kr(i))&&(w=p/r),[p,w]}let d=null,g=null;if(oe(s)?d=G(s,n.width):i&&oe(i)&&(g=G(i,n.height)),d!==null&&(!i||kr(i))&&(g=a&&l?d/e*t:n.height),g!==null&&kr(s)&&(d=a&&l?g/t*e:n.width),d!==null&&g!==null)return[d,g];throw new Error("Unable to calculate background-size for element")},Lr=(A,e)=>{const t=A[e];return typeof t>"u"?A[0]:t},fb=(A,[e,t],[r,n],s,i)=>{switch(A){case 2:return[new O(Math.round(s.left),Math.round(s.top+t)),new O(Math.round(s.left+s.width),Math.round(s.top+t)),new O(Math.round(s.left+s.width),Math.round(n+s.top+t)),new O(Math.round(s.left),Math.round(n+s.top+t))];case 3:return[new O(Math.round(s.left+e),Math.round(s.top)),new O(Math.round(s.left+e+r),Math.round(s.top)),new O(Math.round(s.left+e+r),Math.round(s.height+s.top)),new O(Math.round(s.left+e),Math.round(s.height+s.top))];case 1:return[new O(Math.round(s.left+e),Math.round(s.top+t)),new O(Math.round(s.left+e+r),Math.round(s.top+t)),new O(Math.round(s.left+e+r),Math.round(s.top+t+n)),new O(Math.round(s.left+e),Math.round(s.top+t+n))];default:return[new O(Math.round(i.left),Math.round(i.top)),new O(Math.round(i.left+i.width),Math.round(i.top)),new O(Math.round(i.left+i.width),Math.round(i.height+i.top)),new O(Math.round(i.left),Math.round(i.height+i.top))]}},gb="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",nf="Hidden Text";var pb=class{constructor(A){this._data={},this._document=A}parseMetrics(A,e){const t=this._document.createElement("div"),r=this._document.createElement("img"),n=this._document.createElement("span"),s=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",s.appendChild(t),r.src=gb,r.width=1,r.height=1,r.style.margin="0",r.style.padding="0",r.style.verticalAlign="baseline",n.style.fontFamily=A,n.style.fontSize=e,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(nf)),t.appendChild(n),t.appendChild(r);const i=r.offsetTop-n.offsetTop+2;t.removeChild(n),t.appendChild(this._document.createTextNode(nf)),t.style.lineHeight="normal",r.style.verticalAlign="super";const o=r.offsetTop-t.offsetTop+2;return s.removeChild(t),{baseline:i,middle:o}}getMetrics(A,e){const t=`${A} ${e}`;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]}},wb=class{constructor(A){this.ctx=A}render(A,e){this.ctx.fillStyle=me(e.textDecorationColor||e.color);let t=1;typeof e.textDecorationThickness=="number"?t=e.textDecorationThickness:e.textDecorationThickness==="from-font"&&(t=Math.max(1,Math.floor(e.fontSize.number*.05)));let r=0;typeof e.textUnderlineOffset=="number"&&(r=e.textUnderlineOffset);const n=e.textDecorationStyle;e.textDecorationLine.forEach(s=>{let i=0;switch(s){case 1:i=A.top+A.height-t+r;break;case 2:i=A.top;break;case 3:i=A.top+(A.height/2-t/2);break;default:return}this.draw(A.left,i,A.width,t,n)})}draw(A,e,t,r,n){switch(n){case 0:this.ctx.fillRect(A,e,t,r);break;case 1:{const s=Math.max(1,r);this.ctx.fillRect(A,e,t,r),this.ctx.fillRect(A,e+r+s,t,r);break}case 2:this.drawPattern(A,e,t,r,[r,r*2]);break;case 3:this.drawPattern(A,e,t,r,[r*3,r*2]);break;case 4:this.drawWavy(A,e,t,r);break;default:this.ctx.fillRect(A,e,t,r)}}drawPattern(A,e,t,r,n){this.ctx.save(),this.ctx.beginPath(),this.ctx.setLineDash(n),this.ctx.lineWidth=r,this.ctx.strokeStyle=this.ctx.fillStyle,this.ctx.moveTo(A,e+r/2),this.ctx.lineTo(A+t,e+r/2),this.ctx.stroke(),this.ctx.restore()}drawWavy(A,e,t,r){this.ctx.save(),this.ctx.beginPath(),this.ctx.lineWidth=r,this.ctx.strokeStyle=this.ctx.fillStyle;const n=r*2,s=r*4;let i=A;for(this.ctx.moveTo(i,e+r/2);i<A+t;){const o=Math.min(i+s/2,A+t);if(this.ctx.quadraticCurveTo(i+s/4,e+r/2-n,o,e+r/2),i=o,i<A+t){const a=Math.min(i+s/2,A+t);this.ctx.quadraticCurveTo(i+s/4,e+r/2+n,a,e+r/2),i=a}}this.ctx.stroke(),this.ctx.restore()}};const mb=["-apple-system","system-ui"],Bb=/[\u2E80-\u2FFF\u3000-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFFEF]/,oc=A=>Bb.test(A),yb=()=>{if(typeof navigator>"u")return null;const A=navigator.userAgent,e=/iPhone|iPad|iPod/.test(A),t=/Macintosh/.test(A)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1;if(!e&&!t)return null;for(const r of[/(?:iPhone|CPU(?:\siPhone)?)\sOS\s(\d+)[\._](\d+)/,/Version\/(\d+)\.(\d+)/]){const n=A.match(r);if(n&&n[1])return parseInt(n[1],10)}return null},Cb=A=>{const e=yb();return e!==null&&e>=15&&e<17?A.map(t=>mb.indexOf(t)!==-1?'-apple-system, "Helvetica Neue", Arial, sans-serif':t):A},_b=()=>{var A;return(A=typeof window<"u"?window:void 0)!=null&&A.chrome?"miter":"round"};var Eb=class{constructor(A){this.ctx=A.ctx,this.options=A.options,this.decorationRenderer=new wb(A.ctx)}iterateLettersWithLetterSpacing(A,e,t,r,n){if(Oa(r)){this.iterateVerticalGlyphs(A,e,t,r,n);return}const s=Sr(A.text),i=A.bounds.top+t;let o=A.bounds.left;for(const a of s){if(oc(a)){const l=this.ctx.textBaseline;this.ctx.textBaseline="ideographic",n(a,o,i),this.ctx.textBaseline=l}else n(a,o,i);o+=this.ctx.measureText(a).width+e}}iterateVerticalGlyphs(A,e,t,r,n){const s=Sr(A.text);let i=A.bounds.top;for(const o of s){if(R0(r)||!oc(o)&&o.trim().length>0)this.ctx.save(),this.ctx.translate(A.bounds.left+t,i),this.ctx.rotate(r===4?-Math.PI/2:Math.PI/2),n(o,0,0),this.ctx.restore();else{const a=this.ctx.textBaseline;oc(o)&&(this.ctx.textBaseline="ideographic"),n(o,A.bounds.left,i+t),this.ctx.textBaseline=a}i+=this.ctx.measureText(o).width+e}}renderTextWithLetterSpacing(A,e,t,r=0){this.renderFillText(A,e,t,r)}canRenderWholeText(A,e){return A===0&&!Oa(e)}renderFillText(A,e,t,r){this.canRenderWholeText(e,r)?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):this.iterateLettersWithLetterSpacing(A,e,t,r,(n,s,i)=>{this.ctx.fillText(n,s,i)})}renderStrokeText(A,e,t,r){this.canRenderWholeText(e,r)?this.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+t):this.iterateLettersWithLetterSpacing(A,e,t,r,(n,s,i)=>{this.ctx.strokeText(n,s,i)})}renderTextStrokeWithStyle(A,e){!e.webkitTextStrokeWidth||!A.text.trim().length||(this.ctx.strokeStyle=me(e.webkitTextStrokeColor),this.ctx.lineWidth=e.webkitTextStrokeWidth,this.ctx.lineJoin=_b(),this.renderStrokeText(A,e.letterSpacing,e.fontSize.number,e.writingMode),this.ctx.strokeStyle="",this.ctx.lineWidth=0,this.ctx.lineJoin="miter")}renderTextFillWithShadows(A,e){this.ctx.fillStyle=me(e.color),this.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number,e.writingMode);const t=e.textShadow;t.length&&A.text.trim().length&&(t.slice(0).reverse().forEach(r=>{this.ctx.shadowColor=me(r.color),this.ctx.shadowOffsetX=r.offsetX.number*this.options.scale,this.ctx.shadowOffsetY=r.offsetY.number*this.options.scale,this.ctx.shadowBlur=r.blur.number,this.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number,e.writingMode)}),this.ctx.shadowColor="",this.ctx.shadowOffsetX=0,this.ctx.shadowOffsetY=0,this.ctx.shadowBlur=0)}renderTextBoundWithPaintOrder(A,e,t){t.forEach(r=>{switch(r){case 0:this.ctx.fillStyle=me(e.color),this.renderTextWithLetterSpacing(A,e.letterSpacing,e.fontSize.number,e.writingMode);break;case 1:this.renderTextStrokeWithStyle(A,e);break}})}renderTextDecoration(A,e){this.decorationRenderer.render(A,e)}truncateTextWithEllipsis(A,e,t){const r="…",n=this.ctx.measureText(r).width,s=Sr(A);if(t===0){const i=l=>this.ctx.measureText(s.slice(0,l).join("")).width+n<=e;let o=0,a=s.length;for(;o<a;){const l=o+a+1>>1;i(l)?o=l:a=l-1}return s.slice(0,o).join("")+r}else{let i=n;const o=[];for(const a of s){const l=this.ctx.measureText(a).width;if(i+l>e)break;o.push(a),i+=l+t}return o.join("")+r}}createFontStyle(A){const e=A.fontVariant.filter(n=>n==="normal"||n==="small-caps").join(""),t=Cb(A.fontFamily).join(", "),r=jt(A.fontSize)?`${A.fontSize.number}${A.fontSize.unit}`:`${A.fontSize.number}px`;return[[A.fontStyle,e,A.fontWeight,r,t].join(" "),t,r]}renderLineClampedText(A,e,t,r){const n=e.fontSize.number*1.5,s=[];let i=[],o=A.textBounds[0].bounds.top;A.textBounds.forEach(u=>{Math.abs(u.bounds.top-o)>=n*.5?(i.length>0&&s.push(i),i=[u],o=u.bounds.top):i.push(u)}),i.length>0&&s.push(i);const a=e.webkitLineClamp;if(s.length<=a)return!1;for(let u=0;u<a-1;u++)s[u].forEach(d=>this.renderTextBoundWithPaintOrder(d,e,t));const l=s[a-1];if(l!=null&&l.length&&r){const u=l.map(w=>w.text).join(""),d=l[0],g=r.width-(d.bounds.left-r.left),p=new JA(this.truncateTextWithEllipsis(u,g,e.letterSpacing),d.bounds);for(const w of t)w===0?(this.ctx.fillStyle=me(e.color),this.renderTextWithLetterSpacing(p,e.letterSpacing,e.fontSize.number,e.writingMode)):w===1&&this.renderTextStrokeWithStyle(p,e)}return!0}renderEllipsisText(A,e,t,r){const n=e.fontSize.number*1.5,s=A.textBounds[0].bounds.top;if(!A.textBounds.every(a=>Math.abs(a.bounds.top-s)<n*.5))return!1;let i=A.textBounds.map(a=>a.text).join("").replace(/\s+/g," ").trim();if(this.ctx.measureText(i).width<=r.width)return!1;const o=new JA(this.truncateTextWithEllipsis(i,r.width,e.letterSpacing),A.textBounds[0].bounds);for(const a of t)a===0?this.renderTextFillWithShadows(o,e):a===1&&this.renderTextStrokeWithStyle(o,e);return!0}async renderTextNode(A,e,t){this.ctx.font=this.createFontStyle(e)[0],this.ctx.direction=e.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic";const r=e.paintOrder;e.webkitLineClamp>0&&e.display&2&&e.overflowY===1&&A.textBounds.length>0&&this.renderLineClampedText(A,e,r,t)||e.textOverflow===1&&t&&e.overflowX===1&&A.textBounds.length>0&&this.renderEllipsisText(A,e,r,t)||A.textBounds.forEach(n=>{r.forEach(s=>{s===0?(this.renderTextFillWithShadows(n,e),e.textDecorationLine.length&&this.renderTextDecoration(n.bounds,e)):s===1&&this.renderTextStrokeWithStyle(n,e)})})}};const sf=(A,e)=>{e.forEach((t,r)=>{const n=Ct(t)?t.start:t;r===0?A.moveTo(n.x,n.y):A.lineTo(n.x,n.y),Ct(t)&&A.bezierCurveTo(t.startControl.x,t.startControl.y,t.endControl.x,t.endControl.y,t.end.x,t.end.y)})},of=(A,e)=>{A.beginPath(),sf(A,e),A.closePath()};var vb=(wr=class{constructor(e){this.patternCache=new Map,this.ctx=e.ctx,this.context=e.context,this.canvas=e.canvas}async renderBackgroundImage(e){let t=e.styles.backgroundImage.length-1;const r=e.styles.backgroundBlendMode;let n=0;for(const s of e.styles.backgroundImage.slice(0).reverse()){if(n>0){const i=r[n]??r[0]??"normal";i!=="normal"&&(this.ctx.save(),this.ctx.globalCompositeOperation=i)}s.type===0?await this.renderBackgroundURLImage(e,s,t):b_(s)?this.renderLinearGradient(e,s,t):Q_(s)?this.renderRepeatingLinearGradient(e,s,t):U_(s)&&this.renderRadialGradient(e,s,t),n>0&&(r[n]??r[0]??"normal")!=="normal"&&this.ctx.restore(),t--,n++}}async renderBackgroundURLImage(e,t,r){var i,o;let n;const s=t.url;try{n=await this.context.cache.match(s)}catch(a){this.context.logger.error(`Error loading background-image ${s}`),(o=(i=this.context).onError)==null||o.call(i,a instanceof Error?a:new Error(String(a)))}if(n){const a=isNaN(n.width)||n.width===0?1:n.width,l=isNaN(n.height)||n.height===0?1:n.height,[u,d,g,p,w]=Li(e,r,[a,l,a/l]),y=`${s}|${Math.round(p)}x${Math.round(w)}|${e.styles.imageRendering}`;let B=this.lruGet(this.patternCache,y);if(!B){const b=this.resizeImage(n,p,w,e.styles.imageRendering);B=this.ctx.createPattern(b,"repeat"),this.lruSet(this.patternCache,y,B)}this.renderRepeat(u,B,d,g)}}renderRepeatingLinearGradient(e,t,r){const[n,s,i,o,a]=Li(e,r,[null,null,null]),[l,u,d,g,p]=Mh(t.angle,o,a),w=ka(t.stops,l||1),y=w[w.length-1],B=w[0],b=y.stop-B.stop;if(b<=0){this.renderLinearGradient(e,t,r);return}const S=d-u,I=p-g,R=b/(Math.sqrt(S*S+I*I)||1),K=u,P=g,_=u+S*R,C=g+I*R,v=this.canvas.ownerDocument??document,U=`rlg|${t.angle}|${Math.round(b)}|${JSON.stringify(t.stops)}`;let Q=this.lruGet(this.patternCache,U);if(!Q){const F=v.createElement("canvas"),E=Math.max(1,Math.ceil(b));F.width=E,F.height=E;const Ce=F.getContext("2d");if(!Ce)return;const pt=Ce.createLinearGradient(K-s,P-i,_-s,C-i);w.forEach(fA=>{pt.addColorStop((fA.stop-B.stop)/b,me(fA.color))}),Ce.fillStyle=pt,Ce.fillRect(0,0,E,E),E>0&&(Q=this.ctx.createPattern(F,"repeat"),this.lruSet(this.patternCache,U,Q))}Q&&this.renderRepeat(n,Q,s,i)}renderLinearGradient(e,t,r){const[n,s,i,o,a]=Li(e,r,[null,null,null]),[l,u,d,g,p]=Mh(t.angle,o,a),w=`lg|${t.angle}|${Math.round(o)}x${Math.round(a)}|${JSON.stringify(t.stops)}`;let y=this.lruGet(this.patternCache,w);if(!y){const B=(this.canvas.ownerDocument??document).createElement("canvas");B.width=o,B.height=a;const b=B.getContext("2d");if(!b)return;const S=b.createLinearGradient(u,g,d,p);ka(t.stops,l||1).forEach(I=>S.addColorStop(I.stop,me(I.color))),b.fillStyle=S,b.fillRect(0,0,o,a),o>0&&a>0&&(y=this.ctx.createPattern(B,"repeat"),this.lruSet(this.patternCache,w,y))}y&&this.renderRepeat(n,y,s,i)}renderRadialGradient(e,t,r){const[n,s,i,o,a]=Li(e,r,[null,null,null]),l=t.position.length===0?[sA]:t.position,u=G(l[0],o),d=G(l[l.length-1],a);let[g,p]=__(t,u,d,o,a);if((g===0||p===0)&&(g=Math.max(g,.01),p=Math.max(p,.01)),g>0&&p>0){const w=`rg|${Math.round(u)}x${Math.round(d)}|${Math.round(g)}x${Math.round(p)}|${JSON.stringify(t.stops)}`;let y=this.lruGet(this.patternCache,w);if(!y){const B=this.canvas.ownerDocument??document,b=Math.ceil(Math.max(g,p)*2),S=B.createElement("canvas");S.width=b,S.height=b;const I=S.getContext("2d");if(I){const R=Math.max(g,p),K=I.createRadialGradient(R,R,0,R,R,R);ka(t.stops,R*2).forEach(P=>K.addColorStop(P.stop,me(P.color))),I.fillStyle=K,g!==p&&I.scale(1,p/g),I.fillRect(0,0,R*2,R*2),y=this.ctx.createPattern(S,"no-repeat"),this.lruSet(this.patternCache,w,y)}}y&&(this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.translate(s+u-Math.max(g,p),i+d-Math.max(g,p)),this.ctx.fillStyle=y,this.ctx.fillRect(0,0,Math.max(g,p)*2,Math.max(g,p)*2),this.ctx.restore())}}renderRepeat(e,t,r,n){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(r,n),this.ctx.fill(),this.ctx.translate(-r,-n)}resizeImage(e,t,r,n){const s=(this.canvas.ownerDocument??document).createElement("canvas");s.width=Math.max(1,t),s.height=Math.max(1,r);const i=s.getContext("2d");return i?(n===2||n===1?(this.context.logger.debug("Disabling image smoothing for background image due to CSS image-rendering"),i.imageSmoothingEnabled=!1):n===3?(this.context.logger.debug("Enabling image smoothing for background image due to CSS image-rendering: smooth"),i.imageSmoothingEnabled=!0):i.imageSmoothingEnabled=this.ctx.imageSmoothingEnabled,this.ctx.imageSmoothingQuality&&(i.imageSmoothingQuality=this.ctx.imageSmoothingQuality),i.drawImage(e,0,0,e.width,e.height,0,0,t,r),s):e}path(e){of(this.ctx,e)}lruGet(e,t){const r=e.get(t);return r!==void 0&&(e.delete(t),e.set(t,r)),r}lruSet(e,t,r){if(e.size>=wr.PATTERN_CACHE_MAX){const n=e.keys().next().value;e.delete(n)}e.set(t,r)}},wr.PATTERN_CACHE_MAX=50,wr);const af=(A,e)=>{switch(e){case 0:return _t(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return _t(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return _t(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return _t(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},bb=(A,e)=>{switch(e){case 0:return _t(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return _t(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return _t(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return _t(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Ub=(A,e)=>{switch(e){case 0:return _t(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return _t(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return _t(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return _t(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},Qb=(A,e)=>{switch(e){case 0:return Hi(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return Hi(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return Hi(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return Hi(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},Hi=(A,e)=>{const t=[];return Ct(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ct(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},_t=(A,e,t,r)=>{const n=[];return Ct(A)?n.push(A.subdivide(.5,!1)):n.push(A),Ct(t)?n.push(t.subdivide(.5,!0)):n.push(t),Ct(r)?n.push(r.subdivide(.5,!0).reverse()):n.push(r),Ct(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n};var Ib=class{constructor(A,e){this.ctx=A.ctx,this.pathCallbacks=e}async renderSolidBorder(A,e,t){this.pathCallbacks.path(af(t,e)),this.ctx.fillStyle=me(A),this.ctx.fill()}async renderDoubleBorder(A,e,t,r){if(e<3){await this.renderSolidBorder(A,t,r);return}const n=bb(r,t);this.pathCallbacks.path(n),this.ctx.fillStyle=me(A),this.ctx.fill();const s=Ub(r,t);this.pathCallbacks.path(s),this.ctx.fill()}async renderDashedDottedBorder(A,e,t,r,n){this.ctx.save();const s=Qb(r,t),i=af(r,t);n===2&&(this.pathCallbacks.path(i),this.ctx.clip());let o,a,l,u;Ct(i[0])?(o=i[0].start.x,a=i[0].start.y):(o=i[0].x,a=i[0].y),Ct(i[1])?(l=i[1].end.x,u=i[1].end.y):(l=i[1].x,u=i[1].y);let d;t===0||t===2?d=Math.abs(o-l):d=Math.abs(a-u),this.ctx.beginPath(),n===3?this.pathCallbacks.formatPath(s):this.pathCallbacks.formatPath(i.slice(0,2));let g=e<3?e*3:e*2,p=e<3?e*2:e;n===3&&(g=e,p=e);let w=!0;if(d<=g*2)w=!1;else if(d<=g*2+p){const y=d/(2*g+p);g*=y,p*=y}else{const y=Math.floor((d+p)/(g+p)),B=(d-y*g)/(y-1),b=(d-(y+1)*g)/y;p=b<=0||Math.abs(p-B)<Math.abs(p-b)?B:b}if(w&&(n===3?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),n===3?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=e*2+1.1,this.ctx.strokeStyle=me(A),this.ctx.stroke(),this.ctx.setLineDash([]),n===2){if(Ct(i[0])){const y=i[3],B=i[0];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(y.end.x,y.end.y),new O(B.start.x,B.start.y)]),this.ctx.stroke()}if(Ct(i[1])){const y=i[1],B=i[2];this.ctx.beginPath(),this.pathCallbacks.formatPath([new O(y.end.x,y.end.y),new O(B.start.x,B.start.y)]),this.ctx.stroke()}}this.ctx.restore()}},Fb=class{constructor(A){this.ctx=A}renderBorderImage(A,e,t,r,n,s,i,o){const a=e.naturalWidth||e.width,l=e.naturalHeight||e.height;if(a<=0||l<=0)return;const u=Math.min(t.unit==="percent"?t.top/100*l:Math.min(t.top,l),l),d=Math.min(t.unit==="percent"?t.right/100*a:Math.min(t.right,a),a),g=Math.min(t.unit==="percent"?t.bottom/100*l:Math.min(t.bottom,l),l),p=Math.min(t.unit==="percent"?t.left/100*a:Math.min(t.left,a),a),{left:w,top:y,width:B,height:b}=A;if(B<=0||b<=0)return;const S=Math.min(n,b),I=Math.min(s,B),R=Math.min(i,b-S),K=Math.min(o,B-I);this.drawRegion(e,0,0,p,u,w,y,K,S),this.drawRegion(e,a-d,0,d,u,w+B-I,y,I,S),this.drawRegion(e,a-d,l-g,d,g,w+B-I,y+b-R,I,R),this.drawRegion(e,0,l-g,p,g,w,y+b-R,K,R);const P=[{sx:p,sy:0,sw:a-p-d,sh:u,dx:w+K,dy:y,dw:B-K-I,dh:S,repeat:r.horizontal},{sx:a-d,sy:u,sw:d,sh:l-u-g,dx:w+B-I,dy:y+S,dw:I,dh:b-S-R,repeat:r.vertical},{sx:p,sy:l-g,sw:a-p-d,sh:g,dx:w+K,dy:y+b-R,dw:B-K-I,dh:R,repeat:r.horizontal},{sx:0,sy:u,sw:p,sh:l-u-g,dx:w,dy:y+S,dw:K,dh:b-S-R,repeat:r.vertical}];for(const _ of P){if(_.sw<=0||_.sh<=0||_.dw<=0||_.dh<=0)continue;const C=_.dw>=_.dh;_.repeat===0?this.ctx.drawImage(e,_.sx,_.sy,_.sw,_.sh,_.dx,_.dy,_.dw,_.dh):(_.repeat===1||_.repeat===2)&&this.drawRepeatedEdge(e,_,C,_.repeat===2)}if(t.fill){const _=p,C=u,v=a-p-d,U=l-u-g,Q=w+K,F=y+S,E=B-K-I,Ce=b-S-R;this.drawRegion(e,_,C,v,U,Q,F,E,Ce)}}drawRegion(A,e,t,r,n,s,i,o,a){r>0&&n>0&&o>0&&a>0&&this.ctx.drawImage(A,e,t,r,n,s,i,o,a)}drawRepeatedEdge(A,e,t,r){const n=t?e.sw:e.sh,s=t?e.dw:e.dh;if(n<=0||s<=0)return;let i,o;r?(o=Math.max(1,Math.round(s/n)),i=s/o):(i=n,o=Math.ceil(s/i)),this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(e.dx,e.dy,e.dw,e.dh),this.ctx.clip();for(let a=0;a<o;a++){const l=a*i,u=s-l,d=Math.min(i,u);if(d<=0)break;t?this.ctx.drawImage(A,e.sx,e.sy,e.sw,e.sh,e.dx+l,e.dy,d,e.dh):this.ctx.drawImage(A,e.sx,e.sy,e.sw,e.sh,e.dx,e.dy+l,e.dw,d)}this.ctx.restore()}},Tb=class{constructor(A,e){this.activeEffects=[],this.ctx=A.ctx,this.pathCallback=e}applyEffects(A){for(;this.activeEffects.length;)this.popEffect();A.forEach(e=>this.applyEffect(e))}applyEffect(A){if(this.ctx.save(),sb(A))this.ctx.globalAlpha=A.opacity;else if(nb(A))this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY);else if(Xd(A))this.pathCallback.path(A.path),this.ctx.clip();else if(ib(A))A.applyClip(this.ctx);else if(ob(A))this.ctx.globalCompositeOperation=A.compositeOperation;else if(ab(A)){const e=A.filterString.replace(/drop-shadow\([^)]+\)\s*/g,"").trim();this.ctx.filter=e||"none"}this.activeEffects.push(A)}popEffect(){this.activeEffects.pop(),this.ctx.restore()}getActiveEffectCount(){return this.activeEffects.length}hasActiveEffects(){return this.activeEffects.length>0}};const Sb=(A,e,t,r,n)=>{let s=0,i=0,o=A,a=e,l=t.left,u=t.top,d=t.width,g=t.height;const p=d/g,w=o/a,y=n?G(n[0],1):.5,B=n?G(n[1],1):.5;return r===2?w>p?(g=d/w,u+=(t.height-g)*B):(d=g*w,l+=(t.width-d)*y):r===4?w>p?(o=a*p,s+=(A-o)*y):(a=o/p,i+=(e-a)*B):r===8?(o>d?(s+=(o-d)*y,o=d):(l+=(d-o)*y,d=o),a>g?(i+=(a-g)*B,a=g):(u+=(g-a)*B,g=a)):r===16&&((w>p?d:g*w)<(o>d?o:d)?w>p?(g=d/w,u+=(t.height-g)*B):(d=g*w,l+=(t.width-d)*y):(o>d?(s+=(o-d)*y,o=d):(l+=(d-o)*y,d=o),a>g?(i+=(a-g)*B,a=g):(u+=(g-a)*B,g=a))),{sx:s,sy:i,sw:o,sh:a,dx:l,dy:u,dw:d,dh:g}};async function Rb(A,e,t,r,n,s,i,o){var a,l;if(n instanceof xd)try{const u=await e.cache.match(n.src),d=A.imageSmoothingEnabled;i.imageRendering===2||i.imageRendering===1?A.imageSmoothingEnabled=!1:i.imageRendering===3&&(A.imageSmoothingEnabled=!0),o(n,s,u),A.imageSmoothingEnabled=d}catch(u){e.logger.error(`Error loading image ${n.src}`),(a=e.onError)==null||a.call(e,u instanceof Error?u:new Error(String(u)))}if(n instanceof kd&&o(n,s,n.canvas),n instanceof Ld)try{o(n,s,await e.cache.match(n.svg))}catch(u){e.logger.error(`Error loading svg ${n.svg.substring(0,255)}`),(l=e.onError)==null||l.call(e,u instanceof Error?u:new Error(String(u)))}if(n instanceof Nd&&n.tree){const u=await r(e,{scale:t.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}).render(n.tree);n.width&&n.height&&A.drawImage(u,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height)}}function xb(A,e,t,r,n,s){if(n instanceof Ln){const i=Math.min(n.bounds.width,n.bounds.height);n.type==="checkbox"&&n.checked?(A.save(),r([new O(n.bounds.left+i*.39363,n.bounds.top+i*.79),new O(n.bounds.left+i*.16,n.bounds.top+i*.5549),new O(n.bounds.left+i*.27347,n.bounds.top+i*.44071),new O(n.bounds.left+i*.39694,n.bounds.top+i*.5649),new O(n.bounds.left+i*.72983,n.bounds.top+i*.23),new O(n.bounds.left+i*.84,n.bounds.top+i*.34085),new O(n.bounds.left+i*.39363,n.bounds.top+i*.79)]),A.fillStyle=me(Hd),A.fill(),A.restore()):n.type==="radio"&&n.checked&&(A.save(),A.beginPath(),A.arc(n.bounds.left+i/2,n.bounds.top+i/2,i/4,0,Math.PI*2,!0),A.fillStyle=me(Hd),A.fill(),A.restore())}if(Lb(n)&&n.value.length){const[i,o,a]=t.createFontStyle(s),{baseline:l}=e.getMetrics(o,a);A.font=i,A.fillStyle=n instanceof Ln&&n.isPlaceholder?me(vv):me(s.color),A.textBaseline="alphabetic",A.textAlign=Db(n.styles.textAlign);const u=On(n);let d=0;switch(n.styles.textAlign){case 1:d+=u.width/2;break;case 2:d+=u.width;break}let g=0;if(n instanceof Ln){const w=G(s.fontSize,0);g=(u.height-w)/2}const p=u.add(d,g,0,0);A.save(),r([new O(u.left,u.top),new O(u.left+u.width,u.top),new O(u.left+u.width,u.top+u.height),new O(u.left,u.top+u.height)]),A.clip(),t.renderTextWithLetterSpacing(new JA(n.value,p),s.letterSpacing,l,s.writingMode),A.restore(),A.textBaseline="alphabetic",A.textAlign="left"}}async function kb(A,e,t,r,n,s){var i;if(Pe(n.styles.display,2048)){if(n.styles.listStyleImage!==null){const o=n.styles.listStyleImage;if(o.type===0){const a=o.url;try{const l=await e.cache.match(a);A.drawImage(l,n.bounds.left-(l.width+10),n.bounds.top)}catch(l){e.logger.error(`Error loading list-style-image ${a}`),(i=e.onError)==null||i.call(e,l instanceof Error?l:new Error(String(l)))}}}else if(r.listValue&&n.styles.listStyleType!==-1){const[o]=t.createFontStyle(s);A.font=o,A.fillStyle=me(s.color),A.textBaseline="middle",A.textAlign="right";const a=new rA(n.bounds.left,n.bounds.top+G(n.styles.paddingTop,n.bounds.width),n.bounds.width,Ad(s.lineHeight,s.fontSize.number)/2+1);t.renderTextWithLetterSpacing(new JA(r.listValue,a),s.letterSpacing,Ad(s.lineHeight,s.fontSize.number)/2+2,s.writingMode),A.textBaseline="bottom",A.textAlign="left"}}}const Lb=A=>A instanceof Pd||A instanceof Od?!0:A instanceof Ln&&A.type!=="radio"&&A.type!=="checkbox",Db=A=>{switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Hb=1e4;var Ob=class wB{constructor(e,t){this.context=e,this.options=t,this.canvas=t.canvas?t.canvas:document.createElement("canvas");const r=this.canvas.getContext("2d");if(!r)throw new Error("Failed to get 2D rendering context from canvas");this.ctx=r,t.canvas||(this.canvas.width=Math.floor(t.width*t.scale),this.canvas.height=Math.floor(t.height*t.scale),this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`),this.fontMetrics=new pb(document),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-t.x,-t.y),this.ctx.textBaseline="bottom",t.imageSmoothing!==void 0&&(this.ctx.imageSmoothingEnabled=t.imageSmoothing),t.imageSmoothingQuality&&(this.ctx.imageSmoothingQuality=t.imageSmoothingQuality),this.backgroundRenderer=new vb({ctx:this.ctx,context:this.context,canvas:this.canvas,options:{width:t.width,height:t.height,scale:t.scale}}),this.borderRenderer=new Ib({ctx:this.ctx},{path:n=>this.path(n),formatPath:n=>this.formatPath(n)}),this.borderImageRenderer=new Fb(this.ctx),this.effectsRenderer=new Tb({ctx:this.ctx},{path:n=>this.path(n)}),this.textRenderer=new Eb({ctx:this.ctx,context:this.context,options:{scale:t.scale}}),this.context.logger.debug(`Canvas renderer initialized (${t.width}x${t.height}) with scale ${t.scale}`)}async renderStack(e){e.element.container.styles.isVisible()&&await this.renderStackContent(e)}async renderNode(e){if(e.container.debugRender)debugger;e.container.styles.isVisible()&&(await this.renderNodeBackgroundAndBorders(e),await this.renderNodeContent(e))}renderReplacedElement(e,t,r){const n=r.naturalWidth||e.intrinsicWidth,s=r.naturalHeight||e.intrinsicHeight;if(r&&n>0&&s>0){const i=On(e),o=xi(t);this.path(o),this.ctx.save(),this.ctx.clip();const{sx:a,sy:l,sw:u,sh:d,dx:g,dy:p,dw:w,dh:y}=Sb(n,s,i,e.styles.objectFit,e.styles.objectPosition);this.ctx.drawImage(r,a,l,u,d,g,p,w,y),this.ctx.restore()}}async renderNodeContent(e){this.effectsRenderer.applyEffects(e.getEffects(4));const t=e.container,r=e.curves,n=t.styles,s=On(t);for(const i of t.textNodes)await this.textRenderer.renderTextNode(i,n,s);await Rb(this.ctx,this.context,{scale:this.options.scale,backgroundColor:this.options.backgroundColor,x:this.options.x,y:this.options.y,width:this.options.width,height:this.options.height},(i,o)=>new wB(i,o),t,r,n,(i,o,a)=>this.renderReplacedElement(i,o,a)),xb(this.ctx,this.fontMetrics,this.textRenderer,this.path.bind(this),t,n),await kb(this.ctx,this.context,this.textRenderer,e,t,n)}async renderStackContent(e){if(e.element.container.debugRender)debugger;const t=this.options.signal;await this.renderNodeBackgroundAndBorders(e.element);for(const r of e.negativeZIndex){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderNodeContent(e.element);for(const r of e.nonInlineLevel)await this.renderNode(r);for(const r of e.nonPositionedFloats){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}for(const r of e.nonPositionedInlineLevel){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}for(const r of e.inlineLevel)await this.renderNode(r);for(const r of e.zeroOrAutoZIndexOrTransformedOrOpacity){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}for(const r of e.positiveZIndex){if(t!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");await this.renderStack(r)}}mask(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.options.width,0),this.ctx.lineTo(this.options.width,this.options.height),this.ctx.lineTo(0,this.options.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()}path(e){of(this.ctx,e)}formatPath(e){sf(this.ctx,e)}async renderNodeBackgroundAndBorders(e){this.effectsRenderer.applyEffects(e.getEffects(2));const t=e.container.styles,r=!_A(t.backgroundColor)||t.backgroundImage.length,n=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],s=Pb(Lr(t.backgroundClip,0),e.curves);if((r||t.boxShadow.length)&&(this.ctx.save(),this.path(s),this.ctx.clip(),_A(t.backgroundColor)||(this.ctx.fillStyle=me(t.backgroundColor),this.ctx.fill()),await this.backgroundRenderer.renderBackgroundImage(e.container),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(o=>{this.ctx.save();const a=Ri(e.curves),l=o.inset?0:Hb,u=Xv(a,-l+(o.inset?1:-1)*o.spread.number,(o.inset?1:-1)*o.spread.number,o.spread.number*(o.inset?-2:2),o.spread.number*(o.inset?-2:2));o.inset?(this.path(a),this.ctx.clip(),this.mask(u)):(this.mask(a),this.ctx.clip(),this.path(u)),this.ctx.shadowOffsetX=o.offsetX.number+l,this.ctx.shadowOffsetY=o.offsetY.number,this.ctx.shadowColor=me(o.color),this.ctx.shadowBlur=o.blur.number,this.ctx.fillStyle=o.inset?me(o.color):"rgba(0,0,0,1)",this.ctx.fill(),this.ctx.restore()})),t.borderImageSource){const o=t.borderImageSource;if(o.type===0){const a=o.url;try{const l=await this.context.cache.match(a);if(l){const u=e.container.bounds;this.borderImageRenderer.renderBorderImage(u,l,t.borderImageSlice,t.borderImageRepeat,Math.max(0,t.borderTopWidth),Math.max(0,t.borderRightWidth),Math.max(0,t.borderBottomWidth),Math.max(0,t.borderLeftWidth))}}catch{this.context.logger.error(`Error loading border-image ${a}`)}}return}let i=0;for(const o of n)o.style!==0&&!_A(o.color)&&o.width>0&&(o.style===2?await this.borderRenderer.renderDashedDottedBorder(o.color,o.width,i,e.curves,2):o.style===3?await this.borderRenderer.renderDashedDottedBorder(o.color,o.width,i,e.curves,3):o.style===4?await this.borderRenderer.renderDoubleBorder(o.color,o.width,i,e.curves):await this.borderRenderer.renderSolidBorder(o.color,i,e.curves)),i++}async render(e){this.options.backgroundColor&&(this.ctx.fillStyle=me(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height));const t=lb(e);return await this.renderStack(t),this.effectsRenderer.applyEffects([]),this.canvas}};const Pb=(A,e)=>{switch(A){case 0:return Ri(e);case 2:return Zv(e);default:return xi(e)}};var Nb=class{constructor(A,e){this.context=A,this.options=e,this.canvas=e.canvas?e.canvas:document.createElement("canvas");const t=this.canvas.getContext("2d");if(!t)throw new Error("Failed to get 2D rendering context from canvas");this.ctx=t,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.context.logger.debug(`EXPERIMENTAL ForeignObject renderer initialized (${e.width}x${e.height} at ${e.x},${e.y}) with scale ${e.scale}`)}async render(A){var t;if((t=this.options.signal)!=null&&t.aborted)throw new DOMException("The operation was aborted.","AbortError");const e=await Ya(Xa(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A));return this.options.backgroundColor&&(this.ctx.fillStyle=me(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(e,-this.options.x*this.options.scale,-this.options.y*this.options.scale),this.canvas}},Mb=(cn=class{constructor({id:e,enabled:t}){this.id=e,this.enabled=t,this.start=Date.now()}debug(...e){this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug(this.id,`${this.getTime()}ms`,...e):this.info(...e))}getTime(){return Date.now()-this.start}info(...e){this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info(this.id,`${this.getTime()}ms`,...e)}warn(...e){this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn(this.id,`${this.getTime()}ms`,...e):this.info(...e))}error(...e){this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error(this.id,`${this.getTime()}ms`,...e):this.info(...e))}},cn.instances={},cn),Vb=class{constructor(A,e){if(this.context=A,this._options=e,this._cache=new Map,this._pendingOperations=new Map,this.maxSize=e.maxCacheSize??100,this.maxSize<1)throw new Error("Cache maxSize must be at least 1");this.maxSize>1e4&&this.context.logger.warn(`Cache maxSize ${this.maxSize} is very large and may cause memory issues. Consider using a smaller value (recommended: 100-1000).`)}addImage(A){const e=this._pendingOperations.get(A);if(e)return e;if(this.has(A)){const t=this._cache.get(A);return this._cache.delete(A),this._cache.set(A,t),Promise.resolve()}if(cc(A)||Gb(A)){const t=this._addImageInternal(A);return this._pendingOperations.set(A,t),t.finally(()=>{this._pendingOperations.delete(A)}),t}return Promise.resolve()}async _addImageInternal(A){const e=this._options.imageTimeout??15e3,t=this.withTimeout(this.loadImage(A),e,`Timed out (${e}ms) loading image`);t.catch(r=>{this.context.logger.error(`Failed to load image ${A}: ${r instanceof Error?r.message:"Unknown error"}`)}),this.set(A,t)}withTimeout(A,e,t){if(e<=0)return A;let r;const n=new Promise((s,i)=>{r=setTimeout(()=>i(new Error(t)),e)});return Promise.race([A,n]).finally(()=>{r!==void 0&&clearTimeout(r)})}match(A){const e=this._cache.get(A);if(e)return this._cache.delete(A),this._cache.set(A,e),e.value}set(A,e){if(this._cache.has(A))this._cache.delete(A);else if(this._cache.size>=this.maxSize){const t=this._cache.keys().next().value;t!==void 0&&(this._cache.delete(t),this.context.logger.debug(`Cache: Evicted LRU entry: ${t}`))}this._cache.set(A,{value:e})}size(){return this._cache.size}getMaxSize(){return this.maxSize}clear(){this._cache.clear()}async loadImage(A){const e=this.context.originChecker,t=o=>e.isSameOrigin(o),r=typeof this._options.customIsSameOrigin=="function"?await this._options.customIsSameOrigin(A,t):t(A),n=!ac(A)&&this._options.useCORS===!0&&Ne.SUPPORT_CORS_IMAGES&&!r,s=!ac(A)&&!r&&!cc(A)&&typeof this._options.proxy=="string"&&Ne.SUPPORT_CORS_XHR&&!n;if(!r&&this._options.allowTaint===!1&&!ac(A)&&!cc(A)&&!s&&!n)return;let i=A;return s&&(i=await this.proxy(i)),this.context.logger.debug(`Added image ${A.substring(0,256)}`),await new Promise((o,a)=>{const l=new Image;l.onload=()=>o(l),l.onerror=a,(Wb(i)||n)&&(l.crossOrigin="anonymous"),l.src=i,l.complete===!0&&setTimeout(()=>o(l),500)})}has(A){return this._cache.has(A)}keys(){return Promise.resolve(Array.from(this._cache.keys()))}proxy(A){const e=this._options.proxy;if(!e)throw new Error("No proxy defined");const t=A.substring(0,256);return new Promise((r,n)=>{const s=Ne.SUPPORT_RESPONSE_TYPE?"blob":"text",i=new XMLHttpRequest;i.onload=()=>{if(i.status===200)if(s==="text")r(i.response);else{const a=new FileReader;a.addEventListener("load",()=>r(a.result),!1),a.addEventListener("error",l=>n(l),!1),a.readAsDataURL(i.response)}else n(`Failed to proxy resource ${t} with status code ${i.status}`)},i.onerror=n;const o=e.indexOf("?")>-1?"&":"?";if(i.open("GET",`${e}${o}url=${encodeURIComponent(A)}&responseType=${s}`),s!=="text"&&i instanceof XMLHttpRequest&&(i.responseType=s),this._options.imageTimeout){const a=this._options.imageTimeout;i.timeout=a,i.ontimeout=()=>n(`Timed out (${a}ms) proxying ${t}`)}i.send()})}};const Kb=/^data:image\/svg\+xml/i,$b=/^data:image\/.*;base64,/i,jb=/^data:image\/.*/i,Gb=A=>Ne.SUPPORT_SVG_DRAWING||!qb(A),ac=A=>jb.test(A),Wb=A=>$b.test(A),cc=A=>A.substring(0,4)==="blob",qb=A=>A.slice(-3).toLowerCase()==="svg"||Kb.test(A);var Jb=class{constructor(A){if(!A||!A.document)throw new Error("Valid window object required for OriginChecker");if(!A.location||!A.location.href)throw new Error("Window object must have valid location");this.link=A.document.createElement("a"),this.origin=this.getOrigin(A.location.href)}getOrigin(A){return this.link.href=A,this.link.href=this.link.href,this.link.protocol+this.link.hostname+this.link.port}isSameOrigin(A){return this.getOrigin(A)===this.origin}getContextOrigin(){return this.origin}},zb=(mr=class{constructor(e,t,r){this.windowBounds=t,this.instanceName=`#${mr.instanceCount++}`,this.config=r,this.logger=new Mb({id:this.instanceName,enabled:e.logging}),this.originChecker=new Jb(r.window),this.cache=e.cache??r.cache??new Vb(this,e),this.onError=e.onError}},mr.instanceCount=1,mr);const Xb=A=>{["scale","width","height","imageTimeout","x","y","windowWidth","windowHeight","scrollX","scrollY"].forEach(e=>{const t=A[e];if(t!=null&&typeof t!="number"){const r=Number(t);Number.isNaN(r)||(A[e]=r)}})},Yb=async(A,e,t)=>{if(Xb(e),!e.skipValidation){const Ce=e.validator||Ku(),pt=Ce.validateElement(A);if(!pt.valid)throw new Error(pt.error);const fA=Ce.validateOptions(e);if(!fA.valid)throw new Error(`Invalid options: ${fA.error}`)}if(!A||typeof A!="object")throw new Error("Invalid element provided as first argument");const r=A.ownerDocument;if(!r)throw new Error("Element is not attached to a Document");const n=r.defaultView;if(!n)throw new Error("Document is not attached to a Window");const s={allowTaint:e.allowTaint??!1,imageTimeout:e.imageTimeout??15e3,proxy:e.proxy,useCORS:e.useCORS??!1,customIsSameOrigin:e.customIsSameOrigin,maxCacheSize:e.maxCacheSize},i={logging:e.logging??!0,cache:e.cache??t.cache,...s},o=800,a=600,l=0,u=n,d={windowWidth:e.windowWidth??u.innerWidth??o,windowHeight:e.windowHeight??u.innerHeight??a,scrollX:e.scrollX??u.pageXOffset??l,scrollY:e.scrollY??u.pageYOffset??l},g=new rA(d.scrollX,d.scrollY,d.windowWidth,d.windowHeight),p=new zb(i,g,t),w=e.enablePerformanceMonitoring??e.logging??!1,y=new $u(p,w);y.start("total",{width:d.windowWidth,height:d.windowHeight});const B=e.signal;if(B!=null&&B.aborted)throw new DOMException("The operation was aborted.","AbortError");const b=e.foreignObjectRendering??!1,S={allowTaint:e.allowTaint??!1,onclone:e.onclone,ignoreElements:e.ignoreElements,iframeContainer:e.iframeContainer,inlineImages:b,copyStyles:b,cspNonce:e.cspNonce??t.cspNonce};p.logger.debug(`Starting document clone with size ${g.width}x${g.height} scrolled to ${-g.left},${-g.top}`),y.start("clone");const I=new tc(p,A,S),R=I.clonedReferenceElement;if(!R)throw new Error("Unable to find element in cloned iframe");const K=await I.toIFrame(r,g);if(y.end("clone"),B!=null&&B.aborted)throw(e.removeContainer??!0)&&tc.destroy(K),new DOMException("The operation was aborted.","AbortError");const{width:P,height:_,left:C,top:v}=Pa(R)||UE(R)?VB(R.ownerDocument):js(p,R),U=Zb(p,R,e.backgroundColor),Q={canvas:e.canvas,backgroundColor:U,signal:B,scale:e.scale??n.devicePixelRatio??1,x:(e.x??0)+C,y:(e.y??0)+v,width:e.width??Math.ceil(P),height:e.height??Math.ceil(_),imageSmoothing:e.imageSmoothing,imageSmoothingQuality:e.imageSmoothingQuality};let F,E;try{if(b)p.logger.debug("Document cloned, using foreign object rendering"),y.start("render-foreignobject"),F=await new Nb(p,Q).render(R),y.end("render-foreignobject");else{if(p.logger.debug(`Document cloned, element located at ${C},${v} with size ${P}x${_} using computed rendering`),p.logger.debug("Starting DOM parsing"),y.start("parse"),B!=null&&B.aborted)throw new DOMException("The operation was aborted.","AbortError");if(E=Vd(p,R),y.end("parse"),U===E.styles.backgroundColor&&(E.styles.backgroundColor=Gt.TRANSPARENT),p.logger.debug(`Starting renderer for element at ${Q.x},${Q.y} with size ${Q.width}x${Q.height}`),y.start("render"),B!=null&&B.aborted)throw new DOMException("The operation was aborted.","AbortError");F=await new Ob(p,Q).render(E),y.end("render")}return y.start("cleanup"),(e.removeContainer??!0)&&(tc.destroy(K)||p.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),y.end("cleanup"),y.end("total"),p.logger.debug("Finished rendering"),w&&y.logSummary(),F}finally{E&&E.restoreTree()}},Zb=(A,e,t)=>{const r=e.ownerDocument,n=r.documentElement?Tr(A,getComputedStyle(r.documentElement).backgroundColor):Gt.TRANSPARENT,s=r.body?Tr(A,getComputedStyle(r.body).backgroundColor):Gt.TRANSPARENT,i=typeof t=="string"?Tr(A,t):t===null?Gt.TRANSPARENT:4294967295;return e===r.documentElement?_A(n)?_A(s)?i:s:n:i},cf=(A,e={},t)=>Yb(A,e,t||Mu.fromElement(A,{cspNonce:e.cspNonce,cache:e.cache})),eU=Object.freeze(Object.defineProperty({__proto__:null,Html2CanvasConfig:Mu,PerformanceMonitor:$u,Validator:Vu,createDefaultValidator:Ku,default:cf,html2canvas:cf},Symbol.toStringTag,{value:"Module"}));/**
782
782
  * @license
783
783
  * Copyright 2017 Google LLC
784
784
  *
@@ -808,7 +808,7 @@
808
808
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
809
809
  * See the License for the specific language governing permissions and
810
810
  * limitations under the License.
811
- */const lf=function(A){const e=[];let t=0;for(let r=0;r<A.length;r++){let n=A.charCodeAt(r);n<128?e[t++]=n:n<2048?(e[t++]=n>>6|192,e[t++]=n&63|128):(n&64512)===55296&&r+1<A.length&&(A.charCodeAt(r+1)&64512)===56320?(n=65536+((n&1023)<<10)+(A.charCodeAt(++r)&1023),e[t++]=n>>18|240,e[t++]=n>>12&63|128,e[t++]=n>>6&63|128,e[t++]=n&63|128):(e[t++]=n>>12|224,e[t++]=n>>6&63|128,e[t++]=n&63|128)}return e},tU=function(A){const e=[];let t=0,r=0;for(;t<A.length;){const n=A[t++];if(n<128)e[r++]=String.fromCharCode(n);else if(n>191&&n<224){const s=A[t++];e[r++]=String.fromCharCode((n&31)<<6|s&63)}else if(n>239&&n<365){const s=A[t++],i=A[t++],o=A[t++],a=((n&7)<<18|(s&63)<<12|(i&63)<<6|o&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=A[t++],i=A[t++];e[r++]=String.fromCharCode((n&15)<<12|(s&63)<<6|i&63)}}return e.join("")},uf={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(A,e){if(!Array.isArray(A))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let n=0;n<A.length;n+=3){const s=A[n],i=n+1<A.length,o=i?A[n+1]:0,a=n+2<A.length,l=a?A[n+2]:0,u=s>>2,d=(s&3)<<4|o>>4;let g=(o&15)<<2|l>>6,p=l&63;a||(p=64,i||(g=64)),r.push(t[u],t[d],t[g],t[p])}return r.join("")},encodeString(A,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(A):this.encodeByteArray(lf(A),e)},decodeString(A,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(A):tU(this.decodeStringToByteArray(A,e))},decodeStringToByteArray(A,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let n=0;n<A.length;){const s=t[A.charAt(n++)],o=n<A.length?t[A.charAt(n)]:0;++n;const l=n<A.length?t[A.charAt(n)]:64;++n;const d=n<A.length?t[A.charAt(n)]:64;if(++n,s==null||o==null||l==null||d==null)throw new AU;const g=s<<2|o>>4;if(r.push(g),l!==64){const p=o<<4&240|l>>2;if(r.push(p),d!==64){const w=l<<6&192|d;r.push(w)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let A=0;A<this.ENCODED_VALS.length;A++)this.byteToCharMap_[A]=this.ENCODED_VALS.charAt(A),this.charToByteMap_[this.byteToCharMap_[A]]=A,this.byteToCharMapWebSafe_[A]=this.ENCODED_VALS_WEBSAFE.charAt(A),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[A]]=A,A>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(A)]=A,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(A)]=A)}}};class AU extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const rU=function(A){const e=lf(A);return uf.encodeByteArray(e,!0)},Pi=function(A){return rU(A).replace(/\./g,"")},nU=function(A){try{return uf.decodeString(A,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
811
+ */const lf=function(A){const e=[];let t=0;for(let r=0;r<A.length;r++){let n=A.charCodeAt(r);n<128?e[t++]=n:n<2048?(e[t++]=n>>6|192,e[t++]=n&63|128):(n&64512)===55296&&r+1<A.length&&(A.charCodeAt(r+1)&64512)===56320?(n=65536+((n&1023)<<10)+(A.charCodeAt(++r)&1023),e[t++]=n>>18|240,e[t++]=n>>12&63|128,e[t++]=n>>6&63|128,e[t++]=n&63|128):(e[t++]=n>>12|224,e[t++]=n>>6&63|128,e[t++]=n&63|128)}return e},tU=function(A){const e=[];let t=0,r=0;for(;t<A.length;){const n=A[t++];if(n<128)e[r++]=String.fromCharCode(n);else if(n>191&&n<224){const s=A[t++];e[r++]=String.fromCharCode((n&31)<<6|s&63)}else if(n>239&&n<365){const s=A[t++],i=A[t++],o=A[t++],a=((n&7)<<18|(s&63)<<12|(i&63)<<6|o&63)-65536;e[r++]=String.fromCharCode(55296+(a>>10)),e[r++]=String.fromCharCode(56320+(a&1023))}else{const s=A[t++],i=A[t++];e[r++]=String.fromCharCode((n&15)<<12|(s&63)<<6|i&63)}}return e.join("")},uf={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(A,e){if(!Array.isArray(A))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let n=0;n<A.length;n+=3){const s=A[n],i=n+1<A.length,o=i?A[n+1]:0,a=n+2<A.length,l=a?A[n+2]:0,u=s>>2,d=(s&3)<<4|o>>4;let g=(o&15)<<2|l>>6,p=l&63;a||(p=64,i||(g=64)),r.push(t[u],t[d],t[g],t[p])}return r.join("")},encodeString(A,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(A):this.encodeByteArray(lf(A),e)},decodeString(A,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(A):tU(this.decodeStringToByteArray(A,e))},decodeStringToByteArray(A,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let n=0;n<A.length;){const s=t[A.charAt(n++)],o=n<A.length?t[A.charAt(n)]:0;++n;const l=n<A.length?t[A.charAt(n)]:64;++n;const d=n<A.length?t[A.charAt(n)]:64;if(++n,s==null||o==null||l==null||d==null)throw new AU;const g=s<<2|o>>4;if(r.push(g),l!==64){const p=o<<4&240|l>>2;if(r.push(p),d!==64){const w=l<<6&192|d;r.push(w)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let A=0;A<this.ENCODED_VALS.length;A++)this.byteToCharMap_[A]=this.ENCODED_VALS.charAt(A),this.charToByteMap_[this.byteToCharMap_[A]]=A,this.byteToCharMapWebSafe_[A]=this.ENCODED_VALS_WEBSAFE.charAt(A),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[A]]=A,A>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(A)]=A,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(A)]=A)}}};class AU extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const rU=function(A){const e=lf(A);return uf.encodeByteArray(e,!0)},Oi=function(A){return rU(A).replace(/\./g,"")},nU=function(A){try{return uf.decodeString(A,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
812
812
  * @license
813
813
  * Copyright 2022 Google LLC
814
814
  *
@@ -838,7 +838,7 @@
838
838
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
839
839
  * See the License for the specific language governing permissions and
840
840
  * limitations under the License.
841
- */const iU=()=>sU().__FIREBASE_DEFAULTS__,oU=()=>{if(typeof process>"u"||typeof process.env>"u")return;const A=process.env.__FIREBASE_DEFAULTS__;if(A)return JSON.parse(A)},aU=()=>{if(typeof document>"u")return;let A;try{A=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=A&&nU(A[1]);return e&&JSON.parse(e)},uc=()=>{try{return iU()||oU()||aU()}catch(A){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${A}`);return}},cU=A=>{var e,t;return(t=(e=uc())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[A]},hf=A=>{const e=cU(A);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),r]:[e.substring(0,t),r]},df=()=>{var A;return(A=uc())===null||A===void 0?void 0:A.config};/**
841
+ */const iU=()=>sU().__FIREBASE_DEFAULTS__,oU=()=>{if(typeof process>"u"||typeof process.env>"u")return;const A=process.env.__FIREBASE_DEFAULTS__;if(A)return JSON.parse(A)},aU=()=>{if(typeof document>"u")return;let A;try{A=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=A&&nU(A[1]);return e&&JSON.parse(e)},lc=()=>{try{return iU()||oU()||aU()}catch(A){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${A}`);return}},cU=A=>{var e,t;return(t=(e=lc())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[A]},hf=A=>{const e=cU(A);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),r]:[e.substring(0,t),r]},df=()=>{var A;return(A=lc())===null||A===void 0?void 0:A.config};/**
842
842
  * @license
843
843
  * Copyright 2017 Google LLC
844
844
  *
@@ -868,7 +868,7 @@
868
868
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
869
869
  * See the License for the specific language governing permissions and
870
870
  * limitations under the License.
871
- */function ff(A,e){if(A.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},r=e||"demo-project",n=A.iat||0,s=A.sub||A.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:n,exp:n+3600,auth_time:n,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},A);return[Pi(JSON.stringify(t)),Pi(JSON.stringify(i)),""].join(".")}/**
871
+ */function ff(A,e){if(A.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},r=e||"demo-project",n=A.iat||0,s=A.sub||A.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:n,exp:n+3600,auth_time:n,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},A);return[Oi(JSON.stringify(t)),Oi(JSON.stringify(i)),""].join(".")}/**
872
872
  * @license
873
873
  * Copyright 2017 Google LLC
874
874
  *
@@ -883,7 +883,7 @@
883
883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
884
884
  * See the License for the specific language governing permissions and
885
885
  * limitations under the License.
886
- */function uU(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function hU(){var A;const e=(A=uc())===null||A===void 0?void 0:A.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function dU(){return!hU()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function fU(){try{return typeof indexedDB=="object"}catch{return!1}}function gU(){return new Promise((A,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(r);n.onsuccess=()=>{n.result.close(),t||self.indexedDB.deleteDatabase(r),A(!0)},n.onupgradeneeded=()=>{t=!1},n.onerror=()=>{var s;e(((s=n.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
886
+ */function uU(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function hU(){var A;const e=(A=lc())===null||A===void 0?void 0:A.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function dU(){return!hU()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function fU(){try{return typeof indexedDB=="object"}catch{return!1}}function gU(){return new Promise((A,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",n=self.indexedDB.open(r);n.onsuccess=()=>{n.result.close(),t||self.indexedDB.deleteDatabase(r),A(!0)},n.onupgradeneeded=()=>{t=!1},n.onerror=()=>{var s;e(((s=n.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}/**
887
887
  * @license
888
888
  * Copyright 2017 Google LLC
889
889
  *
@@ -898,7 +898,7 @@
898
898
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
899
899
  * See the License for the specific language governing permissions and
900
900
  * limitations under the License.
901
- */const pU="FirebaseError";class XA extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=pU,Object.setPrototypeOf(this,XA.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,gf.prototype.create)}}class gf{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},n=`${this.service}/${e}`,s=this.errors[e],i=s?wU(s,r):"Error",o=`${this.serviceName}: ${i} (${n}).`;return new XA(n,o,r)}}function wU(A,e){return A.replace(mU,(t,r)=>{const n=e[r];return n!=null?String(n):`<${r}?>`})}const mU=/\{\$([^}]+)}/g;function hc(A,e){if(A===e)return!0;const t=Object.keys(A),r=Object.keys(e);for(const n of t){if(!r.includes(n))return!1;const s=A[n],i=e[n];if(pf(s)&&pf(i)){if(!hc(s,i))return!1}else if(s!==i)return!1}for(const n of r)if(!t.includes(n))return!1;return!0}function pf(A){return A!==null&&typeof A=="object"}/**
901
+ */const pU="FirebaseError";class XA extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=pU,Object.setPrototypeOf(this,XA.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,gf.prototype.create)}}class gf{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},n=`${this.service}/${e}`,s=this.errors[e],i=s?wU(s,r):"Error",o=`${this.serviceName}: ${i} (${n}).`;return new XA(n,o,r)}}function wU(A,e){return A.replace(mU,(t,r)=>{const n=e[r];return n!=null?String(n):`<${r}?>`})}const mU=/\{\$([^}]+)}/g;function uc(A,e){if(A===e)return!0;const t=Object.keys(A),r=Object.keys(e);for(const n of t){if(!r.includes(n))return!1;const s=A[n],i=e[n];if(pf(s)&&pf(i)){if(!uc(s,i))return!1}else if(s!==i)return!1}for(const n of r)if(!t.includes(n))return!1;return!0}function pf(A){return A!==null&&typeof A=="object"}/**
902
902
  * @license
903
903
  * Copyright 2021 Google LLC
904
904
  *
@@ -913,7 +913,7 @@
913
913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
914
914
  * See the License for the specific language governing permissions and
915
915
  * limitations under the License.
916
- */function ot(A){return A&&A._delegate?A._delegate:A}class Lr{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
916
+ */function ot(A){return A&&A._delegate?A._delegate:A}class Dr{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
917
917
  * @license
918
918
  * Copyright 2019 Google LLC
919
919
  *
@@ -973,7 +973,7 @@
973
973
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
974
974
  * See the License for the specific language governing permissions and
975
975
  * limitations under the License.
976
- */var ne;(function(A){A[A.DEBUG=0]="DEBUG",A[A.VERBOSE=1]="VERBOSE",A[A.INFO=2]="INFO",A[A.WARN=3]="WARN",A[A.ERROR=4]="ERROR",A[A.SILENT=5]="SILENT"})(ne||(ne={}));const EU={debug:ne.DEBUG,verbose:ne.VERBOSE,info:ne.INFO,warn:ne.WARN,error:ne.ERROR,silent:ne.SILENT},vU=ne.INFO,bU={[ne.DEBUG]:"log",[ne.VERBOSE]:"log",[ne.INFO]:"info",[ne.WARN]:"warn",[ne.ERROR]:"error"},UU=(A,e,...t)=>{if(e<A.logLevel)return;const r=new Date().toISOString(),n=bU[e];if(n)console[n](`[${r}] ${A.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class wf{constructor(e){this.name=e,this._logLevel=vU,this._logHandler=UU,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in ne))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?EU[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,ne.DEBUG,...e),this._logHandler(this,ne.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,ne.VERBOSE,...e),this._logHandler(this,ne.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,ne.INFO,...e),this._logHandler(this,ne.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,ne.WARN,...e),this._logHandler(this,ne.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,ne.ERROR,...e),this._logHandler(this,ne.ERROR,...e)}}const QU=(A,e)=>e.some(t=>A instanceof t);let mf,Bf;function IU(){return mf||(mf=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function FU(){return Bf||(Bf=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const yf=new WeakMap,dc=new WeakMap,Cf=new WeakMap,fc=new WeakMap,gc=new WeakMap;function TU(A){const e=new Promise((t,r)=>{const n=()=>{A.removeEventListener("success",s),A.removeEventListener("error",i)},s=()=>{t(bA(A.result)),n()},i=()=>{r(A.error),n()};A.addEventListener("success",s),A.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&yf.set(t,A)}).catch(()=>{}),gc.set(e,A),e}function SU(A){if(dc.has(A))return;const e=new Promise((t,r)=>{const n=()=>{A.removeEventListener("complete",s),A.removeEventListener("error",i),A.removeEventListener("abort",i)},s=()=>{t(),n()},i=()=>{r(A.error||new DOMException("AbortError","AbortError")),n()};A.addEventListener("complete",s),A.addEventListener("error",i),A.addEventListener("abort",i)});dc.set(A,e)}let pc={get(A,e,t){if(A instanceof IDBTransaction){if(e==="done")return dc.get(A);if(e==="objectStoreNames")return A.objectStoreNames||Cf.get(A);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return bA(A[e])},set(A,e,t){return A[e]=t,!0},has(A,e){return A instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in A}};function RU(A){pc=A(pc)}function xU(A){return A===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=A.call(wc(this),e,...t);return Cf.set(r,e.sort?e.sort():[e]),bA(r)}:FU().includes(A)?function(...e){return A.apply(wc(this),e),bA(yf.get(this))}:function(...e){return bA(A.apply(wc(this),e))}}function kU(A){return typeof A=="function"?xU(A):(A instanceof IDBTransaction&&SU(A),QU(A,IU())?new Proxy(A,pc):A)}function bA(A){if(A instanceof IDBRequest)return TU(A);if(fc.has(A))return fc.get(A);const e=kU(A);return e!==A&&(fc.set(A,e),gc.set(e,A)),e}const wc=A=>gc.get(A);function LU(A,e,{blocked:t,upgrade:r,blocking:n,terminated:s}={}){const i=indexedDB.open(A,e),o=bA(i);return r&&i.addEventListener("upgradeneeded",a=>{r(bA(i.result),a.oldVersion,a.newVersion,bA(i.transaction),a)}),t&&i.addEventListener("blocked",a=>t(a.oldVersion,a.newVersion,a)),o.then(a=>{s&&a.addEventListener("close",()=>s()),n&&a.addEventListener("versionchange",l=>n(l.oldVersion,l.newVersion,l))}).catch(()=>{}),o}const DU=["get","getKey","getAll","getAllKeys","count"],HU=["put","add","delete","clear"],mc=new Map;function _f(A,e){if(!(A instanceof IDBDatabase&&!(e in A)&&typeof e=="string"))return;if(mc.get(e))return mc.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,n=HU.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(n||DU.includes(t)))return;const s=async function(i,...o){const a=this.transaction(i,n?"readwrite":"readonly");let l=a.store;return r&&(l=l.index(o.shift())),(await Promise.all([l[t](...o),n&&a.done]))[0]};return mc.set(e,s),s}RU(A=>({...A,get:(e,t,r)=>_f(e,t)||A.get(e,t,r),has:(e,t)=>!!_f(e,t)||A.has(e,t)}));/**
976
+ */var ne;(function(A){A[A.DEBUG=0]="DEBUG",A[A.VERBOSE=1]="VERBOSE",A[A.INFO=2]="INFO",A[A.WARN=3]="WARN",A[A.ERROR=4]="ERROR",A[A.SILENT=5]="SILENT"})(ne||(ne={}));const EU={debug:ne.DEBUG,verbose:ne.VERBOSE,info:ne.INFO,warn:ne.WARN,error:ne.ERROR,silent:ne.SILENT},vU=ne.INFO,bU={[ne.DEBUG]:"log",[ne.VERBOSE]:"log",[ne.INFO]:"info",[ne.WARN]:"warn",[ne.ERROR]:"error"},UU=(A,e,...t)=>{if(e<A.logLevel)return;const r=new Date().toISOString(),n=bU[e];if(n)console[n](`[${r}] ${A.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class wf{constructor(e){this.name=e,this._logLevel=vU,this._logHandler=UU,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in ne))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?EU[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,ne.DEBUG,...e),this._logHandler(this,ne.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,ne.VERBOSE,...e),this._logHandler(this,ne.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,ne.INFO,...e),this._logHandler(this,ne.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,ne.WARN,...e),this._logHandler(this,ne.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,ne.ERROR,...e),this._logHandler(this,ne.ERROR,...e)}}const QU=(A,e)=>e.some(t=>A instanceof t);let mf,Bf;function IU(){return mf||(mf=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function FU(){return Bf||(Bf=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const yf=new WeakMap,hc=new WeakMap,Cf=new WeakMap,dc=new WeakMap,fc=new WeakMap;function TU(A){const e=new Promise((t,r)=>{const n=()=>{A.removeEventListener("success",s),A.removeEventListener("error",i)},s=()=>{t(bA(A.result)),n()},i=()=>{r(A.error),n()};A.addEventListener("success",s),A.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&yf.set(t,A)}).catch(()=>{}),fc.set(e,A),e}function SU(A){if(hc.has(A))return;const e=new Promise((t,r)=>{const n=()=>{A.removeEventListener("complete",s),A.removeEventListener("error",i),A.removeEventListener("abort",i)},s=()=>{t(),n()},i=()=>{r(A.error||new DOMException("AbortError","AbortError")),n()};A.addEventListener("complete",s),A.addEventListener("error",i),A.addEventListener("abort",i)});hc.set(A,e)}let gc={get(A,e,t){if(A instanceof IDBTransaction){if(e==="done")return hc.get(A);if(e==="objectStoreNames")return A.objectStoreNames||Cf.get(A);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return bA(A[e])},set(A,e,t){return A[e]=t,!0},has(A,e){return A instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in A}};function RU(A){gc=A(gc)}function xU(A){return A===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=A.call(pc(this),e,...t);return Cf.set(r,e.sort?e.sort():[e]),bA(r)}:FU().includes(A)?function(...e){return A.apply(pc(this),e),bA(yf.get(this))}:function(...e){return bA(A.apply(pc(this),e))}}function kU(A){return typeof A=="function"?xU(A):(A instanceof IDBTransaction&&SU(A),QU(A,IU())?new Proxy(A,gc):A)}function bA(A){if(A instanceof IDBRequest)return TU(A);if(dc.has(A))return dc.get(A);const e=kU(A);return e!==A&&(dc.set(A,e),fc.set(e,A)),e}const pc=A=>fc.get(A);function LU(A,e,{blocked:t,upgrade:r,blocking:n,terminated:s}={}){const i=indexedDB.open(A,e),o=bA(i);return r&&i.addEventListener("upgradeneeded",a=>{r(bA(i.result),a.oldVersion,a.newVersion,bA(i.transaction),a)}),t&&i.addEventListener("blocked",a=>t(a.oldVersion,a.newVersion,a)),o.then(a=>{s&&a.addEventListener("close",()=>s()),n&&a.addEventListener("versionchange",l=>n(l.oldVersion,l.newVersion,l))}).catch(()=>{}),o}const DU=["get","getKey","getAll","getAllKeys","count"],HU=["put","add","delete","clear"],wc=new Map;function _f(A,e){if(!(A instanceof IDBDatabase&&!(e in A)&&typeof e=="string"))return;if(wc.get(e))return wc.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,n=HU.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(n||DU.includes(t)))return;const s=async function(i,...o){const a=this.transaction(i,n?"readwrite":"readonly");let l=a.store;return r&&(l=l.index(o.shift())),(await Promise.all([l[t](...o),n&&a.done]))[0]};return wc.set(e,s),s}RU(A=>({...A,get:(e,t,r)=>_f(e,t)||A.get(e,t,r),has:(e,t)=>!!_f(e,t)||A.has(e,t)}));/**
977
977
  * @license
978
978
  * Copyright 2019 Google LLC
979
979
  *
@@ -988,7 +988,7 @@
988
988
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
989
989
  * See the License for the specific language governing permissions and
990
990
  * limitations under the License.
991
- */class OU{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(PU(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function PU(A){const e=A.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Bc="@firebase/app",Ef="0.10.13";/**
991
+ */class OU{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(PU(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function PU(A){const e=A.getComponent();return(e==null?void 0:e.type)==="VERSION"}const mc="@firebase/app",Ef="0.10.13";/**
992
992
  * @license
993
993
  * Copyright 2019 Google LLC
994
994
  *
@@ -1018,7 +1018,7 @@
1018
1018
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1019
1019
  * See the License for the specific language governing permissions and
1020
1020
  * limitations under the License.
1021
- */const yc="[DEFAULT]",dQ={[Bc]:"fire-core",[NU]:"fire-core-compat",[VU]:"fire-analytics",[MU]:"fire-analytics-compat",[$U]:"fire-app-check",[KU]:"fire-app-check-compat",[jU]:"fire-auth",[GU]:"fire-auth-compat",[WU]:"fire-rtdb",[qU]:"fire-data-connect",[JU]:"fire-rtdb-compat",[zU]:"fire-fn",[XU]:"fire-fn-compat",[YU]:"fire-iid",[ZU]:"fire-iid-compat",[eQ]:"fire-fcm",[tQ]:"fire-fcm-compat",[AQ]:"fire-perf",[rQ]:"fire-perf-compat",[nQ]:"fire-rc",[sQ]:"fire-rc-compat",[iQ]:"fire-gcs",[oQ]:"fire-gcs-compat",[aQ]:"fire-fst",[lQ]:"fire-fst-compat",[cQ]:"fire-vertex","fire-js":"fire-js",[uQ]:"fire-js-all"};/**
1021
+ */const Bc="[DEFAULT]",dQ={[mc]:"fire-core",[NU]:"fire-core-compat",[VU]:"fire-analytics",[MU]:"fire-analytics-compat",[$U]:"fire-app-check",[KU]:"fire-app-check-compat",[jU]:"fire-auth",[GU]:"fire-auth-compat",[WU]:"fire-rtdb",[qU]:"fire-data-connect",[JU]:"fire-rtdb-compat",[zU]:"fire-fn",[XU]:"fire-fn-compat",[YU]:"fire-iid",[ZU]:"fire-iid-compat",[eQ]:"fire-fcm",[tQ]:"fire-fcm-compat",[AQ]:"fire-perf",[rQ]:"fire-perf-compat",[nQ]:"fire-rc",[sQ]:"fire-rc-compat",[iQ]:"fire-gcs",[oQ]:"fire-gcs-compat",[aQ]:"fire-fst",[lQ]:"fire-fst-compat",[cQ]:"fire-vertex","fire-js":"fire-js",[uQ]:"fire-js-all"};/**
1022
1022
  * @license
1023
1023
  * Copyright 2019 Google LLC
1024
1024
  *
@@ -1033,7 +1033,7 @@
1033
1033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
1034
  * See the License for the specific language governing permissions and
1035
1035
  * limitations under the License.
1036
- */const Pn=new Map,fQ=new Map,Cc=new Map;function vf(A,e){try{A.container.addComponent(e)}catch(t){oA.debug(`Component ${e.name} failed to register with FirebaseApp ${A.name}`,t)}}function Nn(A){const e=A.name;if(Cc.has(e))return oA.debug(`There were multiple attempts to register component ${e}.`),!1;Cc.set(e,A);for(const t of Pn.values())vf(t,A);for(const t of fQ.values())vf(t,A);return!0}function bf(A,e){const t=A.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),A.container.getProvider(e)}/**
1036
+ */const Pn=new Map,fQ=new Map,yc=new Map;function vf(A,e){try{A.container.addComponent(e)}catch(t){oA.debug(`Component ${e.name} failed to register with FirebaseApp ${A.name}`,t)}}function Nn(A){const e=A.name;if(yc.has(e))return oA.debug(`There were multiple attempts to register component ${e}.`),!1;yc.set(e,A);for(const t of Pn.values())vf(t,A);for(const t of fQ.values())vf(t,A);return!0}function bf(A,e){const t=A.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),A.container.getProvider(e)}/**
1037
1037
  * @license
1038
1038
  * Copyright 2019 Google LLC
1039
1039
  *
@@ -1063,7 +1063,7 @@
1063
1063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1064
1064
  * See the License for the specific language governing permissions and
1065
1065
  * limitations under the License.
1066
- */class pQ{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Lr("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw UA.create("app-deleted",{appName:this._name})}}/**
1066
+ */class pQ{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Dr("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw UA.create("app-deleted",{appName:this._name})}}/**
1067
1067
  * @license
1068
1068
  * Copyright 2019 Google LLC
1069
1069
  *
@@ -1078,7 +1078,7 @@
1078
1078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1079
1079
  * See the License for the specific language governing permissions and
1080
1080
  * limitations under the License.
1081
- */const Uf=hQ;function Qf(A,e={}){let t=A;typeof e!="object"&&(e={name:e});const r=Object.assign({name:yc,automaticDataCollectionEnabled:!1},e),n=r.name;if(typeof n!="string"||!n)throw UA.create("bad-app-name",{appName:String(n)});if(t||(t=df()),!t)throw UA.create("no-options");const s=Pn.get(n);if(s){if(hc(t,s.options)&&hc(r,s.config))return s;throw UA.create("duplicate-app",{appName:n})}const i=new _U(n);for(const a of Cc.values())i.addComponent(a);const o=new pQ(t,r,i);return Pn.set(n,o),o}function If(A=yc){const e=Pn.get(A);if(!e&&A===yc&&df())return Qf();if(!e)throw UA.create("no-app",{appName:A});return e}function wQ(){return Array.from(Pn.values())}function QA(A,e,t){var r;let n=(r=dQ[A])!==null&&r!==void 0?r:A;t&&(n+=`-${t}`);const s=n.match(/\s|\//),i=e.match(/\s|\//);if(s||i){const o=[`Unable to register library "${n}" with version "${e}":`];s&&o.push(`library name "${n}" contains illegal characters (whitespace or "/")`),s&&i&&o.push("and"),i&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),oA.warn(o.join(" "));return}Nn(new Lr(`${n}-version`,()=>({library:n,version:e}),"VERSION"))}/**
1081
+ */const Uf=hQ;function Qf(A,e={}){let t=A;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Bc,automaticDataCollectionEnabled:!1},e),n=r.name;if(typeof n!="string"||!n)throw UA.create("bad-app-name",{appName:String(n)});if(t||(t=df()),!t)throw UA.create("no-options");const s=Pn.get(n);if(s){if(uc(t,s.options)&&uc(r,s.config))return s;throw UA.create("duplicate-app",{appName:n})}const i=new _U(n);for(const a of yc.values())i.addComponent(a);const o=new pQ(t,r,i);return Pn.set(n,o),o}function If(A=Bc){const e=Pn.get(A);if(!e&&A===Bc&&df())return Qf();if(!e)throw UA.create("no-app",{appName:A});return e}function wQ(){return Array.from(Pn.values())}function QA(A,e,t){var r;let n=(r=dQ[A])!==null&&r!==void 0?r:A;t&&(n+=`-${t}`);const s=n.match(/\s|\//),i=e.match(/\s|\//);if(s||i){const o=[`Unable to register library "${n}" with version "${e}":`];s&&o.push(`library name "${n}" contains illegal characters (whitespace or "/")`),s&&i&&o.push("and"),i&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),oA.warn(o.join(" "));return}Nn(new Dr(`${n}-version`,()=>({library:n,version:e}),"VERSION"))}/**
1082
1082
  * @license
1083
1083
  * Copyright 2021 Google LLC
1084
1084
  *
@@ -1093,7 +1093,7 @@
1093
1093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1094
1094
  * See the License for the specific language governing permissions and
1095
1095
  * limitations under the License.
1096
- */const mQ="firebase-heartbeat-database",BQ=1,Mn="firebase-heartbeat-store";let _c=null;function Ff(){return _c||(_c=LU(mQ,BQ,{upgrade:(A,e)=>{switch(e){case 0:try{A.createObjectStore(Mn)}catch(t){console.warn(t)}}}}).catch(A=>{throw UA.create("idb-open",{originalErrorMessage:A.message})})),_c}async function yQ(A){try{const t=(await Ff()).transaction(Mn),r=await t.objectStore(Mn).get(Sf(A));return await t.done,r}catch(e){if(e instanceof XA)oA.warn(e.message);else{const t=UA.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});oA.warn(t.message)}}}async function Tf(A,e){try{const r=(await Ff()).transaction(Mn,"readwrite");await r.objectStore(Mn).put(e,Sf(A)),await r.done}catch(t){if(t instanceof XA)oA.warn(t.message);else{const r=UA.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});oA.warn(r.message)}}}function Sf(A){return`${A.name}!${A.options.appId}`}/**
1096
+ */const mQ="firebase-heartbeat-database",BQ=1,Mn="firebase-heartbeat-store";let Cc=null;function Ff(){return Cc||(Cc=LU(mQ,BQ,{upgrade:(A,e)=>{switch(e){case 0:try{A.createObjectStore(Mn)}catch(t){console.warn(t)}}}}).catch(A=>{throw UA.create("idb-open",{originalErrorMessage:A.message})})),Cc}async function yQ(A){try{const t=(await Ff()).transaction(Mn),r=await t.objectStore(Mn).get(Sf(A));return await t.done,r}catch(e){if(e instanceof XA)oA.warn(e.message);else{const t=UA.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});oA.warn(t.message)}}}async function Tf(A,e){try{const r=(await Ff()).transaction(Mn,"readwrite");await r.objectStore(Mn).put(e,Sf(A)),await r.done}catch(t){if(t instanceof XA)oA.warn(t.message);else{const r=UA.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});oA.warn(r.message)}}}function Sf(A){return`${A.name}!${A.options.appId}`}/**
1097
1097
  * @license
1098
1098
  * Copyright 2021 Google LLC
1099
1099
  *
@@ -1108,7 +1108,7 @@
1108
1108
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1109
1109
  * See the License for the specific language governing permissions and
1110
1110
  * limitations under the License.
1111
- */const CQ=1024,_Q=30*24*60*60*1e3;class EQ{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new bQ(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Rf();return((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(i=>i.date===s)?void 0:(this._heartbeatsCache.heartbeats.push({date:s,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const o=new Date(i.date).valueOf();return Date.now()-o<=_Q}),this._storage.overwrite(this._heartbeatsCache))}catch(r){oA.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=Rf(),{heartbeatsToSend:r,unsentEntries:n}=vQ(this._heartbeatsCache.heartbeats),s=Pi(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return oA.warn(t),""}}}function Rf(){return new Date().toISOString().substring(0,10)}function vQ(A,e=CQ){const t=[];let r=A.slice();for(const n of A){const s=t.find(i=>i.agent===n.agent);if(s){if(s.dates.push(n.date),xf(t)>e){s.dates.pop();break}}else if(t.push({agent:n.agent,dates:[n.date]}),xf(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class bQ{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return fU()?gU().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await yQ(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return Tf(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return Tf(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}else return}}function xf(A){return Pi(JSON.stringify({version:2,heartbeats:A})).length}/**
1111
+ */const CQ=1024,_Q=30*24*60*60*1e3;class EQ{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new bQ(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Rf();return((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(i=>i.date===s)?void 0:(this._heartbeatsCache.heartbeats.push({date:s,agent:n}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(i=>{const o=new Date(i.date).valueOf();return Date.now()-o<=_Q}),this._storage.overwrite(this._heartbeatsCache))}catch(r){oA.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=Rf(),{heartbeatsToSend:r,unsentEntries:n}=vQ(this._heartbeatsCache.heartbeats),s=Oi(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return oA.warn(t),""}}}function Rf(){return new Date().toISOString().substring(0,10)}function vQ(A,e=CQ){const t=[];let r=A.slice();for(const n of A){const s=t.find(i=>i.agent===n.agent);if(s){if(s.dates.push(n.date),xf(t)>e){s.dates.pop();break}}else if(t.push({agent:n.agent,dates:[n.date]}),xf(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class bQ{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return fU()?gU().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await yQ(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return Tf(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return Tf(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}else return}}function xf(A){return Oi(JSON.stringify({version:2,heartbeats:A})).length}/**
1112
1112
  * @license
1113
1113
  * Copyright 2019 Google LLC
1114
1114
  *
@@ -1123,7 +1123,7 @@
1123
1123
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1124
1124
  * See the License for the specific language governing permissions and
1125
1125
  * limitations under the License.
1126
- */function UQ(A){Nn(new Lr("platform-logger",e=>new OU(e),"PRIVATE")),Nn(new Lr("heartbeat",e=>new EQ(e),"PRIVATE")),QA(Bc,Ef,A),QA(Bc,Ef,"esm2017"),QA("fire-js","")}UQ("");var QQ="firebase",IQ="10.14.1";/**
1126
+ */function UQ(A){Nn(new Dr("platform-logger",e=>new OU(e),"PRIVATE")),Nn(new Dr("heartbeat",e=>new EQ(e),"PRIVATE")),QA(mc,Ef,A),QA(mc,Ef,"esm2017"),QA("fire-js","")}UQ("");var QQ="firebase",IQ="10.14.1";/**
1127
1127
  * @license
1128
1128
  * Copyright 2020 Google LLC
1129
1129
  *
@@ -1145,22 +1145,22 @@ SPDX-License-Identifier: Apache-2.0
1145
1145
 
1146
1146
  Copyright The Closure Library Authors.
1147
1147
  SPDX-License-Identifier: Apache-2.0
1148
- */function e(_,C){function v(){}v.prototype=C.prototype,_.D=C.prototype,_.prototype=new v,_.prototype.constructor=_,_.C=function(U,Q,F){for(var E=Array(arguments.length-2),Ce=2;Ce<arguments.length;Ce++)E[Ce-2]=arguments[Ce];return C.prototype[Q].apply(U,E)}}function t(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,t),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function n(_,C,v){v||(v=0);var U=Array(16);if(typeof C=="string")for(var Q=0;16>Q;++Q)U[Q]=C.charCodeAt(v++)|C.charCodeAt(v++)<<8|C.charCodeAt(v++)<<16|C.charCodeAt(v++)<<24;else for(Q=0;16>Q;++Q)U[Q]=C[v++]|C[v++]<<8|C[v++]<<16|C[v++]<<24;C=_.g[0],v=_.g[1],Q=_.g[2];var F=_.g[3],E=C+(F^v&(Q^F))+U[0]+3614090360&4294967295;C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[1]+3905402710&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[2]+606105819&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[3]+3250441966&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(F^v&(Q^F))+U[4]+4118548399&4294967295,C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[5]+1200080426&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[6]+2821735955&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[7]+4249261313&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(F^v&(Q^F))+U[8]+1770035416&4294967295,C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[9]+2336552879&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[10]+4294925233&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[11]+2304563134&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(F^v&(Q^F))+U[12]+1804603682&4294967295,C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[13]+4254626195&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[14]+2792965006&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[15]+1236535329&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(Q^F&(v^Q))+U[1]+4129170786&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[6]+3225465664&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[11]+643717713&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[0]+3921069994&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(Q^F&(v^Q))+U[5]+3593408605&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[10]+38016083&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[15]+3634488961&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[4]+3889429448&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(Q^F&(v^Q))+U[9]+568446438&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[14]+3275163606&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[3]+4107603335&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[8]+1163531501&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(Q^F&(v^Q))+U[13]+2850285829&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[2]+4243563512&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[7]+1735328473&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[12]+2368359562&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(v^Q^F)+U[5]+4294588738&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[8]+2272392833&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[11]+1839030562&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[14]+4259657740&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(v^Q^F)+U[1]+2763975236&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[4]+1272893353&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[7]+4139469664&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[10]+3200236656&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(v^Q^F)+U[13]+681279174&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[0]+3936430074&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[3]+3572445317&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[6]+76029189&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(v^Q^F)+U[9]+3654602809&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[12]+3873151461&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[15]+530742520&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[2]+3299628645&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(Q^(v|~F))+U[0]+4096336452&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[7]+1126891415&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[14]+2878612391&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[5]+4237533241&4294967295,v=Q+(E<<21&4294967295|E>>>11),E=C+(Q^(v|~F))+U[12]+1700485571&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[3]+2399980690&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[10]+4293915773&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[1]+2240044497&4294967295,v=Q+(E<<21&4294967295|E>>>11),E=C+(Q^(v|~F))+U[8]+1873313359&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[15]+4264355552&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[6]+2734768916&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[13]+1309151649&4294967295,v=Q+(E<<21&4294967295|E>>>11),E=C+(Q^(v|~F))+U[4]+4149444226&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[11]+3174756917&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[2]+718787259&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[9]+3951481745&4294967295,_.g[0]=_.g[0]+C&4294967295,_.g[1]=_.g[1]+(Q+(E<<21&4294967295|E>>>11))&4294967295,_.g[2]=_.g[2]+Q&4294967295,_.g[3]=_.g[3]+F&4294967295}r.prototype.u=function(_,C){C===void 0&&(C=_.length);for(var v=C-this.blockSize,U=this.B,Q=this.h,F=0;F<C;){if(Q==0)for(;F<=v;)n(this,_,F),F+=this.blockSize;if(typeof _=="string"){for(;F<C;)if(U[Q++]=_.charCodeAt(F++),Q==this.blockSize){n(this,U),Q=0;break}}else for(;F<C;)if(U[Q++]=_[F++],Q==this.blockSize){n(this,U),Q=0;break}}this.h=Q,this.o+=C},r.prototype.v=function(){var _=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);_[0]=128;for(var C=1;C<_.length-8;++C)_[C]=0;var v=8*this.o;for(C=_.length-8;C<_.length;++C)_[C]=v&255,v/=256;for(this.u(_),_=Array(16),C=v=0;4>C;++C)for(var U=0;32>U;U+=8)_[v++]=this.g[C]>>>U&255;return _};function s(_,C){var v=o;return Object.prototype.hasOwnProperty.call(v,_)?v[_]:v[_]=C(_)}function i(_,C){this.h=C;for(var v=[],U=!0,Q=_.length-1;0<=Q;Q--){var F=_[Q]|0;U&&F==C||(v[Q]=F,U=!1)}this.g=v}var o={};function a(_){return-128<=_&&128>_?s(_,function(C){return new i([C|0],0>C?-1:0)}):new i([_|0],0>_?-1:0)}function l(_){if(isNaN(_)||!isFinite(_))return d;if(0>_)return B(l(-_));for(var C=[],v=1,U=0;_>=v;U++)C[U]=_/v|0,v*=4294967296;return new i(C,0)}function u(_,C){if(_.length==0)throw Error("number format error: empty string");if(C=C||10,2>C||36<C)throw Error("radix out of range: "+C);if(_.charAt(0)=="-")return B(u(_.substring(1),C));if(0<=_.indexOf("-"))throw Error('number format error: interior "-" character');for(var v=l(Math.pow(C,8)),U=d,Q=0;Q<_.length;Q+=8){var F=Math.min(8,_.length-Q),E=parseInt(_.substring(Q,Q+F),C);8>F?(F=l(Math.pow(C,F)),U=U.j(F).add(l(E))):(U=U.j(v),U=U.add(l(E)))}return U}var d=a(0),g=a(1),p=a(16777216);A=i.prototype,A.m=function(){if(y(this))return-B(this).m();for(var _=0,C=1,v=0;v<this.g.length;v++){var U=this.i(v);_+=(0<=U?U:4294967296+U)*C,C*=4294967296}return _},A.toString=function(_){if(_=_||10,2>_||36<_)throw Error("radix out of range: "+_);if(w(this))return"0";if(y(this))return"-"+B(this).toString(_);for(var C=l(Math.pow(_,6)),v=this,U="";;){var Q=R(v,C).g;v=b(v,Q.j(C));var F=((0<v.g.length?v.g[0]:v.h)>>>0).toString(_);if(v=Q,w(v))return F+U;for(;6>F.length;)F="0"+F;U=F+U}},A.i=function(_){return 0>_?0:_<this.g.length?this.g[_]:this.h};function w(_){if(_.h!=0)return!1;for(var C=0;C<_.g.length;C++)if(_.g[C]!=0)return!1;return!0}function y(_){return _.h==-1}A.l=function(_){return _=b(this,_),y(_)?-1:w(_)?0:1};function B(_){for(var C=_.g.length,v=[],U=0;U<C;U++)v[U]=~_.g[U];return new i(v,~_.h).add(g)}A.abs=function(){return y(this)?B(this):this},A.add=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0,Q=0;Q<=C;Q++){var F=U+(this.i(Q)&65535)+(_.i(Q)&65535),E=(F>>>16)+(this.i(Q)>>>16)+(_.i(Q)>>>16);U=E>>>16,F&=65535,E&=65535,v[Q]=E<<16|F}return new i(v,v[v.length-1]&-2147483648?-1:0)};function b(_,C){return _.add(B(C))}A.j=function(_){if(w(this)||w(_))return d;if(y(this))return y(_)?B(this).j(B(_)):B(B(this).j(_));if(y(_))return B(this.j(B(_)));if(0>this.l(p)&&0>_.l(p))return l(this.m()*_.m());for(var C=this.g.length+_.g.length,v=[],U=0;U<2*C;U++)v[U]=0;for(U=0;U<this.g.length;U++)for(var Q=0;Q<_.g.length;Q++){var F=this.i(U)>>>16,E=this.i(U)&65535,Ce=_.i(Q)>>>16,pt=_.i(Q)&65535;v[2*U+2*Q]+=E*pt,S(v,2*U+2*Q),v[2*U+2*Q+1]+=F*pt,S(v,2*U+2*Q+1),v[2*U+2*Q+1]+=E*Ce,S(v,2*U+2*Q+1),v[2*U+2*Q+2]+=F*Ce,S(v,2*U+2*Q+2)}for(U=0;U<C;U++)v[U]=v[2*U+1]<<16|v[2*U];for(U=C;U<2*C;U++)v[U]=0;return new i(v,0)};function S(_,C){for(;(_[C]&65535)!=_[C];)_[C+1]+=_[C]>>>16,_[C]&=65535,C++}function I(_,C){this.g=_,this.h=C}function R(_,C){if(w(C))throw Error("division by zero");if(w(_))return new I(d,d);if(y(_))return C=R(B(_),C),new I(B(C.g),B(C.h));if(y(C))return C=R(_,B(C)),new I(B(C.g),C.h);if(30<_.g.length){if(y(_)||y(C))throw Error("slowDivide_ only works with positive integers.");for(var v=g,U=C;0>=U.l(_);)v=K(v),U=K(U);var Q=P(v,1),F=P(U,1);for(U=P(U,2),v=P(v,2);!w(U);){var E=F.add(U);0>=E.l(_)&&(Q=Q.add(v),F=E),U=P(U,1),v=P(v,1)}return C=b(_,Q.j(C)),new I(Q,C)}for(Q=d;0<=_.l(C);){for(v=Math.max(1,Math.floor(_.m()/C.m())),U=Math.ceil(Math.log(v)/Math.LN2),U=48>=U?1:Math.pow(2,U-48),F=l(v),E=F.j(C);y(E)||0<E.l(_);)v-=U,F=l(v),E=F.j(C);w(F)&&(F=g),Q=Q.add(F),_=b(_,E)}return new I(Q,_)}A.A=function(_){return R(this,_).h},A.and=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0;U<C;U++)v[U]=this.i(U)&_.i(U);return new i(v,this.h&_.h)},A.or=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0;U<C;U++)v[U]=this.i(U)|_.i(U);return new i(v,this.h|_.h)},A.xor=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0;U<C;U++)v[U]=this.i(U)^_.i(U);return new i(v,this.h^_.h)};function K(_){for(var C=_.g.length+1,v=[],U=0;U<C;U++)v[U]=_.i(U)<<1|_.i(U-1)>>>31;return new i(v,_.h)}function P(_,C){var v=C>>5;C%=32;for(var U=_.g.length-v,Q=[],F=0;F<U;F++)Q[F]=0<C?_.i(F+v)>>>C|_.i(F+v+1)<<32-C:_.i(F+v);return new i(Q,_.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,Lf=r,i.prototype.add=i.prototype.add,i.prototype.multiply=i.prototype.j,i.prototype.modulo=i.prototype.A,i.prototype.compare=i.prototype.l,i.prototype.toNumber=i.prototype.m,i.prototype.toString=i.prototype.toString,i.prototype.getBits=i.prototype.i,i.fromNumber=l,i.fromString=u,ZA=i}).apply(typeof kf<"u"?kf:typeof self<"u"?self:typeof window<"u"?window:{});var Ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1148
+ */function e(_,C){function v(){}v.prototype=C.prototype,_.D=C.prototype,_.prototype=new v,_.prototype.constructor=_,_.C=function(U,Q,F){for(var E=Array(arguments.length-2),Ce=2;Ce<arguments.length;Ce++)E[Ce-2]=arguments[Ce];return C.prototype[Q].apply(U,E)}}function t(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,t),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function n(_,C,v){v||(v=0);var U=Array(16);if(typeof C=="string")for(var Q=0;16>Q;++Q)U[Q]=C.charCodeAt(v++)|C.charCodeAt(v++)<<8|C.charCodeAt(v++)<<16|C.charCodeAt(v++)<<24;else for(Q=0;16>Q;++Q)U[Q]=C[v++]|C[v++]<<8|C[v++]<<16|C[v++]<<24;C=_.g[0],v=_.g[1],Q=_.g[2];var F=_.g[3],E=C+(F^v&(Q^F))+U[0]+3614090360&4294967295;C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[1]+3905402710&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[2]+606105819&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[3]+3250441966&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(F^v&(Q^F))+U[4]+4118548399&4294967295,C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[5]+1200080426&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[6]+2821735955&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[7]+4249261313&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(F^v&(Q^F))+U[8]+1770035416&4294967295,C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[9]+2336552879&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[10]+4294925233&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[11]+2304563134&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(F^v&(Q^F))+U[12]+1804603682&4294967295,C=v+(E<<7&4294967295|E>>>25),E=F+(Q^C&(v^Q))+U[13]+4254626195&4294967295,F=C+(E<<12&4294967295|E>>>20),E=Q+(v^F&(C^v))+U[14]+2792965006&4294967295,Q=F+(E<<17&4294967295|E>>>15),E=v+(C^Q&(F^C))+U[15]+1236535329&4294967295,v=Q+(E<<22&4294967295|E>>>10),E=C+(Q^F&(v^Q))+U[1]+4129170786&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[6]+3225465664&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[11]+643717713&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[0]+3921069994&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(Q^F&(v^Q))+U[5]+3593408605&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[10]+38016083&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[15]+3634488961&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[4]+3889429448&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(Q^F&(v^Q))+U[9]+568446438&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[14]+3275163606&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[3]+4107603335&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[8]+1163531501&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(Q^F&(v^Q))+U[13]+2850285829&4294967295,C=v+(E<<5&4294967295|E>>>27),E=F+(v^Q&(C^v))+U[2]+4243563512&4294967295,F=C+(E<<9&4294967295|E>>>23),E=Q+(C^v&(F^C))+U[7]+1735328473&4294967295,Q=F+(E<<14&4294967295|E>>>18),E=v+(F^C&(Q^F))+U[12]+2368359562&4294967295,v=Q+(E<<20&4294967295|E>>>12),E=C+(v^Q^F)+U[5]+4294588738&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[8]+2272392833&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[11]+1839030562&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[14]+4259657740&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(v^Q^F)+U[1]+2763975236&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[4]+1272893353&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[7]+4139469664&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[10]+3200236656&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(v^Q^F)+U[13]+681279174&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[0]+3936430074&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[3]+3572445317&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[6]+76029189&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(v^Q^F)+U[9]+3654602809&4294967295,C=v+(E<<4&4294967295|E>>>28),E=F+(C^v^Q)+U[12]+3873151461&4294967295,F=C+(E<<11&4294967295|E>>>21),E=Q+(F^C^v)+U[15]+530742520&4294967295,Q=F+(E<<16&4294967295|E>>>16),E=v+(Q^F^C)+U[2]+3299628645&4294967295,v=Q+(E<<23&4294967295|E>>>9),E=C+(Q^(v|~F))+U[0]+4096336452&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[7]+1126891415&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[14]+2878612391&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[5]+4237533241&4294967295,v=Q+(E<<21&4294967295|E>>>11),E=C+(Q^(v|~F))+U[12]+1700485571&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[3]+2399980690&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[10]+4293915773&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[1]+2240044497&4294967295,v=Q+(E<<21&4294967295|E>>>11),E=C+(Q^(v|~F))+U[8]+1873313359&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[15]+4264355552&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[6]+2734768916&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[13]+1309151649&4294967295,v=Q+(E<<21&4294967295|E>>>11),E=C+(Q^(v|~F))+U[4]+4149444226&4294967295,C=v+(E<<6&4294967295|E>>>26),E=F+(v^(C|~Q))+U[11]+3174756917&4294967295,F=C+(E<<10&4294967295|E>>>22),E=Q+(C^(F|~v))+U[2]+718787259&4294967295,Q=F+(E<<15&4294967295|E>>>17),E=v+(F^(Q|~C))+U[9]+3951481745&4294967295,_.g[0]=_.g[0]+C&4294967295,_.g[1]=_.g[1]+(Q+(E<<21&4294967295|E>>>11))&4294967295,_.g[2]=_.g[2]+Q&4294967295,_.g[3]=_.g[3]+F&4294967295}r.prototype.u=function(_,C){C===void 0&&(C=_.length);for(var v=C-this.blockSize,U=this.B,Q=this.h,F=0;F<C;){if(Q==0)for(;F<=v;)n(this,_,F),F+=this.blockSize;if(typeof _=="string"){for(;F<C;)if(U[Q++]=_.charCodeAt(F++),Q==this.blockSize){n(this,U),Q=0;break}}else for(;F<C;)if(U[Q++]=_[F++],Q==this.blockSize){n(this,U),Q=0;break}}this.h=Q,this.o+=C},r.prototype.v=function(){var _=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);_[0]=128;for(var C=1;C<_.length-8;++C)_[C]=0;var v=8*this.o;for(C=_.length-8;C<_.length;++C)_[C]=v&255,v/=256;for(this.u(_),_=Array(16),C=v=0;4>C;++C)for(var U=0;32>U;U+=8)_[v++]=this.g[C]>>>U&255;return _};function s(_,C){var v=o;return Object.prototype.hasOwnProperty.call(v,_)?v[_]:v[_]=C(_)}function i(_,C){this.h=C;for(var v=[],U=!0,Q=_.length-1;0<=Q;Q--){var F=_[Q]|0;U&&F==C||(v[Q]=F,U=!1)}this.g=v}var o={};function a(_){return-128<=_&&128>_?s(_,function(C){return new i([C|0],0>C?-1:0)}):new i([_|0],0>_?-1:0)}function l(_){if(isNaN(_)||!isFinite(_))return d;if(0>_)return B(l(-_));for(var C=[],v=1,U=0;_>=v;U++)C[U]=_/v|0,v*=4294967296;return new i(C,0)}function u(_,C){if(_.length==0)throw Error("number format error: empty string");if(C=C||10,2>C||36<C)throw Error("radix out of range: "+C);if(_.charAt(0)=="-")return B(u(_.substring(1),C));if(0<=_.indexOf("-"))throw Error('number format error: interior "-" character');for(var v=l(Math.pow(C,8)),U=d,Q=0;Q<_.length;Q+=8){var F=Math.min(8,_.length-Q),E=parseInt(_.substring(Q,Q+F),C);8>F?(F=l(Math.pow(C,F)),U=U.j(F).add(l(E))):(U=U.j(v),U=U.add(l(E)))}return U}var d=a(0),g=a(1),p=a(16777216);A=i.prototype,A.m=function(){if(y(this))return-B(this).m();for(var _=0,C=1,v=0;v<this.g.length;v++){var U=this.i(v);_+=(0<=U?U:4294967296+U)*C,C*=4294967296}return _},A.toString=function(_){if(_=_||10,2>_||36<_)throw Error("radix out of range: "+_);if(w(this))return"0";if(y(this))return"-"+B(this).toString(_);for(var C=l(Math.pow(_,6)),v=this,U="";;){var Q=R(v,C).g;v=b(v,Q.j(C));var F=((0<v.g.length?v.g[0]:v.h)>>>0).toString(_);if(v=Q,w(v))return F+U;for(;6>F.length;)F="0"+F;U=F+U}},A.i=function(_){return 0>_?0:_<this.g.length?this.g[_]:this.h};function w(_){if(_.h!=0)return!1;for(var C=0;C<_.g.length;C++)if(_.g[C]!=0)return!1;return!0}function y(_){return _.h==-1}A.l=function(_){return _=b(this,_),y(_)?-1:w(_)?0:1};function B(_){for(var C=_.g.length,v=[],U=0;U<C;U++)v[U]=~_.g[U];return new i(v,~_.h).add(g)}A.abs=function(){return y(this)?B(this):this},A.add=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0,Q=0;Q<=C;Q++){var F=U+(this.i(Q)&65535)+(_.i(Q)&65535),E=(F>>>16)+(this.i(Q)>>>16)+(_.i(Q)>>>16);U=E>>>16,F&=65535,E&=65535,v[Q]=E<<16|F}return new i(v,v[v.length-1]&-2147483648?-1:0)};function b(_,C){return _.add(B(C))}A.j=function(_){if(w(this)||w(_))return d;if(y(this))return y(_)?B(this).j(B(_)):B(B(this).j(_));if(y(_))return B(this.j(B(_)));if(0>this.l(p)&&0>_.l(p))return l(this.m()*_.m());for(var C=this.g.length+_.g.length,v=[],U=0;U<2*C;U++)v[U]=0;for(U=0;U<this.g.length;U++)for(var Q=0;Q<_.g.length;Q++){var F=this.i(U)>>>16,E=this.i(U)&65535,Ce=_.i(Q)>>>16,pt=_.i(Q)&65535;v[2*U+2*Q]+=E*pt,S(v,2*U+2*Q),v[2*U+2*Q+1]+=F*pt,S(v,2*U+2*Q+1),v[2*U+2*Q+1]+=E*Ce,S(v,2*U+2*Q+1),v[2*U+2*Q+2]+=F*Ce,S(v,2*U+2*Q+2)}for(U=0;U<C;U++)v[U]=v[2*U+1]<<16|v[2*U];for(U=C;U<2*C;U++)v[U]=0;return new i(v,0)};function S(_,C){for(;(_[C]&65535)!=_[C];)_[C+1]+=_[C]>>>16,_[C]&=65535,C++}function I(_,C){this.g=_,this.h=C}function R(_,C){if(w(C))throw Error("division by zero");if(w(_))return new I(d,d);if(y(_))return C=R(B(_),C),new I(B(C.g),B(C.h));if(y(C))return C=R(_,B(C)),new I(B(C.g),C.h);if(30<_.g.length){if(y(_)||y(C))throw Error("slowDivide_ only works with positive integers.");for(var v=g,U=C;0>=U.l(_);)v=K(v),U=K(U);var Q=P(v,1),F=P(U,1);for(U=P(U,2),v=P(v,2);!w(U);){var E=F.add(U);0>=E.l(_)&&(Q=Q.add(v),F=E),U=P(U,1),v=P(v,1)}return C=b(_,Q.j(C)),new I(Q,C)}for(Q=d;0<=_.l(C);){for(v=Math.max(1,Math.floor(_.m()/C.m())),U=Math.ceil(Math.log(v)/Math.LN2),U=48>=U?1:Math.pow(2,U-48),F=l(v),E=F.j(C);y(E)||0<E.l(_);)v-=U,F=l(v),E=F.j(C);w(F)&&(F=g),Q=Q.add(F),_=b(_,E)}return new I(Q,_)}A.A=function(_){return R(this,_).h},A.and=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0;U<C;U++)v[U]=this.i(U)&_.i(U);return new i(v,this.h&_.h)},A.or=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0;U<C;U++)v[U]=this.i(U)|_.i(U);return new i(v,this.h|_.h)},A.xor=function(_){for(var C=Math.max(this.g.length,_.g.length),v=[],U=0;U<C;U++)v[U]=this.i(U)^_.i(U);return new i(v,this.h^_.h)};function K(_){for(var C=_.g.length+1,v=[],U=0;U<C;U++)v[U]=_.i(U)<<1|_.i(U-1)>>>31;return new i(v,_.h)}function P(_,C){var v=C>>5;C%=32;for(var U=_.g.length-v,Q=[],F=0;F<U;F++)Q[F]=0<C?_.i(F+v)>>>C|_.i(F+v+1)<<32-C:_.i(F+v);return new i(Q,_.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,Lf=r,i.prototype.add=i.prototype.add,i.prototype.multiply=i.prototype.j,i.prototype.modulo=i.prototype.A,i.prototype.compare=i.prototype.l,i.prototype.toNumber=i.prototype.m,i.prototype.toString=i.prototype.toString,i.prototype.getBits=i.prototype.i,i.fromNumber=l,i.fromString=u,ZA=i}).apply(typeof kf<"u"?kf:typeof self<"u"?self:typeof window<"u"?window:{});var Pi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1149
1149
  Copyright The Closure Library Authors.
1150
1150
  SPDX-License-Identifier: Apache-2.0
1151
- */var Df,Vn,Hf,Mi,Ec,Of,Pf,Nf;(function(){var A,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(c,h,f){return c==Array.prototype||c==Object.prototype||(c[h]=f.value),c};function t(c){c=[typeof globalThis=="object"&&globalThis,c,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ni=="object"&&Ni];for(var h=0;h<c.length;++h){var f=c[h];if(f&&f.Math==Math)return f}throw Error("Cannot find global object")}var r=t(this);function n(c,h){if(h)e:{var f=r;c=c.split(".");for(var m=0;m<c.length-1;m++){var T=c[m];if(!(T in f))break e;f=f[T]}c=c[c.length-1],m=f[c],h=h(m),h!=m&&h!=null&&e(f,c,{configurable:!0,writable:!0,value:h})}}function s(c,h){c instanceof String&&(c+="");var f=0,m=!1,T={next:function(){if(!m&&f<c.length){var x=f++;return{value:h(x,c[x]),done:!1}}return m=!0,{done:!0,value:void 0}}};return T[Symbol.iterator]=function(){return T},T}n("Array.prototype.values",function(c){return c||function(){return s(this,function(h,f){return f})}});/** @license
1151
+ */var Df,Vn,Hf,Ni,_c,Of,Pf,Nf;(function(){var A,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(c,h,f){return c==Array.prototype||c==Object.prototype||(c[h]=f.value),c};function t(c){c=[typeof globalThis=="object"&&globalThis,c,typeof window=="object"&&window,typeof self=="object"&&self,typeof Pi=="object"&&Pi];for(var h=0;h<c.length;++h){var f=c[h];if(f&&f.Math==Math)return f}throw Error("Cannot find global object")}var r=t(this);function n(c,h){if(h)e:{var f=r;c=c.split(".");for(var m=0;m<c.length-1;m++){var T=c[m];if(!(T in f))break e;f=f[T]}c=c[c.length-1],m=f[c],h=h(m),h!=m&&h!=null&&e(f,c,{configurable:!0,writable:!0,value:h})}}function s(c,h){c instanceof String&&(c+="");var f=0,m=!1,T={next:function(){if(!m&&f<c.length){var x=f++;return{value:h(x,c[x]),done:!1}}return m=!0,{done:!0,value:void 0}}};return T[Symbol.iterator]=function(){return T},T}n("Array.prototype.values",function(c){return c||function(){return s(this,function(h,f){return f})}});/** @license
1152
1152
 
1153
1153
  Copyright The Closure Library Authors.
1154
1154
  SPDX-License-Identifier: Apache-2.0
1155
- */var i=i||{},o=this||self;function a(c){var h=typeof c;return h=h!="object"?h:c?Array.isArray(c)?"array":h:"null",h=="array"||h=="object"&&typeof c.length=="number"}function l(c){var h=typeof c;return h=="object"&&c!=null||h=="function"}function u(c,h,f){return c.call.apply(c.bind,arguments)}function d(c,h,f){if(!c)throw Error();if(2<arguments.length){var m=Array.prototype.slice.call(arguments,2);return function(){var T=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(T,m),c.apply(h,T)}}return function(){return c.apply(h,arguments)}}function g(c,h,f){return g=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?u:d,g.apply(null,arguments)}function p(c,h){var f=Array.prototype.slice.call(arguments,1);return function(){var m=f.slice();return m.push.apply(m,arguments),c.apply(this,m)}}function w(c,h){function f(){}f.prototype=h.prototype,c.aa=h.prototype,c.prototype=new f,c.prototype.constructor=c,c.Qb=function(m,T,x){for(var D=Array(arguments.length-2),ue=2;ue<arguments.length;ue++)D[ue-2]=arguments[ue];return h.prototype[T].apply(m,D)}}function y(c){const h=c.length;if(0<h){const f=Array(h);for(let m=0;m<h;m++)f[m]=c[m];return f}return[]}function B(c,h){for(let f=1;f<arguments.length;f++){const m=arguments[f];if(a(m)){const T=c.length||0,x=m.length||0;c.length=T+x;for(let D=0;D<x;D++)c[T+D]=m[D]}else c.push(m)}}class b{constructor(h,f){this.i=h,this.j=f,this.h=0,this.g=null}get(){let h;return 0<this.h?(this.h--,h=this.g,this.g=h.next,h.next=null):h=this.i(),h}}function S(c){return/^[\s\xa0]*$/.test(c)}function I(){var c=o.navigator;return c&&(c=c.userAgent)?c:""}function R(c){return R[" "](c),c}R[" "]=function(){};var K=I().indexOf("Gecko")!=-1&&!(I().toLowerCase().indexOf("webkit")!=-1&&I().indexOf("Edge")==-1)&&!(I().indexOf("Trident")!=-1||I().indexOf("MSIE")!=-1)&&I().indexOf("Edge")==-1;function P(c,h,f){for(const m in c)h.call(f,c[m],m,c)}function _(c,h){for(const f in c)h.call(void 0,c[f],f,c)}function C(c){const h={};for(const f in c)h[f]=c[f];return h}const v="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function U(c,h){let f,m;for(let T=1;T<arguments.length;T++){m=arguments[T];for(f in m)c[f]=m[f];for(let x=0;x<v.length;x++)f=v[x],Object.prototype.hasOwnProperty.call(m,f)&&(c[f]=m[f])}}function Q(c){var h=1;c=c.split(":");const f=[];for(;0<h&&c.length;)f.push(c.shift()),h--;return c.length&&f.push(c.join(":")),f}function F(c){o.setTimeout(()=>{throw c},0)}function E(){var c=re;let h=null;return c.g&&(h=c.g,c.g=c.g.next,c.g||(c.h=null),h.next=null),h}class Ce{constructor(){this.h=this.g=null}add(h,f){const m=pt.get();m.set(h,f),this.h?this.h.next=m:this.g=m,this.h=m}}var pt=new b(()=>new fA,c=>c.reset());class fA{constructor(){this.next=this.g=this.h=null}set(h,f){this.h=h,this.g=f,this.next=null}reset(){this.next=this.g=this.h=null}}let Br,j=!1,re=new Ce,ce=()=>{const c=o.Promise.resolve(void 0);Br=()=>{c.then(Y)}};var Y=()=>{for(var c;c=E();){try{c.h.call(c.g)}catch(f){F(f)}var h=pt;h.j(c),100>h.h&&(h.h++,c.next=h.g,h.g=c)}j=!1};function le(){this.s=this.s,this.C=this.C}le.prototype.s=!1,le.prototype.ma=function(){this.s||(this.s=!0,this.N())},le.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function te(c,h){this.type=c,this.g=this.target=h,this.defaultPrevented=!1}te.prototype.h=function(){this.defaultPrevented=!0};var Mt=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var c=!1,h=Object.defineProperty({},"passive",{get:function(){c=!0}});try{const f=()=>{};o.addEventListener("test",f,h),o.removeEventListener("test",f,h)}catch{}return c}();function Ut(c,h){if(te.call(this,c?c.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,c){var f=this.type=c.type,m=c.changedTouches&&c.changedTouches.length?c.changedTouches[0]:null;if(this.target=c.target||c.srcElement,this.g=h,h=c.relatedTarget){if(K){e:{try{R(h.nodeName);var T=!0;break e}catch{}T=!1}T||(h=null)}}else f=="mouseover"?h=c.fromElement:f=="mouseout"&&(h=c.toElement);this.relatedTarget=h,m?(this.clientX=m.clientX!==void 0?m.clientX:m.pageX,this.clientY=m.clientY!==void 0?m.clientY:m.pageY,this.screenX=m.screenX||0,this.screenY=m.screenY||0):(this.clientX=c.clientX!==void 0?c.clientX:c.pageX,this.clientY=c.clientY!==void 0?c.clientY:c.pageY,this.screenX=c.screenX||0,this.screenY=c.screenY||0),this.button=c.button,this.key=c.key||"",this.ctrlKey=c.ctrlKey,this.altKey=c.altKey,this.shiftKey=c.shiftKey,this.metaKey=c.metaKey,this.pointerId=c.pointerId||0,this.pointerType=typeof c.pointerType=="string"?c.pointerType:ou[c.pointerType]||"",this.state=c.state,this.i=c,c.defaultPrevented&&Ut.aa.h.call(this)}}w(Ut,te);var ou={2:"touch",3:"pen",4:"mouse"};Ut.prototype.h=function(){Ut.aa.h.call(this);var c=this.i;c.preventDefault?c.preventDefault():c.returnValue=!1};var tA="closure_listenable_"+(1e6*Math.random()|0),au=0;function cu(c,h,f,m,T){this.listener=c,this.proxy=null,this.src=h,this.type=f,this.capture=!!m,this.ha=T,this.key=++au,this.da=this.fa=!1}function cn(c){c.da=!0,c.listener=null,c.proxy=null,c.src=null,c.ha=null}function ln(c){this.src=c,this.g={},this.h=0}ln.prototype.add=function(c,h,f,m,T){var x=c.toString();c=this.g[x],c||(c=this.g[x]=[],this.h++);var D=lu(c,h,m,T);return-1<D?(h=c[D],f||(h.fa=!1)):(h=new cu(h,this.src,x,!!m,T),h.fa=f,c.push(h)),h};function Ts(c,h){var f=h.type;if(f in c.g){var m=c.g[f],T=Array.prototype.indexOf.call(m,h,void 0),x;(x=0<=T)&&Array.prototype.splice.call(m,T,1),x&&(cn(h),c.g[f].length==0&&(delete c.g[f],c.h--))}}function lu(c,h,f,m){for(var T=0;T<c.length;++T){var x=c[T];if(!x.da&&x.listener==h&&x.capture==!!f&&x.ha==m)return T}return-1}var uu="closure_lm_"+(1e6*Math.random()|0),hu={};function wm(c,h,f,m,T){if(Array.isArray(h)){for(var x=0;x<h.length;x++)wm(c,h[x],f,m,T);return null}return f=ym(f),c&&c[tA]?c.K(h,f,l(m)?!!m.capture:!1,T):zx(c,h,f,!1,m,T)}function zx(c,h,f,m,T,x){if(!h)throw Error("Invalid event type");var D=l(T)?!!T.capture:!!T,ue=fu(c);if(ue||(c[uu]=ue=new ln(c)),f=ue.add(h,f,m,D,x),f.proxy)return f;if(m=Xx(),f.proxy=m,m.src=c,m.listener=f,c.addEventListener)Mt||(T=D),T===void 0&&(T=!1),c.addEventListener(h.toString(),m,T);else if(c.attachEvent)c.attachEvent(Bm(h.toString()),m);else if(c.addListener&&c.removeListener)c.addListener(m);else throw Error("addEventListener and attachEvent are unavailable.");return f}function Xx(){function c(f){return h.call(c.src,c.listener,f)}const h=Yx;return c}function mm(c,h,f,m,T){if(Array.isArray(h))for(var x=0;x<h.length;x++)mm(c,h[x],f,m,T);else m=l(m)?!!m.capture:!!m,f=ym(f),c&&c[tA]?(c=c.i,h=String(h).toString(),h in c.g&&(x=c.g[h],f=lu(x,f,m,T),-1<f&&(cn(x[f]),Array.prototype.splice.call(x,f,1),x.length==0&&(delete c.g[h],c.h--)))):c&&(c=fu(c))&&(h=c.g[h.toString()],c=-1,h&&(c=lu(h,f,m,T)),(f=-1<c?h[c]:null)&&du(f))}function du(c){if(typeof c!="number"&&c&&!c.da){var h=c.src;if(h&&h[tA])Ts(h.i,c);else{var f=c.type,m=c.proxy;h.removeEventListener?h.removeEventListener(f,m,c.capture):h.detachEvent?h.detachEvent(Bm(f),m):h.addListener&&h.removeListener&&h.removeListener(m),(f=fu(h))?(Ts(f,c),f.h==0&&(f.src=null,h[uu]=null)):cn(c)}}}function Bm(c){return c in hu?hu[c]:hu[c]="on"+c}function Yx(c,h){if(c.da)c=!0;else{h=new Ut(h,this);var f=c.listener,m=c.ha||c.src;c.fa&&du(c),c=f.call(m,h)}return c}function fu(c){return c=c[uu],c instanceof ln?c:null}var gu="__closure_events_fn_"+(1e9*Math.random()>>>0);function ym(c){return typeof c=="function"?c:(c[gu]||(c[gu]=function(h){return c.handleEvent(h)}),c[gu])}function Xe(){le.call(this),this.i=new ln(this),this.M=this,this.F=null}w(Xe,le),Xe.prototype[tA]=!0,Xe.prototype.removeEventListener=function(c,h,f,m){mm(this,c,h,f,m)};function At(c,h){var f,m=c.F;if(m)for(f=[];m;m=m.F)f.push(m);if(c=c.M,m=h.type||h,typeof h=="string")h=new te(h,c);else if(h instanceof te)h.target=h.target||c;else{var T=h;h=new te(m,c),U(h,T)}if(T=!0,f)for(var x=f.length-1;0<=x;x--){var D=h.g=f[x];T=$o(D,m,!0,h)&&T}if(D=h.g=c,T=$o(D,m,!0,h)&&T,T=$o(D,m,!1,h)&&T,f)for(x=0;x<f.length;x++)D=h.g=f[x],T=$o(D,m,!1,h)&&T}Xe.prototype.N=function(){if(Xe.aa.N.call(this),this.i){var c=this.i,h;for(h in c.g){for(var f=c.g[h],m=0;m<f.length;m++)cn(f[m]);delete c.g[h],c.h--}}this.F=null},Xe.prototype.K=function(c,h,f,m){return this.i.add(String(c),h,!1,f,m)},Xe.prototype.L=function(c,h,f,m){return this.i.add(String(c),h,!0,f,m)};function $o(c,h,f,m){if(h=c.i.g[String(h)],!h)return!0;h=h.concat();for(var T=!0,x=0;x<h.length;++x){var D=h[x];if(D&&!D.da&&D.capture==f){var ue=D.listener,je=D.ha||D.src;D.fa&&Ts(c.i,D),T=ue.call(je,m)!==!1&&T}}return T&&!m.defaultPrevented}function Cm(c,h,f){if(typeof c=="function")f&&(c=g(c,f));else if(c&&typeof c.handleEvent=="function")c=g(c.handleEvent,c);else throw Error("Invalid listener argument");return 2147483647<Number(h)?-1:o.setTimeout(c,h||0)}function _m(c){c.g=Cm(()=>{c.g=null,c.i&&(c.i=!1,_m(c))},c.l);const h=c.h;c.h=null,c.m.apply(null,h)}class Zx extends le{constructor(h,f){super(),this.m=h,this.l=f,this.h=null,this.i=!1,this.g=null}j(h){this.h=arguments,this.g?this.i=!0:_m(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ss(c){le.call(this),this.h=c,this.g={}}w(Ss,le);var Em=[];function vm(c){P(c.g,function(h,f){this.g.hasOwnProperty(f)&&du(h)},c),c.g={}}Ss.prototype.N=function(){Ss.aa.N.call(this),vm(this)},Ss.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var pu=o.JSON.stringify,ek=o.JSON.parse,tk=class{stringify(c){return o.JSON.stringify(c,void 0)}parse(c){return o.JSON.parse(c,void 0)}};function wu(){}wu.prototype.h=null;function bm(c){return c.h||(c.h=c.i())}function Um(){}var Rs={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function mu(){te.call(this,"d")}w(mu,te);function Bu(){te.call(this,"c")}w(Bu,te);var yr={},Qm=null;function jo(){return Qm=Qm||new Xe}yr.La="serverreachability";function Im(c){te.call(this,yr.La,c)}w(Im,te);function xs(c){const h=jo();At(h,new Im(h))}yr.STAT_EVENT="statevent";function Fm(c,h){te.call(this,yr.STAT_EVENT,c),this.stat=h}w(Fm,te);function rt(c){const h=jo();At(h,new Fm(h,c))}yr.Ma="timingevent";function Tm(c,h){te.call(this,yr.Ma,c),this.size=h}w(Tm,te);function ks(c,h){if(typeof c!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){c()},h)}function Ls(){this.g=!0}Ls.prototype.xa=function(){this.g=!1};function Ak(c,h,f,m,T,x){c.info(function(){if(c.g)if(x)for(var D="",ue=x.split("&"),je=0;je<ue.length;je++){var ie=ue[je].split("=");if(1<ie.length){var Ye=ie[0];ie=ie[1];var Ze=Ye.split("_");D=2<=Ze.length&&Ze[1]=="type"?D+(Ye+"="+ie+"&"):D+(Ye+"=redacted&")}}else D=null;else D=x;return"XMLHTTP REQ ("+m+") [attempt "+T+"]: "+h+`
1155
+ */var i=i||{},o=this||self;function a(c){var h=typeof c;return h=h!="object"?h:c?Array.isArray(c)?"array":h:"null",h=="array"||h=="object"&&typeof c.length=="number"}function l(c){var h=typeof c;return h=="object"&&c!=null||h=="function"}function u(c,h,f){return c.call.apply(c.bind,arguments)}function d(c,h,f){if(!c)throw Error();if(2<arguments.length){var m=Array.prototype.slice.call(arguments,2);return function(){var T=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(T,m),c.apply(h,T)}}return function(){return c.apply(h,arguments)}}function g(c,h,f){return g=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?u:d,g.apply(null,arguments)}function p(c,h){var f=Array.prototype.slice.call(arguments,1);return function(){var m=f.slice();return m.push.apply(m,arguments),c.apply(this,m)}}function w(c,h){function f(){}f.prototype=h.prototype,c.aa=h.prototype,c.prototype=new f,c.prototype.constructor=c,c.Qb=function(m,T,x){for(var D=Array(arguments.length-2),ue=2;ue<arguments.length;ue++)D[ue-2]=arguments[ue];return h.prototype[T].apply(m,D)}}function y(c){const h=c.length;if(0<h){const f=Array(h);for(let m=0;m<h;m++)f[m]=c[m];return f}return[]}function B(c,h){for(let f=1;f<arguments.length;f++){const m=arguments[f];if(a(m)){const T=c.length||0,x=m.length||0;c.length=T+x;for(let D=0;D<x;D++)c[T+D]=m[D]}else c.push(m)}}class b{constructor(h,f){this.i=h,this.j=f,this.h=0,this.g=null}get(){let h;return 0<this.h?(this.h--,h=this.g,this.g=h.next,h.next=null):h=this.i(),h}}function S(c){return/^[\s\xa0]*$/.test(c)}function I(){var c=o.navigator;return c&&(c=c.userAgent)?c:""}function R(c){return R[" "](c),c}R[" "]=function(){};var K=I().indexOf("Gecko")!=-1&&!(I().toLowerCase().indexOf("webkit")!=-1&&I().indexOf("Edge")==-1)&&!(I().indexOf("Trident")!=-1||I().indexOf("MSIE")!=-1)&&I().indexOf("Edge")==-1;function P(c,h,f){for(const m in c)h.call(f,c[m],m,c)}function _(c,h){for(const f in c)h.call(void 0,c[f],f,c)}function C(c){const h={};for(const f in c)h[f]=c[f];return h}const v="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function U(c,h){let f,m;for(let T=1;T<arguments.length;T++){m=arguments[T];for(f in m)c[f]=m[f];for(let x=0;x<v.length;x++)f=v[x],Object.prototype.hasOwnProperty.call(m,f)&&(c[f]=m[f])}}function Q(c){var h=1;c=c.split(":");const f=[];for(;0<h&&c.length;)f.push(c.shift()),h--;return c.length&&f.push(c.join(":")),f}function F(c){o.setTimeout(()=>{throw c},0)}function E(){var c=re;let h=null;return c.g&&(h=c.g,c.g=c.g.next,c.g||(c.h=null),h.next=null),h}class Ce{constructor(){this.h=this.g=null}add(h,f){const m=pt.get();m.set(h,f),this.h?this.h.next=m:this.g=m,this.h=m}}var pt=new b(()=>new fA,c=>c.reset());class fA{constructor(){this.next=this.g=this.h=null}set(h,f){this.h=h,this.g=f,this.next=null}reset(){this.next=this.g=this.h=null}}let Br,j=!1,re=new Ce,ce=()=>{const c=o.Promise.resolve(void 0);Br=()=>{c.then(Y)}};var Y=()=>{for(var c;c=E();){try{c.h.call(c.g)}catch(f){F(f)}var h=pt;h.j(c),100>h.h&&(h.h++,c.next=h.g,h.g=c)}j=!1};function le(){this.s=this.s,this.C=this.C}le.prototype.s=!1,le.prototype.ma=function(){this.s||(this.s=!0,this.N())},le.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function te(c,h){this.type=c,this.g=this.target=h,this.defaultPrevented=!1}te.prototype.h=function(){this.defaultPrevented=!0};var Mt=function(){if(!o.addEventListener||!Object.defineProperty)return!1;var c=!1,h=Object.defineProperty({},"passive",{get:function(){c=!0}});try{const f=()=>{};o.addEventListener("test",f,h),o.removeEventListener("test",f,h)}catch{}return c}();function Ut(c,h){if(te.call(this,c?c.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,c){var f=this.type=c.type,m=c.changedTouches&&c.changedTouches.length?c.changedTouches[0]:null;if(this.target=c.target||c.srcElement,this.g=h,h=c.relatedTarget){if(K){e:{try{R(h.nodeName);var T=!0;break e}catch{}T=!1}T||(h=null)}}else f=="mouseover"?h=c.fromElement:f=="mouseout"&&(h=c.toElement);this.relatedTarget=h,m?(this.clientX=m.clientX!==void 0?m.clientX:m.pageX,this.clientY=m.clientY!==void 0?m.clientY:m.pageY,this.screenX=m.screenX||0,this.screenY=m.screenY||0):(this.clientX=c.clientX!==void 0?c.clientX:c.pageX,this.clientY=c.clientY!==void 0?c.clientY:c.pageY,this.screenX=c.screenX||0,this.screenY=c.screenY||0),this.button=c.button,this.key=c.key||"",this.ctrlKey=c.ctrlKey,this.altKey=c.altKey,this.shiftKey=c.shiftKey,this.metaKey=c.metaKey,this.pointerId=c.pointerId||0,this.pointerType=typeof c.pointerType=="string"?c.pointerType:iu[c.pointerType]||"",this.state=c.state,this.i=c,c.defaultPrevented&&Ut.aa.h.call(this)}}w(Ut,te);var iu={2:"touch",3:"pen",4:"mouse"};Ut.prototype.h=function(){Ut.aa.h.call(this);var c=this.i;c.preventDefault?c.preventDefault():c.returnValue=!1};var tA="closure_listenable_"+(1e6*Math.random()|0),ou=0;function au(c,h,f,m,T){this.listener=c,this.proxy=null,this.src=h,this.type=f,this.capture=!!m,this.ha=T,this.key=++ou,this.da=this.fa=!1}function yr(c){c.da=!0,c.listener=null,c.proxy=null,c.src=null,c.ha=null}function ln(c){this.src=c,this.g={},this.h=0}ln.prototype.add=function(c,h,f,m,T){var x=c.toString();c=this.g[x],c||(c=this.g[x]=[],this.h++);var D=lu(c,h,m,T);return-1<D?(h=c[D],f||(h.fa=!1)):(h=new au(h,this.src,x,!!m,T),h.fa=f,c.push(h)),h};function cu(c,h){var f=h.type;if(f in c.g){var m=c.g[f],T=Array.prototype.indexOf.call(m,h,void 0),x;(x=0<=T)&&Array.prototype.splice.call(m,T,1),x&&(yr(h),c.g[f].length==0&&(delete c.g[f],c.h--))}}function lu(c,h,f,m){for(var T=0;T<c.length;++T){var x=c[T];if(!x.da&&x.listener==h&&x.capture==!!f&&x.ha==m)return T}return-1}var uu="closure_lm_"+(1e6*Math.random()|0),hu={};function wm(c,h,f,m,T){if(Array.isArray(h)){for(var x=0;x<h.length;x++)wm(c,h[x],f,m,T);return null}return f=ym(f),c&&c[tA]?c.K(h,f,l(m)?!!m.capture:!1,T):zx(c,h,f,!1,m,T)}function zx(c,h,f,m,T,x){if(!h)throw Error("Invalid event type");var D=l(T)?!!T.capture:!!T,ue=fu(c);if(ue||(c[uu]=ue=new ln(c)),f=ue.add(h,f,m,D,x),f.proxy)return f;if(m=Xx(),f.proxy=m,m.src=c,m.listener=f,c.addEventListener)Mt||(T=D),T===void 0&&(T=!1),c.addEventListener(h.toString(),m,T);else if(c.attachEvent)c.attachEvent(Bm(h.toString()),m);else if(c.addListener&&c.removeListener)c.addListener(m);else throw Error("addEventListener and attachEvent are unavailable.");return f}function Xx(){function c(f){return h.call(c.src,c.listener,f)}const h=Yx;return c}function mm(c,h,f,m,T){if(Array.isArray(h))for(var x=0;x<h.length;x++)mm(c,h[x],f,m,T);else m=l(m)?!!m.capture:!!m,f=ym(f),c&&c[tA]?(c=c.i,h=String(h).toString(),h in c.g&&(x=c.g[h],f=lu(x,f,m,T),-1<f&&(yr(x[f]),Array.prototype.splice.call(x,f,1),x.length==0&&(delete c.g[h],c.h--)))):c&&(c=fu(c))&&(h=c.g[h.toString()],c=-1,h&&(c=lu(h,f,m,T)),(f=-1<c?h[c]:null)&&du(f))}function du(c){if(typeof c!="number"&&c&&!c.da){var h=c.src;if(h&&h[tA])cu(h.i,c);else{var f=c.type,m=c.proxy;h.removeEventListener?h.removeEventListener(f,m,c.capture):h.detachEvent?h.detachEvent(Bm(f),m):h.addListener&&h.removeListener&&h.removeListener(m),(f=fu(h))?(cu(f,c),f.h==0&&(f.src=null,h[uu]=null)):yr(c)}}}function Bm(c){return c in hu?hu[c]:hu[c]="on"+c}function Yx(c,h){if(c.da)c=!0;else{h=new Ut(h,this);var f=c.listener,m=c.ha||c.src;c.fa&&du(c),c=f.call(m,h)}return c}function fu(c){return c=c[uu],c instanceof ln?c:null}var gu="__closure_events_fn_"+(1e9*Math.random()>>>0);function ym(c){return typeof c=="function"?c:(c[gu]||(c[gu]=function(h){return c.handleEvent(h)}),c[gu])}function Xe(){le.call(this),this.i=new ln(this),this.M=this,this.F=null}w(Xe,le),Xe.prototype[tA]=!0,Xe.prototype.removeEventListener=function(c,h,f,m){mm(this,c,h,f,m)};function At(c,h){var f,m=c.F;if(m)for(f=[];m;m=m.F)f.push(m);if(c=c.M,m=h.type||h,typeof h=="string")h=new te(h,c);else if(h instanceof te)h.target=h.target||c;else{var T=h;h=new te(m,c),U(h,T)}if(T=!0,f)for(var x=f.length-1;0<=x;x--){var D=h.g=f[x];T=Ko(D,m,!0,h)&&T}if(D=h.g=c,T=Ko(D,m,!0,h)&&T,T=Ko(D,m,!1,h)&&T,f)for(x=0;x<f.length;x++)D=h.g=f[x],T=Ko(D,m,!1,h)&&T}Xe.prototype.N=function(){if(Xe.aa.N.call(this),this.i){var c=this.i,h;for(h in c.g){for(var f=c.g[h],m=0;m<f.length;m++)yr(f[m]);delete c.g[h],c.h--}}this.F=null},Xe.prototype.K=function(c,h,f,m){return this.i.add(String(c),h,!1,f,m)},Xe.prototype.L=function(c,h,f,m){return this.i.add(String(c),h,!0,f,m)};function Ko(c,h,f,m){if(h=c.i.g[String(h)],!h)return!0;h=h.concat();for(var T=!0,x=0;x<h.length;++x){var D=h[x];if(D&&!D.da&&D.capture==f){var ue=D.listener,je=D.ha||D.src;D.fa&&cu(c.i,D),T=ue.call(je,m)!==!1&&T}}return T&&!m.defaultPrevented}function Cm(c,h,f){if(typeof c=="function")f&&(c=g(c,f));else if(c&&typeof c.handleEvent=="function")c=g(c.handleEvent,c);else throw Error("Invalid listener argument");return 2147483647<Number(h)?-1:o.setTimeout(c,h||0)}function _m(c){c.g=Cm(()=>{c.g=null,c.i&&(c.i=!1,_m(c))},c.l);const h=c.h;c.h=null,c.m.apply(null,h)}class Zx extends le{constructor(h,f){super(),this.m=h,this.l=f,this.h=null,this.i=!1,this.g=null}j(h){this.h=arguments,this.g?this.i=!0:_m(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ts(c){le.call(this),this.h=c,this.g={}}w(Ts,le);var Em=[];function vm(c){P(c.g,function(h,f){this.g.hasOwnProperty(f)&&du(h)},c),c.g={}}Ts.prototype.N=function(){Ts.aa.N.call(this),vm(this)},Ts.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var pu=o.JSON.stringify,ek=o.JSON.parse,tk=class{stringify(c){return o.JSON.stringify(c,void 0)}parse(c){return o.JSON.parse(c,void 0)}};function wu(){}wu.prototype.h=null;function bm(c){return c.h||(c.h=c.i())}function Um(){}var Ss={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function mu(){te.call(this,"d")}w(mu,te);function Bu(){te.call(this,"c")}w(Bu,te);var Cr={},Qm=null;function $o(){return Qm=Qm||new Xe}Cr.La="serverreachability";function Im(c){te.call(this,Cr.La,c)}w(Im,te);function Rs(c){const h=$o();At(h,new Im(h))}Cr.STAT_EVENT="statevent";function Fm(c,h){te.call(this,Cr.STAT_EVENT,c),this.stat=h}w(Fm,te);function rt(c){const h=$o();At(h,new Fm(h,c))}Cr.Ma="timingevent";function Tm(c,h){te.call(this,Cr.Ma,c),this.size=h}w(Tm,te);function xs(c,h){if(typeof c!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){c()},h)}function ks(){this.g=!0}ks.prototype.xa=function(){this.g=!1};function Ak(c,h,f,m,T,x){c.info(function(){if(c.g)if(x)for(var D="",ue=x.split("&"),je=0;je<ue.length;je++){var ie=ue[je].split("=");if(1<ie.length){var Ye=ie[0];ie=ie[1];var Ze=Ye.split("_");D=2<=Ze.length&&Ze[1]=="type"?D+(Ye+"="+ie+"&"):D+(Ye+"=redacted&")}}else D=null;else D=x;return"XMLHTTP REQ ("+m+") [attempt "+T+"]: "+h+`
1156
1156
  `+f+`
1157
1157
  `+D})}function rk(c,h,f,m,T,x,D){c.info(function(){return"XMLHTTP RESP ("+m+") [ attempt "+T+"]: "+h+`
1158
1158
  `+f+`
1159
- `+x+" "+D})}function un(c,h,f,m){c.info(function(){return"XMLHTTP TEXT ("+h+"): "+sk(c,f)+(m?" "+m:"")})}function nk(c,h){c.info(function(){return"TIMEOUT: "+h})}Ls.prototype.info=function(){};function sk(c,h){if(!c.g)return h;if(!h)return null;try{var f=JSON.parse(h);if(f){for(c=0;c<f.length;c++)if(Array.isArray(f[c])){var m=f[c];if(!(2>m.length)){var T=m[1];if(Array.isArray(T)&&!(1>T.length)){var x=T[0];if(x!="noop"&&x!="stop"&&x!="close")for(var D=1;D<T.length;D++)T[D]=""}}}}return pu(f)}catch{return h}}var Go={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Sm={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},yu;function Wo(){}w(Wo,wu),Wo.prototype.g=function(){return new XMLHttpRequest},Wo.prototype.i=function(){return{}},yu=new Wo;function HA(c,h,f,m){this.j=c,this.i=h,this.l=f,this.R=m||1,this.U=new Ss(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Rm}function Rm(){this.i=null,this.g="",this.h=!1}var xm={},Cu={};function _u(c,h,f){c.L=1,c.v=Xo(gA(h)),c.m=f,c.P=!0,km(c,null)}function km(c,h){c.F=Date.now(),qo(c),c.A=gA(c.v);var f=c.A,m=c.R;Array.isArray(m)||(m=[String(m)]),qm(f.i,"t",m),c.C=0,f=c.j.J,c.h=new Rm,c.g=hB(c.j,f?h:null,!c.m),0<c.O&&(c.M=new Zx(g(c.Y,c,c.g),c.O)),h=c.U,f=c.g,m=c.ca;var T="readystatechange";Array.isArray(T)||(T&&(Em[0]=T.toString()),T=Em);for(var x=0;x<T.length;x++){var D=wm(f,T[x],m||h.handleEvent,!1,h.h||h);if(!D)break;h.g[D.key]=D}h=c.H?C(c.H):{},c.m?(c.u||(c.u="POST"),h["Content-Type"]="application/x-www-form-urlencoded",c.g.ea(c.A,c.u,c.m,h)):(c.u="GET",c.g.ea(c.A,c.u,null,h)),xs(),Ak(c.i,c.u,c.A,c.l,c.R,c.m)}HA.prototype.ca=function(c){c=c.target;const h=this.M;h&&pA(c)==3?h.j():this.Y(c)},HA.prototype.Y=function(c){try{if(c==this.g)e:{const Ze=pA(this.g);var h=this.g.Ba();const fn=this.g.Z();if(!(3>Ze)&&(Ze!=3||this.g&&(this.h.h||this.g.oa()||tB(this.g)))){this.J||Ze!=4||h==7||(h==8||0>=fn?xs(3):xs(2)),Eu(this);var f=this.g.Z();this.X=f;t:if(Lm(this)){var m=tB(this.g);c="";var T=m.length,x=pA(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Cr(this),Ds(this);var D="";break t}this.h.i=new o.TextDecoder}for(h=0;h<T;h++)this.h.h=!0,c+=this.h.i.decode(m[h],{stream:!(x&&h==T-1)});m.length=0,this.h.g+=c,this.C=0,D=this.h.g}else D=this.g.oa();if(this.o=f==200,rk(this.i,this.u,this.A,this.l,this.R,Ze,f),this.o){if(this.T&&!this.K){t:{if(this.g){var ue,je=this.g;if((ue=je.g?je.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(ue)){var ie=ue;break t}}ie=null}if(f=ie)un(this.i,this.l,f,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,vu(this,f);else{this.o=!1,this.s=3,rt(12),Cr(this),Ds(this);break e}}if(this.P){f=!0;let Vt;for(;!this.J&&this.C<D.length;)if(Vt=ik(this,D),Vt==Cu){Ze==4&&(this.s=4,rt(14),f=!1),un(this.i,this.l,null,"[Incomplete Response]");break}else if(Vt==xm){this.s=4,rt(15),un(this.i,this.l,D,"[Invalid Chunk]"),f=!1;break}else un(this.i,this.l,Vt,null),vu(this,Vt);if(Lm(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Ze!=4||D.length!=0||this.h.h||(this.s=1,rt(16),f=!1),this.o=this.o&&f,!f)un(this.i,this.l,D,"[Invalid Chunked Response]"),Cr(this),Ds(this);else if(0<D.length&&!this.W){this.W=!0;var Ye=this.j;Ye.g==this&&Ye.ba&&!Ye.M&&(Ye.j.info("Great, no buffering proxy detected. Bytes received: "+D.length),Tu(Ye),Ye.M=!0,rt(11))}}else un(this.i,this.l,D,null),vu(this,D);Ze==4&&Cr(this),this.o&&!this.J&&(Ze==4?aB(this.j,this):(this.o=!1,qo(this)))}else Ek(this.g),f==400&&0<D.indexOf("Unknown SID")?(this.s=3,rt(12)):(this.s=0,rt(13)),Cr(this),Ds(this)}}}catch{}finally{}};function Lm(c){return c.g?c.u=="GET"&&c.L!=2&&c.j.Ca:!1}function ik(c,h){var f=c.C,m=h.indexOf(`
1160
- `,f);return m==-1?Cu:(f=Number(h.substring(f,m)),isNaN(f)?xm:(m+=1,m+f>h.length?Cu:(h=h.slice(m,m+f),c.C=m+f,h)))}HA.prototype.cancel=function(){this.J=!0,Cr(this)};function qo(c){c.S=Date.now()+c.I,Dm(c,c.I)}function Dm(c,h){if(c.B!=null)throw Error("WatchDog timer not null");c.B=ks(g(c.ba,c),h)}function Eu(c){c.B&&(o.clearTimeout(c.B),c.B=null)}HA.prototype.ba=function(){this.B=null;const c=Date.now();0<=c-this.S?(nk(this.i,this.A),this.L!=2&&(xs(),rt(17)),Cr(this),this.s=2,Ds(this)):Dm(this,this.S-c)};function Ds(c){c.j.G==0||c.J||aB(c.j,c)}function Cr(c){Eu(c);var h=c.M;h&&typeof h.ma=="function"&&h.ma(),c.M=null,vm(c.U),c.g&&(h=c.g,c.g=null,h.abort(),h.ma())}function vu(c,h){try{var f=c.j;if(f.G!=0&&(f.g==c||bu(f.h,c))){if(!c.K&&bu(f.h,c)&&f.G==3){try{var m=f.Da.g.parse(h)}catch{m=null}if(Array.isArray(m)&&m.length==3){var T=m;if(T[0]==0){e:if(!f.u){if(f.g)if(f.g.F+3e3<c.F)ra(f),ta(f);else break e;Fu(f),rt(18)}}else f.za=T[1],0<f.za-f.T&&37500>T[2]&&f.F&&f.v==0&&!f.C&&(f.C=ks(g(f.Za,f),6e3));if(1>=Pm(f.h)&&f.ca){try{f.ca()}catch{}f.ca=void 0}}else Er(f,11)}else if((c.K||f.g==c)&&ra(f),!S(h))for(T=f.Da.g.parse(h),h=0;h<T.length;h++){let ie=T[h];if(f.T=ie[0],ie=ie[1],f.G==2)if(ie[0]=="c"){f.K=ie[1],f.ia=ie[2];const Ye=ie[3];Ye!=null&&(f.la=Ye,f.j.info("VER="+f.la));const Ze=ie[4];Ze!=null&&(f.Aa=Ze,f.j.info("SVER="+f.Aa));const fn=ie[5];fn!=null&&typeof fn=="number"&&0<fn&&(m=1.5*fn,f.L=m,f.j.info("backChannelRequestTimeoutMs_="+m)),m=f;const Vt=c.g;if(Vt){const sa=Vt.g?Vt.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(sa){var x=m.h;x.g||sa.indexOf("spdy")==-1&&sa.indexOf("quic")==-1&&sa.indexOf("h2")==-1||(x.j=x.l,x.g=new Set,x.h&&(Uu(x,x.h),x.h=null))}if(m.D){const Su=Vt.g?Vt.g.getResponseHeader("X-HTTP-Session-Id"):null;Su&&(m.ya=Su,fe(m.I,m.D,Su))}}f.G=3,f.l&&f.l.ua(),f.ba&&(f.R=Date.now()-c.F,f.j.info("Handshake RTT: "+f.R+"ms")),m=f;var D=c;if(m.qa=uB(m,m.J?m.ia:null,m.W),D.K){Nm(m.h,D);var ue=D,je=m.L;je&&(ue.I=je),ue.B&&(Eu(ue),qo(ue)),m.g=D}else iB(m);0<f.i.length&&Aa(f)}else ie[0]!="stop"&&ie[0]!="close"||Er(f,7);else f.G==3&&(ie[0]=="stop"||ie[0]=="close"?ie[0]=="stop"?Er(f,7):Iu(f):ie[0]!="noop"&&f.l&&f.l.ta(ie),f.v=0)}}xs(4)}catch{}}var ok=class{constructor(c,h){this.g=c,this.map=h}};function Hm(c){this.l=c||10,o.PerformanceNavigationTiming?(c=o.performance.getEntriesByType("navigation"),c=0<c.length&&(c[0].nextHopProtocol=="hq"||c[0].nextHopProtocol=="h2")):c=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=c?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Om(c){return c.h?!0:c.g?c.g.size>=c.j:!1}function Pm(c){return c.h?1:c.g?c.g.size:0}function bu(c,h){return c.h?c.h==h:c.g?c.g.has(h):!1}function Uu(c,h){c.g?c.g.add(h):c.h=h}function Nm(c,h){c.h&&c.h==h?c.h=null:c.g&&c.g.has(h)&&c.g.delete(h)}Hm.prototype.cancel=function(){if(this.i=Mm(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const c of this.g.values())c.cancel();this.g.clear()}};function Mm(c){if(c.h!=null)return c.i.concat(c.h.D);if(c.g!=null&&c.g.size!==0){let h=c.i;for(const f of c.g.values())h=h.concat(f.D);return h}return y(c.i)}function ak(c){if(c.V&&typeof c.V=="function")return c.V();if(typeof Map<"u"&&c instanceof Map||typeof Set<"u"&&c instanceof Set)return Array.from(c.values());if(typeof c=="string")return c.split("");if(a(c)){for(var h=[],f=c.length,m=0;m<f;m++)h.push(c[m]);return h}h=[],f=0;for(m in c)h[f++]=c[m];return h}function ck(c){if(c.na&&typeof c.na=="function")return c.na();if(!c.V||typeof c.V!="function"){if(typeof Map<"u"&&c instanceof Map)return Array.from(c.keys());if(!(typeof Set<"u"&&c instanceof Set)){if(a(c)||typeof c=="string"){var h=[];c=c.length;for(var f=0;f<c;f++)h.push(f);return h}h=[],f=0;for(const m in c)h[f++]=m;return h}}}function Vm(c,h){if(c.forEach&&typeof c.forEach=="function")c.forEach(h,void 0);else if(a(c)||typeof c=="string")Array.prototype.forEach.call(c,h,void 0);else for(var f=ck(c),m=ak(c),T=m.length,x=0;x<T;x++)h.call(void 0,m[x],f&&f[x],c)}var Km=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function lk(c,h){if(c){c=c.split("&");for(var f=0;f<c.length;f++){var m=c[f].indexOf("="),T=null;if(0<=m){var x=c[f].substring(0,m);T=c[f].substring(m+1)}else x=c[f];h(x,T?decodeURIComponent(T.replace(/\+/g," ")):"")}}}function _r(c){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,c instanceof _r){this.h=c.h,Jo(this,c.j),this.o=c.o,this.g=c.g,zo(this,c.s),this.l=c.l;var h=c.i,f=new Ps;f.i=h.i,h.g&&(f.g=new Map(h.g),f.h=h.h),$m(this,f),this.m=c.m}else c&&(h=String(c).match(Km))?(this.h=!1,Jo(this,h[1]||"",!0),this.o=Hs(h[2]||""),this.g=Hs(h[3]||"",!0),zo(this,h[4]),this.l=Hs(h[5]||"",!0),$m(this,h[6]||"",!0),this.m=Hs(h[7]||"")):(this.h=!1,this.i=new Ps(null,this.h))}_r.prototype.toString=function(){var c=[],h=this.j;h&&c.push(Os(h,jm,!0),":");var f=this.g;return(f||h=="file")&&(c.push("//"),(h=this.o)&&c.push(Os(h,jm,!0),"@"),c.push(encodeURIComponent(String(f)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),f=this.s,f!=null&&c.push(":",String(f))),(f=this.l)&&(this.g&&f.charAt(0)!="/"&&c.push("/"),c.push(Os(f,f.charAt(0)=="/"?dk:hk,!0))),(f=this.i.toString())&&c.push("?",f),(f=this.m)&&c.push("#",Os(f,gk)),c.join("")};function gA(c){return new _r(c)}function Jo(c,h,f){c.j=f?Hs(h,!0):h,c.j&&(c.j=c.j.replace(/:$/,""))}function zo(c,h){if(h){if(h=Number(h),isNaN(h)||0>h)throw Error("Bad port number "+h);c.s=h}else c.s=null}function $m(c,h,f){h instanceof Ps?(c.i=h,pk(c.i,c.h)):(f||(h=Os(h,fk)),c.i=new Ps(h,c.h))}function fe(c,h,f){c.i.set(h,f)}function Xo(c){return fe(c,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),c}function Hs(c,h){return c?h?decodeURI(c.replace(/%25/g,"%2525")):decodeURIComponent(c):""}function Os(c,h,f){return typeof c=="string"?(c=encodeURI(c).replace(h,uk),f&&(c=c.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c):null}function uk(c){return c=c.charCodeAt(0),"%"+(c>>4&15).toString(16)+(c&15).toString(16)}var jm=/[#\/\?@]/g,hk=/[#\?:]/g,dk=/[#\?]/g,fk=/[#\?@]/g,gk=/#/g;function Ps(c,h){this.h=this.g=null,this.i=c||null,this.j=!!h}function OA(c){c.g||(c.g=new Map,c.h=0,c.i&&lk(c.i,function(h,f){c.add(decodeURIComponent(h.replace(/\+/g," ")),f)}))}A=Ps.prototype,A.add=function(c,h){OA(this),this.i=null,c=hn(this,c);var f=this.g.get(c);return f||this.g.set(c,f=[]),f.push(h),this.h+=1,this};function Gm(c,h){OA(c),h=hn(c,h),c.g.has(h)&&(c.i=null,c.h-=c.g.get(h).length,c.g.delete(h))}function Wm(c,h){return OA(c),h=hn(c,h),c.g.has(h)}A.forEach=function(c,h){OA(this),this.g.forEach(function(f,m){f.forEach(function(T){c.call(h,T,m,this)},this)},this)},A.na=function(){OA(this);const c=Array.from(this.g.values()),h=Array.from(this.g.keys()),f=[];for(let m=0;m<h.length;m++){const T=c[m];for(let x=0;x<T.length;x++)f.push(h[m])}return f},A.V=function(c){OA(this);let h=[];if(typeof c=="string")Wm(this,c)&&(h=h.concat(this.g.get(hn(this,c))));else{c=Array.from(this.g.values());for(let f=0;f<c.length;f++)h=h.concat(c[f])}return h},A.set=function(c,h){return OA(this),this.i=null,c=hn(this,c),Wm(this,c)&&(this.h-=this.g.get(c).length),this.g.set(c,[h]),this.h+=1,this},A.get=function(c,h){return c?(c=this.V(c),0<c.length?String(c[0]):h):h};function qm(c,h,f){Gm(c,h),0<f.length&&(c.i=null,c.g.set(hn(c,h),y(f)),c.h+=f.length)}A.toString=function(){if(this.i)return this.i;if(!this.g)return"";const c=[],h=Array.from(this.g.keys());for(var f=0;f<h.length;f++){var m=h[f];const x=encodeURIComponent(String(m)),D=this.V(m);for(m=0;m<D.length;m++){var T=x;D[m]!==""&&(T+="="+encodeURIComponent(String(D[m]))),c.push(T)}}return this.i=c.join("&")};function hn(c,h){return h=String(h),c.j&&(h=h.toLowerCase()),h}function pk(c,h){h&&!c.j&&(OA(c),c.i=null,c.g.forEach(function(f,m){var T=m.toLowerCase();m!=T&&(Gm(this,m),qm(this,T,f))},c)),c.j=h}function wk(c,h){const f=new Ls;if(o.Image){const m=new Image;m.onload=p(PA,f,"TestLoadImage: loaded",!0,h,m),m.onerror=p(PA,f,"TestLoadImage: error",!1,h,m),m.onabort=p(PA,f,"TestLoadImage: abort",!1,h,m),m.ontimeout=p(PA,f,"TestLoadImage: timeout",!1,h,m),o.setTimeout(function(){m.ontimeout&&m.ontimeout()},1e4),m.src=c}else h(!1)}function mk(c,h){const f=new Ls,m=new AbortController,T=setTimeout(()=>{m.abort(),PA(f,"TestPingServer: timeout",!1,h)},1e4);fetch(c,{signal:m.signal}).then(x=>{clearTimeout(T),x.ok?PA(f,"TestPingServer: ok",!0,h):PA(f,"TestPingServer: server error",!1,h)}).catch(()=>{clearTimeout(T),PA(f,"TestPingServer: error",!1,h)})}function PA(c,h,f,m,T){try{T&&(T.onload=null,T.onerror=null,T.onabort=null,T.ontimeout=null),m(f)}catch{}}function Bk(){this.g=new tk}function yk(c,h,f){const m=f||"";try{Vm(c,function(T,x){let D=T;l(T)&&(D=pu(T)),h.push(m+x+"="+encodeURIComponent(D))})}catch(T){throw h.push(m+"type="+encodeURIComponent("_badmap")),T}}function Yo(c){this.l=c.Ub||null,this.j=c.eb||!1}w(Yo,wu),Yo.prototype.g=function(){return new Zo(this.l,this.j)},Yo.prototype.i=function(c){return function(){return c}}({});function Zo(c,h){Xe.call(this),this.D=c,this.o=h,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}w(Zo,Xe),A=Zo.prototype,A.open=function(c,h){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=c,this.A=h,this.readyState=1,Ms(this)},A.send=function(c){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const h={headers:this.u,method:this.B,credentials:this.m,cache:void 0};c&&(h.body=c),(this.D||o).fetch(new Request(this.A,h)).then(this.Sa.bind(this),this.ga.bind(this))},A.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Ns(this)),this.readyState=0},A.Sa=function(c){if(this.g&&(this.l=c,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=c.headers,this.readyState=2,Ms(this)),this.g&&(this.readyState=3,Ms(this),this.g)))if(this.responseType==="arraybuffer")c.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in c){if(this.j=c.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Jm(this)}else c.text().then(this.Ra.bind(this),this.ga.bind(this))};function Jm(c){c.j.read().then(c.Pa.bind(c)).catch(c.ga.bind(c))}A.Pa=function(c){if(this.g){if(this.o&&c.value)this.response.push(c.value);else if(!this.o){var h=c.value?c.value:new Uint8Array(0);(h=this.v.decode(h,{stream:!c.done}))&&(this.response=this.responseText+=h)}c.done?Ns(this):Ms(this),this.readyState==3&&Jm(this)}},A.Ra=function(c){this.g&&(this.response=this.responseText=c,Ns(this))},A.Qa=function(c){this.g&&(this.response=c,Ns(this))},A.ga=function(){this.g&&Ns(this)};function Ns(c){c.readyState=4,c.l=null,c.j=null,c.v=null,Ms(c)}A.setRequestHeader=function(c,h){this.u.append(c,h)},A.getResponseHeader=function(c){return this.h&&this.h.get(c.toLowerCase())||""},A.getAllResponseHeaders=function(){if(!this.h)return"";const c=[],h=this.h.entries();for(var f=h.next();!f.done;)f=f.value,c.push(f[0]+": "+f[1]),f=h.next();return c.join(`\r
1161
- `)};function Ms(c){c.onreadystatechange&&c.onreadystatechange.call(c)}Object.defineProperty(Zo.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(c){this.m=c?"include":"same-origin"}});function zm(c){let h="";return P(c,function(f,m){h+=m,h+=":",h+=f,h+=`\r
1162
- `}),h}function Qu(c,h,f){e:{for(m in f){var m=!1;break e}m=!0}m||(f=zm(f),typeof c=="string"?f!=null&&encodeURIComponent(String(f)):fe(c,h,f))}function _e(c){Xe.call(this),this.headers=new Map,this.o=c||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}w(_e,Xe);var Ck=/^https?$/i,_k=["POST","PUT"];A=_e.prototype,A.Ha=function(c){this.J=c},A.ea=function(c,h,f,m){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+c);h=h?h.toUpperCase():"GET",this.D=c,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():yu.g(),this.v=this.o?bm(this.o):bm(yu),this.g.onreadystatechange=g(this.Ea,this);try{this.B=!0,this.g.open(h,String(c),!0),this.B=!1}catch(x){Xm(this,x);return}if(c=f||"",f=new Map(this.headers),m)if(Object.getPrototypeOf(m)===Object.prototype)for(var T in m)f.set(T,m[T]);else if(typeof m.keys=="function"&&typeof m.get=="function")for(const x of m.keys())f.set(x,m.get(x));else throw Error("Unknown input type for opt_headers: "+String(m));m=Array.from(f.keys()).find(x=>x.toLowerCase()=="content-type"),T=o.FormData&&c instanceof o.FormData,!(0<=Array.prototype.indexOf.call(_k,h,void 0))||m||T||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[x,D]of f)this.g.setRequestHeader(x,D);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{eB(this),this.u=!0,this.g.send(c),this.u=!1}catch(x){Xm(this,x)}};function Xm(c,h){c.h=!1,c.g&&(c.j=!0,c.g.abort(),c.j=!1),c.l=h,c.m=5,Ym(c),ea(c)}function Ym(c){c.A||(c.A=!0,At(c,"complete"),At(c,"error"))}A.abort=function(c){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=c||7,At(this,"complete"),At(this,"abort"),ea(this))},A.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),ea(this,!0)),_e.aa.N.call(this)},A.Ea=function(){this.s||(this.B||this.u||this.j?Zm(this):this.bb())},A.bb=function(){Zm(this)};function Zm(c){if(c.h&&typeof i<"u"&&(!c.v[1]||pA(c)!=4||c.Z()!=2)){if(c.u&&pA(c)==4)Cm(c.Ea,0,c);else if(At(c,"readystatechange"),pA(c)==4){c.h=!1;try{const D=c.Z();e:switch(D){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var h=!0;break e;default:h=!1}var f;if(!(f=h)){var m;if(m=D===0){var T=String(c.D).match(Km)[1]||null;!T&&o.self&&o.self.location&&(T=o.self.location.protocol.slice(0,-1)),m=!Ck.test(T?T.toLowerCase():"")}f=m}if(f)At(c,"complete"),At(c,"success");else{c.m=6;try{var x=2<pA(c)?c.g.statusText:""}catch{x=""}c.l=x+" ["+c.Z()+"]",Ym(c)}}finally{ea(c)}}}}function ea(c,h){if(c.g){eB(c);const f=c.g,m=c.v[0]?()=>{}:null;c.g=null,c.v=null,h||At(c,"ready");try{f.onreadystatechange=m}catch{}}}function eB(c){c.I&&(o.clearTimeout(c.I),c.I=null)}A.isActive=function(){return!!this.g};function pA(c){return c.g?c.g.readyState:0}A.Z=function(){try{return 2<pA(this)?this.g.status:-1}catch{return-1}},A.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},A.Oa=function(c){if(this.g){var h=this.g.responseText;return c&&h.indexOf(c)==0&&(h=h.substring(c.length)),ek(h)}};function tB(c){try{if(!c.g)return null;if("response"in c.g)return c.g.response;switch(c.H){case"":case"text":return c.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in c.g)return c.g.mozResponseArrayBuffer}return null}catch{return null}}function Ek(c){const h={};c=(c.g&&2<=pA(c)&&c.g.getAllResponseHeaders()||"").split(`\r
1163
- `);for(let m=0;m<c.length;m++){if(S(c[m]))continue;var f=Q(c[m]);const T=f[0];if(f=f[1],typeof f!="string")continue;f=f.trim();const x=h[T]||[];h[T]=x,x.push(f)}_(h,function(m){return m.join(", ")})}A.Ba=function(){return this.m},A.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Vs(c,h,f){return f&&f.internalChannelParams&&f.internalChannelParams[c]||h}function AB(c){this.Aa=0,this.i=[],this.j=new Ls,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Vs("failFast",!1,c),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Vs("baseRetryDelayMs",5e3,c),this.cb=Vs("retryDelaySeedMs",1e4,c),this.Wa=Vs("forwardChannelMaxRetries",2,c),this.wa=Vs("forwardChannelRequestTimeoutMs",2e4,c),this.pa=c&&c.xmlHttpFactory||void 0,this.Xa=c&&c.Tb||void 0,this.Ca=c&&c.useFetchStreams||!1,this.L=void 0,this.J=c&&c.supportsCrossDomainXhr||!1,this.K="",this.h=new Hm(c&&c.concurrentRequestLimit),this.Da=new Bk,this.P=c&&c.fastHandshake||!1,this.O=c&&c.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=c&&c.Rb||!1,c&&c.xa&&this.j.xa(),c&&c.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&c&&c.detectBufferingProxy||!1,this.ja=void 0,c&&c.longPollingTimeout&&0<c.longPollingTimeout&&(this.ja=c.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}A=AB.prototype,A.la=8,A.G=1,A.connect=function(c,h,f,m){rt(0),this.W=c,this.H=h||{},f&&m!==void 0&&(this.H.OSID=f,this.H.OAID=m),this.F=this.X,this.I=uB(this,null,this.W),Aa(this)};function Iu(c){if(rB(c),c.G==3){var h=c.U++,f=gA(c.I);if(fe(f,"SID",c.K),fe(f,"RID",h),fe(f,"TYPE","terminate"),Ks(c,f),h=new HA(c,c.j,h),h.L=2,h.v=Xo(gA(f)),f=!1,o.navigator&&o.navigator.sendBeacon)try{f=o.navigator.sendBeacon(h.v.toString(),"")}catch{}!f&&o.Image&&(new Image().src=h.v,f=!0),f||(h.g=hB(h.j,null),h.g.ea(h.v)),h.F=Date.now(),qo(h)}lB(c)}function ta(c){c.g&&(Tu(c),c.g.cancel(),c.g=null)}function rB(c){ta(c),c.u&&(o.clearTimeout(c.u),c.u=null),ra(c),c.h.cancel(),c.s&&(typeof c.s=="number"&&o.clearTimeout(c.s),c.s=null)}function Aa(c){if(!Om(c.h)&&!c.s){c.s=!0;var h=c.Ga;Br||ce(),j||(Br(),j=!0),re.add(h,c),c.B=0}}function vk(c,h){return Pm(c.h)>=c.h.j-(c.s?1:0)?!1:c.s?(c.i=h.D.concat(c.i),!0):c.G==1||c.G==2||c.B>=(c.Va?0:c.Wa)?!1:(c.s=ks(g(c.Ga,c,h),cB(c,c.B)),c.B++,!0)}A.Ga=function(c){if(this.s)if(this.s=null,this.G==1){if(!c){this.U=Math.floor(1e5*Math.random()),c=this.U++;const T=new HA(this,this.j,c);let x=this.o;if(this.S&&(x?(x=C(x),U(x,this.S)):x=this.S),this.m!==null||this.O||(T.H=x,x=null),this.P)e:{for(var h=0,f=0;f<this.i.length;f++){t:{var m=this.i[f];if("__data__"in m.map&&(m=m.map.__data__,typeof m=="string")){m=m.length;break t}m=void 0}if(m===void 0)break;if(h+=m,4096<h){h=f;break e}if(h===4096||f===this.i.length-1){h=f+1;break e}}h=1e3}else h=1e3;h=sB(this,T,h),f=gA(this.I),fe(f,"RID",c),fe(f,"CVER",22),this.D&&fe(f,"X-HTTP-Session-Id",this.D),Ks(this,f),x&&(this.O?h="headers="+encodeURIComponent(String(zm(x)))+"&"+h:this.m&&Qu(f,this.m,x)),Uu(this.h,T),this.Ua&&fe(f,"TYPE","init"),this.P?(fe(f,"$req",h),fe(f,"SID","null"),T.T=!0,_u(T,f,null)):_u(T,f,h),this.G=2}}else this.G==3&&(c?nB(this,c):this.i.length==0||Om(this.h)||nB(this))};function nB(c,h){var f;h?f=h.l:f=c.U++;const m=gA(c.I);fe(m,"SID",c.K),fe(m,"RID",f),fe(m,"AID",c.T),Ks(c,m),c.m&&c.o&&Qu(m,c.m,c.o),f=new HA(c,c.j,f,c.B+1),c.m===null&&(f.H=c.o),h&&(c.i=h.D.concat(c.i)),h=sB(c,f,1e3),f.I=Math.round(.5*c.wa)+Math.round(.5*c.wa*Math.random()),Uu(c.h,f),_u(f,m,h)}function Ks(c,h){c.H&&P(c.H,function(f,m){fe(h,m,f)}),c.l&&Vm({},function(f,m){fe(h,m,f)})}function sB(c,h,f){f=Math.min(c.i.length,f);var m=c.l?g(c.l.Na,c.l,c):null;e:{var T=c.i;let x=-1;for(;;){const D=["count="+f];x==-1?0<f?(x=T[0].g,D.push("ofs="+x)):x=0:D.push("ofs="+x);let ue=!0;for(let je=0;je<f;je++){let ie=T[je].g;const Ye=T[je].map;if(ie-=x,0>ie)x=Math.max(0,T[je].g-100),ue=!1;else try{yk(Ye,D,"req"+ie+"_")}catch{m&&m(Ye)}}if(ue){m=D.join("&");break e}}}return c=c.i.splice(0,f),h.D=c,m}function iB(c){if(!c.g&&!c.u){c.Y=1;var h=c.Fa;Br||ce(),j||(Br(),j=!0),re.add(h,c),c.v=0}}function Fu(c){return c.g||c.u||3<=c.v?!1:(c.Y++,c.u=ks(g(c.Fa,c),cB(c,c.v)),c.v++,!0)}A.Fa=function(){if(this.u=null,oB(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var c=2*this.R;this.j.info("BP detection timer enabled: "+c),this.A=ks(g(this.ab,this),c)}},A.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,rt(10),ta(this),oB(this))};function Tu(c){c.A!=null&&(o.clearTimeout(c.A),c.A=null)}function oB(c){c.g=new HA(c,c.j,"rpc",c.Y),c.m===null&&(c.g.H=c.o),c.g.O=0;var h=gA(c.qa);fe(h,"RID","rpc"),fe(h,"SID",c.K),fe(h,"AID",c.T),fe(h,"CI",c.F?"0":"1"),!c.F&&c.ja&&fe(h,"TO",c.ja),fe(h,"TYPE","xmlhttp"),Ks(c,h),c.m&&c.o&&Qu(h,c.m,c.o),c.L&&(c.g.I=c.L);var f=c.g;c=c.ia,f.L=1,f.v=Xo(gA(h)),f.m=null,f.P=!0,km(f,c)}A.Za=function(){this.C!=null&&(this.C=null,ta(this),Fu(this),rt(19))};function ra(c){c.C!=null&&(o.clearTimeout(c.C),c.C=null)}function aB(c,h){var f=null;if(c.g==h){ra(c),Tu(c),c.g=null;var m=2}else if(bu(c.h,h))f=h.D,Nm(c.h,h),m=1;else return;if(c.G!=0){if(h.o)if(m==1){f=h.m?h.m.length:0,h=Date.now()-h.F;var T=c.B;m=jo(),At(m,new Tm(m,f)),Aa(c)}else iB(c);else if(T=h.s,T==3||T==0&&0<h.X||!(m==1&&vk(c,h)||m==2&&Fu(c)))switch(f&&0<f.length&&(h=c.h,h.i=h.i.concat(f)),T){case 1:Er(c,5);break;case 4:Er(c,10);break;case 3:Er(c,6);break;default:Er(c,2)}}}function cB(c,h){let f=c.Ta+Math.floor(Math.random()*c.cb);return c.isActive()||(f*=2),f*h}function Er(c,h){if(c.j.info("Error code "+h),h==2){var f=g(c.fb,c),m=c.Xa;const T=!m;m=new _r(m||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Jo(m,"https"),Xo(m),T?wk(m.toString(),f):mk(m.toString(),f)}else rt(2);c.G=0,c.l&&c.l.sa(h),lB(c),rB(c)}A.fb=function(c){c?(this.j.info("Successfully pinged google.com"),rt(2)):(this.j.info("Failed to ping google.com"),rt(1))};function lB(c){if(c.G=0,c.ka=[],c.l){const h=Mm(c.h);(h.length!=0||c.i.length!=0)&&(B(c.ka,h),B(c.ka,c.i),c.h.i.length=0,y(c.i),c.i.length=0),c.l.ra()}}function uB(c,h,f){var m=f instanceof _r?gA(f):new _r(f);if(m.g!="")h&&(m.g=h+"."+m.g),zo(m,m.s);else{var T=o.location;m=T.protocol,h=h?h+"."+T.hostname:T.hostname,T=+T.port;var x=new _r(null);m&&Jo(x,m),h&&(x.g=h),T&&zo(x,T),f&&(x.l=f),m=x}return f=c.D,h=c.ya,f&&h&&fe(m,f,h),fe(m,"VER",c.la),Ks(c,m),m}function hB(c,h,f){if(h&&!c.J)throw Error("Can't create secondary domain capable XhrIo object.");return h=c.Ca&&!c.pa?new _e(new Yo({eb:f})):new _e(c.pa),h.Ha(c.J),h}A.isActive=function(){return!!this.l&&this.l.isActive(this)};function dB(){}A=dB.prototype,A.ua=function(){},A.ta=function(){},A.sa=function(){},A.ra=function(){},A.isActive=function(){return!0},A.Na=function(){};function na(){}na.prototype.g=function(c,h){return new wt(c,h)};function wt(c,h){Xe.call(this),this.g=new AB(h),this.l=c,this.h=h&&h.messageUrlParams||null,c=h&&h.messageHeaders||null,h&&h.clientProtocolHeaderRequired&&(c?c["X-Client-Protocol"]="webchannel":c={"X-Client-Protocol":"webchannel"}),this.g.o=c,c=h&&h.initMessageHeaders||null,h&&h.messageContentType&&(c?c["X-WebChannel-Content-Type"]=h.messageContentType:c={"X-WebChannel-Content-Type":h.messageContentType}),h&&h.va&&(c?c["X-WebChannel-Client-Profile"]=h.va:c={"X-WebChannel-Client-Profile":h.va}),this.g.S=c,(c=h&&h.Sb)&&!S(c)&&(this.g.m=c),this.v=h&&h.supportsCrossDomainXhr||!1,this.u=h&&h.sendRawJson||!1,(h=h&&h.httpSessionIdParam)&&!S(h)&&(this.g.D=h,c=this.h,c!==null&&h in c&&(c=this.h,h in c&&delete c[h])),this.j=new dn(this)}w(wt,Xe),wt.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},wt.prototype.close=function(){Iu(this.g)},wt.prototype.o=function(c){var h=this.g;if(typeof c=="string"){var f={};f.__data__=c,c=f}else this.u&&(f={},f.__data__=pu(c),c=f);h.i.push(new ok(h.Ya++,c)),h.G==3&&Aa(h)},wt.prototype.N=function(){this.g.l=null,delete this.j,Iu(this.g),delete this.g,wt.aa.N.call(this)};function fB(c){mu.call(this),c.__headers__&&(this.headers=c.__headers__,this.statusCode=c.__status__,delete c.__headers__,delete c.__status__);var h=c.__sm__;if(h){e:{for(const f in h){c=f;break e}c=void 0}(this.i=c)&&(c=this.i,h=h!==null&&c in h?h[c]:void 0),this.data=h}else this.data=c}w(fB,mu);function gB(){Bu.call(this),this.status=1}w(gB,Bu);function dn(c){this.g=c}w(dn,dB),dn.prototype.ua=function(){At(this.g,"a")},dn.prototype.ta=function(c){At(this.g,new fB(c))},dn.prototype.sa=function(c){At(this.g,new gB)},dn.prototype.ra=function(){At(this.g,"b")},na.prototype.createWebChannel=na.prototype.g,wt.prototype.send=wt.prototype.o,wt.prototype.open=wt.prototype.m,wt.prototype.close=wt.prototype.close,Nf=function(){return new na},Pf=function(){return jo()},Of=yr,Ec={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Go.NO_ERROR=0,Go.TIMEOUT=8,Go.HTTP_ERROR=6,Mi=Go,Sm.COMPLETE="complete",Hf=Sm,Um.EventType=Rs,Rs.OPEN="a",Rs.CLOSE="b",Rs.ERROR="c",Rs.MESSAGE="d",Xe.prototype.listen=Xe.prototype.K,Vn=Um,_e.prototype.listenOnce=_e.prototype.L,_e.prototype.getLastError=_e.prototype.Ka,_e.prototype.getLastErrorCode=_e.prototype.Ba,_e.prototype.getStatus=_e.prototype.Z,_e.prototype.getResponseJson=_e.prototype.Oa,_e.prototype.getResponseText=_e.prototype.oa,_e.prototype.send=_e.prototype.ea,_e.prototype.setWithCredentials=_e.prototype.Ha,Df=_e}).apply(typeof Ni<"u"?Ni:typeof self<"u"?self:typeof window<"u"?window:{});const Mf="@firebase/firestore";/**
1159
+ `+x+" "+D})}function un(c,h,f,m){c.info(function(){return"XMLHTTP TEXT ("+h+"): "+sk(c,f)+(m?" "+m:"")})}function nk(c,h){c.info(function(){return"TIMEOUT: "+h})}ks.prototype.info=function(){};function sk(c,h){if(!c.g)return h;if(!h)return null;try{var f=JSON.parse(h);if(f){for(c=0;c<f.length;c++)if(Array.isArray(f[c])){var m=f[c];if(!(2>m.length)){var T=m[1];if(Array.isArray(T)&&!(1>T.length)){var x=T[0];if(x!="noop"&&x!="stop"&&x!="close")for(var D=1;D<T.length;D++)T[D]=""}}}}return pu(f)}catch{return h}}var jo={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},Sm={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},yu;function Go(){}w(Go,wu),Go.prototype.g=function(){return new XMLHttpRequest},Go.prototype.i=function(){return{}},yu=new Go;function HA(c,h,f,m){this.j=c,this.i=h,this.l=f,this.R=m||1,this.U=new Ts(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Rm}function Rm(){this.i=null,this.g="",this.h=!1}var xm={},Cu={};function _u(c,h,f){c.L=1,c.v=zo(gA(h)),c.m=f,c.P=!0,km(c,null)}function km(c,h){c.F=Date.now(),Wo(c),c.A=gA(c.v);var f=c.A,m=c.R;Array.isArray(m)||(m=[String(m)]),qm(f.i,"t",m),c.C=0,f=c.j.J,c.h=new Rm,c.g=hB(c.j,f?h:null,!c.m),0<c.O&&(c.M=new Zx(g(c.Y,c,c.g),c.O)),h=c.U,f=c.g,m=c.ca;var T="readystatechange";Array.isArray(T)||(T&&(Em[0]=T.toString()),T=Em);for(var x=0;x<T.length;x++){var D=wm(f,T[x],m||h.handleEvent,!1,h.h||h);if(!D)break;h.g[D.key]=D}h=c.H?C(c.H):{},c.m?(c.u||(c.u="POST"),h["Content-Type"]="application/x-www-form-urlencoded",c.g.ea(c.A,c.u,c.m,h)):(c.u="GET",c.g.ea(c.A,c.u,null,h)),Rs(),Ak(c.i,c.u,c.A,c.l,c.R,c.m)}HA.prototype.ca=function(c){c=c.target;const h=this.M;h&&pA(c)==3?h.j():this.Y(c)},HA.prototype.Y=function(c){try{if(c==this.g)e:{const Ze=pA(this.g);var h=this.g.Ba();const fn=this.g.Z();if(!(3>Ze)&&(Ze!=3||this.g&&(this.h.h||this.g.oa()||tB(this.g)))){this.J||Ze!=4||h==7||(h==8||0>=fn?Rs(3):Rs(2)),Eu(this);var f=this.g.Z();this.X=f;t:if(Lm(this)){var m=tB(this.g);c="";var T=m.length,x=pA(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){_r(this),Ls(this);var D="";break t}this.h.i=new o.TextDecoder}for(h=0;h<T;h++)this.h.h=!0,c+=this.h.i.decode(m[h],{stream:!(x&&h==T-1)});m.length=0,this.h.g+=c,this.C=0,D=this.h.g}else D=this.g.oa();if(this.o=f==200,rk(this.i,this.u,this.A,this.l,this.R,Ze,f),this.o){if(this.T&&!this.K){t:{if(this.g){var ue,je=this.g;if((ue=je.g?je.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(ue)){var ie=ue;break t}}ie=null}if(f=ie)un(this.i,this.l,f,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,vu(this,f);else{this.o=!1,this.s=3,rt(12),_r(this),Ls(this);break e}}if(this.P){f=!0;let Vt;for(;!this.J&&this.C<D.length;)if(Vt=ik(this,D),Vt==Cu){Ze==4&&(this.s=4,rt(14),f=!1),un(this.i,this.l,null,"[Incomplete Response]");break}else if(Vt==xm){this.s=4,rt(15),un(this.i,this.l,D,"[Invalid Chunk]"),f=!1;break}else un(this.i,this.l,Vt,null),vu(this,Vt);if(Lm(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Ze!=4||D.length!=0||this.h.h||(this.s=1,rt(16),f=!1),this.o=this.o&&f,!f)un(this.i,this.l,D,"[Invalid Chunked Response]"),_r(this),Ls(this);else if(0<D.length&&!this.W){this.W=!0;var Ye=this.j;Ye.g==this&&Ye.ba&&!Ye.M&&(Ye.j.info("Great, no buffering proxy detected. Bytes received: "+D.length),Tu(Ye),Ye.M=!0,rt(11))}}else un(this.i,this.l,D,null),vu(this,D);Ze==4&&_r(this),this.o&&!this.J&&(Ze==4?aB(this.j,this):(this.o=!1,Wo(this)))}else Ek(this.g),f==400&&0<D.indexOf("Unknown SID")?(this.s=3,rt(12)):(this.s=0,rt(13)),_r(this),Ls(this)}}}catch{}finally{}};function Lm(c){return c.g?c.u=="GET"&&c.L!=2&&c.j.Ca:!1}function ik(c,h){var f=c.C,m=h.indexOf(`
1160
+ `,f);return m==-1?Cu:(f=Number(h.substring(f,m)),isNaN(f)?xm:(m+=1,m+f>h.length?Cu:(h=h.slice(m,m+f),c.C=m+f,h)))}HA.prototype.cancel=function(){this.J=!0,_r(this)};function Wo(c){c.S=Date.now()+c.I,Dm(c,c.I)}function Dm(c,h){if(c.B!=null)throw Error("WatchDog timer not null");c.B=xs(g(c.ba,c),h)}function Eu(c){c.B&&(o.clearTimeout(c.B),c.B=null)}HA.prototype.ba=function(){this.B=null;const c=Date.now();0<=c-this.S?(nk(this.i,this.A),this.L!=2&&(Rs(),rt(17)),_r(this),this.s=2,Ls(this)):Dm(this,this.S-c)};function Ls(c){c.j.G==0||c.J||aB(c.j,c)}function _r(c){Eu(c);var h=c.M;h&&typeof h.ma=="function"&&h.ma(),c.M=null,vm(c.U),c.g&&(h=c.g,c.g=null,h.abort(),h.ma())}function vu(c,h){try{var f=c.j;if(f.G!=0&&(f.g==c||bu(f.h,c))){if(!c.K&&bu(f.h,c)&&f.G==3){try{var m=f.Da.g.parse(h)}catch{m=null}if(Array.isArray(m)&&m.length==3){var T=m;if(T[0]==0){e:if(!f.u){if(f.g)if(f.g.F+3e3<c.F)Aa(f),ea(f);else break e;Fu(f),rt(18)}}else f.za=T[1],0<f.za-f.T&&37500>T[2]&&f.F&&f.v==0&&!f.C&&(f.C=xs(g(f.Za,f),6e3));if(1>=Pm(f.h)&&f.ca){try{f.ca()}catch{}f.ca=void 0}}else vr(f,11)}else if((c.K||f.g==c)&&Aa(f),!S(h))for(T=f.Da.g.parse(h),h=0;h<T.length;h++){let ie=T[h];if(f.T=ie[0],ie=ie[1],f.G==2)if(ie[0]=="c"){f.K=ie[1],f.ia=ie[2];const Ye=ie[3];Ye!=null&&(f.la=Ye,f.j.info("VER="+f.la));const Ze=ie[4];Ze!=null&&(f.Aa=Ze,f.j.info("SVER="+f.Aa));const fn=ie[5];fn!=null&&typeof fn=="number"&&0<fn&&(m=1.5*fn,f.L=m,f.j.info("backChannelRequestTimeoutMs_="+m)),m=f;const Vt=c.g;if(Vt){const na=Vt.g?Vt.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(na){var x=m.h;x.g||na.indexOf("spdy")==-1&&na.indexOf("quic")==-1&&na.indexOf("h2")==-1||(x.j=x.l,x.g=new Set,x.h&&(Uu(x,x.h),x.h=null))}if(m.D){const Su=Vt.g?Vt.g.getResponseHeader("X-HTTP-Session-Id"):null;Su&&(m.ya=Su,fe(m.I,m.D,Su))}}f.G=3,f.l&&f.l.ua(),f.ba&&(f.R=Date.now()-c.F,f.j.info("Handshake RTT: "+f.R+"ms")),m=f;var D=c;if(m.qa=uB(m,m.J?m.ia:null,m.W),D.K){Nm(m.h,D);var ue=D,je=m.L;je&&(ue.I=je),ue.B&&(Eu(ue),Wo(ue)),m.g=D}else iB(m);0<f.i.length&&ta(f)}else ie[0]!="stop"&&ie[0]!="close"||vr(f,7);else f.G==3&&(ie[0]=="stop"||ie[0]=="close"?ie[0]=="stop"?vr(f,7):Iu(f):ie[0]!="noop"&&f.l&&f.l.ta(ie),f.v=0)}}Rs(4)}catch{}}var ok=class{constructor(c,h){this.g=c,this.map=h}};function Hm(c){this.l=c||10,o.PerformanceNavigationTiming?(c=o.performance.getEntriesByType("navigation"),c=0<c.length&&(c[0].nextHopProtocol=="hq"||c[0].nextHopProtocol=="h2")):c=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=c?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Om(c){return c.h?!0:c.g?c.g.size>=c.j:!1}function Pm(c){return c.h?1:c.g?c.g.size:0}function bu(c,h){return c.h?c.h==h:c.g?c.g.has(h):!1}function Uu(c,h){c.g?c.g.add(h):c.h=h}function Nm(c,h){c.h&&c.h==h?c.h=null:c.g&&c.g.has(h)&&c.g.delete(h)}Hm.prototype.cancel=function(){if(this.i=Mm(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const c of this.g.values())c.cancel();this.g.clear()}};function Mm(c){if(c.h!=null)return c.i.concat(c.h.D);if(c.g!=null&&c.g.size!==0){let h=c.i;for(const f of c.g.values())h=h.concat(f.D);return h}return y(c.i)}function ak(c){if(c.V&&typeof c.V=="function")return c.V();if(typeof Map<"u"&&c instanceof Map||typeof Set<"u"&&c instanceof Set)return Array.from(c.values());if(typeof c=="string")return c.split("");if(a(c)){for(var h=[],f=c.length,m=0;m<f;m++)h.push(c[m]);return h}h=[],f=0;for(m in c)h[f++]=c[m];return h}function ck(c){if(c.na&&typeof c.na=="function")return c.na();if(!c.V||typeof c.V!="function"){if(typeof Map<"u"&&c instanceof Map)return Array.from(c.keys());if(!(typeof Set<"u"&&c instanceof Set)){if(a(c)||typeof c=="string"){var h=[];c=c.length;for(var f=0;f<c;f++)h.push(f);return h}h=[],f=0;for(const m in c)h[f++]=m;return h}}}function Vm(c,h){if(c.forEach&&typeof c.forEach=="function")c.forEach(h,void 0);else if(a(c)||typeof c=="string")Array.prototype.forEach.call(c,h,void 0);else for(var f=ck(c),m=ak(c),T=m.length,x=0;x<T;x++)h.call(void 0,m[x],f&&f[x],c)}var Km=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function lk(c,h){if(c){c=c.split("&");for(var f=0;f<c.length;f++){var m=c[f].indexOf("="),T=null;if(0<=m){var x=c[f].substring(0,m);T=c[f].substring(m+1)}else x=c[f];h(x,T?decodeURIComponent(T.replace(/\+/g," ")):"")}}}function Er(c){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,c instanceof Er){this.h=c.h,qo(this,c.j),this.o=c.o,this.g=c.g,Jo(this,c.s),this.l=c.l;var h=c.i,f=new Os;f.i=h.i,h.g&&(f.g=new Map(h.g),f.h=h.h),$m(this,f),this.m=c.m}else c&&(h=String(c).match(Km))?(this.h=!1,qo(this,h[1]||"",!0),this.o=Ds(h[2]||""),this.g=Ds(h[3]||"",!0),Jo(this,h[4]),this.l=Ds(h[5]||"",!0),$m(this,h[6]||"",!0),this.m=Ds(h[7]||"")):(this.h=!1,this.i=new Os(null,this.h))}Er.prototype.toString=function(){var c=[],h=this.j;h&&c.push(Hs(h,jm,!0),":");var f=this.g;return(f||h=="file")&&(c.push("//"),(h=this.o)&&c.push(Hs(h,jm,!0),"@"),c.push(encodeURIComponent(String(f)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),f=this.s,f!=null&&c.push(":",String(f))),(f=this.l)&&(this.g&&f.charAt(0)!="/"&&c.push("/"),c.push(Hs(f,f.charAt(0)=="/"?dk:hk,!0))),(f=this.i.toString())&&c.push("?",f),(f=this.m)&&c.push("#",Hs(f,gk)),c.join("")};function gA(c){return new Er(c)}function qo(c,h,f){c.j=f?Ds(h,!0):h,c.j&&(c.j=c.j.replace(/:$/,""))}function Jo(c,h){if(h){if(h=Number(h),isNaN(h)||0>h)throw Error("Bad port number "+h);c.s=h}else c.s=null}function $m(c,h,f){h instanceof Os?(c.i=h,pk(c.i,c.h)):(f||(h=Hs(h,fk)),c.i=new Os(h,c.h))}function fe(c,h,f){c.i.set(h,f)}function zo(c){return fe(c,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),c}function Ds(c,h){return c?h?decodeURI(c.replace(/%25/g,"%2525")):decodeURIComponent(c):""}function Hs(c,h,f){return typeof c=="string"?(c=encodeURI(c).replace(h,uk),f&&(c=c.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c):null}function uk(c){return c=c.charCodeAt(0),"%"+(c>>4&15).toString(16)+(c&15).toString(16)}var jm=/[#\/\?@]/g,hk=/[#\?:]/g,dk=/[#\?]/g,fk=/[#\?@]/g,gk=/#/g;function Os(c,h){this.h=this.g=null,this.i=c||null,this.j=!!h}function OA(c){c.g||(c.g=new Map,c.h=0,c.i&&lk(c.i,function(h,f){c.add(decodeURIComponent(h.replace(/\+/g," ")),f)}))}A=Os.prototype,A.add=function(c,h){OA(this),this.i=null,c=hn(this,c);var f=this.g.get(c);return f||this.g.set(c,f=[]),f.push(h),this.h+=1,this};function Gm(c,h){OA(c),h=hn(c,h),c.g.has(h)&&(c.i=null,c.h-=c.g.get(h).length,c.g.delete(h))}function Wm(c,h){return OA(c),h=hn(c,h),c.g.has(h)}A.forEach=function(c,h){OA(this),this.g.forEach(function(f,m){f.forEach(function(T){c.call(h,T,m,this)},this)},this)},A.na=function(){OA(this);const c=Array.from(this.g.values()),h=Array.from(this.g.keys()),f=[];for(let m=0;m<h.length;m++){const T=c[m];for(let x=0;x<T.length;x++)f.push(h[m])}return f},A.V=function(c){OA(this);let h=[];if(typeof c=="string")Wm(this,c)&&(h=h.concat(this.g.get(hn(this,c))));else{c=Array.from(this.g.values());for(let f=0;f<c.length;f++)h=h.concat(c[f])}return h},A.set=function(c,h){return OA(this),this.i=null,c=hn(this,c),Wm(this,c)&&(this.h-=this.g.get(c).length),this.g.set(c,[h]),this.h+=1,this},A.get=function(c,h){return c?(c=this.V(c),0<c.length?String(c[0]):h):h};function qm(c,h,f){Gm(c,h),0<f.length&&(c.i=null,c.g.set(hn(c,h),y(f)),c.h+=f.length)}A.toString=function(){if(this.i)return this.i;if(!this.g)return"";const c=[],h=Array.from(this.g.keys());for(var f=0;f<h.length;f++){var m=h[f];const x=encodeURIComponent(String(m)),D=this.V(m);for(m=0;m<D.length;m++){var T=x;D[m]!==""&&(T+="="+encodeURIComponent(String(D[m]))),c.push(T)}}return this.i=c.join("&")};function hn(c,h){return h=String(h),c.j&&(h=h.toLowerCase()),h}function pk(c,h){h&&!c.j&&(OA(c),c.i=null,c.g.forEach(function(f,m){var T=m.toLowerCase();m!=T&&(Gm(this,m),qm(this,T,f))},c)),c.j=h}function wk(c,h){const f=new ks;if(o.Image){const m=new Image;m.onload=p(PA,f,"TestLoadImage: loaded",!0,h,m),m.onerror=p(PA,f,"TestLoadImage: error",!1,h,m),m.onabort=p(PA,f,"TestLoadImage: abort",!1,h,m),m.ontimeout=p(PA,f,"TestLoadImage: timeout",!1,h,m),o.setTimeout(function(){m.ontimeout&&m.ontimeout()},1e4),m.src=c}else h(!1)}function mk(c,h){const f=new ks,m=new AbortController,T=setTimeout(()=>{m.abort(),PA(f,"TestPingServer: timeout",!1,h)},1e4);fetch(c,{signal:m.signal}).then(x=>{clearTimeout(T),x.ok?PA(f,"TestPingServer: ok",!0,h):PA(f,"TestPingServer: server error",!1,h)}).catch(()=>{clearTimeout(T),PA(f,"TestPingServer: error",!1,h)})}function PA(c,h,f,m,T){try{T&&(T.onload=null,T.onerror=null,T.onabort=null,T.ontimeout=null),m(f)}catch{}}function Bk(){this.g=new tk}function yk(c,h,f){const m=f||"";try{Vm(c,function(T,x){let D=T;l(T)&&(D=pu(T)),h.push(m+x+"="+encodeURIComponent(D))})}catch(T){throw h.push(m+"type="+encodeURIComponent("_badmap")),T}}function Xo(c){this.l=c.Ub||null,this.j=c.eb||!1}w(Xo,wu),Xo.prototype.g=function(){return new Yo(this.l,this.j)},Xo.prototype.i=function(c){return function(){return c}}({});function Yo(c,h){Xe.call(this),this.D=c,this.o=h,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}w(Yo,Xe),A=Yo.prototype,A.open=function(c,h){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=c,this.A=h,this.readyState=1,Ns(this)},A.send=function(c){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const h={headers:this.u,method:this.B,credentials:this.m,cache:void 0};c&&(h.body=c),(this.D||o).fetch(new Request(this.A,h)).then(this.Sa.bind(this),this.ga.bind(this))},A.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,Ps(this)),this.readyState=0},A.Sa=function(c){if(this.g&&(this.l=c,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=c.headers,this.readyState=2,Ns(this)),this.g&&(this.readyState=3,Ns(this),this.g)))if(this.responseType==="arraybuffer")c.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in c){if(this.j=c.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Jm(this)}else c.text().then(this.Ra.bind(this),this.ga.bind(this))};function Jm(c){c.j.read().then(c.Pa.bind(c)).catch(c.ga.bind(c))}A.Pa=function(c){if(this.g){if(this.o&&c.value)this.response.push(c.value);else if(!this.o){var h=c.value?c.value:new Uint8Array(0);(h=this.v.decode(h,{stream:!c.done}))&&(this.response=this.responseText+=h)}c.done?Ps(this):Ns(this),this.readyState==3&&Jm(this)}},A.Ra=function(c){this.g&&(this.response=this.responseText=c,Ps(this))},A.Qa=function(c){this.g&&(this.response=c,Ps(this))},A.ga=function(){this.g&&Ps(this)};function Ps(c){c.readyState=4,c.l=null,c.j=null,c.v=null,Ns(c)}A.setRequestHeader=function(c,h){this.u.append(c,h)},A.getResponseHeader=function(c){return this.h&&this.h.get(c.toLowerCase())||""},A.getAllResponseHeaders=function(){if(!this.h)return"";const c=[],h=this.h.entries();for(var f=h.next();!f.done;)f=f.value,c.push(f[0]+": "+f[1]),f=h.next();return c.join(`\r
1161
+ `)};function Ns(c){c.onreadystatechange&&c.onreadystatechange.call(c)}Object.defineProperty(Yo.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(c){this.m=c?"include":"same-origin"}});function zm(c){let h="";return P(c,function(f,m){h+=m,h+=":",h+=f,h+=`\r
1162
+ `}),h}function Qu(c,h,f){e:{for(m in f){var m=!1;break e}m=!0}m||(f=zm(f),typeof c=="string"?f!=null&&encodeURIComponent(String(f)):fe(c,h,f))}function _e(c){Xe.call(this),this.headers=new Map,this.o=c||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}w(_e,Xe);var Ck=/^https?$/i,_k=["POST","PUT"];A=_e.prototype,A.Ha=function(c){this.J=c},A.ea=function(c,h,f,m){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+c);h=h?h.toUpperCase():"GET",this.D=c,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():yu.g(),this.v=this.o?bm(this.o):bm(yu),this.g.onreadystatechange=g(this.Ea,this);try{this.B=!0,this.g.open(h,String(c),!0),this.B=!1}catch(x){Xm(this,x);return}if(c=f||"",f=new Map(this.headers),m)if(Object.getPrototypeOf(m)===Object.prototype)for(var T in m)f.set(T,m[T]);else if(typeof m.keys=="function"&&typeof m.get=="function")for(const x of m.keys())f.set(x,m.get(x));else throw Error("Unknown input type for opt_headers: "+String(m));m=Array.from(f.keys()).find(x=>x.toLowerCase()=="content-type"),T=o.FormData&&c instanceof o.FormData,!(0<=Array.prototype.indexOf.call(_k,h,void 0))||m||T||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[x,D]of f)this.g.setRequestHeader(x,D);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{eB(this),this.u=!0,this.g.send(c),this.u=!1}catch(x){Xm(this,x)}};function Xm(c,h){c.h=!1,c.g&&(c.j=!0,c.g.abort(),c.j=!1),c.l=h,c.m=5,Ym(c),Zo(c)}function Ym(c){c.A||(c.A=!0,At(c,"complete"),At(c,"error"))}A.abort=function(c){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=c||7,At(this,"complete"),At(this,"abort"),Zo(this))},A.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Zo(this,!0)),_e.aa.N.call(this)},A.Ea=function(){this.s||(this.B||this.u||this.j?Zm(this):this.bb())},A.bb=function(){Zm(this)};function Zm(c){if(c.h&&typeof i<"u"&&(!c.v[1]||pA(c)!=4||c.Z()!=2)){if(c.u&&pA(c)==4)Cm(c.Ea,0,c);else if(At(c,"readystatechange"),pA(c)==4){c.h=!1;try{const D=c.Z();e:switch(D){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var h=!0;break e;default:h=!1}var f;if(!(f=h)){var m;if(m=D===0){var T=String(c.D).match(Km)[1]||null;!T&&o.self&&o.self.location&&(T=o.self.location.protocol.slice(0,-1)),m=!Ck.test(T?T.toLowerCase():"")}f=m}if(f)At(c,"complete"),At(c,"success");else{c.m=6;try{var x=2<pA(c)?c.g.statusText:""}catch{x=""}c.l=x+" ["+c.Z()+"]",Ym(c)}}finally{Zo(c)}}}}function Zo(c,h){if(c.g){eB(c);const f=c.g,m=c.v[0]?()=>{}:null;c.g=null,c.v=null,h||At(c,"ready");try{f.onreadystatechange=m}catch{}}}function eB(c){c.I&&(o.clearTimeout(c.I),c.I=null)}A.isActive=function(){return!!this.g};function pA(c){return c.g?c.g.readyState:0}A.Z=function(){try{return 2<pA(this)?this.g.status:-1}catch{return-1}},A.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},A.Oa=function(c){if(this.g){var h=this.g.responseText;return c&&h.indexOf(c)==0&&(h=h.substring(c.length)),ek(h)}};function tB(c){try{if(!c.g)return null;if("response"in c.g)return c.g.response;switch(c.H){case"":case"text":return c.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in c.g)return c.g.mozResponseArrayBuffer}return null}catch{return null}}function Ek(c){const h={};c=(c.g&&2<=pA(c)&&c.g.getAllResponseHeaders()||"").split(`\r
1163
+ `);for(let m=0;m<c.length;m++){if(S(c[m]))continue;var f=Q(c[m]);const T=f[0];if(f=f[1],typeof f!="string")continue;f=f.trim();const x=h[T]||[];h[T]=x,x.push(f)}_(h,function(m){return m.join(", ")})}A.Ba=function(){return this.m},A.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Ms(c,h,f){return f&&f.internalChannelParams&&f.internalChannelParams[c]||h}function AB(c){this.Aa=0,this.i=[],this.j=new ks,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Ms("failFast",!1,c),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Ms("baseRetryDelayMs",5e3,c),this.cb=Ms("retryDelaySeedMs",1e4,c),this.Wa=Ms("forwardChannelMaxRetries",2,c),this.wa=Ms("forwardChannelRequestTimeoutMs",2e4,c),this.pa=c&&c.xmlHttpFactory||void 0,this.Xa=c&&c.Tb||void 0,this.Ca=c&&c.useFetchStreams||!1,this.L=void 0,this.J=c&&c.supportsCrossDomainXhr||!1,this.K="",this.h=new Hm(c&&c.concurrentRequestLimit),this.Da=new Bk,this.P=c&&c.fastHandshake||!1,this.O=c&&c.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=c&&c.Rb||!1,c&&c.xa&&this.j.xa(),c&&c.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&c&&c.detectBufferingProxy||!1,this.ja=void 0,c&&c.longPollingTimeout&&0<c.longPollingTimeout&&(this.ja=c.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}A=AB.prototype,A.la=8,A.G=1,A.connect=function(c,h,f,m){rt(0),this.W=c,this.H=h||{},f&&m!==void 0&&(this.H.OSID=f,this.H.OAID=m),this.F=this.X,this.I=uB(this,null,this.W),ta(this)};function Iu(c){if(rB(c),c.G==3){var h=c.U++,f=gA(c.I);if(fe(f,"SID",c.K),fe(f,"RID",h),fe(f,"TYPE","terminate"),Vs(c,f),h=new HA(c,c.j,h),h.L=2,h.v=zo(gA(f)),f=!1,o.navigator&&o.navigator.sendBeacon)try{f=o.navigator.sendBeacon(h.v.toString(),"")}catch{}!f&&o.Image&&(new Image().src=h.v,f=!0),f||(h.g=hB(h.j,null),h.g.ea(h.v)),h.F=Date.now(),Wo(h)}lB(c)}function ea(c){c.g&&(Tu(c),c.g.cancel(),c.g=null)}function rB(c){ea(c),c.u&&(o.clearTimeout(c.u),c.u=null),Aa(c),c.h.cancel(),c.s&&(typeof c.s=="number"&&o.clearTimeout(c.s),c.s=null)}function ta(c){if(!Om(c.h)&&!c.s){c.s=!0;var h=c.Ga;Br||ce(),j||(Br(),j=!0),re.add(h,c),c.B=0}}function vk(c,h){return Pm(c.h)>=c.h.j-(c.s?1:0)?!1:c.s?(c.i=h.D.concat(c.i),!0):c.G==1||c.G==2||c.B>=(c.Va?0:c.Wa)?!1:(c.s=xs(g(c.Ga,c,h),cB(c,c.B)),c.B++,!0)}A.Ga=function(c){if(this.s)if(this.s=null,this.G==1){if(!c){this.U=Math.floor(1e5*Math.random()),c=this.U++;const T=new HA(this,this.j,c);let x=this.o;if(this.S&&(x?(x=C(x),U(x,this.S)):x=this.S),this.m!==null||this.O||(T.H=x,x=null),this.P)e:{for(var h=0,f=0;f<this.i.length;f++){t:{var m=this.i[f];if("__data__"in m.map&&(m=m.map.__data__,typeof m=="string")){m=m.length;break t}m=void 0}if(m===void 0)break;if(h+=m,4096<h){h=f;break e}if(h===4096||f===this.i.length-1){h=f+1;break e}}h=1e3}else h=1e3;h=sB(this,T,h),f=gA(this.I),fe(f,"RID",c),fe(f,"CVER",22),this.D&&fe(f,"X-HTTP-Session-Id",this.D),Vs(this,f),x&&(this.O?h="headers="+encodeURIComponent(String(zm(x)))+"&"+h:this.m&&Qu(f,this.m,x)),Uu(this.h,T),this.Ua&&fe(f,"TYPE","init"),this.P?(fe(f,"$req",h),fe(f,"SID","null"),T.T=!0,_u(T,f,null)):_u(T,f,h),this.G=2}}else this.G==3&&(c?nB(this,c):this.i.length==0||Om(this.h)||nB(this))};function nB(c,h){var f;h?f=h.l:f=c.U++;const m=gA(c.I);fe(m,"SID",c.K),fe(m,"RID",f),fe(m,"AID",c.T),Vs(c,m),c.m&&c.o&&Qu(m,c.m,c.o),f=new HA(c,c.j,f,c.B+1),c.m===null&&(f.H=c.o),h&&(c.i=h.D.concat(c.i)),h=sB(c,f,1e3),f.I=Math.round(.5*c.wa)+Math.round(.5*c.wa*Math.random()),Uu(c.h,f),_u(f,m,h)}function Vs(c,h){c.H&&P(c.H,function(f,m){fe(h,m,f)}),c.l&&Vm({},function(f,m){fe(h,m,f)})}function sB(c,h,f){f=Math.min(c.i.length,f);var m=c.l?g(c.l.Na,c.l,c):null;e:{var T=c.i;let x=-1;for(;;){const D=["count="+f];x==-1?0<f?(x=T[0].g,D.push("ofs="+x)):x=0:D.push("ofs="+x);let ue=!0;for(let je=0;je<f;je++){let ie=T[je].g;const Ye=T[je].map;if(ie-=x,0>ie)x=Math.max(0,T[je].g-100),ue=!1;else try{yk(Ye,D,"req"+ie+"_")}catch{m&&m(Ye)}}if(ue){m=D.join("&");break e}}}return c=c.i.splice(0,f),h.D=c,m}function iB(c){if(!c.g&&!c.u){c.Y=1;var h=c.Fa;Br||ce(),j||(Br(),j=!0),re.add(h,c),c.v=0}}function Fu(c){return c.g||c.u||3<=c.v?!1:(c.Y++,c.u=xs(g(c.Fa,c),cB(c,c.v)),c.v++,!0)}A.Fa=function(){if(this.u=null,oB(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var c=2*this.R;this.j.info("BP detection timer enabled: "+c),this.A=xs(g(this.ab,this),c)}},A.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,rt(10),ea(this),oB(this))};function Tu(c){c.A!=null&&(o.clearTimeout(c.A),c.A=null)}function oB(c){c.g=new HA(c,c.j,"rpc",c.Y),c.m===null&&(c.g.H=c.o),c.g.O=0;var h=gA(c.qa);fe(h,"RID","rpc"),fe(h,"SID",c.K),fe(h,"AID",c.T),fe(h,"CI",c.F?"0":"1"),!c.F&&c.ja&&fe(h,"TO",c.ja),fe(h,"TYPE","xmlhttp"),Vs(c,h),c.m&&c.o&&Qu(h,c.m,c.o),c.L&&(c.g.I=c.L);var f=c.g;c=c.ia,f.L=1,f.v=zo(gA(h)),f.m=null,f.P=!0,km(f,c)}A.Za=function(){this.C!=null&&(this.C=null,ea(this),Fu(this),rt(19))};function Aa(c){c.C!=null&&(o.clearTimeout(c.C),c.C=null)}function aB(c,h){var f=null;if(c.g==h){Aa(c),Tu(c),c.g=null;var m=2}else if(bu(c.h,h))f=h.D,Nm(c.h,h),m=1;else return;if(c.G!=0){if(h.o)if(m==1){f=h.m?h.m.length:0,h=Date.now()-h.F;var T=c.B;m=$o(),At(m,new Tm(m,f)),ta(c)}else iB(c);else if(T=h.s,T==3||T==0&&0<h.X||!(m==1&&vk(c,h)||m==2&&Fu(c)))switch(f&&0<f.length&&(h=c.h,h.i=h.i.concat(f)),T){case 1:vr(c,5);break;case 4:vr(c,10);break;case 3:vr(c,6);break;default:vr(c,2)}}}function cB(c,h){let f=c.Ta+Math.floor(Math.random()*c.cb);return c.isActive()||(f*=2),f*h}function vr(c,h){if(c.j.info("Error code "+h),h==2){var f=g(c.fb,c),m=c.Xa;const T=!m;m=new Er(m||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||qo(m,"https"),zo(m),T?wk(m.toString(),f):mk(m.toString(),f)}else rt(2);c.G=0,c.l&&c.l.sa(h),lB(c),rB(c)}A.fb=function(c){c?(this.j.info("Successfully pinged google.com"),rt(2)):(this.j.info("Failed to ping google.com"),rt(1))};function lB(c){if(c.G=0,c.ka=[],c.l){const h=Mm(c.h);(h.length!=0||c.i.length!=0)&&(B(c.ka,h),B(c.ka,c.i),c.h.i.length=0,y(c.i),c.i.length=0),c.l.ra()}}function uB(c,h,f){var m=f instanceof Er?gA(f):new Er(f);if(m.g!="")h&&(m.g=h+"."+m.g),Jo(m,m.s);else{var T=o.location;m=T.protocol,h=h?h+"."+T.hostname:T.hostname,T=+T.port;var x=new Er(null);m&&qo(x,m),h&&(x.g=h),T&&Jo(x,T),f&&(x.l=f),m=x}return f=c.D,h=c.ya,f&&h&&fe(m,f,h),fe(m,"VER",c.la),Vs(c,m),m}function hB(c,h,f){if(h&&!c.J)throw Error("Can't create secondary domain capable XhrIo object.");return h=c.Ca&&!c.pa?new _e(new Xo({eb:f})):new _e(c.pa),h.Ha(c.J),h}A.isActive=function(){return!!this.l&&this.l.isActive(this)};function dB(){}A=dB.prototype,A.ua=function(){},A.ta=function(){},A.sa=function(){},A.ra=function(){},A.isActive=function(){return!0},A.Na=function(){};function ra(){}ra.prototype.g=function(c,h){return new wt(c,h)};function wt(c,h){Xe.call(this),this.g=new AB(h),this.l=c,this.h=h&&h.messageUrlParams||null,c=h&&h.messageHeaders||null,h&&h.clientProtocolHeaderRequired&&(c?c["X-Client-Protocol"]="webchannel":c={"X-Client-Protocol":"webchannel"}),this.g.o=c,c=h&&h.initMessageHeaders||null,h&&h.messageContentType&&(c?c["X-WebChannel-Content-Type"]=h.messageContentType:c={"X-WebChannel-Content-Type":h.messageContentType}),h&&h.va&&(c?c["X-WebChannel-Client-Profile"]=h.va:c={"X-WebChannel-Client-Profile":h.va}),this.g.S=c,(c=h&&h.Sb)&&!S(c)&&(this.g.m=c),this.v=h&&h.supportsCrossDomainXhr||!1,this.u=h&&h.sendRawJson||!1,(h=h&&h.httpSessionIdParam)&&!S(h)&&(this.g.D=h,c=this.h,c!==null&&h in c&&(c=this.h,h in c&&delete c[h])),this.j=new dn(this)}w(wt,Xe),wt.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},wt.prototype.close=function(){Iu(this.g)},wt.prototype.o=function(c){var h=this.g;if(typeof c=="string"){var f={};f.__data__=c,c=f}else this.u&&(f={},f.__data__=pu(c),c=f);h.i.push(new ok(h.Ya++,c)),h.G==3&&ta(h)},wt.prototype.N=function(){this.g.l=null,delete this.j,Iu(this.g),delete this.g,wt.aa.N.call(this)};function fB(c){mu.call(this),c.__headers__&&(this.headers=c.__headers__,this.statusCode=c.__status__,delete c.__headers__,delete c.__status__);var h=c.__sm__;if(h){e:{for(const f in h){c=f;break e}c=void 0}(this.i=c)&&(c=this.i,h=h!==null&&c in h?h[c]:void 0),this.data=h}else this.data=c}w(fB,mu);function gB(){Bu.call(this),this.status=1}w(gB,Bu);function dn(c){this.g=c}w(dn,dB),dn.prototype.ua=function(){At(this.g,"a")},dn.prototype.ta=function(c){At(this.g,new fB(c))},dn.prototype.sa=function(c){At(this.g,new gB)},dn.prototype.ra=function(){At(this.g,"b")},ra.prototype.createWebChannel=ra.prototype.g,wt.prototype.send=wt.prototype.o,wt.prototype.open=wt.prototype.m,wt.prototype.close=wt.prototype.close,Nf=function(){return new ra},Pf=function(){return $o()},Of=Cr,_c={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},jo.NO_ERROR=0,jo.TIMEOUT=8,jo.HTTP_ERROR=6,Ni=jo,Sm.COMPLETE="complete",Hf=Sm,Um.EventType=Ss,Ss.OPEN="a",Ss.CLOSE="b",Ss.ERROR="c",Ss.MESSAGE="d",Xe.prototype.listen=Xe.prototype.K,Vn=Um,_e.prototype.listenOnce=_e.prototype.L,_e.prototype.getLastError=_e.prototype.Ka,_e.prototype.getLastErrorCode=_e.prototype.Ba,_e.prototype.getStatus=_e.prototype.Z,_e.prototype.getResponseJson=_e.prototype.Oa,_e.prototype.getResponseText=_e.prototype.oa,_e.prototype.send=_e.prototype.ea,_e.prototype.setWithCredentials=_e.prototype.Ha,Df=_e}).apply(typeof Pi<"u"?Pi:typeof self<"u"?self:typeof window<"u"?window:{});const Mf="@firebase/firestore";/**
1164
1164
  * @license
1165
1165
  * Copyright 2017 Google LLC
1166
1166
  *
@@ -1190,7 +1190,7 @@ SPDX-License-Identifier: Apache-2.0
1190
1190
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1191
1191
  * See the License for the specific language governing permissions and
1192
1192
  * limitations under the License.
1193
- */let Dr="10.14.0";/**
1193
+ */let Hr="10.14.0";/**
1194
1194
  * @license
1195
1195
  * Copyright 2017 Google LLC
1196
1196
  *
@@ -1205,7 +1205,7 @@ SPDX-License-Identifier: Apache-2.0
1205
1205
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1206
1206
  * See the License for the specific language governing permissions and
1207
1207
  * limitations under the License.
1208
- */const er=new wf("@firebase/firestore");function Kn(){return er.logLevel}function V(A,...e){if(er.logLevel<=ne.DEBUG){const t=e.map(vc);er.debug(`Firestore (${Dr}): ${A}`,...t)}}function aA(A,...e){if(er.logLevel<=ne.ERROR){const t=e.map(vc);er.error(`Firestore (${Dr}): ${A}`,...t)}}function Hr(A,...e){if(er.logLevel<=ne.WARN){const t=e.map(vc);er.warn(`Firestore (${Dr}): ${A}`,...t)}}function vc(A){if(typeof A=="string")return A;try{/**
1208
+ */const er=new wf("@firebase/firestore");function Kn(){return er.logLevel}function V(A,...e){if(er.logLevel<=ne.DEBUG){const t=e.map(Ec);er.debug(`Firestore (${Hr}): ${A}`,...t)}}function aA(A,...e){if(er.logLevel<=ne.ERROR){const t=e.map(Ec);er.error(`Firestore (${Hr}): ${A}`,...t)}}function Or(A,...e){if(er.logLevel<=ne.WARN){const t=e.map(Ec);er.warn(`Firestore (${Hr}): ${A}`,...t)}}function Ec(A){if(typeof A=="string")return A;try{/**
1209
1209
  * @license
1210
1210
  * Copyright 2020 Google LLC
1211
1211
  *
@@ -1235,7 +1235,7 @@ SPDX-License-Identifier: Apache-2.0
1235
1235
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1236
1236
  * See the License for the specific language governing permissions and
1237
1237
  * limitations under the License.
1238
- */function q(A="Unexpected state"){const e=`FIRESTORE (${Dr}) INTERNAL ASSERTION FAILED: `+A;throw aA(e),new Error(e)}function ae(A,e){A||q()}function z(A,e){return A}/**
1238
+ */function q(A="Unexpected state"){const e=`FIRESTORE (${Hr}) INTERNAL ASSERTION FAILED: `+A;throw aA(e),new Error(e)}function ae(A,e){A||q()}function z(A,e){return A}/**
1239
1239
  * @license
1240
1240
  * Copyright 2017 Google LLC
1241
1241
  *
@@ -1310,7 +1310,7 @@ SPDX-License-Identifier: Apache-2.0
1310
1310
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311
1311
  * See the License for the specific language governing permissions and
1312
1312
  * limitations under the License.
1313
- */class Kf{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length;let r="";for(;r.length<20;){const n=DQ(40);for(let s=0;s<n.length;++s)r.length<20&&n[s]<t&&(r+=e.charAt(n[s]%e.length))}return r}}function se(A,e){return A<e?-1:A>e?1:0}function Or(A,e,t){return A.length===e.length&&A.every((r,n)=>t(r,e[n]))}/**
1313
+ */class Kf{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length;let r="";for(;r.length<20;){const n=DQ(40);for(let s=0;s<n.length;++s)r.length<20&&n[s]<t&&(r+=e.charAt(n[s]%e.length))}return r}}function se(A,e){return A<e?-1:A>e?1:0}function Pr(A,e,t){return A.length===e.length&&A.every((r,n)=>t(r,e[n]))}/**
1314
1314
  * @license
1315
1315
  * Copyright 2017 Google LLC
1316
1316
  *
@@ -1430,7 +1430,7 @@ SPDX-License-Identifier: Apache-2.0
1430
1430
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1431
1431
  * See the License for the specific language governing permissions and
1432
1432
  * limitations under the License.
1433
- */class bc{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=r=>this.ie(r),this.se=r=>t.writeSequenceNumber(r))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}bc.oe=-1;function Vi(A){return A==null}function Ki(A){return A===0&&1/A==-1/0}function $Q(A){return typeof A=="number"&&Number.isInteger(A)&&!Ki(A)&&A<=Number.MAX_SAFE_INTEGER&&A>=Number.MIN_SAFE_INTEGER}/**
1433
+ */class vc{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=r=>this.ie(r),this.se=r=>t.writeSequenceNumber(r))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}vc.oe=-1;function Mi(A){return A==null}function Vi(A){return A===0&&1/A==-1/0}function $Q(A){return typeof A=="number"&&Number.isInteger(A)&&!Vi(A)&&A<=Number.MAX_SAFE_INTEGER&&A>=Number.MIN_SAFE_INTEGER}/**
1434
1434
  * @license
1435
1435
  * Copyright 2017 Google LLC
1436
1436
  *
@@ -1460,7 +1460,7 @@ SPDX-License-Identifier: Apache-2.0
1460
1460
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1461
1461
  * See the License for the specific language governing permissions and
1462
1462
  * limitations under the License.
1463
- */class pe{constructor(e,t){this.comparator=e,this.root=t||Ve.EMPTY}insert(e,t){return new pe(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Ve.BLACK,null,null))}remove(e){return new pe(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Ve.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const r=this.comparator(e,t.key);if(r===0)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){const n=this.comparator(e,r.key);if(n===0)return t+r.left.size;n<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){const e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new $i(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new $i(this.root,e,this.comparator,!1)}getReverseIterator(){return new $i(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new $i(this.root,e,this.comparator,!0)}}class $i{constructor(e,t,r,n){this.isReverse=n,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=t?r(e.key,t):1,t&&n&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Ve{constructor(e,t,r,n,s){this.key=e,this.value=t,this.color=r??Ve.RED,this.left=n??Ve.EMPTY,this.right=s??Ve.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,n,s){return new Ve(e??this.key,t??this.value,r??this.color,n??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let n=this;const s=r(e,n.key);return n=s<0?n.copy(null,null,null,n.left.insert(e,t,r),null):s===0?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,r)),n.fixUp()}removeMin(){if(this.left.isEmpty())return Ve.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let r,n=this;if(t(e,n.key)<0)n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),t(e,n.key)===0){if(n.right.isEmpty())return Ve.EMPTY;r=n.right.min(),n=n.copy(r.key,r.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Ve.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Ve.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw q();const e=this.left.check();if(e!==this.right.check())throw q();return e+(this.isRed()?0:1)}}Ve.EMPTY=null,Ve.RED=!0,Ve.BLACK=!1,Ve.EMPTY=new class{constructor(){this.size=0}get key(){throw q()}get value(){throw q()}get color(){throw q()}get left(){throw q()}get right(){throw q()}copy(e,t,r,n,s){return this}insert(e,t,r){return new Ve(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
1463
+ */class pe{constructor(e,t){this.comparator=e,this.root=t||Ve.EMPTY}insert(e,t){return new pe(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Ve.BLACK,null,null))}remove(e){return new pe(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Ve.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const r=this.comparator(e,t.key);if(r===0)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){const n=this.comparator(e,r.key);if(n===0)return t+r.left.size;n<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,r)=>(e(t,r),!1))}toString(){const e=[];return this.inorderTraversal((t,r)=>(e.push(`${t}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Ki(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Ki(this.root,e,this.comparator,!1)}getReverseIterator(){return new Ki(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Ki(this.root,e,this.comparator,!0)}}class Ki{constructor(e,t,r,n){this.isReverse=n,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=t?r(e.key,t):1,t&&n&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Ve{constructor(e,t,r,n,s){this.key=e,this.value=t,this.color=r??Ve.RED,this.left=n??Ve.EMPTY,this.right=s??Ve.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,n,s){return new Ve(e??this.key,t??this.value,r??this.color,n??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let n=this;const s=r(e,n.key);return n=s<0?n.copy(null,null,null,n.left.insert(e,t,r),null):s===0?n.copy(null,t,null,null,null):n.copy(null,null,null,null,n.right.insert(e,t,r)),n.fixUp()}removeMin(){if(this.left.isEmpty())return Ve.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let r,n=this;if(t(e,n.key)<0)n.left.isEmpty()||n.left.isRed()||n.left.left.isRed()||(n=n.moveRedLeft()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed()&&(n=n.rotateRight()),n.right.isEmpty()||n.right.isRed()||n.right.left.isRed()||(n=n.moveRedRight()),t(e,n.key)===0){if(n.right.isEmpty())return Ve.EMPTY;r=n.right.min(),n=n.copy(r.key,r.value,null,null,n.right.removeMin())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Ve.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Ve.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw q();const e=this.left.check();if(e!==this.right.check())throw q();return e+(this.isRed()?0:1)}}Ve.EMPTY=null,Ve.RED=!0,Ve.BLACK=!1,Ve.EMPTY=new class{constructor(){this.size=0}get key(){throw q()}get value(){throw q()}get color(){throw q()}get left(){throw q()}get right(){throw q()}copy(e,t,r,n,s){return this}insert(e,t,r){return new Ve(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
1464
1464
  * @license
1465
1465
  * Copyright 2017 Google LLC
1466
1466
  *
@@ -1490,7 +1490,7 @@ SPDX-License-Identifier: Apache-2.0
1490
1490
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1491
1491
  * See the License for the specific language governing permissions and
1492
1492
  * limitations under the License.
1493
- */class dt{constructor(e){this.fields=e,e.sort(Me.comparator)}static empty(){return new dt([])}unionWith(e){let t=new Ke(Me.comparator);for(const r of this.fields)t=t.add(r);for(const r of e)t=t.add(r);return new dt(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Or(this.fields,e.fields,(t,r)=>t.isEqual(r))}}/**
1493
+ */class dt{constructor(e){this.fields=e,e.sort(Me.comparator)}static empty(){return new dt([])}unionWith(e){let t=new Ke(Me.comparator);for(const r of this.fields)t=t.add(r);for(const r of e)t=t.add(r);return new dt(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Pr(this.fields,e.fields,(t,r)=>t.isEqual(r))}}/**
1494
1494
  * @license
1495
1495
  * Copyright 2023 Google LLC
1496
1496
  *
@@ -1535,7 +1535,7 @@ SPDX-License-Identifier: Apache-2.0
1535
1535
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1536
1536
  * See the License for the specific language governing permissions and
1537
1537
  * limitations under the License.
1538
- */function Uc(A){var e,t;return((t=(((e=A==null?void 0:A.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||t===void 0?void 0:t.stringValue)==="server_timestamp"}function Qc(A){const e=A.mapValue.fields.__previous_value__;return Uc(e)?Qc(e):e}function Wn(A){const e=TA(A.mapValue.fields.__local_write_time__.timestampValue);return new De(e.seconds,e.nanos)}/**
1538
+ */function bc(A){var e,t;return((t=(((e=A==null?void 0:A.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||t===void 0?void 0:t.stringValue)==="server_timestamp"}function Uc(A){const e=A.mapValue.fields.__previous_value__;return bc(e)?Uc(e):e}function Wn(A){const e=TA(A.mapValue.fields.__local_write_time__.timestampValue);return new De(e.seconds,e.nanos)}/**
1539
1539
  * @license
1540
1540
  * Copyright 2017 Google LLC
1541
1541
  *
@@ -1565,7 +1565,7 @@ SPDX-License-Identifier: Apache-2.0
1565
1565
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1566
1566
  * See the License for the specific language governing permissions and
1567
1567
  * limitations under the License.
1568
- */const ji={mapValue:{}};function rr(A){return"nullValue"in A?0:"booleanValue"in A?1:"integerValue"in A||"doubleValue"in A?2:"timestampValue"in A?3:"stringValue"in A?5:"bytesValue"in A?6:"referenceValue"in A?7:"geoPointValue"in A?8:"arrayValue"in A?9:"mapValue"in A?Uc(A)?4:qQ(A)?9007199254740991:WQ(A)?10:11:q()}function qt(A,e){if(A===e)return!0;const t=rr(A);if(t!==rr(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return A.booleanValue===e.booleanValue;case 4:return Wn(A).isEqual(Wn(e));case 3:return function(n,s){if(typeof n.timestampValue=="string"&&typeof s.timestampValue=="string"&&n.timestampValue.length===s.timestampValue.length)return n.timestampValue===s.timestampValue;const i=TA(n.timestampValue),o=TA(s.timestampValue);return i.seconds===o.seconds&&i.nanos===o.nanos}(A,e);case 5:return A.stringValue===e.stringValue;case 6:return function(n,s){return Ar(n.bytesValue).isEqual(Ar(s.bytesValue))}(A,e);case 7:return A.referenceValue===e.referenceValue;case 8:return function(n,s){return Ue(n.geoPointValue.latitude)===Ue(s.geoPointValue.latitude)&&Ue(n.geoPointValue.longitude)===Ue(s.geoPointValue.longitude)}(A,e);case 2:return function(n,s){if("integerValue"in n&&"integerValue"in s)return Ue(n.integerValue)===Ue(s.integerValue);if("doubleValue"in n&&"doubleValue"in s){const i=Ue(n.doubleValue),o=Ue(s.doubleValue);return i===o?Ki(i)===Ki(o):isNaN(i)&&isNaN(o)}return!1}(A,e);case 9:return Or(A.arrayValue.values||[],e.arrayValue.values||[],qt);case 10:case 11:return function(n,s){const i=n.mapValue.fields||{},o=s.mapValue.fields||{};if($f(i)!==$f(o))return!1;for(const a in i)if(i.hasOwnProperty(a)&&(o[a]===void 0||!qt(i[a],o[a])))return!1;return!0}(A,e);default:return q()}}function Jn(A,e){return(A.values||[]).find(t=>qt(t,e))!==void 0}function Pr(A,e){if(A===e)return 0;const t=rr(A),r=rr(e);if(t!==r)return se(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return se(A.booleanValue,e.booleanValue);case 2:return function(s,i){const o=Ue(s.integerValue||s.doubleValue),a=Ue(i.integerValue||i.doubleValue);return o<a?-1:o>a?1:o===a?0:isNaN(o)?isNaN(a)?0:-1:1}(A,e);case 3:return qf(A.timestampValue,e.timestampValue);case 4:return qf(Wn(A),Wn(e));case 5:return se(A.stringValue,e.stringValue);case 6:return function(s,i){const o=Ar(s),a=Ar(i);return o.compareTo(a)}(A.bytesValue,e.bytesValue);case 7:return function(s,i){const o=s.split("/"),a=i.split("/");for(let l=0;l<o.length&&l<a.length;l++){const u=se(o[l],a[l]);if(u!==0)return u}return se(o.length,a.length)}(A.referenceValue,e.referenceValue);case 8:return function(s,i){const o=se(Ue(s.latitude),Ue(i.latitude));return o!==0?o:se(Ue(s.longitude),Ue(i.longitude))}(A.geoPointValue,e.geoPointValue);case 9:return Jf(A.arrayValue,e.arrayValue);case 10:return function(s,i){var o,a,l,u;const d=s.fields||{},g=i.fields||{},p=(o=d.value)===null||o===void 0?void 0:o.arrayValue,w=(a=g.value)===null||a===void 0?void 0:a.arrayValue,y=se(((l=p==null?void 0:p.values)===null||l===void 0?void 0:l.length)||0,((u=w==null?void 0:w.values)===null||u===void 0?void 0:u.length)||0);return y!==0?y:Jf(p,w)}(A.mapValue,e.mapValue);case 11:return function(s,i){if(s===ji.mapValue&&i===ji.mapValue)return 0;if(s===ji.mapValue)return 1;if(i===ji.mapValue)return-1;const o=s.fields||{},a=Object.keys(o),l=i.fields||{},u=Object.keys(l);a.sort(),u.sort();for(let d=0;d<a.length&&d<u.length;++d){const g=se(a[d],u[d]);if(g!==0)return g;const p=Pr(o[a[d]],l[u[d]]);if(p!==0)return p}return se(a.length,u.length)}(A.mapValue,e.mapValue);default:throw q()}}function qf(A,e){if(typeof A=="string"&&typeof e=="string"&&A.length===e.length)return se(A,e);const t=TA(A),r=TA(e),n=se(t.seconds,r.seconds);return n!==0?n:se(t.nanos,r.nanos)}function Jf(A,e){const t=A.values||[],r=e.values||[];for(let n=0;n<t.length&&n<r.length;++n){const s=Pr(t[n],r[n]);if(s)return s}return se(t.length,r.length)}function Nr(A){return Ic(A)}function Ic(A){return"nullValue"in A?"null":"booleanValue"in A?""+A.booleanValue:"integerValue"in A?""+A.integerValue:"doubleValue"in A?""+A.doubleValue:"timestampValue"in A?function(t){const r=TA(t);return`time(${r.seconds},${r.nanos})`}(A.timestampValue):"stringValue"in A?A.stringValue:"bytesValue"in A?function(t){return Ar(t).toBase64()}(A.bytesValue):"referenceValue"in A?function(t){return $.fromName(t).toString()}(A.referenceValue):"geoPointValue"in A?function(t){return`geo(${t.latitude},${t.longitude})`}(A.geoPointValue):"arrayValue"in A?function(t){let r="[",n=!0;for(const s of t.values||[])n?n=!1:r+=",",r+=Ic(s);return r+"]"}(A.arrayValue):"mapValue"in A?function(t){const r=Object.keys(t.fields||{}).sort();let n="{",s=!0;for(const i of r)s?s=!1:n+=",",n+=`${i}:${Ic(t.fields[i])}`;return n+"}"}(A.mapValue):q()}function zf(A,e){return{referenceValue:`projects/${A.projectId}/databases/${A.database}/documents/${e.path.canonicalString()}`}}function Fc(A){return!!A&&"integerValue"in A}function Tc(A){return!!A&&"arrayValue"in A}function Xf(A){return!!A&&"nullValue"in A}function Yf(A){return!!A&&"doubleValue"in A&&isNaN(Number(A.doubleValue))}function Gi(A){return!!A&&"mapValue"in A}function WQ(A){var e,t;return((t=(((e=A==null?void 0:A.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||t===void 0?void 0:t.stringValue)==="__vector__"}function zn(A){if(A.geoPointValue)return{geoPointValue:Object.assign({},A.geoPointValue)};if(A.timestampValue&&typeof A.timestampValue=="object")return{timestampValue:Object.assign({},A.timestampValue)};if(A.mapValue){const e={mapValue:{fields:{}}};return tr(A.mapValue.fields,(t,r)=>e.mapValue.fields[t]=zn(r)),e}if(A.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(A.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=zn(A.arrayValue.values[t]);return e}return Object.assign({},A)}function qQ(A){return(((A.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
1568
+ */const $i={mapValue:{}};function rr(A){return"nullValue"in A?0:"booleanValue"in A?1:"integerValue"in A||"doubleValue"in A?2:"timestampValue"in A?3:"stringValue"in A?5:"bytesValue"in A?6:"referenceValue"in A?7:"geoPointValue"in A?8:"arrayValue"in A?9:"mapValue"in A?bc(A)?4:qQ(A)?9007199254740991:WQ(A)?10:11:q()}function qt(A,e){if(A===e)return!0;const t=rr(A);if(t!==rr(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return A.booleanValue===e.booleanValue;case 4:return Wn(A).isEqual(Wn(e));case 3:return function(n,s){if(typeof n.timestampValue=="string"&&typeof s.timestampValue=="string"&&n.timestampValue.length===s.timestampValue.length)return n.timestampValue===s.timestampValue;const i=TA(n.timestampValue),o=TA(s.timestampValue);return i.seconds===o.seconds&&i.nanos===o.nanos}(A,e);case 5:return A.stringValue===e.stringValue;case 6:return function(n,s){return Ar(n.bytesValue).isEqual(Ar(s.bytesValue))}(A,e);case 7:return A.referenceValue===e.referenceValue;case 8:return function(n,s){return Ue(n.geoPointValue.latitude)===Ue(s.geoPointValue.latitude)&&Ue(n.geoPointValue.longitude)===Ue(s.geoPointValue.longitude)}(A,e);case 2:return function(n,s){if("integerValue"in n&&"integerValue"in s)return Ue(n.integerValue)===Ue(s.integerValue);if("doubleValue"in n&&"doubleValue"in s){const i=Ue(n.doubleValue),o=Ue(s.doubleValue);return i===o?Vi(i)===Vi(o):isNaN(i)&&isNaN(o)}return!1}(A,e);case 9:return Pr(A.arrayValue.values||[],e.arrayValue.values||[],qt);case 10:case 11:return function(n,s){const i=n.mapValue.fields||{},o=s.mapValue.fields||{};if($f(i)!==$f(o))return!1;for(const a in i)if(i.hasOwnProperty(a)&&(o[a]===void 0||!qt(i[a],o[a])))return!1;return!0}(A,e);default:return q()}}function Jn(A,e){return(A.values||[]).find(t=>qt(t,e))!==void 0}function Nr(A,e){if(A===e)return 0;const t=rr(A),r=rr(e);if(t!==r)return se(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return se(A.booleanValue,e.booleanValue);case 2:return function(s,i){const o=Ue(s.integerValue||s.doubleValue),a=Ue(i.integerValue||i.doubleValue);return o<a?-1:o>a?1:o===a?0:isNaN(o)?isNaN(a)?0:-1:1}(A,e);case 3:return qf(A.timestampValue,e.timestampValue);case 4:return qf(Wn(A),Wn(e));case 5:return se(A.stringValue,e.stringValue);case 6:return function(s,i){const o=Ar(s),a=Ar(i);return o.compareTo(a)}(A.bytesValue,e.bytesValue);case 7:return function(s,i){const o=s.split("/"),a=i.split("/");for(let l=0;l<o.length&&l<a.length;l++){const u=se(o[l],a[l]);if(u!==0)return u}return se(o.length,a.length)}(A.referenceValue,e.referenceValue);case 8:return function(s,i){const o=se(Ue(s.latitude),Ue(i.latitude));return o!==0?o:se(Ue(s.longitude),Ue(i.longitude))}(A.geoPointValue,e.geoPointValue);case 9:return Jf(A.arrayValue,e.arrayValue);case 10:return function(s,i){var o,a,l,u;const d=s.fields||{},g=i.fields||{},p=(o=d.value)===null||o===void 0?void 0:o.arrayValue,w=(a=g.value)===null||a===void 0?void 0:a.arrayValue,y=se(((l=p==null?void 0:p.values)===null||l===void 0?void 0:l.length)||0,((u=w==null?void 0:w.values)===null||u===void 0?void 0:u.length)||0);return y!==0?y:Jf(p,w)}(A.mapValue,e.mapValue);case 11:return function(s,i){if(s===$i.mapValue&&i===$i.mapValue)return 0;if(s===$i.mapValue)return 1;if(i===$i.mapValue)return-1;const o=s.fields||{},a=Object.keys(o),l=i.fields||{},u=Object.keys(l);a.sort(),u.sort();for(let d=0;d<a.length&&d<u.length;++d){const g=se(a[d],u[d]);if(g!==0)return g;const p=Nr(o[a[d]],l[u[d]]);if(p!==0)return p}return se(a.length,u.length)}(A.mapValue,e.mapValue);default:throw q()}}function qf(A,e){if(typeof A=="string"&&typeof e=="string"&&A.length===e.length)return se(A,e);const t=TA(A),r=TA(e),n=se(t.seconds,r.seconds);return n!==0?n:se(t.nanos,r.nanos)}function Jf(A,e){const t=A.values||[],r=e.values||[];for(let n=0;n<t.length&&n<r.length;++n){const s=Nr(t[n],r[n]);if(s)return s}return se(t.length,r.length)}function Mr(A){return Qc(A)}function Qc(A){return"nullValue"in A?"null":"booleanValue"in A?""+A.booleanValue:"integerValue"in A?""+A.integerValue:"doubleValue"in A?""+A.doubleValue:"timestampValue"in A?function(t){const r=TA(t);return`time(${r.seconds},${r.nanos})`}(A.timestampValue):"stringValue"in A?A.stringValue:"bytesValue"in A?function(t){return Ar(t).toBase64()}(A.bytesValue):"referenceValue"in A?function(t){return $.fromName(t).toString()}(A.referenceValue):"geoPointValue"in A?function(t){return`geo(${t.latitude},${t.longitude})`}(A.geoPointValue):"arrayValue"in A?function(t){let r="[",n=!0;for(const s of t.values||[])n?n=!1:r+=",",r+=Qc(s);return r+"]"}(A.arrayValue):"mapValue"in A?function(t){const r=Object.keys(t.fields||{}).sort();let n="{",s=!0;for(const i of r)s?s=!1:n+=",",n+=`${i}:${Qc(t.fields[i])}`;return n+"}"}(A.mapValue):q()}function zf(A,e){return{referenceValue:`projects/${A.projectId}/databases/${A.database}/documents/${e.path.canonicalString()}`}}function Ic(A){return!!A&&"integerValue"in A}function Fc(A){return!!A&&"arrayValue"in A}function Xf(A){return!!A&&"nullValue"in A}function Yf(A){return!!A&&"doubleValue"in A&&isNaN(Number(A.doubleValue))}function ji(A){return!!A&&"mapValue"in A}function WQ(A){var e,t;return((t=(((e=A==null?void 0:A.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||t===void 0?void 0:t.stringValue)==="__vector__"}function zn(A){if(A.geoPointValue)return{geoPointValue:Object.assign({},A.geoPointValue)};if(A.timestampValue&&typeof A.timestampValue=="object")return{timestampValue:Object.assign({},A.timestampValue)};if(A.mapValue){const e={mapValue:{fields:{}}};return tr(A.mapValue.fields,(t,r)=>e.mapValue.fields[t]=zn(r)),e}if(A.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(A.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=zn(A.arrayValue.values[t]);return e}return Object.assign({},A)}function qQ(A){return(((A.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
1569
1569
  * @license
1570
1570
  * Copyright 2017 Google LLC
1571
1571
  *
@@ -1580,7 +1580,7 @@ SPDX-License-Identifier: Apache-2.0
1580
1580
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1581
1581
  * See the License for the specific language governing permissions and
1582
1582
  * limitations under the License.
1583
- */class at{constructor(e){this.value=e}static empty(){return new at({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(t=(t.mapValue.fields||{})[e.get(r)],!Gi(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=zn(t)}setAll(e){let t=Me.emptyPath(),r={},n=[];e.forEach((i,o)=>{if(!t.isImmediateParentOf(o)){const a=this.getFieldsMap(t);this.applyChanges(a,r,n),r={},n=[],t=o.popLast()}i?r[o.lastSegment()]=zn(i):n.push(o.lastSegment())});const s=this.getFieldsMap(t);this.applyChanges(s,r,n)}delete(e){const t=this.field(e.popLast());Gi(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return qt(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;r<e.length;++r){let n=t.mapValue.fields[e.get(r)];Gi(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=n),t=n}return t.mapValue.fields}applyChanges(e,t,r){tr(t,(n,s)=>e[n]=s);for(const n of r)delete e[n]}clone(){return new at(zn(this.value))}}function Zf(A){const e=[];return tr(A.fields,(t,r)=>{const n=new Me([t]);if(Gi(r)){const s=Zf(r.mapValue).fields;if(s.length===0)e.push(n);else for(const i of s)e.push(n.child(i))}else e.push(n)}),new dt(e)}/**
1583
+ */class at{constructor(e){this.value=e}static empty(){return new at({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(t=(t.mapValue.fields||{})[e.get(r)],!ji(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=zn(t)}setAll(e){let t=Me.emptyPath(),r={},n=[];e.forEach((i,o)=>{if(!t.isImmediateParentOf(o)){const a=this.getFieldsMap(t);this.applyChanges(a,r,n),r={},n=[],t=o.popLast()}i?r[o.lastSegment()]=zn(i):n.push(o.lastSegment())});const s=this.getFieldsMap(t);this.applyChanges(s,r,n)}delete(e){const t=this.field(e.popLast());ji(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return qt(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;r<e.length;++r){let n=t.mapValue.fields[e.get(r)];ji(n)&&n.mapValue.fields||(n={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=n),t=n}return t.mapValue.fields}applyChanges(e,t,r){tr(t,(n,s)=>e[n]=s);for(const n of r)delete e[n]}clone(){return new at(zn(this.value))}}function Zf(A){const e=[];return tr(A.fields,(t,r)=>{const n=new Me([t]);if(ji(r)){const s=Zf(r.mapValue).fields;if(s.length===0)e.push(n);else for(const i of s)e.push(n.child(i))}else e.push(n)}),new dt(e)}/**
1584
1584
  * @license
1585
1585
  * Copyright 2017 Google LLC
1586
1586
  *
@@ -1610,7 +1610,7 @@ SPDX-License-Identifier: Apache-2.0
1610
1610
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1611
1611
  * See the License for the specific language governing permissions and
1612
1612
  * limitations under the License.
1613
- */class Wi{constructor(e,t){this.position=e,this.inclusive=t}}function eg(A,e,t){let r=0;for(let n=0;n<A.position.length;n++){const s=e[n],i=A.position[n];if(s.field.isKeyField()?r=$.comparator($.fromName(i.referenceValue),t.key):r=Pr(i,t.data.field(s.field)),s.dir==="desc"&&(r*=-1),r!==0)break}return r}function tg(A,e){if(A===null)return e===null;if(e===null||A.inclusive!==e.inclusive||A.position.length!==e.position.length)return!1;for(let t=0;t<A.position.length;t++)if(!qt(A.position[t],e.position[t]))return!1;return!0}/**
1613
+ */class Gi{constructor(e,t){this.position=e,this.inclusive=t}}function eg(A,e,t){let r=0;for(let n=0;n<A.position.length;n++){const s=e[n],i=A.position[n];if(s.field.isKeyField()?r=$.comparator($.fromName(i.referenceValue),t.key):r=Nr(i,t.data.field(s.field)),s.dir==="desc"&&(r*=-1),r!==0)break}return r}function tg(A,e){if(A===null)return e===null;if(e===null||A.inclusive!==e.inclusive||A.position.length!==e.position.length)return!1;for(let t=0;t<A.position.length;t++)if(!qt(A.position[t],e.position[t]))return!1;return!0}/**
1614
1614
  * @license
1615
1615
  * Copyright 2022 Google LLC
1616
1616
  *
@@ -1625,7 +1625,7 @@ SPDX-License-Identifier: Apache-2.0
1625
1625
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1626
1626
  * See the License for the specific language governing permissions and
1627
1627
  * limitations under the License.
1628
- */class qi{constructor(e,t="asc"){this.field=e,this.dir=t}}function JQ(A,e){return A.dir===e.dir&&A.field.isEqual(e.field)}/**
1628
+ */class Wi{constructor(e,t="asc"){this.field=e,this.dir=t}}function JQ(A,e){return A.dir===e.dir&&A.field.isEqual(e.field)}/**
1629
1629
  * @license
1630
1630
  * Copyright 2022 Google LLC
1631
1631
  *
@@ -1640,7 +1640,7 @@ SPDX-License-Identifier: Apache-2.0
1640
1640
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1641
1641
  * See the License for the specific language governing permissions and
1642
1642
  * limitations under the License.
1643
- */class Ag{}class Fe extends Ag{constructor(e,t,r){super(),this.field=e,this.op=t,this.value=r}static create(e,t,r){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,r):new XQ(e,t,r):t==="array-contains"?new eI(e,r):t==="in"?new tI(e,r):t==="not-in"?new AI(e,r):t==="array-contains-any"?new rI(e,r):new Fe(e,t,r)}static createKeyFieldInFilter(e,t,r){return t==="in"?new YQ(e,r):new ZQ(e,r)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&this.matchesComparison(Pr(t,this.value)):t!==null&&rr(this.value)===rr(t)&&this.matchesComparison(Pr(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return q()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Rt extends Ag{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new Rt(e,t)}matches(e){return rg(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function rg(A){return A.op==="and"}function ng(A){return zQ(A)&&rg(A)}function zQ(A){for(const e of A.filters)if(e instanceof Rt)return!1;return!0}function Sc(A){if(A instanceof Fe)return A.field.canonicalString()+A.op.toString()+Nr(A.value);if(ng(A))return A.filters.map(e=>Sc(e)).join(",");{const e=A.filters.map(t=>Sc(t)).join(",");return`${A.op}(${e})`}}function sg(A,e){return A instanceof Fe?function(r,n){return n instanceof Fe&&r.op===n.op&&r.field.isEqual(n.field)&&qt(r.value,n.value)}(A,e):A instanceof Rt?function(r,n){return n instanceof Rt&&r.op===n.op&&r.filters.length===n.filters.length?r.filters.reduce((s,i,o)=>s&&sg(i,n.filters[o]),!0):!1}(A,e):void q()}function ig(A){return A instanceof Fe?function(t){return`${t.field.canonicalString()} ${t.op} ${Nr(t.value)}`}(A):A instanceof Rt?function(t){return t.op.toString()+" {"+t.getFilters().map(ig).join(" ,")+"}"}(A):"Filter"}class XQ extends Fe{constructor(e,t,r){super(e,t,r),this.key=$.fromName(r.referenceValue)}matches(e){const t=$.comparator(e.key,this.key);return this.matchesComparison(t)}}class YQ extends Fe{constructor(e,t){super(e,"in",t),this.keys=og("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class ZQ extends Fe{constructor(e,t){super(e,"not-in",t),this.keys=og("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function og(A,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(r=>$.fromName(r.referenceValue))}class eI extends Fe{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Tc(t)&&Jn(t.arrayValue,this.value)}}class tI extends Fe{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&Jn(this.value.arrayValue,t)}}class AI extends Fe{constructor(e,t){super(e,"not-in",t)}matches(e){if(Jn(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&!Jn(this.value.arrayValue,t)}}class rI extends Fe{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Tc(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>Jn(this.value.arrayValue,r))}}/**
1643
+ */class Ag{}class Fe extends Ag{constructor(e,t,r){super(),this.field=e,this.op=t,this.value=r}static create(e,t,r){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,r):new XQ(e,t,r):t==="array-contains"?new eI(e,r):t==="in"?new tI(e,r):t==="not-in"?new AI(e,r):t==="array-contains-any"?new rI(e,r):new Fe(e,t,r)}static createKeyFieldInFilter(e,t,r){return t==="in"?new YQ(e,r):new ZQ(e,r)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&this.matchesComparison(Nr(t,this.value)):t!==null&&rr(this.value)===rr(t)&&this.matchesComparison(Nr(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return q()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Rt extends Ag{constructor(e,t){super(),this.filters=e,this.op=t,this.ae=null}static create(e,t){return new Rt(e,t)}matches(e){return rg(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function rg(A){return A.op==="and"}function ng(A){return zQ(A)&&rg(A)}function zQ(A){for(const e of A.filters)if(e instanceof Rt)return!1;return!0}function Tc(A){if(A instanceof Fe)return A.field.canonicalString()+A.op.toString()+Mr(A.value);if(ng(A))return A.filters.map(e=>Tc(e)).join(",");{const e=A.filters.map(t=>Tc(t)).join(",");return`${A.op}(${e})`}}function sg(A,e){return A instanceof Fe?function(r,n){return n instanceof Fe&&r.op===n.op&&r.field.isEqual(n.field)&&qt(r.value,n.value)}(A,e):A instanceof Rt?function(r,n){return n instanceof Rt&&r.op===n.op&&r.filters.length===n.filters.length?r.filters.reduce((s,i,o)=>s&&sg(i,n.filters[o]),!0):!1}(A,e):void q()}function ig(A){return A instanceof Fe?function(t){return`${t.field.canonicalString()} ${t.op} ${Mr(t.value)}`}(A):A instanceof Rt?function(t){return t.op.toString()+" {"+t.getFilters().map(ig).join(" ,")+"}"}(A):"Filter"}class XQ extends Fe{constructor(e,t,r){super(e,t,r),this.key=$.fromName(r.referenceValue)}matches(e){const t=$.comparator(e.key,this.key);return this.matchesComparison(t)}}class YQ extends Fe{constructor(e,t){super(e,"in",t),this.keys=og("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class ZQ extends Fe{constructor(e,t){super(e,"not-in",t),this.keys=og("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function og(A,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(r=>$.fromName(r.referenceValue))}class eI extends Fe{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Fc(t)&&Jn(t.arrayValue,this.value)}}class tI extends Fe{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&Jn(this.value.arrayValue,t)}}class AI extends Fe{constructor(e,t){super(e,"not-in",t)}matches(e){if(Jn(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&!Jn(this.value.arrayValue,t)}}class rI extends Fe{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Fc(t)||!t.arrayValue.values)&&t.arrayValue.values.some(r=>Jn(this.value.arrayValue,r))}}/**
1644
1644
  * @license
1645
1645
  * Copyright 2019 Google LLC
1646
1646
  *
@@ -1655,7 +1655,7 @@ SPDX-License-Identifier: Apache-2.0
1655
1655
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1656
1656
  * See the License for the specific language governing permissions and
1657
1657
  * limitations under the License.
1658
- */class nI{constructor(e,t=null,r=[],n=[],s=null,i=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=n,this.limit=s,this.startAt=i,this.endAt=o,this.ue=null}}function ag(A,e=null,t=[],r=[],n=null,s=null,i=null){return new nI(A,e,t,r,n,s,i)}function Rc(A){const e=z(A);if(e.ue===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>Sc(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),Vi(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>Nr(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>Nr(r)).join(",")),e.ue=t}return e.ue}function xc(A,e){if(A.limit!==e.limit||A.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<A.orderBy.length;t++)if(!JQ(A.orderBy[t],e.orderBy[t]))return!1;if(A.filters.length!==e.filters.length)return!1;for(let t=0;t<A.filters.length;t++)if(!sg(A.filters[t],e.filters[t]))return!1;return A.collectionGroup===e.collectionGroup&&!!A.path.isEqual(e.path)&&!!tg(A.startAt,e.startAt)&&tg(A.endAt,e.endAt)}function kc(A){return $.isDocumentKey(A.path)&&A.collectionGroup===null&&A.filters.length===0}/**
1658
+ */class nI{constructor(e,t=null,r=[],n=[],s=null,i=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=n,this.limit=s,this.startAt=i,this.endAt=o,this.ue=null}}function ag(A,e=null,t=[],r=[],n=null,s=null,i=null){return new nI(A,e,t,r,n,s,i)}function Sc(A){const e=z(A);if(e.ue===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(r=>Tc(r)).join(","),t+="|ob:",t+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),Mi(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(r=>Mr(r)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(r=>Mr(r)).join(",")),e.ue=t}return e.ue}function Rc(A,e){if(A.limit!==e.limit||A.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<A.orderBy.length;t++)if(!JQ(A.orderBy[t],e.orderBy[t]))return!1;if(A.filters.length!==e.filters.length)return!1;for(let t=0;t<A.filters.length;t++)if(!sg(A.filters[t],e.filters[t]))return!1;return A.collectionGroup===e.collectionGroup&&!!A.path.isEqual(e.path)&&!!tg(A.startAt,e.startAt)&&tg(A.endAt,e.endAt)}function xc(A){return $.isDocumentKey(A.path)&&A.collectionGroup===null&&A.filters.length===0}/**
1659
1659
  * @license
1660
1660
  * Copyright 2017 Google LLC
1661
1661
  *
@@ -1670,7 +1670,7 @@ SPDX-License-Identifier: Apache-2.0
1670
1670
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1671
1671
  * See the License for the specific language governing permissions and
1672
1672
  * limitations under the License.
1673
- */class Xn{constructor(e,t=null,r=[],n=[],s=null,i="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=n,this.limit=s,this.limitType=i,this.startAt=o,this.endAt=a,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function sI(A,e,t,r,n,s,i,o){return new Xn(A,e,t,r,n,s,i,o)}function Lc(A){return new Xn(A)}function cg(A){return A.filters.length===0&&A.limit===null&&A.startAt==null&&A.endAt==null&&(A.explicitOrderBy.length===0||A.explicitOrderBy.length===1&&A.explicitOrderBy[0].field.isKeyField())}function lg(A){return A.collectionGroup!==null}function Yn(A){const e=z(A);if(e.ce===null){e.ce=[];const t=new Set;for(const s of e.explicitOrderBy)e.ce.push(s),t.add(s.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(i){let o=new Ke(Me.comparator);return i.filters.forEach(a=>{a.getFlattenedFilters().forEach(l=>{l.isInequality()&&(o=o.add(l.field))})}),o})(e).forEach(s=>{t.has(s.canonicalString())||s.isKeyField()||e.ce.push(new qi(s,r))}),t.has(Me.keyField().canonicalString())||e.ce.push(new qi(Me.keyField(),r))}return e.ce}function Jt(A){const e=z(A);return e.le||(e.le=iI(e,Yn(A))),e.le}function iI(A,e){if(A.limitType==="F")return ag(A.path,A.collectionGroup,e,A.filters,A.limit,A.startAt,A.endAt);{e=e.map(n=>{const s=n.dir==="desc"?"asc":"desc";return new qi(n.field,s)});const t=A.endAt?new Wi(A.endAt.position,A.endAt.inclusive):null,r=A.startAt?new Wi(A.startAt.position,A.startAt.inclusive):null;return ag(A.path,A.collectionGroup,e,A.filters,A.limit,t,r)}}function Dc(A,e){const t=A.filters.concat([e]);return new Xn(A.path,A.collectionGroup,A.explicitOrderBy.slice(),t,A.limit,A.limitType,A.startAt,A.endAt)}function Hc(A,e,t){return new Xn(A.path,A.collectionGroup,A.explicitOrderBy.slice(),A.filters.slice(),e,t,A.startAt,A.endAt)}function Ji(A,e){return xc(Jt(A),Jt(e))&&A.limitType===e.limitType}function ug(A){return`${Rc(Jt(A))}|lt:${A.limitType}`}function Mr(A){return`Query(target=${function(t){let r=t.path.canonicalString();return t.collectionGroup!==null&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(n=>ig(n)).join(", ")}]`),Vi(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(n=>function(i){return`${i.field.canonicalString()} (${i.dir})`}(n)).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(n=>Nr(n)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(n=>Nr(n)).join(",")),`Target(${r})`}(Jt(A))}; limitType=${A.limitType})`}function zi(A,e){return e.isFoundDocument()&&function(r,n){const s=n.key.path;return r.collectionGroup!==null?n.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):$.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(A,e)&&function(r,n){for(const s of Yn(r))if(!s.field.isKeyField()&&n.data.field(s.field)===null)return!1;return!0}(A,e)&&function(r,n){for(const s of r.filters)if(!s.matches(n))return!1;return!0}(A,e)&&function(r,n){return!(r.startAt&&!function(i,o,a){const l=eg(i,o,a);return i.inclusive?l<=0:l<0}(r.startAt,Yn(r),n)||r.endAt&&!function(i,o,a){const l=eg(i,o,a);return i.inclusive?l>=0:l>0}(r.endAt,Yn(r),n))}(A,e)}function oI(A){return A.collectionGroup||(A.path.length%2==1?A.path.lastSegment():A.path.get(A.path.length-2))}function hg(A){return(e,t)=>{let r=!1;for(const n of Yn(A)){const s=aI(n,e,t);if(s!==0)return s;r=r||n.field.isKeyField()}return 0}}function aI(A,e,t){const r=A.field.isKeyField()?$.comparator(e.key,t.key):function(s,i,o){const a=i.data.field(s),l=o.data.field(s);return a!==null&&l!==null?Pr(a,l):q()}(A.field,e,t);switch(A.dir){case"asc":return r;case"desc":return-1*r;default:return q()}}/**
1673
+ */class Xn{constructor(e,t=null,r=[],n=[],s=null,i="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=n,this.limit=s,this.limitType=i,this.startAt=o,this.endAt=a,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function sI(A,e,t,r,n,s,i,o){return new Xn(A,e,t,r,n,s,i,o)}function kc(A){return new Xn(A)}function cg(A){return A.filters.length===0&&A.limit===null&&A.startAt==null&&A.endAt==null&&(A.explicitOrderBy.length===0||A.explicitOrderBy.length===1&&A.explicitOrderBy[0].field.isKeyField())}function lg(A){return A.collectionGroup!==null}function Yn(A){const e=z(A);if(e.ce===null){e.ce=[];const t=new Set;for(const s of e.explicitOrderBy)e.ce.push(s),t.add(s.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(i){let o=new Ke(Me.comparator);return i.filters.forEach(a=>{a.getFlattenedFilters().forEach(l=>{l.isInequality()&&(o=o.add(l.field))})}),o})(e).forEach(s=>{t.has(s.canonicalString())||s.isKeyField()||e.ce.push(new Wi(s,r))}),t.has(Me.keyField().canonicalString())||e.ce.push(new Wi(Me.keyField(),r))}return e.ce}function Jt(A){const e=z(A);return e.le||(e.le=iI(e,Yn(A))),e.le}function iI(A,e){if(A.limitType==="F")return ag(A.path,A.collectionGroup,e,A.filters,A.limit,A.startAt,A.endAt);{e=e.map(n=>{const s=n.dir==="desc"?"asc":"desc";return new Wi(n.field,s)});const t=A.endAt?new Gi(A.endAt.position,A.endAt.inclusive):null,r=A.startAt?new Gi(A.startAt.position,A.startAt.inclusive):null;return ag(A.path,A.collectionGroup,e,A.filters,A.limit,t,r)}}function Lc(A,e){const t=A.filters.concat([e]);return new Xn(A.path,A.collectionGroup,A.explicitOrderBy.slice(),t,A.limit,A.limitType,A.startAt,A.endAt)}function Dc(A,e,t){return new Xn(A.path,A.collectionGroup,A.explicitOrderBy.slice(),A.filters.slice(),e,t,A.startAt,A.endAt)}function qi(A,e){return Rc(Jt(A),Jt(e))&&A.limitType===e.limitType}function ug(A){return`${Sc(Jt(A))}|lt:${A.limitType}`}function Vr(A){return`Query(target=${function(t){let r=t.path.canonicalString();return t.collectionGroup!==null&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map(n=>ig(n)).join(", ")}]`),Mi(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map(n=>function(i){return`${i.field.canonicalString()} (${i.dir})`}(n)).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map(n=>Mr(n)).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map(n=>Mr(n)).join(",")),`Target(${r})`}(Jt(A))}; limitType=${A.limitType})`}function Ji(A,e){return e.isFoundDocument()&&function(r,n){const s=n.key.path;return r.collectionGroup!==null?n.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):$.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(A,e)&&function(r,n){for(const s of Yn(r))if(!s.field.isKeyField()&&n.data.field(s.field)===null)return!1;return!0}(A,e)&&function(r,n){for(const s of r.filters)if(!s.matches(n))return!1;return!0}(A,e)&&function(r,n){return!(r.startAt&&!function(i,o,a){const l=eg(i,o,a);return i.inclusive?l<=0:l<0}(r.startAt,Yn(r),n)||r.endAt&&!function(i,o,a){const l=eg(i,o,a);return i.inclusive?l>=0:l>0}(r.endAt,Yn(r),n))}(A,e)}function oI(A){return A.collectionGroup||(A.path.length%2==1?A.path.lastSegment():A.path.get(A.path.length-2))}function hg(A){return(e,t)=>{let r=!1;for(const n of Yn(A)){const s=aI(n,e,t);if(s!==0)return s;r=r||n.field.isKeyField()}return 0}}function aI(A,e,t){const r=A.field.isKeyField()?$.comparator(e.key,t.key):function(s,i,o){const a=i.data.field(s),l=o.data.field(s);return a!==null&&l!==null?Nr(a,l):q()}(A.field,e,t);switch(A.dir){case"asc":return r;case"desc":return-1*r;default:return q()}}/**
1674
1674
  * @license
1675
1675
  * Copyright 2017 Google LLC
1676
1676
  *
@@ -1685,7 +1685,7 @@ SPDX-License-Identifier: Apache-2.0
1685
1685
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1686
1686
  * See the License for the specific language governing permissions and
1687
1687
  * limitations under the License.
1688
- */class Vr{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r!==void 0){for(const[n,s]of r)if(this.equalsFn(n,e))return s}}has(e){return this.get(e)!==void 0}set(e,t){const r=this.mapKeyFn(e),n=this.inner[r];if(n===void 0)return this.inner[r]=[[e,t]],void this.innerSize++;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],e))return void(n[s]=[e,t]);n.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r===void 0)return!1;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return r.length===1?delete this.inner[t]:r.splice(n,1),this.innerSize--,!0;return!1}forEach(e){tr(this.inner,(t,r)=>{for(const[n,s]of r)e(n,s)})}isEmpty(){return jf(this.inner)}size(){return this.innerSize}}/**
1688
+ */class Kr{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r!==void 0){for(const[n,s]of r)if(this.equalsFn(n,e))return s}}has(e){return this.get(e)!==void 0}set(e,t){const r=this.mapKeyFn(e),n=this.inner[r];if(n===void 0)return this.inner[r]=[[e,t]],void this.innerSize++;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],e))return void(n[s]=[e,t]);n.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r===void 0)return!1;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return r.length===1?delete this.inner[t]:r.splice(n,1),this.innerSize--,!0;return!1}forEach(e){tr(this.inner,(t,r)=>{for(const[n,s]of r)e(n,s)})}isEmpty(){return jf(this.inner)}size(){return this.innerSize}}/**
1689
1689
  * @license
1690
1690
  * Copyright 2017 Google LLC
1691
1691
  *
@@ -1700,7 +1700,7 @@ SPDX-License-Identifier: Apache-2.0
1700
1700
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1701
1701
  * See the License for the specific language governing permissions and
1702
1702
  * limitations under the License.
1703
- */const cI=new pe($.comparator);function cA(){return cI}const dg=new pe($.comparator);function Zn(...A){let e=dg;for(const t of A)e=e.insert(t.key,t);return e}function fg(A){let e=dg;return A.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function nr(){return es()}function gg(){return es()}function es(){return new Vr(A=>A.toString(),(A,e)=>A.isEqual(e))}const lI=new pe($.comparator),uI=new Ke($.comparator);function ee(...A){let e=uI;for(const t of A)e=e.add(t);return e}const hI=new Ke(se);function dI(){return hI}/**
1703
+ */const cI=new pe($.comparator);function cA(){return cI}const dg=new pe($.comparator);function Zn(...A){let e=dg;for(const t of A)e=e.insert(t.key,t);return e}function fg(A){let e=dg;return A.forEach((t,r)=>e=e.insert(t,r.overlayedDocument)),e}function nr(){return es()}function gg(){return es()}function es(){return new Kr(A=>A.toString(),(A,e)=>A.isEqual(e))}const lI=new pe($.comparator),uI=new Ke($.comparator);function ee(...A){let e=uI;for(const t of A)e=e.add(t);return e}const hI=new Ke(se);function dI(){return hI}/**
1704
1704
  * @license
1705
1705
  * Copyright 2020 Google LLC
1706
1706
  *
@@ -1715,7 +1715,7 @@ SPDX-License-Identifier: Apache-2.0
1715
1715
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1716
1716
  * See the License for the specific language governing permissions and
1717
1717
  * limitations under the License.
1718
- */function Oc(A,e){if(A.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ki(e)?"-0":e}}function pg(A){return{integerValue:""+A}}function fI(A,e){return $Q(e)?pg(e):Oc(A,e)}/**
1718
+ */function Hc(A,e){if(A.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Vi(e)?"-0":e}}function pg(A){return{integerValue:""+A}}function fI(A,e){return $Q(e)?pg(e):Hc(A,e)}/**
1719
1719
  * @license
1720
1720
  * Copyright 2018 Google LLC
1721
1721
  *
@@ -1730,7 +1730,7 @@ SPDX-License-Identifier: Apache-2.0
1730
1730
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1731
1731
  * See the License for the specific language governing permissions and
1732
1732
  * limitations under the License.
1733
- */class Xi{constructor(){this._=void 0}}function gI(A,e,t){return A instanceof Yi?function(n,s){const i={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:n.seconds,nanos:n.nanoseconds}}}};return s&&Uc(s)&&(s=Qc(s)),s&&(i.fields.__previous_value__=s),{mapValue:i}}(t,e):A instanceof ts?mg(A,e):A instanceof As?Bg(A,e):function(n,s){const i=wg(n,s),o=yg(i)+yg(n.Pe);return Fc(i)&&Fc(n.Pe)?pg(o):Oc(n.serializer,o)}(A,e)}function pI(A,e,t){return A instanceof ts?mg(A,e):A instanceof As?Bg(A,e):t}function wg(A,e){return A instanceof Zi?function(r){return Fc(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class Yi extends Xi{}class ts extends Xi{constructor(e){super(),this.elements=e}}function mg(A,e){const t=Cg(e);for(const r of A.elements)t.some(n=>qt(n,r))||t.push(r);return{arrayValue:{values:t}}}class As extends Xi{constructor(e){super(),this.elements=e}}function Bg(A,e){let t=Cg(e);for(const r of A.elements)t=t.filter(n=>!qt(n,r));return{arrayValue:{values:t}}}class Zi extends Xi{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function yg(A){return Ue(A.integerValue||A.doubleValue)}function Cg(A){return Tc(A)&&A.arrayValue.values?A.arrayValue.values.slice():[]}function wI(A,e){return A.field.isEqual(e.field)&&function(r,n){return r instanceof ts&&n instanceof ts||r instanceof As&&n instanceof As?Or(r.elements,n.elements,qt):r instanceof Zi&&n instanceof Zi?qt(r.Pe,n.Pe):r instanceof Yi&&n instanceof Yi}(A.transform,e.transform)}class mI{constructor(e,t){this.version=e,this.transformResults=t}}class xt{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new xt}static exists(e){return new xt(void 0,e)}static updateTime(e){return new xt(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function eo(A,e){return A.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(A.updateTime):A.exists===void 0||A.exists===e.isFoundDocument()}class to{}function _g(A,e){if(!A.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return A.isNoDocument()?new Pc(A.key,xt.none()):new ns(A.key,A.data,xt.none());{const t=A.data,r=at.empty();let n=new Ke(Me.comparator);for(let s of e.fields)if(!n.has(s)){let i=t.field(s);i===null&&s.length>1&&(s=s.popLast(),i=t.field(s)),i===null?r.delete(s):r.set(s,i),n=n.add(s)}return new SA(A.key,r,new dt(n.toArray()),xt.none())}}function BI(A,e,t){A instanceof ns?function(n,s,i){const o=n.value.clone(),a=bg(n.fieldTransforms,s,i.transformResults);o.setAll(a),s.convertToFoundDocument(i.version,o).setHasCommittedMutations()}(A,e,t):A instanceof SA?function(n,s,i){if(!eo(n.precondition,s))return void s.convertToUnknownDocument(i.version);const o=bg(n.fieldTransforms,s,i.transformResults),a=s.data;a.setAll(vg(n)),a.setAll(o),s.convertToFoundDocument(i.version,a).setHasCommittedMutations()}(A,e,t):function(n,s,i){s.convertToNoDocument(i.version).setHasCommittedMutations()}(0,e,t)}function rs(A,e,t,r){return A instanceof ns?function(s,i,o,a){if(!eo(s.precondition,i))return o;const l=s.value.clone(),u=Ug(s.fieldTransforms,a,i);return l.setAll(u),i.convertToFoundDocument(i.version,l).setHasLocalMutations(),null}(A,e,t,r):A instanceof SA?function(s,i,o,a){if(!eo(s.precondition,i))return o;const l=Ug(s.fieldTransforms,a,i),u=i.data;return u.setAll(vg(s)),u.setAll(l),i.convertToFoundDocument(i.version,u).setHasLocalMutations(),o===null?null:o.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(d=>d.field))}(A,e,t,r):function(s,i,o){return eo(s.precondition,i)?(i.convertToNoDocument(i.version).setHasLocalMutations(),null):o}(A,e,t)}function yI(A,e){let t=null;for(const r of A.fieldTransforms){const n=e.data.field(r.field),s=wg(r.transform,n||null);s!=null&&(t===null&&(t=at.empty()),t.set(r.field,s))}return t||null}function Eg(A,e){return A.type===e.type&&!!A.key.isEqual(e.key)&&!!A.precondition.isEqual(e.precondition)&&!!function(r,n){return r===void 0&&n===void 0||!(!r||!n)&&Or(r,n,(s,i)=>wI(s,i))}(A.fieldTransforms,e.fieldTransforms)&&(A.type===0?A.value.isEqual(e.value):A.type!==1||A.data.isEqual(e.data)&&A.fieldMask.isEqual(e.fieldMask))}class ns extends to{constructor(e,t,r,n=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}}class SA extends to{constructor(e,t,r,n,s=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=n,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function vg(A){const e=new Map;return A.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const r=A.data.field(t);e.set(t,r)}}),e}function bg(A,e,t){const r=new Map;ae(A.length===t.length);for(let n=0;n<t.length;n++){const s=A[n],i=s.transform,o=e.data.field(s.field);r.set(s.field,pI(i,o,t[n]))}return r}function Ug(A,e,t){const r=new Map;for(const n of A){const s=n.transform,i=t.data.field(n.field);r.set(n.field,gI(s,i,e))}return r}class Pc extends to{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class CI extends to{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
1733
+ */class zi{constructor(){this._=void 0}}function gI(A,e,t){return A instanceof Xi?function(n,s){const i={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:n.seconds,nanos:n.nanoseconds}}}};return s&&bc(s)&&(s=Uc(s)),s&&(i.fields.__previous_value__=s),{mapValue:i}}(t,e):A instanceof ts?mg(A,e):A instanceof As?Bg(A,e):function(n,s){const i=wg(n,s),o=yg(i)+yg(n.Pe);return Ic(i)&&Ic(n.Pe)?pg(o):Hc(n.serializer,o)}(A,e)}function pI(A,e,t){return A instanceof ts?mg(A,e):A instanceof As?Bg(A,e):t}function wg(A,e){return A instanceof Yi?function(r){return Ic(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class Xi extends zi{}class ts extends zi{constructor(e){super(),this.elements=e}}function mg(A,e){const t=Cg(e);for(const r of A.elements)t.some(n=>qt(n,r))||t.push(r);return{arrayValue:{values:t}}}class As extends zi{constructor(e){super(),this.elements=e}}function Bg(A,e){let t=Cg(e);for(const r of A.elements)t=t.filter(n=>!qt(n,r));return{arrayValue:{values:t}}}class Yi extends zi{constructor(e,t){super(),this.serializer=e,this.Pe=t}}function yg(A){return Ue(A.integerValue||A.doubleValue)}function Cg(A){return Fc(A)&&A.arrayValue.values?A.arrayValue.values.slice():[]}function wI(A,e){return A.field.isEqual(e.field)&&function(r,n){return r instanceof ts&&n instanceof ts||r instanceof As&&n instanceof As?Pr(r.elements,n.elements,qt):r instanceof Yi&&n instanceof Yi?qt(r.Pe,n.Pe):r instanceof Xi&&n instanceof Xi}(A.transform,e.transform)}class mI{constructor(e,t){this.version=e,this.transformResults=t}}class xt{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new xt}static exists(e){return new xt(void 0,e)}static updateTime(e){return new xt(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Zi(A,e){return A.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(A.updateTime):A.exists===void 0||A.exists===e.isFoundDocument()}class eo{}function _g(A,e){if(!A.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return A.isNoDocument()?new Oc(A.key,xt.none()):new ns(A.key,A.data,xt.none());{const t=A.data,r=at.empty();let n=new Ke(Me.comparator);for(let s of e.fields)if(!n.has(s)){let i=t.field(s);i===null&&s.length>1&&(s=s.popLast(),i=t.field(s)),i===null?r.delete(s):r.set(s,i),n=n.add(s)}return new SA(A.key,r,new dt(n.toArray()),xt.none())}}function BI(A,e,t){A instanceof ns?function(n,s,i){const o=n.value.clone(),a=bg(n.fieldTransforms,s,i.transformResults);o.setAll(a),s.convertToFoundDocument(i.version,o).setHasCommittedMutations()}(A,e,t):A instanceof SA?function(n,s,i){if(!Zi(n.precondition,s))return void s.convertToUnknownDocument(i.version);const o=bg(n.fieldTransforms,s,i.transformResults),a=s.data;a.setAll(vg(n)),a.setAll(o),s.convertToFoundDocument(i.version,a).setHasCommittedMutations()}(A,e,t):function(n,s,i){s.convertToNoDocument(i.version).setHasCommittedMutations()}(0,e,t)}function rs(A,e,t,r){return A instanceof ns?function(s,i,o,a){if(!Zi(s.precondition,i))return o;const l=s.value.clone(),u=Ug(s.fieldTransforms,a,i);return l.setAll(u),i.convertToFoundDocument(i.version,l).setHasLocalMutations(),null}(A,e,t,r):A instanceof SA?function(s,i,o,a){if(!Zi(s.precondition,i))return o;const l=Ug(s.fieldTransforms,a,i),u=i.data;return u.setAll(vg(s)),u.setAll(l),i.convertToFoundDocument(i.version,u).setHasLocalMutations(),o===null?null:o.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(d=>d.field))}(A,e,t,r):function(s,i,o){return Zi(s.precondition,i)?(i.convertToNoDocument(i.version).setHasLocalMutations(),null):o}(A,e,t)}function yI(A,e){let t=null;for(const r of A.fieldTransforms){const n=e.data.field(r.field),s=wg(r.transform,n||null);s!=null&&(t===null&&(t=at.empty()),t.set(r.field,s))}return t||null}function Eg(A,e){return A.type===e.type&&!!A.key.isEqual(e.key)&&!!A.precondition.isEqual(e.precondition)&&!!function(r,n){return r===void 0&&n===void 0||!(!r||!n)&&Pr(r,n,(s,i)=>wI(s,i))}(A.fieldTransforms,e.fieldTransforms)&&(A.type===0?A.value.isEqual(e.value):A.type!==1||A.data.isEqual(e.data)&&A.fieldMask.isEqual(e.fieldMask))}class ns extends eo{constructor(e,t,r,n=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=n,this.type=0}getFieldMask(){return null}}class SA extends eo{constructor(e,t,r,n,s=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=n,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function vg(A){const e=new Map;return A.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const r=A.data.field(t);e.set(t,r)}}),e}function bg(A,e,t){const r=new Map;ae(A.length===t.length);for(let n=0;n<t.length;n++){const s=A[n],i=s.transform,o=e.data.field(s.field);r.set(s.field,pI(i,o,t[n]))}return r}function Ug(A,e,t){const r=new Map;for(const n of A){const s=n.transform,i=t.data.field(n.field);r.set(n.field,gI(s,i,e))}return r}class Oc extends eo{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class CI extends eo{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
1734
1734
  * @license
1735
1735
  * Copyright 2017 Google LLC
1736
1736
  *
@@ -1745,7 +1745,7 @@ SPDX-License-Identifier: Apache-2.0
1745
1745
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1746
1746
  * See the License for the specific language governing permissions and
1747
1747
  * limitations under the License.
1748
- */class _I{constructor(e,t,r,n){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=n}applyToRemoteDocument(e,t){const r=t.mutationResults;for(let n=0;n<this.mutations.length;n++){const s=this.mutations[n];s.key.isEqual(e.key)&&BI(s,e,r[n])}}applyToLocalView(e,t){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(t=rs(r,e,t,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(t=rs(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const r=gg();return this.mutations.forEach(n=>{const s=e.get(n.key),i=s.overlayedDocument;let o=this.applyToLocalView(i,s.mutatedFields);o=t.has(n.key)?null:o;const a=_g(i,o);a!==null&&r.set(n.key,a),i.isValidDocument()||i.convertToNoDocument(X.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),ee())}isEqual(e){return this.batchId===e.batchId&&Or(this.mutations,e.mutations,(t,r)=>Eg(t,r))&&Or(this.baseMutations,e.baseMutations,(t,r)=>Eg(t,r))}}class Nc{constructor(e,t,r,n){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=n}static from(e,t,r){ae(e.mutations.length===r.length);let n=function(){return lI}();const s=e.mutations;for(let i=0;i<s.length;i++)n=n.insert(s[i].key,r[i].version);return new Nc(e,t,r,n)}}/**
1748
+ */class _I{constructor(e,t,r,n){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=n}applyToRemoteDocument(e,t){const r=t.mutationResults;for(let n=0;n<this.mutations.length;n++){const s=this.mutations[n];s.key.isEqual(e.key)&&BI(s,e,r[n])}}applyToLocalView(e,t){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(t=rs(r,e,t,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(t=rs(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const r=gg();return this.mutations.forEach(n=>{const s=e.get(n.key),i=s.overlayedDocument;let o=this.applyToLocalView(i,s.mutatedFields);o=t.has(n.key)?null:o;const a=_g(i,o);a!==null&&r.set(n.key,a),i.isValidDocument()||i.convertToNoDocument(X.min())}),r}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),ee())}isEqual(e){return this.batchId===e.batchId&&Pr(this.mutations,e.mutations,(t,r)=>Eg(t,r))&&Pr(this.baseMutations,e.baseMutations,(t,r)=>Eg(t,r))}}class Pc{constructor(e,t,r,n){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=n}static from(e,t,r){ae(e.mutations.length===r.length);let n=function(){return lI}();const s=e.mutations;for(let i=0;i<s.length;i++)n=n.insert(s[i].key,r[i].version);return new Pc(e,t,r,n)}}/**
1749
1749
  * @license
1750
1750
  * Copyright 2022 Google LLC
1751
1751
  *
@@ -1823,7 +1823,7 @@ SPDX-License-Identifier: Apache-2.0
1823
1823
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1824
1824
  * See the License for the specific language governing permissions and
1825
1825
  * limitations under the License.
1826
- */const QI=new ZA([4294967295,4294967295],0);function Ig(A){const e=UI().encode(A),t=new Lf;return t.update(e),new Uint8Array(t.digest())}function Fg(A){const e=new DataView(A.buffer),t=e.getUint32(0,!0),r=e.getUint32(4,!0),n=e.getUint32(8,!0),s=e.getUint32(12,!0);return[new ZA([t,r],0),new ZA([n,s],0)]}class Mc{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new ss(`Invalid padding: ${t}`);if(r<0)throw new ss(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new ss(`Invalid hash count: ${r}`);if(e.length===0&&t!==0)throw new ss(`Invalid padding when bitmap length is 0: ${t}`);this.Ie=8*e.length-t,this.Te=ZA.fromNumber(this.Ie)}Ee(e,t,r){let n=e.add(t.multiply(ZA.fromNumber(r)));return n.compare(QI)===1&&(n=new ZA([n.getBits(0),n.getBits(1)],0)),n.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Ie===0)return!1;const t=Ig(e),[r,n]=Fg(t);for(let s=0;s<this.hashCount;s++){const i=this.Ee(r,n,s);if(!this.de(i))return!1}return!0}static create(e,t,r){const n=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),i=new Mc(s,n,t);return r.forEach(o=>i.insert(o)),i}insert(e){if(this.Ie===0)return;const t=Ig(e),[r,n]=Fg(t);for(let s=0;s<this.hashCount;s++){const i=this.Ee(r,n,s);this.Ae(i)}}Ae(e){const t=Math.floor(e/8),r=e%8;this.bitmap[t]|=1<<r}}class ss extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
1826
+ */const QI=new ZA([4294967295,4294967295],0);function Ig(A){const e=UI().encode(A),t=new Lf;return t.update(e),new Uint8Array(t.digest())}function Fg(A){const e=new DataView(A.buffer),t=e.getUint32(0,!0),r=e.getUint32(4,!0),n=e.getUint32(8,!0),s=e.getUint32(12,!0);return[new ZA([t,r],0),new ZA([n,s],0)]}class Nc{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new ss(`Invalid padding: ${t}`);if(r<0)throw new ss(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new ss(`Invalid hash count: ${r}`);if(e.length===0&&t!==0)throw new ss(`Invalid padding when bitmap length is 0: ${t}`);this.Ie=8*e.length-t,this.Te=ZA.fromNumber(this.Ie)}Ee(e,t,r){let n=e.add(t.multiply(ZA.fromNumber(r)));return n.compare(QI)===1&&(n=new ZA([n.getBits(0),n.getBits(1)],0)),n.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Ie===0)return!1;const t=Ig(e),[r,n]=Fg(t);for(let s=0;s<this.hashCount;s++){const i=this.Ee(r,n,s);if(!this.de(i))return!1}return!0}static create(e,t,r){const n=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),i=new Nc(s,n,t);return r.forEach(o=>i.insert(o)),i}insert(e){if(this.Ie===0)return;const t=Ig(e),[r,n]=Fg(t);for(let s=0;s<this.hashCount;s++){const i=this.Ee(r,n,s);this.Ae(i)}}Ae(e){const t=Math.floor(e/8),r=e%8;this.bitmap[t]|=1<<r}}class ss extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
1827
1827
  * @license
1828
1828
  * Copyright 2017 Google LLC
1829
1829
  *
@@ -1838,7 +1838,7 @@ SPDX-License-Identifier: Apache-2.0
1838
1838
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1839
1839
  * See the License for the specific language governing permissions and
1840
1840
  * limitations under the License.
1841
- */class Ao{constructor(e,t,r,n,s){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=r,this.documentUpdates=n,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,t,r){const n=new Map;return n.set(e,is.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new Ao(X.min(),n,new pe(se),cA(),ee())}}class is{constructor(e,t,r,n,s){this.resumeToken=e,this.current=t,this.addedDocuments=r,this.modifiedDocuments=n,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,t,r){return new is(r,t,ee(),ee(),ee())}}/**
1841
+ */class to{constructor(e,t,r,n,s){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=r,this.documentUpdates=n,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,t,r){const n=new Map;return n.set(e,is.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new to(X.min(),n,new pe(se),cA(),ee())}}class is{constructor(e,t,r,n,s){this.resumeToken=e,this.current=t,this.addedDocuments=r,this.modifiedDocuments=n,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,t,r){return new is(r,t,ee(),ee(),ee())}}/**
1842
1842
  * @license
1843
1843
  * Copyright 2017 Google LLC
1844
1844
  *
@@ -1853,7 +1853,7 @@ SPDX-License-Identifier: Apache-2.0
1853
1853
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1854
1854
  * See the License for the specific language governing permissions and
1855
1855
  * limitations under the License.
1856
- */class ro{constructor(e,t,r,n){this.Re=e,this.removedTargetIds=t,this.key=r,this.Ve=n}}class Tg{constructor(e,t){this.targetId=e,this.me=t}}class Sg{constructor(e,t,r=$e.EMPTY_BYTE_STRING,n=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=n}}class Rg{constructor(){this.fe=0,this.ge=kg(),this.pe=$e.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}ve(){let e=ee(),t=ee(),r=ee();return this.ge.forEach((n,s)=>{switch(s){case 0:e=e.add(n);break;case 2:t=t.add(n);break;case 1:r=r.add(n);break;default:q()}}),new is(this.pe,this.ye,e,t,r)}Ce(){this.we=!1,this.ge=kg()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,ae(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class II{constructor(e){this.Le=e,this.Be=new Map,this.ke=cA(),this.qe=xg(),this.Qe=new pe(se)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,t=>{const r=this.Ge(t);switch(e.state){case 0:this.ze(t)&&r.De(e.resumeToken);break;case 1:r.Oe(),r.Se||r.Ce(),r.De(e.resumeToken);break;case 2:r.Oe(),r.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(r.Ne(),r.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),r.De(e.resumeToken));break;default:q()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach((r,n)=>{this.ze(n)&&t(n)})}He(e){const t=e.targetId,r=e.me.count,n=this.Je(t);if(n){const s=n.target;if(kc(s))if(r===0){const i=new $(s.path);this.Ue(t,i,qe.newNoDocument(i,X.min()))}else ae(r===1);else{const i=this.Ye(t);if(i!==r){const o=this.Ze(e),a=o?this.Xe(o,e,i):1;if(a!==0){this.je(t);const l=a===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,l)}}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:r="",padding:n=0},hashCount:s=0}=t;let i,o;try{i=Ar(r).toUint8Array()}catch(a){if(a instanceof Wf)return Hr("Decoding the base64 bloom filter in existence filter failed ("+a.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw a}try{o=new Mc(i,n,s)}catch(a){return Hr(a instanceof ss?"BloomFilter error: ":"Applying bloom filter failed: ",a),null}return o.Ie===0?null:o}Xe(e,t,r){return t.me.count===r-this.nt(e,t.targetId)?0:2}nt(e,t){const r=this.Le.getRemoteKeysForTarget(t);let n=0;return r.forEach(s=>{const i=this.Le.tt(),o=`projects/${i.projectId}/databases/${i.database}/documents/${s.path.canonicalString()}`;e.mightContain(o)||(this.Ue(t,s,null),n++)}),n}rt(e){const t=new Map;this.Be.forEach((s,i)=>{const o=this.Je(i);if(o){if(s.current&&kc(o.target)){const a=new $(o.target.path);this.ke.get(a)!==null||this.it(i,a)||this.Ue(i,a,qe.newNoDocument(a,e))}s.be&&(t.set(i,s.ve()),s.Ce())}});let r=ee();this.qe.forEach((s,i)=>{let o=!0;i.forEachWhile(a=>{const l=this.Je(a);return!l||l.purpose==="TargetPurposeLimboResolution"||(o=!1,!1)}),o&&(r=r.add(s))}),this.ke.forEach((s,i)=>i.setReadTime(e));const n=new Ao(e,t,this.Qe,this.ke,r);return this.ke=cA(),this.qe=xg(),this.Qe=new pe(se),n}$e(e,t){if(!this.ze(e))return;const r=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,r),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,r){if(!this.ze(e))return;const n=this.Ge(e);this.it(e,t)?n.Fe(t,1):n.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),r&&(this.ke=this.ke.insert(t,r))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new Rg,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new Ke(se),this.qe=this.qe.insert(e,t)),t}ze(e){const t=this.Je(e)!==null;return t||V("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new Rg),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.Ue(e,t,null)})}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function xg(){return new pe($.comparator)}function kg(){return new pe($.comparator)}const FI={asc:"ASCENDING",desc:"DESCENDING"},TI={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},SI={and:"AND",or:"OR"};class RI{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Vc(A,e){return A.useProto3Json||Vi(e)?e:{value:e}}function no(A,e){return A.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Lg(A,e){return A.useProto3Json?e.toBase64():e.toUint8Array()}function xI(A,e){return no(A,e.toTimestamp())}function zt(A){return ae(!!A),X.fromTimestamp(function(t){const r=TA(t);return new De(r.seconds,r.nanos)}(A))}function Kc(A,e){return $c(A,e).canonicalString()}function $c(A,e){const t=function(n){return new de(["projects",n.projectId,"databases",n.database])}(A).child("documents");return e===void 0?t:t.child(e)}function Dg(A){const e=de.fromString(A);return ae(Vg(e)),e}function jc(A,e){return Kc(A.databaseId,e.path)}function Gc(A,e){const t=Dg(e);if(t.get(1)!==A.databaseId.projectId)throw new N(k.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+A.databaseId.projectId);if(t.get(3)!==A.databaseId.database)throw new N(k.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+A.databaseId.database);return new $(Og(t))}function Hg(A,e){return Kc(A.databaseId,e)}function kI(A){const e=Dg(A);return e.length===4?de.emptyPath():Og(e)}function Wc(A){return new de(["projects",A.databaseId.projectId,"databases",A.databaseId.database]).canonicalString()}function Og(A){return ae(A.length>4&&A.get(4)==="documents"),A.popFirst(5)}function Pg(A,e,t){return{name:jc(A,e),fields:t.value.mapValue.fields}}function LI(A,e){let t;if("targetChange"in e){e.targetChange;const r=function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:q()}(e.targetChange.targetChangeType||"NO_CHANGE"),n=e.targetChange.targetIds||[],s=function(l,u){return l.useProto3Json?(ae(u===void 0||typeof u=="string"),$e.fromBase64String(u||"")):(ae(u===void 0||u instanceof Buffer||u instanceof Uint8Array),$e.fromUint8Array(u||new Uint8Array))}(A,e.targetChange.resumeToken),i=e.targetChange.cause,o=i&&function(l){const u=l.code===void 0?k.UNKNOWN:Qg(l.code);return new N(u,l.message||"")}(i);t=new Sg(r,n,s,o||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const n=Gc(A,r.document.name),s=zt(r.document.updateTime),i=r.document.createTime?zt(r.document.createTime):X.min(),o=new at({mapValue:{fields:r.document.fields}}),a=qe.newFoundDocument(n,s,i,o),l=r.targetIds||[],u=r.removedTargetIds||[];t=new ro(l,u,a.key,a)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const n=Gc(A,r.document),s=r.readTime?zt(r.readTime):X.min(),i=qe.newNoDocument(n,s),o=r.removedTargetIds||[];t=new ro([],o,i.key,i)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const n=Gc(A,r.document),s=r.removedTargetIds||[];t=new ro([],s,n,null)}else{if(!("filter"in e))return q();{e.filter;const r=e.filter;r.targetId;const{count:n=0,unchangedNames:s}=r,i=new vI(n,s),o=r.targetId;t=new Tg(o,i)}}return t}function DI(A,e){let t;if(e instanceof ns)t={update:Pg(A,e.key,e.value)};else if(e instanceof Pc)t={delete:jc(A,e.key)};else if(e instanceof SA)t={update:Pg(A,e.key,e.data),updateMask:jI(e.fieldMask)};else{if(!(e instanceof CI))return q();t={verify:jc(A,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>function(s,i){const o=i.transform;if(o instanceof Yi)return{fieldPath:i.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(o instanceof ts)return{fieldPath:i.field.canonicalString(),appendMissingElements:{values:o.elements}};if(o instanceof As)return{fieldPath:i.field.canonicalString(),removeAllFromArray:{values:o.elements}};if(o instanceof Zi)return{fieldPath:i.field.canonicalString(),increment:o.Pe};throw q()}(0,r))),e.precondition.isNone||(t.currentDocument=function(n,s){return s.updateTime!==void 0?{updateTime:xI(n,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:q()}(A,e.precondition)),t}function HI(A,e){return A&&A.length>0?(ae(e!==void 0),A.map(t=>function(n,s){let i=n.updateTime?zt(n.updateTime):zt(s);return i.isEqual(X.min())&&(i=zt(s)),new mI(i,n.transformResults||[])}(t,e))):[]}function OI(A,e){return{documents:[Hg(A,e.path)]}}function PI(A,e){const t={structuredQuery:{}},r=e.path;let n;e.collectionGroup!==null?(n=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=Hg(A,n);const s=function(l){if(l.length!==0)return Mg(Rt.create(l,"and"))}(e.filters);s&&(t.structuredQuery.where=s);const i=function(l){if(l.length!==0)return l.map(u=>function(g){return{field:Kr(g.field),direction:VI(g.dir)}}(u))}(e.orderBy);i&&(t.structuredQuery.orderBy=i);const o=Vc(A,e.limit);return o!==null&&(t.structuredQuery.limit=o),e.startAt&&(t.structuredQuery.startAt=function(l){return{before:l.inclusive,values:l.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(l){return{before:!l.inclusive,values:l.position}}(e.endAt)),{_t:t,parent:n}}function NI(A){let e=kI(A.parent);const t=A.structuredQuery,r=t.from?t.from.length:0;let n=null;if(r>0){ae(r===1);const u=t.from[0];u.allDescendants?n=u.collectionId:e=e.child(u.collectionId)}let s=[];t.where&&(s=function(d){const g=Ng(d);return g instanceof Rt&&ng(g)?g.getFilters():[g]}(t.where));let i=[];t.orderBy&&(i=function(d){return d.map(g=>function(w){return new qi($r(w.field),function(B){switch(B){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(w.direction))}(g))}(t.orderBy));let o=null;t.limit&&(o=function(d){let g;return g=typeof d=="object"?d.value:d,Vi(g)?null:g}(t.limit));let a=null;t.startAt&&(a=function(d){const g=!!d.before,p=d.values||[];return new Wi(p,g)}(t.startAt));let l=null;return t.endAt&&(l=function(d){const g=!d.before,p=d.values||[];return new Wi(p,g)}(t.endAt)),sI(e,n,i,s,o,"F",a,l)}function MI(A,e){const t=function(n){switch(n){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return q()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function Ng(A){return A.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":const r=$r(t.unaryFilter.field);return Fe.create(r,"==",{doubleValue:NaN});case"IS_NULL":const n=$r(t.unaryFilter.field);return Fe.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=$r(t.unaryFilter.field);return Fe.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=$r(t.unaryFilter.field);return Fe.create(i,"!=",{nullValue:"NULL_VALUE"});default:return q()}}(A):A.fieldFilter!==void 0?function(t){return Fe.create($r(t.fieldFilter.field),function(n){switch(n){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return q()}}(t.fieldFilter.op),t.fieldFilter.value)}(A):A.compositeFilter!==void 0?function(t){return Rt.create(t.compositeFilter.filters.map(r=>Ng(r)),function(n){switch(n){case"AND":return"and";case"OR":return"or";default:return q()}}(t.compositeFilter.op))}(A):q()}function VI(A){return FI[A]}function KI(A){return TI[A]}function $I(A){return SI[A]}function Kr(A){return{fieldPath:A.canonicalString()}}function $r(A){return Me.fromServerFormat(A.fieldPath)}function Mg(A){return A instanceof Fe?function(t){if(t.op==="=="){if(Yf(t.value))return{unaryFilter:{field:Kr(t.field),op:"IS_NAN"}};if(Xf(t.value))return{unaryFilter:{field:Kr(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(Yf(t.value))return{unaryFilter:{field:Kr(t.field),op:"IS_NOT_NAN"}};if(Xf(t.value))return{unaryFilter:{field:Kr(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Kr(t.field),op:KI(t.op),value:t.value}}}(A):A instanceof Rt?function(t){const r=t.getFilters().map(n=>Mg(n));return r.length===1?r[0]:{compositeFilter:{op:$I(t.op),filters:r}}}(A):q()}function jI(A){const e=[];return A.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function Vg(A){return A.length>=4&&A.get(0)==="projects"&&A.get(2)==="databases"}/**
1856
+ */class Ao{constructor(e,t,r,n){this.Re=e,this.removedTargetIds=t,this.key=r,this.Ve=n}}class Tg{constructor(e,t){this.targetId=e,this.me=t}}class Sg{constructor(e,t,r=$e.EMPTY_BYTE_STRING,n=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=n}}class Rg{constructor(){this.fe=0,this.ge=kg(),this.pe=$e.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}ve(){let e=ee(),t=ee(),r=ee();return this.ge.forEach((n,s)=>{switch(s){case 0:e=e.add(n);break;case 2:t=t.add(n);break;case 1:r=r.add(n);break;default:q()}}),new is(this.pe,this.ye,e,t,r)}Ce(){this.we=!1,this.ge=kg()}Fe(e,t){this.we=!0,this.ge=this.ge.insert(e,t)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,ae(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class II{constructor(e){this.Le=e,this.Be=new Map,this.ke=cA(),this.qe=xg(),this.Qe=new pe(se)}Ke(e){for(const t of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(t,e.Ve):this.Ue(t,e.key,e.Ve);for(const t of e.removedTargetIds)this.Ue(t,e.key,e.Ve)}We(e){this.forEachTarget(e,t=>{const r=this.Ge(t);switch(e.state){case 0:this.ze(t)&&r.De(e.resumeToken);break;case 1:r.Oe(),r.Se||r.Ce(),r.De(e.resumeToken);break;case 2:r.Oe(),r.Se||this.removeTarget(t);break;case 3:this.ze(t)&&(r.Ne(),r.De(e.resumeToken));break;case 4:this.ze(t)&&(this.je(t),r.De(e.resumeToken));break;default:q()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Be.forEach((r,n)=>{this.ze(n)&&t(n)})}He(e){const t=e.targetId,r=e.me.count,n=this.Je(t);if(n){const s=n.target;if(xc(s))if(r===0){const i=new $(s.path);this.Ue(t,i,qe.newNoDocument(i,X.min()))}else ae(r===1);else{const i=this.Ye(t);if(i!==r){const o=this.Ze(e),a=o?this.Xe(o,e,i):1;if(a!==0){this.je(t);const l=a===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(t,l)}}}}}Ze(e){const t=e.me.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:r="",padding:n=0},hashCount:s=0}=t;let i,o;try{i=Ar(r).toUint8Array()}catch(a){if(a instanceof Wf)return Or("Decoding the base64 bloom filter in existence filter failed ("+a.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw a}try{o=new Nc(i,n,s)}catch(a){return Or(a instanceof ss?"BloomFilter error: ":"Applying bloom filter failed: ",a),null}return o.Ie===0?null:o}Xe(e,t,r){return t.me.count===r-this.nt(e,t.targetId)?0:2}nt(e,t){const r=this.Le.getRemoteKeysForTarget(t);let n=0;return r.forEach(s=>{const i=this.Le.tt(),o=`projects/${i.projectId}/databases/${i.database}/documents/${s.path.canonicalString()}`;e.mightContain(o)||(this.Ue(t,s,null),n++)}),n}rt(e){const t=new Map;this.Be.forEach((s,i)=>{const o=this.Je(i);if(o){if(s.current&&xc(o.target)){const a=new $(o.target.path);this.ke.get(a)!==null||this.it(i,a)||this.Ue(i,a,qe.newNoDocument(a,e))}s.be&&(t.set(i,s.ve()),s.Ce())}});let r=ee();this.qe.forEach((s,i)=>{let o=!0;i.forEachWhile(a=>{const l=this.Je(a);return!l||l.purpose==="TargetPurposeLimboResolution"||(o=!1,!1)}),o&&(r=r.add(s))}),this.ke.forEach((s,i)=>i.setReadTime(e));const n=new to(e,t,this.Qe,this.ke,r);return this.ke=cA(),this.qe=xg(),this.Qe=new pe(se),n}$e(e,t){if(!this.ze(e))return;const r=this.it(e,t.key)?2:0;this.Ge(e).Fe(t.key,r),this.ke=this.ke.insert(t.key,t),this.qe=this.qe.insert(t.key,this.st(t.key).add(e))}Ue(e,t,r){if(!this.ze(e))return;const n=this.Ge(e);this.it(e,t)?n.Fe(t,1):n.Me(t),this.qe=this.qe.insert(t,this.st(t).delete(e)),r&&(this.ke=this.ke.insert(t,r))}removeTarget(e){this.Be.delete(e)}Ye(e){const t=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let t=this.Be.get(e);return t||(t=new Rg,this.Be.set(e,t)),t}st(e){let t=this.qe.get(e);return t||(t=new Ke(se),this.qe=this.qe.insert(e,t)),t}ze(e){const t=this.Je(e)!==null;return t||V("WatchChangeAggregator","Detected inactive target",e),t}Je(e){const t=this.Be.get(e);return t&&t.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new Rg),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.Ue(e,t,null)})}it(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function xg(){return new pe($.comparator)}function kg(){return new pe($.comparator)}const FI={asc:"ASCENDING",desc:"DESCENDING"},TI={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},SI={and:"AND",or:"OR"};class RI{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Mc(A,e){return A.useProto3Json||Mi(e)?e:{value:e}}function ro(A,e){return A.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Lg(A,e){return A.useProto3Json?e.toBase64():e.toUint8Array()}function xI(A,e){return ro(A,e.toTimestamp())}function zt(A){return ae(!!A),X.fromTimestamp(function(t){const r=TA(t);return new De(r.seconds,r.nanos)}(A))}function Vc(A,e){return Kc(A,e).canonicalString()}function Kc(A,e){const t=function(n){return new de(["projects",n.projectId,"databases",n.database])}(A).child("documents");return e===void 0?t:t.child(e)}function Dg(A){const e=de.fromString(A);return ae(Vg(e)),e}function $c(A,e){return Vc(A.databaseId,e.path)}function jc(A,e){const t=Dg(e);if(t.get(1)!==A.databaseId.projectId)throw new N(k.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+A.databaseId.projectId);if(t.get(3)!==A.databaseId.database)throw new N(k.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+A.databaseId.database);return new $(Og(t))}function Hg(A,e){return Vc(A.databaseId,e)}function kI(A){const e=Dg(A);return e.length===4?de.emptyPath():Og(e)}function Gc(A){return new de(["projects",A.databaseId.projectId,"databases",A.databaseId.database]).canonicalString()}function Og(A){return ae(A.length>4&&A.get(4)==="documents"),A.popFirst(5)}function Pg(A,e,t){return{name:$c(A,e),fields:t.value.mapValue.fields}}function LI(A,e){let t;if("targetChange"in e){e.targetChange;const r=function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:q()}(e.targetChange.targetChangeType||"NO_CHANGE"),n=e.targetChange.targetIds||[],s=function(l,u){return l.useProto3Json?(ae(u===void 0||typeof u=="string"),$e.fromBase64String(u||"")):(ae(u===void 0||u instanceof Buffer||u instanceof Uint8Array),$e.fromUint8Array(u||new Uint8Array))}(A,e.targetChange.resumeToken),i=e.targetChange.cause,o=i&&function(l){const u=l.code===void 0?k.UNKNOWN:Qg(l.code);return new N(u,l.message||"")}(i);t=new Sg(r,n,s,o||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const n=jc(A,r.document.name),s=zt(r.document.updateTime),i=r.document.createTime?zt(r.document.createTime):X.min(),o=new at({mapValue:{fields:r.document.fields}}),a=qe.newFoundDocument(n,s,i,o),l=r.targetIds||[],u=r.removedTargetIds||[];t=new Ao(l,u,a.key,a)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const n=jc(A,r.document),s=r.readTime?zt(r.readTime):X.min(),i=qe.newNoDocument(n,s),o=r.removedTargetIds||[];t=new Ao([],o,i.key,i)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const n=jc(A,r.document),s=r.removedTargetIds||[];t=new Ao([],s,n,null)}else{if(!("filter"in e))return q();{e.filter;const r=e.filter;r.targetId;const{count:n=0,unchangedNames:s}=r,i=new vI(n,s),o=r.targetId;t=new Tg(o,i)}}return t}function DI(A,e){let t;if(e instanceof ns)t={update:Pg(A,e.key,e.value)};else if(e instanceof Oc)t={delete:$c(A,e.key)};else if(e instanceof SA)t={update:Pg(A,e.key,e.data),updateMask:jI(e.fieldMask)};else{if(!(e instanceof CI))return q();t={verify:$c(A,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(r=>function(s,i){const o=i.transform;if(o instanceof Xi)return{fieldPath:i.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(o instanceof ts)return{fieldPath:i.field.canonicalString(),appendMissingElements:{values:o.elements}};if(o instanceof As)return{fieldPath:i.field.canonicalString(),removeAllFromArray:{values:o.elements}};if(o instanceof Yi)return{fieldPath:i.field.canonicalString(),increment:o.Pe};throw q()}(0,r))),e.precondition.isNone||(t.currentDocument=function(n,s){return s.updateTime!==void 0?{updateTime:xI(n,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:q()}(A,e.precondition)),t}function HI(A,e){return A&&A.length>0?(ae(e!==void 0),A.map(t=>function(n,s){let i=n.updateTime?zt(n.updateTime):zt(s);return i.isEqual(X.min())&&(i=zt(s)),new mI(i,n.transformResults||[])}(t,e))):[]}function OI(A,e){return{documents:[Hg(A,e.path)]}}function PI(A,e){const t={structuredQuery:{}},r=e.path;let n;e.collectionGroup!==null?(n=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=Hg(A,n);const s=function(l){if(l.length!==0)return Mg(Rt.create(l,"and"))}(e.filters);s&&(t.structuredQuery.where=s);const i=function(l){if(l.length!==0)return l.map(u=>function(g){return{field:$r(g.field),direction:VI(g.dir)}}(u))}(e.orderBy);i&&(t.structuredQuery.orderBy=i);const o=Mc(A,e.limit);return o!==null&&(t.structuredQuery.limit=o),e.startAt&&(t.structuredQuery.startAt=function(l){return{before:l.inclusive,values:l.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(l){return{before:!l.inclusive,values:l.position}}(e.endAt)),{_t:t,parent:n}}function NI(A){let e=kI(A.parent);const t=A.structuredQuery,r=t.from?t.from.length:0;let n=null;if(r>0){ae(r===1);const u=t.from[0];u.allDescendants?n=u.collectionId:e=e.child(u.collectionId)}let s=[];t.where&&(s=function(d){const g=Ng(d);return g instanceof Rt&&ng(g)?g.getFilters():[g]}(t.where));let i=[];t.orderBy&&(i=function(d){return d.map(g=>function(w){return new Wi(jr(w.field),function(B){switch(B){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(w.direction))}(g))}(t.orderBy));let o=null;t.limit&&(o=function(d){let g;return g=typeof d=="object"?d.value:d,Mi(g)?null:g}(t.limit));let a=null;t.startAt&&(a=function(d){const g=!!d.before,p=d.values||[];return new Gi(p,g)}(t.startAt));let l=null;return t.endAt&&(l=function(d){const g=!d.before,p=d.values||[];return new Gi(p,g)}(t.endAt)),sI(e,n,i,s,o,"F",a,l)}function MI(A,e){const t=function(n){switch(n){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return q()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function Ng(A){return A.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":const r=jr(t.unaryFilter.field);return Fe.create(r,"==",{doubleValue:NaN});case"IS_NULL":const n=jr(t.unaryFilter.field);return Fe.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=jr(t.unaryFilter.field);return Fe.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=jr(t.unaryFilter.field);return Fe.create(i,"!=",{nullValue:"NULL_VALUE"});default:return q()}}(A):A.fieldFilter!==void 0?function(t){return Fe.create(jr(t.fieldFilter.field),function(n){switch(n){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return q()}}(t.fieldFilter.op),t.fieldFilter.value)}(A):A.compositeFilter!==void 0?function(t){return Rt.create(t.compositeFilter.filters.map(r=>Ng(r)),function(n){switch(n){case"AND":return"and";case"OR":return"or";default:return q()}}(t.compositeFilter.op))}(A):q()}function VI(A){return FI[A]}function KI(A){return TI[A]}function $I(A){return SI[A]}function $r(A){return{fieldPath:A.canonicalString()}}function jr(A){return Me.fromServerFormat(A.fieldPath)}function Mg(A){return A instanceof Fe?function(t){if(t.op==="=="){if(Yf(t.value))return{unaryFilter:{field:$r(t.field),op:"IS_NAN"}};if(Xf(t.value))return{unaryFilter:{field:$r(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(Yf(t.value))return{unaryFilter:{field:$r(t.field),op:"IS_NOT_NAN"}};if(Xf(t.value))return{unaryFilter:{field:$r(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:$r(t.field),op:KI(t.op),value:t.value}}}(A):A instanceof Rt?function(t){const r=t.getFilters().map(n=>Mg(n));return r.length===1?r[0]:{compositeFilter:{op:$I(t.op),filters:r}}}(A):q()}function jI(A){const e=[];return A.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function Vg(A){return A.length>=4&&A.get(0)==="projects"&&A.get(2)==="databases"}/**
1857
1857
  * @license
1858
1858
  * Copyright 2017 Google LLC
1859
1859
  *
@@ -1883,7 +1883,7 @@ SPDX-License-Identifier: Apache-2.0
1883
1883
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1884
1884
  * See the License for the specific language governing permissions and
1885
1885
  * limitations under the License.
1886
- */class GI{constructor(e){this.ct=e}}function WI(A){const e=NI({parent:A.parent,structuredQuery:A.structuredQuery});return A.limitType==="LAST"?Hc(e,e.limit,"L"):e}/**
1886
+ */class GI{constructor(e){this.ct=e}}function WI(A){const e=NI({parent:A.parent,structuredQuery:A.structuredQuery});return A.limitType==="LAST"?Dc(e,e.limit,"L"):e}/**
1887
1887
  * @license
1888
1888
  * Copyright 2019 Google LLC
1889
1889
  *
@@ -1913,7 +1913,7 @@ SPDX-License-Identifier: Apache-2.0
1913
1913
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1914
1914
  * See the License for the specific language governing permissions and
1915
1915
  * limitations under the License.
1916
- */class jr{constructor(e){this.Ln=e}next(){return this.Ln+=2,this.Ln}static Bn(){return new jr(0)}static kn(){return new jr(-1)}}/**
1916
+ */class Gr{constructor(e){this.Ln=e}next(){return this.Ln+=2,this.Ln}static Bn(){return new Gr(0)}static kn(){return new Gr(-1)}}/**
1917
1917
  * @license
1918
1918
  * Copyright 2017 Google LLC
1919
1919
  *
@@ -1928,7 +1928,7 @@ SPDX-License-Identifier: Apache-2.0
1928
1928
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1929
1929
  * See the License for the specific language governing permissions and
1930
1930
  * limitations under the License.
1931
- */class zI{constructor(){this.changes=new Vr(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,qe.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const r=this.changes.get(t);return r!==void 0?L.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
1931
+ */class zI{constructor(){this.changes=new Kr(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,qe.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const r=this.changes.get(t);return r!==void 0?L.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
1932
1932
  * @license
1933
1933
  * Copyright 2017 Google LLC
1934
1934
  *
@@ -1973,7 +1973,7 @@ SPDX-License-Identifier: Apache-2.0
1973
1973
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1974
1974
  * See the License for the specific language governing permissions and
1975
1975
  * limitations under the License.
1976
- */class YI{constructor(e,t,r,n){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=n}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(n=>(r=n,this.remoteDocumentCache.getEntry(e,t))).next(n=>(r!==null&&rs(r.mutation,n,dt.empty(),De.now()),n))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,ee()).next(()=>r))}getLocalViewOfDocuments(e,t,r=ee()){const n=nr();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,r).next(s=>{let i=Zn();return s.forEach((o,a)=>{i=i.insert(o,a.overlayedDocument)}),i}))}getOverlayedDocuments(e,t){const r=nr();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,ee()))}populateOverlays(e,t,r){const n=[];return r.forEach(s=>{t.has(s)||n.push(s)}),this.documentOverlayCache.getOverlays(e,n).next(s=>{s.forEach((i,o)=>{t.set(i,o)})})}computeViews(e,t,r,n){let s=cA();const i=es(),o=function(){return es()}();return t.forEach((a,l)=>{const u=r.get(l.key);n.has(l.key)&&(u===void 0||u.mutation instanceof SA)?s=s.insert(l.key,l):u!==void 0?(i.set(l.key,u.mutation.getFieldMask()),rs(u.mutation,l,u.mutation.getFieldMask(),De.now())):i.set(l.key,dt.empty())}),this.recalculateAndSaveOverlays(e,s).next(a=>(a.forEach((l,u)=>i.set(l,u)),t.forEach((l,u)=>{var d;return o.set(l,new XI(u,(d=i.get(l))!==null&&d!==void 0?d:null))}),o))}recalculateAndSaveOverlays(e,t){const r=es();let n=new pe((i,o)=>i-o),s=ee();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(i=>{for(const o of i)o.keys().forEach(a=>{const l=t.get(a);if(l===null)return;let u=r.get(a)||dt.empty();u=o.applyToLocalView(l,u),r.set(a,u);const d=(n.get(o.batchId)||ee()).add(a);n=n.insert(o.batchId,d)})}).next(()=>{const i=[],o=n.getReverseIterator();for(;o.hasNext();){const a=o.getNext(),l=a.key,u=a.value,d=gg();u.forEach(g=>{if(!s.has(g)){const p=_g(t.get(g),r.get(g));p!==null&&d.set(g,p),s=s.add(g)}}),i.push(this.documentOverlayCache.saveOverlays(e,l,d))}return L.waitFor(i)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,n){return function(i){return $.isDocumentKey(i.path)&&i.collectionGroup===null&&i.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):lg(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,n):this.getDocumentsMatchingCollectionQuery(e,t,r,n)}getNextDocuments(e,t,r,n){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,n).next(s=>{const i=n-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,n-s.size):L.resolve(nr());let o=-1,a=s;return i.next(l=>L.forEach(l,(u,d)=>(o<d.largestBatchId&&(o=d.largestBatchId),s.get(u)?L.resolve():this.remoteDocumentCache.getEntry(e,u).next(g=>{a=a.insert(u,g)}))).next(()=>this.populateOverlays(e,l,s)).next(()=>this.computeViews(e,a,l,ee())).next(u=>({batchId:o,changes:fg(u)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new $(t)).next(r=>{let n=Zn();return r.isFoundDocument()&&(n=n.insert(r.key,r)),n})}getDocumentsMatchingCollectionGroupQuery(e,t,r,n){const s=t.collectionGroup;let i=Zn();return this.indexManager.getCollectionParents(e,s).next(o=>L.forEach(o,a=>{const l=function(d,g){return new Xn(g,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt)}(t,a.child(s));return this.getDocumentsMatchingCollectionQuery(e,l,r,n).next(u=>{u.forEach((d,g)=>{i=i.insert(d,g)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,r,n){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(i=>(s=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,s,n))).next(i=>{s.forEach((a,l)=>{const u=l.getKey();i.get(u)===null&&(i=i.insert(u,qe.newInvalidDocument(u)))});let o=Zn();return i.forEach((a,l)=>{const u=s.get(a);u!==void 0&&rs(u.mutation,l,dt.empty(),De.now()),zi(t,l)&&(o=o.insert(a,l))}),o})}}/**
1976
+ */class YI{constructor(e,t,r,n){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=n}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next(n=>(r=n,this.remoteDocumentCache.getEntry(e,t))).next(n=>(r!==null&&rs(r.mutation,n,dt.empty(),De.now()),n))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.getLocalViewOfDocuments(e,r,ee()).next(()=>r))}getLocalViewOfDocuments(e,t,r=ee()){const n=nr();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,r).next(s=>{let i=Zn();return s.forEach((o,a)=>{i=i.insert(o,a.overlayedDocument)}),i}))}getOverlayedDocuments(e,t){const r=nr();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,ee()))}populateOverlays(e,t,r){const n=[];return r.forEach(s=>{t.has(s)||n.push(s)}),this.documentOverlayCache.getOverlays(e,n).next(s=>{s.forEach((i,o)=>{t.set(i,o)})})}computeViews(e,t,r,n){let s=cA();const i=es(),o=function(){return es()}();return t.forEach((a,l)=>{const u=r.get(l.key);n.has(l.key)&&(u===void 0||u.mutation instanceof SA)?s=s.insert(l.key,l):u!==void 0?(i.set(l.key,u.mutation.getFieldMask()),rs(u.mutation,l,u.mutation.getFieldMask(),De.now())):i.set(l.key,dt.empty())}),this.recalculateAndSaveOverlays(e,s).next(a=>(a.forEach((l,u)=>i.set(l,u)),t.forEach((l,u)=>{var d;return o.set(l,new XI(u,(d=i.get(l))!==null&&d!==void 0?d:null))}),o))}recalculateAndSaveOverlays(e,t){const r=es();let n=new pe((i,o)=>i-o),s=ee();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(i=>{for(const o of i)o.keys().forEach(a=>{const l=t.get(a);if(l===null)return;let u=r.get(a)||dt.empty();u=o.applyToLocalView(l,u),r.set(a,u);const d=(n.get(o.batchId)||ee()).add(a);n=n.insert(o.batchId,d)})}).next(()=>{const i=[],o=n.getReverseIterator();for(;o.hasNext();){const a=o.getNext(),l=a.key,u=a.value,d=gg();u.forEach(g=>{if(!s.has(g)){const p=_g(t.get(g),r.get(g));p!==null&&d.set(g,p),s=s.add(g)}}),i.push(this.documentOverlayCache.saveOverlays(e,l,d))}return L.waitFor(i)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,t,r,n){return function(i){return $.isDocumentKey(i.path)&&i.collectionGroup===null&&i.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):lg(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,n):this.getDocumentsMatchingCollectionQuery(e,t,r,n)}getNextDocuments(e,t,r,n){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,n).next(s=>{const i=n-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,n-s.size):L.resolve(nr());let o=-1,a=s;return i.next(l=>L.forEach(l,(u,d)=>(o<d.largestBatchId&&(o=d.largestBatchId),s.get(u)?L.resolve():this.remoteDocumentCache.getEntry(e,u).next(g=>{a=a.insert(u,g)}))).next(()=>this.populateOverlays(e,l,s)).next(()=>this.computeViews(e,a,l,ee())).next(u=>({batchId:o,changes:fg(u)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new $(t)).next(r=>{let n=Zn();return r.isFoundDocument()&&(n=n.insert(r.key,r)),n})}getDocumentsMatchingCollectionGroupQuery(e,t,r,n){const s=t.collectionGroup;let i=Zn();return this.indexManager.getCollectionParents(e,s).next(o=>L.forEach(o,a=>{const l=function(d,g){return new Xn(g,null,d.explicitOrderBy.slice(),d.filters.slice(),d.limit,d.limitType,d.startAt,d.endAt)}(t,a.child(s));return this.getDocumentsMatchingCollectionQuery(e,l,r,n).next(u=>{u.forEach((d,g)=>{i=i.insert(d,g)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,r,n){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next(i=>(s=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,s,n))).next(i=>{s.forEach((a,l)=>{const u=l.getKey();i.get(u)===null&&(i=i.insert(u,qe.newInvalidDocument(u)))});let o=Zn();return i.forEach((a,l)=>{const u=s.get(a);u!==void 0&&rs(u.mutation,l,dt.empty(),De.now()),Ji(t,l)&&(o=o.insert(a,l))}),o})}}/**
1977
1977
  * @license
1978
1978
  * Copyright 2020 Google LLC
1979
1979
  *
@@ -2033,7 +2033,7 @@ SPDX-License-Identifier: Apache-2.0
2033
2033
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2034
2034
  * See the License for the specific language governing permissions and
2035
2035
  * limitations under the License.
2036
- */class qc{constructor(){this.Tr=new Ke(Oe.Er),this.dr=new Ke(Oe.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(e,t){const r=new Oe(e,t);this.Tr=this.Tr.add(r),this.dr=this.dr.add(r)}Rr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.Vr(new Oe(e,t))}mr(e,t){e.forEach(r=>this.removeReference(r,t))}gr(e){const t=new $(new de([])),r=new Oe(t,e),n=new Oe(t,e+1),s=[];return this.dr.forEachInRange([r,n],i=>{this.Vr(i),s.push(i.key)}),s}pr(){this.Tr.forEach(e=>this.Vr(e))}Vr(e){this.Tr=this.Tr.delete(e),this.dr=this.dr.delete(e)}yr(e){const t=new $(new de([])),r=new Oe(t,e),n=new Oe(t,e+1);let s=ee();return this.dr.forEachInRange([r,n],i=>{s=s.add(i.key)}),s}containsKey(e){const t=new Oe(e,0),r=this.Tr.firstAfterOrEqual(t);return r!==null&&e.isEqual(r.key)}}class Oe{constructor(e,t){this.key=e,this.wr=t}static Er(e,t){return $.comparator(e.key,t.key)||se(e.wr,t.wr)}static Ar(e,t){return se(e.wr,t.wr)||$.comparator(e.key,t.key)}}/**
2036
+ */class Wc{constructor(){this.Tr=new Ke(Oe.Er),this.dr=new Ke(Oe.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(e,t){const r=new Oe(e,t);this.Tr=this.Tr.add(r),this.dr=this.dr.add(r)}Rr(e,t){e.forEach(r=>this.addReference(r,t))}removeReference(e,t){this.Vr(new Oe(e,t))}mr(e,t){e.forEach(r=>this.removeReference(r,t))}gr(e){const t=new $(new de([])),r=new Oe(t,e),n=new Oe(t,e+1),s=[];return this.dr.forEachInRange([r,n],i=>{this.Vr(i),s.push(i.key)}),s}pr(){this.Tr.forEach(e=>this.Vr(e))}Vr(e){this.Tr=this.Tr.delete(e),this.dr=this.dr.delete(e)}yr(e){const t=new $(new de([])),r=new Oe(t,e),n=new Oe(t,e+1);let s=ee();return this.dr.forEachInRange([r,n],i=>{s=s.add(i.key)}),s}containsKey(e){const t=new Oe(e,0),r=this.Tr.firstAfterOrEqual(t);return r!==null&&e.isEqual(r.key)}}class Oe{constructor(e,t){this.key=e,this.wr=t}static Er(e,t){return $.comparator(e.key,t.key)||se(e.wr,t.wr)}static Ar(e,t){return se(e.wr,t.wr)||$.comparator(e.key,t.key)}}/**
2037
2037
  * @license
2038
2038
  * Copyright 2017 Google LLC
2039
2039
  *
@@ -2063,7 +2063,7 @@ SPDX-License-Identifier: Apache-2.0
2063
2063
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2064
2064
  * See the License for the specific language governing permissions and
2065
2065
  * limitations under the License.
2066
- */class rF{constructor(e){this.Mr=e,this.docs=function(){return new pe($.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const r=t.key,n=this.docs.get(r),s=n?n.size:0,i=this.Mr(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:i}),this.size+=i-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const r=this.docs.get(t);return L.resolve(r?r.document.mutableCopy():qe.newInvalidDocument(t))}getEntries(e,t){let r=cA();return t.forEach(n=>{const s=this.docs.get(n);r=r.insert(n,s?s.document.mutableCopy():qe.newInvalidDocument(n))}),L.resolve(r)}getDocumentsMatchingQuery(e,t,r,n){let s=cA();const i=t.path,o=new $(i.child("")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){const{key:l,value:{document:u}}=a.getNext();if(!i.isPrefixOf(l.path))break;l.path.length>i.length+1||NQ(PQ(u),r)<=0||(n.has(u.key)||zi(t,u))&&(s=s.insert(u.key,u.mutableCopy()))}return L.resolve(s)}getAllFromCollectionGroup(e,t,r,n){q()}Or(e,t){return L.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new nF(this)}getSize(e){return L.resolve(this.size)}}class nF extends zI{constructor(e){super(),this.cr=e}applyChanges(e){const t=[];return this.changes.forEach((r,n)=>{n.isValidDocument()?t.push(this.cr.addEntry(e,n)):this.cr.removeEntry(r)}),L.waitFor(t)}getFromCache(e,t){return this.cr.getEntry(e,t)}getAllFromCache(e,t){return this.cr.getEntries(e,t)}}/**
2066
+ */class rF{constructor(e){this.Mr=e,this.docs=function(){return new pe($.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const r=t.key,n=this.docs.get(r),s=n?n.size:0,i=this.Mr(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:i}),this.size+=i-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const r=this.docs.get(t);return L.resolve(r?r.document.mutableCopy():qe.newInvalidDocument(t))}getEntries(e,t){let r=cA();return t.forEach(n=>{const s=this.docs.get(n);r=r.insert(n,s?s.document.mutableCopy():qe.newInvalidDocument(n))}),L.resolve(r)}getDocumentsMatchingQuery(e,t,r,n){let s=cA();const i=t.path,o=new $(i.child("")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){const{key:l,value:{document:u}}=a.getNext();if(!i.isPrefixOf(l.path))break;l.path.length>i.length+1||NQ(PQ(u),r)<=0||(n.has(u.key)||Ji(t,u))&&(s=s.insert(u.key,u.mutableCopy()))}return L.resolve(s)}getAllFromCollectionGroup(e,t,r,n){q()}Or(e,t){return L.forEach(this.docs,r=>t(r))}newChangeBuffer(e){return new nF(this)}getSize(e){return L.resolve(this.size)}}class nF extends zI{constructor(e){super(),this.cr=e}applyChanges(e){const t=[];return this.changes.forEach((r,n)=>{n.isValidDocument()?t.push(this.cr.addEntry(e,n)):this.cr.removeEntry(r)}),L.waitFor(t)}getFromCache(e,t){return this.cr.getEntry(e,t)}getAllFromCache(e,t){return this.cr.getEntries(e,t)}}/**
2067
2067
  * @license
2068
2068
  * Copyright 2017 Google LLC
2069
2069
  *
@@ -2078,7 +2078,7 @@ SPDX-License-Identifier: Apache-2.0
2078
2078
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2079
2079
  * See the License for the specific language governing permissions and
2080
2080
  * limitations under the License.
2081
- */class sF{constructor(e){this.persistence=e,this.Nr=new Vr(t=>Rc(t),xc),this.lastRemoteSnapshotVersion=X.min(),this.highestTargetId=0,this.Lr=0,this.Br=new qc,this.targetCount=0,this.kr=jr.Bn()}forEachTarget(e,t){return this.Nr.forEach((r,n)=>t(n)),L.resolve()}getLastRemoteSnapshotVersion(e){return L.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return L.resolve(this.Lr)}allocateTargetId(e){return this.highestTargetId=this.kr.next(),L.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.Lr&&(this.Lr=t),L.resolve()}Kn(e){this.Nr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.kr=new jr(t),this.highestTargetId=t),e.sequenceNumber>this.Lr&&(this.Lr=e.sequenceNumber)}addTargetData(e,t){return this.Kn(t),this.targetCount+=1,L.resolve()}updateTargetData(e,t){return this.Kn(t),L.resolve()}removeTargetData(e,t){return this.Nr.delete(t.target),this.Br.gr(t.targetId),this.targetCount-=1,L.resolve()}removeTargets(e,t,r){let n=0;const s=[];return this.Nr.forEach((i,o)=>{o.sequenceNumber<=t&&r.get(o.targetId)===null&&(this.Nr.delete(i),s.push(this.removeMatchingKeysForTargetId(e,o.targetId)),n++)}),L.waitFor(s).next(()=>n)}getTargetCount(e){return L.resolve(this.targetCount)}getTargetData(e,t){const r=this.Nr.get(t)||null;return L.resolve(r)}addMatchingKeys(e,t,r){return this.Br.Rr(t,r),L.resolve()}removeMatchingKeys(e,t,r){this.Br.mr(t,r);const n=this.persistence.referenceDelegate,s=[];return n&&t.forEach(i=>{s.push(n.markPotentiallyOrphaned(e,i))}),L.waitFor(s)}removeMatchingKeysForTargetId(e,t){return this.Br.gr(t),L.resolve()}getMatchingKeysForTargetId(e,t){const r=this.Br.yr(t);return L.resolve(r)}containsKey(e,t){return L.resolve(this.Br.containsKey(t))}}/**
2081
+ */class sF{constructor(e){this.persistence=e,this.Nr=new Kr(t=>Sc(t),Rc),this.lastRemoteSnapshotVersion=X.min(),this.highestTargetId=0,this.Lr=0,this.Br=new Wc,this.targetCount=0,this.kr=Gr.Bn()}forEachTarget(e,t){return this.Nr.forEach((r,n)=>t(n)),L.resolve()}getLastRemoteSnapshotVersion(e){return L.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return L.resolve(this.Lr)}allocateTargetId(e){return this.highestTargetId=this.kr.next(),L.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.Lr&&(this.Lr=t),L.resolve()}Kn(e){this.Nr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.kr=new Gr(t),this.highestTargetId=t),e.sequenceNumber>this.Lr&&(this.Lr=e.sequenceNumber)}addTargetData(e,t){return this.Kn(t),this.targetCount+=1,L.resolve()}updateTargetData(e,t){return this.Kn(t),L.resolve()}removeTargetData(e,t){return this.Nr.delete(t.target),this.Br.gr(t.targetId),this.targetCount-=1,L.resolve()}removeTargets(e,t,r){let n=0;const s=[];return this.Nr.forEach((i,o)=>{o.sequenceNumber<=t&&r.get(o.targetId)===null&&(this.Nr.delete(i),s.push(this.removeMatchingKeysForTargetId(e,o.targetId)),n++)}),L.waitFor(s).next(()=>n)}getTargetCount(e){return L.resolve(this.targetCount)}getTargetData(e,t){const r=this.Nr.get(t)||null;return L.resolve(r)}addMatchingKeys(e,t,r){return this.Br.Rr(t,r),L.resolve()}removeMatchingKeys(e,t,r){this.Br.mr(t,r);const n=this.persistence.referenceDelegate,s=[];return n&&t.forEach(i=>{s.push(n.markPotentiallyOrphaned(e,i))}),L.waitFor(s)}removeMatchingKeysForTargetId(e,t){return this.Br.gr(t),L.resolve()}getMatchingKeysForTargetId(e,t){const r=this.Br.yr(t);return L.resolve(r)}containsKey(e,t){return L.resolve(this.Br.containsKey(t))}}/**
2082
2082
  * @license
2083
2083
  * Copyright 2017 Google LLC
2084
2084
  *
@@ -2093,7 +2093,7 @@ SPDX-License-Identifier: Apache-2.0
2093
2093
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2094
2094
  * See the License for the specific language governing permissions and
2095
2095
  * limitations under the License.
2096
- */class iF{constructor(e,t){this.qr={},this.overlays={},this.Qr=new bc(0),this.Kr=!1,this.Kr=!0,this.$r=new tF,this.referenceDelegate=e(this),this.Ur=new sF(this),this.indexManager=new qI,this.remoteDocumentCache=function(n){return new rF(n)}(r=>this.referenceDelegate.Wr(r)),this.serializer=new GI(t),this.Gr=new ZI(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new eF,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.qr[e.toKey()];return r||(r=new AF(t,this.referenceDelegate),this.qr[e.toKey()]=r),r}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(e,t,r){V("MemoryPersistence","Starting transaction:",e);const n=new oF(this.Qr.next());return this.referenceDelegate.zr(),r(n).next(s=>this.referenceDelegate.jr(n).next(()=>s)).toPromise().then(s=>(n.raiseOnCommittedEvent(),s))}Hr(e,t){return L.or(Object.values(this.qr).map(r=>()=>r.containsKey(e,t)))}}class oF extends VQ{constructor(e){super(),this.currentSequenceNumber=e}}class Jc{constructor(e){this.persistence=e,this.Jr=new qc,this.Yr=null}static Zr(e){return new Jc(e)}get Xr(){if(this.Yr)return this.Yr;throw q()}addReference(e,t,r){return this.Jr.addReference(r,t),this.Xr.delete(r.toString()),L.resolve()}removeReference(e,t,r){return this.Jr.removeReference(r,t),this.Xr.add(r.toString()),L.resolve()}markPotentiallyOrphaned(e,t){return this.Xr.add(t.toString()),L.resolve()}removeTarget(e,t){this.Jr.gr(t.targetId).forEach(n=>this.Xr.add(n.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(n=>{n.forEach(s=>this.Xr.add(s.toString()))}).next(()=>r.removeTargetData(e,t))}zr(){this.Yr=new Set}jr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return L.forEach(this.Xr,r=>{const n=$.fromPath(r);return this.ei(e,n).next(s=>{s||t.removeEntry(n,X.min())})}).next(()=>(this.Yr=null,t.apply(e)))}updateLimboDocument(e,t){return this.ei(e,t).next(r=>{r?this.Xr.delete(t.toString()):this.Xr.add(t.toString())})}Wr(e){return 0}ei(e,t){return L.or([()=>L.resolve(this.Jr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Hr(e,t)])}}/**
2096
+ */class iF{constructor(e,t){this.qr={},this.overlays={},this.Qr=new vc(0),this.Kr=!1,this.Kr=!0,this.$r=new tF,this.referenceDelegate=e(this),this.Ur=new sF(this),this.indexManager=new qI,this.remoteDocumentCache=function(n){return new rF(n)}(r=>this.referenceDelegate.Wr(r)),this.serializer=new GI(t),this.Gr=new ZI(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new eF,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.qr[e.toKey()];return r||(r=new AF(t,this.referenceDelegate),this.qr[e.toKey()]=r),r}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(e,t,r){V("MemoryPersistence","Starting transaction:",e);const n=new oF(this.Qr.next());return this.referenceDelegate.zr(),r(n).next(s=>this.referenceDelegate.jr(n).next(()=>s)).toPromise().then(s=>(n.raiseOnCommittedEvent(),s))}Hr(e,t){return L.or(Object.values(this.qr).map(r=>()=>r.containsKey(e,t)))}}class oF extends VQ{constructor(e){super(),this.currentSequenceNumber=e}}class qc{constructor(e){this.persistence=e,this.Jr=new Wc,this.Yr=null}static Zr(e){return new qc(e)}get Xr(){if(this.Yr)return this.Yr;throw q()}addReference(e,t,r){return this.Jr.addReference(r,t),this.Xr.delete(r.toString()),L.resolve()}removeReference(e,t,r){return this.Jr.removeReference(r,t),this.Xr.add(r.toString()),L.resolve()}markPotentiallyOrphaned(e,t){return this.Xr.add(t.toString()),L.resolve()}removeTarget(e,t){this.Jr.gr(t.targetId).forEach(n=>this.Xr.add(n.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next(n=>{n.forEach(s=>this.Xr.add(s.toString()))}).next(()=>r.removeTargetData(e,t))}zr(){this.Yr=new Set}jr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return L.forEach(this.Xr,r=>{const n=$.fromPath(r);return this.ei(e,n).next(s=>{s||t.removeEntry(n,X.min())})}).next(()=>(this.Yr=null,t.apply(e)))}updateLimboDocument(e,t){return this.ei(e,t).next(r=>{r?this.Xr.delete(t.toString()):this.Xr.add(t.toString())})}Wr(e){return 0}ei(e,t){return L.or([()=>L.resolve(this.Jr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Hr(e,t)])}}/**
2097
2097
  * @license
2098
2098
  * Copyright 2017 Google LLC
2099
2099
  *
@@ -2108,7 +2108,7 @@ SPDX-License-Identifier: Apache-2.0
2108
2108
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2109
2109
  * See the License for the specific language governing permissions and
2110
2110
  * limitations under the License.
2111
- */class zc{constructor(e,t,r,n){this.targetId=e,this.fromCache=t,this.$i=r,this.Ui=n}static Wi(e,t){let r=ee(),n=ee();for(const s of t.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:n=n.add(s.doc.key)}return new zc(e,t.fromCache,r,n)}}/**
2111
+ */class Jc{constructor(e,t,r,n){this.targetId=e,this.fromCache=t,this.$i=r,this.Ui=n}static Wi(e,t){let r=ee(),n=ee();for(const s of t.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:n=n.add(s.doc.key)}return new Jc(e,t.fromCache,r,n)}}/**
2112
2112
  * @license
2113
2113
  * Copyright 2023 Google LLC
2114
2114
  *
@@ -2138,7 +2138,7 @@ SPDX-License-Identifier: Apache-2.0
2138
2138
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2139
2139
  * See the License for the specific language governing permissions and
2140
2140
  * limitations under the License.
2141
- */class cF{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return dU()?8:KQ(uU())>0?6:4}()}initialize(e,t){this.Ji=e,this.indexManager=t,this.Gi=!0}getDocumentsMatchingQuery(e,t,r,n){const s={result:null};return this.Yi(e,t).next(i=>{s.result=i}).next(()=>{if(!s.result)return this.Zi(e,t,n,r).next(i=>{s.result=i})}).next(()=>{if(s.result)return;const i=new aF;return this.Xi(e,t,i).next(o=>{if(s.result=o,this.zi)return this.es(e,t,i,o.size)})}).next(()=>s.result)}es(e,t,r,n){return r.documentReadCount<this.ji?(Kn()<=ne.DEBUG&&V("QueryEngine","SDK will not create cache indexes for query:",Mr(t),"since it only creates cache indexes for collection contains","more than or equal to",this.ji,"documents"),L.resolve()):(Kn()<=ne.DEBUG&&V("QueryEngine","Query:",Mr(t),"scans",r.documentReadCount,"local documents and returns",n,"documents as results."),r.documentReadCount>this.Hi*n?(Kn()<=ne.DEBUG&&V("QueryEngine","The SDK decides to create cache indexes for query:",Mr(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Jt(t))):L.resolve())}Yi(e,t){if(cg(t))return L.resolve(null);let r=Jt(t);return this.indexManager.getIndexType(e,r).next(n=>n===0?null:(t.limit!==null&&n===1&&(t=Hc(t,null,"F"),r=Jt(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const i=ee(...s);return this.Ji.getDocuments(e,i).next(o=>this.indexManager.getMinOffset(e,r).next(a=>{const l=this.ts(t,o);return this.ns(t,l,i,a.readTime)?this.Yi(e,Hc(t,null,"F")):this.rs(e,l,t,a)}))})))}Zi(e,t,r,n){return cg(t)||n.isEqual(X.min())?L.resolve(null):this.Ji.getDocuments(e,r).next(s=>{const i=this.ts(t,s);return this.ns(t,i,r,n)?L.resolve(null):(Kn()<=ne.DEBUG&&V("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Mr(t)),this.rs(e,i,t,OQ(n,-1)).next(o=>o))})}ts(e,t){let r=new Ke(hg(e));return t.forEach((n,s)=>{zi(e,s)&&(r=r.add(s))}),r}ns(e,t,r,n){if(e.limit===null)return!1;if(r.size!==t.size)return!0;const s=e.limitType==="F"?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(n)>0)}Xi(e,t,r){return Kn()<=ne.DEBUG&&V("QueryEngine","Using full collection scan to execute query:",Mr(t)),this.Ji.getDocumentsMatchingQuery(e,t,FA.min(),r)}rs(e,t,r,n){return this.Ji.getDocumentsMatchingQuery(e,r,n).next(s=>(t.forEach(i=>{s=s.insert(i.key,i)}),s))}}/**
2141
+ */class cF{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return dU()?8:KQ(uU())>0?6:4}()}initialize(e,t){this.Ji=e,this.indexManager=t,this.Gi=!0}getDocumentsMatchingQuery(e,t,r,n){const s={result:null};return this.Yi(e,t).next(i=>{s.result=i}).next(()=>{if(!s.result)return this.Zi(e,t,n,r).next(i=>{s.result=i})}).next(()=>{if(s.result)return;const i=new aF;return this.Xi(e,t,i).next(o=>{if(s.result=o,this.zi)return this.es(e,t,i,o.size)})}).next(()=>s.result)}es(e,t,r,n){return r.documentReadCount<this.ji?(Kn()<=ne.DEBUG&&V("QueryEngine","SDK will not create cache indexes for query:",Vr(t),"since it only creates cache indexes for collection contains","more than or equal to",this.ji,"documents"),L.resolve()):(Kn()<=ne.DEBUG&&V("QueryEngine","Query:",Vr(t),"scans",r.documentReadCount,"local documents and returns",n,"documents as results."),r.documentReadCount>this.Hi*n?(Kn()<=ne.DEBUG&&V("QueryEngine","The SDK decides to create cache indexes for query:",Vr(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Jt(t))):L.resolve())}Yi(e,t){if(cg(t))return L.resolve(null);let r=Jt(t);return this.indexManager.getIndexType(e,r).next(n=>n===0?null:(t.limit!==null&&n===1&&(t=Dc(t,null,"F"),r=Jt(t)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const i=ee(...s);return this.Ji.getDocuments(e,i).next(o=>this.indexManager.getMinOffset(e,r).next(a=>{const l=this.ts(t,o);return this.ns(t,l,i,a.readTime)?this.Yi(e,Dc(t,null,"F")):this.rs(e,l,t,a)}))})))}Zi(e,t,r,n){return cg(t)||n.isEqual(X.min())?L.resolve(null):this.Ji.getDocuments(e,r).next(s=>{const i=this.ts(t,s);return this.ns(t,i,r,n)?L.resolve(null):(Kn()<=ne.DEBUG&&V("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Vr(t)),this.rs(e,i,t,OQ(n,-1)).next(o=>o))})}ts(e,t){let r=new Ke(hg(e));return t.forEach((n,s)=>{Ji(e,s)&&(r=r.add(s))}),r}ns(e,t,r,n){if(e.limit===null)return!1;if(r.size!==t.size)return!0;const s=e.limitType==="F"?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(n)>0)}Xi(e,t,r){return Kn()<=ne.DEBUG&&V("QueryEngine","Using full collection scan to execute query:",Vr(t)),this.Ji.getDocumentsMatchingQuery(e,t,FA.min(),r)}rs(e,t,r,n){return this.Ji.getDocumentsMatchingQuery(e,r,n).next(s=>(t.forEach(i=>{s=s.insert(i.key,i)}),s))}}/**
2142
2142
  * @license
2143
2143
  * Copyright 2020 Google LLC
2144
2144
  *
@@ -2153,7 +2153,7 @@ SPDX-License-Identifier: Apache-2.0
2153
2153
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2154
2154
  * See the License for the specific language governing permissions and
2155
2155
  * limitations under the License.
2156
- */class lF{constructor(e,t,r,n){this.persistence=e,this.ss=t,this.serializer=n,this.os=new pe(se),this._s=new Vr(s=>Rc(s),xc),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(r)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new YI(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.os))}}function uF(A,e,t,r){return new lF(A,e,t,r)}async function Kg(A,e){const t=z(A);return await t.persistence.runTransaction("Handle user change","readonly",r=>{let n;return t.mutationQueue.getAllMutationBatches(r).next(s=>(n=s,t.ls(e),t.mutationQueue.getAllMutationBatches(r))).next(s=>{const i=[],o=[];let a=ee();for(const l of n){i.push(l.batchId);for(const u of l.mutations)a=a.add(u.key)}for(const l of s){o.push(l.batchId);for(const u of l.mutations)a=a.add(u.key)}return t.localDocuments.getDocuments(r,a).next(l=>({hs:l,removedBatchIds:i,addedBatchIds:o}))})})}function hF(A,e){const t=z(A);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const n=e.batch.keys(),s=t.cs.newChangeBuffer({trackRemovals:!0});return function(o,a,l,u){const d=l.batch,g=d.keys();let p=L.resolve();return g.forEach(w=>{p=p.next(()=>u.getEntry(a,w)).next(y=>{const B=l.docVersions.get(w);ae(B!==null),y.version.compareTo(B)<0&&(d.applyToRemoteDocument(y,l),y.isValidDocument()&&(y.setReadTime(l.commitVersion),u.addEntry(y)))})}),p.next(()=>o.mutationQueue.removeMutationBatch(a,d))}(t,r,e,s).next(()=>s.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,n,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(o){let a=ee();for(let l=0;l<o.mutationResults.length;++l)o.mutationResults[l].transformResults.length>0&&(a=a.add(o.batch.mutations[l].key));return a}(e))).next(()=>t.localDocuments.getDocuments(r,n))})}function $g(A){const e=z(A);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Ur.getLastRemoteSnapshotVersion(t))}function dF(A,e){const t=z(A),r=e.snapshotVersion;let n=t.os;return t.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const i=t.cs.newChangeBuffer({trackRemovals:!0});n=t.os;const o=[];e.targetChanges.forEach((u,d)=>{const g=n.get(d);if(!g)return;o.push(t.Ur.removeMatchingKeys(s,u.removedDocuments,d).next(()=>t.Ur.addMatchingKeys(s,u.addedDocuments,d)));let p=g.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(d)!==null?p=p.withResumeToken($e.EMPTY_BYTE_STRING,X.min()).withLastLimboFreeSnapshotVersion(X.min()):u.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(u.resumeToken,r)),n=n.insert(d,p),function(y,B,b){return y.resumeToken.approximateByteSize()===0||B.snapshotVersion.toMicroseconds()-y.snapshotVersion.toMicroseconds()>=3e8?!0:b.addedDocuments.size+b.modifiedDocuments.size+b.removedDocuments.size>0}(g,p,u)&&o.push(t.Ur.updateTargetData(s,p))});let a=cA(),l=ee();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&o.push(t.persistence.referenceDelegate.updateLimboDocument(s,u))}),o.push(fF(s,i,e.documentUpdates).next(u=>{a=u.Ps,l=u.Is})),!r.isEqual(X.min())){const u=t.Ur.getLastRemoteSnapshotVersion(s).next(d=>t.Ur.setTargetsMetadata(s,s.currentSequenceNumber,r));o.push(u)}return L.waitFor(o).next(()=>i.apply(s)).next(()=>t.localDocuments.getLocalViewOfDocuments(s,a,l)).next(()=>a)}).then(s=>(t.os=n,s))}function fF(A,e,t){let r=ee(),n=ee();return t.forEach(s=>r=r.add(s)),e.getEntries(A,r).next(s=>{let i=cA();return t.forEach((o,a)=>{const l=s.get(o);a.isFoundDocument()!==l.isFoundDocument()&&(n=n.add(o)),a.isNoDocument()&&a.version.isEqual(X.min())?(e.removeEntry(o,a.readTime),i=i.insert(o,a)):!l.isValidDocument()||a.version.compareTo(l.version)>0||a.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(a),i=i.insert(o,a)):V("LocalStore","Ignoring outdated watch update for ",o,". Current version:",l.version," Watch version:",a.version)}),{Ps:i,Is:n}})}function gF(A,e){const t=z(A);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=-1),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function pF(A,e){const t=z(A);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let n;return t.Ur.getTargetData(r,e).next(s=>s?(n=s,L.resolve(n)):t.Ur.allocateTargetId(r).next(i=>(n=new RA(e,i,"TargetPurposeListen",r.currentSequenceNumber),t.Ur.addTargetData(r,n).next(()=>n))))}).then(r=>{const n=t.os.get(r.targetId);return(n===null||r.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(t.os=t.os.insert(r.targetId,r),t._s.set(e,r.targetId)),r})}async function Xc(A,e,t){const r=z(A),n=r.os.get(e),s=t?"readwrite":"readwrite-primary";try{t||await r.persistence.runTransaction("Release target",s,i=>r.persistence.referenceDelegate.removeTarget(i,n))}catch(i){if(!Gn(i))throw i;V("LocalStore",`Failed to update sequence numbers for target ${e}: ${i}`)}r.os=r.os.remove(e),r._s.delete(n.target)}function jg(A,e,t){const r=z(A);let n=X.min(),s=ee();return r.persistence.runTransaction("Execute query","readwrite",i=>function(a,l,u){const d=z(a),g=d._s.get(u);return g!==void 0?L.resolve(d.os.get(g)):d.Ur.getTargetData(l,u)}(r,i,Jt(e)).next(o=>{if(o)return n=o.lastLimboFreeSnapshotVersion,r.Ur.getMatchingKeysForTargetId(i,o.targetId).next(a=>{s=a})}).next(()=>r.ss.getDocumentsMatchingQuery(i,e,t?n:X.min(),t?s:ee())).next(o=>(wF(r,oI(e),o),{documents:o,Ts:s})))}function wF(A,e,t){let r=A.us.get(e)||X.min();t.forEach((n,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),A.us.set(e,r)}class Gg{constructor(){this.activeTargetIds=dI()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class mF{constructor(){this.so=new Gg,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,t,r){this.oo[e]=t}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new Gg,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
2156
+ */class lF{constructor(e,t,r,n){this.persistence=e,this.ss=t,this.serializer=n,this.os=new pe(se),this._s=new Kr(s=>Sc(s),Rc),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(r)}ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new YI(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.os))}}function uF(A,e,t,r){return new lF(A,e,t,r)}async function Kg(A,e){const t=z(A);return await t.persistence.runTransaction("Handle user change","readonly",r=>{let n;return t.mutationQueue.getAllMutationBatches(r).next(s=>(n=s,t.ls(e),t.mutationQueue.getAllMutationBatches(r))).next(s=>{const i=[],o=[];let a=ee();for(const l of n){i.push(l.batchId);for(const u of l.mutations)a=a.add(u.key)}for(const l of s){o.push(l.batchId);for(const u of l.mutations)a=a.add(u.key)}return t.localDocuments.getDocuments(r,a).next(l=>({hs:l,removedBatchIds:i,addedBatchIds:o}))})})}function hF(A,e){const t=z(A);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const n=e.batch.keys(),s=t.cs.newChangeBuffer({trackRemovals:!0});return function(o,a,l,u){const d=l.batch,g=d.keys();let p=L.resolve();return g.forEach(w=>{p=p.next(()=>u.getEntry(a,w)).next(y=>{const B=l.docVersions.get(w);ae(B!==null),y.version.compareTo(B)<0&&(d.applyToRemoteDocument(y,l),y.isValidDocument()&&(y.setReadTime(l.commitVersion),u.addEntry(y)))})}),p.next(()=>o.mutationQueue.removeMutationBatch(a,d))}(t,r,e,s).next(()=>s.apply(r)).next(()=>t.mutationQueue.performConsistencyCheck(r)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(r,n,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(o){let a=ee();for(let l=0;l<o.mutationResults.length;++l)o.mutationResults[l].transformResults.length>0&&(a=a.add(o.batch.mutations[l].key));return a}(e))).next(()=>t.localDocuments.getDocuments(r,n))})}function $g(A){const e=z(A);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Ur.getLastRemoteSnapshotVersion(t))}function dF(A,e){const t=z(A),r=e.snapshotVersion;let n=t.os;return t.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const i=t.cs.newChangeBuffer({trackRemovals:!0});n=t.os;const o=[];e.targetChanges.forEach((u,d)=>{const g=n.get(d);if(!g)return;o.push(t.Ur.removeMatchingKeys(s,u.removedDocuments,d).next(()=>t.Ur.addMatchingKeys(s,u.addedDocuments,d)));let p=g.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(d)!==null?p=p.withResumeToken($e.EMPTY_BYTE_STRING,X.min()).withLastLimboFreeSnapshotVersion(X.min()):u.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(u.resumeToken,r)),n=n.insert(d,p),function(y,B,b){return y.resumeToken.approximateByteSize()===0||B.snapshotVersion.toMicroseconds()-y.snapshotVersion.toMicroseconds()>=3e8?!0:b.addedDocuments.size+b.modifiedDocuments.size+b.removedDocuments.size>0}(g,p,u)&&o.push(t.Ur.updateTargetData(s,p))});let a=cA(),l=ee();if(e.documentUpdates.forEach(u=>{e.resolvedLimboDocuments.has(u)&&o.push(t.persistence.referenceDelegate.updateLimboDocument(s,u))}),o.push(fF(s,i,e.documentUpdates).next(u=>{a=u.Ps,l=u.Is})),!r.isEqual(X.min())){const u=t.Ur.getLastRemoteSnapshotVersion(s).next(d=>t.Ur.setTargetsMetadata(s,s.currentSequenceNumber,r));o.push(u)}return L.waitFor(o).next(()=>i.apply(s)).next(()=>t.localDocuments.getLocalViewOfDocuments(s,a,l)).next(()=>a)}).then(s=>(t.os=n,s))}function fF(A,e,t){let r=ee(),n=ee();return t.forEach(s=>r=r.add(s)),e.getEntries(A,r).next(s=>{let i=cA();return t.forEach((o,a)=>{const l=s.get(o);a.isFoundDocument()!==l.isFoundDocument()&&(n=n.add(o)),a.isNoDocument()&&a.version.isEqual(X.min())?(e.removeEntry(o,a.readTime),i=i.insert(o,a)):!l.isValidDocument()||a.version.compareTo(l.version)>0||a.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(a),i=i.insert(o,a)):V("LocalStore","Ignoring outdated watch update for ",o,". Current version:",l.version," Watch version:",a.version)}),{Ps:i,Is:n}})}function gF(A,e){const t=z(A);return t.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=-1),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function pF(A,e){const t=z(A);return t.persistence.runTransaction("Allocate target","readwrite",r=>{let n;return t.Ur.getTargetData(r,e).next(s=>s?(n=s,L.resolve(n)):t.Ur.allocateTargetId(r).next(i=>(n=new RA(e,i,"TargetPurposeListen",r.currentSequenceNumber),t.Ur.addTargetData(r,n).next(()=>n))))}).then(r=>{const n=t.os.get(r.targetId);return(n===null||r.snapshotVersion.compareTo(n.snapshotVersion)>0)&&(t.os=t.os.insert(r.targetId,r),t._s.set(e,r.targetId)),r})}async function zc(A,e,t){const r=z(A),n=r.os.get(e),s=t?"readwrite":"readwrite-primary";try{t||await r.persistence.runTransaction("Release target",s,i=>r.persistence.referenceDelegate.removeTarget(i,n))}catch(i){if(!Gn(i))throw i;V("LocalStore",`Failed to update sequence numbers for target ${e}: ${i}`)}r.os=r.os.remove(e),r._s.delete(n.target)}function jg(A,e,t){const r=z(A);let n=X.min(),s=ee();return r.persistence.runTransaction("Execute query","readwrite",i=>function(a,l,u){const d=z(a),g=d._s.get(u);return g!==void 0?L.resolve(d.os.get(g)):d.Ur.getTargetData(l,u)}(r,i,Jt(e)).next(o=>{if(o)return n=o.lastLimboFreeSnapshotVersion,r.Ur.getMatchingKeysForTargetId(i,o.targetId).next(a=>{s=a})}).next(()=>r.ss.getDocumentsMatchingQuery(i,e,t?n:X.min(),t?s:ee())).next(o=>(wF(r,oI(e),o),{documents:o,Ts:s})))}function wF(A,e,t){let r=A.us.get(e)||X.min();t.forEach((n,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),A.us.set(e,r)}class Gg{constructor(){this.activeTargetIds=dI()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class mF{constructor(){this.so=new Gg,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,t,r){this.oo[e]=t}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new Gg,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
2157
2157
  * @license
2158
2158
  * Copyright 2019 Google LLC
2159
2159
  *
@@ -2198,7 +2198,7 @@ SPDX-License-Identifier: Apache-2.0
2198
2198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2199
2199
  * See the License for the specific language governing permissions and
2200
2200
  * limitations under the License.
2201
- */let so=null;function Yc(){return so===null?so=function(){return 268435456+Math.round(2147483648*Math.random())}():so++,"0x"+so.toString(16)}/**
2201
+ */let no=null;function Xc(){return no===null?no=function(){return 268435456+Math.round(2147483648*Math.random())}():no++,"0x"+no.toString(16)}/**
2202
2202
  * @license
2203
2203
  * Copyright 2020 Google LLC
2204
2204
  *
@@ -2243,7 +2243,7 @@ SPDX-License-Identifier: Apache-2.0
2243
2243
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2244
2244
  * See the License for the specific language governing permissions and
2245
2245
  * limitations under the License.
2246
- */const Je="WebChannelConnection";class _F extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const r=t.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Do=r+"://"+t.host,this.vo=`projects/${n}/databases/${s}`,this.Co=this.databaseId.database==="(default)"?`project_id=${n}`:`project_id=${n}&database_id=${s}`}get Fo(){return!1}Mo(t,r,n,s,i){const o=Yc(),a=this.xo(t,r.toUriEncodedString());V("RestConnection",`Sending RPC '${t}' ${o}:`,a,n);const l={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(l,s,i),this.No(t,a,l,n).then(u=>(V("RestConnection",`Received RPC '${t}' ${o}: `,u),u),u=>{throw Hr("RestConnection",`RPC '${t}' ${o} failed with error: `,u,"url: ",a,"request:",n),u})}Lo(t,r,n,s,i,o){return this.Mo(t,r,n,s,i)}Oo(t,r,n){t["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Dr}(),t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((s,i)=>t[i]=s),n&&n.headers.forEach((s,i)=>t[i]=s)}xo(t,r){const n=yF[t];return`${this.Do}/v1/${r}:${n}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,t,r,n){const s=Yc();return new Promise((i,o)=>{const a=new Df;a.setWithCredentials(!0),a.listenOnce(Hf.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case Mi.NO_ERROR:const u=a.getResponseJson();V(Je,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(u)),i(u);break;case Mi.TIMEOUT:V(Je,`RPC '${e}' ${s} timed out`),o(new N(k.DEADLINE_EXCEEDED,"Request time out"));break;case Mi.HTTP_ERROR:const d=a.getStatus();if(V(Je,`RPC '${e}' ${s} failed with status:`,d,"response text:",a.getResponseText()),d>0){let g=a.getResponseJson();Array.isArray(g)&&(g=g[0]);const p=g==null?void 0:g.error;if(p&&p.status&&p.message){const w=function(B){const b=B.toLowerCase().replace(/_/g,"-");return Object.values(k).indexOf(b)>=0?b:k.UNKNOWN}(p.status);o(new N(w,p.message))}else o(new N(k.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new N(k.UNAVAILABLE,"Connection failed."));break;default:q()}}finally{V(Je,`RPC '${e}' ${s} completed.`)}});const l=JSON.stringify(n);V(Je,`RPC '${e}' ${s} sending request:`,n),a.send(t,"POST",l,r,15)})}Bo(e,t,r){const n=Yc(),s=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=Nf(),o=Pf(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(a.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(a.useFetchStreams=!0),this.Oo(a.initMessageHeaders,t,r),a.encodeInitMessageHeaders=!0;const u=s.join("");V(Je,`Creating RPC '${e}' stream ${n}: ${u}`,a);const d=i.createWebChannel(u,a);let g=!1,p=!1;const w=new CF({Io:B=>{p?V(Je,`Not sending because RPC '${e}' stream ${n} is closed:`,B):(g||(V(Je,`Opening RPC '${e}' stream ${n} transport.`),d.open(),g=!0),V(Je,`RPC '${e}' stream ${n} sending:`,B),d.send(B))},To:()=>d.close()}),y=(B,b,S)=>{B.listen(b,I=>{try{S(I)}catch(R){setTimeout(()=>{throw R},0)}})};return y(d,Vn.EventType.OPEN,()=>{p||(V(Je,`RPC '${e}' stream ${n} transport opened.`),w.yo())}),y(d,Vn.EventType.CLOSE,()=>{p||(p=!0,V(Je,`RPC '${e}' stream ${n} transport closed`),w.So())}),y(d,Vn.EventType.ERROR,B=>{p||(p=!0,Hr(Je,`RPC '${e}' stream ${n} transport errored:`,B),w.So(new N(k.UNAVAILABLE,"The operation could not be completed")))}),y(d,Vn.EventType.MESSAGE,B=>{var b;if(!p){const S=B.data[0];ae(!!S);const I=S,R=I.error||((b=I[0])===null||b===void 0?void 0:b.error);if(R){V(Je,`RPC '${e}' stream ${n} received error:`,R);const K=R.status;let P=function(v){const U=Te[v];if(U!==void 0)return Qg(U)}(K),_=R.message;P===void 0&&(P=k.INTERNAL,_="Unknown error status: "+K+" with message "+R.message),p=!0,w.So(new N(P,_)),d.close()}else V(Je,`RPC '${e}' stream ${n} received:`,S),w.bo(S)}}),y(o,Of.STAT_EVENT,B=>{B.stat===Ec.PROXY?V(Je,`RPC '${e}' stream ${n} detected buffering proxy`):B.stat===Ec.NOPROXY&&V(Je,`RPC '${e}' stream ${n} detected no buffering proxy`)}),setTimeout(()=>{w.wo()},0),w}}function Zc(){return typeof document<"u"?document:null}/**
2246
+ */const Je="WebChannelConnection";class _F extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const r=t.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Do=r+"://"+t.host,this.vo=`projects/${n}/databases/${s}`,this.Co=this.databaseId.database==="(default)"?`project_id=${n}`:`project_id=${n}&database_id=${s}`}get Fo(){return!1}Mo(t,r,n,s,i){const o=Xc(),a=this.xo(t,r.toUriEncodedString());V("RestConnection",`Sending RPC '${t}' ${o}:`,a,n);const l={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(l,s,i),this.No(t,a,l,n).then(u=>(V("RestConnection",`Received RPC '${t}' ${o}: `,u),u),u=>{throw Or("RestConnection",`RPC '${t}' ${o} failed with error: `,u,"url: ",a,"request:",n),u})}Lo(t,r,n,s,i,o){return this.Mo(t,r,n,s,i)}Oo(t,r,n){t["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Hr}(),t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),r&&r.headers.forEach((s,i)=>t[i]=s),n&&n.headers.forEach((s,i)=>t[i]=s)}xo(t,r){const n=yF[t];return`${this.Do}/v1/${r}:${n}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,t,r,n){const s=Xc();return new Promise((i,o)=>{const a=new Df;a.setWithCredentials(!0),a.listenOnce(Hf.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case Ni.NO_ERROR:const u=a.getResponseJson();V(Je,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(u)),i(u);break;case Ni.TIMEOUT:V(Je,`RPC '${e}' ${s} timed out`),o(new N(k.DEADLINE_EXCEEDED,"Request time out"));break;case Ni.HTTP_ERROR:const d=a.getStatus();if(V(Je,`RPC '${e}' ${s} failed with status:`,d,"response text:",a.getResponseText()),d>0){let g=a.getResponseJson();Array.isArray(g)&&(g=g[0]);const p=g==null?void 0:g.error;if(p&&p.status&&p.message){const w=function(B){const b=B.toLowerCase().replace(/_/g,"-");return Object.values(k).indexOf(b)>=0?b:k.UNKNOWN}(p.status);o(new N(w,p.message))}else o(new N(k.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new N(k.UNAVAILABLE,"Connection failed."));break;default:q()}}finally{V(Je,`RPC '${e}' ${s} completed.`)}});const l=JSON.stringify(n);V(Je,`RPC '${e}' ${s} sending request:`,n),a.send(t,"POST",l,r,15)})}Bo(e,t,r){const n=Xc(),s=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],i=Nf(),o=Pf(),a={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(a.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(a.useFetchStreams=!0),this.Oo(a.initMessageHeaders,t,r),a.encodeInitMessageHeaders=!0;const u=s.join("");V(Je,`Creating RPC '${e}' stream ${n}: ${u}`,a);const d=i.createWebChannel(u,a);let g=!1,p=!1;const w=new CF({Io:B=>{p?V(Je,`Not sending because RPC '${e}' stream ${n} is closed:`,B):(g||(V(Je,`Opening RPC '${e}' stream ${n} transport.`),d.open(),g=!0),V(Je,`RPC '${e}' stream ${n} sending:`,B),d.send(B))},To:()=>d.close()}),y=(B,b,S)=>{B.listen(b,I=>{try{S(I)}catch(R){setTimeout(()=>{throw R},0)}})};return y(d,Vn.EventType.OPEN,()=>{p||(V(Je,`RPC '${e}' stream ${n} transport opened.`),w.yo())}),y(d,Vn.EventType.CLOSE,()=>{p||(p=!0,V(Je,`RPC '${e}' stream ${n} transport closed`),w.So())}),y(d,Vn.EventType.ERROR,B=>{p||(p=!0,Or(Je,`RPC '${e}' stream ${n} transport errored:`,B),w.So(new N(k.UNAVAILABLE,"The operation could not be completed")))}),y(d,Vn.EventType.MESSAGE,B=>{var b;if(!p){const S=B.data[0];ae(!!S);const I=S,R=I.error||((b=I[0])===null||b===void 0?void 0:b.error);if(R){V(Je,`RPC '${e}' stream ${n} received error:`,R);const K=R.status;let P=function(v){const U=Te[v];if(U!==void 0)return Qg(U)}(K),_=R.message;P===void 0&&(P=k.INTERNAL,_="Unknown error status: "+K+" with message "+R.message),p=!0,w.So(new N(P,_)),d.close()}else V(Je,`RPC '${e}' stream ${n} received:`,S),w.bo(S)}}),y(o,Of.STAT_EVENT,B=>{B.stat===_c.PROXY?V(Je,`RPC '${e}' stream ${n} detected buffering proxy`):B.stat===_c.NOPROXY&&V(Je,`RPC '${e}' stream ${n} detected no buffering proxy`)}),setTimeout(()=>{w.wo()},0),w}}function Yc(){return typeof document<"u"?document:null}/**
2247
2247
  * @license
2248
2248
  * Copyright 2020 Google LLC
2249
2249
  *
@@ -2258,7 +2258,7 @@ SPDX-License-Identifier: Apache-2.0
2258
2258
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2259
2259
  * See the License for the specific language governing permissions and
2260
2260
  * limitations under the License.
2261
- */function io(A){return new RI(A,!0)}/**
2261
+ */function so(A){return new RI(A,!0)}/**
2262
2262
  * @license
2263
2263
  * Copyright 2017 Google LLC
2264
2264
  *
@@ -2288,7 +2288,7 @@ SPDX-License-Identifier: Apache-2.0
2288
2288
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2289
2289
  * See the License for the specific language governing permissions and
2290
2290
  * limitations under the License.
2291
- */class Jg{constructor(e,t,r,n,s,i,o,a){this.ui=e,this.Ho=r,this.Jo=n,this.connection=s,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new qg(e,t)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,t){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():t&&t.code===k.RESOURCE_EXHAUSTED?(aA(t.toString()),aA("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):t&&t.code===k.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(t)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),t=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,n])=>{this.Yo===t&&this.P_(r,n)},r=>{e(()=>{const n=new N(k.UNKNOWN,"Fetching auth token failed: "+r.message);return this.I_(n)})})}P_(e,t){const r=this.h_(this.Yo);this.stream=this.T_(e,t),this.stream.Eo(()=>{r(()=>this.listener.Eo())}),this.stream.Ro(()=>{r(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(n=>{r(()=>this.I_(n))}),this.stream.onMessage(n=>{r(()=>++this.e_==1?this.E_(n):this.onNext(n))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return V("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return t=>{this.ui.enqueueAndForget(()=>this.Yo===e?t():(V("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class EF extends Jg{constructor(e,t,r,n,s,i){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,n,i),this.serializer=s}T_(e,t){return this.connection.Bo("Listen",e,t)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const t=LI(this.serializer,e),r=function(s){if(!("targetChange"in s))return X.min();const i=s.targetChange;return i.targetIds&&i.targetIds.length?X.min():i.readTime?zt(i.readTime):X.min()}(e);return this.listener.d_(t,r)}A_(e){const t={};t.database=Wc(this.serializer),t.addTarget=function(s,i){let o;const a=i.target;if(o=kc(a)?{documents:OI(s,a)}:{query:PI(s,a)._t},o.targetId=i.targetId,i.resumeToken.approximateByteSize()>0){o.resumeToken=Lg(s,i.resumeToken);const l=Vc(s,i.expectedCount);l!==null&&(o.expectedCount=l)}else if(i.snapshotVersion.compareTo(X.min())>0){o.readTime=no(s,i.snapshotVersion.toTimestamp());const l=Vc(s,i.expectedCount);l!==null&&(o.expectedCount=l)}return o}(this.serializer,e);const r=MI(this.serializer,e);r&&(t.labels=r),this.a_(t)}R_(e){const t={};t.database=Wc(this.serializer),t.removeTarget=e,this.a_(t)}}class vF extends Jg{constructor(e,t,r,n,s,i){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,n,i),this.serializer=s}get V_(){return this.e_>0}start(){this.lastStreamToken=void 0,super.start()}l_(){this.V_&&this.m_([])}T_(e,t){return this.connection.Bo("Write",e,t)}E_(e){return ae(!!e.streamToken),this.lastStreamToken=e.streamToken,ae(!e.writeResults||e.writeResults.length===0),this.listener.f_()}onNext(e){ae(!!e.streamToken),this.lastStreamToken=e.streamToken,this.t_.reset();const t=HI(e.writeResults,e.commitTime),r=zt(e.commitTime);return this.listener.g_(r,t)}p_(){const e={};e.database=Wc(this.serializer),this.a_(e)}m_(e){const t={streamToken:this.lastStreamToken,writes:e.map(r=>DI(this.serializer,r))};this.a_(t)}}/**
2291
+ */class Jg{constructor(e,t,r,n,s,i,o,a){this.ui=e,this.Ho=r,this.Jo=n,this.connection=s,this.authCredentialsProvider=i,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new qg(e,t)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,t){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():t&&t.code===k.RESOURCE_EXHAUSTED?(aA(t.toString()),aA("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):t&&t.code===k.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(t)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),t=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,n])=>{this.Yo===t&&this.P_(r,n)},r=>{e(()=>{const n=new N(k.UNKNOWN,"Fetching auth token failed: "+r.message);return this.I_(n)})})}P_(e,t){const r=this.h_(this.Yo);this.stream=this.T_(e,t),this.stream.Eo(()=>{r(()=>this.listener.Eo())}),this.stream.Ro(()=>{r(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(n=>{r(()=>this.I_(n))}),this.stream.onMessage(n=>{r(()=>++this.e_==1?this.E_(n):this.onNext(n))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return V("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return t=>{this.ui.enqueueAndForget(()=>this.Yo===e?t():(V("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class EF extends Jg{constructor(e,t,r,n,s,i){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,n,i),this.serializer=s}T_(e,t){return this.connection.Bo("Listen",e,t)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const t=LI(this.serializer,e),r=function(s){if(!("targetChange"in s))return X.min();const i=s.targetChange;return i.targetIds&&i.targetIds.length?X.min():i.readTime?zt(i.readTime):X.min()}(e);return this.listener.d_(t,r)}A_(e){const t={};t.database=Gc(this.serializer),t.addTarget=function(s,i){let o;const a=i.target;if(o=xc(a)?{documents:OI(s,a)}:{query:PI(s,a)._t},o.targetId=i.targetId,i.resumeToken.approximateByteSize()>0){o.resumeToken=Lg(s,i.resumeToken);const l=Mc(s,i.expectedCount);l!==null&&(o.expectedCount=l)}else if(i.snapshotVersion.compareTo(X.min())>0){o.readTime=ro(s,i.snapshotVersion.toTimestamp());const l=Mc(s,i.expectedCount);l!==null&&(o.expectedCount=l)}return o}(this.serializer,e);const r=MI(this.serializer,e);r&&(t.labels=r),this.a_(t)}R_(e){const t={};t.database=Gc(this.serializer),t.removeTarget=e,this.a_(t)}}class vF extends Jg{constructor(e,t,r,n,s,i){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,n,i),this.serializer=s}get V_(){return this.e_>0}start(){this.lastStreamToken=void 0,super.start()}l_(){this.V_&&this.m_([])}T_(e,t){return this.connection.Bo("Write",e,t)}E_(e){return ae(!!e.streamToken),this.lastStreamToken=e.streamToken,ae(!e.writeResults||e.writeResults.length===0),this.listener.f_()}onNext(e){ae(!!e.streamToken),this.lastStreamToken=e.streamToken,this.t_.reset();const t=HI(e.writeResults,e.commitTime),r=zt(e.commitTime);return this.listener.g_(r,t)}p_(){const e={};e.database=Gc(this.serializer),this.a_(e)}m_(e){const t={streamToken:this.lastStreamToken,writes:e.map(r=>DI(this.serializer,r))};this.a_(t)}}/**
2292
2292
  * @license
2293
2293
  * Copyright 2017 Google LLC
2294
2294
  *
@@ -2303,7 +2303,7 @@ SPDX-License-Identifier: Apache-2.0
2303
2303
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2304
2304
  * See the License for the specific language governing permissions and
2305
2305
  * limitations under the License.
2306
- */class bF extends class{}{constructor(e,t,r,n){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=n,this.y_=!1}w_(){if(this.y_)throw new N(k.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(e,t,r,n){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,i])=>this.connection.Mo(e,$c(t,r),n,s,i)).catch(s=>{throw s.name==="FirebaseError"?(s.code===k.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new N(k.UNKNOWN,s.toString())})}Lo(e,t,r,n,s){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.Lo(e,$c(t,r),n,i,o,s)).catch(i=>{throw i.name==="FirebaseError"?(i.code===k.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new N(k.UNKNOWN,i.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class UF{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){this.S_===0&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(e){this.state==="Online"?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.C_("Offline")))}set(e){this.x_(),this.S_=0,e==="Online"&&(this.D_=!1),this.C_(e)}C_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}F_(e){const t=`Could not reach Cloud Firestore backend. ${e}
2306
+ */class bF extends class{}{constructor(e,t,r,n){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=n,this.y_=!1}w_(){if(this.y_)throw new N(k.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(e,t,r,n){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,i])=>this.connection.Mo(e,Kc(t,r),n,s,i)).catch(s=>{throw s.name==="FirebaseError"?(s.code===k.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new N(k.UNKNOWN,s.toString())})}Lo(e,t,r,n,s){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.Lo(e,Kc(t,r),n,i,o,s)).catch(i=>{throw i.name==="FirebaseError"?(i.code===k.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new N(k.UNKNOWN,i.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class UF{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){this.S_===0&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(e){this.state==="Online"?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.C_("Offline")))}set(e){this.x_(),this.S_=0,e==="Online"&&(this.D_=!1),this.C_(e)}C_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}F_(e){const t=`Could not reach Cloud Firestore backend. ${e}
2307
2307
  This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.D_?(aA(t),this.D_=!1):V("OnlineStateTracker",t)}x_(){this.b_!==null&&(this.b_.cancel(),this.b_=null)}}/**
2308
2308
  * @license
2309
2309
  * Copyright 2017 Google LLC
@@ -2319,7 +2319,7 @@ This typically indicates that your device does not have a healthy Internet conne
2319
2319
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2320
2320
  * See the License for the specific language governing permissions and
2321
2321
  * limitations under the License.
2322
- */class QF{constructor(e,t,r,n,s){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=s,this.k_._o(i=>{r.enqueueAndForget(async()=>{sr(this)&&(V("RemoteStore","Restarting streams for network reachability change."),await async function(a){const l=z(a);l.L_.add(4),await os(l),l.q_.set("Unknown"),l.L_.delete(4),await oo(l)}(this))})}),this.q_=new UF(r,n)}}async function oo(A){if(sr(A))for(const e of A.B_)await e(!0)}async function os(A){for(const e of A.B_)await e(!1)}function zg(A,e){const t=z(A);t.N_.has(e.targetId)||(t.N_.set(e.targetId,e),rl(t)?Al(t):Gr(t).r_()&&tl(t,e))}function el(A,e){const t=z(A),r=Gr(t);t.N_.delete(e),r.r_()&&Xg(t,e),t.N_.size===0&&(r.r_()?r.o_():sr(t)&&t.q_.set("Unknown"))}function tl(A,e){if(A.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(X.min())>0){const t=A.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Gr(A).A_(e)}function Xg(A,e){A.Q_.xe(e),Gr(A).R_(e)}function Al(A){A.Q_=new II({getRemoteKeysForTarget:e=>A.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>A.N_.get(e)||null,tt:()=>A.datastore.serializer.databaseId}),Gr(A).start(),A.q_.v_()}function rl(A){return sr(A)&&!Gr(A).n_()&&A.N_.size>0}function sr(A){return z(A).L_.size===0}function Yg(A){A.Q_=void 0}async function IF(A){A.q_.set("Online")}async function FF(A){A.N_.forEach((e,t)=>{tl(A,e)})}async function TF(A,e){Yg(A),rl(A)?(A.q_.M_(e),Al(A)):A.q_.set("Unknown")}async function SF(A,e,t){if(A.q_.set("Online"),e instanceof Sg&&e.state===2&&e.cause)try{await async function(n,s){const i=s.cause;for(const o of s.targetIds)n.N_.has(o)&&(await n.remoteSyncer.rejectListen(o,i),n.N_.delete(o),n.Q_.removeTarget(o))}(A,e)}catch(r){V("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),await ao(A,r)}else if(e instanceof ro?A.Q_.Ke(e):e instanceof Tg?A.Q_.He(e):A.Q_.We(e),!t.isEqual(X.min()))try{const r=await $g(A.localStore);t.compareTo(r)>=0&&await function(s,i){const o=s.Q_.rt(i);return o.targetChanges.forEach((a,l)=>{if(a.resumeToken.approximateByteSize()>0){const u=s.N_.get(l);u&&s.N_.set(l,u.withResumeToken(a.resumeToken,i))}}),o.targetMismatches.forEach((a,l)=>{const u=s.N_.get(a);if(!u)return;s.N_.set(a,u.withResumeToken($e.EMPTY_BYTE_STRING,u.snapshotVersion)),Xg(s,a);const d=new RA(u.target,a,l,u.sequenceNumber);tl(s,d)}),s.remoteSyncer.applyRemoteEvent(o)}(A,t)}catch(r){V("RemoteStore","Failed to raise snapshot:",r),await ao(A,r)}}async function ao(A,e,t){if(!Gn(e))throw e;A.L_.add(1),await os(A),A.q_.set("Offline"),t||(t=()=>$g(A.localStore)),A.asyncQueue.enqueueRetryable(async()=>{V("RemoteStore","Retrying IndexedDB access"),await t(),A.L_.delete(1),await oo(A)})}function Zg(A,e){return e().catch(t=>ao(A,t,e))}async function co(A){const e=z(A),t=xA(e);let r=e.O_.length>0?e.O_[e.O_.length-1].batchId:-1;for(;RF(e);)try{const n=await gF(e.localStore,r);if(n===null){e.O_.length===0&&t.o_();break}r=n.batchId,xF(e,n)}catch(n){await ao(e,n)}ep(e)&&tp(e)}function RF(A){return sr(A)&&A.O_.length<10}function xF(A,e){A.O_.push(e);const t=xA(A);t.r_()&&t.V_&&t.m_(e.mutations)}function ep(A){return sr(A)&&!xA(A).n_()&&A.O_.length>0}function tp(A){xA(A).start()}async function kF(A){xA(A).p_()}async function LF(A){const e=xA(A);for(const t of A.O_)e.m_(t.mutations)}async function DF(A,e,t){const r=A.O_.shift(),n=Nc.from(r,e,t);await Zg(A,()=>A.remoteSyncer.applySuccessfulWrite(n)),await co(A)}async function HF(A,e){e&&xA(A).V_&&await async function(r,n){if(function(i){return bI(i)&&i!==k.ABORTED}(n.code)){const s=r.O_.shift();xA(r).s_(),await Zg(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,n)),await co(r)}}(A,e),ep(A)&&tp(A)}async function Ap(A,e){const t=z(A);t.asyncQueue.verifyOperationInProgress(),V("RemoteStore","RemoteStore received new credentials");const r=sr(t);t.L_.add(3),await os(t),r&&t.q_.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.L_.delete(3),await oo(t)}async function OF(A,e){const t=z(A);e?(t.L_.delete(2),await oo(t)):e||(t.L_.add(2),await os(t),t.q_.set("Unknown"))}function Gr(A){return A.K_||(A.K_=function(t,r,n){const s=z(t);return s.w_(),new EF(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(A.datastore,A.asyncQueue,{Eo:IF.bind(null,A),Ro:FF.bind(null,A),mo:TF.bind(null,A),d_:SF.bind(null,A)}),A.B_.push(async e=>{e?(A.K_.s_(),rl(A)?Al(A):A.q_.set("Unknown")):(await A.K_.stop(),Yg(A))})),A.K_}function xA(A){return A.U_||(A.U_=function(t,r,n){const s=z(t);return s.w_(),new vF(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(A.datastore,A.asyncQueue,{Eo:()=>Promise.resolve(),Ro:kF.bind(null,A),mo:HF.bind(null,A),f_:LF.bind(null,A),g_:DF.bind(null,A)}),A.B_.push(async e=>{e?(A.U_.s_(),await co(A)):(await A.U_.stop(),A.O_.length>0&&(V("RemoteStore",`Stopping write stream with ${A.O_.length} pending writes`),A.O_=[]))})),A.U_}/**
2322
+ */class QF{constructor(e,t,r,n,s){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=s,this.k_._o(i=>{r.enqueueAndForget(async()=>{sr(this)&&(V("RemoteStore","Restarting streams for network reachability change."),await async function(a){const l=z(a);l.L_.add(4),await os(l),l.q_.set("Unknown"),l.L_.delete(4),await io(l)}(this))})}),this.q_=new UF(r,n)}}async function io(A){if(sr(A))for(const e of A.B_)await e(!0)}async function os(A){for(const e of A.B_)await e(!1)}function zg(A,e){const t=z(A);t.N_.has(e.targetId)||(t.N_.set(e.targetId,e),Al(t)?tl(t):Wr(t).r_()&&el(t,e))}function Zc(A,e){const t=z(A),r=Wr(t);t.N_.delete(e),r.r_()&&Xg(t,e),t.N_.size===0&&(r.r_()?r.o_():sr(t)&&t.q_.set("Unknown"))}function el(A,e){if(A.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(X.min())>0){const t=A.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}Wr(A).A_(e)}function Xg(A,e){A.Q_.xe(e),Wr(A).R_(e)}function tl(A){A.Q_=new II({getRemoteKeysForTarget:e=>A.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>A.N_.get(e)||null,tt:()=>A.datastore.serializer.databaseId}),Wr(A).start(),A.q_.v_()}function Al(A){return sr(A)&&!Wr(A).n_()&&A.N_.size>0}function sr(A){return z(A).L_.size===0}function Yg(A){A.Q_=void 0}async function IF(A){A.q_.set("Online")}async function FF(A){A.N_.forEach((e,t)=>{el(A,e)})}async function TF(A,e){Yg(A),Al(A)?(A.q_.M_(e),tl(A)):A.q_.set("Unknown")}async function SF(A,e,t){if(A.q_.set("Online"),e instanceof Sg&&e.state===2&&e.cause)try{await async function(n,s){const i=s.cause;for(const o of s.targetIds)n.N_.has(o)&&(await n.remoteSyncer.rejectListen(o,i),n.N_.delete(o),n.Q_.removeTarget(o))}(A,e)}catch(r){V("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),r),await oo(A,r)}else if(e instanceof Ao?A.Q_.Ke(e):e instanceof Tg?A.Q_.He(e):A.Q_.We(e),!t.isEqual(X.min()))try{const r=await $g(A.localStore);t.compareTo(r)>=0&&await function(s,i){const o=s.Q_.rt(i);return o.targetChanges.forEach((a,l)=>{if(a.resumeToken.approximateByteSize()>0){const u=s.N_.get(l);u&&s.N_.set(l,u.withResumeToken(a.resumeToken,i))}}),o.targetMismatches.forEach((a,l)=>{const u=s.N_.get(a);if(!u)return;s.N_.set(a,u.withResumeToken($e.EMPTY_BYTE_STRING,u.snapshotVersion)),Xg(s,a);const d=new RA(u.target,a,l,u.sequenceNumber);el(s,d)}),s.remoteSyncer.applyRemoteEvent(o)}(A,t)}catch(r){V("RemoteStore","Failed to raise snapshot:",r),await oo(A,r)}}async function oo(A,e,t){if(!Gn(e))throw e;A.L_.add(1),await os(A),A.q_.set("Offline"),t||(t=()=>$g(A.localStore)),A.asyncQueue.enqueueRetryable(async()=>{V("RemoteStore","Retrying IndexedDB access"),await t(),A.L_.delete(1),await io(A)})}function Zg(A,e){return e().catch(t=>oo(A,t,e))}async function ao(A){const e=z(A),t=xA(e);let r=e.O_.length>0?e.O_[e.O_.length-1].batchId:-1;for(;RF(e);)try{const n=await gF(e.localStore,r);if(n===null){e.O_.length===0&&t.o_();break}r=n.batchId,xF(e,n)}catch(n){await oo(e,n)}ep(e)&&tp(e)}function RF(A){return sr(A)&&A.O_.length<10}function xF(A,e){A.O_.push(e);const t=xA(A);t.r_()&&t.V_&&t.m_(e.mutations)}function ep(A){return sr(A)&&!xA(A).n_()&&A.O_.length>0}function tp(A){xA(A).start()}async function kF(A){xA(A).p_()}async function LF(A){const e=xA(A);for(const t of A.O_)e.m_(t.mutations)}async function DF(A,e,t){const r=A.O_.shift(),n=Pc.from(r,e,t);await Zg(A,()=>A.remoteSyncer.applySuccessfulWrite(n)),await ao(A)}async function HF(A,e){e&&xA(A).V_&&await async function(r,n){if(function(i){return bI(i)&&i!==k.ABORTED}(n.code)){const s=r.O_.shift();xA(r).s_(),await Zg(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,n)),await ao(r)}}(A,e),ep(A)&&tp(A)}async function Ap(A,e){const t=z(A);t.asyncQueue.verifyOperationInProgress(),V("RemoteStore","RemoteStore received new credentials");const r=sr(t);t.L_.add(3),await os(t),r&&t.q_.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.L_.delete(3),await io(t)}async function OF(A,e){const t=z(A);e?(t.L_.delete(2),await io(t)):e||(t.L_.add(2),await os(t),t.q_.set("Unknown"))}function Wr(A){return A.K_||(A.K_=function(t,r,n){const s=z(t);return s.w_(),new EF(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(A.datastore,A.asyncQueue,{Eo:IF.bind(null,A),Ro:FF.bind(null,A),mo:TF.bind(null,A),d_:SF.bind(null,A)}),A.B_.push(async e=>{e?(A.K_.s_(),Al(A)?tl(A):A.q_.set("Unknown")):(await A.K_.stop(),Yg(A))})),A.K_}function xA(A){return A.U_||(A.U_=function(t,r,n){const s=z(t);return s.w_(),new vF(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,n)}(A.datastore,A.asyncQueue,{Eo:()=>Promise.resolve(),Ro:kF.bind(null,A),mo:HF.bind(null,A),f_:LF.bind(null,A),g_:DF.bind(null,A)}),A.B_.push(async e=>{e?(A.U_.s_(),await ao(A)):(await A.U_.stop(),A.O_.length>0&&(V("RemoteStore",`Stopping write stream with ${A.O_.length} pending writes`),A.O_=[]))})),A.U_}/**
2323
2323
  * @license
2324
2324
  * Copyright 2017 Google LLC
2325
2325
  *
@@ -2334,7 +2334,7 @@ This typically indicates that your device does not have a healthy Internet conne
2334
2334
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2335
2335
  * See the License for the specific language governing permissions and
2336
2336
  * limitations under the License.
2337
- */class nl{constructor(e,t,r,n,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=n,this.removalCallback=s,this.deferred=new IA,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(i=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,n,s){const i=Date.now()+r,o=new nl(e,t,i,n,s);return o.start(r),o}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new N(k.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function sl(A,e){if(aA("AsyncQueue",`${e}: ${A}`),Gn(A))return new N(k.UNAVAILABLE,`${e}: ${A}`);throw A}/**
2337
+ */class rl{constructor(e,t,r,n,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=n,this.removalCallback=s,this.deferred=new IA,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(i=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,n,s){const i=Date.now()+r,o=new rl(e,t,i,n,s);return o.start(r),o}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new N(k.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function nl(A,e){if(aA("AsyncQueue",`${e}: ${A}`),Gn(A))return new N(k.UNAVAILABLE,`${e}: ${A}`);throw A}/**
2338
2338
  * @license
2339
2339
  * Copyright 2017 Google LLC
2340
2340
  *
@@ -2349,10 +2349,10 @@ This typically indicates that your device does not have a healthy Internet conne
2349
2349
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2350
2350
  * See the License for the specific language governing permissions and
2351
2351
  * limitations under the License.
2352
- */class Wr{constructor(e){this.comparator=e?(t,r)=>e(t,r)||$.comparator(t.key,r.key):(t,r)=>$.comparator(t.key,r.key),this.keyedMap=Zn(),this.sortedSet=new pe(this.comparator)}static emptySet(e){return new Wr(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof Wr)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){const n=t.getNext().key,s=r.getNext().key;if(!n.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
2352
+ */class qr{constructor(e){this.comparator=e?(t,r)=>e(t,r)||$.comparator(t.key,r.key):(t,r)=>$.comparator(t.key,r.key),this.keyedMap=Zn(),this.sortedSet=new pe(this.comparator)}static emptySet(e){return new qr(e.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,r)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof qr)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){const n=t.getNext().key,s=r.getNext().key;if(!n.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
2353
2353
  `+e.join(`
2354
2354
  `)+`
2355
- )`}copy(e,t){const r=new Wr;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}/**
2355
+ )`}copy(e,t){const r=new qr;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}/**
2356
2356
  * @license
2357
2357
  * Copyright 2017 Google LLC
2358
2358
  *
@@ -2367,7 +2367,7 @@ This typically indicates that your device does not have a healthy Internet conne
2367
2367
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2368
2368
  * See the License for the specific language governing permissions and
2369
2369
  * limitations under the License.
2370
- */class rp{constructor(){this.W_=new pe($.comparator)}track(e){const t=e.doc.key,r=this.W_.get(t);r?e.type!==0&&r.type===3?this.W_=this.W_.insert(t,e):e.type===3&&r.type!==1?this.W_=this.W_.insert(t,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.W_=this.W_.insert(t,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.W_=this.W_.insert(t,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.W_=this.W_.remove(t):e.type===1&&r.type===2?this.W_=this.W_.insert(t,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.W_=this.W_.insert(t,{type:2,doc:e.doc}):q():this.W_=this.W_.insert(t,e)}G_(){const e=[];return this.W_.inorderTraversal((t,r)=>{e.push(r)}),e}}class qr{constructor(e,t,r,n,s,i,o,a,l){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=n,this.mutatedKeys=s,this.fromCache=i,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=l}static fromInitialDocuments(e,t,r,n,s){const i=[];return t.forEach(o=>{i.push({type:0,doc:o})}),new qr(e,t,Wr.emptySet(t),i,r,n,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Ji(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n].type!==r[n].type||!t[n].doc.isEqual(r[n].doc))return!1;return!0}}/**
2370
+ */class rp{constructor(){this.W_=new pe($.comparator)}track(e){const t=e.doc.key,r=this.W_.get(t);r?e.type!==0&&r.type===3?this.W_=this.W_.insert(t,e):e.type===3&&r.type!==1?this.W_=this.W_.insert(t,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.W_=this.W_.insert(t,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.W_=this.W_.insert(t,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.W_=this.W_.remove(t):e.type===1&&r.type===2?this.W_=this.W_.insert(t,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.W_=this.W_.insert(t,{type:2,doc:e.doc}):q():this.W_=this.W_.insert(t,e)}G_(){const e=[];return this.W_.inorderTraversal((t,r)=>{e.push(r)}),e}}class Jr{constructor(e,t,r,n,s,i,o,a,l){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=n,this.mutatedKeys=s,this.fromCache=i,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=l}static fromInitialDocuments(e,t,r,n,s){const i=[];return t.forEach(o=>{i.push({type:0,doc:o})}),new Jr(e,t,qr.emptySet(t),i,r,n,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&qi(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(t[n].type!==r[n].type||!t[n].doc.isEqual(r[n].doc))return!1;return!0}}/**
2371
2371
  * @license
2372
2372
  * Copyright 2017 Google LLC
2373
2373
  *
@@ -2382,7 +2382,7 @@ This typically indicates that your device does not have a healthy Internet conne
2382
2382
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2383
2383
  * See the License for the specific language governing permissions and
2384
2384
  * limitations under the License.
2385
- */class PF{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class NF{constructor(){this.queries=np(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(t,r){const n=z(t),s=n.queries;n.queries=np(),s.forEach((i,o)=>{for(const a of o.j_)a.onError(r)})})(this,new N(k.ABORTED,"Firestore shutting down"))}}function np(){return new Vr(A=>ug(A),Ji)}async function sp(A,e){const t=z(A);let r=3;const n=e.query;let s=t.queries.get(n);s?!s.H_()&&e.J_()&&(r=2):(s=new PF,r=e.J_()?0:1);try{switch(r){case 0:s.z_=await t.onListen(n,!0);break;case 1:s.z_=await t.onListen(n,!1);break;case 2:await t.onFirstRemoteStoreListen(n)}}catch(i){const o=sl(i,`Initialization of query '${Mr(e.query)}' failed`);return void e.onError(o)}t.queries.set(n,s),s.j_.push(e),e.Z_(t.onlineState),s.z_&&e.X_(s.z_)&&il(t)}async function ip(A,e){const t=z(A),r=e.query;let n=3;const s=t.queries.get(r);if(s){const i=s.j_.indexOf(e);i>=0&&(s.j_.splice(i,1),s.j_.length===0?n=e.J_()?0:1:!s.H_()&&e.J_()&&(n=2))}switch(n){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}}function MF(A,e){const t=z(A);let r=!1;for(const n of e){const s=n.query,i=t.queries.get(s);if(i){for(const o of i.j_)o.X_(n)&&(r=!0);i.z_=n}}r&&il(t)}function VF(A,e,t){const r=z(A),n=r.queries.get(e);if(n)for(const s of n.j_)s.onError(t);r.queries.delete(e)}function il(A){A.Y_.forEach(e=>{e.next()})}var ol,op;(op=ol||(ol={})).ea="default",op.Cache="cache";class ap{constructor(e,t,r){this.query=e,this.ta=t,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=r||{}}X_(e){if(!this.options.includeMetadataChanges){const r=[];for(const n of e.docChanges)n.type!==3&&r.push(n);e=new qr(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.na?this.ia(e)&&(this.ta.next(e),t=!0):this.sa(e,this.onlineState)&&(this.oa(e),t=!0),this.ra=e,t}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let t=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),t=!0),t}sa(e,t){if(!e.fromCache||!this.J_())return!0;const r=t!=="Offline";return(!this.options._a||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const t=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}oa(e){e=qr.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==ol.Cache}}/**
2385
+ */class PF{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class NF{constructor(){this.queries=np(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(t,r){const n=z(t),s=n.queries;n.queries=np(),s.forEach((i,o)=>{for(const a of o.j_)a.onError(r)})})(this,new N(k.ABORTED,"Firestore shutting down"))}}function np(){return new Kr(A=>ug(A),qi)}async function sp(A,e){const t=z(A);let r=3;const n=e.query;let s=t.queries.get(n);s?!s.H_()&&e.J_()&&(r=2):(s=new PF,r=e.J_()?0:1);try{switch(r){case 0:s.z_=await t.onListen(n,!0);break;case 1:s.z_=await t.onListen(n,!1);break;case 2:await t.onFirstRemoteStoreListen(n)}}catch(i){const o=nl(i,`Initialization of query '${Vr(e.query)}' failed`);return void e.onError(o)}t.queries.set(n,s),s.j_.push(e),e.Z_(t.onlineState),s.z_&&e.X_(s.z_)&&sl(t)}async function ip(A,e){const t=z(A),r=e.query;let n=3;const s=t.queries.get(r);if(s){const i=s.j_.indexOf(e);i>=0&&(s.j_.splice(i,1),s.j_.length===0?n=e.J_()?0:1:!s.H_()&&e.J_()&&(n=2))}switch(n){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}}function MF(A,e){const t=z(A);let r=!1;for(const n of e){const s=n.query,i=t.queries.get(s);if(i){for(const o of i.j_)o.X_(n)&&(r=!0);i.z_=n}}r&&sl(t)}function VF(A,e,t){const r=z(A),n=r.queries.get(e);if(n)for(const s of n.j_)s.onError(t);r.queries.delete(e)}function sl(A){A.Y_.forEach(e=>{e.next()})}var il,op;(op=il||(il={})).ea="default",op.Cache="cache";class ap{constructor(e,t,r){this.query=e,this.ta=t,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=r||{}}X_(e){if(!this.options.includeMetadataChanges){const r=[];for(const n of e.docChanges)n.type!==3&&r.push(n);e=new Jr(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.na?this.ia(e)&&(this.ta.next(e),t=!0):this.sa(e,this.onlineState)&&(this.oa(e),t=!0),this.ra=e,t}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let t=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),t=!0),t}sa(e,t){if(!e.fromCache||!this.J_())return!0;const r=t!=="Offline";return(!this.options._a||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const t=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}oa(e){e=Jr.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==il.Cache}}/**
2386
2386
  * @license
2387
2387
  * Copyright 2017 Google LLC
2388
2388
  *
@@ -2397,7 +2397,7 @@ This typically indicates that your device does not have a healthy Internet conne
2397
2397
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2398
2398
  * See the License for the specific language governing permissions and
2399
2399
  * limitations under the License.
2400
- */class cp{constructor(e){this.key=e}}class lp{constructor(e){this.key=e}}class KF{constructor(e,t){this.query=e,this.Ta=t,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=ee(),this.mutatedKeys=ee(),this.Aa=hg(e),this.Ra=new Wr(this.Aa)}get Va(){return this.Ta}ma(e,t){const r=t?t.fa:new rp,n=t?t.Ra:this.Ra;let s=t?t.mutatedKeys:this.mutatedKeys,i=n,o=!1;const a=this.query.limitType==="F"&&n.size===this.query.limit?n.last():null,l=this.query.limitType==="L"&&n.size===this.query.limit?n.first():null;if(e.inorderTraversal((u,d)=>{const g=n.get(u),p=zi(this.query,d)?d:null,w=!!g&&this.mutatedKeys.has(g.key),y=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let B=!1;g&&p?g.data.isEqual(p.data)?w!==y&&(r.track({type:3,doc:p}),B=!0):this.ga(g,p)||(r.track({type:2,doc:p}),B=!0,(a&&this.Aa(p,a)>0||l&&this.Aa(p,l)<0)&&(o=!0)):!g&&p?(r.track({type:0,doc:p}),B=!0):g&&!p&&(r.track({type:1,doc:g}),B=!0,(a||l)&&(o=!0)),B&&(p?(i=i.add(p),s=y?s.add(u):s.delete(u)):(i=i.delete(u),s=s.delete(u)))}),this.query.limit!==null)for(;i.size>this.query.limit;){const u=this.query.limitType==="F"?i.last():i.first();i=i.delete(u.key),s=s.delete(u.key),r.track({type:1,doc:u})}return{Ra:i,fa:r,ns:o,mutatedKeys:s}}ga(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,n){const s=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const i=e.fa.G_();i.sort((u,d)=>function(p,w){const y=B=>{switch(B){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return q()}};return y(p)-y(w)}(u.type,d.type)||this.Aa(u.doc,d.doc)),this.pa(r),n=n!=null&&n;const o=t&&!n?this.ya():[],a=this.da.size===0&&this.current&&!n?1:0,l=a!==this.Ea;return this.Ea=a,i.length!==0||l?{snapshot:new qr(this.query,e.Ra,s,i,e.mutatedKeys,a===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),wa:o}:{wa:o}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new rp,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(t=>this.Ta=this.Ta.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Ta=this.Ta.delete(t)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=ee(),this.Ra.forEach(r=>{this.Sa(r.key)&&(this.da=this.da.add(r.key))});const t=[];return e.forEach(r=>{this.da.has(r)||t.push(new lp(r))}),this.da.forEach(r=>{e.has(r)||t.push(new cp(r))}),t}ba(e){this.Ta=e.Ts,this.da=ee();const t=this.ma(e.documents);return this.applyChanges(t,!0)}Da(){return qr.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class $F{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class jF{constructor(e){this.key=e,this.va=!1}}class GF{constructor(e,t,r,n,s,i){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=n,this.currentUser=s,this.maxConcurrentLimboResolutions=i,this.Ca={},this.Fa=new Vr(o=>ug(o),Ji),this.Ma=new Map,this.xa=new Set,this.Oa=new pe($.comparator),this.Na=new Map,this.La=new qc,this.Ba={},this.ka=new Map,this.qa=jr.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function WF(A,e,t=!0){const r=mp(A);let n;const s=r.Fa.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),n=s.view.Da()):n=await up(r,e,t,!0),n}async function qF(A,e){const t=mp(A);await up(t,e,!0,!1)}async function up(A,e,t,r){const n=await pF(A.localStore,Jt(e)),s=n.targetId,i=A.sharedClientState.addLocalQueryTarget(s,t);let o;return r&&(o=await JF(A,e,s,i==="current",n.resumeToken)),A.isPrimaryClient&&t&&zg(A.remoteStore,n),o}async function JF(A,e,t,r,n){A.Ka=(d,g,p)=>async function(y,B,b,S){let I=B.view.ma(b);I.ns&&(I=await jg(y.localStore,B.query,!1).then(({documents:_})=>B.view.ma(_,I)));const R=S&&S.targetChanges.get(B.targetId),K=S&&S.targetMismatches.get(B.targetId)!=null,P=B.view.applyChanges(I,y.isPrimaryClient,R,K);return wp(y,B.targetId,P.wa),P.snapshot}(A,d,g,p);const s=await jg(A.localStore,e,!0),i=new KF(e,s.Ts),o=i.ma(s.documents),a=is.createSynthesizedTargetChangeForCurrentChange(t,r&&A.onlineState!=="Offline",n),l=i.applyChanges(o,A.isPrimaryClient,a);wp(A,t,l.wa);const u=new $F(e,t,i);return A.Fa.set(e,u),A.Ma.has(t)?A.Ma.get(t).push(e):A.Ma.set(t,[e]),l.snapshot}async function zF(A,e,t){const r=z(A),n=r.Fa.get(e),s=r.Ma.get(n.targetId);if(s.length>1)return r.Ma.set(n.targetId,s.filter(i=>!Ji(i,e))),void r.Fa.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(n.targetId),r.sharedClientState.isActiveQueryTarget(n.targetId)||await Xc(r.localStore,n.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(n.targetId),t&&el(r.remoteStore,n.targetId),al(r,n.targetId)}).catch(jn)):(al(r,n.targetId),await Xc(r.localStore,n.targetId,!0))}async function XF(A,e){const t=z(A),r=t.Fa.get(e),n=t.Ma.get(r.targetId);t.isPrimaryClient&&n.length===1&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),el(t.remoteStore,r.targetId))}async function YF(A,e,t){const r=sT(A);try{const n=await function(i,o){const a=z(i),l=De.now(),u=o.reduce((p,w)=>p.add(w.key),ee());let d,g;return a.persistence.runTransaction("Locally write mutations","readwrite",p=>{let w=cA(),y=ee();return a.cs.getEntries(p,u).next(B=>{w=B,w.forEach((b,S)=>{S.isValidDocument()||(y=y.add(b))})}).next(()=>a.localDocuments.getOverlayedDocuments(p,w)).next(B=>{d=B;const b=[];for(const S of o){const I=yI(S,d.get(S.key).overlayedDocument);I!=null&&b.push(new SA(S.key,I,Zf(I.value.mapValue),xt.exists(!0)))}return a.mutationQueue.addMutationBatch(p,l,b,o)}).next(B=>{g=B;const b=B.applyToLocalDocumentSet(d,y);return a.documentOverlayCache.saveOverlays(p,B.batchId,b)})}).then(()=>({batchId:g.batchId,changes:fg(d)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(n.batchId),function(i,o,a){let l=i.Ba[i.currentUser.toKey()];l||(l=new pe(se)),l=l.insert(o,a),i.Ba[i.currentUser.toKey()]=l}(r,n.batchId,t),await as(r,n.changes),await co(r.remoteStore)}catch(n){const s=sl(n,"Failed to persist write");t.reject(s)}}async function hp(A,e){const t=z(A);try{const r=await dF(t.localStore,e);e.targetChanges.forEach((n,s)=>{const i=t.Na.get(s);i&&(ae(n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size<=1),n.addedDocuments.size>0?i.va=!0:n.modifiedDocuments.size>0?ae(i.va):n.removedDocuments.size>0&&(ae(i.va),i.va=!1))}),await as(t,r,e)}catch(r){await jn(r)}}function dp(A,e,t){const r=z(A);if(r.isPrimaryClient&&t===0||!r.isPrimaryClient&&t===1){const n=[];r.Fa.forEach((s,i)=>{const o=i.view.Z_(e);o.snapshot&&n.push(o.snapshot)}),function(i,o){const a=z(i);a.onlineState=o;let l=!1;a.queries.forEach((u,d)=>{for(const g of d.j_)g.Z_(o)&&(l=!0)}),l&&il(a)}(r.eventManager,e),n.length&&r.Ca.d_(n),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function ZF(A,e,t){const r=z(A);r.sharedClientState.updateQueryState(e,"rejected",t);const n=r.Na.get(e),s=n&&n.key;if(s){let i=new pe($.comparator);i=i.insert(s,qe.newNoDocument(s,X.min()));const o=ee().add(s),a=new Ao(X.min(),new Map,new pe(se),i,o);await hp(r,a),r.Oa=r.Oa.remove(s),r.Na.delete(e),cl(r)}else await Xc(r.localStore,e,!1).then(()=>al(r,e,t)).catch(jn)}async function eT(A,e){const t=z(A),r=e.batch.batchId;try{const n=await hF(t.localStore,e);gp(t,r,null),fp(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),await as(t,n)}catch(n){await jn(n)}}async function tT(A,e,t){const r=z(A);try{const n=await function(i,o){const a=z(i);return a.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let u;return a.mutationQueue.lookupMutationBatch(l,o).next(d=>(ae(d!==null),u=d.keys(),a.mutationQueue.removeMutationBatch(l,d))).next(()=>a.mutationQueue.performConsistencyCheck(l)).next(()=>a.documentOverlayCache.removeOverlaysForBatchId(l,u,o)).next(()=>a.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,u)).next(()=>a.localDocuments.getDocuments(l,u))})}(r.localStore,e);gp(r,e,t),fp(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),await as(r,n)}catch(n){await jn(n)}}function fp(A,e){(A.ka.get(e)||[]).forEach(t=>{t.resolve()}),A.ka.delete(e)}function gp(A,e,t){const r=z(A);let n=r.Ba[r.currentUser.toKey()];if(n){const s=n.get(e);s&&(t?s.reject(t):s.resolve(),n=n.remove(e)),r.Ba[r.currentUser.toKey()]=n}}function al(A,e,t=null){A.sharedClientState.removeLocalQueryTarget(e);for(const r of A.Ma.get(e))A.Fa.delete(r),t&&A.Ca.$a(r,t);A.Ma.delete(e),A.isPrimaryClient&&A.La.gr(e).forEach(r=>{A.La.containsKey(r)||pp(A,r)})}function pp(A,e){A.xa.delete(e.path.canonicalString());const t=A.Oa.get(e);t!==null&&(el(A.remoteStore,t),A.Oa=A.Oa.remove(e),A.Na.delete(t),cl(A))}function wp(A,e,t){for(const r of t)r instanceof cp?(A.La.addReference(r.key,e),AT(A,r)):r instanceof lp?(V("SyncEngine","Document no longer in limbo: "+r.key),A.La.removeReference(r.key,e),A.La.containsKey(r.key)||pp(A,r.key)):q()}function AT(A,e){const t=e.key,r=t.path.canonicalString();A.Oa.get(t)||A.xa.has(r)||(V("SyncEngine","New document in limbo: "+t),A.xa.add(r),cl(A))}function cl(A){for(;A.xa.size>0&&A.Oa.size<A.maxConcurrentLimboResolutions;){const e=A.xa.values().next().value;A.xa.delete(e);const t=new $(de.fromString(e)),r=A.qa.next();A.Na.set(r,new jF(t)),A.Oa=A.Oa.insert(t,r),zg(A.remoteStore,new RA(Jt(Lc(t.path)),r,"TargetPurposeLimboResolution",bc.oe))}}async function as(A,e,t){const r=z(A),n=[],s=[],i=[];r.Fa.isEmpty()||(r.Fa.forEach((o,a)=>{i.push(r.Ka(a,e,t).then(l=>{var u;if((l||t)&&r.isPrimaryClient){const d=l?!l.fromCache:(u=t==null?void 0:t.targetChanges.get(a.targetId))===null||u===void 0?void 0:u.current;r.sharedClientState.updateQueryState(a.targetId,d?"current":"not-current")}if(l){n.push(l);const d=zc.Wi(a.targetId,l);s.push(d)}}))}),await Promise.all(i),r.Ca.d_(n),await async function(a,l){const u=z(a);try{await u.persistence.runTransaction("notifyLocalViewChanges","readwrite",d=>L.forEach(l,g=>L.forEach(g.$i,p=>u.persistence.referenceDelegate.addReference(d,g.targetId,p)).next(()=>L.forEach(g.Ui,p=>u.persistence.referenceDelegate.removeReference(d,g.targetId,p)))))}catch(d){if(!Gn(d))throw d;V("LocalStore","Failed to update sequence numbers: "+d)}for(const d of l){const g=d.targetId;if(!d.fromCache){const p=u.os.get(g),w=p.snapshotVersion,y=p.withLastLimboFreeSnapshotVersion(w);u.os=u.os.insert(g,y)}}}(r.localStore,s))}async function rT(A,e){const t=z(A);if(!t.currentUser.isEqual(e)){V("SyncEngine","User change. New user:",e.toKey());const r=await Kg(t.localStore,e);t.currentUser=e,function(s,i){s.ka.forEach(o=>{o.forEach(a=>{a.reject(new N(k.CANCELLED,i))})}),s.ka.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await as(t,r.hs)}}function nT(A,e){const t=z(A),r=t.Na.get(e);if(r&&r.va)return ee().add(r.key);{let n=ee();const s=t.Ma.get(e);if(!s)return n;for(const i of s){const o=t.Fa.get(i);n=n.unionWith(o.view.Va)}return n}}function mp(A){const e=z(A);return e.remoteStore.remoteSyncer.applyRemoteEvent=hp.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=nT.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=ZF.bind(null,e),e.Ca.d_=MF.bind(null,e.eventManager),e.Ca.$a=VF.bind(null,e.eventManager),e}function sT(A){const e=z(A);return e.remoteStore.remoteSyncer.applySuccessfulWrite=eT.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tT.bind(null,e),e}class lo{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=io(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,t){return null}Ha(e,t){return null}za(e){return uF(this.persistence,new cF,e.initialUser,this.serializer)}Ga(e){return new iF(Jc.Zr,this.serializer)}Wa(e){return new mF}async terminate(){var e,t;(e=this.gcScheduler)===null||e===void 0||e.stop(),(t=this.indexBackfillerScheduler)===null||t===void 0||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}lo.provider={build:()=>new lo};class ll{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>dp(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=rT.bind(null,this.syncEngine),await OF(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new NF}()}createDatastore(e){const t=io(e.databaseInfo.databaseId),r=function(s){return new _F(s)}(e.databaseInfo);return function(s,i,o,a){return new bF(s,i,o,a)}(e.authCredentials,e.appCheckCredentials,r,t)}createRemoteStore(e){return function(r,n,s,i,o){return new QF(r,n,s,i,o)}(this.localStore,this.datastore,e.asyncQueue,t=>dp(this.syncEngine,t,0),function(){return Wg.D()?new Wg:new BF}())}createSyncEngine(e,t){return function(n,s,i,o,a,l,u){const d=new GF(n,s,i,o,a,l);return u&&(d.Qa=!0),d}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(n){const s=z(n);V("RemoteStore","RemoteStore shutting down."),s.L_.add(5),await os(s),s.k_.shutdown(),s.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(t=this.eventManager)===null||t===void 0||t.terminate()}}ll.provider={build:()=>new ll};/**
2400
+ */class cp{constructor(e){this.key=e}}class lp{constructor(e){this.key=e}}class KF{constructor(e,t){this.query=e,this.Ta=t,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=ee(),this.mutatedKeys=ee(),this.Aa=hg(e),this.Ra=new qr(this.Aa)}get Va(){return this.Ta}ma(e,t){const r=t?t.fa:new rp,n=t?t.Ra:this.Ra;let s=t?t.mutatedKeys:this.mutatedKeys,i=n,o=!1;const a=this.query.limitType==="F"&&n.size===this.query.limit?n.last():null,l=this.query.limitType==="L"&&n.size===this.query.limit?n.first():null;if(e.inorderTraversal((u,d)=>{const g=n.get(u),p=Ji(this.query,d)?d:null,w=!!g&&this.mutatedKeys.has(g.key),y=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let B=!1;g&&p?g.data.isEqual(p.data)?w!==y&&(r.track({type:3,doc:p}),B=!0):this.ga(g,p)||(r.track({type:2,doc:p}),B=!0,(a&&this.Aa(p,a)>0||l&&this.Aa(p,l)<0)&&(o=!0)):!g&&p?(r.track({type:0,doc:p}),B=!0):g&&!p&&(r.track({type:1,doc:g}),B=!0,(a||l)&&(o=!0)),B&&(p?(i=i.add(p),s=y?s.add(u):s.delete(u)):(i=i.delete(u),s=s.delete(u)))}),this.query.limit!==null)for(;i.size>this.query.limit;){const u=this.query.limitType==="F"?i.last():i.first();i=i.delete(u.key),s=s.delete(u.key),r.track({type:1,doc:u})}return{Ra:i,fa:r,ns:o,mutatedKeys:s}}ga(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,n){const s=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const i=e.fa.G_();i.sort((u,d)=>function(p,w){const y=B=>{switch(B){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return q()}};return y(p)-y(w)}(u.type,d.type)||this.Aa(u.doc,d.doc)),this.pa(r),n=n!=null&&n;const o=t&&!n?this.ya():[],a=this.da.size===0&&this.current&&!n?1:0,l=a!==this.Ea;return this.Ea=a,i.length!==0||l?{snapshot:new Jr(this.query,e.Ra,s,i,e.mutatedKeys,a===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),wa:o}:{wa:o}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new rp,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(t=>this.Ta=this.Ta.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.Ta=this.Ta.delete(t)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=ee(),this.Ra.forEach(r=>{this.Sa(r.key)&&(this.da=this.da.add(r.key))});const t=[];return e.forEach(r=>{this.da.has(r)||t.push(new lp(r))}),this.da.forEach(r=>{e.has(r)||t.push(new cp(r))}),t}ba(e){this.Ta=e.Ts,this.da=ee();const t=this.ma(e.documents);return this.applyChanges(t,!0)}Da(){return Jr.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class $F{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class jF{constructor(e){this.key=e,this.va=!1}}class GF{constructor(e,t,r,n,s,i){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=n,this.currentUser=s,this.maxConcurrentLimboResolutions=i,this.Ca={},this.Fa=new Kr(o=>ug(o),qi),this.Ma=new Map,this.xa=new Set,this.Oa=new pe($.comparator),this.Na=new Map,this.La=new Wc,this.Ba={},this.ka=new Map,this.qa=Gr.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function WF(A,e,t=!0){const r=mp(A);let n;const s=r.Fa.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),n=s.view.Da()):n=await up(r,e,t,!0),n}async function qF(A,e){const t=mp(A);await up(t,e,!0,!1)}async function up(A,e,t,r){const n=await pF(A.localStore,Jt(e)),s=n.targetId,i=A.sharedClientState.addLocalQueryTarget(s,t);let o;return r&&(o=await JF(A,e,s,i==="current",n.resumeToken)),A.isPrimaryClient&&t&&zg(A.remoteStore,n),o}async function JF(A,e,t,r,n){A.Ka=(d,g,p)=>async function(y,B,b,S){let I=B.view.ma(b);I.ns&&(I=await jg(y.localStore,B.query,!1).then(({documents:_})=>B.view.ma(_,I)));const R=S&&S.targetChanges.get(B.targetId),K=S&&S.targetMismatches.get(B.targetId)!=null,P=B.view.applyChanges(I,y.isPrimaryClient,R,K);return wp(y,B.targetId,P.wa),P.snapshot}(A,d,g,p);const s=await jg(A.localStore,e,!0),i=new KF(e,s.Ts),o=i.ma(s.documents),a=is.createSynthesizedTargetChangeForCurrentChange(t,r&&A.onlineState!=="Offline",n),l=i.applyChanges(o,A.isPrimaryClient,a);wp(A,t,l.wa);const u=new $F(e,t,i);return A.Fa.set(e,u),A.Ma.has(t)?A.Ma.get(t).push(e):A.Ma.set(t,[e]),l.snapshot}async function zF(A,e,t){const r=z(A),n=r.Fa.get(e),s=r.Ma.get(n.targetId);if(s.length>1)return r.Ma.set(n.targetId,s.filter(i=>!qi(i,e))),void r.Fa.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(n.targetId),r.sharedClientState.isActiveQueryTarget(n.targetId)||await zc(r.localStore,n.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(n.targetId),t&&Zc(r.remoteStore,n.targetId),ol(r,n.targetId)}).catch(jn)):(ol(r,n.targetId),await zc(r.localStore,n.targetId,!0))}async function XF(A,e){const t=z(A),r=t.Fa.get(e),n=t.Ma.get(r.targetId);t.isPrimaryClient&&n.length===1&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),Zc(t.remoteStore,r.targetId))}async function YF(A,e,t){const r=sT(A);try{const n=await function(i,o){const a=z(i),l=De.now(),u=o.reduce((p,w)=>p.add(w.key),ee());let d,g;return a.persistence.runTransaction("Locally write mutations","readwrite",p=>{let w=cA(),y=ee();return a.cs.getEntries(p,u).next(B=>{w=B,w.forEach((b,S)=>{S.isValidDocument()||(y=y.add(b))})}).next(()=>a.localDocuments.getOverlayedDocuments(p,w)).next(B=>{d=B;const b=[];for(const S of o){const I=yI(S,d.get(S.key).overlayedDocument);I!=null&&b.push(new SA(S.key,I,Zf(I.value.mapValue),xt.exists(!0)))}return a.mutationQueue.addMutationBatch(p,l,b,o)}).next(B=>{g=B;const b=B.applyToLocalDocumentSet(d,y);return a.documentOverlayCache.saveOverlays(p,B.batchId,b)})}).then(()=>({batchId:g.batchId,changes:fg(d)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(n.batchId),function(i,o,a){let l=i.Ba[i.currentUser.toKey()];l||(l=new pe(se)),l=l.insert(o,a),i.Ba[i.currentUser.toKey()]=l}(r,n.batchId,t),await as(r,n.changes),await ao(r.remoteStore)}catch(n){const s=nl(n,"Failed to persist write");t.reject(s)}}async function hp(A,e){const t=z(A);try{const r=await dF(t.localStore,e);e.targetChanges.forEach((n,s)=>{const i=t.Na.get(s);i&&(ae(n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size<=1),n.addedDocuments.size>0?i.va=!0:n.modifiedDocuments.size>0?ae(i.va):n.removedDocuments.size>0&&(ae(i.va),i.va=!1))}),await as(t,r,e)}catch(r){await jn(r)}}function dp(A,e,t){const r=z(A);if(r.isPrimaryClient&&t===0||!r.isPrimaryClient&&t===1){const n=[];r.Fa.forEach((s,i)=>{const o=i.view.Z_(e);o.snapshot&&n.push(o.snapshot)}),function(i,o){const a=z(i);a.onlineState=o;let l=!1;a.queries.forEach((u,d)=>{for(const g of d.j_)g.Z_(o)&&(l=!0)}),l&&sl(a)}(r.eventManager,e),n.length&&r.Ca.d_(n),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function ZF(A,e,t){const r=z(A);r.sharedClientState.updateQueryState(e,"rejected",t);const n=r.Na.get(e),s=n&&n.key;if(s){let i=new pe($.comparator);i=i.insert(s,qe.newNoDocument(s,X.min()));const o=ee().add(s),a=new to(X.min(),new Map,new pe(se),i,o);await hp(r,a),r.Oa=r.Oa.remove(s),r.Na.delete(e),al(r)}else await zc(r.localStore,e,!1).then(()=>ol(r,e,t)).catch(jn)}async function eT(A,e){const t=z(A),r=e.batch.batchId;try{const n=await hF(t.localStore,e);gp(t,r,null),fp(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),await as(t,n)}catch(n){await jn(n)}}async function tT(A,e,t){const r=z(A);try{const n=await function(i,o){const a=z(i);return a.persistence.runTransaction("Reject batch","readwrite-primary",l=>{let u;return a.mutationQueue.lookupMutationBatch(l,o).next(d=>(ae(d!==null),u=d.keys(),a.mutationQueue.removeMutationBatch(l,d))).next(()=>a.mutationQueue.performConsistencyCheck(l)).next(()=>a.documentOverlayCache.removeOverlaysForBatchId(l,u,o)).next(()=>a.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,u)).next(()=>a.localDocuments.getDocuments(l,u))})}(r.localStore,e);gp(r,e,t),fp(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),await as(r,n)}catch(n){await jn(n)}}function fp(A,e){(A.ka.get(e)||[]).forEach(t=>{t.resolve()}),A.ka.delete(e)}function gp(A,e,t){const r=z(A);let n=r.Ba[r.currentUser.toKey()];if(n){const s=n.get(e);s&&(t?s.reject(t):s.resolve(),n=n.remove(e)),r.Ba[r.currentUser.toKey()]=n}}function ol(A,e,t=null){A.sharedClientState.removeLocalQueryTarget(e);for(const r of A.Ma.get(e))A.Fa.delete(r),t&&A.Ca.$a(r,t);A.Ma.delete(e),A.isPrimaryClient&&A.La.gr(e).forEach(r=>{A.La.containsKey(r)||pp(A,r)})}function pp(A,e){A.xa.delete(e.path.canonicalString());const t=A.Oa.get(e);t!==null&&(Zc(A.remoteStore,t),A.Oa=A.Oa.remove(e),A.Na.delete(t),al(A))}function wp(A,e,t){for(const r of t)r instanceof cp?(A.La.addReference(r.key,e),AT(A,r)):r instanceof lp?(V("SyncEngine","Document no longer in limbo: "+r.key),A.La.removeReference(r.key,e),A.La.containsKey(r.key)||pp(A,r.key)):q()}function AT(A,e){const t=e.key,r=t.path.canonicalString();A.Oa.get(t)||A.xa.has(r)||(V("SyncEngine","New document in limbo: "+t),A.xa.add(r),al(A))}function al(A){for(;A.xa.size>0&&A.Oa.size<A.maxConcurrentLimboResolutions;){const e=A.xa.values().next().value;A.xa.delete(e);const t=new $(de.fromString(e)),r=A.qa.next();A.Na.set(r,new jF(t)),A.Oa=A.Oa.insert(t,r),zg(A.remoteStore,new RA(Jt(kc(t.path)),r,"TargetPurposeLimboResolution",vc.oe))}}async function as(A,e,t){const r=z(A),n=[],s=[],i=[];r.Fa.isEmpty()||(r.Fa.forEach((o,a)=>{i.push(r.Ka(a,e,t).then(l=>{var u;if((l||t)&&r.isPrimaryClient){const d=l?!l.fromCache:(u=t==null?void 0:t.targetChanges.get(a.targetId))===null||u===void 0?void 0:u.current;r.sharedClientState.updateQueryState(a.targetId,d?"current":"not-current")}if(l){n.push(l);const d=Jc.Wi(a.targetId,l);s.push(d)}}))}),await Promise.all(i),r.Ca.d_(n),await async function(a,l){const u=z(a);try{await u.persistence.runTransaction("notifyLocalViewChanges","readwrite",d=>L.forEach(l,g=>L.forEach(g.$i,p=>u.persistence.referenceDelegate.addReference(d,g.targetId,p)).next(()=>L.forEach(g.Ui,p=>u.persistence.referenceDelegate.removeReference(d,g.targetId,p)))))}catch(d){if(!Gn(d))throw d;V("LocalStore","Failed to update sequence numbers: "+d)}for(const d of l){const g=d.targetId;if(!d.fromCache){const p=u.os.get(g),w=p.snapshotVersion,y=p.withLastLimboFreeSnapshotVersion(w);u.os=u.os.insert(g,y)}}}(r.localStore,s))}async function rT(A,e){const t=z(A);if(!t.currentUser.isEqual(e)){V("SyncEngine","User change. New user:",e.toKey());const r=await Kg(t.localStore,e);t.currentUser=e,function(s,i){s.ka.forEach(o=>{o.forEach(a=>{a.reject(new N(k.CANCELLED,i))})}),s.ka.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await as(t,r.hs)}}function nT(A,e){const t=z(A),r=t.Na.get(e);if(r&&r.va)return ee().add(r.key);{let n=ee();const s=t.Ma.get(e);if(!s)return n;for(const i of s){const o=t.Fa.get(i);n=n.unionWith(o.view.Va)}return n}}function mp(A){const e=z(A);return e.remoteStore.remoteSyncer.applyRemoteEvent=hp.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=nT.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=ZF.bind(null,e),e.Ca.d_=MF.bind(null,e.eventManager),e.Ca.$a=VF.bind(null,e.eventManager),e}function sT(A){const e=z(A);return e.remoteStore.remoteSyncer.applySuccessfulWrite=eT.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tT.bind(null,e),e}class co{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=so(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,t){return null}Ha(e,t){return null}za(e){return uF(this.persistence,new cF,e.initialUser,this.serializer)}Ga(e){return new iF(qc.Zr,this.serializer)}Wa(e){return new mF}async terminate(){var e,t;(e=this.gcScheduler)===null||e===void 0||e.stop(),(t=this.indexBackfillerScheduler)===null||t===void 0||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}co.provider={build:()=>new co};class cl{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>dp(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=rT.bind(null,this.syncEngine),await OF(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new NF}()}createDatastore(e){const t=so(e.databaseInfo.databaseId),r=function(s){return new _F(s)}(e.databaseInfo);return function(s,i,o,a){return new bF(s,i,o,a)}(e.authCredentials,e.appCheckCredentials,r,t)}createRemoteStore(e){return function(r,n,s,i,o){return new QF(r,n,s,i,o)}(this.localStore,this.datastore,e.asyncQueue,t=>dp(this.syncEngine,t,0),function(){return Wg.D()?new Wg:new BF}())}createSyncEngine(e,t){return function(n,s,i,o,a,l,u){const d=new GF(n,s,i,o,a,l);return u&&(d.Qa=!0),d}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(n){const s=z(n);V("RemoteStore","RemoteStore shutting down."),s.L_.add(5),await os(s),s.k_.shutdown(),s.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(t=this.eventManager)===null||t===void 0||t.terminate()}}cl.provider={build:()=>new cl};/**
2401
2401
  * @license
2402
2402
  * Copyright 2020 Google LLC
2403
2403
  *
@@ -2442,7 +2442,7 @@ This typically indicates that your device does not have a healthy Internet conne
2442
2442
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2443
2443
  * See the License for the specific language governing permissions and
2444
2444
  * limitations under the License.
2445
- */class iT{constructor(e,t,r,n,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=n,this.user=We.UNAUTHENTICATED,this.clientId=Kf.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async i=>{V("FirestoreClient","Received user=",i.uid),await this.authCredentialListener(i),this.user=i}),this.appCheckCredentials.start(r,i=>(V("FirestoreClient","Received new app check token=",i),this.appCheckCredentialListener(i,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new IA;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const r=sl(t,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function ul(A,e){A.asyncQueue.verifyOperationInProgress(),V("FirestoreClient","Initializing OfflineComponentProvider");const t=A.configuration;await e.initialize(t);let r=t.initialUser;A.setCredentialChangeListener(async n=>{r.isEqual(n)||(await Kg(e.localStore,n),r=n)}),e.persistence.setDatabaseDeletedListener(()=>A.terminate()),A._offlineComponents=e}async function yp(A,e){A.asyncQueue.verifyOperationInProgress();const t=await oT(A);V("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(t,A.configuration),A.setCredentialChangeListener(r=>Ap(e.remoteStore,r)),A.setAppCheckTokenChangeListener((r,n)=>Ap(e.remoteStore,n)),A._onlineComponents=e}async function oT(A){if(!A._offlineComponents)if(A._uninitializedComponentsProvider){V("FirestoreClient","Using user provided OfflineComponentProvider");try{await ul(A,A._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!function(n){return n.name==="FirebaseError"?n.code===k.FAILED_PRECONDITION||n.code===k.UNIMPLEMENTED:!(typeof DOMException<"u"&&n instanceof DOMException)||n.code===22||n.code===20||n.code===11}(t))throw t;Hr("Error using user provided cache. Falling back to memory cache: "+t),await ul(A,new lo)}}else V("FirestoreClient","Using default OfflineComponentProvider"),await ul(A,new lo);return A._offlineComponents}async function Cp(A){return A._onlineComponents||(A._uninitializedComponentsProvider?(V("FirestoreClient","Using user provided OnlineComponentProvider"),await yp(A,A._uninitializedComponentsProvider._online)):(V("FirestoreClient","Using default OnlineComponentProvider"),await yp(A,new ll))),A._onlineComponents}function aT(A){return Cp(A).then(e=>e.syncEngine)}async function hl(A){const e=await Cp(A),t=e.eventManager;return t.onListen=WF.bind(null,e.syncEngine),t.onUnlisten=zF.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=qF.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=XF.bind(null,e.syncEngine),t}function cT(A,e,t={}){const r=new IA;return A.asyncQueue.enqueueAndForget(async()=>function(s,i,o,a,l){const u=new Bp({next:g=>{u.Za(),i.enqueueAndForget(()=>ip(s,d)),g.fromCache&&a.source==="server"?l.reject(new N(k.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(g)},error:g=>l.reject(g)}),d=new ap(o,u,{includeMetadataChanges:!0,_a:!0});return sp(s,d)}(await hl(A),A.asyncQueue,e,t,r)),r.promise}/**
2445
+ */class iT{constructor(e,t,r,n,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this.databaseInfo=n,this.user=We.UNAUTHENTICATED,this.clientId=Kf.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async i=>{V("FirestoreClient","Received user=",i.uid),await this.authCredentialListener(i),this.user=i}),this.appCheckCredentials.start(r,i=>(V("FirestoreClient","Received new app check token=",i),this.appCheckCredentialListener(i,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new IA;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const r=nl(t,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function ll(A,e){A.asyncQueue.verifyOperationInProgress(),V("FirestoreClient","Initializing OfflineComponentProvider");const t=A.configuration;await e.initialize(t);let r=t.initialUser;A.setCredentialChangeListener(async n=>{r.isEqual(n)||(await Kg(e.localStore,n),r=n)}),e.persistence.setDatabaseDeletedListener(()=>A.terminate()),A._offlineComponents=e}async function yp(A,e){A.asyncQueue.verifyOperationInProgress();const t=await oT(A);V("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(t,A.configuration),A.setCredentialChangeListener(r=>Ap(e.remoteStore,r)),A.setAppCheckTokenChangeListener((r,n)=>Ap(e.remoteStore,n)),A._onlineComponents=e}async function oT(A){if(!A._offlineComponents)if(A._uninitializedComponentsProvider){V("FirestoreClient","Using user provided OfflineComponentProvider");try{await ll(A,A._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!function(n){return n.name==="FirebaseError"?n.code===k.FAILED_PRECONDITION||n.code===k.UNIMPLEMENTED:!(typeof DOMException<"u"&&n instanceof DOMException)||n.code===22||n.code===20||n.code===11}(t))throw t;Or("Error using user provided cache. Falling back to memory cache: "+t),await ll(A,new co)}}else V("FirestoreClient","Using default OfflineComponentProvider"),await ll(A,new co);return A._offlineComponents}async function Cp(A){return A._onlineComponents||(A._uninitializedComponentsProvider?(V("FirestoreClient","Using user provided OnlineComponentProvider"),await yp(A,A._uninitializedComponentsProvider._online)):(V("FirestoreClient","Using default OnlineComponentProvider"),await yp(A,new cl))),A._onlineComponents}function aT(A){return Cp(A).then(e=>e.syncEngine)}async function ul(A){const e=await Cp(A),t=e.eventManager;return t.onListen=WF.bind(null,e.syncEngine),t.onUnlisten=zF.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=qF.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=XF.bind(null,e.syncEngine),t}function cT(A,e,t={}){const r=new IA;return A.asyncQueue.enqueueAndForget(async()=>function(s,i,o,a,l){const u=new Bp({next:g=>{u.Za(),i.enqueueAndForget(()=>ip(s,d)),g.fromCache&&a.source==="server"?l.reject(new N(k.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(g)},error:g=>l.reject(g)}),d=new ap(o,u,{includeMetadataChanges:!0,_a:!0});return sp(s,d)}(await ul(A),A.asyncQueue,e,t,r)),r.promise}/**
2446
2446
  * @license
2447
2447
  * Copyright 2023 Google LLC
2448
2448
  *
@@ -2487,7 +2487,7 @@ This typically indicates that your device does not have a healthy Internet conne
2487
2487
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2488
2488
  * See the License for the specific language governing permissions and
2489
2489
  * limitations under the License.
2490
- */function vp(A,e,t){if(!t)throw new N(k.INVALID_ARGUMENT,`Function ${A}() cannot be called with an empty ${e}.`)}function lT(A,e,t,r){if(e===!0&&r===!0)throw new N(k.INVALID_ARGUMENT,`${A} and ${t} cannot be used together.`)}function bp(A){if(!$.isDocumentKey(A))throw new N(k.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${A} has ${A.length}.`)}function Up(A){if($.isDocumentKey(A))throw new N(k.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${A} has ${A.length}.`)}function uo(A){if(A===void 0)return"undefined";if(A===null)return"null";if(typeof A=="string")return A.length>20&&(A=`${A.substring(0,20)}...`),JSON.stringify(A);if(typeof A=="number"||typeof A=="boolean")return""+A;if(typeof A=="object"){if(A instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(A);return e?`a custom ${e} object`:"an object"}}return typeof A=="function"?"a function":q()}function Xt(A,e){if("_delegate"in A&&(A=A._delegate),!(A instanceof e)){if(e.name===A.constructor.name)throw new N(k.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=uo(A);throw new N(k.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return A}/**
2490
+ */function vp(A,e,t){if(!t)throw new N(k.INVALID_ARGUMENT,`Function ${A}() cannot be called with an empty ${e}.`)}function lT(A,e,t,r){if(e===!0&&r===!0)throw new N(k.INVALID_ARGUMENT,`${A} and ${t} cannot be used together.`)}function bp(A){if(!$.isDocumentKey(A))throw new N(k.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${A} has ${A.length}.`)}function Up(A){if($.isDocumentKey(A))throw new N(k.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${A} has ${A.length}.`)}function lo(A){if(A===void 0)return"undefined";if(A===null)return"null";if(typeof A=="string")return A.length>20&&(A=`${A.substring(0,20)}...`),JSON.stringify(A);if(typeof A=="number"||typeof A=="boolean")return""+A;if(typeof A=="object"){if(A instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(A);return e?`a custom ${e} object`:"an object"}}return typeof A=="function"?"a function":q()}function Xt(A,e){if("_delegate"in A&&(A=A._delegate),!(A instanceof e)){if(e.name===A.constructor.name)throw new N(k.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=lo(A);throw new N(k.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return A}/**
2491
2491
  * @license
2492
2492
  * Copyright 2020 Google LLC
2493
2493
  *
@@ -2502,7 +2502,7 @@ This typically indicates that your device does not have a healthy Internet conne
2502
2502
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2503
2503
  * See the License for the specific language governing permissions and
2504
2504
  * limitations under the License.
2505
- */class Qp{constructor(e){var t,r;if(e.host===void 0){if(e.ssl!==void 0)throw new N(k.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(t=e.ssl)===null||t===void 0||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new N(k.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}lT("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=_p((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new N(k.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new N(k.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new N(k.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,n){return r.timeoutSeconds===n.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class ho{constructor(e,t,r,n){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=n,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Qp({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new N(k.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new N(k.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Qp(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new FQ;switch(r.type){case"firstParty":return new xQ(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new N(k.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const r=Ep.get(t);r&&(V("ComponentProvider","Removing Datastore"),Ep.delete(t),r.terminate())}(this),Promise.resolve()}}function uT(A,e,t,r={}){var n;const s=(A=Xt(A,ho))._getSettings(),i=`${e}:${t}`;if(s.host!=="firestore.googleapis.com"&&s.host!==i&&Hr("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),A._setSettings(Object.assign(Object.assign({},s),{host:i,ssl:!1})),r.mockUserToken){let o,a;if(typeof r.mockUserToken=="string")o=r.mockUserToken,a=We.MOCK_USER;else{o=ff(r.mockUserToken,(n=A._app)===null||n===void 0?void 0:n.options.projectId);const l=r.mockUserToken.sub||r.mockUserToken.user_id;if(!l)throw new N(k.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");a=new We(l)}A._authCredentials=new TQ(new Vf(o,a))}}/**
2505
+ */class Qp{constructor(e){var t,r;if(e.host===void 0){if(e.ssl!==void 0)throw new N(k.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(t=e.ssl)===null||t===void 0||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new N(k.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}lT("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=_p((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new N(k.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new N(k.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new N(k.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,n){return r.timeoutSeconds===n.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class uo{constructor(e,t,r,n){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=n,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Qp({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new N(k.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new N(k.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Qp(e),e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new FQ;switch(r.type){case"firstParty":return new xQ(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new N(k.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const r=Ep.get(t);r&&(V("ComponentProvider","Removing Datastore"),Ep.delete(t),r.terminate())}(this),Promise.resolve()}}function uT(A,e,t,r={}){var n;const s=(A=Xt(A,uo))._getSettings(),i=`${e}:${t}`;if(s.host!=="firestore.googleapis.com"&&s.host!==i&&Or("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),A._setSettings(Object.assign(Object.assign({},s),{host:i,ssl:!1})),r.mockUserToken){let o,a;if(typeof r.mockUserToken=="string")o=r.mockUserToken,a=We.MOCK_USER;else{o=ff(r.mockUserToken,(n=A._app)===null||n===void 0?void 0:n.options.projectId);const l=r.mockUserToken.sub||r.mockUserToken.user_id;if(!l)throw new N(k.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");a=new We(l)}A._authCredentials=new TQ(new Vf(o,a))}}/**
2506
2506
  * @license
2507
2507
  * Copyright 2020 Google LLC
2508
2508
  *
@@ -2517,7 +2517,7 @@ This typically indicates that your device does not have a healthy Internet conne
2517
2517
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2518
2518
  * See the License for the specific language governing permissions and
2519
2519
  * limitations under the License.
2520
- */class ir{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new ir(this.firestore,e,this._query)}}class ct{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new kA(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new ct(this.firestore,e,this._key)}}class kA extends ir{constructor(e,t,r){super(e,t,Lc(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new ct(this.firestore,null,new $(e))}withConverter(e){return new kA(this.firestore,e,this._path)}}function cs(A,e,...t){if(A=ot(A),vp("collection","path",e),A instanceof ho){const r=de.fromString(e,...t);return Up(r),new kA(A,null,r)}{if(!(A instanceof ct||A instanceof kA))throw new N(k.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=A._path.child(de.fromString(e,...t));return Up(r),new kA(A.firestore,null,r)}}function dl(A,e,...t){if(A=ot(A),arguments.length===1&&(e=Kf.newId()),vp("doc","path",e),A instanceof ho){const r=de.fromString(e,...t);return bp(r),new ct(A,null,new $(r))}{if(!(A instanceof ct||A instanceof kA))throw new N(k.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=A._path.child(de.fromString(e,...t));return bp(r),new ct(A.firestore,A instanceof kA?A.converter:null,new $(r))}}/**
2520
+ */class ir{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new ir(this.firestore,e,this._query)}}class ct{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new kA(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new ct(this.firestore,e,this._key)}}class kA extends ir{constructor(e,t,r){super(e,t,kc(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new ct(this.firestore,null,new $(e))}withConverter(e){return new kA(this.firestore,e,this._path)}}function cs(A,e,...t){if(A=ot(A),vp("collection","path",e),A instanceof uo){const r=de.fromString(e,...t);return Up(r),new kA(A,null,r)}{if(!(A instanceof ct||A instanceof kA))throw new N(k.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=A._path.child(de.fromString(e,...t));return Up(r),new kA(A.firestore,null,r)}}function hl(A,e,...t){if(A=ot(A),arguments.length===1&&(e=Kf.newId()),vp("doc","path",e),A instanceof uo){const r=de.fromString(e,...t);return bp(r),new ct(A,null,new $(r))}{if(!(A instanceof ct||A instanceof kA))throw new N(k.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=A._path.child(de.fromString(e,...t));return bp(r),new ct(A.firestore,A instanceof kA?A.converter:null,new $(r))}}/**
2521
2521
  * @license
2522
2522
  * Copyright 2020 Google LLC
2523
2523
  *
@@ -2532,8 +2532,8 @@ This typically indicates that your device does not have a healthy Internet conne
2532
2532
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2533
2533
  * See the License for the specific language governing permissions and
2534
2534
  * limitations under the License.
2535
- */class Ip{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new qg(this,"async_queue_retry"),this.Vu=()=>{const r=Zc();r&&V("AsyncQueue","Visibility state changed to "+r.visibilityState),this.t_.jo()},this.mu=e;const t=Zc();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const t=Zc();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const t=new IA;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(e){if(!Gn(e))throw e;V("AsyncQueue","Operation failed with retryable error: "+e)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const t=this.mu.then(()=>(this.du=!0,e().catch(r=>{this.Eu=r,this.du=!1;const n=function(i){let o=i.message||"";return i.stack&&(o=i.stack.includes(i.message)?i.stack:i.message+`
2536
- `+i.stack),o}(r);throw aA("INTERNAL UNHANDLED ERROR: ",n),r}).then(r=>(this.du=!1,r))));return this.mu=t,t}enqueueAfterDelay(e,t,r){this.fu(),this.Ru.indexOf(e)>-1&&(t=0);const n=nl.createAndSchedule(this,e,t,r,s=>this.yu(s));return this.Tu.push(n),n}fu(){this.Eu&&q()}verifyOperationInProgress(){}async wu(){let e;do e=this.mu,await e;while(e!==this.mu)}Su(e){for(const t of this.Tu)if(t.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(const t of this.Tu)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const t=this.Tu.indexOf(e);this.Tu.splice(t,1)}}function Fp(A){return function(t,r){if(typeof t!="object"||t===null)return!1;const n=t;for(const s of r)if(s in n&&typeof n[s]=="function")return!0;return!1}(A,["next","error","complete"])}class or extends ho{constructor(e,t,r,n){super(e,t,r,n),this.type="firestore",this._queue=new Ip,this._persistenceKey=(n==null?void 0:n.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Ip(e),this._firestoreClient=void 0,await e}}}function hT(A,e){const t=typeof A=="object"?A:If(),r=typeof A=="string"?A:"(default)",n=bf(t,"firestore").getImmediate({identifier:r});if(!n._initialized){const s=hf("firestore");s&&uT(n,...s)}return n}function fl(A){if(A._terminated)throw new N(k.FAILED_PRECONDITION,"The client has already been terminated.");return A._firestoreClient||dT(A),A._firestoreClient}function dT(A){var e,t,r;const n=A._freezeSettings(),s=function(o,a,l,u){return new GQ(o,a,l,u.host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,_p(u.experimentalLongPollingOptions),u.useFetchStreams)}(A._databaseId,((e=A._app)===null||e===void 0?void 0:e.options.appId)||"",A._persistenceKey,n);A._componentsProvider||!((t=n.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((r=n.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(A._componentsProvider={_offline:n.localCache._offlineComponentProvider,_online:n.localCache._onlineComponentProvider}),A._firestoreClient=new iT(A._authCredentials,A._appCheckCredentials,A._queue,s,A._componentsProvider&&function(o){const a=o==null?void 0:o._online.build();return{_offline:o==null?void 0:o._offline.build(a),_online:a}}(A._componentsProvider))}/**
2535
+ */class Ip{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new qg(this,"async_queue_retry"),this.Vu=()=>{const r=Yc();r&&V("AsyncQueue","Visibility state changed to "+r.visibilityState),this.t_.jo()},this.mu=e;const t=Yc();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const t=Yc();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const t=new IA;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(e){if(!Gn(e))throw e;V("AsyncQueue","Operation failed with retryable error: "+e)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const t=this.mu.then(()=>(this.du=!0,e().catch(r=>{this.Eu=r,this.du=!1;const n=function(i){let o=i.message||"";return i.stack&&(o=i.stack.includes(i.message)?i.stack:i.message+`
2536
+ `+i.stack),o}(r);throw aA("INTERNAL UNHANDLED ERROR: ",n),r}).then(r=>(this.du=!1,r))));return this.mu=t,t}enqueueAfterDelay(e,t,r){this.fu(),this.Ru.indexOf(e)>-1&&(t=0);const n=rl.createAndSchedule(this,e,t,r,s=>this.yu(s));return this.Tu.push(n),n}fu(){this.Eu&&q()}verifyOperationInProgress(){}async wu(){let e;do e=this.mu,await e;while(e!==this.mu)}Su(e){for(const t of this.Tu)if(t.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((t,r)=>t.targetTimeMs-r.targetTimeMs);for(const t of this.Tu)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const t=this.Tu.indexOf(e);this.Tu.splice(t,1)}}function Fp(A){return function(t,r){if(typeof t!="object"||t===null)return!1;const n=t;for(const s of r)if(s in n&&typeof n[s]=="function")return!0;return!1}(A,["next","error","complete"])}class or extends uo{constructor(e,t,r,n){super(e,t,r,n),this.type="firestore",this._queue=new Ip,this._persistenceKey=(n==null?void 0:n.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Ip(e),this._firestoreClient=void 0,await e}}}function hT(A,e){const t=typeof A=="object"?A:If(),r=typeof A=="string"?A:"(default)",n=bf(t,"firestore").getImmediate({identifier:r});if(!n._initialized){const s=hf("firestore");s&&uT(n,...s)}return n}function dl(A){if(A._terminated)throw new N(k.FAILED_PRECONDITION,"The client has already been terminated.");return A._firestoreClient||dT(A),A._firestoreClient}function dT(A){var e,t,r;const n=A._freezeSettings(),s=function(o,a,l,u){return new GQ(o,a,l,u.host,u.ssl,u.experimentalForceLongPolling,u.experimentalAutoDetectLongPolling,_p(u.experimentalLongPollingOptions),u.useFetchStreams)}(A._databaseId,((e=A._app)===null||e===void 0?void 0:e.options.appId)||"",A._persistenceKey,n);A._componentsProvider||!((t=n.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((r=n.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(A._componentsProvider={_offline:n.localCache._offlineComponentProvider,_online:n.localCache._onlineComponentProvider}),A._firestoreClient=new iT(A._authCredentials,A._appCheckCredentials,A._queue,s,A._componentsProvider&&function(o){const a=o==null?void 0:o._online.build();return{_offline:o==null?void 0:o._offline.build(a),_online:a}}(A._componentsProvider))}/**
2537
2537
  * @license
2538
2538
  * Copyright 2020 Google LLC
2539
2539
  *
@@ -2548,7 +2548,7 @@ This typically indicates that your device does not have a healthy Internet conne
2548
2548
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2549
2549
  * See the License for the specific language governing permissions and
2550
2550
  * limitations under the License.
2551
- */class Jr{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Jr($e.fromBase64String(e))}catch(t){throw new N(k.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Jr($e.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/**
2551
+ */class zr{constructor(e){this._byteString=e}static fromBase64String(e){try{return new zr($e.fromBase64String(e))}catch(t){throw new N(k.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new zr($e.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/**
2552
2552
  * @license
2553
2553
  * Copyright 2020 Google LLC
2554
2554
  *
@@ -2563,7 +2563,7 @@ This typically indicates that your device does not have a healthy Internet conne
2563
2563
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2564
2564
  * See the License for the specific language governing permissions and
2565
2565
  * limitations under the License.
2566
- */class fo{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new N(k.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Me(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
2566
+ */class ho{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new N(k.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Me(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
2567
2567
  * @license
2568
2568
  * Copyright 2020 Google LLC
2569
2569
  *
@@ -2578,7 +2578,7 @@ This typically indicates that your device does not have a healthy Internet conne
2578
2578
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2579
2579
  * See the License for the specific language governing permissions and
2580
2580
  * limitations under the License.
2581
- */class gl{constructor(e){this._methodName=e}}/**
2581
+ */class fl{constructor(e){this._methodName=e}}/**
2582
2582
  * @license
2583
2583
  * Copyright 2017 Google LLC
2584
2584
  *
@@ -2593,7 +2593,7 @@ This typically indicates that your device does not have a healthy Internet conne
2593
2593
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2594
2594
  * See the License for the specific language governing permissions and
2595
2595
  * limitations under the License.
2596
- */class pl{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new N(k.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new N(k.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return se(this._lat,e._lat)||se(this._long,e._long)}}/**
2596
+ */class gl{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new N(k.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new N(k.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return se(this._lat,e._lat)||se(this._long,e._long)}}/**
2597
2597
  * @license
2598
2598
  * Copyright 2024 Google LLC
2599
2599
  *
@@ -2608,7 +2608,7 @@ This typically indicates that your device does not have a healthy Internet conne
2608
2608
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2609
2609
  * See the License for the specific language governing permissions and
2610
2610
  * limitations under the License.
2611
- */class wl{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,n){if(r.length!==n.length)return!1;for(let s=0;s<r.length;++s)if(r[s]!==n[s])return!1;return!0}(this._values,e._values)}}/**
2611
+ */class pl{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,n){if(r.length!==n.length)return!1;for(let s=0;s<r.length;++s)if(r[s]!==n[s])return!1;return!0}(this._values,e._values)}}/**
2612
2612
  * @license
2613
2613
  * Copyright 2017 Google LLC
2614
2614
  *
@@ -2623,7 +2623,7 @@ This typically indicates that your device does not have a healthy Internet conne
2623
2623
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2624
2624
  * See the License for the specific language governing permissions and
2625
2625
  * limitations under the License.
2626
- */const fT=/^__.*__$/;class gT{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return this.fieldMask!==null?new SA(e,this.data,this.fieldMask,t,this.fieldTransforms):new ns(e,this.data,t,this.fieldTransforms)}}class Tp{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new SA(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Sp(A){switch(A){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw q()}}class ml{constructor(e,t,r,n,s,i){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=n,s===void 0&&this.vu(),this.fieldTransforms=s||[],this.fieldMask=i||[]}get path(){return this.settings.path}get Cu(){return this.settings.Cu}Fu(e){return new ml(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mu(e){var t;const r=(t=this.path)===null||t===void 0?void 0:t.child(e),n=this.Fu({path:r,xu:!1});return n.Ou(e),n}Nu(e){var t;const r=(t=this.path)===null||t===void 0?void 0:t.child(e),n=this.Fu({path:r,xu:!1});return n.vu(),n}Lu(e){return this.Fu({path:void 0,xu:!0})}Bu(e){return po(e,this.settings.methodName,this.settings.ku||!1,this.path,this.settings.qu)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}vu(){if(this.path)for(let e=0;e<this.path.length;e++)this.Ou(this.path.get(e))}Ou(e){if(e.length===0)throw this.Bu("Document fields must not be empty");if(Sp(this.Cu)&&fT.test(e))throw this.Bu('Document fields cannot begin and end with "__"')}}class pT{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=r||io(e)}Qu(e,t,r,n=!1){return new ml({Cu:e,methodName:t,qu:r,path:Me.emptyPath(),xu:!1,ku:n},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Bl(A){const e=A._freezeSettings(),t=io(A._databaseId);return new pT(A._databaseId,!!e.ignoreUndefinedProperties,t)}function wT(A,e,t,r,n,s={}){const i=A.Qu(s.merge||s.mergeFields?2:0,e,t,n);yl("Data must be an object, but it was:",i,r);const o=Rp(r,i);let a,l;if(s.merge)a=new dt(i.fieldMask),l=i.fieldTransforms;else if(s.mergeFields){const u=[];for(const d of s.mergeFields){const g=Cl(e,d,t);if(!i.contains(g))throw new N(k.INVALID_ARGUMENT,`Field '${g}' is specified in your field mask but missing from your input data.`);kp(u,g)||u.push(g)}a=new dt(u),l=i.fieldTransforms.filter(d=>a.covers(d.field))}else a=null,l=i.fieldTransforms;return new gT(new at(o),a,l)}class go extends gl{_toFieldTransform(e){if(e.Cu!==2)throw e.Cu===1?e.Bu(`${this._methodName}() can only appear at the top level of your update data`):e.Bu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof go}}function mT(A,e,t,r){const n=A.Qu(1,e,t);yl("Data must be an object, but it was:",n,r);const s=[],i=at.empty();tr(r,(a,l)=>{const u=_l(e,a,t);l=ot(l);const d=n.Nu(u);if(l instanceof go)s.push(u);else{const g=ls(l,d);g!=null&&(s.push(u),i.set(u,g))}});const o=new dt(s);return new Tp(i,o,n.fieldTransforms)}function BT(A,e,t,r,n,s){const i=A.Qu(1,e,t),o=[Cl(e,r,t)],a=[n];if(s.length%2!=0)throw new N(k.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let g=0;g<s.length;g+=2)o.push(Cl(e,s[g])),a.push(s[g+1]);const l=[],u=at.empty();for(let g=o.length-1;g>=0;--g)if(!kp(l,o[g])){const p=o[g];let w=a[g];w=ot(w);const y=i.Nu(p);if(w instanceof go)l.push(p);else{const B=ls(w,y);B!=null&&(l.push(p),u.set(p,B))}}const d=new dt(l);return new Tp(u,d,i.fieldTransforms)}function yT(A,e,t,r=!1){return ls(t,A.Qu(r?4:3,e))}function ls(A,e){if(xp(A=ot(A)))return yl("Unsupported field value:",e,A),Rp(A,e);if(A instanceof gl)return function(r,n){if(!Sp(n.Cu))throw n.Bu(`${r._methodName}() can only be used with update() and set()`);if(!n.path)throw n.Bu(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(n);s&&n.fieldTransforms.push(s)}(A,e),null;if(A===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),A instanceof Array){if(e.settings.xu&&e.Cu!==4)throw e.Bu("Nested arrays are not supported");return function(r,n){const s=[];let i=0;for(const o of r){let a=ls(o,n.Lu(i));a==null&&(a={nullValue:"NULL_VALUE"}),s.push(a),i++}return{arrayValue:{values:s}}}(A,e)}return function(r,n){if((r=ot(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return fI(n.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=De.fromDate(r);return{timestampValue:no(n.serializer,s)}}if(r instanceof De){const s=new De(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:no(n.serializer,s)}}if(r instanceof pl)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Jr)return{bytesValue:Lg(n.serializer,r._byteString)};if(r instanceof ct){const s=n.databaseId,i=r.firestore._databaseId;if(!i.isEqual(s))throw n.Bu(`Document reference is for database ${i.projectId}/${i.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:Kc(r.firestore._databaseId||n.databaseId,r._key.path)}}if(r instanceof wl)return function(i,o){return{mapValue:{fields:{__type__:{stringValue:"__vector__"},value:{arrayValue:{values:i.toArray().map(a=>{if(typeof a!="number")throw o.Bu("VectorValues must only contain numeric values.");return Oc(o.serializer,a)})}}}}}}(r,n);throw n.Bu(`Unsupported field value: ${uo(r)}`)}(A,e)}function Rp(A,e){const t={};return jf(A)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):tr(A,(r,n)=>{const s=ls(n,e.Mu(r));s!=null&&(t[r]=s)}),{mapValue:{fields:t}}}function xp(A){return!(typeof A!="object"||A===null||A instanceof Array||A instanceof Date||A instanceof De||A instanceof pl||A instanceof Jr||A instanceof ct||A instanceof gl||A instanceof wl)}function yl(A,e,t){if(!xp(t)||!function(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}(t)){const r=uo(t);throw r==="an object"?e.Bu(A+" a custom object"):e.Bu(A+" "+r)}}function Cl(A,e,t){if((e=ot(e))instanceof fo)return e._internalPath;if(typeof e=="string")return _l(A,e);throw po("Field path arguments must be of type string or ",A,!1,void 0,t)}const CT=new RegExp("[~\\*/\\[\\]]");function _l(A,e,t){if(e.search(CT)>=0)throw po(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,A,!1,void 0,t);try{return new fo(...e.split("."))._internalPath}catch{throw po(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,A,!1,void 0,t)}}function po(A,e,t,r,n){const s=r&&!r.isEmpty(),i=n!==void 0;let o=`Function ${e}() called with invalid data`;t&&(o+=" (via `toFirestore()`)"),o+=". ";let a="";return(s||i)&&(a+=" (found",s&&(a+=` in field ${r}`),i&&(a+=` in document ${n}`),a+=")"),new N(k.INVALID_ARGUMENT,o+A+a)}function kp(A,e){return A.some(t=>t.isEqual(e))}/**
2626
+ */const fT=/^__.*__$/;class gT{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return this.fieldMask!==null?new SA(e,this.data,this.fieldMask,t,this.fieldTransforms):new ns(e,this.data,t,this.fieldTransforms)}}class Tp{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new SA(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function Sp(A){switch(A){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw q()}}class wl{constructor(e,t,r,n,s,i){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=n,s===void 0&&this.vu(),this.fieldTransforms=s||[],this.fieldMask=i||[]}get path(){return this.settings.path}get Cu(){return this.settings.Cu}Fu(e){return new wl(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mu(e){var t;const r=(t=this.path)===null||t===void 0?void 0:t.child(e),n=this.Fu({path:r,xu:!1});return n.Ou(e),n}Nu(e){var t;const r=(t=this.path)===null||t===void 0?void 0:t.child(e),n=this.Fu({path:r,xu:!1});return n.vu(),n}Lu(e){return this.Fu({path:void 0,xu:!0})}Bu(e){return go(e,this.settings.methodName,this.settings.ku||!1,this.path,this.settings.qu)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}vu(){if(this.path)for(let e=0;e<this.path.length;e++)this.Ou(this.path.get(e))}Ou(e){if(e.length===0)throw this.Bu("Document fields must not be empty");if(Sp(this.Cu)&&fT.test(e))throw this.Bu('Document fields cannot begin and end with "__"')}}class pT{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=r||so(e)}Qu(e,t,r,n=!1){return new wl({Cu:e,methodName:t,qu:r,path:Me.emptyPath(),xu:!1,ku:n},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function ml(A){const e=A._freezeSettings(),t=so(A._databaseId);return new pT(A._databaseId,!!e.ignoreUndefinedProperties,t)}function wT(A,e,t,r,n,s={}){const i=A.Qu(s.merge||s.mergeFields?2:0,e,t,n);Bl("Data must be an object, but it was:",i,r);const o=Rp(r,i);let a,l;if(s.merge)a=new dt(i.fieldMask),l=i.fieldTransforms;else if(s.mergeFields){const u=[];for(const d of s.mergeFields){const g=yl(e,d,t);if(!i.contains(g))throw new N(k.INVALID_ARGUMENT,`Field '${g}' is specified in your field mask but missing from your input data.`);kp(u,g)||u.push(g)}a=new dt(u),l=i.fieldTransforms.filter(d=>a.covers(d.field))}else a=null,l=i.fieldTransforms;return new gT(new at(o),a,l)}class fo extends fl{_toFieldTransform(e){if(e.Cu!==2)throw e.Cu===1?e.Bu(`${this._methodName}() can only appear at the top level of your update data`):e.Bu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof fo}}function mT(A,e,t,r){const n=A.Qu(1,e,t);Bl("Data must be an object, but it was:",n,r);const s=[],i=at.empty();tr(r,(a,l)=>{const u=Cl(e,a,t);l=ot(l);const d=n.Nu(u);if(l instanceof fo)s.push(u);else{const g=ls(l,d);g!=null&&(s.push(u),i.set(u,g))}});const o=new dt(s);return new Tp(i,o,n.fieldTransforms)}function BT(A,e,t,r,n,s){const i=A.Qu(1,e,t),o=[yl(e,r,t)],a=[n];if(s.length%2!=0)throw new N(k.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let g=0;g<s.length;g+=2)o.push(yl(e,s[g])),a.push(s[g+1]);const l=[],u=at.empty();for(let g=o.length-1;g>=0;--g)if(!kp(l,o[g])){const p=o[g];let w=a[g];w=ot(w);const y=i.Nu(p);if(w instanceof fo)l.push(p);else{const B=ls(w,y);B!=null&&(l.push(p),u.set(p,B))}}const d=new dt(l);return new Tp(u,d,i.fieldTransforms)}function yT(A,e,t,r=!1){return ls(t,A.Qu(r?4:3,e))}function ls(A,e){if(xp(A=ot(A)))return Bl("Unsupported field value:",e,A),Rp(A,e);if(A instanceof fl)return function(r,n){if(!Sp(n.Cu))throw n.Bu(`${r._methodName}() can only be used with update() and set()`);if(!n.path)throw n.Bu(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(n);s&&n.fieldTransforms.push(s)}(A,e),null;if(A===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),A instanceof Array){if(e.settings.xu&&e.Cu!==4)throw e.Bu("Nested arrays are not supported");return function(r,n){const s=[];let i=0;for(const o of r){let a=ls(o,n.Lu(i));a==null&&(a={nullValue:"NULL_VALUE"}),s.push(a),i++}return{arrayValue:{values:s}}}(A,e)}return function(r,n){if((r=ot(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return fI(n.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=De.fromDate(r);return{timestampValue:ro(n.serializer,s)}}if(r instanceof De){const s=new De(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:ro(n.serializer,s)}}if(r instanceof gl)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof zr)return{bytesValue:Lg(n.serializer,r._byteString)};if(r instanceof ct){const s=n.databaseId,i=r.firestore._databaseId;if(!i.isEqual(s))throw n.Bu(`Document reference is for database ${i.projectId}/${i.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:Vc(r.firestore._databaseId||n.databaseId,r._key.path)}}if(r instanceof pl)return function(i,o){return{mapValue:{fields:{__type__:{stringValue:"__vector__"},value:{arrayValue:{values:i.toArray().map(a=>{if(typeof a!="number")throw o.Bu("VectorValues must only contain numeric values.");return Hc(o.serializer,a)})}}}}}}(r,n);throw n.Bu(`Unsupported field value: ${lo(r)}`)}(A,e)}function Rp(A,e){const t={};return jf(A)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):tr(A,(r,n)=>{const s=ls(n,e.Mu(r));s!=null&&(t[r]=s)}),{mapValue:{fields:t}}}function xp(A){return!(typeof A!="object"||A===null||A instanceof Array||A instanceof Date||A instanceof De||A instanceof gl||A instanceof zr||A instanceof ct||A instanceof fl||A instanceof pl)}function Bl(A,e,t){if(!xp(t)||!function(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}(t)){const r=lo(t);throw r==="an object"?e.Bu(A+" a custom object"):e.Bu(A+" "+r)}}function yl(A,e,t){if((e=ot(e))instanceof ho)return e._internalPath;if(typeof e=="string")return Cl(A,e);throw go("Field path arguments must be of type string or ",A,!1,void 0,t)}const CT=new RegExp("[~\\*/\\[\\]]");function Cl(A,e,t){if(e.search(CT)>=0)throw go(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,A,!1,void 0,t);try{return new ho(...e.split("."))._internalPath}catch{throw go(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,A,!1,void 0,t)}}function go(A,e,t,r,n){const s=r&&!r.isEmpty(),i=n!==void 0;let o=`Function ${e}() called with invalid data`;t&&(o+=" (via `toFirestore()`)"),o+=". ";let a="";return(s||i)&&(a+=" (found",s&&(a+=` in field ${r}`),i&&(a+=` in document ${n}`),a+=")"),new N(k.INVALID_ARGUMENT,o+A+a)}function kp(A,e){return A.some(t=>t.isEqual(e))}/**
2627
2627
  * @license
2628
2628
  * Copyright 2020 Google LLC
2629
2629
  *
@@ -2638,7 +2638,7 @@ This typically indicates that your device does not have a healthy Internet conne
2638
2638
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2639
2639
  * See the License for the specific language governing permissions and
2640
2640
  * limitations under the License.
2641
- */class Lp{constructor(e,t,r,n,s){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=n,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new ct(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new _T(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(El("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class _T extends Lp{data(){return super.data()}}function El(A,e){return typeof e=="string"?_l(A,e):e instanceof fo?e._internalPath:e._delegate._internalPath}/**
2641
+ */class Lp{constructor(e,t,r,n,s){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=n,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new ct(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new _T(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(_l("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class _T extends Lp{data(){return super.data()}}function _l(A,e){return typeof e=="string"?Cl(A,e):e instanceof ho?e._internalPath:e._delegate._internalPath}/**
2642
2642
  * @license
2643
2643
  * Copyright 2020 Google LLC
2644
2644
  *
@@ -2653,7 +2653,7 @@ This typically indicates that your device does not have a healthy Internet conne
2653
2653
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2654
2654
  * See the License for the specific language governing permissions and
2655
2655
  * limitations under the License.
2656
- */function Dp(A){if(A.limitType==="L"&&A.explicitOrderBy.length===0)throw new N(k.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class vl{}class ET extends vl{}function Hp(A,e,...t){let r=[];e instanceof vl&&r.push(e),r=r.concat(t),function(s){const i=s.filter(a=>a instanceof bl).length,o=s.filter(a=>a instanceof wo).length;if(i>1||i>0&&o>0)throw new N(k.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const n of r)A=n._apply(A);return A}class wo extends ET{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new wo(e,t,r)}_apply(e){const t=this._parse(e);return Np(e._query,t),new ir(e.firestore,e.converter,Dc(e._query,t))}_parse(e){const t=Bl(e.firestore);return function(s,i,o,a,l,u,d){let g;if(l.isKeyField()){if(u==="array-contains"||u==="array-contains-any")throw new N(k.INVALID_ARGUMENT,`Invalid Query. You can't perform '${u}' queries on documentId().`);if(u==="in"||u==="not-in"){Pp(d,u);const p=[];for(const w of d)p.push(Op(a,s,w));g={arrayValue:{values:p}}}else g=Op(a,s,d)}else u!=="in"&&u!=="not-in"&&u!=="array-contains-any"||Pp(d,u),g=yT(o,i,d,u==="in"||u==="not-in");return Fe.create(l,u,g)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function mo(A,e,t){const r=e,n=El("where",A);return wo._create(n,r,t)}class bl extends vl{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new bl(e,t)}_parse(e){const t=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return t.length===1?t[0]:Rt.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:(function(n,s){let i=n;const o=s.getFlattenedFilters();for(const a of o)Np(i,a),i=Dc(i,a)}(e._query,t),new ir(e.firestore,e.converter,Dc(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function Op(A,e,t){if(typeof(t=ot(t))=="string"){if(t==="")throw new N(k.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!lg(e)&&t.indexOf("/")!==-1)throw new N(k.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const r=e.path.child(de.fromString(t));if(!$.isDocumentKey(r))throw new N(k.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return zf(A,new $(r))}if(t instanceof ct)return zf(A,t._key);throw new N(k.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${uo(t)}.`)}function Pp(A,e){if(!Array.isArray(A)||A.length===0)throw new N(k.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function Np(A,e){const t=function(n,s){for(const i of n)for(const o of i.getFlattenedFilters())if(s.indexOf(o.op)>=0)return o.op;return null}(A.filters,function(n){switch(n){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(t!==null)throw t===e.op?new N(k.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new N(k.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}class vT{convertValue(e,t="none"){switch(rr(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Ue(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Ar(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw q()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const r={};return tr(e,(n,s)=>{r[n]=this.convertValue(s,t)}),r}convertVectorValue(e){var t,r,n;const s=(n=(r=(t=e.fields)===null||t===void 0?void 0:t.value.arrayValue)===null||r===void 0?void 0:r.values)===null||n===void 0?void 0:n.map(i=>Ue(i.doubleValue));return new wl(s)}convertGeoPoint(e){return new pl(Ue(e.latitude),Ue(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":const r=Qc(e);return r==null?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(Wn(e));default:return null}}convertTimestamp(e){const t=TA(e);return new De(t.seconds,t.nanos)}convertDocumentKey(e,t){const r=de.fromString(e);ae(Vg(r));const n=new qn(r.get(1),r.get(3)),s=new $(r.popFirst(5));return n.isEqual(t)||aA(`Document ${s} contains a document reference within a different database (${n.projectId}/${n.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),s}}/**
2656
+ */function Dp(A){if(A.limitType==="L"&&A.explicitOrderBy.length===0)throw new N(k.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class El{}class ET extends El{}function Hp(A,e,...t){let r=[];e instanceof El&&r.push(e),r=r.concat(t),function(s){const i=s.filter(a=>a instanceof vl).length,o=s.filter(a=>a instanceof po).length;if(i>1||i>0&&o>0)throw new N(k.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const n of r)A=n._apply(A);return A}class po extends ET{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new po(e,t,r)}_apply(e){const t=this._parse(e);return Np(e._query,t),new ir(e.firestore,e.converter,Lc(e._query,t))}_parse(e){const t=ml(e.firestore);return function(s,i,o,a,l,u,d){let g;if(l.isKeyField()){if(u==="array-contains"||u==="array-contains-any")throw new N(k.INVALID_ARGUMENT,`Invalid Query. You can't perform '${u}' queries on documentId().`);if(u==="in"||u==="not-in"){Pp(d,u);const p=[];for(const w of d)p.push(Op(a,s,w));g={arrayValue:{values:p}}}else g=Op(a,s,d)}else u!=="in"&&u!=="not-in"&&u!=="array-contains-any"||Pp(d,u),g=yT(o,i,d,u==="in"||u==="not-in");return Fe.create(l,u,g)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function wo(A,e,t){const r=e,n=_l("where",A);return po._create(n,r,t)}class vl extends El{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new vl(e,t)}_parse(e){const t=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return t.length===1?t[0]:Rt.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:(function(n,s){let i=n;const o=s.getFlattenedFilters();for(const a of o)Np(i,a),i=Lc(i,a)}(e._query,t),new ir(e.firestore,e.converter,Lc(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function Op(A,e,t){if(typeof(t=ot(t))=="string"){if(t==="")throw new N(k.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!lg(e)&&t.indexOf("/")!==-1)throw new N(k.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const r=e.path.child(de.fromString(t));if(!$.isDocumentKey(r))throw new N(k.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return zf(A,new $(r))}if(t instanceof ct)return zf(A,t._key);throw new N(k.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${lo(t)}.`)}function Pp(A,e){if(!Array.isArray(A)||A.length===0)throw new N(k.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function Np(A,e){const t=function(n,s){for(const i of n)for(const o of i.getFlattenedFilters())if(s.indexOf(o.op)>=0)return o.op;return null}(A.filters,function(n){switch(n){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(t!==null)throw t===e.op?new N(k.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new N(k.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}class vT{convertValue(e,t="none"){switch(rr(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Ue(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Ar(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw q()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const r={};return tr(e,(n,s)=>{r[n]=this.convertValue(s,t)}),r}convertVectorValue(e){var t,r,n;const s=(n=(r=(t=e.fields)===null||t===void 0?void 0:t.value.arrayValue)===null||r===void 0?void 0:r.values)===null||n===void 0?void 0:n.map(i=>Ue(i.doubleValue));return new pl(s)}convertGeoPoint(e){return new gl(Ue(e.latitude),Ue(e.longitude))}convertArray(e,t){return(e.values||[]).map(r=>this.convertValue(r,t))}convertServerTimestamp(e,t){switch(t){case"previous":const r=Uc(e);return r==null?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(Wn(e));default:return null}}convertTimestamp(e){const t=TA(e);return new De(t.seconds,t.nanos)}convertDocumentKey(e,t){const r=de.fromString(e);ae(Vg(r));const n=new qn(r.get(1),r.get(3)),s=new $(r.popFirst(5));return n.isEqual(t)||aA(`Document ${s} contains a document reference within a different database (${n.projectId}/${n.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),s}}/**
2657
2657
  * @license
2658
2658
  * Copyright 2020 Google LLC
2659
2659
  *
@@ -2683,7 +2683,7 @@ This typically indicates that your device does not have a healthy Internet conne
2683
2683
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2684
2684
  * See the License for the specific language governing permissions and
2685
2685
  * limitations under the License.
2686
- */class us{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Mp extends Lp{constructor(e,t,r,n,s,i){super(e,t,r,n,i),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Bo(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const r=this._document.data.field(El("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}}class Bo extends Mp{data(e={}){return super.data(e)}}class Vp{constructor(e,t,r,n){this._firestore=e,this._userDataWriter=t,this._snapshot=n,this.metadata=new us(n.hasPendingWrites,n.fromCache),this.query=r}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new Bo(this._firestore,this._userDataWriter,r.key,r,new us(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new N(k.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(n,s){if(n._snapshot.oldDocs.isEmpty()){let i=0;return n._snapshot.docChanges.map(o=>{const a=new Bo(n._firestore,n._userDataWriter,o.doc.key,o.doc,new us(n._snapshot.mutatedKeys.has(o.doc.key),n._snapshot.fromCache),n.query.converter);return o.doc,{type:"added",doc:a,oldIndex:-1,newIndex:i++}})}{let i=n._snapshot.oldDocs;return n._snapshot.docChanges.filter(o=>s||o.type!==3).map(o=>{const a=new Bo(n._firestore,n._userDataWriter,o.doc.key,o.doc,new us(n._snapshot.mutatedKeys.has(o.doc.key),n._snapshot.fromCache),n.query.converter);let l=-1,u=-1;return o.type!==0&&(l=i.indexOf(o.doc.key),i=i.delete(o.doc.key)),o.type!==1&&(i=i.add(o.doc),u=i.indexOf(o.doc.key)),{type:UT(o.type),doc:a,oldIndex:l,newIndex:u}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function UT(A){switch(A){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return q()}}class Ul extends vT{constructor(e){super(),this.firestore=e}convertBytes(e){return new Jr(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new ct(this.firestore,null,t)}}function Kp(A){A=Xt(A,ir);const e=Xt(A.firestore,or),t=fl(e),r=new Ul(e);return Dp(A._query),cT(t,A._query).then(n=>new Vp(e,r,A,n))}function QT(A,e,t,...r){A=Xt(A,ct);const n=Xt(A.firestore,or),s=Bl(n);let i;return i=typeof(e=ot(e))=="string"||e instanceof fo?BT(s,"updateDoc",A._key,e,t,r):mT(s,"updateDoc",A._key,e),Ql(n,[i.toMutation(A._key,xt.exists(!0))])}function IT(A){return Ql(Xt(A.firestore,or),[new Pc(A._key,xt.none())])}function $p(A,e){const t=Xt(A.firestore,or),r=dl(A),n=bT(A.converter,e);return Ql(t,[wT(Bl(A.firestore),"addDoc",r._key,n,A.converter!==null,{}).toMutation(r._key,xt.exists(!1))]).then(()=>r)}function FT(A,...e){var t,r,n;A=ot(A);let s={includeMetadataChanges:!1,source:"default"},i=0;typeof e[i]!="object"||Fp(e[i])||(s=e[i],i++);const o={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(Fp(e[i])){const d=e[i];e[i]=(t=d.next)===null||t===void 0?void 0:t.bind(d),e[i+1]=(r=d.error)===null||r===void 0?void 0:r.bind(d),e[i+2]=(n=d.complete)===null||n===void 0?void 0:n.bind(d)}let a,l,u;if(A instanceof ct)l=Xt(A.firestore,or),u=Lc(A._key.path),a={next:d=>{e[i]&&e[i](TT(l,A,d))},error:e[i+1],complete:e[i+2]};else{const d=Xt(A,ir);l=Xt(d.firestore,or),u=d._query;const g=new Ul(l);a={next:p=>{e[i]&&e[i](new Vp(l,g,d,p))},error:e[i+1],complete:e[i+2]},Dp(A._query)}return function(g,p,w,y){const B=new Bp(y),b=new ap(p,B,w);return g.asyncQueue.enqueueAndForget(async()=>sp(await hl(g),b)),()=>{B.Za(),g.asyncQueue.enqueueAndForget(async()=>ip(await hl(g),b))}}(fl(l),u,o,a)}function Ql(A,e){return function(r,n){const s=new IA;return r.asyncQueue.enqueueAndForget(async()=>YF(await aT(r),n,s)),s.promise}(fl(A),e)}function TT(A,e,t){const r=t.docs.get(e._key),n=new Ul(A);return new Mp(A,n,e._key,r,new us(t.hasPendingWrites,t.fromCache),e.converter)}(function(e,t=!0){(function(n){Dr=n})(Uf),Nn(new Lr("firestore",(r,{instanceIdentifier:n,options:s})=>{const i=r.getProvider("app").getImmediate(),o=new or(new SQ(r.getProvider("auth-internal")),new LQ(r.getProvider("app-check-internal")),function(l,u){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new N(k.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new qn(l.options.projectId,u)}(i,n),i);return s=Object.assign({useFetchStreams:t},s),o._setSettings(s),o},"PUBLIC").setMultipleInstances(!0)),QA(Mf,"4.7.3",e),QA(Mf,"4.7.3","esm2017")})();/**
2686
+ */class us{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Mp extends Lp{constructor(e,t,r,n,s,i){super(e,t,r,n,i),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new mo(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const r=this._document.data.field(_l("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}}class mo extends Mp{data(e={}){return super.data(e)}}class Vp{constructor(e,t,r,n){this._firestore=e,this._userDataWriter=t,this._snapshot=n,this.metadata=new us(n.hasPendingWrites,n.fromCache),this.query=r}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(r=>{e.call(t,new mo(this._firestore,this._userDataWriter,r.key,r,new us(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new N(k.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(n,s){if(n._snapshot.oldDocs.isEmpty()){let i=0;return n._snapshot.docChanges.map(o=>{const a=new mo(n._firestore,n._userDataWriter,o.doc.key,o.doc,new us(n._snapshot.mutatedKeys.has(o.doc.key),n._snapshot.fromCache),n.query.converter);return o.doc,{type:"added",doc:a,oldIndex:-1,newIndex:i++}})}{let i=n._snapshot.oldDocs;return n._snapshot.docChanges.filter(o=>s||o.type!==3).map(o=>{const a=new mo(n._firestore,n._userDataWriter,o.doc.key,o.doc,new us(n._snapshot.mutatedKeys.has(o.doc.key),n._snapshot.fromCache),n.query.converter);let l=-1,u=-1;return o.type!==0&&(l=i.indexOf(o.doc.key),i=i.delete(o.doc.key)),o.type!==1&&(i=i.add(o.doc),u=i.indexOf(o.doc.key)),{type:UT(o.type),doc:a,oldIndex:l,newIndex:u}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function UT(A){switch(A){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return q()}}class bl extends vT{constructor(e){super(),this.firestore=e}convertBytes(e){return new zr(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new ct(this.firestore,null,t)}}function Kp(A){A=Xt(A,ir);const e=Xt(A.firestore,or),t=dl(e),r=new bl(e);return Dp(A._query),cT(t,A._query).then(n=>new Vp(e,r,A,n))}function QT(A,e,t,...r){A=Xt(A,ct);const n=Xt(A.firestore,or),s=ml(n);let i;return i=typeof(e=ot(e))=="string"||e instanceof ho?BT(s,"updateDoc",A._key,e,t,r):mT(s,"updateDoc",A._key,e),Ul(n,[i.toMutation(A._key,xt.exists(!0))])}function IT(A){return Ul(Xt(A.firestore,or),[new Oc(A._key,xt.none())])}function $p(A,e){const t=Xt(A.firestore,or),r=hl(A),n=bT(A.converter,e);return Ul(t,[wT(ml(A.firestore),"addDoc",r._key,n,A.converter!==null,{}).toMutation(r._key,xt.exists(!1))]).then(()=>r)}function FT(A,...e){var t,r,n;A=ot(A);let s={includeMetadataChanges:!1,source:"default"},i=0;typeof e[i]!="object"||Fp(e[i])||(s=e[i],i++);const o={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(Fp(e[i])){const d=e[i];e[i]=(t=d.next)===null||t===void 0?void 0:t.bind(d),e[i+1]=(r=d.error)===null||r===void 0?void 0:r.bind(d),e[i+2]=(n=d.complete)===null||n===void 0?void 0:n.bind(d)}let a,l,u;if(A instanceof ct)l=Xt(A.firestore,or),u=kc(A._key.path),a={next:d=>{e[i]&&e[i](TT(l,A,d))},error:e[i+1],complete:e[i+2]};else{const d=Xt(A,ir);l=Xt(d.firestore,or),u=d._query;const g=new bl(l);a={next:p=>{e[i]&&e[i](new Vp(l,g,d,p))},error:e[i+1],complete:e[i+2]},Dp(A._query)}return function(g,p,w,y){const B=new Bp(y),b=new ap(p,B,w);return g.asyncQueue.enqueueAndForget(async()=>sp(await ul(g),b)),()=>{B.Za(),g.asyncQueue.enqueueAndForget(async()=>ip(await ul(g),b))}}(dl(l),u,o,a)}function Ul(A,e){return function(r,n){const s=new IA;return r.asyncQueue.enqueueAndForget(async()=>YF(await aT(r),n,s)),s.promise}(dl(A),e)}function TT(A,e,t){const r=t.docs.get(e._key),n=new bl(A);return new Mp(A,n,e._key,r,new us(t.hasPendingWrites,t.fromCache),e.converter)}(function(e,t=!0){(function(n){Hr=n})(Uf),Nn(new Dr("firestore",(r,{instanceIdentifier:n,options:s})=>{const i=r.getProvider("app").getImmediate(),o=new or(new SQ(r.getProvider("auth-internal")),new LQ(r.getProvider("app-check-internal")),function(l,u){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new N(k.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new qn(l.options.projectId,u)}(i,n),i);return s=Object.assign({useFetchStreams:t},s),o._setSettings(s),o},"PUBLIC").setMultipleInstances(!0)),QA(Mf,"4.7.3",e),QA(Mf,"4.7.3","esm2017")})();/**
2687
2687
  * @license
2688
2688
  * Copyright 2017 Google LLC
2689
2689
  *
@@ -2713,8 +2713,8 @@ This typically indicates that your device does not have a healthy Internet conne
2713
2713
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2714
2714
  * See the License for the specific language governing permissions and
2715
2715
  * limitations under the License.
2716
- */let Se=class mB extends XA{constructor(e,t,r=0){super(Il(e),`Firebase Storage: ${t} (${Il(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,mB.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Il(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
2717
- ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(function(A){A.UNKNOWN="unknown",A.OBJECT_NOT_FOUND="object-not-found",A.BUCKET_NOT_FOUND="bucket-not-found",A.PROJECT_NOT_FOUND="project-not-found",A.QUOTA_EXCEEDED="quota-exceeded",A.UNAUTHENTICATED="unauthenticated",A.UNAUTHORIZED="unauthorized",A.UNAUTHORIZED_APP="unauthorized-app",A.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",A.INVALID_CHECKSUM="invalid-checksum",A.CANCELED="canceled",A.INVALID_EVENT_NAME="invalid-event-name",A.INVALID_URL="invalid-url",A.INVALID_DEFAULT_BUCKET="invalid-default-bucket",A.NO_DEFAULT_BUCKET="no-default-bucket",A.CANNOT_SLICE_BLOB="cannot-slice-blob",A.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",A.NO_DOWNLOAD_URL="no-download-url",A.INVALID_ARGUMENT="invalid-argument",A.INVALID_ARGUMENT_COUNT="invalid-argument-count",A.APP_DELETED="app-deleted",A.INVALID_ROOT_OPERATION="invalid-root-operation",A.INVALID_FORMAT="invalid-format",A.INTERNAL_ERROR="internal-error",A.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Be||(Be={}));function Il(A){return"storage/"+A}function Fl(){const A="An unknown error occurred, please check the error payload for server response.";return new Se(Be.UNKNOWN,A)}function xT(A){return new Se(Be.OBJECT_NOT_FOUND,"Object '"+A+"' does not exist.")}function kT(A){return new Se(Be.QUOTA_EXCEEDED,"Quota for bucket '"+A+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function LT(){const A="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Se(Be.UNAUTHENTICATED,A)}function DT(){return new Se(Be.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function HT(A){return new Se(Be.UNAUTHORIZED,"User does not have permission to access '"+A+"'.")}function OT(){return new Se(Be.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function PT(){return new Se(Be.CANCELED,"User canceled the upload/download.")}function NT(A){return new Se(Be.INVALID_URL,"Invalid URL '"+A+"'.")}function MT(A){return new Se(Be.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+A+"'.")}function VT(){return new Se(Be.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+Gp+"' property when initializing the app?")}function KT(){return new Se(Be.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function $T(){return new Se(Be.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function jT(A){return new Se(Be.UNSUPPORTED_ENVIRONMENT,`${A} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function Tl(A){return new Se(Be.INVALID_ARGUMENT,A)}function Wp(){return new Se(Be.APP_DELETED,"The Firebase app was deleted.")}function GT(A){return new Se(Be.INVALID_ROOT_OPERATION,"The operation '"+A+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function hs(A,e){return new Se(Be.INVALID_FORMAT,"String does not match format '"+A+"': "+e)}function ds(A){throw new Se(Be.INTERNAL_ERROR,"Internal error: "+A)}/**
2716
+ */let Se=class mB extends XA{constructor(e,t,r=0){super(Ql(e),`Firebase Storage: ${t} (${Ql(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,mB.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return Ql(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
2717
+ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(function(A){A.UNKNOWN="unknown",A.OBJECT_NOT_FOUND="object-not-found",A.BUCKET_NOT_FOUND="bucket-not-found",A.PROJECT_NOT_FOUND="project-not-found",A.QUOTA_EXCEEDED="quota-exceeded",A.UNAUTHENTICATED="unauthenticated",A.UNAUTHORIZED="unauthorized",A.UNAUTHORIZED_APP="unauthorized-app",A.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",A.INVALID_CHECKSUM="invalid-checksum",A.CANCELED="canceled",A.INVALID_EVENT_NAME="invalid-event-name",A.INVALID_URL="invalid-url",A.INVALID_DEFAULT_BUCKET="invalid-default-bucket",A.NO_DEFAULT_BUCKET="no-default-bucket",A.CANNOT_SLICE_BLOB="cannot-slice-blob",A.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",A.NO_DOWNLOAD_URL="no-download-url",A.INVALID_ARGUMENT="invalid-argument",A.INVALID_ARGUMENT_COUNT="invalid-argument-count",A.APP_DELETED="app-deleted",A.INVALID_ROOT_OPERATION="invalid-root-operation",A.INVALID_FORMAT="invalid-format",A.INTERNAL_ERROR="internal-error",A.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Be||(Be={}));function Ql(A){return"storage/"+A}function Il(){const A="An unknown error occurred, please check the error payload for server response.";return new Se(Be.UNKNOWN,A)}function xT(A){return new Se(Be.OBJECT_NOT_FOUND,"Object '"+A+"' does not exist.")}function kT(A){return new Se(Be.QUOTA_EXCEEDED,"Quota for bucket '"+A+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function LT(){const A="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Se(Be.UNAUTHENTICATED,A)}function DT(){return new Se(Be.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function HT(A){return new Se(Be.UNAUTHORIZED,"User does not have permission to access '"+A+"'.")}function OT(){return new Se(Be.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function PT(){return new Se(Be.CANCELED,"User canceled the upload/download.")}function NT(A){return new Se(Be.INVALID_URL,"Invalid URL '"+A+"'.")}function MT(A){return new Se(Be.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+A+"'.")}function VT(){return new Se(Be.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+Gp+"' property when initializing the app?")}function KT(){return new Se(Be.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function $T(){return new Se(Be.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function jT(A){return new Se(Be.UNSUPPORTED_ENVIRONMENT,`${A} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function Fl(A){return new Se(Be.INVALID_ARGUMENT,A)}function Wp(){return new Se(Be.APP_DELETED,"The Firebase app was deleted.")}function GT(A){return new Se(Be.INVALID_ROOT_OPERATION,"The operation '"+A+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function hs(A,e){return new Se(Be.INVALID_FORMAT,"String does not match format '"+A+"': "+e)}function ds(A){throw new Se(Be.INTERNAL_ERROR,"Internal error: "+A)}/**
2718
2718
  * @license
2719
2719
  * Copyright 2017 Google LLC
2720
2720
  *
@@ -2759,7 +2759,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2759
2759
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2760
2760
  * See the License for the specific language governing permissions and
2761
2761
  * limitations under the License.
2762
- */function zT(A){return A!==void 0}function XT(A){return typeof A=="object"&&!Array.isArray(A)}function Sl(A){return typeof A=="string"||A instanceof String}function qp(A){return Rl()&&A instanceof Blob}function Rl(){return typeof Blob<"u"}function Jp(A,e,t,r){if(r<e)throw Tl(`Invalid value for '${A}'. Expected ${e} or greater.`);if(r>t)throw Tl(`Invalid value for '${A}'. Expected ${t} or less.`)}/**
2762
+ */function zT(A){return A!==void 0}function XT(A){return typeof A=="object"&&!Array.isArray(A)}function Tl(A){return typeof A=="string"||A instanceof String}function qp(A){return Sl()&&A instanceof Blob}function Sl(){return typeof Blob<"u"}function Jp(A,e,t,r){if(r<e)throw Fl(`Invalid value for '${A}'. Expected ${e} or greater.`);if(r>t)throw Fl(`Invalid value for '${A}'. Expected ${t} or less.`)}/**
2763
2763
  * @license
2764
2764
  * Copyright 2017 Google LLC
2765
2765
  *
@@ -2774,7 +2774,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2774
2774
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2775
2775
  * See the License for the specific language governing permissions and
2776
2776
  * limitations under the License.
2777
- */function xl(A,e,t){let r=e;return t==null&&(r=`https://${e}`),`${t}://${r}/v0${A}`}function zp(A){const e=encodeURIComponent;let t="?";for(const r in A)if(A.hasOwnProperty(r)){const n=e(r)+"="+e(A[r]);t=t+n+"&"}return t=t.slice(0,-1),t}var ar;(function(A){A[A.NO_ERROR=0]="NO_ERROR",A[A.NETWORK_ERROR=1]="NETWORK_ERROR",A[A.ABORT=2]="ABORT"})(ar||(ar={}));/**
2777
+ */function Rl(A,e,t){let r=e;return t==null&&(r=`https://${e}`),`${t}://${r}/v0${A}`}function zp(A){const e=encodeURIComponent;let t="?";for(const r in A)if(A.hasOwnProperty(r)){const n=e(r)+"="+e(A[r]);t=t+n+"&"}return t=t.slice(0,-1),t}var ar;(function(A){A[A.NO_ERROR=0]="NO_ERROR",A[A.NETWORK_ERROR=1]="NETWORK_ERROR",A[A.ABORT=2]="ABORT"})(ar||(ar={}));/**
2778
2778
  * @license
2779
2779
  * Copyright 2022 Google LLC
2780
2780
  *
@@ -2804,7 +2804,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2804
2804
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2805
2805
  * See the License for the specific language governing permissions and
2806
2806
  * limitations under the License.
2807
- */class ZT{constructor(e,t,r,n,s,i,o,a,l,u,d,g=!0){this.url_=e,this.method_=t,this.headers_=r,this.body_=n,this.successCodes_=s,this.additionalRetryCodes_=i,this.callback_=o,this.errorCallback_=a,this.timeout_=l,this.progressCallback_=u,this.connectionFactory_=d,this.retry=g,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,w)=>{this.resolve_=p,this.reject_=w,this.start_()})}start_(){const e=(r,n)=>{if(n){r(!1,new yo(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const i=o=>{const a=o.loaded,l=o.lengthComputable?o.total:-1;this.progressCallback_!==null&&this.progressCallback_(a,l)};this.progressCallback_!==null&&s.addUploadProgressListener(i),s.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(i),this.pendingConnection_=null;const o=s.getErrorCode()===ar.NO_ERROR,a=s.getStatus();if(!o||YT(a,this.additionalRetryCodes_)&&this.retry){const u=s.getErrorCode()===ar.ABORT;r(!1,new yo(!1,null,u));return}const l=this.successCodes_.indexOf(a)!==-1;r(!0,new yo(l,s))})},t=(r,n)=>{const s=this.resolve_,i=this.reject_,o=n.connection;if(n.wasSuccessCode)try{const a=this.callback_(o,o.getResponse());zT(a)?s(a):s()}catch(a){i(a)}else if(o!==null){const a=Fl();a.serverResponse=o.getErrorText(),this.errorCallback_?i(this.errorCallback_(o,a)):i(a)}else if(n.canceled){const a=this.appDelete_?Wp():PT();i(a)}else{const a=OT();i(a)}};this.canceled_?t(!1,new yo(!1,null,!0)):this.backoffId_=qT(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&JT(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class yo{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function eS(A,e){e!==null&&e.length>0&&(A.Authorization="Firebase "+e)}function tS(A,e){A["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function AS(A,e){e&&(A["X-Firebase-GMPID"]=e)}function rS(A,e){e!==null&&(A["X-Firebase-AppCheck"]=e)}function nS(A,e,t,r,n,s,i=!0){const o=zp(A.urlParams),a=A.url+o,l=Object.assign({},A.headers);return AS(l,e),eS(l,t),tS(l,s),rS(l,r),new ZT(a,A.method,l,A.body,A.successCodes,A.additionalRetryCodes,A.handler,A.errorHandler,A.timeout,A.progressCallback,n,i)}/**
2807
+ */class ZT{constructor(e,t,r,n,s,i,o,a,l,u,d,g=!0){this.url_=e,this.method_=t,this.headers_=r,this.body_=n,this.successCodes_=s,this.additionalRetryCodes_=i,this.callback_=o,this.errorCallback_=a,this.timeout_=l,this.progressCallback_=u,this.connectionFactory_=d,this.retry=g,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,w)=>{this.resolve_=p,this.reject_=w,this.start_()})}start_(){const e=(r,n)=>{if(n){r(!1,new Bo(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const i=o=>{const a=o.loaded,l=o.lengthComputable?o.total:-1;this.progressCallback_!==null&&this.progressCallback_(a,l)};this.progressCallback_!==null&&s.addUploadProgressListener(i),s.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(i),this.pendingConnection_=null;const o=s.getErrorCode()===ar.NO_ERROR,a=s.getStatus();if(!o||YT(a,this.additionalRetryCodes_)&&this.retry){const u=s.getErrorCode()===ar.ABORT;r(!1,new Bo(!1,null,u));return}const l=this.successCodes_.indexOf(a)!==-1;r(!0,new Bo(l,s))})},t=(r,n)=>{const s=this.resolve_,i=this.reject_,o=n.connection;if(n.wasSuccessCode)try{const a=this.callback_(o,o.getResponse());zT(a)?s(a):s()}catch(a){i(a)}else if(o!==null){const a=Il();a.serverResponse=o.getErrorText(),this.errorCallback_?i(this.errorCallback_(o,a)):i(a)}else if(n.canceled){const a=this.appDelete_?Wp():PT();i(a)}else{const a=OT();i(a)}};this.canceled_?t(!1,new Bo(!1,null,!0)):this.backoffId_=qT(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&JT(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Bo{constructor(e,t,r){this.wasSuccessCode=e,this.connection=t,this.canceled=!!r}}function eS(A,e){e!==null&&e.length>0&&(A.Authorization="Firebase "+e)}function tS(A,e){A["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function AS(A,e){e&&(A["X-Firebase-GMPID"]=e)}function rS(A,e){e!==null&&(A["X-Firebase-AppCheck"]=e)}function nS(A,e,t,r,n,s,i=!0){const o=zp(A.urlParams),a=A.url+o,l=Object.assign({},A.headers);return AS(l,e),eS(l,t),tS(l,s),rS(l,r),new ZT(a,A.method,l,A.body,A.successCodes,A.additionalRetryCodes,A.handler,A.errorHandler,A.timeout,A.progressCallback,n,i)}/**
2808
2808
  * @license
2809
2809
  * Copyright 2017 Google LLC
2810
2810
  *
@@ -2819,7 +2819,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2819
2819
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2820
2820
  * See the License for the specific language governing permissions and
2821
2821
  * limitations under the License.
2822
- */function sS(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function iS(...A){const e=sS();if(e!==void 0){const t=new e;for(let r=0;r<A.length;r++)t.append(A[r]);return t.getBlob()}else{if(Rl())return new Blob(A);throw new Se(Be.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function oS(A,e,t){return A.webkitSlice?A.webkitSlice(e,t):A.mozSlice?A.mozSlice(e,t):A.slice?A.slice(e,t):null}/**
2822
+ */function sS(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function iS(...A){const e=sS();if(e!==void 0){const t=new e;for(let r=0;r<A.length;r++)t.append(A[r]);return t.getBlob()}else{if(Sl())return new Blob(A);throw new Se(Be.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function oS(A,e,t){return A.webkitSlice?A.webkitSlice(e,t):A.mozSlice?A.mozSlice(e,t):A.slice?A.slice(e,t):null}/**
2823
2823
  * @license
2824
2824
  * Copyright 2021 Google LLC
2825
2825
  *
@@ -2849,7 +2849,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2849
2849
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2850
2850
  * See the License for the specific language governing permissions and
2851
2851
  * limitations under the License.
2852
- */const kt={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class kl{constructor(e,t){this.data=e,this.contentType=t||null}}function Xp(A,e){switch(A){case kt.RAW:return new kl(Yp(e));case kt.BASE64:case kt.BASE64URL:return new kl(Zp(A,e));case kt.DATA_URL:return new kl(lS(e),uS(e))}throw Fl()}function Yp(A){const e=[];for(let t=0;t<A.length;t++){let r=A.charCodeAt(t);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|r&63);else if((r&64512)===55296)if(!(t<A.length-1&&(A.charCodeAt(t+1)&64512)===56320))e.push(239,191,189);else{const s=r,i=A.charCodeAt(++t);r=65536|(s&1023)<<10|i&1023,e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}else(r&64512)===56320?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function cS(A){let e;try{e=decodeURIComponent(A)}catch{throw hs(kt.DATA_URL,"Malformed data URL.")}return Yp(e)}function Zp(A,e){switch(A){case kt.BASE64:{const n=e.indexOf("-")!==-1,s=e.indexOf("_")!==-1;if(n||s)throw hs(A,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break}case kt.BASE64URL:{const n=e.indexOf("+")!==-1,s=e.indexOf("/")!==-1;if(n||s)throw hs(A,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let t;try{t=aS(e)}catch(n){throw n.message.includes("polyfill")?n:hs(A,"Invalid character found")}const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}class ew{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(t===null)throw hs(kt.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const r=t[1]||null;r!=null&&(this.base64=hS(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=e.substring(e.indexOf(",")+1)}}function lS(A){const e=new ew(A);return e.base64?Zp(kt.BASE64,e.rest):cS(e.rest)}function uS(A){return new ew(A).contentType}function hS(A,e){return A.length>=e.length?A.substring(A.length-e.length)===e:!1}/**
2852
+ */const kt={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class xl{constructor(e,t){this.data=e,this.contentType=t||null}}function Xp(A,e){switch(A){case kt.RAW:return new xl(Yp(e));case kt.BASE64:case kt.BASE64URL:return new xl(Zp(A,e));case kt.DATA_URL:return new xl(lS(e),uS(e))}throw Il()}function Yp(A){const e=[];for(let t=0;t<A.length;t++){let r=A.charCodeAt(t);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|r&63);else if((r&64512)===55296)if(!(t<A.length-1&&(A.charCodeAt(t+1)&64512)===56320))e.push(239,191,189);else{const s=r,i=A.charCodeAt(++t);r=65536|(s&1023)<<10|i&1023,e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}else(r&64512)===56320?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function cS(A){let e;try{e=decodeURIComponent(A)}catch{throw hs(kt.DATA_URL,"Malformed data URL.")}return Yp(e)}function Zp(A,e){switch(A){case kt.BASE64:{const n=e.indexOf("-")!==-1,s=e.indexOf("_")!==-1;if(n||s)throw hs(A,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break}case kt.BASE64URL:{const n=e.indexOf("+")!==-1,s=e.indexOf("/")!==-1;if(n||s)throw hs(A,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let t;try{t=aS(e)}catch(n){throw n.message.includes("polyfill")?n:hs(A,"Invalid character found")}const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}class ew{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(t===null)throw hs(kt.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const r=t[1]||null;r!=null&&(this.base64=hS(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=e.substring(e.indexOf(",")+1)}}function lS(A){const e=new ew(A);return e.base64?Zp(kt.BASE64,e.rest):cS(e.rest)}function uS(A){return new ew(A).contentType}function hS(A,e){return A.length>=e.length?A.substring(A.length-e.length)===e:!1}/**
2853
2853
  * @license
2854
2854
  * Copyright 2017 Google LLC
2855
2855
  *
@@ -2864,7 +2864,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2864
2864
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2865
2865
  * See the License for the specific language governing permissions and
2866
2866
  * limitations under the License.
2867
- */class LA{constructor(e,t){let r=0,n="";qp(e)?(this.data_=e,r=e.size,n=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=n}size(){return this.size_}type(){return this.type_}slice(e,t){if(qp(this.data_)){const r=this.data_,n=oS(r,e,t);return n===null?null:new LA(n)}else{const r=new Uint8Array(this.data_.buffer,e,t-e);return new LA(r,!0)}}static getBlob(...e){if(Rl()){const t=e.map(r=>r instanceof LA?r.data_:r);return new LA(iS.apply(null,t))}else{const t=e.map(i=>Sl(i)?Xp(kt.RAW,i).data:i.data_);let r=0;t.forEach(i=>{r+=i.byteLength});const n=new Uint8Array(r);let s=0;return t.forEach(i=>{for(let o=0;o<i.length;o++)n[s++]=i[o]}),new LA(n,!0)}}uploadData(){return this.data_}}/**
2867
+ */class LA{constructor(e,t){let r=0,n="";qp(e)?(this.data_=e,r=e.size,n=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=n}size(){return this.size_}type(){return this.type_}slice(e,t){if(qp(this.data_)){const r=this.data_,n=oS(r,e,t);return n===null?null:new LA(n)}else{const r=new Uint8Array(this.data_.buffer,e,t-e);return new LA(r,!0)}}static getBlob(...e){if(Sl()){const t=e.map(r=>r instanceof LA?r.data_:r);return new LA(iS.apply(null,t))}else{const t=e.map(i=>Tl(i)?Xp(kt.RAW,i).data:i.data_);let r=0;t.forEach(i=>{r+=i.byteLength});const n=new Uint8Array(r);let s=0;return t.forEach(i=>{for(let o=0;o<i.length;o++)n[s++]=i[o]}),new LA(n,!0)}}uploadData(){return this.data_}}/**
2868
2868
  * @license
2869
2869
  * Copyright 2017 Google LLC
2870
2870
  *
@@ -2909,7 +2909,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2909
2909
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2910
2910
  * See the License for the specific language governing permissions and
2911
2911
  * limitations under the License.
2912
- */function gS(A,e){return e}class tt{constructor(e,t,r,n){this.server=e,this.local=t||e,this.writable=!!r,this.xform=n||gS}}let Co=null;function pS(A){return!Sl(A)||A.length<2?A:Aw(A)}function rw(){if(Co)return Co;const A=[];A.push(new tt("bucket")),A.push(new tt("generation")),A.push(new tt("metageneration")),A.push(new tt("name","fullPath",!0));function e(s,i){return pS(i)}const t=new tt("name");t.xform=e,A.push(t);function r(s,i){return i!==void 0?Number(i):i}const n=new tt("size");return n.xform=r,A.push(n),A.push(new tt("timeCreated")),A.push(new tt("updated")),A.push(new tt("md5Hash",null,!0)),A.push(new tt("cacheControl",null,!0)),A.push(new tt("contentDisposition",null,!0)),A.push(new tt("contentEncoding",null,!0)),A.push(new tt("contentLanguage",null,!0)),A.push(new tt("contentType",null,!0)),A.push(new tt("metadata","customMetadata",!0)),Co=A,Co}function wS(A,e){function t(){const r=A.bucket,n=A.fullPath,s=new ft(r,n);return e._makeStorageReference(s)}Object.defineProperty(A,"ref",{get:t})}function mS(A,e,t){const r={};r.type="file";const n=t.length;for(let s=0;s<n;s++){const i=t[s];r[i.local]=i.xform(r,e[i.server])}return wS(r,A),r}function nw(A,e,t){const r=tw(e);return r===null?null:mS(A,r,t)}function BS(A,e,t,r){const n=tw(e);if(n===null||!Sl(n.downloadTokens))return null;const s=n.downloadTokens;if(s.length===0)return null;const i=encodeURIComponent;return s.split(",").map(l=>{const u=A.bucket,d=A.fullPath,g="/b/"+i(u)+"/o/"+i(d),p=xl(g,t,r),w=zp({alt:"media",token:l});return p+w})[0]}function yS(A,e){const t={},r=e.length;for(let n=0;n<r;n++){const s=e[n];s.writable&&(t[s.server]=A[s.local])}return JSON.stringify(t)}class sw{constructor(e,t,r,n){this.url=e,this.method=t,this.handler=r,this.timeout=n,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
2912
+ */function gS(A,e){return e}class tt{constructor(e,t,r,n){this.server=e,this.local=t||e,this.writable=!!r,this.xform=n||gS}}let yo=null;function pS(A){return!Tl(A)||A.length<2?A:Aw(A)}function rw(){if(yo)return yo;const A=[];A.push(new tt("bucket")),A.push(new tt("generation")),A.push(new tt("metageneration")),A.push(new tt("name","fullPath",!0));function e(s,i){return pS(i)}const t=new tt("name");t.xform=e,A.push(t);function r(s,i){return i!==void 0?Number(i):i}const n=new tt("size");return n.xform=r,A.push(n),A.push(new tt("timeCreated")),A.push(new tt("updated")),A.push(new tt("md5Hash",null,!0)),A.push(new tt("cacheControl",null,!0)),A.push(new tt("contentDisposition",null,!0)),A.push(new tt("contentEncoding",null,!0)),A.push(new tt("contentLanguage",null,!0)),A.push(new tt("contentType",null,!0)),A.push(new tt("metadata","customMetadata",!0)),yo=A,yo}function wS(A,e){function t(){const r=A.bucket,n=A.fullPath,s=new ft(r,n);return e._makeStorageReference(s)}Object.defineProperty(A,"ref",{get:t})}function mS(A,e,t){const r={};r.type="file";const n=t.length;for(let s=0;s<n;s++){const i=t[s];r[i.local]=i.xform(r,e[i.server])}return wS(r,A),r}function nw(A,e,t){const r=tw(e);return r===null?null:mS(A,r,t)}function BS(A,e,t,r){const n=tw(e);if(n===null||!Tl(n.downloadTokens))return null;const s=n.downloadTokens;if(s.length===0)return null;const i=encodeURIComponent;return s.split(",").map(l=>{const u=A.bucket,d=A.fullPath,g="/b/"+i(u)+"/o/"+i(d),p=Rl(g,t,r),w=zp({alt:"media",token:l});return p+w})[0]}function yS(A,e){const t={},r=e.length;for(let n=0;n<r;n++){const s=e[n];s.writable&&(t[s.server]=A[s.local])}return JSON.stringify(t)}class sw{constructor(e,t,r,n){this.url=e,this.method=t,this.handler=r,this.timeout=n,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
2913
2913
  * @license
2914
2914
  * Copyright 2017 Google LLC
2915
2915
  *
@@ -2924,7 +2924,7 @@ ${this.customData.serverResponse}`:this.message=this._baseMessage}};var Be;(func
2924
2924
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2925
2925
  * See the License for the specific language governing permissions and
2926
2926
  * limitations under the License.
2927
- */function iw(A){if(!A)throw Fl()}function CS(A,e){function t(r,n){const s=nw(A,n,e);return iw(s!==null),s}return t}function _S(A,e){function t(r,n){const s=nw(A,n,e);return iw(s!==null),BS(s,n,A.host,A._protocol)}return t}function ow(A){function e(t,r){let n;return t.getStatus()===401?t.getErrorText().includes("Firebase App Check token is invalid")?n=DT():n=LT():t.getStatus()===402?n=kT(A.bucket):t.getStatus()===403?n=HT(A.path):n=r,n.status=t.getStatus(),n.serverResponse=r.serverResponse,n}return e}function ES(A){const e=ow(A);function t(r,n){let s=e(r,n);return r.getStatus()===404&&(s=xT(A.path)),s.serverResponse=n.serverResponse,s}return t}function vS(A,e,t){const r=e.fullServerUrl(),n=xl(r,A.host,A._protocol),s="GET",i=A.maxOperationRetryTime,o=new sw(n,s,_S(A,t),i);return o.errorHandler=ES(e),o}function bS(A,e){return A&&A.contentType||e&&e.type()||"application/octet-stream"}function US(A,e,t){const r=Object.assign({},t);return r.fullPath=A.path,r.size=e.size(),r.contentType||(r.contentType=bS(null,e)),r}function QS(A,e,t,r,n){const s=e.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function o(){let I="";for(let R=0;R<2;R++)I=I+Math.random().toString().slice(2);return I}const a=o();i["Content-Type"]="multipart/related; boundary="+a;const l=US(e,r,n),u=yS(l,t),d="--"+a+`\r
2927
+ */function iw(A){if(!A)throw Il()}function CS(A,e){function t(r,n){const s=nw(A,n,e);return iw(s!==null),s}return t}function _S(A,e){function t(r,n){const s=nw(A,n,e);return iw(s!==null),BS(s,n,A.host,A._protocol)}return t}function ow(A){function e(t,r){let n;return t.getStatus()===401?t.getErrorText().includes("Firebase App Check token is invalid")?n=DT():n=LT():t.getStatus()===402?n=kT(A.bucket):t.getStatus()===403?n=HT(A.path):n=r,n.status=t.getStatus(),n.serverResponse=r.serverResponse,n}return e}function ES(A){const e=ow(A);function t(r,n){let s=e(r,n);return r.getStatus()===404&&(s=xT(A.path)),s.serverResponse=n.serverResponse,s}return t}function vS(A,e,t){const r=e.fullServerUrl(),n=Rl(r,A.host,A._protocol),s="GET",i=A.maxOperationRetryTime,o=new sw(n,s,_S(A,t),i);return o.errorHandler=ES(e),o}function bS(A,e){return A&&A.contentType||e&&e.type()||"application/octet-stream"}function US(A,e,t){const r=Object.assign({},t);return r.fullPath=A.path,r.size=e.size(),r.contentType||(r.contentType=bS(null,e)),r}function QS(A,e,t,r,n){const s=e.bucketOnlyServerUrl(),i={"X-Goog-Upload-Protocol":"multipart"};function o(){let I="";for(let R=0;R<2;R++)I=I+Math.random().toString().slice(2);return I}const a=o();i["Content-Type"]="multipart/related; boundary="+a;const l=US(e,r,n),u=yS(l,t),d="--"+a+`\r
2928
2928
  Content-Type: application/json; charset=utf-8\r
2929
2929
  \r
2930
2930
  `+u+`\r
@@ -2932,7 +2932,7 @@ Content-Type: application/json; charset=utf-8\r
2932
2932
  Content-Type: `+l.contentType+`\r
2933
2933
  \r
2934
2934
  `,g=`\r
2935
- --`+a+"--",p=LA.getBlob(d,r,g);if(p===null)throw KT();const w={name:l.fullPath},y=xl(s,A.host,A._protocol),B="POST",b=A.maxUploadRetryTime,S=new sw(y,B,CS(A,t),b);return S.urlParams=w,S.headers=i,S.body=p.uploadData(),S.errorHandler=ow(e),S}class IS{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=ar.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=ar.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=ar.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,n){if(this.sent_)throw ds("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),n!==void 0)for(const s in n)n.hasOwnProperty(s)&&this.xhr_.setRequestHeader(s,n[s].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw ds("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw ds("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw ds("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw ds("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class FS extends IS{initXhr(){this.xhr_.responseType="text"}}function aw(){return new FS}/**
2935
+ --`+a+"--",p=LA.getBlob(d,r,g);if(p===null)throw KT();const w={name:l.fullPath},y=Rl(s,A.host,A._protocol),B="POST",b=A.maxUploadRetryTime,S=new sw(y,B,CS(A,t),b);return S.urlParams=w,S.headers=i,S.body=p.uploadData(),S.errorHandler=ow(e),S}class IS{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=ar.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=ar.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=ar.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,r,n){if(this.sent_)throw ds("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),n!==void 0)for(const s in n)n.hasOwnProperty(s)&&this.xhr_.setRequestHeader(s,n[s].toString());return r!==void 0?this.xhr_.send(r):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw ds("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw ds("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw ds("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw ds("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class FS extends IS{initXhr(){this.xhr_.responseType="text"}}function aw(){return new FS}/**
2936
2936
  * @license
2937
2937
  * Copyright 2019 Google LLC
2938
2938
  *
@@ -2962,7 +2962,7 @@ Content-Type: `+l.contentType+`\r
2962
2962
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2963
2963
  * See the License for the specific language governing permissions and
2964
2964
  * limitations under the License.
2965
- */function kS(A){return/^[A-Za-z]+:\/\//.test(A)}function LS(A,e){return new cr(A,e)}function cw(A,e){if(A instanceof Ll){const t=A;if(t._bucket==null)throw VT();const r=new cr(t,t._bucket);return e!=null?cw(r,e):r}else return e!==void 0?xS(A,e):A}function DS(A,e){if(e&&kS(e)){if(A instanceof Ll)return LS(A,e);throw Tl("To use ref(service, url), the first argument must be a Storage instance.")}else return cw(A,e)}function lw(A,e){const t=e==null?void 0:e[Gp];return t==null?null:ft.makeFromBucketSpec(t,A)}function HS(A,e,t,r={}){A.host=`${e}:${t}`,A._protocol="http";const{mockUserToken:n}=r;n&&(A._overrideAuthToken=typeof n=="string"?n:ff(n,A.app.options.projectId))}class Ll{constructor(e,t,r,n,s){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=n,this._firebaseVersion=s,this._bucket=null,this._host=jp,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=ST,this._maxUploadRetryTime=RT,this._requests=new Set,n!=null?this._bucket=ft.makeFromBucketSpec(n,this._host):this._bucket=lw(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=ft.makeFromBucketSpec(this._url,e):this._bucket=lw(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){Jp("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){Jp("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(t!==null)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new cr(this,e)}_makeRequest(e,t,r,n,s=!0){if(this._deleted)return new WT(Wp());{const i=nS(e,this._appId,r,n,t,this._firebaseVersion,s);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,t){const[r,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,n).getPromise()}}const uw="@firebase/storage",hw="0.13.2";/**
2965
+ */function kS(A){return/^[A-Za-z]+:\/\//.test(A)}function LS(A,e){return new cr(A,e)}function cw(A,e){if(A instanceof kl){const t=A;if(t._bucket==null)throw VT();const r=new cr(t,t._bucket);return e!=null?cw(r,e):r}else return e!==void 0?xS(A,e):A}function DS(A,e){if(e&&kS(e)){if(A instanceof kl)return LS(A,e);throw Fl("To use ref(service, url), the first argument must be a Storage instance.")}else return cw(A,e)}function lw(A,e){const t=e==null?void 0:e[Gp];return t==null?null:ft.makeFromBucketSpec(t,A)}function HS(A,e,t,r={}){A.host=`${e}:${t}`,A._protocol="http";const{mockUserToken:n}=r;n&&(A._overrideAuthToken=typeof n=="string"?n:ff(n,A.app.options.projectId))}class kl{constructor(e,t,r,n,s){this.app=e,this._authProvider=t,this._appCheckProvider=r,this._url=n,this._firebaseVersion=s,this._bucket=null,this._host=jp,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=ST,this._maxUploadRetryTime=RT,this._requests=new Set,n!=null?this._bucket=ft.makeFromBucketSpec(n,this._host):this._bucket=lw(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=ft.makeFromBucketSpec(this._url,e):this._bucket=lw(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){Jp("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){Jp("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(t!==null)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new cr(this,e)}_makeRequest(e,t,r,n,s=!0){if(this._deleted)return new WT(Wp());{const i=nS(e,this._appId,r,n,t,this._firebaseVersion,s);return this._requests.add(i),i.getPromise().then(()=>this._requests.delete(i),()=>this._requests.delete(i)),i}}async makeRequestWithTokens(e,t){const[r,n]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,r,n).getPromise()}}const uw="@firebase/storage",hw="0.13.2";/**
2966
2966
  * @license
2967
2967
  * Copyright 2020 Google LLC
2968
2968
  *
@@ -2977,15 +2977,15 @@ Content-Type: `+l.contentType+`\r
2977
2977
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2978
2978
  * See the License for the specific language governing permissions and
2979
2979
  * limitations under the License.
2980
- */const dw="storage";function OS(A,e,t,r){return A=ot(A),SS(A,e,t,r)}function PS(A){return A=ot(A),RS(A)}function NS(A,e){return A=ot(A),DS(A,e)}function MS(A=If(),e){A=ot(A);const r=bf(A,dw).getImmediate({identifier:e}),n=hf("storage");return n&&VS(r,...n),r}function VS(A,e,t,r={}){HS(A,e,t,r)}function KS(A,{instanceIdentifier:e}){const t=A.getProvider("app").getImmediate(),r=A.getProvider("auth-internal"),n=A.getProvider("app-check-internal");return new Ll(t,r,n,e,Uf)}function $S(){Nn(new Lr(dw,KS,"PUBLIC").setMultipleInstances(!0)),QA(uw,hw,""),QA(uw,hw,"esm2017")}$S();class jS{constructor(e){ut(this,"db");ut(this,"storage");const{provider:t,...r}=e;let n;const s=wQ().find(i=>i.name==="ui-feedback-plugin");s?n=s:n=Qf(r,"ui-feedback-plugin"),this.db=hT(n),this.storage=MS(n)}async addComment(e){return(await $p(cs(this.db,"ufp_comments"),e)).id}async getComments(e,t){const r=Hp(cs(this.db,"ufp_comments"),mo("pageUrl","==",e),mo("projectKey","==",t));return(await Kp(r)).docs.map(i=>({id:i.id,...i.data()})).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,t){await QT(dl(this.db,"ufp_comments",e),t)}async deleteComment(e){await IT(dl(this.db,"ufp_comments",e))}async addReply(e){return(await $p(cs(this.db,"ufp_comments",e.commentId,"replies"),e)).id}async getReplies(e){return(await Kp(cs(this.db,"ufp_comments",e,"replies"))).docs.map(n=>({id:n.id,...n.data()})).sort((n,s)=>n.createdAt-s.createdAt)}subscribeToComments(e,t,r){const n=Hp(cs(this.db,"ufp_comments"),mo("pageUrl","==",e),mo("projectKey","==",t));return FT(n,s=>{const i=s.docs.map(o=>({id:o.id,...o.data()})).sort((o,a)=>a.createdAt-o.createdAt);r(i)},s=>{console.error("[ui-feedback-plugin] Firestore listener error:",s)})}async uploadScreenshot(e,t){const r=NS(this.storage,`ufp_screenshots/${e}.png`);return await OS(r,t,"data_url"),PS(r)}}const GS=Object.freeze(Object.defineProperty({__proto__:null,FirebaseAdapter:jS},Symbol.toStringTag,{value:"Module"}));function WS(A){return{id:A.id,pageUrl:A.page_url,projectKey:A.project_key,authorName:A.author_name,text:A.text,screenshotUrl:A.screenshot_url??"",annotation:A.annotation,resolved:A.resolved,createdAt:A.created_at}}function qS(A){return{page_url:A.pageUrl,project_key:A.projectKey,author_name:A.authorName,text:A.text,screenshot_url:A.screenshotUrl,annotation:A.annotation,resolved:A.resolved,created_at:A.createdAt}}function JS(A){return{id:A.id,commentId:A.comment_id,authorName:A.author_name,text:A.text,createdAt:A.created_at}}function zS(A){return{comment_id:A.commentId,author_name:A.authorName,text:A.text,created_at:A.createdAt}}class XS{constructor(e,t){ut(this,"client");ut(this,"_url");ut(this,"_key");ut(this,"_client",null);this._url=e,this._key=t}async _getClient(){if(this._client)return this._client;try{const{createClient:e}=await Promise.resolve().then(()=>Jx);return this._client=e(this._url,this._key),this._client}catch{throw new Error("[ui-feedback-plugin] @supabase/supabase-js is not installed. Run: npm install @supabase/supabase-js")}}async addComment(e){const t=await this._getClient(),{data:r,error:n}=await t.from("ufp_comments").insert(qS(e)).select("id").single();if(n)throw n;return r.id}async getComments(e,t){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_comments").select("*").eq("page_url",e).eq("project_key",t);if(s)throw s;return(n??[]).map(WS).sort((o,a)=>a.createdAt-o.createdAt)}async updateComment(e,t){const r=await this._getClient(),n={};t.resolved!==void 0&&(n.resolved=t.resolved),t.screenshotUrl!==void 0&&(n.screenshot_url=t.screenshotUrl),t.text!==void 0&&(n.text=t.text),t.annotation!==void 0&&(n.annotation=t.annotation);const{error:s}=await r.from("ufp_comments").update(n).eq("id",e);if(s)throw s}async deleteComment(e){const t=await this._getClient(),{error:r}=await t.from("ufp_comments").delete().eq("id",e);if(r)throw r}async addReply(e){const t=await this._getClient(),{data:r,error:n}=await t.from("ufp_replies").insert(zS(e)).select("id").single();if(n)throw n;return r.id}async getReplies(e){const t=await this._getClient(),{data:r,error:n}=await t.from("ufp_replies").select("*").eq("comment_id",e);if(n)throw n;return(r??[]).map(JS).sort((i,o)=>i.createdAt-o.createdAt)}subscribeToComments(e,t,r){let n=null,s=!0;const i=async()=>{if(s)try{const o=await this.getComments(e,t);s&&r(o)}catch(o){console.error("[ui-feedback-plugin] Supabase fetch error:",o)}};return i(),this._getClient().then(o=>{s&&(n=o.channel("ufp-comments").on("postgres_changes",{event:"*",schema:"public",table:"ufp_comments"},()=>{i()}).subscribe())}).catch(console.error),()=>{s=!1,n&&this._getClient().then(o=>o.removeChannel(n)).catch(()=>{})}}async uploadScreenshot(e,t){var p;const r=await this._getClient(),[n,s]=t.split(","),i=((p=n.match(/:(.*?);/))==null?void 0:p[1])??"image/png",o=atob(s),a=new Uint8Array(o.length);for(let w=0;w<o.length;w++)a[w]=o.charCodeAt(w);const l=new Blob([a],{type:i}),u=`${e}.png`,{error:d}=await r.storage.from("ufp-screenshots").upload(u,l,{contentType:"image/png",upsert:!0});if(d)throw d;const{data:g}=r.storage.from("ufp-screenshots").getPublicUrl(u);return g.publicUrl}}const YS=Object.freeze(Object.defineProperty({__proto__:null,SupabaseAdapter:XS},Symbol.toStringTag,{value:"Module"}));class ZS{constructor(e){ut(this,"cfg");ut(this,"_s3",null);this.cfg=e}async cognito(e,t){const r=await fetch(`https://cognito-identity.${this.cfg.region}.amazonaws.com/`,{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":`AWSCognitoIdentityService.${e}`},body:JSON.stringify(t)});if(!r.ok)throw new Error(`Cognito ${e} failed: ${r.status} ${await r.text()}`);return r.json()}async credentials(){const e=`ufp:identity:${this.cfg.identityPoolId}`;let t=null;try{t=localStorage.getItem(e)}catch{}if(!t){t=(await this.cognito("GetId",{IdentityPoolId:this.cfg.identityPoolId})).IdentityId;try{localStorage.setItem(e,t)}catch{}}const{Credentials:r}=await this.cognito("GetCredentialsForIdentity",{IdentityId:t});return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretKey,sessionToken:r.SessionToken,expiration:new Date(r.Expiration*1e3)}}async s3(){if(this._s3)return this._s3;const{S3Client:e}=await import("@aws-sdk/client-s3");return this._s3=new e({region:this.cfg.region,credentials:()=>this.credentials()}),this._s3}async pageHash(e){const t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,16)}async put(e,t,r){const{PutObjectCommand:n}=await import("@aws-sdk/client-s3");await(await this.s3()).send(new n({Bucket:this.cfg.bucket,Key:e,Body:t,ContentType:r}))}async getJson(e){const{GetObjectCommand:t}=await import("@aws-sdk/client-s3"),s=await(await(await this.s3()).send(new t({Bucket:this.cfg.bucket,Key:e}))).Body.transformToString();return JSON.parse(s)}async listKeys(e){const{ListObjectsV2Command:t}=await import("@aws-sdk/client-s3"),r=await this.s3(),n=[];let s;do{const i=await r.send(new t({Bucket:this.cfg.bucket,Prefix:e,ContinuationToken:s}));for(const o of i.Contents??[])o.Key&&n.push(o.Key);s=i.NextContinuationToken}while(s);return n}indexKey(e){return`ufp/_index/${e}.json`}async lookupComment(e){const{p:t,h:r}=await this.getJson(this.indexKey(e));return{key:`ufp/${t}/${r}/comments/${e}.json`}}async addComment(e){const t=await this.pageHash(e.pageUrl),r=crypto.randomUUID();return await Promise.all([this.put(`ufp/${e.projectKey}/${t}/comments/${r}.json`,JSON.stringify({id:r,...e}),"application/json"),this.put(this.indexKey(r),JSON.stringify({p:e.projectKey,h:t}),"application/json")]),r}async getComments(e,t){const r=await this.pageHash(e),n=await this.listKeys(`ufp/${t}/${r}/comments/`);return(await Promise.all(n.map(i=>this.getJson(i).catch(()=>null)))).filter(i=>i!==null&&!i.deleted).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,t){const{key:r}=await this.lookupComment(e),n=await this.getJson(r);await this.put(r,JSON.stringify({...n,...t}),"application/json")}async deleteComment(e){const{key:t}=await this.lookupComment(e),r=await this.getJson(t);await this.put(t,JSON.stringify({...r,deleted:!0}),"application/json")}async addReply(e){const t=crypto.randomUUID();return await this.put(`ufp/replies/${e.commentId}/${t}.json`,JSON.stringify({id:t,...e}),"application/json"),t}async getReplies(e){const t=await this.listKeys(`ufp/replies/${e}/`);return(await Promise.all(t.map(n=>this.getJson(n).catch(()=>null)))).filter(n=>n!==null).sort((n,s)=>n.createdAt-s.createdAt)}subscribeToComments(e,t,r){let n=!0;const s=this.cfg.pollInterval??5e3,i=async()=>{if(n){try{const o=await this.getComments(e,t);n&&r(o)}catch(o){console.error("[ui-feedback-plugin] AWS poll error:",o)}n&&setTimeout(i,s)}};return i(),()=>{n=!1}}async uploadScreenshot(e,t){const{p:r,h:n}=await this.getJson(this.indexKey(e)),s=`ufp/${r}/${n}/screenshots/${e}.png`,i=t.split(",")[1],o=atob(i),a=new Uint8Array(o.length);for(let l=0;l<o.length;l++)a[l]=o.charCodeAt(l);return await this.put(s,a,"image/png"),`https://${this.cfg.bucket}.s3.${this.cfg.region}.amazonaws.com/${s}`}}const eR=Object.freeze(Object.defineProperty({__proto__:null,AWSAdapter:ZS},Symbol.toStringTag,{value:"Module"}));class tR{constructor(){ut(this,"listeners",new Set)}getCommentsFromStorage(){const e=sessionStorage.getItem("ufp_comments");return e?JSON.parse(e):[]}saveCommentsToStorage(e){sessionStorage.setItem("ufp_comments",JSON.stringify(e)),this.notifyListeners()}getRepliesFromStorage(){const e=sessionStorage.getItem("ufp_replies");return e?JSON.parse(e):[]}saveRepliesToStorage(e){sessionStorage.setItem("ufp_replies",JSON.stringify(e))}notifyListeners(){const e=this.getCommentsFromStorage();for(const t of this.listeners)t(e)}async addComment(e){const t=this.getCommentsFromStorage(),r=Math.random().toString(36).substring(2,9),n={...e,id:r};return t.push(n),this.saveCommentsToStorage(t),r}async getComments(e,t){return this.getCommentsFromStorage().filter(n=>n.pageUrl===e&&n.projectKey===t)}async updateComment(e,t){const r=this.getCommentsFromStorage(),n=r.findIndex(s=>s.id===e);n!==-1&&(r[n]={...r[n],...t},this.saveCommentsToStorage(r))}async deleteComment(e){const r=this.getCommentsFromStorage().filter(i=>i.id!==e);this.saveCommentsToStorage(r);const s=this.getRepliesFromStorage().filter(i=>i.commentId!==e);this.saveRepliesToStorage(s)}async addReply(e){const t=this.getRepliesFromStorage(),r=Math.random().toString(36).substring(2,9),n={...e,id:r};return t.push(n),this.saveRepliesToStorage(t),r}async getReplies(e){return this.getRepliesFromStorage().filter(r=>r.commentId===e)}subscribeToComments(e,t,r){const n=s=>{r(s.filter(i=>i.pageUrl===e&&i.projectKey===t))};return this.listeners.add(n),n(this.getCommentsFromStorage()),()=>{this.listeners.delete(n)}}async uploadScreenshot(e,t){return t}}const AR=Object.freeze(Object.defineProperty({__proto__:null,LocalAdapter:tR},Symbol.toStringTag,{value:"Module"}));function _o(A,e){var t={};for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&e.indexOf(r)<0&&(t[r]=A[r]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(A);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(A,r[n])&&(t[r[n]]=A[r[n]]);return t}function rR(A,e,t,r){function n(s){return s instanceof t?s:new t(function(i){i(s)})}return new(t||(t=Promise))(function(s,i){function o(u){try{l(r.next(u))}catch(d){i(d)}}function a(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):n(u.value).then(o,a)}l((r=r.apply(A,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;const nR=A=>A?(...e)=>A(...e):(...e)=>fetch(...e);class Eo extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class fw extends Eo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Dl extends Eo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Hl extends Eo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var vo;(function(A){A.Any="any",A.ApNortheast1="ap-northeast-1",A.ApNortheast2="ap-northeast-2",A.ApSouth1="ap-south-1",A.ApSoutheast1="ap-southeast-1",A.ApSoutheast2="ap-southeast-2",A.CaCentral1="ca-central-1",A.EuCentral1="eu-central-1",A.EuWest1="eu-west-1",A.EuWest2="eu-west-2",A.EuWest3="eu-west-3",A.SaEast1="sa-east-1",A.UsEast1="us-east-1",A.UsWest1="us-west-1",A.UsWest2="us-west-2"})(vo||(vo={}));class sR{constructor(e,{headers:t={},customFetch:r,region:n=vo.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=nR(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return rR(this,arguments,void 0,function*(t,r={}){var n;let s,i;try{const{headers:o,method:a,body:l,signal:u,timeout:d}=r;let g={},{region:p}=r;p||(p=this.region);const w=new URL(`${this.url}/${t}`);p&&p!=="any"&&(g["x-region"]=p,w.searchParams.set("forceFunctionRegion",p));let y;l&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&l instanceof Blob||l instanceof ArrayBuffer?(g["Content-Type"]="application/octet-stream",y=l):typeof l=="string"?(g["Content-Type"]="text/plain",y=l):typeof FormData<"u"&&l instanceof FormData?y=l:(g["Content-Type"]="application/json",y=JSON.stringify(l)):l&&typeof l!="string"&&!(typeof Blob<"u"&&l instanceof Blob)&&!(l instanceof ArrayBuffer)&&!(typeof FormData<"u"&&l instanceof FormData)?y=JSON.stringify(l):y=l;let B=u;d&&(i=new AbortController,s=setTimeout(()=>i.abort(),d),u?(B=i.signal,u.addEventListener("abort",()=>i.abort())):B=i.signal);const b=yield this.fetch(w.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},g),this.headers),o),body:y,signal:B}).catch(K=>{throw new fw(K)}),S=b.headers.get("x-relay-error");if(S&&S==="true")throw new Dl(b);if(!b.ok)throw new Hl(b);let I=((n=b.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),R;return I==="application/json"?R=yield b.json():I==="application/octet-stream"||I==="application/pdf"?R=yield b.blob():I==="text/event-stream"?R=b:I==="multipart/form-data"?R=yield b.formData():R=yield b.text(),{data:R,error:null,response:b}}catch(o){return{data:null,error:o,response:o instanceof Hl||o instanceof Dl?o.context:void 0}}finally{s&&clearTimeout(s)}})}}const gw=3,pw=A=>Math.min(1e3*2**A,3e4),iR=[520,503],ww=["GET","HEAD","OPTIONS"];var Ol=class extends Error{constructor(A){super(A.message),this.name="PostgrestError",this.details=A.details,this.hint=A.hint,this.code=A.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function mw(A,e){return new Promise(t=>{if(e!=null&&e.aborted){t();return}const r=setTimeout(()=>{e==null||e.removeEventListener("abort",n),t()},A);function n(){clearTimeout(r),t()}e==null||e.addEventListener("abort",n)})}function oR(A,e,t,r){return!(!r||t>=gw||!ww.includes(A)||!iR.includes(e))}var aR=class{constructor(A){var e,t,r,n,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=A.method,this.url=A.url,this.headers=new Headers(A.headers),this.schema=A.schema,this.body=A.body,this.shouldThrowOnError=(e=A.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=A.signal,this.isMaybeSingle=(t=A.isMaybeSingle)!==null&&t!==void 0?t:!1,this.shouldStripNulls=(r=A.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=A.urlLengthLimit)!==null&&n!==void 0?n:8e3,this.retryEnabled=(s=A.retry)!==null&&s!==void 0?s:!0,A.fetch?this.fetch=A.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(A,e){return this.headers=new Headers(this.headers),this.headers.set(A,e),this}retry(A){return this.retryEnabled=A,this}then(A,e){var t=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let s=(async()=>{let i=0;for(;;){const l={};t.headers.forEach((d,g)=>{l[g]=d}),i>0&&(l["X-Retry-Count"]=String(i));let u;try{u=await r(t.url.toString(),{method:t.method,headers:l,body:JSON.stringify(t.body,(d,g)=>typeof g=="bigint"?g.toString():g),signal:t.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!ww.includes(t.method))throw d;if(t.retryEnabled&&i<gw){const g=pw(i);i++,await mw(g,t.signal);continue}throw d}if(oR(t.method,u.status,i,t.retryEnabled)){var o,a;const d=(o=(a=u.headers)===null||a===void 0?void 0:a.get("Retry-After"))!==null&&o!==void 0?o:null,g=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:pw(i);await u.text(),i++,await mw(g,t.signal);continue}return await t.processResponse(u)}})();return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="",l="",u="";const d=i==null?void 0:i.cause;if(d){var g,p,w,y;const S=(g=d==null?void 0:d.message)!==null&&g!==void 0?g:"",I=(p=d==null?void 0:d.code)!==null&&p!==void 0?p:"";a=`${(w=i==null?void 0:i.name)!==null&&w!==void 0?w:"FetchError"}: ${i==null?void 0:i.message}`,a+=`
2980
+ */const dw="storage";function OS(A,e,t,r){return A=ot(A),SS(A,e,t,r)}function PS(A){return A=ot(A),RS(A)}function NS(A,e){return A=ot(A),DS(A,e)}function MS(A=If(),e){A=ot(A);const r=bf(A,dw).getImmediate({identifier:e}),n=hf("storage");return n&&VS(r,...n),r}function VS(A,e,t,r={}){HS(A,e,t,r)}function KS(A,{instanceIdentifier:e}){const t=A.getProvider("app").getImmediate(),r=A.getProvider("auth-internal"),n=A.getProvider("app-check-internal");return new kl(t,r,n,e,Uf)}function $S(){Nn(new Dr(dw,KS,"PUBLIC").setMultipleInstances(!0)),QA(uw,hw,""),QA(uw,hw,"esm2017")}$S();class jS{constructor(e){ut(this,"db");ut(this,"storage");const{provider:t,...r}=e;let n;const s=wQ().find(i=>i.name==="ui-feedback-plugin");s?n=s:n=Qf(r,"ui-feedback-plugin"),this.db=hT(n),this.storage=MS(n)}async addComment(e){return(await $p(cs(this.db,"ufp_comments"),e)).id}async getComments(e,t){const r=Hp(cs(this.db,"ufp_comments"),wo("pageUrl","==",e),wo("projectKey","==",t));return(await Kp(r)).docs.map(i=>({id:i.id,...i.data()})).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,t){await QT(hl(this.db,"ufp_comments",e),t)}async deleteComment(e){await IT(hl(this.db,"ufp_comments",e))}async addReply(e){return(await $p(cs(this.db,"ufp_comments",e.commentId,"replies"),e)).id}async getReplies(e){return(await Kp(cs(this.db,"ufp_comments",e,"replies"))).docs.map(n=>({id:n.id,...n.data()})).sort((n,s)=>n.createdAt-s.createdAt)}subscribeToComments(e,t,r){const n=Hp(cs(this.db,"ufp_comments"),wo("pageUrl","==",e),wo("projectKey","==",t));return FT(n,s=>{const i=s.docs.map(o=>({id:o.id,...o.data()})).sort((o,a)=>a.createdAt-o.createdAt);r(i)},s=>{console.error("[ui-feedback-plugin] Firestore listener error:",s)})}async uploadScreenshot(e,t){const r=NS(this.storage,`ufp_screenshots/${e}.png`);return await OS(r,t,"data_url"),PS(r)}}const GS=Object.freeze(Object.defineProperty({__proto__:null,FirebaseAdapter:jS},Symbol.toStringTag,{value:"Module"}));function WS(A){return{id:A.id,pageUrl:A.page_url,projectKey:A.project_key,authorName:A.author_name,text:A.text,screenshotUrl:A.screenshot_url??"",annotation:A.annotation,resolved:A.resolved,createdAt:A.created_at}}function qS(A){return{page_url:A.pageUrl,project_key:A.projectKey,author_name:A.authorName,text:A.text,screenshot_url:A.screenshotUrl,annotation:A.annotation,resolved:A.resolved,created_at:A.createdAt}}function JS(A){return{id:A.id,commentId:A.comment_id,authorName:A.author_name,text:A.text,createdAt:A.created_at}}function zS(A){return{comment_id:A.commentId,author_name:A.authorName,text:A.text,created_at:A.createdAt}}class XS{constructor(e,t){ut(this,"client");ut(this,"_url");ut(this,"_key");ut(this,"_client",null);this._url=e,this._key=t}async _getClient(){if(this._client)return this._client;try{const{createClient:e}=await Promise.resolve().then(()=>Jx);return this._client=e(this._url,this._key),this._client}catch{throw new Error("[ui-feedback-plugin] @supabase/supabase-js is not installed. Run: npm install @supabase/supabase-js")}}async addComment(e){const t=await this._getClient(),{data:r,error:n}=await t.from("ufp_comments").insert(qS(e)).select("id").single();if(n)throw n;return r.id}async getComments(e,t){const r=await this._getClient(),{data:n,error:s}=await r.from("ufp_comments").select("*").eq("page_url",e).eq("project_key",t);if(s)throw s;return(n??[]).map(WS).sort((o,a)=>a.createdAt-o.createdAt)}async updateComment(e,t){const r=await this._getClient(),n={};t.resolved!==void 0&&(n.resolved=t.resolved),t.screenshotUrl!==void 0&&(n.screenshot_url=t.screenshotUrl),t.text!==void 0&&(n.text=t.text),t.annotation!==void 0&&(n.annotation=t.annotation);const{error:s}=await r.from("ufp_comments").update(n).eq("id",e);if(s)throw s}async deleteComment(e){const t=await this._getClient(),{error:r}=await t.from("ufp_comments").delete().eq("id",e);if(r)throw r}async addReply(e){const t=await this._getClient(),{data:r,error:n}=await t.from("ufp_replies").insert(zS(e)).select("id").single();if(n)throw n;return r.id}async getReplies(e){const t=await this._getClient(),{data:r,error:n}=await t.from("ufp_replies").select("*").eq("comment_id",e);if(n)throw n;return(r??[]).map(JS).sort((i,o)=>i.createdAt-o.createdAt)}subscribeToComments(e,t,r){let n=null,s=!0;const i=async()=>{if(s)try{const o=await this.getComments(e,t);s&&r(o)}catch(o){console.error("[ui-feedback-plugin] Supabase fetch error:",o)}};return i(),this._getClient().then(o=>{s&&(n=o.channel("ufp-comments").on("postgres_changes",{event:"*",schema:"public",table:"ufp_comments"},()=>{i()}).subscribe())}).catch(console.error),()=>{s=!1,n&&this._getClient().then(o=>o.removeChannel(n)).catch(()=>{})}}async uploadScreenshot(e,t){var p;const r=await this._getClient(),[n,s]=t.split(","),i=((p=n.match(/:(.*?);/))==null?void 0:p[1])??"image/png",o=atob(s),a=new Uint8Array(o.length);for(let w=0;w<o.length;w++)a[w]=o.charCodeAt(w);const l=new Blob([a],{type:i}),u=`${e}.png`,{error:d}=await r.storage.from("ufp-screenshots").upload(u,l,{contentType:"image/png",upsert:!0});if(d)throw d;const{data:g}=r.storage.from("ufp-screenshots").getPublicUrl(u);return g.publicUrl}}const YS=Object.freeze(Object.defineProperty({__proto__:null,SupabaseAdapter:XS},Symbol.toStringTag,{value:"Module"}));class ZS{constructor(e){ut(this,"cfg");ut(this,"_s3",null);this.cfg=e}async cognito(e,t){const r=await fetch(`https://cognito-identity.${this.cfg.region}.amazonaws.com/`,{method:"POST",headers:{"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":`AWSCognitoIdentityService.${e}`},body:JSON.stringify(t)});if(!r.ok)throw new Error(`Cognito ${e} failed: ${r.status} ${await r.text()}`);return r.json()}async credentials(){const e=`ufp:identity:${this.cfg.identityPoolId}`;let t=null;try{t=localStorage.getItem(e)}catch{}if(!t){t=(await this.cognito("GetId",{IdentityPoolId:this.cfg.identityPoolId})).IdentityId;try{localStorage.setItem(e,t)}catch{}}const{Credentials:r}=await this.cognito("GetCredentialsForIdentity",{IdentityId:t});return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretKey,sessionToken:r.SessionToken,expiration:new Date(r.Expiration*1e3)}}async s3(){if(this._s3)return this._s3;const{S3Client:e}=await import("@aws-sdk/client-s3");return this._s3=new e({region:this.cfg.region,credentials:()=>this.credentials()}),this._s3}async pageHash(e){const t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map(n=>n.toString(16).padStart(2,"0")).join("").slice(0,16)}async put(e,t,r){const{PutObjectCommand:n}=await import("@aws-sdk/client-s3");await(await this.s3()).send(new n({Bucket:this.cfg.bucket,Key:e,Body:t,ContentType:r}))}async getJson(e){const{GetObjectCommand:t}=await import("@aws-sdk/client-s3"),s=await(await(await this.s3()).send(new t({Bucket:this.cfg.bucket,Key:e}))).Body.transformToString();return JSON.parse(s)}async listKeys(e){const{ListObjectsV2Command:t}=await import("@aws-sdk/client-s3"),r=await this.s3(),n=[];let s;do{const i=await r.send(new t({Bucket:this.cfg.bucket,Prefix:e,ContinuationToken:s}));for(const o of i.Contents??[])o.Key&&n.push(o.Key);s=i.NextContinuationToken}while(s);return n}indexKey(e){return`ufp/_index/${e}.json`}async lookupComment(e){const{p:t,h:r}=await this.getJson(this.indexKey(e));return{key:`ufp/${t}/${r}/comments/${e}.json`}}async addComment(e){const t=await this.pageHash(e.pageUrl),r=crypto.randomUUID();return await Promise.all([this.put(`ufp/${e.projectKey}/${t}/comments/${r}.json`,JSON.stringify({id:r,...e}),"application/json"),this.put(this.indexKey(r),JSON.stringify({p:e.projectKey,h:t}),"application/json")]),r}async getComments(e,t){const r=await this.pageHash(e),n=await this.listKeys(`ufp/${t}/${r}/comments/`);return(await Promise.all(n.map(i=>this.getJson(i).catch(()=>null)))).filter(i=>i!==null&&!i.deleted).sort((i,o)=>o.createdAt-i.createdAt)}async updateComment(e,t){const{key:r}=await this.lookupComment(e),n=await this.getJson(r);await this.put(r,JSON.stringify({...n,...t}),"application/json")}async deleteComment(e){const{key:t}=await this.lookupComment(e),r=await this.getJson(t);await this.put(t,JSON.stringify({...r,deleted:!0}),"application/json")}async addReply(e){const t=crypto.randomUUID();return await this.put(`ufp/replies/${e.commentId}/${t}.json`,JSON.stringify({id:t,...e}),"application/json"),t}async getReplies(e){const t=await this.listKeys(`ufp/replies/${e}/`);return(await Promise.all(t.map(n=>this.getJson(n).catch(()=>null)))).filter(n=>n!==null).sort((n,s)=>n.createdAt-s.createdAt)}subscribeToComments(e,t,r){let n=!0;const s=this.cfg.pollInterval??5e3,i=async()=>{if(n){try{const o=await this.getComments(e,t);n&&r(o)}catch(o){console.error("[ui-feedback-plugin] AWS poll error:",o)}n&&setTimeout(i,s)}};return i(),()=>{n=!1}}async uploadScreenshot(e,t){const{p:r,h:n}=await this.getJson(this.indexKey(e)),s=`ufp/${r}/${n}/screenshots/${e}.png`,i=t.split(",")[1],o=atob(i),a=new Uint8Array(o.length);for(let l=0;l<o.length;l++)a[l]=o.charCodeAt(l);return await this.put(s,a,"image/png"),`https://${this.cfg.bucket}.s3.${this.cfg.region}.amazonaws.com/${s}`}}const eR=Object.freeze(Object.defineProperty({__proto__:null,AWSAdapter:ZS},Symbol.toStringTag,{value:"Module"}));class tR{constructor(){ut(this,"listeners",new Set)}getCommentsFromStorage(){const e=sessionStorage.getItem("ufp_comments");return e?JSON.parse(e):[]}saveCommentsToStorage(e){sessionStorage.setItem("ufp_comments",JSON.stringify(e)),this.notifyListeners()}getRepliesFromStorage(){const e=sessionStorage.getItem("ufp_replies");return e?JSON.parse(e):[]}saveRepliesToStorage(e){sessionStorage.setItem("ufp_replies",JSON.stringify(e))}notifyListeners(){const e=this.getCommentsFromStorage();for(const t of this.listeners)t(e)}async addComment(e){const t=this.getCommentsFromStorage(),r=Math.random().toString(36).substring(2,9),n={...e,id:r};return t.push(n),this.saveCommentsToStorage(t),r}async getComments(e,t){return this.getCommentsFromStorage().filter(n=>n.pageUrl===e&&n.projectKey===t)}async updateComment(e,t){const r=this.getCommentsFromStorage(),n=r.findIndex(s=>s.id===e);n!==-1&&(r[n]={...r[n],...t},this.saveCommentsToStorage(r))}async deleteComment(e){const r=this.getCommentsFromStorage().filter(i=>i.id!==e);this.saveCommentsToStorage(r);const s=this.getRepliesFromStorage().filter(i=>i.commentId!==e);this.saveRepliesToStorage(s)}async addReply(e){const t=this.getRepliesFromStorage(),r=Math.random().toString(36).substring(2,9),n={...e,id:r};return t.push(n),this.saveRepliesToStorage(t),r}async getReplies(e){return this.getRepliesFromStorage().filter(r=>r.commentId===e)}subscribeToComments(e,t,r){const n=s=>{r(s.filter(i=>i.pageUrl===e&&i.projectKey===t))};return this.listeners.add(n),n(this.getCommentsFromStorage()),()=>{this.listeners.delete(n)}}async uploadScreenshot(e,t){return t}}const AR=Object.freeze(Object.defineProperty({__proto__:null,LocalAdapter:tR},Symbol.toStringTag,{value:"Module"}));function Co(A,e){var t={};for(var r in A)Object.prototype.hasOwnProperty.call(A,r)&&e.indexOf(r)<0&&(t[r]=A[r]);if(A!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(A);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(A,r[n])&&(t[r[n]]=A[r[n]]);return t}function rR(A,e,t,r){function n(s){return s instanceof t?s:new t(function(i){i(s)})}return new(t||(t=Promise))(function(s,i){function o(u){try{l(r.next(u))}catch(d){i(d)}}function a(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):n(u.value).then(o,a)}l((r=r.apply(A,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;const nR=A=>A?(...e)=>A(...e):(...e)=>fetch(...e);class _o extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class fw extends _o{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Ll extends _o{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Dl extends _o{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Eo;(function(A){A.Any="any",A.ApNortheast1="ap-northeast-1",A.ApNortheast2="ap-northeast-2",A.ApSouth1="ap-south-1",A.ApSoutheast1="ap-southeast-1",A.ApSoutheast2="ap-southeast-2",A.CaCentral1="ca-central-1",A.EuCentral1="eu-central-1",A.EuWest1="eu-west-1",A.EuWest2="eu-west-2",A.EuWest3="eu-west-3",A.SaEast1="sa-east-1",A.UsEast1="us-east-1",A.UsWest1="us-west-1",A.UsWest2="us-west-2"})(Eo||(Eo={}));class sR{constructor(e,{headers:t={},customFetch:r,region:n=Eo.Any}={}){this.url=e,this.headers=t,this.region=n,this.fetch=nR(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return rR(this,arguments,void 0,function*(t,r={}){var n;let s,i;try{const{headers:o,method:a,body:l,signal:u,timeout:d}=r;let g={},{region:p}=r;p||(p=this.region);const w=new URL(`${this.url}/${t}`);p&&p!=="any"&&(g["x-region"]=p,w.searchParams.set("forceFunctionRegion",p));let y;l&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&l instanceof Blob||l instanceof ArrayBuffer?(g["Content-Type"]="application/octet-stream",y=l):typeof l=="string"?(g["Content-Type"]="text/plain",y=l):typeof FormData<"u"&&l instanceof FormData?y=l:(g["Content-Type"]="application/json",y=JSON.stringify(l)):l&&typeof l!="string"&&!(typeof Blob<"u"&&l instanceof Blob)&&!(l instanceof ArrayBuffer)&&!(typeof FormData<"u"&&l instanceof FormData)?y=JSON.stringify(l):y=l;let B=u;d&&(i=new AbortController,s=setTimeout(()=>i.abort(),d),u?(B=i.signal,u.addEventListener("abort",()=>i.abort())):B=i.signal);const b=yield this.fetch(w.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},g),this.headers),o),body:y,signal:B}).catch(K=>{throw new fw(K)}),S=b.headers.get("x-relay-error");if(S&&S==="true")throw new Ll(b);if(!b.ok)throw new Dl(b);let I=((n=b.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),R;return I==="application/json"?R=yield b.json():I==="application/octet-stream"||I==="application/pdf"?R=yield b.blob():I==="text/event-stream"?R=b:I==="multipart/form-data"?R=yield b.formData():R=yield b.text(),{data:R,error:null,response:b}}catch(o){return{data:null,error:o,response:o instanceof Dl||o instanceof Ll?o.context:void 0}}finally{s&&clearTimeout(s)}})}}const gw=3,pw=A=>Math.min(1e3*2**A,3e4),iR=[520,503],ww=["GET","HEAD","OPTIONS"];var Hl=class extends Error{constructor(A){super(A.message),this.name="PostgrestError",this.details=A.details,this.hint=A.hint,this.code=A.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function mw(A,e){return new Promise(t=>{if(e!=null&&e.aborted){t();return}const r=setTimeout(()=>{e==null||e.removeEventListener("abort",n),t()},A);function n(){clearTimeout(r),t()}e==null||e.addEventListener("abort",n)})}function oR(A,e,t,r){return!(!r||t>=gw||!ww.includes(A)||!iR.includes(e))}var aR=class{constructor(A){var e,t,r,n,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=A.method,this.url=A.url,this.headers=new Headers(A.headers),this.schema=A.schema,this.body=A.body,this.shouldThrowOnError=(e=A.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=A.signal,this.isMaybeSingle=(t=A.isMaybeSingle)!==null&&t!==void 0?t:!1,this.shouldStripNulls=(r=A.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=A.urlLengthLimit)!==null&&n!==void 0?n:8e3,this.retryEnabled=(s=A.retry)!==null&&s!==void 0?s:!0,A.fetch?this.fetch=A.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(A,e){return this.headers=new Headers(this.headers),this.headers.set(A,e),this}retry(A){return this.retryEnabled=A,this}then(A,e){var t=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let s=(async()=>{let i=0;for(;;){const l={};t.headers.forEach((d,g)=>{l[g]=d}),i>0&&(l["X-Retry-Count"]=String(i));let u;try{u=await r(t.url.toString(),{method:t.method,headers:l,body:JSON.stringify(t.body,(d,g)=>typeof g=="bigint"?g.toString():g),signal:t.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!ww.includes(t.method))throw d;if(t.retryEnabled&&i<gw){const g=pw(i);i++,await mw(g,t.signal);continue}throw d}if(oR(t.method,u.status,i,t.retryEnabled)){var o,a;const d=(o=(a=u.headers)===null||a===void 0?void 0:a.get("Retry-After"))!==null&&o!==void 0?o:null,g=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:pw(i);await u.text(),i++,await mw(g,t.signal);continue}return await t.processResponse(u)}})();return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="",l="",u="";const d=i==null?void 0:i.cause;if(d){var g,p,w,y;const S=(g=d==null?void 0:d.message)!==null&&g!==void 0?g:"",I=(p=d==null?void 0:d.code)!==null&&p!==void 0?p:"";a=`${(w=i==null?void 0:i.name)!==null&&w!==void 0?w:"FetchError"}: ${i==null?void 0:i.message}`,a+=`
2981
2981
 
2982
2982
  Caused by: ${(y=d==null?void 0:d.name)!==null&&y!==void 0?y:"Error"}: ${S}`,I&&(a+=` (${I})`),d!=null&&d.stack&&(a+=`
2983
- ${d.stack}`)}else{var B;a=(B=i==null?void 0:i.stack)!==null&&B!==void 0?B:""}const b=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(l+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),s.then(A,e)}async processResponse(A){var e=this;let t=null,r=null,n=null,s=A.status,i=A.statusText;if(A.ok){var o,a;if(e.method!=="HEAD"){var l;const g=await A.text();if(g!=="")if(e.headers.get("Accept")==="text/csv")r=g;else if(e.headers.get("Accept")&&(!((l=e.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")))r=g;else try{r=JSON.parse(g)}catch{if(t={message:g},r=null,e.shouldThrowOnError)throw new Ol({message:g,details:"",hint:"",code:""})}}const u=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),d=(a=A.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");u&&d&&d.length>1&&(n=parseInt(d[1])),e.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(t={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,n=null,s=406,i="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const u=await A.text();try{t=JSON.parse(u),Array.isArray(t)&&A.status===404&&(r=[],t=null,s=200,i="OK")}catch{A.status===404&&u===""?(s=204,i="No Content"):t={message:u}}if(t&&e.shouldThrowOnError)throw new Ol(t)}return{success:t===null,error:t,data:r,count:n,status:s,statusText:i}}returns(){return this}overrideTypes(){return this}},cR=class extends aR{throwOnError(){return super.throwOnError()}select(A){let e=!1;const t=(A??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",t),this.headers.append("Prefer","return=representation"),this}order(A,{ascending:e=!0,nullsFirst:t,foreignTable:r,referencedTable:n=r}={}){const s=n?`${n}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${A}.${e?"asc":"desc"}${t===void 0?"":t?".nullsfirst":".nullslast"}`),this}limit(A,{foreignTable:e,referencedTable:t=e}={}){const r=typeof t>"u"?"limit":`${t}.limit`;return this.url.searchParams.set(r,`${A}`),this}range(A,e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${A}`),this.url.searchParams.set(s,`${e-A+1}`),this}abortSignal(A){return this.signal=A,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:A=!1,verbose:e=!1,settings:t=!1,buffers:r=!1,wal:n=!1,format:s="text"}={}){var i;const o=[A?"analyze":null,e?"verbose":null,t?"settings":null,r?"buffers":null,n?"wal":null].filter(Boolean).join("|"),a=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${a}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(A){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${A}`),this}};const Bw=new RegExp("[,()]");var zr=class extends cR{throwOnError(){return super.throwOnError()}eq(A,e){return this.url.searchParams.append(A,`eq.${e}`),this}neq(A,e){return this.url.searchParams.append(A,`neq.${e}`),this}gt(A,e){return this.url.searchParams.append(A,`gt.${e}`),this}gte(A,e){return this.url.searchParams.append(A,`gte.${e}`),this}lt(A,e){return this.url.searchParams.append(A,`lt.${e}`),this}lte(A,e){return this.url.searchParams.append(A,`lte.${e}`),this}like(A,e){return this.url.searchParams.append(A,`like.${e}`),this}likeAllOf(A,e){return this.url.searchParams.append(A,`like(all).{${e.join(",")}}`),this}likeAnyOf(A,e){return this.url.searchParams.append(A,`like(any).{${e.join(",")}}`),this}ilike(A,e){return this.url.searchParams.append(A,`ilike.${e}`),this}ilikeAllOf(A,e){return this.url.searchParams.append(A,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(A,e){return this.url.searchParams.append(A,`ilike(any).{${e.join(",")}}`),this}regexMatch(A,e){return this.url.searchParams.append(A,`match.${e}`),this}regexIMatch(A,e){return this.url.searchParams.append(A,`imatch.${e}`),this}is(A,e){return this.url.searchParams.append(A,`is.${e}`),this}isDistinct(A,e){return this.url.searchParams.append(A,`isdistinct.${e}`),this}in(A,e){const t=Array.from(new Set(e)).map(r=>typeof r=="string"&&Bw.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(A,`in.(${t})`),this}notIn(A,e){const t=Array.from(new Set(e)).map(r=>typeof r=="string"&&Bw.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(A,`not.in.(${t})`),this}contains(A,e){return typeof e=="string"?this.url.searchParams.append(A,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(A,`cs.{${e.join(",")}}`):this.url.searchParams.append(A,`cs.${JSON.stringify(e)}`),this}containedBy(A,e){return typeof e=="string"?this.url.searchParams.append(A,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(A,`cd.{${e.join(",")}}`):this.url.searchParams.append(A,`cd.${JSON.stringify(e)}`),this}rangeGt(A,e){return this.url.searchParams.append(A,`sr.${e}`),this}rangeGte(A,e){return this.url.searchParams.append(A,`nxl.${e}`),this}rangeLt(A,e){return this.url.searchParams.append(A,`sl.${e}`),this}rangeLte(A,e){return this.url.searchParams.append(A,`nxr.${e}`),this}rangeAdjacent(A,e){return this.url.searchParams.append(A,`adj.${e}`),this}overlaps(A,e){return typeof e=="string"?this.url.searchParams.append(A,`ov.${e}`):this.url.searchParams.append(A,`ov.{${e.join(",")}}`),this}textSearch(A,e,{config:t,type:r}={}){let n="";r==="plain"?n="pl":r==="phrase"?n="ph":r==="websearch"&&(n="w");const s=t===void 0?"":`(${t})`;return this.url.searchParams.append(A,`${n}fts${s}.${e}`),this}match(A){return Object.entries(A).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(A,e,t){return this.url.searchParams.append(A,`not.${e}.${t}`),this}or(A,{foreignTable:e,referencedTable:t=e}={}){const r=t?`${t}.or`:"or";return this.url.searchParams.append(r,`(${A})`),this}filter(A,e,t){return this.url.searchParams.append(A,`${e}.${t}`),this}},lR=class{constructor(A,{headers:e={},schema:t,fetch:r,urlLengthLimit:n=8e3,retry:s}){this.url=A,this.headers=new Headers(e),this.schema=t,this.fetch=r,this.urlLengthLimit=n,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(A,e){const{head:t=!1,count:r}=e??{},n=t?"HEAD":"GET";let s=!1;const i=(A??"*").split("").map(l=>/\s/.test(l)&&!s?"":(l==='"'&&(s=!s),l)).join(""),{url:o,headers:a}=this.cloneRequestState();return o.searchParams.set("select",i),r&&a.append("Prefer",`count=${r}`),new zr({method:n,url:o,headers:a,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(A,{count:e,defaultToNull:t=!0}={}){var r;const n="POST",{url:s,headers:i}=this.cloneRequestState();if(e&&i.append("Prefer",`count=${e}`),t||i.append("Prefer","missing=default"),Array.isArray(A)){const o=A.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>0){const a=[...new Set(o)].map(l=>`"${l}"`);s.searchParams.set("columns",a.join(","))}}return new zr({method:n,url:s,headers:i,schema:this.schema,body:A,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(A,{onConflict:e,ignoreDuplicates:t=!1,count:r,defaultToNull:n=!0}={}){var s;const i="POST",{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${t?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),r&&a.append("Prefer",`count=${r}`),n||a.append("Prefer","missing=default"),Array.isArray(A)){const l=A.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);o.searchParams.set("columns",u.join(","))}}return new zr({method:i,url:o,headers:a,schema:this.schema,body:A,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(A,{count:e}={}){var t;const r="PATCH",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new zr({method:r,url:n,headers:s,schema:this.schema,body:A,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:A}={}){var e;const t="DELETE",{url:r,headers:n}=this.cloneRequestState();return A&&n.append("Prefer",`count=${A}`),new zr({method:t,url:r,headers:n,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function fs(A){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(A)}function uR(A,e){if(fs(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var r=t.call(A,e);if(fs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function hR(A){var e=uR(A,"string");return fs(e)=="symbol"?e:e+""}function dR(A,e,t){return(e=hR(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function yw(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(A);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,r)}return t}function bo(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yw(Object(t),!0).forEach(function(r){dR(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yw(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}var fR=class BB{constructor(e,{headers:t={},schema:r,fetch:n,timeout:s,urlLengthLimit:i=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=i;const a=n??globalThis.fetch;s!==void 0&&s>0?this.fetch=(l,u)=>{const d=new AbortController,g=setTimeout(()=>d.abort(),s),p=u==null?void 0:u.signal;if(p){if(p.aborted)return clearTimeout(g),a(l,u);const w=()=>{clearTimeout(g),d.abort()};return p.addEventListener("abort",w,{once:!0}),a(l,bo(bo({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(g),p.removeEventListener("abort",w)})}return a(l,bo(bo({},u),{},{signal:d.signal})).finally(()=>clearTimeout(g))}:this.fetch=a,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new lR(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new BB(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:r=!1,get:n=!1,count:s}={}){var i;let o;const a=new URL(`${this.url}/rpc/${e}`);let l;const u=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(u)),d=r&&Object.values(t).some(u);d?(o="POST",l=t):r||n?(o=r?"HEAD":"GET",Object.entries(t).filter(([p,w])=>w!==void 0).map(([p,w])=>[p,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([p,w])=>{a.searchParams.append(p,w)})):(o="POST",l=t);const g=new Headers(this.headers);return d?g.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&g.set("Prefer",`count=${s}`),new zr({method:o,url:a,headers:g,schema:this.schemaName,body:l,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Cw{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const t=globalThis;if(typeof globalThis<"u"&&typeof t.WebSocket<"u")return{type:"native",wsConstructor:t.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof t.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&t.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const s=n.versions;if(s&&s.node){const i=s.node,o=parseInt(i.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
2983
+ ${d.stack}`)}else{var B;a=(B=i==null?void 0:i.stack)!==null&&B!==void 0?B:""}const b=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",l="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",l="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(l+=`. Your request URL is ${b} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:l,code:u},data:null,count:null,status:0,statusText:""}})),s.then(A,e)}async processResponse(A){var e=this;let t=null,r=null,n=null,s=A.status,i=A.statusText;if(A.ok){var o,a;if(e.method!=="HEAD"){var l;const g=await A.text();if(g!=="")if(e.headers.get("Accept")==="text/csv")r=g;else if(e.headers.get("Accept")&&(!((l=e.headers.get("Accept"))===null||l===void 0)&&l.includes("application/vnd.pgrst.plan+text")))r=g;else try{r=JSON.parse(g)}catch{if(t={message:g},r=null,e.shouldThrowOnError)throw new Hl({message:g,details:"",hint:"",code:""})}}const u=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),d=(a=A.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");u&&d&&d.length>1&&(n=parseInt(d[1])),e.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(t={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,n=null,s=406,i="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const u=await A.text();try{t=JSON.parse(u),Array.isArray(t)&&A.status===404&&(r=[],t=null,s=200,i="OK")}catch{A.status===404&&u===""?(s=204,i="No Content"):t={message:u}}if(t&&e.shouldThrowOnError)throw new Hl(t)}return{success:t===null,error:t,data:r,count:n,status:s,statusText:i}}returns(){return this}overrideTypes(){return this}},cR=class extends aR{throwOnError(){return super.throwOnError()}select(A){let e=!1;const t=(A??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",t),this.headers.append("Prefer","return=representation"),this}order(A,{ascending:e=!0,nullsFirst:t,foreignTable:r,referencedTable:n=r}={}){const s=n?`${n}.order`:"order",i=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${i?`${i},`:""}${A}.${e?"asc":"desc"}${t===void 0?"":t?".nullsfirst":".nullslast"}`),this}limit(A,{foreignTable:e,referencedTable:t=e}={}){const r=typeof t>"u"?"limit":`${t}.limit`;return this.url.searchParams.set(r,`${A}`),this}range(A,e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${A}`),this.url.searchParams.set(s,`${e-A+1}`),this}abortSignal(A){return this.signal=A,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:A=!1,verbose:e=!1,settings:t=!1,buffers:r=!1,wal:n=!1,format:s="text"}={}){var i;const o=[A?"analyze":null,e?"verbose":null,t?"settings":null,r?"buffers":null,n?"wal":null].filter(Boolean).join("|"),a=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${a}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(A){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${A}`),this}};const Bw=new RegExp("[,()]");var Xr=class extends cR{throwOnError(){return super.throwOnError()}eq(A,e){return this.url.searchParams.append(A,`eq.${e}`),this}neq(A,e){return this.url.searchParams.append(A,`neq.${e}`),this}gt(A,e){return this.url.searchParams.append(A,`gt.${e}`),this}gte(A,e){return this.url.searchParams.append(A,`gte.${e}`),this}lt(A,e){return this.url.searchParams.append(A,`lt.${e}`),this}lte(A,e){return this.url.searchParams.append(A,`lte.${e}`),this}like(A,e){return this.url.searchParams.append(A,`like.${e}`),this}likeAllOf(A,e){return this.url.searchParams.append(A,`like(all).{${e.join(",")}}`),this}likeAnyOf(A,e){return this.url.searchParams.append(A,`like(any).{${e.join(",")}}`),this}ilike(A,e){return this.url.searchParams.append(A,`ilike.${e}`),this}ilikeAllOf(A,e){return this.url.searchParams.append(A,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(A,e){return this.url.searchParams.append(A,`ilike(any).{${e.join(",")}}`),this}regexMatch(A,e){return this.url.searchParams.append(A,`match.${e}`),this}regexIMatch(A,e){return this.url.searchParams.append(A,`imatch.${e}`),this}is(A,e){return this.url.searchParams.append(A,`is.${e}`),this}isDistinct(A,e){return this.url.searchParams.append(A,`isdistinct.${e}`),this}in(A,e){const t=Array.from(new Set(e)).map(r=>typeof r=="string"&&Bw.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(A,`in.(${t})`),this}notIn(A,e){const t=Array.from(new Set(e)).map(r=>typeof r=="string"&&Bw.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(A,`not.in.(${t})`),this}contains(A,e){return typeof e=="string"?this.url.searchParams.append(A,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(A,`cs.{${e.join(",")}}`):this.url.searchParams.append(A,`cs.${JSON.stringify(e)}`),this}containedBy(A,e){return typeof e=="string"?this.url.searchParams.append(A,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(A,`cd.{${e.join(",")}}`):this.url.searchParams.append(A,`cd.${JSON.stringify(e)}`),this}rangeGt(A,e){return this.url.searchParams.append(A,`sr.${e}`),this}rangeGte(A,e){return this.url.searchParams.append(A,`nxl.${e}`),this}rangeLt(A,e){return this.url.searchParams.append(A,`sl.${e}`),this}rangeLte(A,e){return this.url.searchParams.append(A,`nxr.${e}`),this}rangeAdjacent(A,e){return this.url.searchParams.append(A,`adj.${e}`),this}overlaps(A,e){return typeof e=="string"?this.url.searchParams.append(A,`ov.${e}`):this.url.searchParams.append(A,`ov.{${e.join(",")}}`),this}textSearch(A,e,{config:t,type:r}={}){let n="";r==="plain"?n="pl":r==="phrase"?n="ph":r==="websearch"&&(n="w");const s=t===void 0?"":`(${t})`;return this.url.searchParams.append(A,`${n}fts${s}.${e}`),this}match(A){return Object.entries(A).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(A,e,t){return this.url.searchParams.append(A,`not.${e}.${t}`),this}or(A,{foreignTable:e,referencedTable:t=e}={}){const r=t?`${t}.or`:"or";return this.url.searchParams.append(r,`(${A})`),this}filter(A,e,t){return this.url.searchParams.append(A,`${e}.${t}`),this}},lR=class{constructor(A,{headers:e={},schema:t,fetch:r,urlLengthLimit:n=8e3,retry:s}){this.url=A,this.headers=new Headers(e),this.schema=t,this.fetch=r,this.urlLengthLimit=n,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(A,e){const{head:t=!1,count:r}=e??{},n=t?"HEAD":"GET";let s=!1;const i=(A??"*").split("").map(l=>/\s/.test(l)&&!s?"":(l==='"'&&(s=!s),l)).join(""),{url:o,headers:a}=this.cloneRequestState();return o.searchParams.set("select",i),r&&a.append("Prefer",`count=${r}`),new Xr({method:n,url:o,headers:a,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(A,{count:e,defaultToNull:t=!0}={}){var r;const n="POST",{url:s,headers:i}=this.cloneRequestState();if(e&&i.append("Prefer",`count=${e}`),t||i.append("Prefer","missing=default"),Array.isArray(A)){const o=A.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>0){const a=[...new Set(o)].map(l=>`"${l}"`);s.searchParams.set("columns",a.join(","))}}return new Xr({method:n,url:s,headers:i,schema:this.schema,body:A,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(A,{onConflict:e,ignoreDuplicates:t=!1,count:r,defaultToNull:n=!0}={}){var s;const i="POST",{url:o,headers:a}=this.cloneRequestState();if(a.append("Prefer",`resolution=${t?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),r&&a.append("Prefer",`count=${r}`),n||a.append("Prefer","missing=default"),Array.isArray(A)){const l=A.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);o.searchParams.set("columns",u.join(","))}}return new Xr({method:i,url:o,headers:a,schema:this.schema,body:A,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(A,{count:e}={}){var t;const r="PATCH",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Xr({method:r,url:n,headers:s,schema:this.schema,body:A,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:A}={}){var e;const t="DELETE",{url:r,headers:n}=this.cloneRequestState();return A&&n.append("Prefer",`count=${A}`),new Xr({method:t,url:r,headers:n,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function fs(A){"@babel/helpers - typeof";return fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fs(A)}function uR(A,e){if(fs(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var r=t.call(A,e);if(fs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function hR(A){var e=uR(A,"string");return fs(e)=="symbol"?e:e+""}function dR(A,e,t){return(e=hR(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function yw(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(A);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,r)}return t}function vo(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yw(Object(t),!0).forEach(function(r){dR(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yw(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}var fR=class BB{constructor(e,{headers:t={},schema:r,fetch:n,timeout:s,urlLengthLimit:i=8e3,retry:o}={}){this.url=e,this.headers=new Headers(t),this.schemaName=r,this.urlLengthLimit=i;const a=n??globalThis.fetch;s!==void 0&&s>0?this.fetch=(l,u)=>{const d=new AbortController,g=setTimeout(()=>d.abort(),s),p=u==null?void 0:u.signal;if(p){if(p.aborted)return clearTimeout(g),a(l,u);const w=()=>{clearTimeout(g),d.abort()};return p.addEventListener("abort",w,{once:!0}),a(l,vo(vo({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(g),p.removeEventListener("abort",w)})}return a(l,vo(vo({},u),{},{signal:d.signal})).finally(()=>clearTimeout(g))}:this.fetch=a,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new lR(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new BB(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:r=!1,get:n=!1,count:s}={}){var i;let o;const a=new URL(`${this.url}/rpc/${e}`);let l;const u=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(u)),d=r&&Object.values(t).some(u);d?(o="POST",l=t):r||n?(o=r?"HEAD":"GET",Object.entries(t).filter(([p,w])=>w!==void 0).map(([p,w])=>[p,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([p,w])=>{a.searchParams.append(p,w)})):(o="POST",l=t);const g=new Headers(this.headers);return d?g.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&g.set("Prefer",`count=${s}`),new Xr({method:o,url:a,headers:g,schema:this.schemaName,body:l,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class Cw{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const t=globalThis;if(typeof globalThis<"u"&&typeof t.WebSocket<"u")return{type:"native",wsConstructor:t.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof t.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&t.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const s=n.versions;if(s&&s.node){const i=s.node,o=parseInt(i.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
2984
2984
  import ws from "ws"
2985
2985
  new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(t+=`
2986
2986
 
2987
- Suggested solution: ${e.workaround}`),new Error(t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const gR="realtime-js/2.108.2",pR="1.0.0",_w="2.0.0",wR=_w,mR=1e4,BR=100,lA={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ew={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Pl={connecting:"connecting",closing:"closing",closed:"closed"};class yR{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return t(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer((t=e.payload)===null||t===void 0?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;const n=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;const n=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:{},i=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,t,r){var n,s;const i=e.topic,o=(n=e.ref)!==null&&n!==void 0?n:"",a=(s=e.join_ref)!==null&&s!==void 0?s:"",l=e.payload.event,u=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},d=Object.keys(u).length===0?"":JSON.stringify(u);if(a.length>255)throw new Error(`joinRef length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`userEvent length ${l.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const g=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+i.length+l.length+d.length,p=new ArrayBuffer(this.HEADER_LENGTH+g);let w=new DataView(p),y=0;w.setUint8(y++,this.KINDS.userBroadcastPush),w.setUint8(y++,a.length),w.setUint8(y++,o.length),w.setUint8(y++,i.length),w.setUint8(y++,l.length),w.setUint8(y++,d.length),w.setUint8(y++,t),Array.from(a,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(o,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(i,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(l,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(d,b=>w.setUint8(y++,b.charCodeAt(0)));var B=new Uint8Array(p.byteLength+r.byteLength);return B.set(new Uint8Array(p),0),B.set(new Uint8Array(r),p.byteLength),B.buffer}decode(e,t){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return t(r)}if(typeof e=="string"){const r=JSON.parse(e),[n,s,i,o,a]=r;return t({join_ref:n,ref:s,topic:i,event:o,payload:a})}return t({})}_binaryDecode(e){const t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,n)}}_decodeUserBroadcast(e,t,r){const n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4);let a=this.HEADER_LENGTH+4;const l=r.decode(e.slice(a,a+n));a=a+n;const u=r.decode(e.slice(a,a+s));a=a+s;const d=r.decode(e.slice(a,a+i));a=a+i;const g=e.slice(a,e.byteLength),p=o===this.JSON_ENCODING?JSON.parse(r.decode(g)):g,w={type:this.BROADCAST_EVENT,event:u,payload:p};return i>0&&(w.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>t.includes(r)))}}var he;(function(A){A.abstime="abstime",A.bool="bool",A.date="date",A.daterange="daterange",A.float4="float4",A.float8="float8",A.int2="int2",A.int4="int4",A.int4range="int4range",A.int8="int8",A.int8range="int8range",A.json="json",A.jsonb="jsonb",A.money="money",A.numeric="numeric",A.oid="oid",A.reltime="reltime",A.text="text",A.time="time",A.timestamp="timestamp",A.timestamptz="timestamptz",A.timetz="timetz",A.tsrange="tsrange",A.tstzrange="tstzrange"})(he||(he={}));const vw=(A,e,t={})=>{var r;const n=(r=t.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,i)=>(s[i]=CR(i,A,e,n),s),{}):{}},CR=(A,e,t,r)=>{const n=e.find(o=>o.name===A),s=n==null?void 0:n.type,i=t[A];return s&&!r.includes(s)?bw(s,i):Nl(i)},bw=(A,e)=>{if(A.charAt(0)==="_"){const t=A.slice(1,A.length);return bR(e,t)}switch(A){case he.bool:return _R(e);case he.float4:case he.float8:case he.int2:case he.int4:case he.int8:case he.numeric:case he.oid:return ER(e);case he.json:case he.jsonb:return vR(e);case he.timestamp:return UR(e);case he.abstime:case he.date:case he.daterange:case he.int4range:case he.int8range:case he.money:case he.reltime:case he.text:case he.time:case he.timestamptz:case he.timetz:case he.tsrange:case he.tstzrange:return Nl(e);default:return Nl(e)}},Nl=A=>A,_R=A=>{switch(A){case"t":return!0;case"f":return!1;default:return A}},ER=A=>{if(typeof A=="string"){const e=parseFloat(A);if(!Number.isNaN(e))return e}return A},vR=A=>{if(typeof A=="string")try{return JSON.parse(A)}catch{return A}return A},bR=(A,e)=>{if(typeof A!="string")return A;const t=A.length-1,r=A[t];if(A[0]==="{"&&r==="}"){let s;const i=A.slice(1,t);try{s=JSON.parse("["+i+"]")}catch{s=i?i.split(","):[]}return s.map(o=>bw(e,o))}return A},UR=A=>typeof A=="string"?A.replace(" ","T"):A,Uw=A=>{const e=new URL(A);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var gs=A=>typeof A=="function"?A:function(){return A},QR=typeof self<"u"?self:null,Xr=typeof window<"u"?window:null,Yt=QR||Xr||globalThis,IR="2.0.0",FR=1e4,TR=1e3,Zt={connecting:0,open:1,closing:2,closed:3},lt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},uA={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Ml={longpoll:"longpoll",websocket:"websocket"},SR={complete:4},Vl="base64url.bearer.phx.",Uo=class{constructor(A,e,t,r){this.channel=A,this.event=e,this.payload=t||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(A){this.timeout=A,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(A,e){return this.hasReceived(A)&&e(this.receivedResp.response),this.recHooks.push({status:A,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:A,response:e,_ref:t}){this.recHooks.filter(r=>r.status===A).forEach(r=>r.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,A=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=A,this.matchReceive(A)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(A){return this.receivedResp&&this.receivedResp.status===A}trigger(A,e){this.channel.trigger(this.refEvent,{status:A,response:e})}},Qw=class{constructor(A,e){this.callback=A,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},RR=class{constructor(A,e,t){this.state=lt.closed,this.topic=A,this.params=gs(e||{}),this.socket=t,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Uo(this,uA.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Qw(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=lt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=lt.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Uo(this,uA.leave,gs({}),this.timeout).send(),this.state=lt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(uA.reply,(r,n)=>{this.trigger(this.replyEventName(n),r)})}join(A=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=A,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(A=>A.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=lt.closed,this.bindings=[]}onClose(A){this.on(uA.close,A)}onError(A){return this.on(uA.error,e=>A(e))}on(A,e){let t=this.bindingRef++;return this.bindings.push({event:A,ref:t,callback:e}),t}off(A,e){this.bindings=this.bindings.filter(t=>!(t.event===A&&(typeof e>"u"||e===t.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(A,e,t=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${A}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Uo(this,A,function(){return e},t);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(A=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=lt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(uA.close,"leave")},t=new Uo(this,uA.leave,gs({}),A);return t.receive("ok",()=>e()).receive("timeout",()=>e()),t.send(),this.canPush()||t.trigger("ok",{}),t}onMessage(A,e,t){return e}filterBindings(A,e,t){return!0}isMember(A,e,t,r){return this.topic!==A?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:A,event:e,payload:t,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(A=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=lt.joining,this.joinPush.resend(A))}trigger(A,e,t,r){let n=this.onMessage(A,e,t,r);if(e&&!n)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(i=>i.event===A&&this.filterBindings(i,e,t));for(let i=0;i<s.length;i++)s[i].callback(n,t,r||this.joinRef())}replyEventName(A){return`chan_reply_${A}`}isClosed(){return this.state===lt.closed}isErrored(){return this.state===lt.errored}isJoined(){return this.state===lt.joined}isJoining(){return this.state===lt.joining}isLeaving(){return this.state===lt.leaving}},Qo=class{static request(A,e,t,r,n,s,i){if(Yt.XDomainRequest){let o=new Yt.XDomainRequest;return this.xdomainRequest(o,A,e,r,n,s,i)}else if(Yt.XMLHttpRequest){let o=new Yt.XMLHttpRequest;return this.xhrRequest(o,A,e,t,r,n,s,i)}else{if(Yt.fetch&&Yt.AbortController)return this.fetchRequest(A,e,t,r,n,s,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(A,e,t,r,n,s,i){let o={method:A,headers:t,body:r},a=null;return n&&(a=new AbortController,setTimeout(()=>a.abort(),n),o.signal=a.signal),Yt.fetch(e,o).then(l=>l.text()).then(l=>this.parseJSON(l)).then(l=>i&&i(l)).catch(l=>{l.name==="AbortError"&&s?s():i&&i(null)}),a}static xdomainRequest(A,e,t,r,n,s,i){return A.timeout=n,A.open(e,t),A.onload=()=>{let o=this.parseJSON(A.responseText);i&&i(o)},s&&(A.ontimeout=s),A.onprogress=()=>{},A.send(r),A}static xhrRequest(A,e,t,r,n,s,i,o){A.open(e,t,!0),A.timeout=s;for(let[a,l]of Object.entries(r))A.setRequestHeader(a,l);return A.onerror=()=>o&&o(null),A.onreadystatechange=()=>{if(A.readyState===SR.complete&&o){let a=this.parseJSON(A.responseText);o(a)}},i&&(A.ontimeout=i),A.send(n),A}static parseJSON(A){if(!A||A==="")return null;try{return JSON.parse(A)}catch{return console&&console.log("failed to parse JSON response",A),null}}static serialize(A,e){let t=[];for(var r in A){if(!Object.prototype.hasOwnProperty.call(A,r))continue;let n=e?`${e}[${r}]`:r,s=A[r];typeof s=="object"?t.push(this.serialize(s,n)):t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}return t.join("&")}static appendParams(A,e){if(Object.keys(e).length===0)return A;let t=A.match(/\?/)?"&":"?";return`${A}${t}${this.serialize(e)}`}},xR=A=>{let e="",t=new Uint8Array(A),r=t.byteLength;for(let n=0;n<r;n++)e+=String.fromCharCode(t[n]);return btoa(e)},Yr=class{constructor(A,e){e&&e.length===2&&e[1].startsWith(Vl)&&(this.authToken=atob(e[1].slice(Vl.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(A),this.readyState=Zt.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(A){return A.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Ml.websocket),"$1/"+Ml.longpoll)}endpointURL(){return Qo.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(A,e,t){this.close(A,e,t),this.readyState=Zt.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Zt.open||this.readyState===Zt.connecting}poll(){const A={Accept:"application/json"};this.authToken&&(A["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",A,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Zt.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}})}send(A){typeof A!="string"&&(A=xR(A)),this.currentBatch?this.currentBatch.push(A):this.awaitingBatchAck?this.batchBuffer.push(A):(this.currentBatch=[A],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(A){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},A.join(`
2988
- `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(A,e,t){for(let n of this.reqs)n.abort();this.readyState=Zt.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:A,reason:e,wasClean:t});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(A,e,t,r,n){let s,i=()=>{this.reqs.delete(s),r()};s=Qo.request(A,this.endpointURL(),e,t,this.timeout,i,o=>{this.reqs.delete(s),this.isActive()&&n(o)}),this.reqs.add(s)}},kR=class js{constructor(e,t={}){let r=t.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,n=>{let{onJoin:s,onLeave:i,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=js.syncState(this.state,n,s,i),this.pendingDiffs.forEach(a=>{this.state=js.syncDiff(this.state,a,s,i)}),this.pendingDiffs=[],o()}),this.channel.on(r.diff,n=>{let{onJoin:s,onLeave:i,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(n):(this.state=js.syncDiff(this.state,n,s,i),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return js.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let s=this.clone(e),i={},o={};return this.map(s,(a,l)=>{t[a]||(o[a]=l)}),this.map(t,(a,l)=>{let u=s[a];if(u){let d=l.metas.map(y=>y.phx_ref),g=u.metas.map(y=>y.phx_ref),p=l.metas.filter(y=>g.indexOf(y.phx_ref)<0),w=u.metas.filter(y=>d.indexOf(y.phx_ref)<0);p.length>0&&(i[a]=l,i[a].metas=p),w.length>0&&(o[a]=this.clone(u),o[a].metas=w)}else i[a]=l}),this.syncDiff(s,{joins:i,leaves:o},r,n)}static syncDiff(e,t,r,n){let{joins:s,leaves:i}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(s,(o,a)=>{let l=e[o];if(e[o]=this.clone(a),l){let u=e[o].metas.map(g=>g.phx_ref),d=l.metas.filter(g=>u.indexOf(g.phx_ref)<0);e[o].metas.unshift(...d)}r(o,l,a)}),this.map(i,(o,a)=>{let l=e[o];if(!l)return;let u=a.metas.map(d=>d.phx_ref);l.metas=l.metas.filter(d=>u.indexOf(d.phx_ref)<0),n(o,l,a),l.metas.length===0&&delete e[o]}),e}static list(e,t){return t||(t=function(r,n){return n}),this.map(e,(r,n)=>t(r,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Io={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(A,e){if(A.payload.constructor===ArrayBuffer)return e(this.binaryEncode(A));{let t=[A.join_ref,A.ref,A.topic,A.event,A.payload];return e(JSON.stringify(t))}},decode(A,e){if(A.constructor===ArrayBuffer)return e(this.binaryDecode(A));{let[t,r,n,s,i]=JSON.parse(A);return e({join_ref:t,ref:r,topic:n,event:s,payload:i})}},binaryEncode(A){let{join_ref:e,ref:t,event:r,topic:n,payload:s}=A,i=this.META_LENGTH+e.length+t.length+n.length+r.length,o=new ArrayBuffer(this.HEADER_LENGTH+i),a=new DataView(o),l=0;a.setUint8(l++,this.KINDS.push),a.setUint8(l++,e.length),a.setUint8(l++,t.length),a.setUint8(l++,n.length),a.setUint8(l++,r.length),Array.from(e,d=>a.setUint8(l++,d.charCodeAt(0))),Array.from(t,d=>a.setUint8(l++,d.charCodeAt(0))),Array.from(n,d=>a.setUint8(l++,d.charCodeAt(0))),Array.from(r,d=>a.setUint8(l++,d.charCodeAt(0)));var u=new Uint8Array(o.byteLength+s.byteLength);return u.set(new Uint8Array(o),0),u.set(new Uint8Array(s),o.byteLength),u.buffer},binaryDecode(A){let e=new DataView(A),t=e.getUint8(0),r=new TextDecoder;switch(t){case this.KINDS.push:return this.decodePush(A,e,r);case this.KINDS.reply:return this.decodeReply(A,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(A,e,r)}},decodePush(A,e,t){let r=e.getUint8(1),n=e.getUint8(2),s=e.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,o=t.decode(A.slice(i,i+r));i=i+r;let a=t.decode(A.slice(i,i+n));i=i+n;let l=t.decode(A.slice(i,i+s));i=i+s;let u=A.slice(i,A.byteLength);return{join_ref:o,ref:null,topic:a,event:l,payload:u}},decodeReply(A,e,t){let r=e.getUint8(1),n=e.getUint8(2),s=e.getUint8(3),i=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=t.decode(A.slice(o,o+r));o=o+r;let l=t.decode(A.slice(o,o+n));o=o+n;let u=t.decode(A.slice(o,o+s));o=o+s;let d=t.decode(A.slice(o,o+i));o=o+i;let g=A.slice(o,A.byteLength),p={status:d,response:g};return{join_ref:a,ref:l,topic:u,event:uA.reply,payload:p}},decodeBroadcast(A,e,t){let r=e.getUint8(1),n=e.getUint8(2),s=this.HEADER_LENGTH+2,i=t.decode(A.slice(s,s+r));s=s+r;let o=t.decode(A.slice(s,s+n));s=s+n;let a=A.slice(s,A.byteLength);return{join_ref:null,ref:null,topic:i,event:o,payload:a}}},LR=class{constructor(A,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||FR,this.transport=e.transport||Yt.WebSocket||Yr,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let t=null;try{t=Yt&&Yt.sessionStorage}catch{}this.sessionStore=e.sessionStorage||t,this.establishedConnections=0,this.defaultEncoder=Io.encode.bind(Io),this.defaultDecoder=Io.decode.bind(Io),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Yr?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Xr&&Xr.addEventListener&&(Xr.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Xr.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),Xr.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,s,i)=>{console.log(`${n}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=gs(e.params||{}),this.endPoint=`${A}/${Ml.websocket}`,this.vsn=e.vsn||IR,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Qw(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Yr}replaceTransport(A){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=A}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let A=Qo.appendParams(Qo.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return A.charAt(0)!=="/"?A:A.charAt(1)==="/"?`${this.protocol()}:${A}`:`${this.protocol()}://${location.host}${A}`}disconnect(A,e,t){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,A&&A()},e,t)}connect(A){A&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=gs(A)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Yr?this.connectWithFallback(Yr,this.longPollFallbackMs):this.transportConnect())}log(A,e,t){this.logger&&this.logger(A,e,t)}hasLogger(){return this.logger!==null}onOpen(A){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,A]),e}onClose(A){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,A]),e}onError(A){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,A]),e}onMessage(A){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,A]),e}onHeartbeat(A){this.heartbeatCallback=A}ping(A){if(!this.isConnected())return!1;let e=this.makeRef(),t=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(n=>{n.ref===e&&(this.off([r]),A(Date.now()-t))});return!0}transportName(A){switch(A){case Yr:return"LongPoll";default:return A.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let A;this.authToken&&(A=["phoenix",`${Vl}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),A),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(A){return this.sessionStore&&this.sessionStore.getItem(A)}storeSession(A,e){this.sessionStore&&this.sessionStore.setItem(A,e)}connectWithFallback(A,e=2500){clearTimeout(this.fallbackTimer);let t=!1,r=!0,n,s,i=this.transportName(A),o=a=>{this.log("transport",`falling back to ${i}...`,a),this.off([n,s]),r=!1,this.replaceTransport(A),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),s=this.onError(a=>{this.log("transport","error",a),r&&!t&&(clearTimeout(this.fallbackTimer),o(a))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(t=!0,!r){let a=this.transportName(A);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${a}`,"true"),this.log("transport",`established ${a} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(a=>{this.log("transport","connected to primary after",a),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(A){this.log("error","error in heartbeat callback",A)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),TR,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(A,e,t){if(!this.conn)return A&&A();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,t||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),A&&A()})})}waitForBufferDone(A,e,t=1){if(t===5||!A.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(A,e,t+1)},150*t)}waitForSocketClosed(A,e,t=1){if(t===5||A.readyState===Zt.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(A,e,t+1)},150*t)}onConnClose(A){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",A),this.triggerChanError(A),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",A)}onConnError(A){this.hasLogger()&&this.log("transport","error",A);let e=this.transport,t=this.establishedConnections;this.triggerStateCallbacks("error",A,e,t),(e===this.transport||t>0)&&this.triggerChanError(A)}triggerChanError(A){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(uA.error,A)})}connectionState(){switch(this.conn&&this.conn.readyState){case Zt.connecting:return"connecting";case Zt.open:return"open";case Zt.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(A){this.off(A.stateChangeRefs),this.channels=this.channels.filter(e=>e!==A)}off(A){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([t])=>A.indexOf(t)===-1)}channel(A,e={}){let t=new RR(A,e,this);return this.channels.push(t),t}push(A){if(this.hasLogger()){let{topic:e,event:t,payload:r,ref:n,join_ref:s}=A;this.log("push",`${e} ${t} (${s}, ${n})`,r)}this.isConnected()?this.encode(A,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(A,e=>this.conn.send(e)))}makeRef(){let A=this.ref+1;return A===this.ref?this.ref=0:this.ref=A,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(A){this.log("error","error in heartbeat callback",A)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(A){this.log("error","error in heartbeat callback",A)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(A=>A()),this.sendBuffer=[])}onConnMessage(A){this.decode(A.data,e=>{let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;if(s&&s===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(n.status==="ok"?"ok":"error",o)}catch(a){this.log("error","error in heartbeat callback",a)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${s&&"("+s+")"||""}`.trim(),n);for(let o=0;o<this.channels.length;o++){const a=this.channels[o];a.isMember(t,r,n,i)&&a.trigger(r,n,s,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(A,...e){try{this.stateChangeCallbacks[A].forEach(([t,r])=>{try{r(...e)}catch(n){this.log("error",`error in ${A} callback`,n)}})}catch(t){this.log("error",`error triggering ${A} callbacks`,t)}}leaveOpenTopic(A){let e=this.channels.find(t=>t.topic===A&&(t.isJoined()||t.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${A}"`),e.leave())}};class ps{constructor(e,t){const r=HR(t);this.presence=new kR(e.getChannel(),r),this.presence.onJoin((n,s,i)=>{const o=ps.onJoinPayload(n,s,i);e.getChannel().trigger("presence",o)}),this.presence.onLeave((n,s,i)=>{const o=ps.onLeavePayload(n,s,i);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ps.transformState(this.presence.state)}static transformState(e){return e=DR(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{const n=e[r];return t[r]=Fo(n),t},{})}static onJoinPayload(e,t,r){const n=Iw(t),s=Fo(r);return{event:"join",key:e,currentPresences:n,newPresences:s}}static onLeavePayload(e,t,r){const n=Iw(t),s=Fo(r);return{event:"leave",key:e,currentPresences:n,leftPresences:s}}}function Fo(A){return A.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function DR(A){return JSON.parse(JSON.stringify(A))}function HR(A){return(A==null?void 0:A.events)&&{events:A.events}}function Iw(A){return A!=null&&A.metas?Fo(A):[]}var Kl;(function(A){A.SYNC="sync",A.JOIN="join",A.LEAVE="leave"})(Kl||(Kl={}));class Fw{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new ps(this.channel.channelAdapter,t)}}function OR(A){if(A instanceof Error)return A;if(typeof A=="string")return new Error(A);if(A&&typeof A=="object"){const e=A;if(typeof e.code=="number"){const t=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${t}`,{cause:A})}return new Error("channel error: transport failure",{cause:A})}return new Error("channel error: connection lost")}class PR{constructor(e,t,r){const n=NR(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>BR){const s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return n}updateJoinPayload(e){const t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===lA.joined}isJoined(){return this.state===lA.joined}isJoining(){return this.state===lA.joining}isClosed(){return this.state===lA.closed}isLeaving(){return this.state===lA.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function NR(A){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},A.config)}}var $l;(function(A){A.ALL="*",A.INSERT="INSERT",A.UPDATE="UPDATE",A.DELETE="DELETE"})($l||($l={}));var lr;(function(A){A.BROADCAST="broadcast",A.PRESENCE="presence",A.POSTGRES_CHANGES="postgres_changes",A.SYSTEM="system"})(lr||(lr={}));var eA;(function(A){A.SUBSCRIBED="SUBSCRIBED",A.TIMED_OUT="TIMED_OUT",A.CLOSED="CLOSED",A.CHANNEL_ERROR="CHANNEL_ERROR"})(eA||(eA={}));const MR=lA;class Zr{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new PR(this.socket.socketAdapter,e,this.params),this.presence=new Fw(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Uw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((s=(n=this.params.config)===null||n===void 0?void 0:n.broadcast)===null||s===void 0)&&s.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,n,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:o,private:a}}=this.params,l=(n=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&n!==void 0?n:[],u=!!this.bindings[lr.PRESENCE]&&this.bindings[lr.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,d={},g={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:l,private:a};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(eA.CHANNEL_ERROR,OR(p))}),this._onClose(()=>e==null?void 0:e(eA.CLOSED)),this.updateJoinPayload(Object.assign({config:g},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(eA.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=lA.errored;const w=Object.values(p).join(", ")||"error";e==null||e(eA.CHANNEL_ERROR,new Error(w,{cause:p}))}).receive("timeout",()=>{e==null||e(eA.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;const n=this.bindings.postgres_changes,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0,i=[];for(let o=0;o<s;o++){const a=n[o],{filter:{event:l,schema:u,table:d,filter:g}}=a,p=e&&e[o];if(p&&p.event===l&&Zr.isFilterValueEqual(p.schema,u)&&Zr.isFilterValueEqual(p.table,d)&&Zr.isFilterValueEqual(p.filter,g))i.push(Object.assign(Object.assign({},a),{id:p.id}));else{this.unsubscribe(),this.state=lA.errored,t==null||t(eA.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=lA.errored&&t&&t(eA.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){const n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===lr.PRESENCE||e===lr.POSTGRES_CHANGES;if(n&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(t==null)return Promise.reject(new Error("Payload is required for httpSend()"));const s=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":s?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o=new URL(this.broadcastEndpointURL);o.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&o.searchParams.set("private","true");const a={method:"POST",headers:i,body:s?t:JSON.stringify(t)},l=await this._fetchWithTimeout(o.toString(),a,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);if(l.status===202)return{success:!0};if(l.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=l.statusText;try{const d=await l.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(e,t={}){var r,n;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:i}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((n=l.body)===null||n===void 0?void 0:n.cancel()),l.ok?"ok":"error"}catch(l){return l instanceof Error&&l.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var i,o,a;const l=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((a=(o=(i=this.params)===null||i===void 0?void 0:i.config)===null||o===void 0?void 0:o.broadcast)===null||a===void 0)&&a.ack)&&s("ok"),l.receive("ok",()=>s("ok")),l.receive("error",()=>s("error")),l.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){const n=new AbortController,s=setTimeout(()=>n.abort(),r),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(s),i}_on(e,t,r){const n=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),i={type:n,filter:t,callback:r,ref:s};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,s,i,o,a,l,u;const d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,r))return!1;const g=(n=this.bindings[d])===null||n===void 0?void 0:n.find(p=>p.ref===e.ref);if(!g)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in g){const p=g.id,w=(s=g.filter)===null||s===void 0?void 0:s.event;return p&&((i=t.ids)===null||i===void 0?void 0:i.includes(p))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((o=t.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const p=(l=(a=g==null?void 0:g.filter)===null||a===void 0?void 0:a.event)===null||l===void 0?void 0:l.toLocaleLowerCase();return p==="*"||p===((u=t==null?void 0:t.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,t){const{close:r,error:n,leave:s,join:i}=Ew;return t&&[r,n,s,i].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if(typeof t=="object"&&"ids"in t){const n=t.data,{schema:s,table:i,commit_timestamp:o,type:a,errors:l}=n;return Object.assign(Object.assign({},{schema:s,table:i,commit_timestamp:o,eventType:a,new:{},old:{},errors:l}),this._getPayloadRecords(n))}return t})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const t in e.bindings)for(const r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=vw(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=vw(e.columns,e.old_record)),t}}class VR{constructor(e,t){this.socket=new LR(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),n),this.socket.disconnect(()=>{e(),s("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Pl.connecting}isDisconnecting(){return this.socket.connectionState()==Pl.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Tw={HEARTBEAT_INTERVAL:25e3},KR=[1e3,2e3,5e3,1e4],$R=1e4;function jR(){const A=new Map;return{get length(){return A.size},clear(){A.clear()},getItem(e){return A.has(e)?A.get(e):null},key(e){var t;return(t=Array.from(A.keys())[e])!==null&&t!==void 0?t:null},removeItem(e){A.delete(e)},setItem(e,t){A.set(e,String(t))}}}function GR(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return jR()}const WR=`
2987
+ Suggested solution: ${e.workaround}`),new Error(t)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const gR="realtime-js/2.108.2",pR="1.0.0",_w="2.0.0",wR=_w,mR=1e4,BR=100,lA={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ew={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Ol={connecting:"connecting",closing:"closing",closed:"closed"};class yR{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return t(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var t;return this._isArrayBuffer((t=e.payload)===null||t===void 0?void 0:t.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var t,r;const n=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,n)}_encodeJsonUserBroadcastPush(e){var t,r;const n=(r=(t=e.payload)===null||t===void 0?void 0:t.payload)!==null&&r!==void 0?r:{},i=new TextEncoder().encode(JSON.stringify(n)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(e,t,r){var n,s;const i=e.topic,o=(n=e.ref)!==null&&n!==void 0?n:"",a=(s=e.join_ref)!==null&&s!==void 0?s:"",l=e.payload.event,u=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},d=Object.keys(u).length===0?"":JSON.stringify(u);if(a.length>255)throw new Error(`joinRef length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`userEvent length ${l.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const g=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+o.length+i.length+l.length+d.length,p=new ArrayBuffer(this.HEADER_LENGTH+g);let w=new DataView(p),y=0;w.setUint8(y++,this.KINDS.userBroadcastPush),w.setUint8(y++,a.length),w.setUint8(y++,o.length),w.setUint8(y++,i.length),w.setUint8(y++,l.length),w.setUint8(y++,d.length),w.setUint8(y++,t),Array.from(a,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(o,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(i,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(l,b=>w.setUint8(y++,b.charCodeAt(0))),Array.from(d,b=>w.setUint8(y++,b.charCodeAt(0)));var B=new Uint8Array(p.byteLength+r.byteLength);return B.set(new Uint8Array(p),0),B.set(new Uint8Array(r),p.byteLength),B.buffer}decode(e,t){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return t(r)}if(typeof e=="string"){const r=JSON.parse(e),[n,s,i,o,a]=r;return t({join_ref:n,ref:s,topic:i,event:o,payload:a})}return t({})}_binaryDecode(e){const t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,n)}}_decodeUserBroadcast(e,t,r){const n=t.getUint8(1),s=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4);let a=this.HEADER_LENGTH+4;const l=r.decode(e.slice(a,a+n));a=a+n;const u=r.decode(e.slice(a,a+s));a=a+s;const d=r.decode(e.slice(a,a+i));a=a+i;const g=e.slice(a,e.byteLength),p=o===this.JSON_ENCODING?JSON.parse(r.decode(g)):g,w={type:this.BROADCAST_EVENT,event:u,payload:p};return i>0&&(w.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:l,event:this.BROADCAST_EVENT,payload:w}}_isArrayBuffer(e){var t;return e instanceof ArrayBuffer||((t=e==null?void 0:e.constructor)===null||t===void 0?void 0:t.name)==="ArrayBuffer"}_pick(e,t){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>t.includes(r)))}}var he;(function(A){A.abstime="abstime",A.bool="bool",A.date="date",A.daterange="daterange",A.float4="float4",A.float8="float8",A.int2="int2",A.int4="int4",A.int4range="int4range",A.int8="int8",A.int8range="int8range",A.json="json",A.jsonb="jsonb",A.money="money",A.numeric="numeric",A.oid="oid",A.reltime="reltime",A.text="text",A.time="time",A.timestamp="timestamp",A.timestamptz="timestamptz",A.timetz="timetz",A.tsrange="tsrange",A.tstzrange="tstzrange"})(he||(he={}));const vw=(A,e,t={})=>{var r;const n=(r=t.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,i)=>(s[i]=CR(i,A,e,n),s),{}):{}},CR=(A,e,t,r)=>{const n=e.find(o=>o.name===A),s=n==null?void 0:n.type,i=t[A];return s&&!r.includes(s)?bw(s,i):Pl(i)},bw=(A,e)=>{if(A.charAt(0)==="_"){const t=A.slice(1,A.length);return bR(e,t)}switch(A){case he.bool:return _R(e);case he.float4:case he.float8:case he.int2:case he.int4:case he.int8:case he.numeric:case he.oid:return ER(e);case he.json:case he.jsonb:return vR(e);case he.timestamp:return UR(e);case he.abstime:case he.date:case he.daterange:case he.int4range:case he.int8range:case he.money:case he.reltime:case he.text:case he.time:case he.timestamptz:case he.timetz:case he.tsrange:case he.tstzrange:return Pl(e);default:return Pl(e)}},Pl=A=>A,_R=A=>{switch(A){case"t":return!0;case"f":return!1;default:return A}},ER=A=>{if(typeof A=="string"){const e=parseFloat(A);if(!Number.isNaN(e))return e}return A},vR=A=>{if(typeof A=="string")try{return JSON.parse(A)}catch{return A}return A},bR=(A,e)=>{if(typeof A!="string")return A;const t=A.length-1,r=A[t];if(A[0]==="{"&&r==="}"){let s;const i=A.slice(1,t);try{s=JSON.parse("["+i+"]")}catch{s=i?i.split(","):[]}return s.map(o=>bw(e,o))}return A},UR=A=>typeof A=="string"?A.replace(" ","T"):A,Uw=A=>{const e=new URL(A);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var gs=A=>typeof A=="function"?A:function(){return A},QR=typeof self<"u"?self:null,Yr=typeof window<"u"?window:null,Yt=QR||Yr||globalThis,IR="2.0.0",FR=1e4,TR=1e3,Zt={connecting:0,open:1,closing:2,closed:3},lt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},uA={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Nl={longpoll:"longpoll",websocket:"websocket"},SR={complete:4},Ml="base64url.bearer.phx.",bo=class{constructor(A,e,t,r){this.channel=A,this.event=e,this.payload=t||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(A){this.timeout=A,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(A,e){return this.hasReceived(A)&&e(this.receivedResp.response),this.recHooks.push({status:A,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:A,response:e,_ref:t}){this.recHooks.filter(r=>r.status===A).forEach(r=>r.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,A=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=A,this.matchReceive(A)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(A){return this.receivedResp&&this.receivedResp.status===A}trigger(A,e){this.channel.trigger(this.refEvent,{status:A,response:e})}},Qw=class{constructor(A,e){this.callback=A,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},RR=class{constructor(A,e,t){this.state=lt.closed,this.topic=A,this.params=gs(e||{}),this.socket=t,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new bo(this,uA.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Qw(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=lt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=lt.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=lt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new bo(this,uA.leave,gs({}),this.timeout).send(),this.state=lt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(uA.reply,(r,n)=>{this.trigger(this.replyEventName(n),r)})}join(A=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=A,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(A=>A.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=lt.closed,this.bindings=[]}onClose(A){this.on(uA.close,A)}onError(A){return this.on(uA.error,e=>A(e))}on(A,e){let t=this.bindingRef++;return this.bindings.push({event:A,ref:t,callback:e}),t}off(A,e){this.bindings=this.bindings.filter(t=>!(t.event===A&&(typeof e>"u"||e===t.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(A,e,t=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${A}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new bo(this,A,function(){return e},t);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(A=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=lt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(uA.close,"leave")},t=new bo(this,uA.leave,gs({}),A);return t.receive("ok",()=>e()).receive("timeout",()=>e()),t.send(),this.canPush()||t.trigger("ok",{}),t}onMessage(A,e,t){return e}filterBindings(A,e,t){return!0}isMember(A,e,t,r){return this.topic!==A?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:A,event:e,payload:t,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(A=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=lt.joining,this.joinPush.resend(A))}trigger(A,e,t,r){let n=this.onMessage(A,e,t,r);if(e&&!n)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(i=>i.event===A&&this.filterBindings(i,e,t));for(let i=0;i<s.length;i++)s[i].callback(n,t,r||this.joinRef())}replyEventName(A){return`chan_reply_${A}`}isClosed(){return this.state===lt.closed}isErrored(){return this.state===lt.errored}isJoined(){return this.state===lt.joined}isJoining(){return this.state===lt.joining}isLeaving(){return this.state===lt.leaving}},Uo=class{static request(A,e,t,r,n,s,i){if(Yt.XDomainRequest){let o=new Yt.XDomainRequest;return this.xdomainRequest(o,A,e,r,n,s,i)}else if(Yt.XMLHttpRequest){let o=new Yt.XMLHttpRequest;return this.xhrRequest(o,A,e,t,r,n,s,i)}else{if(Yt.fetch&&Yt.AbortController)return this.fetchRequest(A,e,t,r,n,s,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(A,e,t,r,n,s,i){let o={method:A,headers:t,body:r},a=null;return n&&(a=new AbortController,setTimeout(()=>a.abort(),n),o.signal=a.signal),Yt.fetch(e,o).then(l=>l.text()).then(l=>this.parseJSON(l)).then(l=>i&&i(l)).catch(l=>{l.name==="AbortError"&&s?s():i&&i(null)}),a}static xdomainRequest(A,e,t,r,n,s,i){return A.timeout=n,A.open(e,t),A.onload=()=>{let o=this.parseJSON(A.responseText);i&&i(o)},s&&(A.ontimeout=s),A.onprogress=()=>{},A.send(r),A}static xhrRequest(A,e,t,r,n,s,i,o){A.open(e,t,!0),A.timeout=s;for(let[a,l]of Object.entries(r))A.setRequestHeader(a,l);return A.onerror=()=>o&&o(null),A.onreadystatechange=()=>{if(A.readyState===SR.complete&&o){let a=this.parseJSON(A.responseText);o(a)}},i&&(A.ontimeout=i),A.send(n),A}static parseJSON(A){if(!A||A==="")return null;try{return JSON.parse(A)}catch{return console&&console.log("failed to parse JSON response",A),null}}static serialize(A,e){let t=[];for(var r in A){if(!Object.prototype.hasOwnProperty.call(A,r))continue;let n=e?`${e}[${r}]`:r,s=A[r];typeof s=="object"?t.push(this.serialize(s,n)):t.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}return t.join("&")}static appendParams(A,e){if(Object.keys(e).length===0)return A;let t=A.match(/\?/)?"&":"?";return`${A}${t}${this.serialize(e)}`}},xR=A=>{let e="",t=new Uint8Array(A),r=t.byteLength;for(let n=0;n<r;n++)e+=String.fromCharCode(t[n]);return btoa(e)},Zr=class{constructor(A,e){e&&e.length===2&&e[1].startsWith(Ml)&&(this.authToken=atob(e[1].slice(Ml.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(A),this.readyState=Zt.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(A){return A.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Nl.websocket),"$1/"+Nl.longpoll)}endpointURL(){return Uo.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(A,e,t){this.close(A,e,t),this.readyState=Zt.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Zt.open||this.readyState===Zt.connecting}poll(){const A={Accept:"application/json"};this.authToken&&(A["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",A,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:r,messages:n}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else t=0;switch(t){case 200:n.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Zt.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}})}send(A){typeof A!="string"&&(A=xR(A)),this.currentBatch?this.currentBatch.push(A):this.awaitingBatchAck?this.batchBuffer.push(A):(this.currentBatch=[A],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(A){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},A.join(`
2988
+ `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(A,e,t){for(let n of this.reqs)n.abort();this.readyState=Zt.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:A,reason:e,wasClean:t});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(A,e,t,r,n){let s,i=()=>{this.reqs.delete(s),r()};s=Uo.request(A,this.endpointURL(),e,t,this.timeout,i,o=>{this.reqs.delete(s),this.isActive()&&n(o)}),this.reqs.add(s)}},kR=class $s{constructor(e,t={}){let r=t.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,n=>{let{onJoin:s,onLeave:i,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=$s.syncState(this.state,n,s,i),this.pendingDiffs.forEach(a=>{this.state=$s.syncDiff(this.state,a,s,i)}),this.pendingDiffs=[],o()}),this.channel.on(r.diff,n=>{let{onJoin:s,onLeave:i,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(n):(this.state=$s.syncDiff(this.state,n,s,i),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return $s.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,r,n){let s=this.clone(e),i={},o={};return this.map(s,(a,l)=>{t[a]||(o[a]=l)}),this.map(t,(a,l)=>{let u=s[a];if(u){let d=l.metas.map(y=>y.phx_ref),g=u.metas.map(y=>y.phx_ref),p=l.metas.filter(y=>g.indexOf(y.phx_ref)<0),w=u.metas.filter(y=>d.indexOf(y.phx_ref)<0);p.length>0&&(i[a]=l,i[a].metas=p),w.length>0&&(o[a]=this.clone(u),o[a].metas=w)}else i[a]=l}),this.syncDiff(s,{joins:i,leaves:o},r,n)}static syncDiff(e,t,r,n){let{joins:s,leaves:i}=this.clone(t);return r||(r=function(){}),n||(n=function(){}),this.map(s,(o,a)=>{let l=e[o];if(e[o]=this.clone(a),l){let u=e[o].metas.map(g=>g.phx_ref),d=l.metas.filter(g=>u.indexOf(g.phx_ref)<0);e[o].metas.unshift(...d)}r(o,l,a)}),this.map(i,(o,a)=>{let l=e[o];if(!l)return;let u=a.metas.map(d=>d.phx_ref);l.metas=l.metas.filter(d=>u.indexOf(d.phx_ref)<0),n(o,l,a),l.metas.length===0&&delete e[o]}),e}static list(e,t){return t||(t=function(r,n){return n}),this.map(e,(r,n)=>t(r,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Qo={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(A,e){if(A.payload.constructor===ArrayBuffer)return e(this.binaryEncode(A));{let t=[A.join_ref,A.ref,A.topic,A.event,A.payload];return e(JSON.stringify(t))}},decode(A,e){if(A.constructor===ArrayBuffer)return e(this.binaryDecode(A));{let[t,r,n,s,i]=JSON.parse(A);return e({join_ref:t,ref:r,topic:n,event:s,payload:i})}},binaryEncode(A){let{join_ref:e,ref:t,event:r,topic:n,payload:s}=A,i=this.META_LENGTH+e.length+t.length+n.length+r.length,o=new ArrayBuffer(this.HEADER_LENGTH+i),a=new DataView(o),l=0;a.setUint8(l++,this.KINDS.push),a.setUint8(l++,e.length),a.setUint8(l++,t.length),a.setUint8(l++,n.length),a.setUint8(l++,r.length),Array.from(e,d=>a.setUint8(l++,d.charCodeAt(0))),Array.from(t,d=>a.setUint8(l++,d.charCodeAt(0))),Array.from(n,d=>a.setUint8(l++,d.charCodeAt(0))),Array.from(r,d=>a.setUint8(l++,d.charCodeAt(0)));var u=new Uint8Array(o.byteLength+s.byteLength);return u.set(new Uint8Array(o),0),u.set(new Uint8Array(s),o.byteLength),u.buffer},binaryDecode(A){let e=new DataView(A),t=e.getUint8(0),r=new TextDecoder;switch(t){case this.KINDS.push:return this.decodePush(A,e,r);case this.KINDS.reply:return this.decodeReply(A,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(A,e,r)}},decodePush(A,e,t){let r=e.getUint8(1),n=e.getUint8(2),s=e.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,o=t.decode(A.slice(i,i+r));i=i+r;let a=t.decode(A.slice(i,i+n));i=i+n;let l=t.decode(A.slice(i,i+s));i=i+s;let u=A.slice(i,A.byteLength);return{join_ref:o,ref:null,topic:a,event:l,payload:u}},decodeReply(A,e,t){let r=e.getUint8(1),n=e.getUint8(2),s=e.getUint8(3),i=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,a=t.decode(A.slice(o,o+r));o=o+r;let l=t.decode(A.slice(o,o+n));o=o+n;let u=t.decode(A.slice(o,o+s));o=o+s;let d=t.decode(A.slice(o,o+i));o=o+i;let g=A.slice(o,A.byteLength),p={status:d,response:g};return{join_ref:a,ref:l,topic:u,event:uA.reply,payload:p}},decodeBroadcast(A,e,t){let r=e.getUint8(1),n=e.getUint8(2),s=this.HEADER_LENGTH+2,i=t.decode(A.slice(s,s+r));s=s+r;let o=t.decode(A.slice(s,s+n));s=s+n;let a=A.slice(s,A.byteLength);return{join_ref:null,ref:null,topic:i,event:o,payload:a}}},LR=class{constructor(A,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||FR,this.transport=e.transport||Yt.WebSocket||Zr,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let t=null;try{t=Yt&&Yt.sessionStorage}catch{}this.sessionStore=e.sessionStorage||t,this.establishedConnections=0,this.defaultEncoder=Qo.encode.bind(Qo),this.defaultDecoder=Qo.decode.bind(Qo),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Zr?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Yr&&Yr.addEventListener&&(Yr.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Yr.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),Yr.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,s,i)=>{console.log(`${n}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=gs(e.params||{}),this.endPoint=`${A}/${Nl.websocket}`,this.vsn=e.vsn||IR,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Qw(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Zr}replaceTransport(A){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=A}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let A=Uo.appendParams(Uo.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return A.charAt(0)!=="/"?A:A.charAt(1)==="/"?`${this.protocol()}:${A}`:`${this.protocol()}://${location.host}${A}`}disconnect(A,e,t){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,A&&A()},e,t)}connect(A){A&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=gs(A)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Zr?this.connectWithFallback(Zr,this.longPollFallbackMs):this.transportConnect())}log(A,e,t){this.logger&&this.logger(A,e,t)}hasLogger(){return this.logger!==null}onOpen(A){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,A]),e}onClose(A){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,A]),e}onError(A){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,A]),e}onMessage(A){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,A]),e}onHeartbeat(A){this.heartbeatCallback=A}ping(A){if(!this.isConnected())return!1;let e=this.makeRef(),t=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(n=>{n.ref===e&&(this.off([r]),A(Date.now()-t))});return!0}transportName(A){switch(A){case Zr:return"LongPoll";default:return A.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let A;this.authToken&&(A=["phoenix",`${Ml}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),A),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(A){return this.sessionStore&&this.sessionStore.getItem(A)}storeSession(A,e){this.sessionStore&&this.sessionStore.setItem(A,e)}connectWithFallback(A,e=2500){clearTimeout(this.fallbackTimer);let t=!1,r=!0,n,s,i=this.transportName(A),o=a=>{this.log("transport",`falling back to ${i}...`,a),this.off([n,s]),r=!1,this.replaceTransport(A),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),s=this.onError(a=>{this.log("transport","error",a),r&&!t&&(clearTimeout(this.fallbackTimer),o(a))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(t=!0,!r){let a=this.transportName(A);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${a}`,"true"),this.log("transport",`established ${a} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(a=>{this.log("transport","connected to primary after",a),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(A){this.log("error","error in heartbeat callback",A)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),TR,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(A,e,t){if(!this.conn)return A&&A();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,t||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),A&&A()})})}waitForBufferDone(A,e,t=1){if(t===5||!A.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(A,e,t+1)},150*t)}waitForSocketClosed(A,e,t=1){if(t===5||A.readyState===Zt.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(A,e,t+1)},150*t)}onConnClose(A){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",A),this.triggerChanError(A),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",A)}onConnError(A){this.hasLogger()&&this.log("transport","error",A);let e=this.transport,t=this.establishedConnections;this.triggerStateCallbacks("error",A,e,t),(e===this.transport||t>0)&&this.triggerChanError(A)}triggerChanError(A){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(uA.error,A)})}connectionState(){switch(this.conn&&this.conn.readyState){case Zt.connecting:return"connecting";case Zt.open:return"open";case Zt.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(A){this.off(A.stateChangeRefs),this.channels=this.channels.filter(e=>e!==A)}off(A){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([t])=>A.indexOf(t)===-1)}channel(A,e={}){let t=new RR(A,e,this);return this.channels.push(t),t}push(A){if(this.hasLogger()){let{topic:e,event:t,payload:r,ref:n,join_ref:s}=A;this.log("push",`${e} ${t} (${s}, ${n})`,r)}this.isConnected()?this.encode(A,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(A,e=>this.conn.send(e)))}makeRef(){let A=this.ref+1;return A===this.ref?this.ref=0:this.ref=A,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(A){this.log("error","error in heartbeat callback",A)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(A){this.log("error","error in heartbeat callback",A)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(A=>A()),this.sendBuffer=[])}onConnMessage(A){this.decode(A.data,e=>{let{topic:t,event:r,payload:n,ref:s,join_ref:i}=e;if(s&&s===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(n.status==="ok"?"ok":"error",o)}catch(a){this.log("error","error in heartbeat callback",a)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${n.status||""} ${t} ${r} ${s&&"("+s+")"||""}`.trim(),n);for(let o=0;o<this.channels.length;o++){const a=this.channels[o];a.isMember(t,r,n,i)&&a.trigger(r,n,s,i)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(A,...e){try{this.stateChangeCallbacks[A].forEach(([t,r])=>{try{r(...e)}catch(n){this.log("error",`error in ${A} callback`,n)}})}catch(t){this.log("error",`error triggering ${A} callbacks`,t)}}leaveOpenTopic(A){let e=this.channels.find(t=>t.topic===A&&(t.isJoined()||t.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${A}"`),e.leave())}};class ps{constructor(e,t){const r=HR(t);this.presence=new kR(e.getChannel(),r),this.presence.onJoin((n,s,i)=>{const o=ps.onJoinPayload(n,s,i);e.getChannel().trigger("presence",o)}),this.presence.onLeave((n,s,i)=>{const o=ps.onLeavePayload(n,s,i);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ps.transformState(this.presence.state)}static transformState(e){return e=DR(e),Object.getOwnPropertyNames(e).reduce((t,r)=>{const n=e[r];return t[r]=Io(n),t},{})}static onJoinPayload(e,t,r){const n=Iw(t),s=Io(r);return{event:"join",key:e,currentPresences:n,newPresences:s}}static onLeavePayload(e,t,r){const n=Iw(t),s=Io(r);return{event:"leave",key:e,currentPresences:n,leftPresences:s}}}function Io(A){return A.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function DR(A){return JSON.parse(JSON.stringify(A))}function HR(A){return(A==null?void 0:A.events)&&{events:A.events}}function Iw(A){return A!=null&&A.metas?Io(A):[]}var Vl;(function(A){A.SYNC="sync",A.JOIN="join",A.LEAVE="leave"})(Vl||(Vl={}));class Fw{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new ps(this.channel.channelAdapter,t)}}function OR(A){if(A instanceof Error)return A;if(typeof A=="string")return new Error(A);if(A&&typeof A=="object"){const e=A;if(typeof e.code=="number"){const t=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${t}`,{cause:A})}return new Error("channel error: transport failure",{cause:A})}return new Error("channel error: connection lost")}class PR{constructor(e,t,r){const n=NR(r);this.channel=e.getSocket().channel(t,n),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,r){let n;try{n=this.channel.push(e,t,r)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>BR){const s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return n}updateJoinPayload(e){const t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===lA.joined}isJoined(){return this.state===lA.joined}isJoining(){return this.state===lA.joining}isClosed(){return this.state===lA.closed}isLeaving(){return this.state===lA.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function NR(A){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},A.config)}}var Kl;(function(A){A.ALL="*",A.INSERT="INSERT",A.UPDATE="UPDATE",A.DELETE="DELETE"})(Kl||(Kl={}));var lr;(function(A){A.BROADCAST="broadcast",A.PRESENCE="presence",A.POSTGRES_CHANGES="postgres_changes",A.SYSTEM="system"})(lr||(lr={}));var eA;(function(A){A.SUBSCRIBED="SUBSCRIBED",A.TIMED_OUT="TIMED_OUT",A.CLOSED="CLOSED",A.CHANNEL_ERROR="CHANNEL_ERROR"})(eA||(eA={}));const MR=lA;class en{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},r){var n,s;if(this.topic=e,this.params=t,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config),this.channelAdapter=new PR(this.socket.socketAdapter,e,this.params),this.presence=new Fw(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Uw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((s=(n=this.params.config)===null||n===void 0?void 0:n.broadcast)===null||s===void 0)&&s.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){var r,n,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:o,private:a}}=this.params,l=(n=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&n!==void 0?n:[],u=!!this.bindings[lr.PRESENCE]&&this.bindings[lr.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,d={},g={broadcast:i,presence:Object.assign(Object.assign({},o),{enabled:u}),postgres_changes:l,private:a};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(p=>{e==null||e(eA.CHANNEL_ERROR,OR(p))}),this._onClose(()=>e==null?void 0:e(eA.CLOSED)),this.updateJoinPayload(Object.assign({config:g},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){e==null||e(eA.SUBSCRIBED);return}this._updatePostgresBindings(p,e)}).receive("error",p=>{this.state=lA.errored;const w=Object.values(p).join(", ")||"error";e==null||e(eA.CHANNEL_ERROR,new Error(w,{cause:p}))}).receive("timeout",()=>{e==null||e(eA.TIMED_OUT)})}return this}_updatePostgresBindings(e,t){var r;const n=this.bindings.postgres_changes,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0,i=[];for(let o=0;o<s;o++){const a=n[o],{filter:{event:l,schema:u,table:d,filter:g}}=a,p=e&&e[o];if(p&&p.event===l&&en.isFilterValueEqual(p.schema,u)&&en.isFilterValueEqual(p.table,d)&&en.isFilterValueEqual(p.filter,g))i.push(Object.assign(Object.assign({},a),{id:p.id}));else{this.unsubscribe(),this.state=lA.errored,t==null||t(eA.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=lA.errored&&t&&t(eA.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,r){const n=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===lr.PRESENCE||e===lr.POSTGRES_CHANGES;if(n&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,t,r)}async httpSend(e,t,r={}){var n;if(t==null)return Promise.reject(new Error("Payload is required for httpSend()"));const s=t instanceof ArrayBuffer||ArrayBuffer.isView(t),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":s?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o=new URL(this.broadcastEndpointURL);o.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&o.searchParams.set("private","true");const a={method:"POST",headers:i,body:s?t:JSON.stringify(t)},l=await this._fetchWithTimeout(o.toString(),a,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);if(l.status===202)return{success:!0};if(l.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=l.statusText;try{const d=await l.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(e,t={}){var r,n;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:i}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:i,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(r=t.timeout)!==null&&r!==void 0?r:this.timeout);return await((n=l.body)===null||n===void 0?void 0:n.cancel()),l.ok?"ok":"error"}catch(l){return l instanceof Error&&l.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var i,o,a;const l=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((a=(o=(i=this.params)===null||i===void 0?void 0:i.config)===null||o===void 0?void 0:o.broadcast)===null||a===void 0)&&a.ack)&&s("ok"),l.receive("ok",()=>s("ok")),l.receive("error",()=>s("error")),l.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>t("ok")).receive("timeout",()=>t("timed out")).receive("error",()=>t("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,r){const n=new AbortController,s=setTimeout(()=>n.abort(),r),i=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:n.signal}));return clearTimeout(s),i}_on(e,t,r){const n=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),i={type:n,filter:t,callback:r,ref:s};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,r)=>{var n,s,i,o,a,l,u;const d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,r))return!1;const g=(n=this.bindings[d])===null||n===void 0?void 0:n.find(p=>p.ref===e.ref);if(!g)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in g){const p=g.id,w=(s=g.filter)===null||s===void 0?void 0:s.event;return p&&((i=t.ids)===null||i===void 0?void 0:i.includes(p))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((o=t.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const p=(l=(a=g==null?void 0:g.filter)===null||a===void 0?void 0:a.event)===null||l===void 0?void 0:l.toLocaleLowerCase();return p==="*"||p===((u=t==null?void 0:t.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,t){const{close:r,error:n,leave:s,join:i}=Ew;return t&&[r,n,s,i].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,r)=>{if(typeof t=="object"&&"ids"in t){const n=t.data,{schema:s,table:i,commit_timestamp:o,type:a,errors:l}=n;return Object.assign(Object.assign({},{schema:s,table:i,commit_timestamp:o,eventType:a,new:{},old:{},errors:l}),this._getPayloadRecords(n))}return t})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const t in e.bindings)for(const r of e.bindings[t])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=vw(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=vw(e.columns,e.old_record)),t}}class VR{constructor(e,t){this.socket=new LR(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,r,n=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),n),this.socket.disconnect(()=>{e(),s("ok")},t,r)})}push(e){this.socket.push(e)}log(e,t,r){this.socket.log(e,t,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Ol.connecting}isDisconnecting(){return this.socket.connectionState()==Ol.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Tw={HEARTBEAT_INTERVAL:25e3},KR=[1e3,2e3,5e3,1e4],$R=1e4;function jR(){const A=new Map;return{get length(){return A.size},clear(){A.clear()},getItem(e){return A.has(e)?A.get(e):null},key(e){var t;return(t=Array.from(A.keys())[e])!==null&&t!==void 0?t:null},removeItem(e){A.delete(e)},setItem(e,t){A.set(e,String(t))}}}function GR(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return jR()}const WR=`
2989
2989
  addEventListener("message", (e) => {
2990
2990
  if (e.data.event === "start") {
2991
2991
  setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
@@ -3003,8 +3003,8 @@ Option 2: Install and provide the "ws" package:
3003
3003
  const client = new RealtimeClient(url, {
3004
3004
  ...options,
3005
3005
  transport: ws
3006
- })`):new Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return t==="ok"&&e.teardown(),t}async removeAllChannels(){const e=this.channels.map(async r=>{const n=await r.unsubscribe();return r.teardown(),n}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||Pl.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){const r=`realtime:${e}`,n=this.getChannels().find(s=>s.topic===r);if(n)return n;{const s=new Zr(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(s),s}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(n){this.log("error","Error fetching access token from callback",n),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(n=>{const s={access_token:t,version:gR};t&&n.updateJoinPayload(s),n.joinedOnce&&n.channelAdapter.isJoined()&&n.channelAdapter.push(Ew.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(t=>{this.log("error","error waiting for auth on connect",t)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{t=="sent"&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{const r=new Blob([WR],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}_initializeOptions(e){var t,r,n,s,i,o,a,l,u,d,g,p;this.worker=(t=e==null?void 0:e.worker)!==null&&t!==void 0?t:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const w={};w.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:mR,w.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:Tw.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:Tw.HEARTBEAT_INTERVAL),w.transport=(a=e==null?void 0:e.transport)!==null&&a!==void 0?a:Cw.getWebSocketConstructor(),w.params=e==null?void 0:e.params,w.logger=e==null?void 0:e.logger,w.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),w.sessionStorage=(l=e==null?void 0:e.sessionStorage)!==null&&l!==void 0?l:GR(),w.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:S=>KR[S-1]||$R;let y,B;const b=(d=e==null?void 0:e.vsn)!==null&&d!==void 0?d:wR;switch(b){case pR:y=(S,I)=>I(JSON.stringify(S)),B=(S,I)=>I(JSON.parse(S));break;case _w:y=this.serializer.encode.bind(this.serializer),B=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${w.vsn}`)}if(w.vsn=b,w.encode=(g=e==null?void 0:e.encode)!==null&&g!==void 0?g:y,w.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:B,w.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,w.params=Object.assign(Object.assign({},w.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,w.autoSendHeartbeat=!this.worker}return w}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var ws=class extends Error{constructor(A,e){var t;super(A),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((t=e.icebergType)==null?void 0:t.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function qR(A,e,t){const r=new URL(e,A);if(t)for(const[n,s]of Object.entries(t))s!==void 0&&r.searchParams.set(n,s);return r.toString()}async function JR(A){return!A||A.type==="none"?{}:A.type==="bearer"?{Authorization:`Bearer ${A.token}`}:A.type==="header"?{[A.name]:A.value}:A.type==="custom"?await A.getHeaders():{}}function zR(A){const e=A.fetchImpl??globalThis.fetch;return{async request({method:t,path:r,query:n,body:s,headers:i}){const o=qR(A.baseUrl,r,n),a=await JR(A.auth),l=await e(o,{method:t,headers:{...s?{"Content-Type":"application/json"}:{},...a,...i},body:s?JSON.stringify(s):void 0}),u=await l.text(),d=(l.headers.get("content-type")||"").includes("application/json"),g=d&&u?JSON.parse(u):u;if(!l.ok){const p=d?g:void 0,w=p==null?void 0:p.error;throw new ws((w==null?void 0:w.message)??`Request failed with status ${l.status}`,{status:l.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:p})}return{status:l.status,headers:l.headers,data:g}}}}function To(A){return A.join("")}var XR=class{constructor(A,e=""){this.client=A,this.prefix=e}async listNamespaces(A){const e=A?{parent:To(A.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(A,e){const t={namespace:A.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:t})).data}async dropNamespace(A){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${To(A.namespace)}`})}async loadNamespaceMetadata(A){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${To(A.namespace)}`})).data.properties}}async namespaceExists(A){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${To(A.namespace)}`}),!0}catch(e){if(e instanceof ws&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(A,e){try{return await this.createNamespace(A,e)}catch(t){if(t instanceof ws&&t.status===409)return;throw t}}};function en(A){return A.join("")}var YR=class{constructor(A,e="",t){this.client=A,this.prefix=e,this.accessDelegation=t}async listTables(A){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${en(A.namespace)}/tables`})).data.identifiers}async createTable(A,e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${en(A.namespace)}/tables`,body:e,headers:t})).data.metadata}async updateTable(A,e){const t=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${en(A.namespace)}/tables/${A.name}`,body:e});return{"metadata-location":t.data["metadata-location"],metadata:t.data.metadata}}async dropTable(A,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${en(A.namespace)}/tables/${A.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(A){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${en(A.namespace)}/tables/${A.name}`,headers:e})).data.metadata}async tableExists(A){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${en(A.namespace)}/tables/${A.name}`,headers:e}),!0}catch(t){if(t instanceof ws&&t.status===404)return!1;throw t}}async createTableIfNotExists(A,e){try{return await this.createTable(A,e)}catch(t){if(t instanceof ws&&t.status===409)return await this.loadTable({namespace:A.namespace,name:e.name});throw t}}},ZR=class{constructor(A){var r;let e="v1";A.catalogName&&(e+=`/${A.catalogName}`);const t=A.baseUrl.endsWith("/")?A.baseUrl:`${A.baseUrl}/`;this.client=zR({baseUrl:t,auth:A.auth,fetchImpl:A.fetch}),this.accessDelegation=(r=A.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new XR(this.client,e),this.tableOps=new YR(this.client,e,this.accessDelegation)}async listNamespaces(A){return this.namespaceOps.listNamespaces(A)}async createNamespace(A,e){return this.namespaceOps.createNamespace(A,e)}async dropNamespace(A){await this.namespaceOps.dropNamespace(A)}async loadNamespaceMetadata(A){return this.namespaceOps.loadNamespaceMetadata(A)}async listTables(A){return this.tableOps.listTables(A)}async createTable(A,e){return this.tableOps.createTable(A,e)}async updateTable(A,e){return this.tableOps.updateTable(A,e)}async dropTable(A,e){await this.tableOps.dropTable(A,e)}async loadTable(A){return this.tableOps.loadTable(A)}async namespaceExists(A){return this.namespaceOps.namespaceExists(A)}async tableExists(A){return this.tableOps.tableExists(A)}async createNamespaceIfNotExists(A,e){return this.namespaceOps.createNamespaceIfNotExists(A,e)}async createTableIfNotExists(A,e){return this.tableOps.createTableIfNotExists(A,e)}};function ms(A){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ms(A)}function e1(A,e){if(ms(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var r=t.call(A,e);if(ms(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function t1(A){var e=e1(A,"string");return ms(e)=="symbol"?e:e+""}function A1(A,e,t){return(e=t1(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Rw(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(A);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,r)}return t}function W(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rw(Object(t),!0).forEach(function(r){A1(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Rw(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}var So=class extends Error{constructor(A,e="storage",t,r){super(A),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Ro(A){return typeof A=="object"&&A!==null&&"__isStorageError"in A}var xo=class extends So{constructor(A,e,t,r="storage"){super(A,r,e,t),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=t}toJSON(){return W({},super.toJSON())}},xw=class extends So{constructor(A,e,t="storage"){super(A,t),this.name=t==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function ko(A,e,t){const r=W({},A),n=e.toLowerCase();for(const s of Object.keys(r))s.toLowerCase()===n&&delete r[s];return r[n]=t,r}function r1(A){const e={};for(const[t,r]of Object.entries(A))e[t.toLowerCase()]=r;return e}const n1=A=>A?(...e)=>A(...e):(...e)=>fetch(...e),s1=A=>{if(typeof A!="object"||A===null)return!1;const e=Object.getPrototypeOf(A);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in A)&&!(Symbol.iterator in A)},jl=A=>{if(Array.isArray(A))return A.map(t=>jl(t));if(typeof A=="function"||A!==Object(A))return A;const e={};return Object.entries(A).forEach(([t,r])=>{const n=t.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[n]=jl(r)}),e},i1=A=>!A||typeof A!="string"||A.length===0||A.length>100||A.trim()!==A||A.includes("/")||A.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(A),kw=A=>{if(typeof A=="object"&&A!==null){const e=A;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const t=e.error;if(typeof t.message=="string")return t.message}}return JSON.stringify(A)},o1=async(A,e,t,r)=>{if(A!==null&&typeof A=="object"&&"json"in A&&typeof A.json=="function"){const n=A;let s=parseInt(String(n.status),10);Number.isFinite(s)||(s=500),n.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||s+"";e(new xo(kw(i),s,o,r))}).catch(()=>{const i=s+"";e(new xo(n.statusText||`HTTP ${s} error`,s,i,r))})}else e(new xw(kw(A),A,r))},a1=(A,e,t,r)=>{const n={method:A,headers:(e==null?void 0:e.headers)||{}};if(A==="GET"||A==="HEAD"||!r)return W(W({},n),t);if(s1(r)){var s;const i=(e==null?void 0:e.headers)||{};let o;for(const[a,l]of Object.entries(i))a.toLowerCase()==="content-type"&&(o=l);n.headers=ko(i,"Content-Type",(s=o)!==null&&s!==void 0?s:"application/json"),n.body=JSON.stringify(r)}else n.body=r;return e!=null&&e.duplex&&(n.duplex=e.duplex),W(W({},n),t)};async function Bs(A,e,t,r,n,s,i){return new Promise((o,a)=>{A(t,a1(e,r,n,s)).then(l=>{if(!l.ok)throw l;if(r!=null&&r.noResolveJson)return l;if(i==="vectors"){const u=l.headers.get("content-type");if(l.headers.get("content-length")==="0"||l.status===204)return{};if(!u||!u.includes("application/json"))return{}}return l.json()}).then(l=>o(l)).catch(l=>o1(l,a,r,i))})}function Lw(A="storage"){return{get:async(e,t,r,n)=>Bs(e,"GET",t,r,n,void 0,A),post:async(e,t,r,n,s)=>Bs(e,"POST",t,n,s,r,A),put:async(e,t,r,n,s)=>Bs(e,"PUT",t,n,s,r,A),head:async(e,t,r,n)=>Bs(e,"HEAD",t,W(W({},r),{},{noResolveJson:!0}),n,void 0,A),remove:async(e,t,r,n,s)=>Bs(e,"DELETE",t,n,s,r,A)}}const c1=Lw("storage"),{get:ys,post:Lt,put:Gl,head:l1,remove:Wl}=c1,gt=Lw("vectors");var tn=class{constructor(A,e={},t,r="storage"){this.shouldThrowOnError=!1,this.url=A,this.headers=r1(e),this.fetch=n1(t),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(A,e){return this.headers=ko(this.headers,A,e),this}async handleOperation(A){var e=this;try{return{data:await A(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Ro(t))return{data:null,error:t};throw t}}};let Dw;Dw=Symbol.toStringTag;var u1=class{constructor(A,e){this.downloadFn=A,this.shouldThrowOnError=e,this[Dw]="StreamDownloadBuilder",this.promise=null}then(A,e){return this.getPromise().then(A,e)}catch(A){return this.getPromise().catch(A)}finally(A){return this.getPromise().finally(A)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var A=this;try{return{data:(await A.downloadFn()).body,error:null}}catch(e){if(A.shouldThrowOnError)throw e;if(Ro(e))return{data:null,error:e};throw e}}};let Hw;Hw=Symbol.toStringTag;var h1=class{constructor(A,e){this.downloadFn=A,this.shouldThrowOnError=e,this[Hw]="BlobDownloadBuilder",this.promise=null}asStream(){return new u1(this.downloadFn,this.shouldThrowOnError)}then(A,e){return this.getPromise().then(A,e)}catch(A){return this.getPromise().catch(A)}finally(A){return this.getPromise().finally(A)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var A=this;try{return{data:await(await A.downloadFn()).blob(),error:null}}catch(e){if(A.shouldThrowOnError)throw e;if(Ro(e))return{data:null,error:e};throw e}}};const d1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ow={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var f1=class extends tn{constructor(A,e={},t,r){super(A,e,r,"storage"),this.bucketId=t}async uploadOrUpdate(A,e,t,r){var n=this;return n.handleOperation(async()=>{let s;const i=W(W({},Ow),r);let o=W(W({},n.headers),A==="POST"&&{"x-upsert":String(i.upsert)});const a=i.metadata;if(typeof Blob<"u"&&t instanceof Blob?(s=new FormData,s.append("cacheControl",i.cacheControl),a&&s.append("metadata",n.encodeMetadata(a)),s.append("",t)):typeof FormData<"u"&&t instanceof FormData?(s=t,s.has("cacheControl")||s.append("cacheControl",i.cacheControl),a&&!s.has("metadata")&&s.append("metadata",n.encodeMetadata(a))):(s=t,o["cache-control"]=`max-age=${i.cacheControl}`,o["content-type"]=i.contentType,a&&(o["x-metadata"]=n.toBase64(n.encodeMetadata(a))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!i.duplex&&(i.duplex="half")),r!=null&&r.headers)for(const[g,p]of Object.entries(r.headers))o=ko(o,g,p);const l=n._removeEmptyFolders(e),u=n._getFinalPath(l),d=await(A=="PUT"?Gl:Lt)(n.fetch,`${n.url}/object/${u}`,s,W({headers:o},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(A,e,t){return this.uploadOrUpdate("POST",A,e,t)}async uploadToSignedUrl(A,e,t,r){var n=this;const s=n._removeEmptyFolders(A),i=n._getFinalPath(s),o=new URL(n.url+`/object/upload/sign/${i}`);return o.searchParams.set("token",e),n.handleOperation(async()=>{let a;const l=W(W({},Ow),r);let u=W(W({},n.headers),{"x-upsert":String(l.upsert)});const d=l.metadata;if(typeof Blob<"u"&&t instanceof Blob?(a=new FormData,a.append("cacheControl",l.cacheControl),d&&a.append("metadata",n.encodeMetadata(d)),a.append("",t)):typeof FormData<"u"&&t instanceof FormData?(a=t,a.has("cacheControl")||a.append("cacheControl",l.cacheControl),d&&!a.has("metadata")&&a.append("metadata",n.encodeMetadata(d))):(a=t,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType,d&&(u["x-metadata"]=n.toBase64(n.encodeMetadata(d))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!l.duplex&&(l.duplex="half")),r!=null&&r.headers)for(const[g,p]of Object.entries(r.headers))u=ko(u,g,p);return{path:s,fullPath:(await Gl(n.fetch,o.toString(),a,W({headers:u},l!=null&&l.duplex?{duplex:l.duplex}:{}))).Key}})}async createSignedUploadUrl(A,e){var t=this;return t.handleOperation(async()=>{let r=t._getFinalPath(A);const n=W({},t.headers);e!=null&&e.upsert&&(n["x-upsert"]="true");const s=await Lt(t.fetch,`${t.url}/object/upload/sign/${r}`,{},{headers:n}),i=new URL(t.url+s.url),o=i.searchParams.get("token");if(!o)throw new So("No token returned by API");return{signedUrl:i.toString(),path:A,token:o}})}async update(A,e,t){return this.uploadOrUpdate("PUT",A,e,t)}async move(A,e,t){var r=this;return r.handleOperation(async()=>await Lt(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:A,destinationKey:e,destinationBucket:t==null?void 0:t.destinationBucket},{headers:r.headers}))}async copy(A,e,t){var r=this;return r.handleOperation(async()=>({path:(await Lt(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:A,destinationKey:e,destinationBucket:t==null?void 0:t.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(A,e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(A);const s=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0;let i=await Lt(r.fetch,`${r.url}/object/sign/${n}`,W({expiresIn:e},s?{transform:t.transform}:{}),{headers:r.headers});const o=new URLSearchParams;t!=null&&t.download&&o.set("download",t.download===!0?"":t.download),(t==null?void 0:t.cacheNonce)!=null&&o.set("cacheNonce",String(t.cacheNonce));const a=o.toString();return{signedUrl:encodeURI(`${r.url}${i.signedURL}${a?`&${a}`:""}`)}})}async createSignedUrls(A,e,t){var r=this;return r.handleOperation(async()=>{const n=await Lt(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:A},{headers:r.headers}),s=new URLSearchParams;t!=null&&t.download&&s.set("download",t.download===!0?"":t.download),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const i=s.toString();return n.map(o=>W(W({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${i?`&${i}`:""}`):null}))})}download(A,e,t){const r=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",n=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),i=this._getFinalPath(A),o=()=>ys(this.fetch,`${this.url}/${r}/${i}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},t);return new h1(o,this.shouldThrowOnError)}async info(A){var e=this;const t=e._getFinalPath(A);return e.handleOperation(async()=>jl(await ys(e.fetch,`${e.url}/object/info/${t}`,{headers:e.headers})))}async exists(A){var e=this;const t=e._getFinalPath(A);try{return await l1(e.fetch,`${e.url}/object/${t}`,{headers:e.headers}),{data:!0,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Ro(n)){var r;const s=n instanceof xo?n.status:n instanceof xw?(r=n.originalError)===null||r===void 0?void 0:r.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:n}}throw n}}getPublicUrl(A,e){const t=this._getFinalPath(A),r=new URLSearchParams;e!=null&&e.download&&r.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(r,e.transform),(e==null?void 0:e.cacheNonce)!=null&&r.set("cacheNonce",String(e.cacheNonce));const n=r.toString(),s=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${t}`)+(n?`?${n}`:"")}}}async remove(A){var e=this;return e.handleOperation(async()=>await Wl(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:A},{headers:e.headers}))}async list(A,e,t){var r=this;return r.handleOperation(async()=>{const n=W(W(W({},d1),e),{},{prefix:A||""});return await Lt(r.fetch,`${r.url}/object/list/${r.bucketId}`,n,{headers:r.headers},t)})}async listV2(A,e){var t=this;return t.handleOperation(async()=>{const r=W({},A);return await Lt(t.fetch,`${t.url}/object/list-v2/${t.bucketId}`,r,{headers:t.headers},e)})}encodeMetadata(A){return JSON.stringify(A)}toBase64(A){return typeof Buffer<"u"?Buffer.from(A).toString("base64"):btoa(A)}_getFinalPath(A){return`${this.bucketId}/${A.replace(/^\/+/,"")}`}_removeEmptyFolders(A){return A.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(A,e){return e.width&&A.set("width",e.width.toString()),e.height&&A.set("height",e.height.toString()),e.resize&&A.set("resize",e.resize),e.format&&A.set("format",e.format),e.quality&&A.set("quality",e.quality.toString()),A}};const Cs={"X-Client-Info":"storage-js/2.108.2"};var g1=class extends tn{constructor(A,e={},t,r){const n=new URL(A);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase."));const s=n.href.replace(/\/$/,""),i=W(W({},Cs),e);super(s,i,t,"storage")}async listBuckets(A){var e=this;return e.handleOperation(async()=>{const t=e.listBucketOptionsToQueryString(A);return await ys(e.fetch,`${e.url}/bucket${t}`,{headers:e.headers})})}async getBucket(A){var e=this;return e.handleOperation(async()=>await ys(e.fetch,`${e.url}/bucket/${A}`,{headers:e.headers}))}async createBucket(A,e={public:!1}){var t=this;return t.handleOperation(async()=>await Lt(t.fetch,`${t.url}/bucket`,{id:A,name:A,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:t.headers}))}async updateBucket(A,e){var t=this;return t.handleOperation(async()=>await Gl(t.fetch,`${t.url}/bucket/${A}`,{id:A,name:A,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:t.headers}))}async emptyBucket(A){var e=this;return e.handleOperation(async()=>await Lt(e.fetch,`${e.url}/bucket/${A}/empty`,{},{headers:e.headers}))}async deleteBucket(A){var e=this;return e.handleOperation(async()=>await Wl(e.fetch,`${e.url}/bucket/${A}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(A){const e={};return A&&("limit"in A&&(e.limit=String(A.limit)),"offset"in A&&(e.offset=String(A.offset)),A.search&&(e.search=A.search),A.sortColumn&&(e.sortColumn=A.sortColumn),A.sortOrder&&(e.sortOrder=A.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},p1=class extends tn{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),e);super(r,n,t,"storage")}async createBucket(A){var e=this;return e.handleOperation(async()=>await Lt(e.fetch,`${e.url}/bucket`,{name:A},{headers:e.headers}))}async listBuckets(A){var e=this;return e.handleOperation(async()=>{const t=new URLSearchParams;(A==null?void 0:A.limit)!==void 0&&t.set("limit",A.limit.toString()),(A==null?void 0:A.offset)!==void 0&&t.set("offset",A.offset.toString()),A!=null&&A.sortColumn&&t.set("sortColumn",A.sortColumn),A!=null&&A.sortOrder&&t.set("sortOrder",A.sortOrder),A!=null&&A.search&&t.set("search",A.search);const r=t.toString(),n=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await ys(e.fetch,n,{headers:e.headers})})}async deleteBucket(A){var e=this;return e.handleOperation(async()=>await Wl(e.fetch,`${e.url}/bucket/${A}`,{},{headers:e.headers}))}from(A){var e=this;if(!i1(A))throw new So("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const t=new ZR({baseUrl:this.url,catalogName:A,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(t,{get(n,s){const i=n[s];return typeof i!="function"?i:async(...o)=>{try{return{data:await i.apply(n,o),error:null}}catch(a){if(r)throw a;return{data:null,error:a}}}}})}},w1=class extends tn{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),{},{"Content-Type":"application/json"},e);super(r,n,t,"vectors")}async createIndex(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/CreateIndex`,A,{headers:e.headers})||{})}async getIndex(A,e){var t=this;return t.handleOperation(async()=>await gt.post(t.fetch,`${t.url}/GetIndex`,{vectorBucketName:A,indexName:e},{headers:t.headers}))}async listIndexes(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/ListIndexes`,A,{headers:e.headers}))}async deleteIndex(A,e){var t=this;return t.handleOperation(async()=>await gt.post(t.fetch,`${t.url}/DeleteIndex`,{vectorBucketName:A,indexName:e},{headers:t.headers})||{})}},m1=class extends tn{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),{},{"Content-Type":"application/json"},e);super(r,n,t,"vectors")}async putVectors(A){var e=this;if(A.vectors.length<1||A.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/PutVectors`,A,{headers:e.headers})||{})}async getVectors(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/GetVectors`,A,{headers:e.headers}))}async listVectors(A){var e=this;if(A.segmentCount!==void 0){if(A.segmentCount<1||A.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(A.segmentIndex!==void 0&&(A.segmentIndex<0||A.segmentIndex>=A.segmentCount))throw new Error(`segmentIndex must be between 0 and ${A.segmentCount-1}`)}return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/ListVectors`,A,{headers:e.headers}))}async queryVectors(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/QueryVectors`,A,{headers:e.headers}))}async deleteVectors(A){var e=this;if(A.keys.length<1||A.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/DeleteVectors`,A,{headers:e.headers})||{})}},B1=class extends tn{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),{},{"Content-Type":"application/json"},e);super(r,n,t,"vectors")}async createBucket(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:A},{headers:e.headers})||{})}async getBucket(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:A},{headers:e.headers}))}async listBuckets(A={}){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/ListVectorBuckets`,A,{headers:e.headers}))}async deleteBucket(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:A},{headers:e.headers})||{})}},y1=class extends B1{constructor(A,e={}){super(A,e.headers||{},e.fetch)}from(A){return new C1(this.url,this.headers,A,this.fetch)}async createBucket(A){var e=()=>super.createBucket,t=this;return e().call(t,A)}async getBucket(A){var e=()=>super.getBucket,t=this;return e().call(t,A)}async listBuckets(A={}){var e=()=>super.listBuckets,t=this;return e().call(t,A)}async deleteBucket(A){var e=()=>super.deleteBucket,t=this;return e().call(t,A)}},C1=class extends w1{constructor(A,e,t,r){super(A,e,r),this.vectorBucketName=t}async createIndex(A){var e=()=>super.createIndex,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName}))}async listIndexes(A={}){var e=()=>super.listIndexes,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName}))}async getIndex(A){var e=()=>super.getIndex,t=this;return e().call(t,t.vectorBucketName,A)}async deleteIndex(A){var e=()=>super.deleteIndex,t=this;return e().call(t,t.vectorBucketName,A)}index(A){return new _1(this.url,this.headers,this.vectorBucketName,A,this.fetch)}},_1=class extends m1{constructor(A,e,t,r,n){super(A,e,n),this.vectorBucketName=t,this.indexName=r}async putVectors(A){var e=()=>super.putVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async getVectors(A){var e=()=>super.getVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async listVectors(A={}){var e=()=>super.listVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async queryVectors(A){var e=()=>super.queryVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async deleteVectors(A){var e=()=>super.deleteVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}},E1=class extends g1{constructor(A,e={},t,r){super(A,e,t,r)}from(A){return new f1(this.url,this.headers,A,this.fetch)}get vectors(){return new y1(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new p1(this.url+"/iceberg",this.headers,this.fetch)}};const Pw="2.108.2",hA=30*1e3,_s=3,ql=_s*hA,v1=2*hA,b1="http://localhost:9999",U1="supabase.auth.token",Q1={"X-Client-Info":`gotrue-js/${Pw}`},Jl="X-Supabase-Api-Version",Nw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},I1=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,F1=10*60*1e3;class An extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function H(A){return typeof A=="object"&&A!==null&&"__isAuthError"in A}class Mw extends An{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function Vw(A){return H(A)&&A.name==="AuthApiError"}class Et extends An{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class Dt extends An{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class He extends Dt{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Es(A){return H(A)&&A.name==="AuthSessionMissingError"}class ur extends Dt{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class vs extends Dt{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class bs extends Dt{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Kw(A){return H(A)&&A.name==="AuthImplicitGrantRedirectError"}class zl extends Dt{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class $w extends Dt{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}function T1(A){return H(A)&&A.name==="AuthPKCECodeVerifierMissingError"}class Lo extends Dt{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function Xl(A){return H(A)&&A.name==="AuthRetryableFetchError"}class Yl extends Dt{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function jw(A){return H(A)&&A.name==="AuthRefreshDiscardedError"}class Zl extends Dt{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}function S1(A){return H(A)&&A.name==="AuthWeakPasswordError"}class Us extends Dt{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Do="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Gw=`
3007
- \r=`.split(""),R1=(()=>{const A=new Array(128);for(let e=0;e<A.length;e+=1)A[e]=-1;for(let e=0;e<Gw.length;e+=1)A[Gw[e].charCodeAt(0)]=-2;for(let e=0;e<Do.length;e+=1)A[Do[e].charCodeAt(0)]=e;return A})();function Ww(A,e,t){if(A!==null)for(e.queue=e.queue<<8|A,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(Do[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(Do[r]),e.queuedBits-=6}}function qw(A,e,t){const r=R1[A];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(A)}"`)}}function Jw(A){const e=[],t=i=>{e.push(String.fromCodePoint(i))},r={utf8seq:0,codepoint:0},n={queue:0,queuedBits:0},s=i=>{L1(i,r,t)};for(let i=0;i<A.length;i+=1)qw(A.charCodeAt(i),n,s);return e.join("")}function x1(A,e){if(A<=127){e(A);return}else if(A<=2047){e(192|A>>6),e(128|A&63);return}else if(A<=65535){e(224|A>>12),e(128|A>>6&63),e(128|A&63);return}else if(A<=1114111){e(240|A>>18),e(128|A>>12&63),e(128|A>>6&63),e(128|A&63);return}throw new Error(`Unrecognized Unicode codepoint: ${A.toString(16)}`)}function k1(A,e){for(let t=0;t<A.length;t+=1){let r=A.charCodeAt(t);if(r>55295&&r<=56319){const n=(r-55296)*1024&65535;r=(A.charCodeAt(t+1)-56320&65535|n)+65536,t+=1}x1(r,e)}}function L1(A,e,t){if(e.utf8seq===0){if(A<=127){t(A);return}for(let r=1;r<6;r+=1)if(!(A>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=A&31;else if(e.utf8seq===3)e.codepoint=A&15;else if(e.utf8seq===4)e.codepoint=A&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(A<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|A&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function rn(A){const e=[],t={queue:0,queuedBits:0},r=n=>{e.push(n)};for(let n=0;n<A.length;n+=1)qw(A.charCodeAt(n),t,r);return new Uint8Array(e)}function D1(A){const e=[];return k1(A,t=>e.push(t)),new Uint8Array(e)}function hr(A){const e=[],t={queue:0,queuedBits:0},r=n=>{e.push(n)};return A.forEach(n=>Ww(n,t,r)),Ww(null,t,r),e.join("")}function H1(A){return Math.round(Date.now()/1e3)+A}function O1(){return Symbol("auth-callback")}const ze=()=>typeof window<"u"&&typeof document<"u",dr={tested:!1,writable:!1},zw=()=>{if(!ze())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(dr.tested)return dr.writable;const A=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(A,A),globalThis.localStorage.removeItem(A),dr.tested=!0,dr.writable=!0}catch{dr.tested=!0,dr.writable=!1}return dr.writable};function P1(A){const e={},t=new URL(A);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((n,s)=>{e[s]=n})}catch{}return t.searchParams.forEach((r,n)=>{e[n]=r}),e}const Xw=A=>A?(...e)=>A(...e):(...e)=>fetch(...e),N1=A=>typeof A=="object"&&A!==null&&"status"in A&&"ok"in A&&"json"in A&&typeof A.json=="function",nn=async(A,e,t)=>{await A.setItem(e,JSON.stringify(t))},Ht=async(A,e)=>{const t=await A.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return null}},Qe=async(A,e)=>{await A.removeItem(e)};class Ho{constructor(){this.promise=new Ho.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Ho.promiseConstructor=Promise;function Oo(A){const e=A.split(".");if(e.length!==3)throw new Us("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!I1.test(e[r]))throw new Us("JWT not in base64url format");return{header:JSON.parse(Jw(e[0])),payload:JSON.parse(Jw(e[1])),signature:rn(e[2]),raw:{header:e[0],payload:e[1]}}}async function M1(A){return await new Promise(e=>{setTimeout(()=>e(null),A)})}function V1(A,e){return new Promise((r,n)=>{(async()=>{for(let s=0;s<1/0;s++)try{const i=await A(s);if(!e(s,null,i)){r(i);return}}catch(i){if(!e(s,i)){n(i);return}}})()})}function K1(A){return("0"+A.toString(16)).substr(-2)}function $1(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=t.length;let n="";for(let s=0;s<56;s++)n+=t.charAt(Math.floor(Math.random()*r));return n}return crypto.getRandomValues(e),Array.from(e,K1).join("")}async function j1(A){const t=new TextEncoder().encode(A),r=await crypto.subtle.digest("SHA-256",t),n=new Uint8Array(r);return Array.from(n).map(s=>String.fromCharCode(s)).join("")}async function G1(A){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),A;const t=await j1(A);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function fr(A,e,t=!1){const r=$1();let n=r;t&&(n+="/recovery"),await nn(A,`${e}-code-verifier`,n);const s=await G1(r);return[s,r===s?"plain":"s256"]}const W1=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function q1(A){const e=A.headers.get(Jl);if(!e||!e.match(W1))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function J1(A){if(!A)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(A<=e)throw new Error("JWT has expired")}function z1(A){switch(A){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const X1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function dA(A){if(!X1.test(A))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ot(A){if(!A.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function eu(){const A={};return new Proxy(A,{get:(e,t)=>{if(t==="__isUserNotAvailableProxy")return!0;if(typeof t=="symbol"){const r=t.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Y1(A,e){return new Proxy(A,{get:(t,r,n)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(t,r,n)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(t,r,n)}})}function Yw(A){return JSON.parse(JSON.stringify(A))}const gr=A=>{if(typeof A=="object"&&A!==null){const e=A;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(A)},Z1=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Zw(A){var e;if(!N1(A))throw new Lo(gr(A),0);if(Z1.includes(A.status))throw new Lo(gr(A),A.status);let t;try{t=await A.json()}catch(s){throw new Et(gr(s),s)}let r;const n=q1(A);if(n&&n.getTime()>=Nw["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?r=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(r=t.error_code),r){if(r==="weak_password")throw new Zl(gr(t),A.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new He}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((s,i)=>s&&typeof i=="string",!0))throw new Zl(gr(t),A.status,t.weak_password.reasons);throw new Mw(gr(t),A.status||500,r)}const ex=(A,e,t,r)=>{const n={method:A,headers:(e==null?void 0:e.headers)||{}};return A==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),n.body=JSON.stringify(r),Object.assign(Object.assign({},n),t))};async function M(A,e,t,r){var n;const s=Object.assign({},r==null?void 0:r.headers);s[Jl]||(s[Jl]=Nw["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const i=(n=r==null?void 0:r.query)!==null&&n!==void 0?n:{};r!=null&&r.redirectTo&&(i.redirect_to=r.redirectTo);const o=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",a=await tx(A,e,t+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(a):{data:Object.assign({},a),error:null}}async function tx(A,e,t,r,n,s){const i=ex(e,r,n,s);let o;try{o=await A(t,Object.assign({},i))}catch(a){throw console.error(a),new Lo(gr(a),0)}if(o.ok||await Zw(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(a){await Zw(a)}}function vt(A){var e;let t=null;nx(A)&&(t=Object.assign({},A),A.expires_at||(t.expires_at=H1(A.expires_in)));const r=(e=A.user)!==null&&e!==void 0?e:typeof(A==null?void 0:A.id)=="string"?A:null;return{data:{session:t,user:r},error:null}}function em(A){const e=vt(A);return!e.error&&A.weak_password&&typeof A.weak_password=="object"&&Array.isArray(A.weak_password.reasons)&&A.weak_password.reasons.length&&A.weak_password.message&&typeof A.weak_password.message=="string"&&A.weak_password.reasons.reduce((t,r)=>t&&typeof r=="string",!0)&&(e.data.weak_password=A.weak_password),e}function DA(A){var e;return{data:{user:(e=A.user)!==null&&e!==void 0?e:A},error:null}}function Ax(A){return{data:A,error:null}}function rx(A){const{action_link:e,email_otp:t,hashed_token:r,redirect_to:n,verification_type:s}=A,i=_o(A,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:t,hashed_token:r,redirect_to:n,verification_type:s},a=Object.assign({},i);return{data:{properties:o,user:a},error:null}}function tm(A){return A}function nx(A){return!!A.access_token&&!!A.refresh_token&&!!A.expires_in}const Po=["global","local","others"];class tu{constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=Xw(r),this.experimental=n??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=Po[0]){if(Po.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Po.join(", ")}`);try{return await M(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(H(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,t={}){try{return await M(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:DA})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:t}=e,r=_o(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=r==null?void 0:r.newEmail,delete n.newEmail),await M(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:rx,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(H(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await M(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:DA})}catch(t){if(H(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,r,n,s,i,o,a;try{const l={nextPage:null,lastPage:0,total:0},u=await M(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(s=(n=e==null?void 0:e.perPage)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""},xform:tm});if(u.error)throw u.error;const d=await u.json(),g=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const y=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),B=JSON.parse(w.split(";")[1].split("=")[1]);l[`${B}Page`]=y}),l.total=parseInt(g)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(H(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){dA(e);try{return await M(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:DA})}catch(t){if(H(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){dA(e);try{return await M(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:DA})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,t=!1){dA(e);try{return await M(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:DA})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){dA(e.userId);try{const{data:t,error:r}=await M(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:n=>({data:{factors:n},error:null})});return{data:t,error:r}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _deleteFactor(e){dA(e.userId),dA(e.id);try{return{data:await M(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _listOAuthClients(e){var t,r,n,s,i,o,a;try{const l={nextPage:null,lastPage:0,total:0},u=await M(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(s=(n=e==null?void 0:e.perPage)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""},xform:tm});if(u.error)throw u.error;const d=await u.json(),g=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const y=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),B=JSON.parse(w.split(";")[1].split("=")[1]);l[`${B}Page`]=y}),l.total=parseInt(g)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(H(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(e){try{return await M(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _getOAuthClient(e){try{return await M(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _updateOAuthClient(e,t){try{return await M(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await M(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _regenerateOAuthClientSecret(e){try{return await M(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _listCustomProviders(e){try{const t={};return e!=null&&e.type&&(t.type=e.type),await M(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:r=>{var n;return{data:{providers:(n=r==null?void 0:r.providers)!==null&&n!==void 0?n:[]},error:null}}})}catch(t){if(H(t))return{data:{providers:[]},error:t};throw t}}async _createCustomProvider(e){try{return await M(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _getCustomProvider(e){try{return await M(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _updateCustomProvider(e,t){try{return await M(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await M(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _adminListPasskeys(e){Ot(this.experimental),dA(e.userId);try{return await M(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _adminDeletePasskey(e){Ot(this.experimental),dA(e.userId),dA(e.passkeyId);try{return await M(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}}function Am(A={}){return{getItem:e=>A[e]||null,setItem:(e,t)=>{A[e]=t},removeItem:e=>{delete A[e]}}}const Pt={debug:!!(globalThis&&zw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Qs extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Au extends Qs{}class sx extends Qs{}async function ix(A,e,t){Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",A,e);const r=new globalThis.AbortController;let n;e>0&&(n=setTimeout(()=>{r.abort(),Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",A)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(A,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){clearTimeout(n),Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",A,s.name);try{return await t()}finally{Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",A,s.name)}}else{if(e===0)throw Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",A),new Au(`Acquiring an exclusive Navigator LockManager lock "${A}" immediately failed`);if(Pt.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(n),await t()}})}catch(s){if(e>0&&clearTimeout(n),s!==null&&typeof s=="object"&&"name"in s&&s.name==="AbortError"&&e>0){if(r.signal.aborted)return Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",A),console.warn(`@supabase/gotrue-js: Lock "${A}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(A,{mode:"exclusive",steal:!0},async i=>{if(i){Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",A,i.name);try{return await t()}finally{Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",A,i.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await t()}));throw Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",A),new Au(`Lock "${A}" was released because another request stole it`)}throw s}}const rm={};async function ox(A,e,t){var r;const n=(r=rm[A])!==null&&r!==void 0?r:Promise.resolve(),s=(async()=>{try{return await n,null}catch{return null}})(),i=(async()=>{let o=null;try{const a=e>=0?new Promise((l,u)=>{o=setTimeout(()=>{console.warn(`@supabase/gotrue-js: Lock "${A}" acquisition timed out after ${e}ms. This may be caused by another operation holding the lock. Consider increasing lockAcquireTimeout or checking for stuck operations.`),u(new sx(`Acquiring process lock with name "${A}" timed out`))},e)}):null;await Promise.race([s,a].filter(l=>l)),o!==null&&clearTimeout(o)}catch(a){if(o!==null&&clearTimeout(o),a instanceof Qs)throw a}return await t()})();return rm[A]=(async()=>{try{return await i}catch(o){if(o instanceof Qs){try{await n}catch{}return null}throw o}})(),await i}function ax(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function nm(A){if(!/^0x[a-fA-F0-9]{40}$/.test(A))throw new Error(`@supabase/auth-js: Address "${A}" is invalid.`);return A.toLowerCase()}function cx(A){return parseInt(A,16)}function lx(A){const e=new TextEncoder().encode(A);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function ux(A){var e;const{chainId:t,domain:r,expirationTime:n,issuedAt:s=new Date,nonce:i,notBefore:o,requestId:a,resources:l,scheme:u,uri:d,version:g}=A;{if(!Number.isInteger(t))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(g!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${g}`);if(!((e=A.statement)===null||e===void 0)&&e.includes(`
3006
+ })`):new Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return t==="ok"&&e.teardown(),t}async removeAllChannels(){const e=this.channels.map(async r=>{const n=await r.unsubscribe();return r.teardown(),n}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,r){this.socketAdapter.log(e,t,r)}connectionState(){return this.socketAdapter.connectionState()||Ol.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){const r=`realtime:${e}`,n=this.getChannels().find(s=>s.topic===r);if(n)return n;{const s=new en(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(s),s}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,r=!1;if(e)t=e,r=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(n){this.log("error","Error fetching access token from callback",n),t=this.accessTokenValue}else t=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(n=>{const s={access_token:t,version:gR};t&&n.updateJoinPayload(s),n.joinedOnce&&n.channelAdapter.isJoined()&&n.channelAdapter.push(Ew.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(t=>{this.log("error",`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(t=>{this.log("error","error waiting for auth on connect",t)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,r)=>{t=="sent"&&this._setAuthSafely(),e&&e(t,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{const r=new Blob([WR],{type:"application/javascript"});t=URL.createObjectURL(r)}return t}_initializeOptions(e){var t,r,n,s,i,o,a,l,u,d,g,p;this.worker=(t=e==null?void 0:e.worker)!==null&&t!==void 0?t:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const w={};w.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:mR,w.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:Tw.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:Tw.HEARTBEAT_INTERVAL),w.transport=(a=e==null?void 0:e.transport)!==null&&a!==void 0?a:Cw.getWebSocketConstructor(),w.params=e==null?void 0:e.params,w.logger=e==null?void 0:e.logger,w.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),w.sessionStorage=(l=e==null?void 0:e.sessionStorage)!==null&&l!==void 0?l:GR(),w.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:S=>KR[S-1]||$R;let y,B;const b=(d=e==null?void 0:e.vsn)!==null&&d!==void 0?d:wR;switch(b){case pR:y=(S,I)=>I(JSON.stringify(S)),B=(S,I)=>I(JSON.parse(S));break;case _w:y=this.serializer.encode.bind(this.serializer),B=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${w.vsn}`)}if(w.vsn=b,w.encode=(g=e==null?void 0:e.encode)!==null&&g!==void 0?g:y,w.decode=(p=e==null?void 0:e.decode)!==null&&p!==void 0?p:B,w.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,w.params=Object.assign(Object.assign({},w.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,w.autoSendHeartbeat=!this.worker}return w}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var ws=class extends Error{constructor(A,e){var t;super(A),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((t=e.icebergType)==null?void 0:t.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function qR(A,e,t){const r=new URL(e,A);if(t)for(const[n,s]of Object.entries(t))s!==void 0&&r.searchParams.set(n,s);return r.toString()}async function JR(A){return!A||A.type==="none"?{}:A.type==="bearer"?{Authorization:`Bearer ${A.token}`}:A.type==="header"?{[A.name]:A.value}:A.type==="custom"?await A.getHeaders():{}}function zR(A){const e=A.fetchImpl??globalThis.fetch;return{async request({method:t,path:r,query:n,body:s,headers:i}){const o=qR(A.baseUrl,r,n),a=await JR(A.auth),l=await e(o,{method:t,headers:{...s?{"Content-Type":"application/json"}:{},...a,...i},body:s?JSON.stringify(s):void 0}),u=await l.text(),d=(l.headers.get("content-type")||"").includes("application/json"),g=d&&u?JSON.parse(u):u;if(!l.ok){const p=d?g:void 0,w=p==null?void 0:p.error;throw new ws((w==null?void 0:w.message)??`Request failed with status ${l.status}`,{status:l.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:p})}return{status:l.status,headers:l.headers,data:g}}}}function Fo(A){return A.join("")}var XR=class{constructor(A,e=""){this.client=A,this.prefix=e}async listNamespaces(A){const e=A?{parent:Fo(A.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(A,e){const t={namespace:A.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:t})).data}async dropNamespace(A){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Fo(A.namespace)}`})}async loadNamespaceMetadata(A){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Fo(A.namespace)}`})).data.properties}}async namespaceExists(A){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Fo(A.namespace)}`}),!0}catch(e){if(e instanceof ws&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(A,e){try{return await this.createNamespace(A,e)}catch(t){if(t instanceof ws&&t.status===409)return;throw t}}};function tn(A){return A.join("")}var YR=class{constructor(A,e="",t){this.client=A,this.prefix=e,this.accessDelegation=t}async listTables(A){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${tn(A.namespace)}/tables`})).data.identifiers}async createTable(A,e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${tn(A.namespace)}/tables`,body:e,headers:t})).data.metadata}async updateTable(A,e){const t=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${tn(A.namespace)}/tables/${A.name}`,body:e});return{"metadata-location":t.data["metadata-location"],metadata:t.data.metadata}}async dropTable(A,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${tn(A.namespace)}/tables/${A.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(A){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${tn(A.namespace)}/tables/${A.name}`,headers:e})).data.metadata}async tableExists(A){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${tn(A.namespace)}/tables/${A.name}`,headers:e}),!0}catch(t){if(t instanceof ws&&t.status===404)return!1;throw t}}async createTableIfNotExists(A,e){try{return await this.createTable(A,e)}catch(t){if(t instanceof ws&&t.status===409)return await this.loadTable({namespace:A.namespace,name:e.name});throw t}}},ZR=class{constructor(A){var r;let e="v1";A.catalogName&&(e+=`/${A.catalogName}`);const t=A.baseUrl.endsWith("/")?A.baseUrl:`${A.baseUrl}/`;this.client=zR({baseUrl:t,auth:A.auth,fetchImpl:A.fetch}),this.accessDelegation=(r=A.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new XR(this.client,e),this.tableOps=new YR(this.client,e,this.accessDelegation)}async listNamespaces(A){return this.namespaceOps.listNamespaces(A)}async createNamespace(A,e){return this.namespaceOps.createNamespace(A,e)}async dropNamespace(A){await this.namespaceOps.dropNamespace(A)}async loadNamespaceMetadata(A){return this.namespaceOps.loadNamespaceMetadata(A)}async listTables(A){return this.tableOps.listTables(A)}async createTable(A,e){return this.tableOps.createTable(A,e)}async updateTable(A,e){return this.tableOps.updateTable(A,e)}async dropTable(A,e){await this.tableOps.dropTable(A,e)}async loadTable(A){return this.tableOps.loadTable(A)}async namespaceExists(A){return this.namespaceOps.namespaceExists(A)}async tableExists(A){return this.tableOps.tableExists(A)}async createNamespaceIfNotExists(A,e){return this.namespaceOps.createNamespaceIfNotExists(A,e)}async createTableIfNotExists(A,e){return this.tableOps.createTableIfNotExists(A,e)}};function ms(A){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ms(A)}function e1(A,e){if(ms(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var r=t.call(A,e);if(ms(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function t1(A){var e=e1(A,"string");return ms(e)=="symbol"?e:e+""}function A1(A,e,t){return(e=t1(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Rw(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(A);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,r)}return t}function W(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rw(Object(t),!0).forEach(function(r){A1(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Rw(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}var To=class extends Error{constructor(A,e="storage",t,r){super(A),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function So(A){return typeof A=="object"&&A!==null&&"__isStorageError"in A}var Ro=class extends To{constructor(A,e,t,r="storage"){super(A,r,e,t),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=t}toJSON(){return W({},super.toJSON())}},xw=class extends To{constructor(A,e,t="storage"){super(A,t),this.name=t==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function xo(A,e,t){const r=W({},A),n=e.toLowerCase();for(const s of Object.keys(r))s.toLowerCase()===n&&delete r[s];return r[n]=t,r}function r1(A){const e={};for(const[t,r]of Object.entries(A))e[t.toLowerCase()]=r;return e}const n1=A=>A?(...e)=>A(...e):(...e)=>fetch(...e),s1=A=>{if(typeof A!="object"||A===null)return!1;const e=Object.getPrototypeOf(A);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in A)&&!(Symbol.iterator in A)},$l=A=>{if(Array.isArray(A))return A.map(t=>$l(t));if(typeof A=="function"||A!==Object(A))return A;const e={};return Object.entries(A).forEach(([t,r])=>{const n=t.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[n]=$l(r)}),e},i1=A=>!A||typeof A!="string"||A.length===0||A.length>100||A.trim()!==A||A.includes("/")||A.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(A),kw=A=>{if(typeof A=="object"&&A!==null){const e=A;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const t=e.error;if(typeof t.message=="string")return t.message}}return JSON.stringify(A)},o1=async(A,e,t,r)=>{if(A!==null&&typeof A=="object"&&"json"in A&&typeof A.json=="function"){const n=A;let s=parseInt(String(n.status),10);Number.isFinite(s)||(s=500),n.json().then(i=>{const o=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||s+"";e(new Ro(kw(i),s,o,r))}).catch(()=>{const i=s+"";e(new Ro(n.statusText||`HTTP ${s} error`,s,i,r))})}else e(new xw(kw(A),A,r))},a1=(A,e,t,r)=>{const n={method:A,headers:(e==null?void 0:e.headers)||{}};if(A==="GET"||A==="HEAD"||!r)return W(W({},n),t);if(s1(r)){var s;const i=(e==null?void 0:e.headers)||{};let o;for(const[a,l]of Object.entries(i))a.toLowerCase()==="content-type"&&(o=l);n.headers=xo(i,"Content-Type",(s=o)!==null&&s!==void 0?s:"application/json"),n.body=JSON.stringify(r)}else n.body=r;return e!=null&&e.duplex&&(n.duplex=e.duplex),W(W({},n),t)};async function Bs(A,e,t,r,n,s,i){return new Promise((o,a)=>{A(t,a1(e,r,n,s)).then(l=>{if(!l.ok)throw l;if(r!=null&&r.noResolveJson)return l;if(i==="vectors"){const u=l.headers.get("content-type");if(l.headers.get("content-length")==="0"||l.status===204)return{};if(!u||!u.includes("application/json"))return{}}return l.json()}).then(l=>o(l)).catch(l=>o1(l,a,r,i))})}function Lw(A="storage"){return{get:async(e,t,r,n)=>Bs(e,"GET",t,r,n,void 0,A),post:async(e,t,r,n,s)=>Bs(e,"POST",t,n,s,r,A),put:async(e,t,r,n,s)=>Bs(e,"PUT",t,n,s,r,A),head:async(e,t,r,n)=>Bs(e,"HEAD",t,W(W({},r),{},{noResolveJson:!0}),n,void 0,A),remove:async(e,t,r,n,s)=>Bs(e,"DELETE",t,n,s,r,A)}}const c1=Lw("storage"),{get:ys,post:Lt,put:jl,head:l1,remove:Gl}=c1,gt=Lw("vectors");var An=class{constructor(A,e={},t,r="storage"){this.shouldThrowOnError=!1,this.url=A,this.headers=r1(e),this.fetch=n1(t),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(A,e){return this.headers=xo(this.headers,A,e),this}async handleOperation(A){var e=this;try{return{data:await A(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(So(t))return{data:null,error:t};throw t}}};let Dw;Dw=Symbol.toStringTag;var u1=class{constructor(A,e){this.downloadFn=A,this.shouldThrowOnError=e,this[Dw]="StreamDownloadBuilder",this.promise=null}then(A,e){return this.getPromise().then(A,e)}catch(A){return this.getPromise().catch(A)}finally(A){return this.getPromise().finally(A)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var A=this;try{return{data:(await A.downloadFn()).body,error:null}}catch(e){if(A.shouldThrowOnError)throw e;if(So(e))return{data:null,error:e};throw e}}};let Hw;Hw=Symbol.toStringTag;var h1=class{constructor(A,e){this.downloadFn=A,this.shouldThrowOnError=e,this[Hw]="BlobDownloadBuilder",this.promise=null}asStream(){return new u1(this.downloadFn,this.shouldThrowOnError)}then(A,e){return this.getPromise().then(A,e)}catch(A){return this.getPromise().catch(A)}finally(A){return this.getPromise().finally(A)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var A=this;try{return{data:await(await A.downloadFn()).blob(),error:null}}catch(e){if(A.shouldThrowOnError)throw e;if(So(e))return{data:null,error:e};throw e}}};const d1={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ow={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var f1=class extends An{constructor(A,e={},t,r){super(A,e,r,"storage"),this.bucketId=t}async uploadOrUpdate(A,e,t,r){var n=this;return n.handleOperation(async()=>{let s;const i=W(W({},Ow),r);let o=W(W({},n.headers),A==="POST"&&{"x-upsert":String(i.upsert)});const a=i.metadata;if(typeof Blob<"u"&&t instanceof Blob?(s=new FormData,s.append("cacheControl",i.cacheControl),a&&s.append("metadata",n.encodeMetadata(a)),s.append("",t)):typeof FormData<"u"&&t instanceof FormData?(s=t,s.has("cacheControl")||s.append("cacheControl",i.cacheControl),a&&!s.has("metadata")&&s.append("metadata",n.encodeMetadata(a))):(s=t,o["cache-control"]=`max-age=${i.cacheControl}`,o["content-type"]=i.contentType,a&&(o["x-metadata"]=n.toBase64(n.encodeMetadata(a))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!i.duplex&&(i.duplex="half")),r!=null&&r.headers)for(const[g,p]of Object.entries(r.headers))o=xo(o,g,p);const l=n._removeEmptyFolders(e),u=n._getFinalPath(l),d=await(A=="PUT"?jl:Lt)(n.fetch,`${n.url}/object/${u}`,s,W({headers:o},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(A,e,t){return this.uploadOrUpdate("POST",A,e,t)}async uploadToSignedUrl(A,e,t,r){var n=this;const s=n._removeEmptyFolders(A),i=n._getFinalPath(s),o=new URL(n.url+`/object/upload/sign/${i}`);return o.searchParams.set("token",e),n.handleOperation(async()=>{let a;const l=W(W({},Ow),r);let u=W(W({},n.headers),{"x-upsert":String(l.upsert)});const d=l.metadata;if(typeof Blob<"u"&&t instanceof Blob?(a=new FormData,a.append("cacheControl",l.cacheControl),d&&a.append("metadata",n.encodeMetadata(d)),a.append("",t)):typeof FormData<"u"&&t instanceof FormData?(a=t,a.has("cacheControl")||a.append("cacheControl",l.cacheControl),d&&!a.has("metadata")&&a.append("metadata",n.encodeMetadata(d))):(a=t,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType,d&&(u["x-metadata"]=n.toBase64(n.encodeMetadata(d))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!l.duplex&&(l.duplex="half")),r!=null&&r.headers)for(const[g,p]of Object.entries(r.headers))u=xo(u,g,p);return{path:s,fullPath:(await jl(n.fetch,o.toString(),a,W({headers:u},l!=null&&l.duplex?{duplex:l.duplex}:{}))).Key}})}async createSignedUploadUrl(A,e){var t=this;return t.handleOperation(async()=>{let r=t._getFinalPath(A);const n=W({},t.headers);e!=null&&e.upsert&&(n["x-upsert"]="true");const s=await Lt(t.fetch,`${t.url}/object/upload/sign/${r}`,{},{headers:n}),i=new URL(t.url+s.url),o=i.searchParams.get("token");if(!o)throw new To("No token returned by API");return{signedUrl:i.toString(),path:A,token:o}})}async update(A,e,t){return this.uploadOrUpdate("PUT",A,e,t)}async move(A,e,t){var r=this;return r.handleOperation(async()=>await Lt(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:A,destinationKey:e,destinationBucket:t==null?void 0:t.destinationBucket},{headers:r.headers}))}async copy(A,e,t){var r=this;return r.handleOperation(async()=>({path:(await Lt(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:A,destinationKey:e,destinationBucket:t==null?void 0:t.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(A,e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(A);const s=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0;let i=await Lt(r.fetch,`${r.url}/object/sign/${n}`,W({expiresIn:e},s?{transform:t.transform}:{}),{headers:r.headers});const o=new URLSearchParams;t!=null&&t.download&&o.set("download",t.download===!0?"":t.download),(t==null?void 0:t.cacheNonce)!=null&&o.set("cacheNonce",String(t.cacheNonce));const a=o.toString();return{signedUrl:encodeURI(`${r.url}${i.signedURL}${a?`&${a}`:""}`)}})}async createSignedUrls(A,e,t){var r=this;return r.handleOperation(async()=>{const n=await Lt(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:A},{headers:r.headers}),s=new URLSearchParams;t!=null&&t.download&&s.set("download",t.download===!0?"":t.download),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const i=s.toString();return n.map(o=>W(W({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${i?`&${i}`:""}`):null}))})}download(A,e,t){const r=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",n=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),i=this._getFinalPath(A),o=()=>ys(this.fetch,`${this.url}/${r}/${i}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},t);return new h1(o,this.shouldThrowOnError)}async info(A){var e=this;const t=e._getFinalPath(A);return e.handleOperation(async()=>$l(await ys(e.fetch,`${e.url}/object/info/${t}`,{headers:e.headers})))}async exists(A){var e=this;const t=e._getFinalPath(A);try{return await l1(e.fetch,`${e.url}/object/${t}`,{headers:e.headers}),{data:!0,error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(So(n)){var r;const s=n instanceof Ro?n.status:n instanceof xw?(r=n.originalError)===null||r===void 0?void 0:r.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:n}}throw n}}getPublicUrl(A,e){const t=this._getFinalPath(A),r=new URLSearchParams;e!=null&&e.download&&r.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(r,e.transform),(e==null?void 0:e.cacheNonce)!=null&&r.set("cacheNonce",String(e.cacheNonce));const n=r.toString(),s=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${t}`)+(n?`?${n}`:"")}}}async remove(A){var e=this;return e.handleOperation(async()=>await Gl(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:A},{headers:e.headers}))}async list(A,e,t){var r=this;return r.handleOperation(async()=>{const n=W(W(W({},d1),e),{},{prefix:A||""});return await Lt(r.fetch,`${r.url}/object/list/${r.bucketId}`,n,{headers:r.headers},t)})}async listV2(A,e){var t=this;return t.handleOperation(async()=>{const r=W({},A);return await Lt(t.fetch,`${t.url}/object/list-v2/${t.bucketId}`,r,{headers:t.headers},e)})}encodeMetadata(A){return JSON.stringify(A)}toBase64(A){return typeof Buffer<"u"?Buffer.from(A).toString("base64"):btoa(A)}_getFinalPath(A){return`${this.bucketId}/${A.replace(/^\/+/,"")}`}_removeEmptyFolders(A){return A.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(A,e){return e.width&&A.set("width",e.width.toString()),e.height&&A.set("height",e.height.toString()),e.resize&&A.set("resize",e.resize),e.format&&A.set("format",e.format),e.quality&&A.set("quality",e.quality.toString()),A}};const Cs={"X-Client-Info":"storage-js/2.108.2"};var g1=class extends An{constructor(A,e={},t,r){const n=new URL(A);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(n.hostname)&&!n.hostname.includes("storage.supabase.")&&(n.hostname=n.hostname.replace("supabase.","storage.supabase."));const s=n.href.replace(/\/$/,""),i=W(W({},Cs),e);super(s,i,t,"storage")}async listBuckets(A){var e=this;return e.handleOperation(async()=>{const t=e.listBucketOptionsToQueryString(A);return await ys(e.fetch,`${e.url}/bucket${t}`,{headers:e.headers})})}async getBucket(A){var e=this;return e.handleOperation(async()=>await ys(e.fetch,`${e.url}/bucket/${A}`,{headers:e.headers}))}async createBucket(A,e={public:!1}){var t=this;return t.handleOperation(async()=>await Lt(t.fetch,`${t.url}/bucket`,{id:A,name:A,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:t.headers}))}async updateBucket(A,e){var t=this;return t.handleOperation(async()=>await jl(t.fetch,`${t.url}/bucket/${A}`,{id:A,name:A,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:t.headers}))}async emptyBucket(A){var e=this;return e.handleOperation(async()=>await Lt(e.fetch,`${e.url}/bucket/${A}/empty`,{},{headers:e.headers}))}async deleteBucket(A){var e=this;return e.handleOperation(async()=>await Gl(e.fetch,`${e.url}/bucket/${A}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(A){const e={};return A&&("limit"in A&&(e.limit=String(A.limit)),"offset"in A&&(e.offset=String(A.offset)),A.search&&(e.search=A.search),A.sortColumn&&(e.sortColumn=A.sortColumn),A.sortOrder&&(e.sortOrder=A.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},p1=class extends An{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),e);super(r,n,t,"storage")}async createBucket(A){var e=this;return e.handleOperation(async()=>await Lt(e.fetch,`${e.url}/bucket`,{name:A},{headers:e.headers}))}async listBuckets(A){var e=this;return e.handleOperation(async()=>{const t=new URLSearchParams;(A==null?void 0:A.limit)!==void 0&&t.set("limit",A.limit.toString()),(A==null?void 0:A.offset)!==void 0&&t.set("offset",A.offset.toString()),A!=null&&A.sortColumn&&t.set("sortColumn",A.sortColumn),A!=null&&A.sortOrder&&t.set("sortOrder",A.sortOrder),A!=null&&A.search&&t.set("search",A.search);const r=t.toString(),n=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await ys(e.fetch,n,{headers:e.headers})})}async deleteBucket(A){var e=this;return e.handleOperation(async()=>await Gl(e.fetch,`${e.url}/bucket/${A}`,{},{headers:e.headers}))}from(A){var e=this;if(!i1(A))throw new To("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const t=new ZR({baseUrl:this.url,catalogName:A,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(t,{get(n,s){const i=n[s];return typeof i!="function"?i:async(...o)=>{try{return{data:await i.apply(n,o),error:null}}catch(a){if(r)throw a;return{data:null,error:a}}}}})}},w1=class extends An{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),{},{"Content-Type":"application/json"},e);super(r,n,t,"vectors")}async createIndex(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/CreateIndex`,A,{headers:e.headers})||{})}async getIndex(A,e){var t=this;return t.handleOperation(async()=>await gt.post(t.fetch,`${t.url}/GetIndex`,{vectorBucketName:A,indexName:e},{headers:t.headers}))}async listIndexes(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/ListIndexes`,A,{headers:e.headers}))}async deleteIndex(A,e){var t=this;return t.handleOperation(async()=>await gt.post(t.fetch,`${t.url}/DeleteIndex`,{vectorBucketName:A,indexName:e},{headers:t.headers})||{})}},m1=class extends An{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),{},{"Content-Type":"application/json"},e);super(r,n,t,"vectors")}async putVectors(A){var e=this;if(A.vectors.length<1||A.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/PutVectors`,A,{headers:e.headers})||{})}async getVectors(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/GetVectors`,A,{headers:e.headers}))}async listVectors(A){var e=this;if(A.segmentCount!==void 0){if(A.segmentCount<1||A.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(A.segmentIndex!==void 0&&(A.segmentIndex<0||A.segmentIndex>=A.segmentCount))throw new Error(`segmentIndex must be between 0 and ${A.segmentCount-1}`)}return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/ListVectors`,A,{headers:e.headers}))}async queryVectors(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/QueryVectors`,A,{headers:e.headers}))}async deleteVectors(A){var e=this;if(A.keys.length<1||A.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/DeleteVectors`,A,{headers:e.headers})||{})}},B1=class extends An{constructor(A,e={},t){const r=A.replace(/\/$/,""),n=W(W({},Cs),{},{"Content-Type":"application/json"},e);super(r,n,t,"vectors")}async createBucket(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:A},{headers:e.headers})||{})}async getBucket(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:A},{headers:e.headers}))}async listBuckets(A={}){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/ListVectorBuckets`,A,{headers:e.headers}))}async deleteBucket(A){var e=this;return e.handleOperation(async()=>await gt.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:A},{headers:e.headers})||{})}},y1=class extends B1{constructor(A,e={}){super(A,e.headers||{},e.fetch)}from(A){return new C1(this.url,this.headers,A,this.fetch)}async createBucket(A){var e=()=>super.createBucket,t=this;return e().call(t,A)}async getBucket(A){var e=()=>super.getBucket,t=this;return e().call(t,A)}async listBuckets(A={}){var e=()=>super.listBuckets,t=this;return e().call(t,A)}async deleteBucket(A){var e=()=>super.deleteBucket,t=this;return e().call(t,A)}},C1=class extends w1{constructor(A,e,t,r){super(A,e,r),this.vectorBucketName=t}async createIndex(A){var e=()=>super.createIndex,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName}))}async listIndexes(A={}){var e=()=>super.listIndexes,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName}))}async getIndex(A){var e=()=>super.getIndex,t=this;return e().call(t,t.vectorBucketName,A)}async deleteIndex(A){var e=()=>super.deleteIndex,t=this;return e().call(t,t.vectorBucketName,A)}index(A){return new _1(this.url,this.headers,this.vectorBucketName,A,this.fetch)}},_1=class extends m1{constructor(A,e,t,r,n){super(A,e,n),this.vectorBucketName=t,this.indexName=r}async putVectors(A){var e=()=>super.putVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async getVectors(A){var e=()=>super.getVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async listVectors(A={}){var e=()=>super.listVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async queryVectors(A){var e=()=>super.queryVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}async deleteVectors(A){var e=()=>super.deleteVectors,t=this;return e().call(t,W(W({},A),{},{vectorBucketName:t.vectorBucketName,indexName:t.indexName}))}},E1=class extends g1{constructor(A,e={},t,r){super(A,e,t,r)}from(A){return new f1(this.url,this.headers,A,this.fetch)}get vectors(){return new y1(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new p1(this.url+"/iceberg",this.headers,this.fetch)}};const Pw="2.108.2",hA=30*1e3,_s=3,Wl=_s*hA,v1=2*hA,b1="http://localhost:9999",U1="supabase.auth.token",Q1={"X-Client-Info":`gotrue-js/${Pw}`},ql="X-Supabase-Api-Version",Nw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},I1=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,F1=10*60*1e3;class rn extends Error{constructor(e,t,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function H(A){return typeof A=="object"&&A!==null&&"__isAuthError"in A}class Mw extends rn{constructor(e,t,r){super(e,t,r),this.name="AuthApiError",this.status=t,this.code=r}}function Vw(A){return H(A)&&A.name==="AuthApiError"}class Et extends rn{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class Dt extends rn{constructor(e,t,r,n){super(e,r,n),this.name=t,this.status=r}}class He extends Dt{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Es(A){return H(A)&&A.name==="AuthSessionMissingError"}class ur extends Dt{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class vs extends Dt{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class bs extends Dt{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function Kw(A){return H(A)&&A.name==="AuthImplicitGrantRedirectError"}class Jl extends Dt{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class $w extends Dt{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}function T1(A){return H(A)&&A.name==="AuthPKCECodeVerifierMissingError"}class ko extends Dt{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function zl(A){return H(A)&&A.name==="AuthRetryableFetchError"}class Xl extends Dt{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function jw(A){return H(A)&&A.name==="AuthRefreshDiscardedError"}class Yl extends Dt{constructor(e,t,r){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}function S1(A){return H(A)&&A.name==="AuthWeakPasswordError"}class Us extends Dt{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Lo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Gw=`
3007
+ \r=`.split(""),R1=(()=>{const A=new Array(128);for(let e=0;e<A.length;e+=1)A[e]=-1;for(let e=0;e<Gw.length;e+=1)A[Gw[e].charCodeAt(0)]=-2;for(let e=0;e<Lo.length;e+=1)A[Lo[e].charCodeAt(0)]=e;return A})();function Ww(A,e,t){if(A!==null)for(e.queue=e.queue<<8|A,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(Lo[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;t(Lo[r]),e.queuedBits-=6}}function qw(A,e,t){const r=R1[A];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(A)}"`)}}function Jw(A){const e=[],t=i=>{e.push(String.fromCodePoint(i))},r={utf8seq:0,codepoint:0},n={queue:0,queuedBits:0},s=i=>{L1(i,r,t)};for(let i=0;i<A.length;i+=1)qw(A.charCodeAt(i),n,s);return e.join("")}function x1(A,e){if(A<=127){e(A);return}else if(A<=2047){e(192|A>>6),e(128|A&63);return}else if(A<=65535){e(224|A>>12),e(128|A>>6&63),e(128|A&63);return}else if(A<=1114111){e(240|A>>18),e(128|A>>12&63),e(128|A>>6&63),e(128|A&63);return}throw new Error(`Unrecognized Unicode codepoint: ${A.toString(16)}`)}function k1(A,e){for(let t=0;t<A.length;t+=1){let r=A.charCodeAt(t);if(r>55295&&r<=56319){const n=(r-55296)*1024&65535;r=(A.charCodeAt(t+1)-56320&65535|n)+65536,t+=1}x1(r,e)}}function L1(A,e,t){if(e.utf8seq===0){if(A<=127){t(A);return}for(let r=1;r<6;r+=1)if(!(A>>7-r&1)){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=A&31;else if(e.utf8seq===3)e.codepoint=A&15;else if(e.utf8seq===4)e.codepoint=A&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(A<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|A&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function nn(A){const e=[],t={queue:0,queuedBits:0},r=n=>{e.push(n)};for(let n=0;n<A.length;n+=1)qw(A.charCodeAt(n),t,r);return new Uint8Array(e)}function D1(A){const e=[];return k1(A,t=>e.push(t)),new Uint8Array(e)}function hr(A){const e=[],t={queue:0,queuedBits:0},r=n=>{e.push(n)};return A.forEach(n=>Ww(n,t,r)),Ww(null,t,r),e.join("")}function H1(A){return Math.round(Date.now()/1e3)+A}function O1(){return Symbol("auth-callback")}const ze=()=>typeof window<"u"&&typeof document<"u",dr={tested:!1,writable:!1},zw=()=>{if(!ze())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(dr.tested)return dr.writable;const A=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(A,A),globalThis.localStorage.removeItem(A),dr.tested=!0,dr.writable=!0}catch{dr.tested=!0,dr.writable=!1}return dr.writable};function P1(A){const e={},t=new URL(A);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((n,s)=>{e[s]=n})}catch{}return t.searchParams.forEach((r,n)=>{e[n]=r}),e}const Xw=A=>A?(...e)=>A(...e):(...e)=>fetch(...e),N1=A=>typeof A=="object"&&A!==null&&"status"in A&&"ok"in A&&"json"in A&&typeof A.json=="function",sn=async(A,e,t)=>{await A.setItem(e,JSON.stringify(t))},Ht=async(A,e)=>{const t=await A.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return null}},Qe=async(A,e)=>{await A.removeItem(e)};class Do{constructor(){this.promise=new Do.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Do.promiseConstructor=Promise;function Ho(A){const e=A.split(".");if(e.length!==3)throw new Us("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!I1.test(e[r]))throw new Us("JWT not in base64url format");return{header:JSON.parse(Jw(e[0])),payload:JSON.parse(Jw(e[1])),signature:nn(e[2]),raw:{header:e[0],payload:e[1]}}}async function M1(A){return await new Promise(e=>{setTimeout(()=>e(null),A)})}function V1(A,e){return new Promise((r,n)=>{(async()=>{for(let s=0;s<1/0;s++)try{const i=await A(s);if(!e(s,null,i)){r(i);return}}catch(i){if(!e(s,i)){n(i);return}}})()})}function K1(A){return("0"+A.toString(16)).substr(-2)}function $1(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=t.length;let n="";for(let s=0;s<56;s++)n+=t.charAt(Math.floor(Math.random()*r));return n}return crypto.getRandomValues(e),Array.from(e,K1).join("")}async function j1(A){const t=new TextEncoder().encode(A),r=await crypto.subtle.digest("SHA-256",t),n=new Uint8Array(r);return Array.from(n).map(s=>String.fromCharCode(s)).join("")}async function G1(A){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),A;const t=await j1(A);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function fr(A,e,t=!1){const r=$1();let n=r;t&&(n+="/recovery"),await sn(A,`${e}-code-verifier`,n);const s=await G1(r);return[s,r===s?"plain":"s256"]}const W1=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function q1(A){const e=A.headers.get(ql);if(!e||!e.match(W1))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function J1(A){if(!A)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(A<=e)throw new Error("JWT has expired")}function z1(A){switch(A){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const X1=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function dA(A){if(!X1.test(A))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ot(A){if(!A.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Zl(){const A={};return new Proxy(A,{get:(e,t)=>{if(t==="__isUserNotAvailableProxy")return!0;if(typeof t=="symbol"){const r=t.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Y1(A,e){return new Proxy(A,{get:(t,r,n)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(t,r,n)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(t,r,n)}})}function Yw(A){return JSON.parse(JSON.stringify(A))}const gr=A=>{if(typeof A=="object"&&A!==null){const e=A;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(A)},Z1=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function Zw(A){var e;if(!N1(A))throw new ko(gr(A),0);if(Z1.includes(A.status))throw new ko(gr(A),A.status);let t;try{t=await A.json()}catch(s){throw new Et(gr(s),s)}let r;const n=q1(A);if(n&&n.getTime()>=Nw["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?r=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(r=t.error_code),r){if(r==="weak_password")throw new Yl(gr(t),A.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new He}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((s,i)=>s&&typeof i=="string",!0))throw new Yl(gr(t),A.status,t.weak_password.reasons);throw new Mw(gr(t),A.status||500,r)}const ex=(A,e,t,r)=>{const n={method:A,headers:(e==null?void 0:e.headers)||{}};return A==="GET"?n:(n.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),n.body=JSON.stringify(r),Object.assign(Object.assign({},n),t))};async function M(A,e,t,r){var n;const s=Object.assign({},r==null?void 0:r.headers);s[ql]||(s[ql]=Nw["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const i=(n=r==null?void 0:r.query)!==null&&n!==void 0?n:{};r!=null&&r.redirectTo&&(i.redirect_to=r.redirectTo);const o=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",a=await tx(A,e,t+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(a):{data:Object.assign({},a),error:null}}async function tx(A,e,t,r,n,s){const i=ex(e,r,n,s);let o;try{o=await A(t,Object.assign({},i))}catch(a){throw console.error(a),new ko(gr(a),0)}if(o.ok||await Zw(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(a){await Zw(a)}}function vt(A){var e;let t=null;nx(A)&&(t=Object.assign({},A),A.expires_at||(t.expires_at=H1(A.expires_in)));const r=(e=A.user)!==null&&e!==void 0?e:typeof(A==null?void 0:A.id)=="string"?A:null;return{data:{session:t,user:r},error:null}}function em(A){const e=vt(A);return!e.error&&A.weak_password&&typeof A.weak_password=="object"&&Array.isArray(A.weak_password.reasons)&&A.weak_password.reasons.length&&A.weak_password.message&&typeof A.weak_password.message=="string"&&A.weak_password.reasons.reduce((t,r)=>t&&typeof r=="string",!0)&&(e.data.weak_password=A.weak_password),e}function DA(A){var e;return{data:{user:(e=A.user)!==null&&e!==void 0?e:A},error:null}}function Ax(A){return{data:A,error:null}}function rx(A){const{action_link:e,email_otp:t,hashed_token:r,redirect_to:n,verification_type:s}=A,i=Co(A,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:t,hashed_token:r,redirect_to:n,verification_type:s},a=Object.assign({},i);return{data:{properties:o,user:a},error:null}}function tm(A){return A}function nx(A){return!!A.access_token&&!!A.refresh_token&&!!A.expires_in}const Oo=["global","local","others"];class eu{constructor({url:e="",headers:t={},fetch:r,experimental:n}){this.url=e,this.headers=t,this.fetch=Xw(r),this.experimental=n??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=Oo[0]){if(Oo.indexOf(t)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Oo.join(", ")}`);try{return await M(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(H(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,t={}){try{return await M(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:DA})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:t}=e,r=Co(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=r==null?void 0:r.newEmail,delete n.newEmail),await M(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:rx,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(H(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await M(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:DA})}catch(t){if(H(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,r,n,s,i,o,a;try{const l={nextPage:null,lastPage:0,total:0},u=await M(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(s=(n=e==null?void 0:e.perPage)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""},xform:tm});if(u.error)throw u.error;const d=await u.json(),g=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const y=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),B=JSON.parse(w.split(";")[1].split("=")[1]);l[`${B}Page`]=y}),l.total=parseInt(g)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(H(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){dA(e);try{return await M(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:DA})}catch(t){if(H(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){dA(e);try{return await M(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:DA})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,t=!1){dA(e);try{return await M(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:DA})}catch(r){if(H(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){dA(e.userId);try{const{data:t,error:r}=await M(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:n=>({data:{factors:n},error:null})});return{data:t,error:r}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _deleteFactor(e){dA(e.userId),dA(e.id);try{return{data:await M(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _listOAuthClients(e){var t,r,n,s,i,o,a;try{const l={nextPage:null,lastPage:0,total:0},u=await M(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:"",per_page:(s=(n=e==null?void 0:e.perPage)===null||n===void 0?void 0:n.toString())!==null&&s!==void 0?s:""},xform:tm});if(u.error)throw u.error;const d=await u.json(),g=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,p=(a=(o=u.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&a!==void 0?a:[];return p.length>0&&(p.forEach(w=>{const y=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),B=JSON.parse(w.split(";")[1].split("=")[1]);l[`${B}Page`]=y}),l.total=parseInt(g)),{data:Object.assign(Object.assign({},d),l),error:null}}catch(l){if(H(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(e){try{return await M(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _getOAuthClient(e){try{return await M(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _updateOAuthClient(e,t){try{return await M(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await M(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _regenerateOAuthClientSecret(e){try{return await M(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _listCustomProviders(e){try{const t={};return e!=null&&e.type&&(t.type=e.type),await M(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:r=>{var n;return{data:{providers:(n=r==null?void 0:r.providers)!==null&&n!==void 0?n:[]},error:null}}})}catch(t){if(H(t))return{data:{providers:[]},error:t};throw t}}async _createCustomProvider(e){try{return await M(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _getCustomProvider(e){try{return await M(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _updateCustomProvider(e,t){try{return await M(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(H(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await M(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}async _adminListPasskeys(e){Ot(this.experimental),dA(e.userId);try{return await M(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:t=>({data:t,error:null})})}catch(t){if(H(t))return{data:null,error:t};throw t}}async _adminDeletePasskey(e){Ot(this.experimental),dA(e.userId),dA(e.passkeyId);try{return await M(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(t){if(H(t))return{data:null,error:t};throw t}}}function Am(A={}){return{getItem:e=>A[e]||null,setItem:(e,t)=>{A[e]=t},removeItem:e=>{delete A[e]}}}const Pt={debug:!!(globalThis&&zw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Qs extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class tu extends Qs{}class sx extends Qs{}async function ix(A,e,t){Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",A,e);const r=new globalThis.AbortController;let n;e>0&&(n=setTimeout(()=>{r.abort(),Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",A)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(A,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){clearTimeout(n),Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",A,s.name);try{return await t()}finally{Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",A,s.name)}}else{if(e===0)throw Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",A),new tu(`Acquiring an exclusive Navigator LockManager lock "${A}" immediately failed`);if(Pt.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(n),await t()}})}catch(s){if(e>0&&clearTimeout(n),s!==null&&typeof s=="object"&&"name"in s&&s.name==="AbortError"&&e>0){if(r.signal.aborted)return Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",A),console.warn(`@supabase/gotrue-js: Lock "${A}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(A,{mode:"exclusive",steal:!0},async i=>{if(i){Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",A,i.name);try{return await t()}finally{Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",A,i.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await t()}));throw Pt.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",A),new tu(`Lock "${A}" was released because another request stole it`)}throw s}}const rm={};async function ox(A,e,t){var r;const n=(r=rm[A])!==null&&r!==void 0?r:Promise.resolve(),s=(async()=>{try{return await n,null}catch{return null}})(),i=(async()=>{let o=null;try{const a=e>=0?new Promise((l,u)=>{o=setTimeout(()=>{console.warn(`@supabase/gotrue-js: Lock "${A}" acquisition timed out after ${e}ms. This may be caused by another operation holding the lock. Consider increasing lockAcquireTimeout or checking for stuck operations.`),u(new sx(`Acquiring process lock with name "${A}" timed out`))},e)}):null;await Promise.race([s,a].filter(l=>l)),o!==null&&clearTimeout(o)}catch(a){if(o!==null&&clearTimeout(o),a instanceof Qs)throw a}return await t()})();return rm[A]=(async()=>{try{return await i}catch(o){if(o instanceof Qs){try{await n}catch{}return null}throw o}})(),await i}function ax(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function nm(A){if(!/^0x[a-fA-F0-9]{40}$/.test(A))throw new Error(`@supabase/auth-js: Address "${A}" is invalid.`);return A.toLowerCase()}function cx(A){return parseInt(A,16)}function lx(A){const e=new TextEncoder().encode(A);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function ux(A){var e;const{chainId:t,domain:r,expirationTime:n,issuedAt:s=new Date,nonce:i,notBefore:o,requestId:a,resources:l,scheme:u,uri:d,version:g}=A;{if(!Number.isInteger(t))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(g!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${g}`);if(!((e=A.statement)===null||e===void 0)&&e.includes(`
3008
3008
  `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${A.statement}`)}const p=nm(A.address),w=u?`${u}://${r}`:r,y=A.statement?`${A.statement}
3009
3009
  `:"",B=`${w} wants you to sign in with your Ethereum account:
3010
3010
  ${p}
@@ -3019,6 +3019,6 @@ Not Before: ${o.toISOString()}`),a&&(b+=`
3019
3019
  Request ID: ${a}`),l){let S=`
3020
3020
  Resources:`;for(const I of l){if(!I||typeof I!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${I}`);S+=`
3021
3021
  - ${I}`}b+=S}return`${B}
3022
- ${b}`}class Re extends Error{constructor({message:e,code:t,cause:r,name:n}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=n??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class No extends Re{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}function hx({error:A,options:e}){var t,r,n;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(A.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Re({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:A})}else if(A.name==="ConstraintError"){if(((t=s.authenticatorSelection)===null||t===void 0?void 0:t.requireResidentKey)===!0)return new Re({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:A});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Re({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:A});if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Re({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:A})}else{if(A.name==="InvalidStateError")return new Re({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:A});if(A.name==="NotAllowedError")return new Re({message:A.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A});if(A.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Re({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:A}):new Re({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:A});if(A.name==="SecurityError"){const i=window.location.hostname;if(cm(i)){if(s.rp.id!==i)return new Re({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:A})}else return new Re({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:A})}else if(A.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new Re({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:A})}else if(A.name==="UnknownError")return new Re({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:A})}return new Re({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A})}function dx({error:A,options:e}){const{publicKey:t}=e;if(!t)throw Error("options was missing required publicKey property");if(A.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Re({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:A})}else{if(A.name==="NotAllowedError")return new Re({message:A.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A});if(A.name==="SecurityError"){const r=window.location.hostname;if(cm(r)){if(t.rpId!==r)return new Re({message:`The RP ID "${t.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:A})}else return new Re({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:A})}else if(A.name==="UnknownError")return new Re({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:A})}return new Re({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A})}class fx{createNewAbortSignal(){if(this.controller){const t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const ru=new fx;function sm(A){if(!A)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(A);const{challenge:e,user:t,excludeCredentials:r}=A,n=_o(A,["challenge","user","excludeCredentials"]),s=rn(e).buffer,i=Object.assign(Object.assign({},t),{id:rn(t.id).buffer}),o=Object.assign(Object.assign({},n),{challenge:s,user:i});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let a=0;a<r.length;a++){const l=r[a];o.excludeCredentials[a]=Object.assign(Object.assign({},l),{id:rn(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return o}function im(A){if(!A)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(A);const{challenge:e,allowCredentials:t}=A,r=_o(A,["challenge","allowCredentials"]),n=rn(e).buffer,s=Object.assign(Object.assign({},r),{challenge:n});if(t&&t.length>0){s.allowCredentials=new Array(t.length);for(let i=0;i<t.length;i++){const o=t[i];s.allowCredentials[i]=Object.assign(Object.assign({},o),{id:rn(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function om(A){var e;if("toJSON"in A&&typeof A.toJSON=="function")return A.toJSON();const t=A;return{id:A.id,rawId:A.id,response:{attestationObject:hr(new Uint8Array(A.response.attestationObject)),clientDataJSON:hr(new Uint8Array(A.response.clientDataJSON))},type:"public-key",clientExtensionResults:A.getClientExtensionResults(),authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function am(A){var e;if("toJSON"in A&&typeof A.toJSON=="function")return A.toJSON();const t=A,r=A.getClientExtensionResults(),n=A.response;return{id:A.id,rawId:A.id,response:{authenticatorData:hr(new Uint8Array(n.authenticatorData)),clientDataJSON:hr(new Uint8Array(n.clientDataJSON)),signature:hr(new Uint8Array(n.signature)),userHandle:n.userHandle?hr(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function cm(A){return A==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(A)}function Mo(){var A,e;return!!(ze()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((A=navigator==null?void 0:navigator.credentials)===null||A===void 0?void 0:A.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function lm(A){try{const e=await navigator.credentials.create(A);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new No("Browser returned unexpected credential type",e)}:{data:null,error:new No("Empty credential response",e)}}catch(e){return{data:null,error:hx({error:e,options:A})}}}async function um(A){try{const e=await navigator.credentials.get(A);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new No("Browser returned unexpected credential type",e)}:{data:null,error:new No("Empty credential response",e)}}catch(e){return{data:null,error:dx({error:e,options:A})}}}const gx={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},px={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Vo(...A){const e=n=>n!==null&&typeof n=="object"&&!Array.isArray(n),t=n=>n instanceof ArrayBuffer||ArrayBuffer.isView(n),r={};for(const n of A)if(n)for(const s in n){const i=n[s];if(i!==void 0)if(Array.isArray(i))r[s]=i;else if(t(i))r[s]=i;else if(e(i)){const o=r[s];e(o)?r[s]=Vo(o,i):r[s]=Vo(i)}else r[s]=i}return r}function wx(A,e){return Vo(gx,A,e||{})}function mx(A,e){return Vo(px,A,e||{})}class Bx{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},s){var i;try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!o)return{data:null,error:a};const l=n??ru.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;if(!u.name){const d=r;if(d)u.name=`${u.id}:${d}`;else{const p=(await this.client.getUser()).data.user,w=((i=p==null?void 0:p.user_metadata)===null||i===void 0?void 0:i.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";u.name=`${u.id}:${w}`}}u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=wx(o.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:g}=await lm({publicKey:u,signal:l});return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:g}}case"request":{const u=mx(o.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:g}=await um(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:l}));return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:g}}}}catch(o){return H(o)?{data:null,error:o}:{data:null,error:new Et("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:n}={}},s){if(!t)return{data:null,error:new An("rpId is required for WebAuthn authentication")};try{if(!Mo())return{data:null,error:new Et("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:n},{request:s});if(!i)return{data:null,error:o};const{webauthn:a}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:r,credential_response:a.credential_response}})}catch(i){return H(i)?{data:null,error:i}:{data:null,error:new Et("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:n}={}},s){if(!t)return{data:null,error:new An("rpId is required for WebAuthn registration")};try{if(!Mo())return{data:null,error:new Et("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(g=>g.factor_type==="webauthn"&&g.friendly_name===e&&g.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:o};const{data:a,error:l}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:n},{create:s});return a?this._verify({factorId:i.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:r,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:l}}catch(i){return H(i)?{data:null,error:i}:{data:null,error:new Et("Unexpected error in register",i)}}}}ax();const yx={url:b1,storageKey:U1,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Q1,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},sn={};class on{get jwks(){var e,t;return(t=(e=sn[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&t!==void 0?t:{keys:[]}}set jwks(e){sn[this.storageKey]=Object.assign(Object.assign({},sn[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return(t=(e=sn[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&t!==void 0?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){sn[this.storageKey]=Object.assign(Object.assign({},sn[this.storageKey]),{cachedAt:e})}constructor(e){var t,r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},yx),e);if(this.storageKey=s.storageKey,this.instanceID=(t=on.nextInstanceID[this.storageKey])!==null&&t!==void 0?t:0,on.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&ze()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.experimental=(r=s.experimental)!==null&&r!==void 0?r:{},this.admin=new tu({url:s.url,headers:s.headers,fetch:s.fetch,experimental:this.experimental}),this.url=s.url,this.headers=s.headers,this.fetch=Xw(s.fetch),this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock!=null&&(this.lock=s.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Bx(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:zw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Am(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=Am(this.memoryStorage)),ze()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}s.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Pw}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let t={},r="none";if(ze()&&(t=P1(window.location.href),this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce")),ze()&&this.detectSessionInUrl&&r!=="none"){const{data:n,error:s}=await this._getSessionFromURL(t,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),Kw(s)){const a=(e=s.details)===null||e===void 0?void 0:e.code;if(a==="identity_already_exists"||a==="identity_not_found"||a==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:i,redirectType:o}=n;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return H(t)?this._returnResult({error:t}):this._returnResult({error:new Et("Unexpected error during initialization",t)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{const s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}},xform:vt}),{data:i,error:o}=s;if(o||!i)return this._returnResult({data:{user:null,session:null},error:o});const a=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(s){if(H(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var t,r,n;try{let s;if("email"in e){const{email:u,password:d,options:g}=e;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await fr(this.storage,this.storageKey)),s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:g==null?void 0:g.emailRedirectTo,body:{email:u,password:d,data:(t=g==null?void 0:g.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken},code_challenge:p,code_challenge_method:w},xform:vt})}else if("phone"in e){const{phone:u,password:d,options:g}=e;s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(r=g==null?void 0:g.data)!==null&&r!==void 0?r:{},channel:(n=g==null?void 0:g.channel)!==null&&n!==void 0?n:"sms",gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken}},xform:vt})}else throw new vs("You must provide either an email or phone number and a password");const{data:i,error:o}=s;if(o||!i)return await Qe(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const a=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(s){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let t;if("email"in e){const{email:s,password:i,options:o}=e;t=await M(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:em})}else if("phone"in e){const{phone:s,password:i,options:o}=e;t=await M(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:em})}else throw new vs("You must provide either an email or phone number and a password");const{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){const s=new ur;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(t){if(H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOAuth(e){var t,r,n,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(n=e.options)===null||n===void 0?void 0:n.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,s,i,o,a,l,u,d,g;let p,w;if("message"in e)p=e.message,w=e.signature;else{const{chain:y,wallet:B,statement:b,options:S}=e;let I;if(ze())if(typeof B=="object")I=B;else{const v=window;if("ethereum"in v&&typeof v.ethereum=="object"&&"request"in v.ethereum&&typeof v.ethereum.request=="function")I=v.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof B!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");I=B}const R=new URL((t=S==null?void 0:S.url)!==null&&t!==void 0?t:window.location.href),K=await I.request({method:"eth_requestAccounts"}).then(v=>v).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!K||K.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const P=nm(K[0]);let _=(r=S==null?void 0:S.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!_){const v=await I.request({method:"eth_chainId"});_=cx(v)}const C={domain:R.host,address:P,statement:b,uri:R.href,version:"1",chainId:_,nonce:(n=S==null?void 0:S.signInWithEthereum)===null||n===void 0?void 0:n.nonce,issuedAt:(i=(s=S==null?void 0:S.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(o=S==null?void 0:S.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(a=S==null?void 0:S.signInWithEthereum)===null||a===void 0?void 0:a.notBefore,requestId:(l=S==null?void 0:S.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(u=S==null?void 0:S.signInWithEthereum)===null||u===void 0?void 0:u.resources};p=ux(C),w=await I.request({method:"personal_sign",params:[lx(p),P]})}try{const{data:y,error:B}=await M(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:vt});if(B)throw B;if(!y||!y.session||!y.user){const b=new ur;return this._returnResult({data:{user:null,session:null},error:b})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:B})}catch(y){if(H(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async signInWithSolana(e){var t,r,n,s,i,o,a,l,u,d,g,p;let w,y;if("message"in e)w=e.message,y=e.signature;else{const{chain:B,wallet:b,statement:S,options:I}=e;let R;if(ze())if(typeof b=="object")R=b;else{const P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))R=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(I!=null&&I.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");R=b}const K=new URL((t=I==null?void 0:I.url)!==null&&t!==void 0?t:window.location.href);if("signIn"in R&&R.signIn){const P=await R.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},I==null?void 0:I.signInWithSolana),{version:"1",domain:K.host,uri:K.href}),S?{statement:S}:null));let _;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")_=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)_=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)w=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),y=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in R)||typeof R.signMessage!="function"||!("publicKey"in R)||typeof R!="object"||!R.publicKey||!("toBase58"in R.publicKey)||typeof R.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${K.host} wants you to sign in with your Solana account:`,R.publicKey.toBase58(),...S?["",S,""]:[""],"Version: 1",`URI: ${K.href}`,`Issued At: ${(n=(r=I==null?void 0:I.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&n!==void 0?n:new Date().toISOString()}`,...!((s=I==null?void 0:I.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${I.signInWithSolana.notBefore}`]:[],...!((i=I==null?void 0:I.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${I.signInWithSolana.expirationTime}`]:[],...!((o=I==null?void 0:I.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${I.signInWithSolana.chainId}`]:[],...!((a=I==null?void 0:I.signInWithSolana)===null||a===void 0)&&a.nonce?[`Nonce: ${I.signInWithSolana.nonce}`]:[],...!((l=I==null?void 0:I.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${I.signInWithSolana.requestId}`]:[],...!((d=(u=I==null?void 0:I.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...I.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
3023
- `);const P=await R.signMessage(new TextEncoder().encode(w),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");y=P}}try{const{data:B,error:b}=await M(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:hr(y)},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:vt});if(b)throw b;if(!B||!B.session||!B.user){const S=new ur;return this._returnResult({data:{user:null,session:null},error:S})}return B.session&&(await this._saveSession(B.session),await this._notifyAllSubscribers("SIGNED_IN",B.session)),this._returnResult({data:Object.assign({},B),error:b})}catch(B){if(H(B))return this._returnResult({data:{user:null,session:null},error:B});throw B}}async _exchangeCodeForSession(e){const t=await Ht(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(t??"").split("/");try{if(!r&&this.flowType==="pkce")throw new $w;const{data:s,error:i}=await M(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:vt});if(await Qe(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!s||!s.session||!s.user){const o=new ur;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers(n==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:n??null}),error:i})}catch(s){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:t,provider:r,token:n,access_token:s,nonce:i}=e,o=await M(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:vt}),{data:a,error:l}=o;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a||!a.session||!a.user){const u=new ur;return this._returnResult({data:{user:null,session:null},error:u})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:l})}catch(t){if(H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOtp(e){var t,r,n,s,i;try{if("email"in e){const{email:o,options:a}=e;let l=null,u=null;this.flowType==="pkce"&&([l,u]=await fr(this.storage,this.storageKey));const{error:d}=await M(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(t=a==null?void 0:a.data)!==null&&t!==void 0?t:{},create_user:(r=a==null?void 0:a.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},code_challenge:l,code_challenge_method:u},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in e){const{phone:o,options:a}=e,{data:l,error:u}=await M(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(n=a==null?void 0:a.data)!==null&&n!==void 0?n:{},create_user:(s=a==null?void 0:a.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},channel:(i=a==null?void 0:a.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:u})}throw new vs("You must provide either an email or phone number.")}catch(o){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var t,r;try{let n,s;"options"in e&&(n=(t=e.options)===null||t===void 0?void 0:t.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:i,error:o}=await M(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:n,xform:vt});if(o)throw o;if(!i)throw new Error("An error occurred on token verification.");const a=i.session,l=i.user;return a!=null&&a.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(n){if(H(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithSSO(e){var t,r,n,s,i;try{let o=null,a=null;this.flowType==="pkce"&&([o,a]=await fr(this.storage,this.storageKey));const l=await M(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&r!==void 0?r:void 0}),!((n=e==null?void 0:e.options)===null||n===void 0)&&n.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:Ax});return!((s=l.data)===null||s===void 0)&&s.url&&ze()&&!(!((i=e.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(o){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new He;const{error:n}=await M(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:r,type:n,options:s}=e;let i=null,o=null;this.flowType==="pkce"&&([i,o]=await fr(this.storage,this.storageKey));const{error:a}=await M(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken},code_challenge:i,code_challenge_method:o},redirectTo:s==null?void 0:s.emailRedirectTo});return a&&await Qe(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:r,type:n,options:s}=e,{data:i,error:o}=await M(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:o})}throw new vs("You must provide either an email or phone number and a type")}catch(t){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await r,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=t();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const n=[...this.pendingInLock];await Promise.all(n),this.pendingInLock.splice(0,n.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await Ht(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<ql:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const i=await Ht(this.userStorage,this.storageKey+"-user");i!=null&&i.user?e.user=i.user:e.user=eu()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};e.user=Y1(e.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:n,error:s}=await this._callRefreshToken(e.refresh_token);if(s){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const o=await Ht(this.storage,this.storageKey);if(o&&o.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:s})}return this._returnResult({data:{session:n},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return this.lock!=null?t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):t=await this._getUser(),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await M(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:DA}):await this._useSession(async t=>{var r,n,s;const{data:i,error:o}=t;if(o)throw o;return!(!((r=i.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new He}:await M(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0,xform:DA})})}catch(t){if(H(t))return Es(t)&&(await this._removeSession(),await Qe(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:t});throw t}}async updateUser(e,t={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t)):await this._updateUser(e,t)}async _updateUser(e,t={}){try{return await this._useSession(async r=>{const{data:n,error:s}=r;if(s)throw s;if(!n.session)throw new He;const i=n.session;let o=null,a=null;this.flowType==="pkce"&&e.email!=null&&([o,a]=await fr(this.storage,this.storageKey));const{data:l,error:u}=await M(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:i.access_token,xform:DA});if(u)throw u;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(r){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new He;const t=Date.now()/1e3;let r=t,n=!0,s=null;const{payload:i}=Oo(e.access_token);if(i.exp&&(r=i.exp,n=r<=t),n){const{data:o,error:a}=await this._callRefreshToken(e.refresh_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(t){if(H(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){const{data:i,error:o}=t;if(o)throw o;e=(r=i.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new He;const{data:n,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(t){if(H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async _getSessionFromURL(e,t){var r;try{if(!ze())throw new bs("No browser detected.");if(e.error||e.error_description||e.error_code)throw new bs(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new zl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new bs("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new zl("No code detected.");const{data:I,error:R}=await this._exchangeCodeForSession(e.code);if(R)throw R;const K=new URL(window.location.href);return K.searchParams.delete("code"),window.history.replaceState(window.history.state,"",K.toString()),{data:{session:I.session,redirectType:(r=I.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!i||!a||!o||!u)throw new bs("No session defined in URL");const d=Math.round(Date.now()/1e3),g=parseInt(a);let p=d+g;l&&(p=parseInt(l));const w=p-d;w*1e3<=hA&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${g}s`);const y=p-g;d-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,p,d):d-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,p,d);const{data:B,error:b}=await this._getUser(i);if(b)throw b;const S={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:g,expires_at:p,refresh_token:o,token_type:u,user:B.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:S,redirectType:e.type},error:null})}catch(n){if(H(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){const t=await Ht(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;const{data:n,error:s}=t;if(s&&!Es(s))return this._returnResult({error:s});const i=(r=n.session)===null||r===void 0?void 0:r.access_token;if(i){const{error:o}=await this.admin.signOut(i,e);if(o&&!(Vw(o)&&(o.status===404||o.status===401||o.status===403)||Es(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await Qe(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const t=O1(),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)}):await this._emitInitialSession(t)))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{const{data:{session:s},error:i}=t;if(i)throw i;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),Es(s)?console.warn(s):console.error(s)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;this.flowType==="pkce"&&([r,n]=await fr(this.storage,this.storageKey,!0));try{return await M(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(s){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{const{data:r,error:n}=await this._useSession(async s=>{var i,o,a,l,u;const{data:d,error:g}=s;if(g)throw g;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(i=e.options)===null||i===void 0?void 0:i.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:!0});return await M(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(l=d.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0})});if(n)throw n;return ze()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(H(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{const{error:n,data:{session:s}}=t;if(n)throw n;const{options:i,provider:o,token:a,access_token:l,nonce:u}=e,d=await M(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:a,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:vt}),{data:g,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!g||!g.session||!g.user?this._returnResult({data:{user:null,session:null},error:new ur}):(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("USER_UPDATED",g.session)),this._returnResult({data:g,error:p}))}catch(n){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;const{data:s,error:i}=t;if(i)throw i;return await M(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(n=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&n!==void 0?n:void 0})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _refreshAccessToken(e){const t="#_refreshAccessToken()";this._debug(t,"begin");try{const r=Date.now();return await V1(async n=>(n>0&&await M1(200*Math.pow(2,n-1)),this._debug(t,"refreshing attempt",n),await M(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:vt})),(n,s)=>{const i=200*Math.pow(2,n);return s&&Xl(s)&&Date.now()+i-r<hA})}catch(r){if(this._debug(t,"error",r),H(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),ze()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const n=await Ht(this.storage,this.storageKey);if(n&&this.userStorage){let i=await Ht(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:n.user},await nn(this.userStorage,this.storageKey+"-user",i)),n.user=(e=i==null?void 0:i.user)!==null&&e!==void 0?e:eu()}else if(n&&!n.user&&!n.user){const i=await Ht(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(n.user=i.user,await Qe(this.storage,this.storageKey+"-user"),await nn(this.storage,this.storageKey,n)):n.user=eu()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}const s=((t=n.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<ql;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${ql}s`),s){if(this.autoRefreshToken&&n.refresh_token){const{error:i}=await this._callRefreshToken(n.refresh_token);i&&(jw(i)?this._debug(r,"refresh discarded by commit guard",i):this._debug(r,"refresh failed",i))}}else if(n.user&&n.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:o}=await this._getUser(n.access_token);!o&&(i!=null&&i.user)?(n.user=i.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(r,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new He;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const n="#_callRefreshToken()";this._debug(n,"begin");try{this.refreshingDeferred=new Ho;const s=await Ht(this.storage,this.storageKey),{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new He;const a=await Ht(this.storage,this.storageKey);if(s!==null&&(a===null||a.refresh_token!==s.refresh_token)){this._debug(n,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:a?"replaced":"cleared"});const g={data:null,error:new Yl};return this.refreshingDeferred.resolve(g),g}const u=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==u){this._debug(n,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await Qe(this.storage,this.storageKey),this.userStorage&&await Qe(this.userStorage,this.storageKey+"-user");const g={data:null,error:new Yl};return this.refreshingDeferred.resolve(g),g}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const d={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(s){if(this._debug(n,"error",s),H(s)){const i={data:null,error:s};if(!Xl(s)){const o=await Ht(this.storage,this.storageKey);!!(o!=null&&o.expires_at&&o.expires_at*1e3>Date.now())?this._debug(n,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:i,expiresAt:Date.now()+v1},(t=this.refreshingDeferred)===null||t===void 0||t.resolve(i),i}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){const n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});const s=[],i=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,t)}catch(a){s.push(a)}});if(await Promise.all(i),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Qe(this.storage,`${this.storageKey}-code-verifier`);const t=Object.assign({},e),r=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&t.user&&await nn(this.userStorage,this.storageKey+"-user",{user:t.user});const n=Object.assign({},t);delete n.user;const s=Yw(n);await nn(this.storage,this.storageKey,s)}else{const n=Yw(t);await nn(this.storage,this.storageKey,n)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Qe(this.storage,this.storageKey),await Qe(this.storage,this.storageKey+"-code-verifier"),await Qe(this.storage,this.storageKey+"-user"),this.userStorage&&await Qe(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&ze()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),hA);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((r.expires_at*1e3-e)/hA);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${hA}ms, refresh threshold is ${_s} ticks`),n<=_s&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof Qs)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((r.expires_at*1e3-e)/hA);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${hA}ms, refresh threshold is ${_s} ticks`),n<=_s&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ze()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;if(this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(t,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){const n=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,i]=await fr(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(i)}`});n.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);n.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;const{data:n,error:s}=t;return s?this._returnResult({data:null,error:s}):await M(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;const{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:a,error:l}=await M(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(e.factorType==="totp"&&a.type==="totp"&&(!((n=a==null?void 0:a.totp)===null||n===void 0)&&n.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _verify(e){const t=async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?om(e.webauthn.credential_response):am(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await M(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,t):t()}async _challenge(e){const t=async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await M(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:sm(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:im(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,t):t()}async _challengeAndVerify(e){const{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const n={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=t==null?void 0:t.factors)!==null&&e!==void 0?e:[])n.all.push(s),s.status==="verified"&&n[s.factor_type].push(s);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,s;if(e)try{const{payload:p}=Oo(e);let w=null;p.aal&&(w=p.aal);let y=w;const{data:{user:B},error:b}=await this.getUser(e);if(b)return this._returnResult({data:null,error:b});((r=(t=B==null?void 0:B.factors)===null||t===void 0?void 0:t.filter(R=>R.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(y="aal2");const I=p.amr||[];return{data:{currentLevel:w,nextLevel:y,currentAuthenticationMethods:I},error:null}}catch(p){if(H(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:i},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=Oo(i.access_token);let l=null;a.aal&&(l=a.aal);let u=l;((s=(n=i.user.factors)===null||n===void 0?void 0:n.filter(p=>p.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(u="aal2");const g=a.amr||[];return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:g},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await M(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new He})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _approveAuthorization(e,t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new He});const i=await M(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&ze()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new He});const i=await M(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&ze()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await M(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:n=>({data:n,error:null})}):this._returnResult({data:null,error:new He})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await M(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new He})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(o=>o.kid===e);if(r)return r;const n=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+F1>n)return r;const{data:s,error:i}=await M(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=n,r=s.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,t={}){try{let r=e;if(!r){const{data:p,error:w}=await this.getSession();if(w||!p.session)return this._returnResult({data:null,error:w});r=p.session.access_token}const{header:n,payload:s,signature:i,raw:{header:o,payload:a}}=Oo(r);if(!(t!=null&&t.allowExpired))try{J1(s.exp)}catch(p){throw new Us(p instanceof Error?p.message:"JWT validation failed")}const l=!n.alg||n.alg.startsWith("HS")||!n.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(n.kid,t!=null&&t.keys?{keys:t.keys}:t==null?void 0:t.jwks);if(!l){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:s,header:n,signature:i},error:null}}const u=z1(n.alg),d=await crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,i,D1(`${o}.${a}`)))throw new Us("Invalid JWT signature");return{data:{claims:s,header:n,signature:i},error:null}}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(e){var t,r,n;Ot(this.experimental);try{if(!Mo())return this._returnResult({data:null,error:new Et("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.captchaToken}});if(i||!s)return this._returnResult({data:null,error:i});const o=im(s.options),a=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:ru.createNewAbortSignal(),{data:l,error:u}=await um({publicKey:o,signal:a});if(u||!l)return this._returnResult({data:null,error:u??new Et("WebAuthn ceremony failed",null)});const d=am(l);return this._verifyPasskeyAuthentication({challengeId:s.challenge_id,credential:d})}catch(s){if(H(s))return this._returnResult({data:null,error:s});throw s}}async registerPasskey(e){var t,r;Ot(this.experimental);try{if(!Mo())return this._returnResult({data:null,error:new Et("Browser does not support WebAuthn",null)});const{data:n,error:s}=await this._startPasskeyRegistration();if(s||!n)return this._returnResult({data:null,error:s});const i=sm(n.options),o=(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.signal)!==null&&r!==void 0?r:ru.createNewAbortSignal(),{data:a,error:l}=await lm({publicKey:i,signal:o});if(l||!a)return this._returnResult({data:null,error:l??new Et("WebAuthn ceremony failed",null)});const u=om(a);return this._verifyPasskeyRegistration({challengeId:n.challenge_id,credential:u})}catch(n){if(H(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyRegistration(){Ot(this.experimental);try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new He});const{data:n,error:s}=await M(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Ot(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new He});const{data:s,error:i}=await M(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _startPasskeyAuthentication(e){var t;Ot(this.experimental);try{const{data:r,error:n}=await M(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:r,error:null})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(e){Ot(this.experimental);try{const{data:t,error:r}=await M(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:vt});return r?this._returnResult({data:null,error:r}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null}))}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _listPasskeys(){Ot(this.experimental);try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new He});const{data:n,error:s}=await M(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:i=>({data:i,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Ot(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new He});const{data:s,error:i}=await M(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _deletePasskey(e){Ot(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new He});const{error:s}=await M(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}}on.nextInstanceID={};const Cx=tu,hm=on,_x="2.108.2";let Is="",Ko;if(typeof Deno<"u"){var nu;Is="deno",Ko=(nu=Deno.version)===null||nu===void 0?void 0:nu.deno}else if(typeof document<"u")Is="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Is="react-native";else{var su;Is="node",Ko=typeof process<"u"?(su=process.version)===null||su===void 0?void 0:su.replace(/^v/,""):void 0}const dm=[`runtime=${Is}`];Ko&&dm.push(`runtime-version=${Ko}`);const Ex={headers:{"X-Client-Info":`supabase-js/${_x}; ${dm.join("; ")}`}},vx={schema:"public"},bx={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Ux={},Qx={enabled:!1,respectSamplingDecision:!0};function Ix(A,e,t,r){function n(s){return s instanceof t?s:new t(function(i){i(s)})}return new(t||(t=Promise))(function(s,i){function o(u){try{l(r.next(u))}catch(d){i(d)}}function a(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):n(u.value).then(o,a)}l((r=r.apply(A,[])).next())})}let iu=null;const Fx="@opentelemetry/api";function Tx(){return iu===null&&(iu=import(Fx).catch(()=>null)),iu}function Sx(){return Ix(this,void 0,void 0,function*(){try{const A=yield Tx();if(!A||!A.propagation||!A.context)return null;const e={};A.propagation.inject(A.context.active(),e);const t=e.traceparent;return t?{traceparent:t,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function Rx(A){if(!A||typeof A!="string")return null;const e=A.split("-");if(e.length!==4)return null;const[t,r,n,s]=e;if(t.length!==2||r.length!==32||n.length!==16||s.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(t)||!i.test(r)||!i.test(n)||!i.test(s)||r==="00000000000000000000000000000000"||n==="0000000000000000"?null:{version:t,traceId:r,parentId:n,traceFlags:s,isSampled:(parseInt(s,16)&1)===1}}function xx(A,e){if(!A||!e||e.length===0)return!1;let t;if(A instanceof URL)t=A;else try{t=new URL(A)}catch{return!1}for(const r of e)try{if(typeof r=="string"){if(kx(t.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(t.hostname))return!0}else if(typeof r=="function"&&r(t))return!0}catch{continue}return!1}function kx(A,e){if(e===A)return!0;if(e.startsWith("*.")){const t=e.slice(2);if(A.endsWith(t)&&(A===t||A.endsWith("."+t)))return!0}return!1}function Lx(A){const e=[];try{const t=new URL(A);e.push(t.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function Fs(A){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fs(A)}function Dx(A,e){if(Fs(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var r=t.call(A,e);if(Fs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function Hx(A){var e=Dx(A,"string");return Fs(e)=="symbol"?e:e+""}function Ox(A,e,t){return(e=Hx(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function fm(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(A);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,r)}return t}function ye(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fm(Object(t),!0).forEach(function(r){Ox(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):fm(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}const Px=A=>A?(...e)=>A(...e):(...e)=>fetch(...e),Nx=()=>Headers,Mx=(A,e,t,r,n)=>{const s=Px(r),i=Nx(),o=(n==null?void 0:n.enabled)===!0,a=(n==null?void 0:n.respectSamplingDecision)!==!1,l=o?Lx(e):null;return async(u,d)=>{var g;const p=(g=await t())!==null&&g!==void 0?g:A;let w=new i(d==null?void 0:d.headers);if(w.has("apikey")||w.set("apikey",A),w.has("Authorization")||w.set("Authorization",`Bearer ${p}`),l){const y=await Vx(u,l,a);y&&(y.traceparent&&!w.has("traceparent")&&w.set("traceparent",y.traceparent),y.tracestate&&!w.has("tracestate")&&w.set("tracestate",y.tracestate),y.baggage&&!w.has("baggage")&&w.set("baggage",y.baggage))}return s(u,ye(ye({},d),{},{headers:w}))}};async function Vx(A,e,t){if(!xx(typeof A=="string"||A instanceof URL?A:A.url,e))return null;const r=await Sx();if(!r||!r.traceparent)return null;if(t){const n=Rx(r.traceparent);if(n&&!n.isSampled)return null}return r}function gm(A){return typeof A=="boolean"?{enabled:A}:A}function Kx(A){return A.endsWith("/")?A:A+"/"}function $x(A,e){var t,r,n,s,i,o;const{db:a,auth:l,realtime:u,global:d}=A,{db:g,auth:p,realtime:w,global:y}=e,B=gm(A.tracePropagation),b=gm(e.tracePropagation),S={db:ye(ye({},g),a),auth:ye(ye({},p),l),realtime:ye(ye({},w),u),storage:{},global:ye(ye(ye({},y),d),{},{headers:ye(ye({},(t=y==null?void 0:y.headers)!==null&&t!==void 0?t:{}),(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(n=(s=B==null?void 0:B.enabled)!==null&&s!==void 0?s:b==null?void 0:b.enabled)!==null&&n!==void 0?n:!1,respectSamplingDecision:(i=(o=B==null?void 0:B.respectSamplingDecision)!==null&&o!==void 0?o:b==null?void 0:b.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return A.accessToken?S.accessToken=A.accessToken:delete S.accessToken,S}function jx(A){const e=A==null?void 0:A.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Kx(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Gx=class extends hm{constructor(A){super(A)}},pm=class{constructor(A,e,t){var r,n;this.supabaseUrl=A,this.supabaseKey=e;const s=jx(A);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const i=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:vx,realtime:Ux,auth:ye(ye({},bx),{},{storageKey:i}),global:Ex,tracePropagation:Qx},a=$x(t??{},o);if(this.settings=a,this.storageKey=(r=a.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(n=a.global.headers)!==null&&n!==void 0?n:{},a.accessToken)this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var l;this.auth=this._initSupabaseAuthClient((l=a.auth)!==null&&l!==void 0?l:{},this.headers,a.global.fetch)}this.fetch=Mx(e,A,this._getAccessToken.bind(this),a.global.fetch,a.tracePropagation),this.realtime=this._initRealtimeClient(ye({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new fR(new URL("rest/v1",s).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new E1(this.storageUrl.href,this.headers,this.fetch,t==null?void 0:t.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new sR(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(A){return this.rest.from(A)}schema(A){return this.rest.schema(A)}rpc(A,e={},t={head:!1,get:!1,count:void 0}){return this.rest.rpc(A,e,t)}channel(A,e={config:{}}){return this.realtime.channel(A,e)}getChannels(){return this.realtime.getChannels()}removeChannel(A){return this.realtime.removeChannel(A)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var A=this,e,t;if(A.accessToken)return await A.accessToken();const{data:r}=await A.auth.getSession();return(e=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&e!==void 0?e:A.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:A,persistSession:e,detectSessionInUrl:t,storage:r,userStorage:n,storageKey:s,flowType:i,lock:o,debug:a,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:g},p,w){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Gx({url:this.authUrl.href,headers:ye(ye({},y),p),storageKey:s,autoRefreshToken:A,persistSession:e,detectSessionInUrl:t,storage:r,userStorage:n,flowType:i,lock:o,debug:a,throwOnError:l,experimental:u,fetch:w,lockAcquireTimeout:d,skipAutoInitialize:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(B=>B.toLowerCase()==="authorization")})}_initRealtimeClient(A){return new Sw(this.realtimeUrl.href,ye(ye({},A),{},{params:ye(ye({},{apikey:this.supabaseKey}),A==null?void 0:A.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((A,e)=>{this._handleTokenChanged(A,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(A,e,t){(A==="TOKEN_REFRESHED"||A==="SIGNED_IN")&&this.changedAccessToken!==t?(this.changedAccessToken=t,this.realtime.setAuth(t)):A==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Wx=(A,e,t)=>new pm(A,e,t);function qx(){if(typeof window<"u")return!1;const A=globalThis.process;if(!A)return!1;const e=A.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}qx()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Jx=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:Cx,AuthApiError:Mw,AuthClient:hm,AuthError:An,AuthImplicitGrantRedirectError:bs,AuthInvalidCredentialsError:vs,AuthInvalidJwtError:Us,AuthInvalidTokenResponseError:ur,AuthPKCECodeVerifierMissingError:$w,AuthPKCEGrantCodeExchangeError:zl,AuthRefreshDiscardedError:Yl,AuthRetryableFetchError:Lo,AuthSessionMissingError:He,AuthUnknownError:Et,AuthWeakPasswordError:Zl,CustomAuthError:Dt,get FunctionRegion(){return vo},FunctionsError:Eo,FunctionsFetchError:fw,FunctionsHttpError:Hl,FunctionsRelayError:Dl,GoTrueAdminApi:tu,GoTrueClient:on,NavigatorLockAcquireTimeoutError:Au,PostgrestError:Ol,REALTIME_CHANNEL_STATES:MR,get REALTIME_LISTEN_TYPES(){return lr},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return $l},get REALTIME_PRESENCE_LISTEN_EVENTS(){return Kl},get REALTIME_SUBSCRIBE_STATES(){return eA},RealtimeChannel:Zr,RealtimeClient:Sw,RealtimePresence:Fw,SIGN_OUT_SCOPES:Po,StorageApiError:xo,SupabaseClient:pm,WebSocketFactory:Cw,createClient:Wx,isAuthApiError:Vw,isAuthError:H,isAuthImplicitGrantRedirectError:Kw,isAuthPKCECodeVerifierMissingError:T1,isAuthRefreshDiscardedError:jw,isAuthRetryableFetchError:Xl,isAuthSessionMissingError:Es,isAuthWeakPasswordError:S1,lockInternals:Pt,navigatorLock:ix,processLock:ox},Symbol.toStringTag,{value:"Module"}));mt.initFeedbackPlugin=MB,Object.defineProperty(mt,Symbol.toStringTag,{value:"Module"})});
3022
+ ${b}`}class Re extends Error{constructor({message:e,code:t,cause:r,name:n}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=n??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Po extends Re{constructor(e,t){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t,message:e}),this.name="WebAuthnUnknownError",this.originalError=t}}function hx({error:A,options:e}){var t,r,n;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(A.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Re({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:A})}else if(A.name==="ConstraintError"){if(((t=s.authenticatorSelection)===null||t===void 0?void 0:t.requireResidentKey)===!0)return new Re({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:A});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Re({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:A});if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Re({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:A})}else{if(A.name==="InvalidStateError")return new Re({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:A});if(A.name==="NotAllowedError")return new Re({message:A.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A});if(A.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Re({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:A}):new Re({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:A});if(A.name==="SecurityError"){const i=window.location.hostname;if(cm(i)){if(s.rp.id!==i)return new Re({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:A})}else return new Re({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:A})}else if(A.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new Re({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:A})}else if(A.name==="UnknownError")return new Re({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:A})}return new Re({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A})}function dx({error:A,options:e}){const{publicKey:t}=e;if(!t)throw Error("options was missing required publicKey property");if(A.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Re({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:A})}else{if(A.name==="NotAllowedError")return new Re({message:A.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A});if(A.name==="SecurityError"){const r=window.location.hostname;if(cm(r)){if(t.rpId!==r)return new Re({message:`The RP ID "${t.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:A})}else return new Re({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:A})}else if(A.name==="UnknownError")return new Re({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:A})}return new Re({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:A})}class fx{createNewAbortSignal(){if(this.controller){const t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const Au=new fx;function sm(A){if(!A)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(A);const{challenge:e,user:t,excludeCredentials:r}=A,n=Co(A,["challenge","user","excludeCredentials"]),s=nn(e).buffer,i=Object.assign(Object.assign({},t),{id:nn(t.id).buffer}),o=Object.assign(Object.assign({},n),{challenge:s,user:i});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let a=0;a<r.length;a++){const l=r[a];o.excludeCredentials[a]=Object.assign(Object.assign({},l),{id:nn(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return o}function im(A){if(!A)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(A);const{challenge:e,allowCredentials:t}=A,r=Co(A,["challenge","allowCredentials"]),n=nn(e).buffer,s=Object.assign(Object.assign({},r),{challenge:n});if(t&&t.length>0){s.allowCredentials=new Array(t.length);for(let i=0;i<t.length;i++){const o=t[i];s.allowCredentials[i]=Object.assign(Object.assign({},o),{id:nn(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function om(A){var e;if("toJSON"in A&&typeof A.toJSON=="function")return A.toJSON();const t=A;return{id:A.id,rawId:A.id,response:{attestationObject:hr(new Uint8Array(A.response.attestationObject)),clientDataJSON:hr(new Uint8Array(A.response.clientDataJSON))},type:"public-key",clientExtensionResults:A.getClientExtensionResults(),authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function am(A){var e;if("toJSON"in A&&typeof A.toJSON=="function")return A.toJSON();const t=A,r=A.getClientExtensionResults(),n=A.response;return{id:A.id,rawId:A.id,response:{authenticatorData:hr(new Uint8Array(n.authenticatorData)),clientDataJSON:hr(new Uint8Array(n.clientDataJSON)),signature:hr(new Uint8Array(n.signature)),userHandle:n.userHandle?hr(new Uint8Array(n.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=t.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function cm(A){return A==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(A)}function No(){var A,e;return!!(ze()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((A=navigator==null?void 0:navigator.credentials)===null||A===void 0?void 0:A.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function lm(A){try{const e=await navigator.credentials.create(A);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Po("Browser returned unexpected credential type",e)}:{data:null,error:new Po("Empty credential response",e)}}catch(e){return{data:null,error:hx({error:e,options:A})}}}async function um(A){try{const e=await navigator.credentials.get(A);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Po("Browser returned unexpected credential type",e)}:{data:null,error:new Po("Empty credential response",e)}}catch(e){return{data:null,error:dx({error:e,options:A})}}}const gx={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},px={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Mo(...A){const e=n=>n!==null&&typeof n=="object"&&!Array.isArray(n),t=n=>n instanceof ArrayBuffer||ArrayBuffer.isView(n),r={};for(const n of A)if(n)for(const s in n){const i=n[s];if(i!==void 0)if(Array.isArray(i))r[s]=i;else if(t(i))r[s]=i;else if(e(i)){const o=r[s];e(o)?r[s]=Mo(o,i):r[s]=Mo(i)}else r[s]=i}return r}function wx(A,e){return Mo(gx,A,e||{})}function mx(A,e){return Mo(px,A,e||{})}class Bx{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:t,friendlyName:r,signal:n},s){var i;try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!o)return{data:null,error:a};const l=n??Au.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;if(!u.name){const d=r;if(d)u.name=`${u.id}:${d}`;else{const p=(await this.client.getUser()).data.user,w=((i=p==null?void 0:p.user_metadata)===null||i===void 0?void 0:i.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";u.name=`${u.id}:${w}`}}u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=wx(o.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:g}=await lm({publicKey:u,signal:l});return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:g}}case"request":{const u=mx(o.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:g}=await um(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:l}));return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:g}}}}catch(o){return H(o)?{data:null,error:o}:{data:null,error:new Et("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:t,webauthn:r}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:n}={}},s){if(!t)return{data:null,error:new rn("rpId is required for WebAuthn authentication")};try{if(!No())return{data:null,error:new Et("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:r},signal:n},{request:s});if(!i)return{data:null,error:o};const{webauthn:a}=i;return this._verify({factorId:e,challengeId:i.challengeId,webauthn:{type:a.type,rpId:t,rpOrigins:r,credential_response:a.credential_response}})}catch(i){return H(i)?{data:null,error:i}:{data:null,error:new Et("Unexpected error in authenticate",i)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:n}={}},s){if(!t)return{data:null,error:new rn("rpId is required for WebAuthn registration")};try{if(!No())return{data:null,error:new Et("Browser does not support WebAuthn",null)};const{data:i,error:o}=await this._enroll({friendlyName:e});if(!i)return await this.client.mfa.listFactors().then(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(g=>g.factor_type==="webauthn"&&g.friendly_name===e&&g.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:o};const{data:a,error:l}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:t,rpOrigins:r},signal:n},{create:s});return a?this._verify({factorId:i.id,challengeId:a.challengeId,webauthn:{rpId:t,rpOrigins:r,type:a.webauthn.type,credential_response:a.webauthn.credential_response}}):{data:null,error:l}}catch(i){return H(i)?{data:null,error:i}:{data:null,error:new Et("Unexpected error in register",i)}}}}ax();const yx={url:b1,storageKey:U1,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Q1,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},on={};class an{get jwks(){var e,t;return(t=(e=on[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&t!==void 0?t:{keys:[]}}set jwks(e){on[this.storageKey]=Object.assign(Object.assign({},on[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,t;return(t=(e=on[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&t!==void 0?t:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){on[this.storageKey]=Object.assign(Object.assign({},on[this.storageKey]),{cachedAt:e})}constructor(e){var t,r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},yx),e);if(this.storageKey=s.storageKey,this.instanceID=(t=an.nextInstanceID[this.storageKey])!==null&&t!==void 0?t:0,an.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&ze()){const i=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.experimental=(r=s.experimental)!==null&&r!==void 0?r:{},this.admin=new eu({url:s.url,headers:s.headers,fetch:s.fetch,experimental:this.experimental}),this.url=s.url,this.headers=s.headers,this.fetch=Xw(s.fetch),this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock!=null&&(this.lock=s.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new Bx(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:zw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Am(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=Am(this.memoryStorage)),ze()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}s.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Pw}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let t={},r="none";if(ze()&&(t=P1(window.location.href),this._isImplicitGrantCallback(t)?r="implicit":await this._isPKCECallback(t)&&(r="pkce")),ze()&&this.detectSessionInUrl&&r!=="none"){const{data:n,error:s}=await this._getSessionFromURL(t,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),Kw(s)){const a=(e=s.details)===null||e===void 0?void 0:e.code;if(a==="identity_already_exists"||a==="identity_not_found"||a==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:i,redirectType:o}=n;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return H(t)?this._returnResult({error:t}):this._returnResult({error:new Et("Unexpected error during initialization",t)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,r,n;try{const s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}},xform:vt}),{data:i,error:o}=s;if(o||!i)return this._returnResult({data:{user:null,session:null},error:o});const a=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(s){if(H(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var t,r,n;try{let s;if("email"in e){const{email:u,password:d,options:g}=e;let p=null,w=null;this.flowType==="pkce"&&([p,w]=await fr(this.storage,this.storageKey)),s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:g==null?void 0:g.emailRedirectTo,body:{email:u,password:d,data:(t=g==null?void 0:g.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken},code_challenge:p,code_challenge_method:w},xform:vt})}else if("phone"in e){const{phone:u,password:d,options:g}=e;s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(r=g==null?void 0:g.data)!==null&&r!==void 0?r:{},channel:(n=g==null?void 0:g.channel)!==null&&n!==void 0?n:"sms",gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken}},xform:vt})}else throw new vs("You must provide either an email or phone number and a password");const{data:i,error:o}=s;if(o||!i)return await Qe(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const a=i.session,l=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(s){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let t;if("email"in e){const{email:s,password:i,options:o}=e;t=await M(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:em})}else if("phone"in e){const{phone:s,password:i,options:o}=e;t=await M(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:i,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:em})}else throw new vs("You must provide either an email or phone number and a password");const{data:r,error:n}=t;if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!r||!r.session||!r.user){const s=new ur;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:n})}catch(t){if(H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOAuth(e){var t,r,n,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(n=e.options)===null||n===void 0?void 0:n.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:t}=e;switch(t){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){var t,r,n,s,i,o,a,l,u,d,g;let p,w;if("message"in e)p=e.message,w=e.signature;else{const{chain:y,wallet:B,statement:b,options:S}=e;let I;if(ze())if(typeof B=="object")I=B;else{const v=window;if("ethereum"in v&&typeof v.ethereum=="object"&&"request"in v.ethereum&&typeof v.ethereum.request=="function")I=v.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof B!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");I=B}const R=new URL((t=S==null?void 0:S.url)!==null&&t!==void 0?t:window.location.href),K=await I.request({method:"eth_requestAccounts"}).then(v=>v).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!K||K.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const P=nm(K[0]);let _=(r=S==null?void 0:S.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!_){const v=await I.request({method:"eth_chainId"});_=cx(v)}const C={domain:R.host,address:P,statement:b,uri:R.href,version:"1",chainId:_,nonce:(n=S==null?void 0:S.signInWithEthereum)===null||n===void 0?void 0:n.nonce,issuedAt:(i=(s=S==null?void 0:S.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(o=S==null?void 0:S.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(a=S==null?void 0:S.signInWithEthereum)===null||a===void 0?void 0:a.notBefore,requestId:(l=S==null?void 0:S.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(u=S==null?void 0:S.signInWithEthereum)===null||u===void 0?void 0:u.resources};p=ux(C),w=await I.request({method:"personal_sign",params:[lx(p),P]})}try{const{data:y,error:B}=await M(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:w},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:vt});if(B)throw B;if(!y||!y.session||!y.user){const b=new ur;return this._returnResult({data:{user:null,session:null},error:b})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:B})}catch(y){if(H(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async signInWithSolana(e){var t,r,n,s,i,o,a,l,u,d,g,p;let w,y;if("message"in e)w=e.message,y=e.signature;else{const{chain:B,wallet:b,statement:S,options:I}=e;let R;if(ze())if(typeof b=="object")R=b;else{const P=window;if("solana"in P&&typeof P.solana=="object"&&("signIn"in P.solana&&typeof P.solana.signIn=="function"||"signMessage"in P.solana&&typeof P.solana.signMessage=="function"))R=P.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(I!=null&&I.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");R=b}const K=new URL((t=I==null?void 0:I.url)!==null&&t!==void 0?t:window.location.href);if("signIn"in R&&R.signIn){const P=await R.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},I==null?void 0:I.signInWithSolana),{version:"1",domain:K.host,uri:K.href}),S?{statement:S}:null));let _;if(Array.isArray(P)&&P[0]&&typeof P[0]=="object")_=P[0];else if(P&&typeof P=="object"&&"signedMessage"in P&&"signature"in P)_=P;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)w=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),y=_.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in R)||typeof R.signMessage!="function"||!("publicKey"in R)||typeof R!="object"||!R.publicKey||!("toBase58"in R.publicKey)||typeof R.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");w=[`${K.host} wants you to sign in with your Solana account:`,R.publicKey.toBase58(),...S?["",S,""]:[""],"Version: 1",`URI: ${K.href}`,`Issued At: ${(n=(r=I==null?void 0:I.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&n!==void 0?n:new Date().toISOString()}`,...!((s=I==null?void 0:I.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${I.signInWithSolana.notBefore}`]:[],...!((i=I==null?void 0:I.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${I.signInWithSolana.expirationTime}`]:[],...!((o=I==null?void 0:I.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${I.signInWithSolana.chainId}`]:[],...!((a=I==null?void 0:I.signInWithSolana)===null||a===void 0)&&a.nonce?[`Nonce: ${I.signInWithSolana.nonce}`]:[],...!((l=I==null?void 0:I.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${I.signInWithSolana.requestId}`]:[],...!((d=(u=I==null?void 0:I.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...I.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(`
3023
+ `);const P=await R.signMessage(new TextEncoder().encode(w),"utf8");if(!P||!(P instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");y=P}}try{const{data:B,error:b}=await M(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:hr(y)},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:vt});if(b)throw b;if(!B||!B.session||!B.user){const S=new ur;return this._returnResult({data:{user:null,session:null},error:S})}return B.session&&(await this._saveSession(B.session),await this._notifyAllSubscribers("SIGNED_IN",B.session)),this._returnResult({data:Object.assign({},B),error:b})}catch(B){if(H(B))return this._returnResult({data:{user:null,session:null},error:B});throw B}}async _exchangeCodeForSession(e){const t=await Ht(this.storage,`${this.storageKey}-code-verifier`),[r,n]=(t??"").split("/");try{if(!r&&this.flowType==="pkce")throw new $w;const{data:s,error:i}=await M(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:vt});if(await Qe(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!s||!s.session||!s.user){const o=new ur;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers(n==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:n??null}),error:i})}catch(s){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:t,provider:r,token:n,access_token:s,nonce:i}=e,o=await M(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:s,nonce:i,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:vt}),{data:a,error:l}=o;if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a||!a.session||!a.user){const u=new ur;return this._returnResult({data:{user:null,session:null},error:u})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:l})}catch(t){if(H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async signInWithOtp(e){var t,r,n,s,i;try{if("email"in e){const{email:o,options:a}=e;let l=null,u=null;this.flowType==="pkce"&&([l,u]=await fr(this.storage,this.storageKey));const{error:d}=await M(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(t=a==null?void 0:a.data)!==null&&t!==void 0?t:{},create_user:(r=a==null?void 0:a.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},code_challenge:l,code_challenge_method:u},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in e){const{phone:o,options:a}=e,{data:l,error:u}=await M(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(n=a==null?void 0:a.data)!==null&&n!==void 0?n:{},create_user:(s=a==null?void 0:a.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken},channel:(i=a==null?void 0:a.channel)!==null&&i!==void 0?i:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:u})}throw new vs("You must provide either an email or phone number.")}catch(o){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var t,r;try{let n,s;"options"in e&&(n=(t=e.options)===null||t===void 0?void 0:t.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:i,error:o}=await M(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:n,xform:vt});if(o)throw o;if(!i)throw new Error("An error occurred on token verification.");const a=i.session,l=i.user;return a!=null&&a.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a)),this._returnResult({data:{user:l,session:a},error:null})}catch(n){if(H(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithSSO(e){var t,r,n,s,i;try{let o=null,a=null;this.flowType==="pkce"&&([o,a]=await fr(this.storage,this.storageKey));const l=await M(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&r!==void 0?r:void 0}),!((n=e==null?void 0:e.options)===null||n===void 0)&&n.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:Ax});return!((s=l.data)===null||s===void 0)&&s.url&&ze()&&!(!((i=e.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(l.data.url),this._returnResult(l)}catch(o){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new He;const{error:n}=await M(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:n})})}catch(e){if(H(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:r,type:n,options:s}=e;let i=null,o=null;this.flowType==="pkce"&&([i,o]=await fr(this.storage,this.storageKey));const{error:a}=await M(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken},code_challenge:i,code_challenge_method:o},redirectTo:s==null?void 0:s.emailRedirectTo});return a&&await Qe(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in e){const{phone:r,type:n,options:s}=e,{data:i,error:o}=await M(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:o})}throw new vs("You must provide either an email or phone number and a type")}catch(t){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await r,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=t();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const n=[...this.pendingInLock];await Promise.all(n),this.pendingInLock.splice(0,n.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await Ht(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<Wl:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const i=await Ht(this.userStorage,this.storageKey+"-user");i!=null&&i.user?e.user=i.user:e.user=Zl()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};e.user=Y1(e.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:n,error:s}=await this._callRefreshToken(e.refresh_token);if(s){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const o=await Ht(this.storage,this.storageKey);if(o&&o.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:s})}return this._returnResult({data:{session:n},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let t;return this.lock!=null?t=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):t=await this._getUser(),t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await M(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:DA}):await this._useSession(async t=>{var r,n,s;const{data:i,error:o}=t;if(o)throw o;return!(!((r=i.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new He}:await M(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0,xform:DA})})}catch(t){if(H(t))return Es(t)&&(await this._removeSession(),await Qe(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:t});throw t}}async updateUser(e,t={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t)):await this._updateUser(e,t)}async _updateUser(e,t={}){try{return await this._useSession(async r=>{const{data:n,error:s}=r;if(s)throw s;if(!n.session)throw new He;const i=n.session;let o=null,a=null;this.flowType==="pkce"&&e.email!=null&&([o,a]=await fr(this.storage,this.storageKey));const{data:l,error:u}=await M(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:i.access_token,xform:DA});if(u)throw u;return i.user=l.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(r){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new He;const t=Date.now()/1e3;let r=t,n=!0,s=null;const{payload:i}=Ho(e.access_token);if(i.exp&&(r=i.exp,n=r<=t),n){const{data:o,error:a}=await this._callRefreshToken(e.refresh_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});s={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(t){if(H(t))return this._returnResult({data:{session:null,user:null},error:t});throw t}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){const{data:i,error:o}=t;if(o)throw o;e=(r=i.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new He;const{data:n,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(t){if(H(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async _getSessionFromURL(e,t){var r;try{if(!ze())throw new bs("No browser detected.");if(e.error||e.error_description||e.error_code)throw new bs(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new Jl("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new bs("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Jl("No code detected.");const{data:I,error:R}=await this._exchangeCodeForSession(e.code);if(R)throw R;const K=new URL(window.location.href);return K.searchParams.delete("code"),window.history.replaceState(window.history.state,"",K.toString()),{data:{session:I.session,redirectType:(r=I.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!i||!a||!o||!u)throw new bs("No session defined in URL");const d=Math.round(Date.now()/1e3),g=parseInt(a);let p=d+g;l&&(p=parseInt(l));const w=p-d;w*1e3<=hA&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${g}s`);const y=p-g;d-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,p,d):d-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,p,d);const{data:B,error:b}=await this._getUser(i);if(b)throw b;const S={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:g,expires_at:p,refresh_token:o,token_type:u,user:B.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:S,redirectType:e.type},error:null})}catch(n){if(H(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){const t=await Ht(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;const{data:n,error:s}=t;if(s&&!Es(s))return this._returnResult({error:s});const i=(r=n.session)===null||r===void 0?void 0:r.access_token;if(i){const{error:o}=await this.admin.signOut(i,e);if(o&&!(Vw(o)&&(o.status===404||o.status===401||o.status===403)||Es(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await Qe(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const t=O1(),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)}):await this._emitInitialSession(t)))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{const{data:{session:s},error:i}=t;if(i)throw i;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),Es(s)?console.warn(s):console.error(s)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;this.flowType==="pkce"&&([r,n]=await fr(this.storage,this.storageKey,!0));try{return await M(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(s){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:t,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var t;try{const{data:r,error:n}=await this._useSession(async s=>{var i,o,a,l,u;const{data:d,error:g}=s;if(g)throw g;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(i=e.options)===null||i===void 0?void 0:i.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:!0});return await M(this.fetch,"GET",p,{headers:this.headers,jwt:(u=(l=d.session)===null||l===void 0?void 0:l.access_token)!==null&&u!==void 0?u:void 0})});if(n)throw n;return ze()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(H(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async t=>{var r;try{const{error:n,data:{session:s}}=t;if(n)throw n;const{options:i,provider:o,token:a,access_token:l,nonce:u}=e,d=await M(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:a,access_token:l,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:vt}),{data:g,error:p}=d;return p?this._returnResult({data:{user:null,session:null},error:p}):!g||!g.session||!g.user?this._returnResult({data:{user:null,session:null},error:new ur}):(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("USER_UPDATED",g.session)),this._returnResult({data:g,error:p}))}catch(n){if(await Qe(this.storage,`${this.storageKey}-code-verifier`),H(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{var r,n;const{data:s,error:i}=t;if(i)throw i;return await M(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(n=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&n!==void 0?n:void 0})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _refreshAccessToken(e){const t="#_refreshAccessToken()";this._debug(t,"begin");try{const r=Date.now();return await V1(async n=>(n>0&&await M1(200*Math.pow(2,n-1)),this._debug(t,"refreshing attempt",n),await M(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:vt})),(n,s)=>{const i=200*Math.pow(2,n);return s&&zl(s)&&Date.now()+i-r<hA})}catch(r){if(this._debug(t,"error",r),H(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),ze()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,t;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const n=await Ht(this.storage,this.storageKey);if(n&&this.userStorage){let i=await Ht(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:n.user},await sn(this.userStorage,this.storageKey+"-user",i)),n.user=(e=i==null?void 0:i.user)!==null&&e!==void 0?e:Zl()}else if(n&&!n.user&&!n.user){const i=await Ht(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(n.user=i.user,await Qe(this.storage,this.storageKey+"-user"),await sn(this.storage,this.storageKey,n)):n.user=Zl()}if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}const s=((t=n.expires_at)!==null&&t!==void 0?t:1/0)*1e3-Date.now()<Wl;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${Wl}s`),s){if(this.autoRefreshToken&&n.refresh_token){const{error:i}=await this._callRefreshToken(n.refresh_token);i&&(jw(i)?this._debug(r,"refresh discarded by commit guard",i):this._debug(r,"refresh failed",i))}}else if(n.user&&n.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:o}=await this._getUser(n.access_token);!o&&(i!=null&&i.user)?(n.user=i.user,await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(r,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new He;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const n="#_callRefreshToken()";this._debug(n,"begin");try{this.refreshingDeferred=new Do;const s=await Ht(this.storage,this.storageKey),{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new He;const a=await Ht(this.storage,this.storageKey);if(s!==null&&(a===null||a.refresh_token!==s.refresh_token)){this._debug(n,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:a?"replaced":"cleared"});const g={data:null,error:new Xl};return this.refreshingDeferred.resolve(g),g}const u=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==u){this._debug(n,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await Qe(this.storage,this.storageKey),this.userStorage&&await Qe(this.userStorage,this.storageKey+"-user");const g={data:null,error:new Xl};return this.refreshingDeferred.resolve(g),g}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const d={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(s){if(this._debug(n,"error",s),H(s)){const i={data:null,error:s};if(!zl(s)){const o=await Ht(this.storage,this.storageKey);!!(o!=null&&o.expires_at&&o.expires_at*1e3>Date.now())?this._debug(n,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:i,expiresAt:Date.now()+v1},(t=this.refreshingDeferred)===null||t===void 0||t.resolve(i),i}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){const n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});const s=[],i=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,t)}catch(a){s.push(a)}});if(await Promise.all(i),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Qe(this.storage,`${this.storageKey}-code-verifier`);const t=Object.assign({},e),r=t.user&&t.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&t.user&&await sn(this.userStorage,this.storageKey+"-user",{user:t.user});const n=Object.assign({},t);delete n.user;const s=Yw(n);await sn(this.storage,this.storageKey,s)}else{const n=Yw(t);await sn(this.storage,this.storageKey,n)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Qe(this.storage,this.storageKey),await Qe(this.storage,this.storageKey+"-code-verifier"),await Qe(this.storage,this.storageKey+"-user"),this.userStorage&&await Qe(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&ze()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),hA);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((r.expires_at*1e3-e)/hA);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${hA}ms, refresh threshold is ${_s} ticks`),n<=_s&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof Qs)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async t=>{const{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const n=Math.floor((r.expires_at*1e3-e)/hA);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts ${hA}ms, refresh threshold is ${_s} ticks`),n<=_s&&await this._callRefreshToken(r.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ze()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;if(this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(t,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,r){const n=[`provider=${encodeURIComponent(t)}`];if(r!=null&&r.redirectTo&&n.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&n.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,i]=await fr(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(i)}`});n.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);n.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&n.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${n.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;const{data:n,error:s}=t;return s?this._returnResult({data:null,error:s}):await M(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=n==null?void 0:n.session)===null||r===void 0?void 0:r.access_token})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;const{data:s,error:i}=t;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:a,error:l}=await M(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return l?this._returnResult({data:null,error:l}):(e.factorType==="totp"&&a.type==="totp"&&(!((n=a==null?void 0:a.totp)===null||n===void 0)&&n.qr_code)&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _verify(e){const t=async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?om(e.webauthn.credential_response):am(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await M(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,t):t()}async _challenge(e){const t=async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await M(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:sm(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:im(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,t):t()}async _challengeAndVerify(e){const{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){var e;const{data:{user:t},error:r}=await this.getUser();if(r)return{data:null,error:r};const n={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=t==null?void 0:t.factors)!==null&&e!==void 0?e:[])n.all.push(s),s.status==="verified"&&n[s.factor_type].push(s);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){var t,r,n,s;if(e)try{const{payload:p}=Ho(e);let w=null;p.aal&&(w=p.aal);let y=w;const{data:{user:B},error:b}=await this.getUser(e);if(b)return this._returnResult({data:null,error:b});((r=(t=B==null?void 0:B.factors)===null||t===void 0?void 0:t.filter(R=>R.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(y="aal2");const I=p.amr||[];return{data:{currentLevel:w,nextLevel:y,currentAuthenticationMethods:I},error:null}}catch(p){if(H(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:i},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=Ho(i.access_token);let l=null;a.aal&&(l=a.aal);let u=l;((s=(n=i.user.factors)===null||n===void 0?void 0:n.filter(p=>p.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(u="aal2");const g=a.amr||[];return{data:{currentLevel:l,nextLevel:u,currentAuthenticationMethods:g},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await M(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new He})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _approveAuthorization(e,t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new He});const i=await M(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&ze()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new He});const i=await M(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:n.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return i.data&&i.data.redirect_url&&ze()&&!(t!=null&&t.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;return r?this._returnResult({data:null,error:r}):t?await M(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:n=>({data:n,error:null})}):this._returnResult({data:null,error:new He})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?(await M(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new He})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async fetchJwk(e,t={keys:[]}){let r=t.keys.find(o=>o.kid===e);if(r)return r;const n=Date.now();if(r=this.jwks.keys.find(o=>o.kid===e),r&&this.jwks_cached_at+F1>n)return r;const{data:s,error:i}=await M(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=n,r=s.keys.find(o=>o.kid===e),!r)?null:r}async getClaims(e,t={}){try{let r=e;if(!r){const{data:p,error:w}=await this.getSession();if(w||!p.session)return this._returnResult({data:null,error:w});r=p.session.access_token}const{header:n,payload:s,signature:i,raw:{header:o,payload:a}}=Ho(r);if(!(t!=null&&t.allowExpired))try{J1(s.exp)}catch(p){throw new Us(p instanceof Error?p.message:"JWT validation failed")}const l=!n.alg||n.alg.startsWith("HS")||!n.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(n.kid,t!=null&&t.keys?{keys:t.keys}:t==null?void 0:t.jwks);if(!l){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:s,header:n,signature:i},error:null}}const u=z1(n.alg),d=await crypto.subtle.importKey("jwk",l,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,i,D1(`${o}.${a}`)))throw new Us("Invalid JWT signature");return{data:{claims:s,header:n,signature:i},error:null}}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(e){var t,r,n;Ot(this.experimental);try{if(!No())return this._returnResult({data:null,error:new Et("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.captchaToken}});if(i||!s)return this._returnResult({data:null,error:i});const o=im(s.options),a=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:Au.createNewAbortSignal(),{data:l,error:u}=await um({publicKey:o,signal:a});if(u||!l)return this._returnResult({data:null,error:u??new Et("WebAuthn ceremony failed",null)});const d=am(l);return this._verifyPasskeyAuthentication({challengeId:s.challenge_id,credential:d})}catch(s){if(H(s))return this._returnResult({data:null,error:s});throw s}}async registerPasskey(e){var t,r;Ot(this.experimental);try{if(!No())return this._returnResult({data:null,error:new Et("Browser does not support WebAuthn",null)});const{data:n,error:s}=await this._startPasskeyRegistration();if(s||!n)return this._returnResult({data:null,error:s});const i=sm(n.options),o=(r=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.signal)!==null&&r!==void 0?r:Au.createNewAbortSignal(),{data:a,error:l}=await lm({publicKey:i,signal:o});if(l||!a)return this._returnResult({data:null,error:l??new Et("WebAuthn ceremony failed",null)});const u=om(a);return this._verifyPasskeyRegistration({challengeId:n.challenge_id,credential:u})}catch(n){if(H(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyRegistration(){Ot(this.experimental);try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new He});const{data:n,error:s}=await M(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Ot(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new He});const{data:s,error:i}=await M(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _startPasskeyAuthentication(e){var t;Ot(this.experimental);try{const{data:r,error:n}=await M(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:r,error:null})}catch(r){if(H(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(e){Ot(this.experimental);try{const{data:t,error:r}=await M(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:vt});return r?this._returnResult({data:null,error:r}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers("SIGNED_IN",t.session)),this._returnResult({data:t,error:null}))}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _listPasskeys(){Ot(this.experimental);try{return await this._useSession(async e=>{const{data:{session:t},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!t)return this._returnResult({data:null,error:new He});const{data:n,error:s}=await M(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:i=>({data:i,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})})}catch(e){if(H(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Ot(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new He});const{data:s,error:i}=await M(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}async _deletePasskey(e){Ot(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new He});const{error:s}=await M(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(t){if(H(t))return this._returnResult({data:null,error:t});throw t}}}an.nextInstanceID={};const Cx=eu,hm=an,_x="2.108.2";let Is="",Vo;if(typeof Deno<"u"){var ru;Is="deno",Vo=(ru=Deno.version)===null||ru===void 0?void 0:ru.deno}else if(typeof document<"u")Is="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Is="react-native";else{var nu;Is="node",Vo=typeof process<"u"?(nu=process.version)===null||nu===void 0?void 0:nu.replace(/^v/,""):void 0}const dm=[`runtime=${Is}`];Vo&&dm.push(`runtime-version=${Vo}`);const Ex={headers:{"X-Client-Info":`supabase-js/${_x}; ${dm.join("; ")}`}},vx={schema:"public"},bx={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Ux={},Qx={enabled:!1,respectSamplingDecision:!0};function Ix(A,e,t,r){function n(s){return s instanceof t?s:new t(function(i){i(s)})}return new(t||(t=Promise))(function(s,i){function o(u){try{l(r.next(u))}catch(d){i(d)}}function a(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):n(u.value).then(o,a)}l((r=r.apply(A,[])).next())})}let su=null;const Fx="@opentelemetry/api";function Tx(){return su===null&&(su=import(Fx).catch(()=>null)),su}function Sx(){return Ix(this,void 0,void 0,function*(){try{const A=yield Tx();if(!A||!A.propagation||!A.context)return null;const e={};A.propagation.inject(A.context.active(),e);const t=e.traceparent;return t?{traceparent:t,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function Rx(A){if(!A||typeof A!="string")return null;const e=A.split("-");if(e.length!==4)return null;const[t,r,n,s]=e;if(t.length!==2||r.length!==32||n.length!==16||s.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(t)||!i.test(r)||!i.test(n)||!i.test(s)||r==="00000000000000000000000000000000"||n==="0000000000000000"?null:{version:t,traceId:r,parentId:n,traceFlags:s,isSampled:(parseInt(s,16)&1)===1}}function xx(A,e){if(!A||!e||e.length===0)return!1;let t;if(A instanceof URL)t=A;else try{t=new URL(A)}catch{return!1}for(const r of e)try{if(typeof r=="string"){if(kx(t.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(t.hostname))return!0}else if(typeof r=="function"&&r(t))return!0}catch{continue}return!1}function kx(A,e){if(e===A)return!0;if(e.startsWith("*.")){const t=e.slice(2);if(A.endsWith(t)&&(A===t||A.endsWith("."+t)))return!0}return!1}function Lx(A){const e=[];try{const t=new URL(A);e.push(t.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function Fs(A){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fs(A)}function Dx(A,e){if(Fs(A)!="object"||!A)return A;var t=A[Symbol.toPrimitive];if(t!==void 0){var r=t.call(A,e);if(Fs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(A)}function Hx(A){var e=Dx(A,"string");return Fs(e)=="symbol"?e:e+""}function Ox(A,e,t){return(e=Hx(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function fm(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(A);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(A,n).enumerable})),t.push.apply(t,r)}return t}function ye(A){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?fm(Object(t),!0).forEach(function(r){Ox(A,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):fm(Object(t)).forEach(function(r){Object.defineProperty(A,r,Object.getOwnPropertyDescriptor(t,r))})}return A}const Px=A=>A?(...e)=>A(...e):(...e)=>fetch(...e),Nx=()=>Headers,Mx=(A,e,t,r,n)=>{const s=Px(r),i=Nx(),o=(n==null?void 0:n.enabled)===!0,a=(n==null?void 0:n.respectSamplingDecision)!==!1,l=o?Lx(e):null;return async(u,d)=>{var g;const p=(g=await t())!==null&&g!==void 0?g:A;let w=new i(d==null?void 0:d.headers);if(w.has("apikey")||w.set("apikey",A),w.has("Authorization")||w.set("Authorization",`Bearer ${p}`),l){const y=await Vx(u,l,a);y&&(y.traceparent&&!w.has("traceparent")&&w.set("traceparent",y.traceparent),y.tracestate&&!w.has("tracestate")&&w.set("tracestate",y.tracestate),y.baggage&&!w.has("baggage")&&w.set("baggage",y.baggage))}return s(u,ye(ye({},d),{},{headers:w}))}};async function Vx(A,e,t){if(!xx(typeof A=="string"||A instanceof URL?A:A.url,e))return null;const r=await Sx();if(!r||!r.traceparent)return null;if(t){const n=Rx(r.traceparent);if(n&&!n.isSampled)return null}return r}function gm(A){return typeof A=="boolean"?{enabled:A}:A}function Kx(A){return A.endsWith("/")?A:A+"/"}function $x(A,e){var t,r,n,s,i,o;const{db:a,auth:l,realtime:u,global:d}=A,{db:g,auth:p,realtime:w,global:y}=e,B=gm(A.tracePropagation),b=gm(e.tracePropagation),S={db:ye(ye({},g),a),auth:ye(ye({},p),l),realtime:ye(ye({},w),u),storage:{},global:ye(ye(ye({},y),d),{},{headers:ye(ye({},(t=y==null?void 0:y.headers)!==null&&t!==void 0?t:{}),(r=d==null?void 0:d.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(n=(s=B==null?void 0:B.enabled)!==null&&s!==void 0?s:b==null?void 0:b.enabled)!==null&&n!==void 0?n:!1,respectSamplingDecision:(i=(o=B==null?void 0:B.respectSamplingDecision)!==null&&o!==void 0?o:b==null?void 0:b.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return A.accessToken?S.accessToken=A.accessToken:delete S.accessToken,S}function jx(A){const e=A==null?void 0:A.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Kx(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Gx=class extends hm{constructor(A){super(A)}},pm=class{constructor(A,e,t){var r,n;this.supabaseUrl=A,this.supabaseKey=e;const s=jx(A);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const i=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:vx,realtime:Ux,auth:ye(ye({},bx),{},{storageKey:i}),global:Ex,tracePropagation:Qx},a=$x(t??{},o);if(this.settings=a,this.storageKey=(r=a.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(n=a.global.headers)!==null&&n!==void 0?n:{},a.accessToken)this.accessToken=a.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var l;this.auth=this._initSupabaseAuthClient((l=a.auth)!==null&&l!==void 0?l:{},this.headers,a.global.fetch)}this.fetch=Mx(e,A,this._getAccessToken.bind(this),a.global.fetch,a.tracePropagation),this.realtime=this._initRealtimeClient(ye({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},a.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new fR(new URL("rest/v1",s).href,{headers:this.headers,schema:a.db.schema,fetch:this.fetch,timeout:a.db.timeout,urlLengthLimit:a.db.urlLengthLimit}),this.storage=new E1(this.storageUrl.href,this.headers,this.fetch,t==null?void 0:t.storage),a.accessToken||this._listenForAuthEvents()}get functions(){return new sR(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(A){return this.rest.from(A)}schema(A){return this.rest.schema(A)}rpc(A,e={},t={head:!1,get:!1,count:void 0}){return this.rest.rpc(A,e,t)}channel(A,e={config:{}}){return this.realtime.channel(A,e)}getChannels(){return this.realtime.getChannels()}removeChannel(A){return this.realtime.removeChannel(A)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var A=this,e,t;if(A.accessToken)return await A.accessToken();const{data:r}=await A.auth.getSession();return(e=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&e!==void 0?e:A.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:A,persistSession:e,detectSessionInUrl:t,storage:r,userStorage:n,storageKey:s,flowType:i,lock:o,debug:a,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:g},p,w){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Gx({url:this.authUrl.href,headers:ye(ye({},y),p),storageKey:s,autoRefreshToken:A,persistSession:e,detectSessionInUrl:t,storage:r,userStorage:n,flowType:i,lock:o,debug:a,throwOnError:l,experimental:u,fetch:w,lockAcquireTimeout:d,skipAutoInitialize:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(B=>B.toLowerCase()==="authorization")})}_initRealtimeClient(A){return new Sw(this.realtimeUrl.href,ye(ye({},A),{},{params:ye(ye({},{apikey:this.supabaseKey}),A==null?void 0:A.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((A,e)=>{this._handleTokenChanged(A,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(A,e,t){(A==="TOKEN_REFRESHED"||A==="SIGNED_IN")&&this.changedAccessToken!==t?(this.changedAccessToken=t,this.realtime.setAuth(t)):A==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Wx=(A,e,t)=>new pm(A,e,t);function qx(){if(typeof window<"u")return!1;const A=globalThis.process;if(!A)return!1;const e=A.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}qx()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Jx=Object.freeze(Object.defineProperty({__proto__:null,AuthAdminApi:Cx,AuthApiError:Mw,AuthClient:hm,AuthError:rn,AuthImplicitGrantRedirectError:bs,AuthInvalidCredentialsError:vs,AuthInvalidJwtError:Us,AuthInvalidTokenResponseError:ur,AuthPKCECodeVerifierMissingError:$w,AuthPKCEGrantCodeExchangeError:Jl,AuthRefreshDiscardedError:Xl,AuthRetryableFetchError:ko,AuthSessionMissingError:He,AuthUnknownError:Et,AuthWeakPasswordError:Yl,CustomAuthError:Dt,get FunctionRegion(){return Eo},FunctionsError:_o,FunctionsFetchError:fw,FunctionsHttpError:Dl,FunctionsRelayError:Ll,GoTrueAdminApi:eu,GoTrueClient:an,NavigatorLockAcquireTimeoutError:tu,PostgrestError:Hl,REALTIME_CHANNEL_STATES:MR,get REALTIME_LISTEN_TYPES(){return lr},get REALTIME_POSTGRES_CHANGES_LISTEN_EVENT(){return Kl},get REALTIME_PRESENCE_LISTEN_EVENTS(){return Vl},get REALTIME_SUBSCRIBE_STATES(){return eA},RealtimeChannel:en,RealtimeClient:Sw,RealtimePresence:Fw,SIGN_OUT_SCOPES:Oo,StorageApiError:Ro,SupabaseClient:pm,WebSocketFactory:Cw,createClient:Wx,isAuthApiError:Vw,isAuthError:H,isAuthImplicitGrantRedirectError:Kw,isAuthPKCECodeVerifierMissingError:T1,isAuthRefreshDiscardedError:jw,isAuthRetryableFetchError:zl,isAuthSessionMissingError:Es,isAuthWeakPasswordError:S1,lockInternals:Pt,navigatorLock:ix,processLock:ox},Symbol.toStringTag,{value:"Module"}));mt.initFeedbackPlugin=MB,Object.defineProperty(mt,Symbol.toStringTag,{value:"Module"})});
3024
3024
  //# sourceMappingURL=ui-feedback-plugin.umd.js.map