var Cl=Object.create;var bn=Object.defineProperty;var El=Object.getOwnPropertyDescriptor;var Ml=Object.getOwnPropertyNames;var Al=Object.getPrototypeOf,_l=Object.prototype.hasOwnProperty;var Vr=(e,t)=>()=>(e&&(t=e(e=0)),t);var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ll=(e,t)=>{for(var n in t)bn(e,n,{get:t[n],enumerable:!0})},kl=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ml(t))!_l.call(e,o)&&o!==n&&bn(e,o,{get:()=>t[o],enumerable:!(r=El(t,o))||r.enumerable});return e};var At=(e,t,n)=>(n=e!=null?Cl(Al(e)):{},kl(t||!e||!e.__esModule?bn(n,"default",{value:e,enumerable:!0}):n,e));var jr=z(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.createChannel=void 0;var vn=class{constructor(t){this.targetOrigin=null,this.started=!1,this.handleMessage=async n=>{if(n.source!==this.target)return;let{type:r,data:o,__requestId:i,__responseId:a}=n.data;if(a){let s=this.pendingRequests.get(a);s&&(s(o),this.pendingRequests.delete(a));return}let l=this.handlers.get(r);if(!l){this.unhandledMessages.push(n),this.unhandledMessages.length>100&&this.unhandledMessages.shift();return}if(i)try{let s=await Promise.resolve(l(o));this.target.postMessage({__responseId:i,data:s??void 0},"*")}catch(s){console.error("[channel] Error handling message:",s)}else l(o)},this.target=t;try{this.targetOrigin=new URL(t.location.href).origin}catch{this.targetOrigin=null}this.handlers=new Map,this.pendingRequests=new Map,this.unhandledMessages=[]}isStale(){try{if(this.target.closed)return!0;let t=new URL(this.target.location.href).origin;return this.targetOrigin!==null&&t!==this.targetOrigin}catch{return this.targetOrigin!==null}}send(t,n){let r={type:t};return n&&(r.data=n),new Promise(o=>{let i=Math.random().toString(36).substring(2);this.pendingRequests.set(i,o),r.__requestId=i,this.target.postMessage(r,"*")})}on(t,n){this.handlers.set(t,n);let r=this.unhandledMessages.filter(o=>o.data.type===t);this.unhandledMessages=this.unhandledMessages.filter(o=>o.data.type!==t);for(let o of r){let{data:i,__requestId:a}=o.data;a?Promise.resolve(n(i)).then(l=>{this.target.postMessage({__responseId:a,data:l??void 0},"*")}).catch(l=>{console.error("[channel] Error replaying buffered message:",l)}):n(i)}}start(){this.started||(window.addEventListener("message",this.handleMessage),this.started=!0)}destroy(){window.removeEventListener("message",this.handleMessage),this.handlers.clear(),this.pendingRequests.clear(),this.unhandledMessages=[],this.started=!1}},Il=e=>new vn(e);_t.createChannel=Il});var so=z(An=>{var lo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");An.encode=function(e){if(0<=e&&e{var co=so(),_n=5,uo=1<<_n,fo=uo-1,ho=uo;function Zl(e){return e<0?(-e<<1)+1:(e<<1)+0}function Kl(e){var t=(e&1)===1,n=e>>1;return t?-n:n}Ln.encode=function(t){var n="",r,o=Zl(t);do r=o&fo,o>>>=_n,o>0&&(r|=ho),n+=co.encode(r);while(o>0);return n};Ln.decode=function(t,n,r){var o=t.length,i=0,a=0,l,s;do{if(n>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(s=co.decode(t.charCodeAt(n++)),s===-1)throw new Error("Invalid base64 digit: "+t.charAt(n-1));l=!!(s&ho),s&=fo,i=i+(s<{function Ql(e,t,n){if(t in e)return e[t];if(arguments.length===3)return n;throw new Error('"'+t+'" is a required argument.')}U.getArg=Ql;var mo=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Jl=/^data:.+\,.+$/;function et(e){var t=e.match(mo);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}U.urlParse=et;function $e(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}U.urlGenerate=$e;function Tn(e){var t=e,n=et(e);if(n){if(!n.path)return e;t=n.path}for(var r=U.isAbsolute(t),o=t.split(/\/+/),i,a=0,l=o.length-1;l>=0;l--)i=o[l],i==="."?o.splice(l,1):i===".."?a++:a>0&&(i===""?(o.splice(l+1,a),a=0):(o.splice(l,2),a--));return t=o.join("/"),t===""&&(t=r?"/":"."),n?(n.path=t,$e(n)):t}U.normalize=Tn;function po(e,t){e===""&&(e="."),t===""&&(t=".");var n=et(t),r=et(e);if(r&&(e=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),$e(n);if(n||t.match(Jl))return t;if(r&&!r.host&&!r.path)return r.host=t,$e(r);var o=t.charAt(0)==="/"?t:Tn(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=o,$e(r)):o}U.join=po;U.isAbsolute=function(e){return e.charAt(0)==="/"||mo.test(e)};function es(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var n=0;t.indexOf(e+"/")!==0;){var r=e.lastIndexOf("/");if(r<0||(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/)))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}U.relative=es;var go=function(){var e=Object.create(null);return!("__proto__"in e)}();function yo(e){return e}function ts(e){return wo(e)?"$"+e:e}U.toSetString=go?yo:ts;function ns(e){return wo(e)?e.slice(1):e}U.fromSetString=go?yo:ns;function wo(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var n=t-10;n>=0;n--)if(e.charCodeAt(n)!==36)return!1;return!0}function rs(e,t,n){var r=Re(e.source,t.source);return r!==0||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0||n)||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=e.generatedLine-t.generatedLine,r!==0)?r:Re(e.name,t.name)}U.compareByOriginalPositions=rs;function os(e,t,n){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0||n)||(r=Re(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Re(e.name,t.name)}U.compareByGeneratedPositionsDeflated=os;function Re(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function is(e,t){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=Re(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:Re(e.name,t.name)}U.compareByGeneratedPositionsInflated=is;function as(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}U.parseSourceMapInput=as;function ls(e,t,n){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),n){var r=et(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var o=r.path.lastIndexOf("/");o>=0&&(r.path=r.path.substring(0,o+1))}t=po($e(r),t)}return Tn(t)}U.computeSourceURL=ls});var $n=z(bo=>{var On=Ne(),In=Object.prototype.hasOwnProperty,Ee=typeof Map<"u";function ae(){this._array=[],this._set=Ee?new Map:Object.create(null)}ae.fromArray=function(t,n){for(var r=new ae,o=0,i=t.length;o=0)return n}else{var r=On.toSetString(t);if(In.call(this._set,r))return this._set[r]}throw new Error('"'+t+'" is not in the set.')};ae.prototype.at=function(t){if(t>=0&&t{var vo=Ne();function ss(e,t){var n=e.generatedLine,r=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return r>n||r==n&&i>=o||vo.compareByGeneratedPositionsInflated(e,t)<=0}function Ot(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ot.prototype.unsortedForEach=function(t,n){this._array.forEach(t,n)};Ot.prototype.add=function(t){ss(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Ot.prototype.toArray=function(){return this._sorted||(this._array.sort(vo.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};So.MappingList=Ot});var Rn=z(Co=>{var tt=kn(),H=Ne(),It=$n().ArraySet,cs=xo().MappingList;function j(e){e||(e={}),this._file=H.getArg(e,"file",null),this._sourceRoot=H.getArg(e,"sourceRoot",null),this._skipValidation=H.getArg(e,"skipValidation",!1),this._sources=new It,this._names=new It,this._mappings=new cs,this._sourcesContents=null}j.prototype._version=3;j.fromSourceMap=function(t){var n=t.sourceRoot,r=new j({file:t.file,sourceRoot:n});return t.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,n!=null&&(i.source=H.relative(n,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),r.addMapping(i)}),t.sources.forEach(function(o){var i=o;n!==null&&(i=H.relative(n,o)),r._sources.has(i)||r._sources.add(i);var a=t.sourceContentFor(o);a!=null&&r.setSourceContent(o,a)}),r};j.prototype.addMapping=function(t){var n=H.getArg(t,"generated"),r=H.getArg(t,"original",null),o=H.getArg(t,"source",null),i=H.getArg(t,"name",null);this._skipValidation||this._validateMapping(n,r,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:o,name:i})};j.prototype.setSourceContent=function(t,n){var r=t;this._sourceRoot!=null&&(r=H.relative(this._sourceRoot,r)),n!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[H.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[H.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};j.prototype.applySourceMap=function(t,n,r){var o=n;if(n==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=H.relative(i,o));var a=new It,l=new It;this._mappings.unsortedForEach(function(s){if(s.source===o&&s.originalLine!=null){var c=t.originalPositionFor({line:s.originalLine,column:s.originalColumn});c.source!=null&&(s.source=c.source,r!=null&&(s.source=H.join(r,s.source)),i!=null&&(s.source=H.relative(i,s.source)),s.originalLine=c.line,s.originalColumn=c.column,c.name!=null&&(s.name=c.name))}var u=s.source;u!=null&&!a.has(u)&&a.add(u);var f=s.name;f!=null&&!l.has(f)&&l.add(f)},this),this._sources=a,this._names=l,t.sources.forEach(function(s){var c=t.sourceContentFor(s);c!=null&&(r!=null&&(s=H.join(r,s)),i!=null&&(s=H.relative(i,s)),this.setSourceContent(s,c))},this)};j.prototype._validateMapping=function(t,n,r,o){if(n&&typeof n.line!="number"&&typeof n.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!n&&!r&&!o)){if(t&&"line"in t&&"column"in t&&n&&"line"in n&&"column"in n&&t.line>0&&t.column>=0&&n.line>0&&n.column>=0&&r)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:r,original:n,name:o}))}};j.prototype._serializeMappings=function(){for(var t=0,n=1,r=0,o=0,i=0,a=0,l="",s,c,u,f,d=this._mappings.toArray(),p=0,m=d.length;p0){if(!H.compareByGeneratedPositionsInflated(c,d[p-1]))continue;s+=","}s+=tt.encode(c.generatedColumn-t),t=c.generatedColumn,c.source!=null&&(f=this._sources.indexOf(c.source),s+=tt.encode(f-a),a=f,s+=tt.encode(c.originalLine-1-o),o=c.originalLine-1,s+=tt.encode(c.originalColumn-r),r=c.originalColumn,c.name!=null&&(u=this._names.indexOf(c.name),s+=tt.encode(u-i),i=u)),l+=s}return l};j.prototype._generateSourcesContent=function(t,n){return t.map(function(r){if(!this._sourcesContents)return null;n!=null&&(r=H.relative(n,r));var o=H.toSetString(r);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};j.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};j.prototype.toString=function(){return JSON.stringify(this.toJSON())};Co.SourceMapGenerator=j});var Eo=z(Me=>{Me.GREATEST_LOWER_BOUND=1;Me.LEAST_UPPER_BOUND=2;function Nn(e,t,n,r,o,i){var a=Math.floor((t-e)/2)+e,l=o(n,r[a],!0);return l===0?a:l>0?t-a>1?Nn(a,t,n,r,o,i):i==Me.LEAST_UPPER_BOUND?t1?Nn(e,a,n,r,o,i):i==Me.LEAST_UPPER_BOUND?a:e<0?-1:e}Me.search=function(t,n,r,o){if(n.length===0)return-1;var i=Nn(-1,n.length,t,n,r,o||Me.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&r(n[i],n[i-1],!0)===0;)--i;return i}});var Ao=z(Mo=>{function Pn(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function us(e,t){return Math.round(e+Math.random()*(t-e))}function Fn(e,t,n,r){if(n{var E=Ne(),zn=Eo(),Pe=$n().ArraySet,ds=kn(),nt=Ao().quickSort;function I(e,t){var n=e;return typeof e=="string"&&(n=E.parseSourceMapInput(e)),n.sections!=null?new K(n,t):new B(n,t)}I.fromSourceMap=function(e,t){return B.fromSourceMap(e,t)};I.prototype._version=3;I.prototype.__generatedMappings=null;Object.defineProperty(I.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});I.prototype.__originalMappings=null;Object.defineProperty(I.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});I.prototype._charIsMappingSeparator=function(t,n){var r=t.charAt(n);return r===";"||r===","};I.prototype._parseMappings=function(t,n){throw new Error("Subclasses must implement _parseMappings")};I.GENERATED_ORDER=1;I.ORIGINAL_ORDER=2;I.GREATEST_LOWER_BOUND=1;I.LEAST_UPPER_BOUND=2;I.prototype.eachMapping=function(t,n,r){var o=n||null,i=r||I.GENERATED_ORDER,a;switch(i){case I.GENERATED_ORDER:a=this._generatedMappings;break;case I.ORIGINAL_ORDER:a=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var l=this.sourceRoot;a.map(function(s){var c=s.source===null?null:this._sources.at(s.source);return c=E.computeSourceURL(l,c,this._sourceMapURL),{source:c,generatedLine:s.generatedLine,generatedColumn:s.generatedColumn,originalLine:s.originalLine,originalColumn:s.originalColumn,name:s.name===null?null:this._names.at(s.name)}},this).forEach(t,o)};I.prototype.allGeneratedPositionsFor=function(t){var n=E.getArg(t,"line"),r={source:E.getArg(t,"source"),originalLine:n,originalColumn:E.getArg(t,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var o=[],i=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",E.compareByOriginalPositions,zn.LEAST_UPPER_BOUND);if(i>=0){var a=this._originalMappings[i];if(t.column===void 0)for(var l=a.originalLine;a&&a.originalLine===l;)o.push({line:E.getArg(a,"generatedLine",null),column:E.getArg(a,"generatedColumn",null),lastColumn:E.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i];else for(var s=a.originalColumn;a&&a.originalLine===n&&a.originalColumn==s;)o.push({line:E.getArg(a,"generatedLine",null),column:E.getArg(a,"generatedColumn",null),lastColumn:E.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i]}return o};$t.SourceMapConsumer=I;function B(e,t){var n=e;typeof e=="string"&&(n=E.parseSourceMapInput(e));var r=E.getArg(n,"version"),o=E.getArg(n,"sources"),i=E.getArg(n,"names",[]),a=E.getArg(n,"sourceRoot",null),l=E.getArg(n,"sourcesContent",null),s=E.getArg(n,"mappings"),c=E.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);a&&(a=E.normalize(a)),o=o.map(String).map(E.normalize).map(function(u){return a&&E.isAbsolute(a)&&E.isAbsolute(u)?E.relative(a,u):u}),this._names=Pe.fromArray(i.map(String),!0),this._sources=Pe.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map(function(u){return E.computeSourceURL(a,u,t)}),this.sourceRoot=a,this.sourcesContent=l,this._mappings=s,this._sourceMapURL=t,this.file=c}B.prototype=Object.create(I.prototype);B.prototype.consumer=I;B.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=E.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var n;for(n=0;n1&&(h.source=l+y[1],l+=y[1],h.originalLine=i+y[2],i=h.originalLine,h.originalLine+=1,h.originalColumn=a+y[3],a=h.originalColumn,y.length>4&&(h.name=s+y[4],s+=y[4])),m.push(h),typeof h.originalLine=="number"&&p.push(h)}nt(m,E.compareByGeneratedPositionsDeflated),this.__generatedMappings=m,nt(p,E.compareByOriginalPositions),this.__originalMappings=p};B.prototype._findMapping=function(t,n,r,o,i,a){if(t[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[r]);if(t[o]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[o]);return zn.search(t,n,i,a)};B.prototype.computeColumnSpans=function(){for(var t=0;t=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=E.getArg(o,"source",null);i!==null&&(i=this._sources.at(i),i=E.computeSourceURL(this.sourceRoot,i,this._sourceMapURL));var a=E.getArg(o,"name",null);return a!==null&&(a=this._names.at(a)),{source:i,line:E.getArg(o,"originalLine",null),column:E.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}};B.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};B.prototype.sourceContentFor=function(t,n){if(!this.sourcesContent)return null;var r=this._findSourceIndex(t);if(r>=0)return this.sourcesContent[r];var o=t;this.sourceRoot!=null&&(o=E.relative(this.sourceRoot,o));var i;if(this.sourceRoot!=null&&(i=E.urlParse(this.sourceRoot))){var a=o.replace(/^file:\/\//,"");if(i.scheme=="file"&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!i.path||i.path=="/")&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(n)return null;throw new Error('"'+o+'" is not in the SourceMap.')};B.prototype.generatedPositionFor=function(t){var n=E.getArg(t,"source");if(n=this._findSourceIndex(n),n<0)return{line:null,column:null,lastColumn:null};var r={source:n,originalLine:E.getArg(t,"line"),originalColumn:E.getArg(t,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",E.compareByOriginalPositions,E.getArg(t,"bias",I.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:E.getArg(i,"generatedLine",null),column:E.getArg(i,"generatedColumn",null),lastColumn:E.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};$t.BasicSourceMapConsumer=B;function K(e,t){var n=e;typeof e=="string"&&(n=E.parseSourceMapInput(e));var r=E.getArg(n,"version"),o=E.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new Pe,this._names=new Pe;var i={line:-1,column:0};this._sections=o.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var l=E.getArg(a,"offset"),s=E.getArg(l,"line"),c=E.getArg(l,"column");if(s{var fs=Rn().SourceMapGenerator,Rt=Ne(),hs=/(\r?\n)/,ms=10,Fe="$$$isSourceNode$$$";function G(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=n??null,this.name=o??null,this[Fe]=!0,r!=null&&this.add(r)}G.fromStringWithSourceMap=function(t,n,r){var o=new G,i=t.split(hs),a=0,l=function(){var d=m(),p=m()||"";return d+p;function m(){return a=0;n--)this.prepend(t[n]);else if(t[Fe]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};G.prototype.walk=function(t){for(var n,r=0,o=this.children.length;r0){for(n=[],r=0;r{Nt.SourceMapGenerator=Rn().SourceMapGenerator;Nt.SourceMapConsumer=Lo().SourceMapConsumer;Nt.SourceNode=To().SourceNode});var $o=z((gf,Io)=>{"use strict";Io.exports=class ee{constructor(t){try{t(n=>{this.setValue(n,!1)},n=>{this.setValue(n,!0)})}catch(n){this.setValue(n,!0)}}setValue(t,n){this.val=t instanceof ee?t.val:t,this.rejected=n||(t instanceof ee?t.rejected:!1)}static valueFrom(t){if(t instanceof ee){if(t.rejected)throw t.val;return t.val}else return t}then(t){try{if(!this.rejected)return ee.resolve(t(this.val))}catch(n){return ee.reject(n)}return this}catch(t){try{if(this.rejected)return ee.resolve(t(this.val))}catch(n){return ee.reject(n)}return this}static resolve(t){return new ee(n=>{n(t)})}static reject(t){return new ee((n,r)=>{r(t)})}}});var Po=z((yf,No)=>{"use strict";var Ro=typeof window<"u"&&window.window===window&&window.navigator,ps=Ro?window.location.href:process.cwd(),gs=new RegExp("^((https|http)://)?[a-z0-9A-Z]{3}.[a-z0-9A-Z][a-z0-9A-Z]{0,61}?[a-z0-9A-Z].com|net|cn|cc (:s[0-9]{1-4})?/$"),le=No.exports={concat(e,t){let n=e[e.length-1]==="/",r=t[0]==="/";return e+(n||r?"":"/")+(n&&r?t.substring(1):t)},resolve(e){return le.isAbsolute(e)?le.normalize(e):le.normalize(le.concat(ps,e))},normalize(e){let t=[],n=0;e.split("/").reverse().filter(o=>o!==".").forEach(o=>{o===".."?n++:n===0?t.push(o):n--});let r=t.reverse().join("/");return(Ro&&r[0]==="/"?r[1]==="/"?window.location.protocol:window.location.origin:"")+r},isData:e=>e.indexOf("data:")===0,isURL:e=>gs.test(e),isAbsolute:e=>e[0]==="/"||/^[^\/]*:/.test(e),relativeToFile(e,t){return le.isData(e)||le.isAbsolute(t)?le.normalize(t):le.normalize(le.concat(e.split("/").slice(0,-1).join("/"),t))}}});var zo=z((wf,Fo)=>{"use strict";Fo.exports=ys;function ys(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");for(var n=e.substring(5,t).split(";"),r=n[0]||"text/plain",o=r,i=!1,a="",l=1;l{"use strict";var{assign:ze}=Object,Dn=typeof window<"u"&&window.window===window&&window.navigator,ws=Oo().SourceMapConsumer,Pt=$o(),Hn=Po(),bs=zo(),Do=Dn?null:Ft.require,Ho=e=>{let t=n=>n in t.cache?t.cache[n]:t.cache[n]=e(n);return t.forgetEverything=()=>{t.cache=Object.create(null)},t.cache=Object.create(null),t};function Wo(e,t){let n=t?Pt:Promise,r=Ho(l=>o(l,e(l)));function o(l,s){return s===void 0?r(Hn.resolve(l)):n.resolve(s).then(c=>{let u,f,d,p=m=>(d=d||i(u))(m);return u={path:l,text:c,get lines(){return f=f||c.split(` `)},resolve(m){let h=p(m);if(t)try{return Pt.valueFrom(h)}catch(g){return ze({},m,{error:g})}else return Promise.resolve(h)},_resolve:p}})}function i(l){let s=/\u0023 sourceMappingURL=(.+)\n?/g,c;for(;;){let d=s.exec(l.text);if(d)c=d;else break}let u=c&&c[1],f=d=>ze({},d,{sourceFile:l,sourceLine:l.lines[d.line-1]||""});return u?a(l.path,u,f):f}function a(l,s,c){let u=s.startsWith("data:")?o(l,bs(s).toString()):o(Hn.relativeToFile(l,s)),f=u.then(p=>ws(JSON.parse(p.text))),d=Ho(function(m){return u.then(h=>{let g=Hn.relativeToFile(h.path,m);return f.then(y=>o(g,y.sourceContentFor(m,!0)||void 0))})});return p=>f.then(m=>{let h=m.originalPositionFor(p);return h.source?d(h.source).then(g=>g._resolve(ze({},p,{line:h.line,column:h.column+1,name:h.name}))):c(p)}).catch(m=>ze(c(p),{sourceMapError:m}))}return ze(function(s){let c=o(s);if(t)try{return Pt.valueFrom(c)}catch(u){let f={path:s,text:"",lines:[],error:u,resolve(d){return ze({},d,{error:u,sourceLine:"",sourceFile:f})}};return f}return c},{resetCache:()=>r.forgetEverything(),getCache:()=>r.cache})}Ft.exports=Wo(function(t){return new Pt(n=>{if(Dn){let r=new XMLHttpRequest;r.open("GET",t,!1),r.send(null),n(r.responseText)}else n(Do("fs").readFileSync(t,{encoding:"utf8"}))})},!0);Ft.exports.async=Wo(function(t){return new Promise((n,r)=>{if(Dn){let o=new XMLHttpRequest;o.open("GET",t),o.onreadystatechange=i=>{o.readyState===4&&(o.status===200?n(o.responseText):r(new Error(o.statusText)))},o.send(null)}else Do("fs").readFile(t,{encoding:"utf8"},(o,i)=>{o?r(o):n(i)})})})});var Uo=z((vf,Bo)=>{"use strict";Bo.exports=(e,t)=>{let n=e||[],r=[],o={label:void 0,items:[n.first]};return n.forEach(i=>{let a=t(i);o.label!==a&&o.items.length?r.push(o={label:a,items:[i]}):o.items.push(i)}),r}});var Go=z((Sf,Un)=>{"use strict";var vs=function(){function e(t,n){var r=[],o=!0,i=!1,a=void 0;try{for(var l=t[Symbol.iterator](),s;!(o=(s=l.next()).done)&&(r.push(s.value),!(n&&r.length===n));o=!0);}catch(c){i=!0,a=c}finally{try{!o&&l.return&&l.return()}finally{if(i)throw a}}return r}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),zt="[\x1B\x9B][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]",Vo="\0-\b\v-\x1B\x9B\xAD\u200B\u2028\u2029\uFEFF\uFE00-\uFE0F",Bn=` `+Vo,Ss=new RegExp("(?:"+zt+")|["+Vo+"]","g"),Wn=new RegExp("(?:"+zt+")|["+Bn+"]","g"),qn=new RegExp("((?:"+zt+")|[ "+Bn+"])?([^ "+Bn+"]*)","g");Un.exports={zeroWidthCharacters:Wn,ansiEscapeCodes:new RegExp(zt,"g"),strlen:e=>Array.from(e.replace(Wn,"")).length,isBlank:e=>e.replace(Wn,"").replace(/\s/g,"").length===0,blank:e=>Array.from(e.replace(Ss,"")).map(t=>t===" "||t===` `?t:" ").join(""),partition(e){for(var t,n=[];qn.lastIndex!==e.length&&(t=qn.exec(e));)n.push([t[1]||"",t[2]]);return qn.lastIndex=0,n},first(e,t){let n="",r=0;for(let i of Un.exports.partition(e)){var o=vs(i,2);let a=o[0],l=o[1],s=Array.from(l).slice(0,t-r);n+=a+s.join(""),r+=s.length}return n}}});var Ko=z((xf,Zo)=>{"use strict";function He(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);txs(e,t-1)+"\u2026",jo=(e,t)=>{let n=(m,h)=>m.reduce((g,y)=>y.map((w,v)=>[].concat(He(g[v]||[]),[w])),[]).map(g=>h.apply(void 0,He(g))),r=e.map(m=>m.map(h=>h.replace(/\n/g,"\\n"))),o=r.map(m=>m.map(Dt)),i=n(o,Math.max),a=Ht.assign({delimiter:" ",minColumnWidths:i.map(m=>0),maxTotalWidth:0},t),l=Dt(a.delimiter),s=i.reduce((m,h)=>m+h,0),c=i.map(m=>m/s),u=a.maxTotalWidth-l*(i.length-1),f=Math.max(0,s-u),d=n([a.minColumnWidths,i,c],(m,h,g)=>Math.max(m,Math.floor(h-f*g))),p=o.map(m=>n([d,m],(h,g)=>h-g));return n([r,p],(m,h)=>n([m,h],(g,y)=>y>=0?a.right?" ".repeat(y)+g:g+" ".repeat(y):Cs(g,Dt(g)+y)).join(a.delimiter))},Yo=e=>Ht.assign(t=>{var n;if(t[0]&&Array.isArray(t[0]))return jo(t.map(a=>a.map((l,s)=>l===void 0?"":e.print(l,s))),e).join(` `);let r=[].concat(He(new Set((n=[]).concat.apply(n,He(t.map(Ht.keys)))))),o=[r.map(e.title)].concat(He(t.map(a=>r.map(l=>a[l]===void 0?"":e.print(a[l],l))))),i=jo(o,e);return(e.dash?[i[0],e.dash.repeat(Dt(i[0]))].concat(He(i.slice(1))):i).join(` `)},e,{configure:t=>Yo(Ht.assign({},e,t))});Zo.exports=Yo({maxTotalWidth:Number.MAX_SAFE_INTEGER,print:String,title:String,dash:"-",right:!1})});var Gn=z((Cf,Vn)=>{"use strict";var Wt=Object,De=typeof window<"u"&&window.window===window&&window.navigator,Qo=De?null:Vn.require,Jo=e=>e[e.length-1],qt=qo(),Es=Uo(),Ms=Ko(),rt=e=>e.replace(/\\/g,"/"),ei=De?window.location.href:rt(process.cwd())+"/",ot=class e{constructor(t,n){let r=t,o=t&&t instanceof SyntaxError&&!De;if(t||(t=new Error,n=n===void 0?1:n),t instanceof Error&&(t=t.stack||""),typeof t=="string"&&(t=this.rawParse(t).slice(n).map(i=>this.extractEntryMetadata(i))),Array.isArray(t)){if(o){let i=Qo("util").inspect(r).split(` `),a=i[0].split(":"),l=a.pop(),s=a.join(":");s&&t.unshift({file:rt(s),line:l,column:(i[2]||"").indexOf("^")+1,sourceLine:i[1],callee:"(syntax error)",syntaxError:!0})}this.items=t}else this.items=[]}extractEntryMetadata(t){let n=this.decomposePath(t.file||""),r=n[0],o=n[1];return Wt.assign(t,{calleeShort:t.calleeShort||Jo((t.callee||"").split(".")),fileRelative:r,fileShort:this.shortenPath(r),fileName:Jo((t.file||"").split("/")),thirdParty:this.isThirdParty(r,o)&&!t.index,externalDomain:o})}shortenPath(t){return t.replace(/^node_modules\//,"").replace(/^webpack\/bootstrap\//,"").replace(/^__parcel_source_root\//,"")}decomposePath(t){let n=t;De&&(n=n.replace(ei,""));let r=n.match(/^(http|https)\:\/\/?([^\/]+)\/(.*)/),o=r?r[2]:void 0;return n=r?r[3]:n,De||(n=Qo("path").relative(ei,n)),[rt(n).replace(/^.*\:\/\/?\/?/,""),o]}isThirdParty(t,n){return n||t[0]==="~"||t[0]==="/"||t.indexOf("node_modules")===0||t.indexOf("webpack/bootstrap")===0}rawParse(t){return(t||"").split(` `).map(o=>{o=o.trim();let i,a=[],l,s,c;if((s=o.match(/at (.+) \(eval at .+ \((.+)\), .+\)/))||(s=o.match(/at (.+) \((.+)\)/))||o.slice(0,3)!=="at "&&(s=o.match(/(.*)@(.*)/)))i=s[1],l=s[2]==="native",a=(s[2].match(/(.*):(\d+):(\d+)/)||s[2].match(/(.*):(\d+)/)||[]).slice(1);else if(c=o.match(/^(at\s+)*(.+):(\d+):(\d+)/))a=c.slice(2);else return;return i&&!a[0]&&i.split(".")[0]==="Array"&&(l=!0),{beforeParse:o,callee:i||"",index:De&&a[0]===window.location.href,native:l||!1,file:rt(a[0]||""),line:parseInt(a[1]||"",10)||void 0,column:parseInt(a[2]||"",10)||void 0}}).filter(o=>o!==void 0)}withSourceAt(t){return this.items[t]&&this.withSource(this.items[t])}withSourceAsyncAt(t){return this.items[t]&&this.withSourceAsync(this.items[t])}withSource(t){if(this.shouldSkipResolving(t))return t;{let n=qt(t.file||"").resolve(t);return n.sourceFile?this.withSourceResolved(t,n):t}}withSourceAsync(t){return this.shouldSkipResolving(t)?Promise.resolve(t):qt.async(t.file||"").then(n=>n.resolve(t)).then(n=>this.withSourceResolved(t,n)).catch(n=>this.withSourceResolved(t,{error:n,sourceLine:""}))}shouldSkipResolving(t){return t.sourceFile||t.error||t.file&&t.file.indexOf("<")>=0}withSourceResolved(t,n){return n.sourceFile&&!n.sourceFile.error&&(n.file=rt(n.sourceFile.path),n=this.extractEntryMetadata(n)),n.sourceLine.includes("// @hide")&&(n.sourceLine=n.sourceLine.replace("// @hide",""),n.hide=!0),(n.sourceLine.includes("__webpack_require__")||n.sourceLine.includes("/******/ ({"))&&(n.thirdParty=!0),Wt.assign({sourceLine:""},t,n)}withSources(){return this.map(t=>this.withSource(t))}withSourcesAsync(){return Promise.all(this.items.map(t=>this.withSourceAsync(t))).then(t=>new e(t))}mergeRepeatedLines(){return new e(Es(this.items,t=>t.file+t.line).map(t=>t.items.slice(1).reduce((n,r)=>(n.callee=(n.callee||"")+" \u2192 "+(r.callee||""),n.calleeShort=(n.calleeShort||"")+" \u2192 "+(r.calleeShort||""),n),Wt.assign({},t.items[0]))))}clean(){let t=this.withSources().mergeRepeatedLines();return t.filter(t.isClean.bind(t))}cleanAsync(){return this.withSourcesAsync().then(t=>(t=t.mergeRepeatedLines(),t.filter(t.isClean.bind(t))))}isClean(t,n){return n===0||!(t.thirdParty||t.hide||t.native)}at(t){return Wt.assign({beforeParse:"",callee:"",index:!1,native:!1,file:"",line:0,column:0},this.items[t])}asTable(t){let n=t&&t.maxColumnWidths||this.maxColumnWidths(),r=(a,l)=>a&&(a.length>l?a.slice(0,l-1)+"\u2026":a),o=(a,l)=>a&&(a.length>l?"\u2026"+a.slice(-(l-1)):a),i=this.map(a=>["at "+r(a.calleeShort,n.callee),o(a.fileShort&&a.fileShort+":"+a.line||"",n.file),r((a.sourceLine||"").trim()||"",n.sourceLine)]);return Ms(i.items)}maxColumnWidths(){return{callee:30,file:60,sourceLine:80}}static resetCache(){qt.resetCache(),qt.async.resetCache()}static locationsEqual(t,n){return t.file===n.file&&t.line===n.line&&t.column===n.column}};["map","filter","slice","concat"].forEach(e=>{ot.prototype[e]=function(){return new ot(this.items[e].apply(this.items,arguments))}});Vn.exports=ot});var ri=z(()=>{});var Ei=z((Tf,Ci)=>{var nr=typeof Map=="function"&&Map.prototype,jn=Object.getOwnPropertyDescriptor&&nr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Gt=nr&&jn&&typeof jn.get=="function"?jn.get:null,oi=nr&&Map.prototype.forEach,rr=typeof Set=="function"&&Set.prototype,Xn=Object.getOwnPropertyDescriptor&&rr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,jt=rr&&Xn&&typeof Xn.get=="function"?Xn.get:null,ii=rr&&Set.prototype.forEach,Ls=typeof WeakMap=="function"&&WeakMap.prototype,lt=Ls?WeakMap.prototype.has:null,ks=typeof WeakSet=="function"&&WeakSet.prototype,st=ks?WeakSet.prototype.has:null,Ts=typeof WeakRef=="function"&&WeakRef.prototype,ai=Ts?WeakRef.prototype.deref:null,Os=Boolean.prototype.valueOf,Is=Object.prototype.toString,$s=Function.prototype.toString,Rs=String.prototype.match,or=String.prototype.slice,pe=String.prototype.replace,Ns=String.prototype.toUpperCase,li=String.prototype.toLowerCase,gi=RegExp.prototype.test,si=Array.prototype.concat,te=Array.prototype.join,Ps=Array.prototype.slice,ci=Math.floor,Kn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Yn=Object.getOwnPropertySymbols,Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,We=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ct=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===We||!0)?Symbol.toStringTag:null,yi=Object.prototype.propertyIsEnumerable,ui=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function di(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||gi.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-ci(-e):ci(e);if(r!==e){var o=String(r),i=or.call(t,o.length+1);return pe.call(o,n,"$&_")+"."+pe.call(pe.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return pe.call(t,n,"$&_")}var Jn=ri(),fi=Jn.custom,hi=vi(fi)?fi:null,wi={__proto__:null,double:'"',single:"'"},Fs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Ci.exports=function e(t,n,r,o){var i=n||{};if(se(i,"quoteStyle")&&!se(wi,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(se(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=se(i,"customInspect")?i.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(se(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(se(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return xi(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var s=String(t);return l?di(t,s):s}if(typeof t=="bigint"){var c=String(t)+"n";return l?di(t,c):c}var u=typeof i.depth>"u"?5:i.depth;if(typeof r>"u"&&(r=0),r>=u&&u>0&&typeof t=="object")return er(t)?"[Array]":"[Object]";var f=tc(i,r);if(typeof o>"u")o=[];else if(Si(o,t)>=0)return"[Circular]";function d(_,V,Q){if(V&&(o=Ps.call(o),o.push(V)),Q){var Y={depth:i.depth};return se(i,"quoteStyle")&&(Y.quoteStyle=i.quoteStyle),e(_,Y,r+1,o)}return e(_,i,r+1,o)}if(typeof t=="function"&&!mi(t)){var p=Gs(t),m=Vt(t,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+te.call(m,", ")+" }":"")}if(vi(t)){var h=We?pe.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Qn.call(t);return typeof t=="object"&&!We?at(h):h}if(Qs(t)){for(var g="<"+li.call(String(t.nodeName)),y=t.attributes||[],w=0;w",g}if(er(t)){if(t.length===0)return"[]";var v=Vt(t,d);return f&&!ec(v)?"["+tr(v,f)+"]":"[ "+te.call(v,", ")+" ]"}if(Ds(t)){var b=Vt(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!yi.call(t,"cause")?"{ ["+String(t)+"] "+te.call(si.call("[cause]: "+d(t.cause),b),", ")+" }":b.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+te.call(b,", ")+" }"}if(typeof t=="object"&&a){if(hi&&typeof t[hi]=="function"&&Jn)return Jn(t,{depth:u-r});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(js(t)){var C=[];return oi&&oi.call(t,function(_,V){C.push(d(V,t,!0)+" => "+d(_,t))}),pi("Map",Gt.call(t),C,f)}if(Zs(t)){var x=[];return ii&&ii.call(t,function(_){x.push(d(_,t))}),pi("Set",jt.call(t),x,f)}if(Xs(t))return Zn("WeakMap");if(Ks(t))return Zn("WeakSet");if(Ys(t))return Zn("WeakRef");if(qs(t))return at(d(Number(t)));if(Us(t))return at(d(Kn.call(t)));if(Bs(t))return at(Os.call(t));if(Ws(t))return at(d(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!Hs(t)&&!mi(t)){var M=Vt(t,d),k=ui?ui(t)===Object.prototype:t instanceof Object||t.constructor===Object,T=t instanceof Object?"":"null prototype",N=!k&&ct&&Object(t)===t&&ct in t?or.call(ge(t),8,-1):T?"Object":"",L=k||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",P=L+(N||T?"["+te.call(si.call([],N||[],T||[]),": ")+"] ":"");return M.length===0?P+"{}":f?P+"{"+tr(M,f)+"}":P+"{ "+te.call(M,", ")+" }"}return String(t)};function bi(e,t,n){var r=n.quoteStyle||t,o=wi[r];return o+e+o}function zs(e){return pe.call(String(e),/"/g,""")}function Ae(e){return!ct||!(typeof e=="object"&&(ct in e||typeof e[ct]<"u"))}function er(e){return ge(e)==="[object Array]"&&Ae(e)}function Hs(e){return ge(e)==="[object Date]"&&Ae(e)}function mi(e){return ge(e)==="[object RegExp]"&&Ae(e)}function Ds(e){return ge(e)==="[object Error]"&&Ae(e)}function Ws(e){return ge(e)==="[object String]"&&Ae(e)}function qs(e){return ge(e)==="[object Number]"&&Ae(e)}function Bs(e){return ge(e)==="[object Boolean]"&&Ae(e)}function vi(e){if(We)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Qn)return!1;try{return Qn.call(e),!0}catch{}return!1}function Us(e){if(!e||typeof e!="object"||!Kn)return!1;try{return Kn.call(e),!0}catch{}return!1}var Vs=Object.prototype.hasOwnProperty||function(e){return e in this};function se(e,t){return Vs.call(e,t)}function ge(e){return Is.call(e)}function Gs(e){if(e.name)return e.name;var t=Rs.call($s.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Si(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return xi(or.call(e,0,t.maxStringLength),t)+r}var o=Fs[t.quoteStyle||"single"];o.lastIndex=0;var i=pe.call(pe.call(e,o,"\\$1"),/[\x00-\x1f]/g,Js);return bi(i,"single",t)}function Js(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+Ns.call(t.toString(16))}function at(e){return"Object("+e+")"}function Zn(e){return e+" { ? }"}function pi(e,t,n,r){var o=r?tr(n,r):te.call(n,", ");return e+" ("+t+") {"+o+"}"}function ec(e){for(var t=0;t=0)return!1;return!0}function tc(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=te.call(Array(e.indent+1)," ");else return null;return{base:n,prev:te.call(Array(t+1),n)}}function tr(e,t){if(e.length===0)return"";var n=` `+t.prev+t.base;return n+te.call(e,","+n)+` `+t.prev}function Vt(e,t){var n=er(e),r=[];if(n){r.length=e.length;for(var o=0;o{let o=r.split(",").map(i=>i.trim());return o.length!==6?`matrix(${r})`:(o[4]="0",o[5]="0",`matrix(${o.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(n,r)=>{let o=r.split(",").map(i=>i.trim());return o.length!==16?`matrix3d(${r})`:(o[12]="0",o[13]="0",`matrix3d(${o.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function dn(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function Sc(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:n=12}={}){let r=new Map,o=0;function i(a,l,s){if(o>=n)return;let c=Date.now();(r.get(l)||0)>c||(r.set(l,c+t),o++,a==="warn"&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(a,l){i("warn",a,l)},errorOnce(a,l){i("error",a,l)},reset(){r.clear(),o=0}}}function xc(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Cc(e,t){try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,o=new URL(r||".",n),i=new URL(e,n);if(i.origin===o.origin)return!0;let a=i.searchParams;if(a&&(a.has("url")||a.has("target")))return!0}catch{}return!1}function Ec(e,t){if(!t||xc(e)||Cc(e,t))return!1;try{let n=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,n);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function Mc(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",dn(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${dn(e)}`;let n=t.includes("?")?"&":"?";return`${t}${n}url=${encodeURIComponent(e)}`}function ua(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>n(new Error("read_failed")),r.readAsDataURL(e)})}function Ac(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function ne(e,t={}){let n=t.as??"blob",r=t.timeout??3e3,o=t.useProxy||"",i=t.errorTTL??8e3,a=t.headers||{},l=!!t.silent;if(/^data:/i.test(e))try{if(n==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,g="",y=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],w=/;base64/i.test(g)?atob(y):decodeURIComponent(y),v=new Uint8Array([...w].map(C=>C.charCodeAt(0))),b=new Blob([v],{type:(g||"").split(";")[0]||""});return{ok:!0,data:b,status:200,url:e,fromCache:!1,mime:b.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let g=await fetch(e);if(!g.ok)return{ok:!1,data:null,status:g.status,url:e,fromCache:!1,reason:"http_error"};let y=await g.blob(),w=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ua(y),status:g.status,url:e,fromCache:!1,mime:w}:n==="text"?{ok:!0,data:await y.text(),status:g.status,url:e,fromCache:!1,mime:w}:{ok:!0,data:y,status:g.status,url:e,fromCache:!1,mime:w}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return n==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:n==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let s=Ac(e,{as:n,timeout:r,useProxy:o,errorTTL:i}),c=gt.get(s);if(c&&c.until>Date.now())return{...c.result,fromCache:!0};c&>.delete(s);let u=ln.get(s);if(u)return u;let f=Ec(e,o)?Mc(e,o):e,d=t.credentials;if(!d)try{let g=typeof location<"u"&&location.href?location.href:"http://localhost/",y=new URL(e,g);d=typeof location<"u"&&y.origin===location.origin?"include":"omit"}catch{d="omit"}let p=new AbortController,m=setTimeout(()=>p.abort("timeout"),r),h=(async()=>{try{let g=await fetch(f,{signal:p.signal,credentials:d,headers:a});if(!g.ok){let v={ok:!1,data:null,status:g.status,url:f,fromCache:!1,reason:"http_error"};if(i>0&>.set(s,{until:Date.now()+i,result:v}),!l){let b=`${g.status} ${g.statusText||""}`.trim();Er.warnOnce(`http:${g.status}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,`HTTP error ${b} while fetching ${n} ${e}`)}return t.onError&&t.onError(v),v}if(n==="text")return{ok:!0,data:await g.text(),status:g.status,url:f,fromCache:!1};let y=await g.blob(),w=y.type||g.headers.get("content-type")||"";return n==="dataURL"?{ok:!0,data:await ua(y),status:g.status,url:f,fromCache:!1,mime:w}:{ok:!0,data:y,status:g.status,url:f,fromCache:!1,mime:w}}catch(g){let y=g&&typeof g=="object"&&"name"in g&&g.name==="AbortError"?String(g.message||"").includes("timeout")?"timeout":"abort":"network",w={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:y};if(!/^blob:/i.test(e)&&i>0&>.set(s,{until:Date.now()+i,result:w}),!l){let v=`${y}:${n}:${new URL(e,location?.href??"http://localhost/").origin}`,b=y==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:y==="abort"?`Request aborted while fetching ${n} ${e}`:`Network/CORS issue while fetching ${n} ${e}. A proxy may be required`;Er.errorOnce(v,b)}return t.onError&&t.onError(w),w}finally{clearTimeout(m),ln.delete(s)}})();return ln.set(s,h),h}async function Ta(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let n=zr(e);if(!n)return e;let r=dn(n);if(S.background.has(r)){let o=S.background.get(r);return o?`url("${o}")`:"none"}try{let o=await ne(r,{as:"dataURL",useProxy:t.useProxy});return o.ok?(S.background.set(r,o.data),`url("${o.data}")`):(S.background.set(r,null),"none")}catch{return S.background.set(r,null),"none"}}function Lc(e){if(e=String(e).toLowerCase(),mn.has(e)){let i={};return S.defaultStyle.set(e,i),i}if(S.defaultStyle.has(e))return S.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let n=document.createElement(e);n.style.all="initial",t.appendChild(n);let r=getComputedStyle(n),o={};for(let i of r){if(Oa(i))continue;let a=r.getPropertyValue(i);o[i]=a}return t.removeChild(n),S.defaultStyle.set(e,o),o}function Oa(e){let t=String(e).toLowerCase();return!!(Fa.has(t)||Pa.test(t)||Na.test(t))}function Mr(e,t){if(t=String(t||"").toLowerCase(),mn.has(t))return"";let n=[],r=Lc(t);for(let[o,i]of Object.entries(e)){if(Oa(o))continue;let a=r[o];i&&i!==a&&n.push(`${o}:${i}`)}return n.sort(),n.join(";")}function kc(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(n=>t.add(n.tagName.toLowerCase())),Array.from(t))}function Tc(e){let t=new Map;for(let r of e){let o=S.defaultStyle.get(r);if(!o)continue;let i=Object.entries(o).map(([a,l])=>`${a}:${l};`).sort().join("");i&&(t.has(i)||t.set(i,[]),t.get(i).push(r))}let n="";for(let[r,o]of t.entries())n+=`${o.join(",")} { ${r} } `;return n}function Oc(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let o of t)n.set(o,`c${r++}`);return n}function Ia(e,t=null){if(!(e instanceof Element))return window.getComputedStyle(e,t);let n=S.computedStyle.get(e);if(n||(n=new Map,S.computedStyle.set(e,n)),!n.has(t)){let r=window.getComputedStyle(e,t);n.set(t,r)}return n.get(t)}function da(e){let t={};for(let n of e)t[n]=e.getPropertyValue(n);return t}function $a(e){let t=[],n=0,r=0;for(let o=0;o"u")return!1;let e=navigator.userAgent||"",t=e.toLowerCase(),n=t.includes("safari")&&!t.includes("chrome")&&!t.includes("crios")&&!t.includes("fxios")&&!t.includes("android"),r=/applewebkit/i.test(e),o=/mobile/i.test(e),i=!/safari/i.test(e),a=r&&o&&i,l=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),s=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),c=/ipad|iphone|ipod/.test(t)&&r;return n||a||l||s||c}function $c(e){return typeof e=="string"&&/^data:image\/svg\+xml/i.test(e)}function Rc(e){let t=e.indexOf(",");return t>=0?decodeURIComponent(e.slice(t+1)):""}function Nc(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Pc(e){let t=[],n="",r=0;for(let o=0;oo.trim()).filter(Boolean)}function Fc(e){let t=[],n="",r=0;for(let i=0;i`${l}:${s}`).join(";")}function zc(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(t,n,r)=>`${n}{${Ha(r)}}`)}function Hc(e){return e=e.replace(/]*>([\s\S]*?)<\/style>/gi,(t,n)=>t.replace(n,zc(n))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(t,n,r)=>`style=${n}${Ha(r)}${n}`),e}function Dc(e){if(!_e()||!$c(e))return e;try{let t=Rc(e),n=Hc(t);return Nc(n)}catch{return e}}async function pn(e,t){let{width:n,height:r,scale:o=1,dpr:i=1,meta:a={},backgroundColor:l}=t;e=Dc(e);let s=new Image;s.loading="eager",s.decoding="sync",s.crossOrigin="anonymous",s.src=e,await s.decode();let c=s.naturalWidth,u=s.naturalHeight,f=Number.isFinite(a.w0)?a.w0:c,d=Number.isFinite(a.h0)?a.h0:u,p,m,h=Number.isFinite(n),g=Number.isFinite(r);if(h&&g)p=Math.max(1,n),m=Math.max(1,r);else if(h){let v=n/Math.max(1,f);p=n,m=d*v}else if(g){let v=r/Math.max(1,d);m=r,p=f*v}else p=c,m=u;p=p*o,m=m*o;let y=document.createElement("canvas");y.width=p*i,y.height=m*i,y.style.width=`${p}px`,y.style.height=`${m}px`;let w=y.getContext("2d");return i!==1&&w.scale(i,i),l&&(w.save(),w.fillStyle=l,w.fillRect(0,0,p,m),w.restore()),w.drawImage(s,0,0,p,m),y}async function Da(e,t){let n=await pn(e,t),r=new Image;return r.src=n.toDataURL(`image/${t.format}`,t.quality),await r.decode(),r.style.width=`${n.width/t.dpr}px`,r.style.height=`${n.height/t.dpr}px`,r}async function fa(e,t){let{scale:n=1,width:r,height:o,meta:i={}}=t,a=Number.isFinite(r),l=Number.isFinite(o),s=Number.isFinite(n)&&n!==1||a||l;if(_e()&&s)return await Da(e,{...t,format:"png",quality:1,meta:i});let c=new Image;if(c.decoding="sync",c.loading="eager",c.src=e,await c.decode(),a&&l)c.style.width=`${r}px`,c.style.height=`${o}px`;else if(a){let u=Number.isFinite(i.w0)?i.w0:c.naturalWidth,f=Number.isFinite(i.h0)?i.h0:c.naturalHeight,d=r/Math.max(1,u);c.style.width=`${r}px`,c.style.height=`${Math.round(f*d)}px`}else if(l){let u=Number.isFinite(i.w0)?i.w0:c.naturalWidth,f=Number.isFinite(i.h0)?i.h0:c.naturalHeight,d=o/Math.max(1,f);c.style.height=`${o}px`,c.style.width=`${Math.round(u*d)}px`}else{let u=Math.round(c.naturalWidth*n),f=Math.round(c.naturalHeight*n);if(c.style.width=`${u}px`,c.style.height=`${f}px`,typeof e=="string"&&e.startsWith("data:image/svg+xml"))try{let d=decodeURIComponent(e.split(",")[1]).replace(/width="[^"]*"/,`width="${u}"`).replace(/height="[^"]*"/,`height="${f}"`);e=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,c.src=e}catch{}}return c}async function Wa(e,t){let n=t.type;if(n==="svg"){let o=decodeURIComponent(e.split(",")[1]);return new Blob([o],{type:"image/svg+xml"})}let r=await pn(e,t);return new Promise(o=>r.toBlob(i=>o(i),`image/${n}`,t.quality))}async function Wc(e,t){let n=(t?.format||t?.type||"").toLowerCase(),r=n==="jpg"?"jpeg":n||"png",o=t?.filename||`snapdom.${r}`,i={...t||{},format:r,type:r};if(i.dpr=1,r==="svg"){let s=await Wa(e,{...i,type:"svg"}),c=URL.createObjectURL(s),u=document.createElement("a");u.href=c,u.download=o,u.click(),URL.revokeObjectURL(c);return}let a=await pn(e,i),l=document.createElement("a");l.href=a.toDataURL(`image/${r}`,t?.quality),l.download=o,l.click()}function wt(){Tr++}function Bc(e=document.documentElement){if(!ma){ma=!0;try{new MutationObserver(()=>wt()).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{new MutationObserver(()=>wt()).observe(document.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0})}catch{}try{let t=document.fonts;t&&(t.addEventListener?.("loadingdone",wt),t.ready?.then(()=>wt()).catch(()=>{}))}catch{}}}function Uc(e,t={}){let n={},r=e.getPropertyValue("visibility");for(let i=0;in[0]r[0]?1:0).map(([n,r])=>`${n}:${r}`).join(";"),pa.set(e,t),t)}function Gc(e,t=null,n={}){let r=ha.get(e);if(r&&r.epoch===Tr)return r.snapshot;let o=t||getComputedStyle(e),i=Uc(o,n);return Qc(e,o,i),ha.set(e,{epoch:Tr,snapshot:i}),i}function jc(e,t){return e&&e.session&&e.persist?e:e&&(e.styleMap||e.styleCache||e.nodeMap)?{session:e,persist:{snapshotKeyCache:kr,defaultStyle:S.defaultStyle,baseStyle:S.baseStyle,image:S.image,resource:S.resource,background:S.background,font:S.font},options:t||{}}:{session:S.session,persist:{snapshotKeyCache:kr,defaultStyle:S.defaultStyle,baseStyle:S.baseStyle,image:S.image,resource:S.resource,background:S.background,font:S.font},options:e||t||{}}}async function Xe(e,t,n,r){if(e.tagName==="STYLE")return;let o=jc(n,r),i=o.options&&o.options.cache||"auto";if(i!=="disabled"&&Bc(document.documentElement),i==="disabled"&&!o.session.__bumpedForDisabled&&(wt(),kr.clear(),o.session.__bumpedForDisabled=!0),mn.has(e.tagName?.toLowerCase())){let d=e.getAttribute?.("style");d&&t.setAttribute("style",d)}let{session:a,persist:l}=o;a.styleCache.has(e)||a.styleCache.set(e,getComputedStyle(e));let s=a.styleCache.get(e),c=Gc(e,s,o.options),u=Vc(c),f=l.snapshotKeyCache.get(u);if(!f){let d=e.tagName?.toLowerCase()||"div";f=Mr(c,d),l.snapshotKeyCache.set(u,f)}a.styleMap.set(t,f)}function Xc(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Yc(e){return e.backgroundImage&&e.backgroundImage!=="none"||e.backgroundColor&&e.backgroundColor!=="rgba(0, 0, 0, 0)"&&e.backgroundColor!=="transparent"||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||"visible")!=="visible"}function Zc(e){let t=e.parentElement;if(!t)return!1;let n=getComputedStyle(t).display||"";return n.includes("flex")||n.includes("grid")}function Kc(e,t){if(e.textContent&&/\S/.test(e.textContent))return!0;let n=e.firstElementChild,r=e.lastElementChild;if(n&&n.tagName==="BR"||r&&r.tagName==="BR")return!0;let o=e.scrollHeight;if(o===0)return!1;let i=parseFloat(t.paddingTop)||0,a=parseFloat(t.paddingBottom)||0;return o>i+a}function Qc(e,t,n){if(e instanceof HTMLElement&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||r!=="div"&&r!=="section"&&r!=="article"&&r!=="main"&&r!=="aside"&&r!=="header"&&r!=="footer"&&r!=="nav"&&r!=="ol"&&r!=="ul"&&r!=="li")return;let o=t.display||"";if(o.includes("flex")||o.includes("grid")||Xc(e))return;let i=t.position;if(i==="absolute"||i==="fixed"||i==="sticky"||t.transform!=="none"||Yc(t)||Zc(e))return;let a=t.overflowX||t.overflow||"visible",l=t.overflowY||t.overflow||"visible";if(a!=="visible"||l!=="visible")return;let s=t.clip;s&&s!=="auto"&&s!=="rect(auto, auto, auto, auto)"||t.visibility==="hidden"||t.opacity==="0"||Kc(e,t)&&(delete n.height,delete n["block-size"])}function Jc(e,t){let n=t+"::"+e.toLowerCase(),r=ga.get(n);if(r)return r;let o=document,i=t==="http://www.w3.org/2000/svg"?o.createElementNS(t,e):o.createElement(e),a=o.createElement("div");a.style.cssText="position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;",a.appendChild(i),o.documentElement.appendChild(a);let l=getComputedStyle(i),s={};for(let c of Ba)s[c]=l.getPropertyValue(c)||"";return a.remove(),ga.set(n,s),s}function eu(e,t){if(!(e instanceof Element)||!(t instanceof Element))return;let n=e.getAttribute?.("style"),r=!!(n&&n.includes("var("));if(!r&&e.attributes?.length){let i=e.attributes;for(let a=0;anew Promise(o=>{function i(){je(a=>{!(a&&typeof a.timeRemaining=="function")||a.timeRemaining()>0?t(r,o):i()},{fast:n})}i()})))}function tu(e){return e=e.trim(),!e||/:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(e)?e:`${e}:not([data-sd-slotted])`}function nu(e,t,n=!0){return e.split(",").map(r=>r.trim()).filter(Boolean).map(r=>{if(r.startsWith(":where(")||r.startsWith("@"))return r;let o=n?tu(r):r;return`:where(${t} ${o})`}).join(", ")}function ru(e,t){return e?(e=e.replace(/:host\(([^)]+)\)/g,(n,r)=>`:where(${t}:is(${r.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/:host-context\(([^)]+)\)/g,(n,r)=>`:where(:where(${r.trim()}) ${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(n,r)=>`:where(${t} ${r.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(n,r,o,i)=>{let a=nu(i,t,!0);return`${r}${o}${a}{`}),e):""}function ou(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function iu(e){let t="";try{e.querySelectorAll("style").forEach(r=>{t+=(r.textContent||"")+` `});let n=e.adoptedStyleSheets||[];for(let r of n)try{if(r&&r.cssRules)for(let o of r.cssRules)t+=o.cssText+` `}catch{}}catch{}return t}function au(e,t,n){if(!t)return;let r=document.createElement("style");r.setAttribute("data-sd",n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function lu(e,t){try{let n=e.currentSrc||e.src||"";if(!n)return;t.setAttribute("src",n),t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.loading="eager",t.decoding="sync"}catch{}}function su(e){let t=new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function cu(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let n=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(n)return n}catch{}return""}function uu(e,t,n){let r=[];for(let o of t){let i=cu(e,o);i&&r.push(`${o}: ${i};`)}return r.length?`${n}{${r.join("")}} `:""}function du(e){e&&(e.nodeType===Node.ELEMENT_NODE&&e.setAttribute("data-sd-slotted",""),e.querySelectorAll&&e.querySelectorAll("*").forEach(t=>t.setAttribute("data-sd-slotted","")))}async function fu(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),o=0;for(;osetTimeout(i,0)),r=n(),o++;return r&&(r.body||r.documentElement)?r:null}function hu(e){let t=e.getBoundingClientRect(),n=0,r=0,o=0,i=0;try{let s=getComputedStyle(e);n=parseFloat(s.borderLeftWidth)||0,r=parseFloat(s.borderRightWidth)||0,o=parseFloat(s.borderTopWidth)||0,i=parseFloat(s.borderBottomWidth)||0}catch{}let a=Math.max(0,Math.round(t.width-(n+r))),l=Math.max(0,Math.round(t.height-(o+i)));return{contentWidth:a,contentHeight:l,rect:t}}function on(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let o=parseFloat(r.width);!isNaN(o)&&o>0&&(t=o)}if(n===0){let o=parseFloat(r.height);!isNaN(o)&&o>0&&(n=o)}}catch{}if(t===0||n===0)try{if(t===0){let r=parseFloat(e.getAttribute("width"));!isNaN(r)&&r>0&&(t=r)}if(n===0){let r=parseFloat(e.getAttribute("height"));!isNaN(r)&&r>0&&(n=r)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}function mu(e,t,n){let r=e.createElement("style");return r.setAttribute("data-sd-iframe-pin",""),r.textContent=`html, body {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,(e.head||e.documentElement).appendChild(r),()=>{try{r.remove()}catch{}}}async function pu(e,t,n){let r=await fu(e,3);if(!r)throw new Error("iframe document not accessible/ready");let{contentWidth:o,contentHeight:i,rect:a}=hu(e),l=n?.snap;if(!l||typeof l.toPng!="function")throw new Error("snapdom.toPng not available in iframe or window");let s={...n,scale:1},c=mu(r,o,i),u;try{u=await l.toPng(r.documentElement,s)}finally{c()}u.style.display="block",u.style.width=`${o}px`,u.style.height=`${i}px`;let f=document.createElement("div");return t.nodeMap.set(f,e),Xe(e,f,t,n),f.style.overflow="hidden",f.style.display="block",f.style.width||(f.style.width=`${Math.round(a.width)}px`),f.style.height||(f.style.height=`${Math.round(a.height)}px`),f.appendChild(u),f}async function bt(e){if(S.resource?.has(e))return S.resource.get(e);if(pt.has(e))return pt.get(e);let t=(async()=>{let n=await ne(e,{as:"dataURL",silent:!0});if(!n.ok||typeof n.data!="string")throw new Error(`[snapDOM] Failed to read blob URL: ${e}`);return S.resource?.set(e,n.data),n.data})();pt.set(e,t);try{let n=await t;return pt.set(e,n),n}catch(n){throw pt.delete(e),n}}async function ya(e){if(!e||e.indexOf("blob:")===-1)return e;let t=Array.from(new Set(e.match(gu)||[]));if(t.length===0)return e;let n=e;for(let r of t)try{let o=await bt(r);n=n.split(r).join(o)}catch{}return n}function an(e){return typeof e=="string"&&e.startsWith("blob:")}function yu(e){return(e||"").split(",").map(t=>t.trim()).filter(Boolean).map(t=>{let n=t.match(/^(\S+)(\s+.+)?$/);return n?{url:n[1],desc:n[2]||""}:null}).filter(Boolean)}function wu(e){return e.map(t=>t.desc?`${t.url} ${t.desc.trim()}`:t.url).join(", ")}async function bu(e){if(!e)return;let t=e.querySelectorAll?e.querySelectorAll("img"):[];for(let a of t)try{let l=a.getAttribute("src")||a.currentSrc||"";if(an(l)){let c=await bt(l);a.setAttribute("src",c)}let s=a.getAttribute("srcset");if(s&&s.includes("blob:")){let c=yu(s),u=!1;for(let f of c)if(an(f.url))try{f.url=await bt(f.url),u=!0}catch{}u&&a.setAttribute("srcset",wu(c))}}catch{}let n=e.querySelectorAll?e.querySelectorAll("image"):[];for(let a of n)try{let l="http://www.w3.org/1999/xlink",s=a.getAttribute("href")||a.getAttributeNS?.(l,"href");if(an(s)){let c=await bt(s);a.setAttribute("href",c),a.removeAttributeNS?.(l,"href")}}catch{}let r=e.querySelectorAll?e.querySelectorAll("[style*='blob:']"):[];for(let a of r)try{let l=a.getAttribute("style");if(l&&l.includes("blob:")){let s=await ya(l);a.setAttribute("style",s)}}catch{}let o=e.querySelectorAll?e.querySelectorAll("style"):[];for(let a of o)try{let l=a.textContent||"";l.includes("blob:")&&(a.textContent=await ya(l))}catch{}let i=["poster"];for(let a of i){let l=e.querySelectorAll?e.querySelectorAll(`[${a}^='blob:']`):[];for(let s of l)try{let c=s.getAttribute(a);an(c)&&s.setAttribute(a,await bt(c))}catch{}}}async function sn(e,t,n){if(!e)throw new Error("Invalid node");let r=new Set,o=null,i=null;if(e.nodeType===Node.ELEMENT_NODE){let c=(e.localName||e.tagName||"").toLowerCase();if(e.id==="snapdom-sandbox"||e.hasAttribute("data-snapdom-sandbox")||Ra.has(c))return null}if(e.nodeType===Node.TEXT_NODE||e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute("data-capture")==="exclude"){if(n.excludeMode==="hide"){let c=document.createElement("div"),u=e.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,c}else if(n.excludeMode==="remove")return null}if(n.exclude&&Array.isArray(n.exclude))for(let c of n.exclude)try{if(e.matches?.(c)){if(n.excludeMode==="hide"){let u=document.createElement("div"),f=e.getBoundingClientRect();return u.style.cssText=`display:inline-block;width:${f.width}px;height:${f.height}px;visibility:hidden;`,u}else if(n.excludeMode==="remove")return null}}catch(u){console.warn(`Invalid selector in exclude option: ${c}`,u)}if(typeof n.filter=="function")try{if(!n.filter(e)){if(n.filterMode==="hide"){let c=document.createElement("div"),u=e.getBoundingClientRect();return c.style.cssText=`display:inline-block;width:${u.width}px;height:${u.height}px;visibility:hidden;`,c}else if(n.filterMode==="remove")return null}}catch(c){console.warn("Error in filter function:",c)}if(e.tagName==="IFRAME"){let c=!1;try{c=!!(e.contentDocument||e.contentWindow?.document)}catch{c=!1}if(c)try{return await pu(e,t,n)}catch(u){console.warn("[SnapDOM] iframe rasterization failed, fallback:",u)}if(n.placeholders){let{width:u,height:f}=on(e),d=document.createElement("div");return d.style.cssText=`width:${u}px;height:${f}px;background-image:repeating-linear-gradient(45deg,#ddd,#ddd 5px,#f9f9f9 5px,#f9f9f9 10px);display:flex;align-items:center;justify-content:center;font-size:12px;color:#555;border:1px solid #aaa;`,Xe(e,d,t,n),d}else{let{width:u,height:f}=on(e),d=document.createElement("div");return d.style.cssText=`display:inline-block;width:${u}px;height:${f}px;visibility:hidden;`,Xe(e,d,t,n),d}}if(e.getAttribute("data-capture")==="placeholder"){let c=e.cloneNode(!1);t.nodeMap.set(c,e),Xe(e,c,t,n);let u=document.createElement("div");return u.textContent=e.getAttribute("data-placeholder-text")||"",u.style.cssText="color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;",c.appendChild(u),c}if(e.tagName==="CANVAS"){let c="";try{let p=e.getContext("2d",{willReadFrequently:!0});try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(m=>requestAnimationFrame(m)),c=e.toDataURL("image/png"),!c||c==="data:,"){try{p&&p.getImageData(0,0,1,1)}catch{}if(await new Promise(m=>requestAnimationFrame(m)),c=e.toDataURL("image/png"),!c||c==="data:,"){let m=document.createElement("canvas");m.width=e.width,m.height=e.height;let h=m.getContext("2d");h&&(h.drawImage(e,0,0),c=m.toDataURL("image/png"))}}}catch{}let u=document.createElement("img");try{u.decoding="sync",u.loading="eager"}catch{}c&&(u.src=c),u.width=e.width,u.height=e.height;let{width:f,height:d}=on(e);return f>0&&(u.style.width=`${f}px`),d>0&&(u.style.height=`${d}px`),t.nodeMap.set(u,e),Xe(e,u,t,n),u}let a;try{if(a=e.cloneNode(!1),eu(e,a),t.nodeMap.set(a,e),e.tagName==="IMG"){lu(e,a);try{let{width:c,height:u}=on(e),f=Math.round(c||0),d=Math.round(u||0);f&&(a.dataset.snapdomWidth=String(f)),d&&(a.dataset.snapdomHeight=String(d))}catch{}try{let c=e.getAttribute("style")||"",u=window.getComputedStyle(e),f=g=>{let y=c.match(new RegExp(`${g}\\s*:\\s*([^;]+)`,"i")),w=y?y[1].trim():u.getPropertyValue(g);return/%|auto/i.test(String(w||""))},d=parseInt(a.dataset.snapdomWidth||"0",10),p=parseInt(a.dataset.snapdomHeight||"0",10),m=f("width")||!d,h=f("height")||!p;m&&d&&(a.style.width=`${d}px`),h&&p&&(a.style.height=`${p}px`),d&&(a.style.minWidth=`${d}px`),p&&(a.style.minHeight=`${p}px`)}catch{}}}catch(c){throw console.error("[Snapdom] Failed to clone node:",e,c),c}if(e instanceof HTMLTextAreaElement){let c=e.getBoundingClientRect();a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}if(e instanceof HTMLInputElement&&(a.value=e.value,a.setAttribute("value",e.value),e.checked!==void 0&&(a.checked=e.checked,e.checked&&a.setAttribute("checked",""),e.indeterminate&&(a.indeterminate=e.indeterminate))),e instanceof HTMLSelectElement&&(o=e.value),e instanceof HTMLTextAreaElement&&(i=e.value),Xe(e,a,t,n),e.shadowRoot){let c=function(w,v){if(w.nodeType===Node.ELEMENT_NODE&&w.tagName==="STYLE")return v(null);sn(w,t,n).then(b=>{v(b||null)}).catch(()=>{v(null)})};try{let w=e.shadowRoot.querySelectorAll("slot");for(let v of w){let b=[];try{b=v.assignedNodes?.({flatten:!0})||v.assignedNodes?.()||[]}catch{b=v.assignedNodes?.()||[]}for(let C of b)r.add(C)}}catch{}let u=ou(t),f=`[data-sd="${u}"]`;try{a.setAttribute("data-sd",u)}catch{}let d=iu(e.shadowRoot),p=ru(d,f),m=su(d),h=uu(e,m,f);au(a,h+p,u);let g=document.createDocumentFragment(),y=await xr(Array.from(e.shadowRoot.childNodes),c,n.fast);g.append(...y.filter(w=>!!w)),a.appendChild(g)}if(e.tagName==="SLOT"){let c=function(m,h){sn(m,t,n).then(g=>{g&&du(g),h(g||null)}).catch(()=>{h(null)})},u=e.assignedNodes?.({flatten:!0})||[],f=u.length>0?u:Array.from(e.childNodes),d=document.createDocumentFragment(),p=await xr(Array.from(f),c,n.fast);return d.append(...p.filter(m=>!!m)),d}function l(c,u){if(r.has(c))return u(null);sn(c,t,n).then(f=>{u(f||null)}).catch(()=>{u(null)})}let s=await xr(Array.from(e.childNodes),l,n.fast);if(a.append(...s.filter(c=>!!c)),o!==null&&a instanceof HTMLSelectElement){a.value=o;for(let c of a.options)c.value===o?c.setAttribute("selected",""):c.removeAttribute("selected")}return i!==null&&a instanceof HTMLTextAreaElement&&(a.textContent=i),a}function Su(e){let t=Array.isArray(e)?e:[e];for(let n of t)n instanceof RegExp?Or.push(n):typeof n=="string"?Or.push(new RegExp(n,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",n)}function de(e){let t=typeof e=="string"?e:"",n=[...vu,...Or];for(let r of n)if(r instanceof RegExp&&r.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function xu(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}function Cu(e=""){let t=Object.create(null),n=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,o;for(;o=r.exec(n);)t[o[1].toUpperCase()]=Number(o[2]);return t}async function Eu(e,t,n){let r=String(e||""),o=r.toLowerCase(),i=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(o)&&!/\bsymbols\b/.test(o))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(o))return{familyForMeasure:r,familyForCanvas:r};let a=n&&(n.FILL??n.fill),l="outlined";/\brounded\b/.test(i)||/\bround\b/.test(i)?l="rounded":/\bsharp\b/.test(i)?l="sharp":/\boutlined\b/.test(i)&&(l="outlined");let s=a===1,c=null;if(s&&(l==="outlined"&&Ve.materialIconsFilled?c={url:Ve.materialIconsFilled,alias:"snapdom-mi-filled"}:l==="rounded"&&Ve.materialIconsRound?c={url:Ve.materialIconsRound,alias:"snapdom-mi-round"}:l==="sharp"&&Ve.materialIconsSharp&&(c={url:Ve.materialIconsSharp,alias:"snapdom-mi-sharp"})),!c)return{familyForMeasure:r,familyForCanvas:r};if(!wa.has(c.alias))try{let f=new FontFace(c.alias,`url(${c.url})`,{style:"normal",weight:"400"});document.fonts.add(f),await f.load(),wa.set(c.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let u=`"${c.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function Mu(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Au(e){let t=e.getPropertyValue("-webkit-text-fill-color")?.trim()||"",n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!=="currentcolor")return t;let r=e.color?.trim();return r&&r!=="inherit"?r:"#000"}async function _u(e,{family:t="Material Icons",weight:n="normal",fontSize:r=32,color:o="#000",variation:i="",className:a=""}={}){let l=String(t||"").replace(/^['"]+|['"]+$/g,""),s=window.devicePixelRatio||1,c=Cu(i),{familyForMeasure:u,familyForCanvas:f}=await Eu(l,a,c);await Mu(f.replace(/^["']+|["']+$/g,""),r);let d=document.createElement("span");d.textContent=e,d.style.position="absolute",d.style.visibility="hidden",d.style.left="-99999px",d.style.whiteSpace="nowrap",d.style.fontFamily=u,d.style.fontWeight=String(n||"normal"),d.style.fontSize=`${r}px`,d.style.lineHeight="1",d.style.margin="0",d.style.padding="0",d.style.fontFeatureSettings="'liga' 1",d.style.fontVariantLigatures="normal",d.style.color=o,document.body.appendChild(d);let p=d.getBoundingClientRect(),m=Math.max(1,Math.ceil(p.width)),h=Math.max(1,Math.ceil(p.height));document.body.removeChild(d);let g=document.createElement("canvas");g.width=m*s,g.height=h*s;let y=g.getContext("2d");y.scale(s,s),y.font=`${n?`${n} `:""}${r}px ${f}`,y.textAlign="left",y.textBaseline="top",y.fillStyle=o;try{y.fontKerning="normal"}catch{}return y.fillText(e,0,0),{dataUrl:g.toDataURL(),width:m,height:h}}async function Lu(e,t){if(!(e instanceof Element))return 0;let n='.material-icons, [class*="material-symbols"]',r=Array.from(e.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim());if(r.length===0)return 0;let o=t instanceof Element?Array.from(t.querySelectorAll(n)).filter(a=>a&&a.textContent&&a.textContent.trim()):[],i=0;for(let a=0;ar.endsWith(i)))return!0;let o=(n.pathname+n.search).toLowerCase();if(/\bfont(s)?\b/.test(o)||/\.woff2?(\b|$)/.test(o)||Ou.some(i=>o.includes(i)))return!0;for(let i of t){let a=i.toLowerCase().replace(/\s+/g,"+"),l=i.toLowerCase().replace(/\s+/g,"-");if(o.includes(a)||o.includes(l))return!0}return!1}catch{return!1}}function Fu(e){let t=new Set;for(let n of e||[]){let r=String(n).split("__")[0]?.trim();r&&t.add(r)}return t}function ba(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(n,r,o)=>{let i=(o||"").trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return n;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}async function zu(e,t,n){if(!e)return e;let r=new Set;function o(l,s){try{return new URL(l,s||location.href).href}catch{return l}}async function i(l,s,c=0){if(c>fn)return console.warn(`[snapDOM] @import depth exceeded (${fn}) at ${s}`),l;let u="",f=0,d;for(;d=Ir.exec(l);){u+=l.slice(f,d.index),f=Ir.lastIndex;let p=(d[2]||d[4]||"").trim(),m=o(p,s);if(r.has(m)){console.warn(`[snapDOM] Skipping circular @import: ${m}`);continue}r.add(m);let h="";try{let g=await ne(m,{as:"text",useProxy:n,silent:!0});g.ok&&typeof g.data=="string"&&(h=g.data)}catch{}h?(h=ba(h,m),h=await i(h,m,c+1),u+=` /* inlined: ${m} */ ${h} `):u+=d[0]}return u+=l.slice(f),u}let a=ba(e,t||location.href);return a=await i(a,t||location.href,0),a}function Va(e){if(!e)return[];let t=[],n=e.split(",").map(r=>r.trim()).filter(Boolean);for(let r of n){let o=r.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!o)continue;let i=o[1],a=o[2],l=s=>{if(!s.includes("?"))return parseInt(s,16);let c=parseInt(s.replace(/\?/g,"0"),16),u=parseInt(s.replace(/\?/g,"F"),16);return[c,u]};if(a){let s=l(i),c=l(a),u=Array.isArray(s)?s[0]:s,f=Array.isArray(c)?c[1]:c;t.push([Math.min(u,f),Math.max(u,f)])}else{let s=l(i);Array.isArray(s)?t.push([s[0],s[1]]):t.push([s,s])}}return t}function Ga(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[r,o]of t)if(n>=r&&n<=o)return!0;return!1}function Dr(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(Ua)){let o=(r[2]||"").trim();if(!(!o||o.startsWith("data:"))){if(!/^https?:/i.test(o))try{o=new URL(o,t||location.href).href}catch{}n.push(o)}}return n}async function ja(e,t,n=""){let r=e;for(let o of e.matchAll(Ua)){let i=zr(o[0]);if(!i)continue;let a=i;if(!a.startsWith("http")&&!a.startsWith("data:"))try{a=new URL(a,t||location.href).href}catch{}if(!de(a)){if(S.resource?.has(a)){S.font?.add(a),r=r.replace(o[0],`url(${S.resource.get(a)})`);continue}if(!S.font?.has(a))try{let l=await ne(a,{as:"dataURL",useProxy:n,silent:!0});if(l.ok&&typeof l.data=="string"){let s=l.data;S.resource?.set(a,s),S.font?.add(a),r=r.replace(o[0],`url(${s})`)}}catch{console.warn("[snapDOM] Failed to fetch font resource:",a)}}}return r}function Du(e){if(!e.length)return null;let t=(a,l)=>e.some(([s,c])=>!(cl)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),o=t(880,1023),i=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?"vietnamese":i?"cyrillic":o?"greek":r?"latin-ext":n?"latin":null}function va(e={}){let t=new Set((e.families||[]).map(o=>String(o).toLowerCase())),n=new Set((e.domains||[]).map(o=>String(o).toLowerCase())),r=new Set((e.subsets||[]).map(o=>String(o).toLowerCase()));return(o,i)=>{if(t.size&&t.has(o.family.toLowerCase()))return!0;if(n.size)for(let a of o.srcUrls)try{if(n.has(new URL(a).host.toLowerCase()))return!0}catch{}if(r.size){let a=Du(i);if(a&&r.has(a))return!0}return!1}}function Wu(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let a=i.match(/font-family:\s*([^;]+);/i)?.[1]||"",l=gn(a),s=(i.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),c=(i.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),u=(i.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),f=(i.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),d=(i.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),p=Dr(d,location.href),m=p.length?p.map(g=>String(g).toLowerCase()).sort().join("|"):d.toLowerCase(),h=[String(l||"").toLowerCase(),s,c,u,f.toLowerCase(),m].join("|");n.has(h)||(n.add(h),r.push(i))}if(r.length===0)return e;let o=0;return e.replace(t,()=>r[o++]||"")}function qu(e,t,n,r){let o=Array.from(e||[]).sort().join("|"),i=t?JSON.stringify({families:(t.families||[]).map(l=>String(l).toLowerCase()).sort(),domains:(t.domains||[]).map(l=>String(l).toLowerCase()).sort(),subsets:(t.subsets||[]).map(l=>String(l).toLowerCase()).sort()}):"",a=(n||[]).map(l=>`${(l.family||"").toLowerCase()}::${l.weight||"normal"}::${l.style||"normal"}::${l.src||""}`).sort().join("|");return`fonts-embed-css::req=${o}::ex=${i}::lf=${a}::px=${r||""}`}async function Xa(e,t,n,r){let o;try{o=e.cssRules||[]}catch{return}let i=(a,l)=>{try{return new URL(a,l||location.href).href}catch{return a}};for(let a of o){if(a.type===CSSRule.IMPORT_RULE&&a.styleSheet){let l=a.href?i(a.href,t):t;if(r.depth>=fn){console.warn(`[snapDOM] CSSOM import depth exceeded (${fn}) at ${l}`);continue}if(l&&r.visitedSheets.has(l)){console.warn(`[snapDOM] Skipping circular CSSOM import: ${l}`);continue}l&&r.visitedSheets.add(l);let s={...r,depth:(r.depth||0)+1};await Xa(a.styleSheet,l,n,s);continue}if(a.type===CSSRule.FONT_FACE_RULE){let l=(a.style.getPropertyValue("font-family")||"").trim(),s=gn(l);if(!s||de(s))continue;let c=(a.style.getPropertyValue("font-weight")||"400").trim(),u=(a.style.getPropertyValue("font-style")||"normal").trim(),f=(a.style.getPropertyValue("font-stretch")||"100%").trim(),d=(a.style.getPropertyValue("src")||"").trim(),p=(a.style.getPropertyValue("unicode-range")||"").trim();if(!r.faceMatchesRequired(s,u,c,f))continue;let m=Va(p);if(!Ga(r.usedCodepoints,m))continue;let h={family:s,weightSpec:c,styleSpec:u,stretchSpec:f,unicodeRange:p,srcRaw:d,srcUrls:Dr(d,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(h,m))continue;if(/url\(/i.test(d)){let g=await ja(d,t||location.href,r.useProxy);await n(`@font-face{font-family:${s};src:${g};font-style:${u};font-weight:${c};font-stretch:${f};${p?`unicode-range:${p};`:""}}`)}else await n(`@font-face{font-family:${s};src:${d};font-style:${u};font-weight:${c};font-stretch:${f};${p?`unicode-range:${p};`:""}}`)}}}async function Bu({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:o=""}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let i=new Map;for(let h of e){let[g,y,w,v]=String(h).split("__");if(!g)continue;let b=i.get(g)||[];b.push({w:parseInt(y,10),s:w,st:parseInt(v,10)}),i.set(g,b)}function a(h,g,y,w){if(!i.has(h))return!1;let v=i.get(h),b=$u(y),C=Ru(g),x=Nu(w),M=b.min!==b.max,k=b.min,T=L=>C.kind==="normal"&&L==="normal"||C.kind!=="normal"&&(L==="italic"||L==="oblique"),N=!1;for(let L of v){let P=M?L.w>=b.min&&L.w<=b.max:L.w===k,_=T(un(L.s)),V=L.st>=x.min&&L.st<=x.max;if(P&&_&&V){N=!0;break}}if(N)return!0;if(!M)for(let L of v){let P=T(un(L.s)),_=L.st>=x.min&&L.st<=x.max;if(Math.abs(k-L.w)<=300&&P&&_)return!0}if(!M&&C.kind==="normal"&&v.some(L=>un(L.s)!=="normal"))for(let L of v){let P=Math.abs(k-L.w)<=300,_=L.st>=x.min&&L.st<=x.max;if(P&&_)return!0}return!1}let l=va(n),s=qu(e,n,r,o);if(S.resource?.has(s))return S.resource.get(s);let c=Fu(e),u=[],f=Ir;for(let h of document.querySelectorAll("style")){let g=h.textContent||"";for(let y of g.matchAll(f)){let w=(y[2]||y[4]||"").trim();!w||de(w)||document.querySelector(`link[rel="stylesheet"][href="proxy.php?url=${w}"]`)||u.push(w)}}u.length&&await Promise.all(u.map(h=>new Promise(g=>{if(document.querySelector(`link[rel="stylesheet"][href="proxy.php?url=${h}"]`))return g(null);let y=document.createElement("link");y.rel="stylesheet",y.href=h,y.setAttribute("data-snapdom","injected-import"),y.onload=()=>g(y),y.onerror=()=>g(null),document.head.appendChild(y)})));let d="",p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(h=>!!h.href);for(let h of p)try{if(de(h.href))continue;let g="",y=!1;try{y=new URL(h.href,location.href).origin===location.origin}catch{}if(!y&&!Pu(h.href,c))continue;if(y){let v=Array.from(document.styleSheets).find(b=>b.href===h.href);if(v)try{let b=v.cssRules||[];g=Array.from(b).map(C=>C.cssText).join("")}catch{}}if(!g){let v=await ne(h.href,{as:"text",useProxy:o});if(v?.ok&&typeof v.data=="string"&&(g=v.data),de(h.href))continue}g=await zu(g,h.href,o);let w="";for(let v of g.match(Hu)||[]){let b=(v.match(/font-family:\s*([^;]+);/i)?.[1]||"").trim(),C=gn(b);if(!C||de(C))continue;let x=(v.match(/font-weight:\s*([^;]+);/i)?.[1]||"400").trim(),M=(v.match(/font-style:\s*([^;]+);/i)?.[1]||"normal").trim(),k=(v.match(/font-stretch:\s*([^;]+);/i)?.[1]||"100%").trim(),T=(v.match(/unicode-range:\s*([^;]+);/i)?.[1]||"").trim(),N=(v.match(/src\s*:\s*([^;}]+)[;}]/i)?.[1]||"").trim(),L=Dr(N,h.href);if(!a(C,M,x,k))continue;let P=Va(T);if(!Ga(t,P))continue;let _={family:C,weightSpec:x,styleSpec:M,stretchSpec:k,unicodeRange:T,srcRaw:N,srcUrls:L,href:h.href};if(n&&l(_,P))continue;let V=/url\(/i.test(N)?await ja(v,h.href,o):v;w+=V}w.trim()&&(d+=w)}catch{console.warn("[snapDOM] Failed to process stylesheet:",h.href)}let m={requiredIndex:i,usedCodepoints:t,faceMatchesRequired:a,simpleExcluder:n?va(n):null,useProxy:o,visitedSheets:new Set,depth:0};for(let h of document.styleSheets)if(!(h.href&&p.some(g=>g.href===h.href)))try{let g=h.href||location.origin+"/";g&&m.visitedSheets.add(g),await Xa(h,g,async y=>{d+=y},m)}catch{}try{for(let h of document.fonts||[]){if(!h||!h.family||h.status!=="loaded"||!h._snapdomSrc)continue;let g=String(h.family).replace(/^['"]+|['"]+$/g,"");if(de(g)||!i.has(g)||n?.families&&n.families.some(w=>String(w).toLowerCase()===g.toLowerCase()))continue;let y=h._snapdomSrc;if(!String(y).startsWith("data:")){if(S.resource?.has(h._snapdomSrc))y=S.resource.get(h._snapdomSrc),S.font?.add(h._snapdomSrc);else if(!S.font?.has(h._snapdomSrc))try{let w=await ne(h._snapdomSrc,{as:"dataURL",useProxy:o,silent:!0});if(w.ok&&typeof w.data=="string")y=w.data,S.resource?.set(h._snapdomSrc,y),S.font?.add(h._snapdomSrc);else continue}catch{console.warn("[snapDOM] Failed to fetch dynamic font src:",h._snapdomSrc);continue}}d+=`@font-face{font-family:'${g}';src:url(${y});font-style:${h.style||"normal"};font-weight:${h.weight||"normal"};}`}}catch{}for(let h of r){if(!h||typeof h!="object")continue;let g=String(h.family||"").replace(/^['"]+|['"]+$/g,"");if(!g||de(g)||!i.has(g)||n?.families&&n.families.some(x=>String(x).toLowerCase()===g.toLowerCase()))continue;let y=h.weight!=null?String(h.weight):"normal",w=h.style!=null?String(h.style):"normal",v=h.stretchPct!=null?`${h.stretchPct}%`:"100%",b=String(h.src||""),C=b;if(!C.startsWith("data:")){if(S.resource?.has(b))C=S.resource.get(b),S.font?.add(b);else if(!S.font?.has(b))try{let x=await ne(b,{as:"dataURL",useProxy:o,silent:!0});if(x.ok&&typeof x.data=="string")C=x.data,S.resource?.set(b,C),S.font?.add(b);else continue}catch{console.warn("[snapDOM] Failed to fetch localFonts src:",b);continue}}d+=`@font-face{font-family:'${g}';src:url(${C});font-style:${w};font-weight:${y};font-stretch:${v};}`}return d&&(d=Wu(d),S.resource?.set(s,d)),d}function Uu(e){let t=new Set;if(!e)return t;let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,null),r=a=>{let l=gn(a.fontFamily);if(!l)return;let s=(c,u,f)=>`${l}__${cn(c)}__${un(u)}__${Iu(f)}`;t.add(s(a.fontWeight,a.fontStyle,a.fontStretch))};r(getComputedStyle(e));let o=getComputedStyle(e,"::before");o&&o.content&&o.content!=="none"&&r(o);let i=getComputedStyle(e,"::after");for(i&&i.content&&i.content!=="none"&&r(i);n.nextNode();){let a=n.currentNode,l=getComputedStyle(a);r(l);let s=getComputedStyle(a,"::before");s&&s.content&&s.content!=="none"&&r(s);let c=getComputedStyle(a,"::after");c&&c.content&&c.content!=="none"&&r(c)}return t}function Vu(e){let t=new Set,n=o=>{if(o)for(let i of o)t.add(i.codePointAt(0))},r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;r.nextNode();){let o=r.currentNode;if(o.nodeType===Node.TEXT_NODE)n(o.nodeValue||"");else if(o.nodeType===Node.ELEMENT_NODE){let i=o;for(let a of["::before","::after"]){let l=getComputedStyle(i,a)?.getPropertyValue("content");if(!(!l||l==="none"))if(/^"/.test(l)||/^'/.test(l))n(l.slice(1,-1));else{let s=l.match(/\\[0-9A-Fa-f]{1,6}/g);if(s)for(let c of s)try{t.add(parseInt(c.slice(1),16))}catch{}}}}}return t}async function Gu(e,t=2){try{await document.fonts.ready}catch{}let n=Array.from(e||[]).filter(Boolean);if(n.length===0)return;let r=()=>{let o=document.createElement("div");o.style.cssText="position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;";for(let i of n){let a=document.createElement("span");a.textContent="AaBbGg1234\xC1\xC9\xCD\xD3\xDA\xE7\xF1\u2014\u221E",a.style.fontFamily=`"${i}"`,a.style.fontWeight="700",a.style.fontStyle="italic",a.style.fontSize="32px",a.style.lineHeight="1",a.style.whiteSpace="nowrap",a.style.margin="0",a.style.padding="0",o.appendChild(a)}document.body.appendChild(o),o.offsetWidth,document.body.removeChild(o)};for(let o=0;orequestAnimationFrame(()=>requestAnimationFrame(i)))}function ju(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||"")}function Xu(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Sa(e,t=!1){let n="",r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function xa(e,t=!0){let n=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],r=Math.max(1,Math.min(3999,e)),o="";for(let[i,a]of n)for(;r>=i;)o+=a,r-=i;return t?o:o.toLowerCase()}function Ca(e,t){switch((t||"decimal").toLowerCase()){case"decimal":return String(Math.max(0,e));case"decimal-leading-zero":return(e<10?"0":"")+String(Math.max(0,e));case"lower-alpha":return Sa(e,!1);case"upper-alpha":return Sa(e,!0);case"lower-roman":return xa(e,!1);case"upper-roman":return xa(e,!0);default:return String(Math.max(0,e))}}function Yu(e){let t=()=>S?.session?.__counterEpoch??0,n=t(),r=new WeakMap,o=e instanceof Document?e.documentElement:e,i=d=>d&&d.tagName==="LI",a=d=>{let p=0,m=d?.parentElement;if(!m)return 0;for(let h of m.children){if(h===d)break;h.tagName==="LI"&&p++}return p},l=d=>{let p=new Map;for(let[m,h]of d)p.set(m,h.slice());return p},s=(d,p,m)=>{let h=l(d),g;try{g=m.style?.counterReset||getComputedStyle(m).counterReset}catch{}if(g&&g!=="none")for(let w of g.split(",")){let v=w.trim().split(/\s+/),b=v[0],C=Number.isFinite(Number(v[1]))?Number(v[1]):0;if(!b)continue;let x=p.get(b);if(x&&x.length){let M=x.slice();M.push(C),h.set(b,M)}else h.set(b,[C])}let y;try{y=m.style?.counterIncrement||getComputedStyle(m).counterIncrement}catch{}if(y&&y!=="none")for(let w of y.split(",")){let v=w.trim().split(/\s+/),b=v[0],C=Number.isFinite(Number(v[1]))?Number(v[1]):1;if(!b)continue;let x=h.get(b)||[];x.length===0&&x.push(0),x[x.length-1]+=C,h.set(b,x)}try{if(getComputedStyle(m).display==="list-item"&&i(m)){let w=m.parentElement,v=1;if(w&&w.tagName==="OL"){let C=w.getAttribute("start"),x=Number.isFinite(Number(C))?Number(C):1,M=a(m),k=m.getAttribute("value");v=Number.isFinite(Number(k))?Number(k):x+M}else v=1+a(m);let b=h.get("list-item")||[];b.length===0&&b.push(0),b[b.length-1]=v,h.set("list-item",b)}}catch{}return h},c=(d,p,m)=>{let h=s(m,p,d);r.set(d,h);let g=h;for(let y of d.children)g=c(y,h,g);return h},u=new Map;c(o,u,u);function f(){let d=t();if(d!==n){n=d;let p=new Map;c(o,p,p)}}return{get(d,p){f();let m=r.get(d)?.get(p);return m&&m.length?m[m.length-1]:0},getStack(d,p){f();let m=r.get(d)?.get(p);return m?m.slice():[]}}}function Zu(e,t,n){if(!e||e==="none")return e;try{let r=/\b(counter|counters)\s*\(([^)]+)\)/g,o=e.replace(r,(i,a,l)=>{let s=String(l).split(",").map(c=>c.trim());if(a==="counter"){let c=s[0]?.replace(/^["']|["']$/g,""),u=(s[1]||"decimal").toLowerCase(),f=n.get(t,c);return Ca(f,u)}else{let c=s[0]?.replace(/^["']|["']$/g,""),u=s[1]?.replace(/^["']|["']$/g,"")??"",f=(s[2]||"decimal").toLowerCase(),d=n.getStack(t,c);return d.length?d.map(p=>Ca(p,f)).join(u):""}});return Xu(o)}catch{return"- "}}function Ku(e,t){let n=Ya(e);return t?(t.__pseudoPreflightFp!==n&&(t.__pseudoPreflight=Aa(e),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):Aa(e)}function $r(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Ya(e){let t=e.querySelectorAll('style,link[rel~="stylesheet"]'),n=`n:${t.length}|`,r=0;for(let i=0;i0;l++){let s=i.cssRules[l],c=s&&s.cssText?s.cssText:"";n.budget--;for(let u of t)if(c.includes(u))return!0}if(n.budget<=0)return!1}return!1}function Aa(e=document){let t=Ya(e),n=Ge.get(e);if(n&&n.fingerprint===t)return n.result;let r=["::before","::after","::first-letter",":before",":after",":first-letter","counter(","counters(","counter-increment","counter-reset"],o=e.querySelectorAll("style");for(let a=0;a0;s++){let c=a[s],u=null;if(c.tagName,u=c.sheet||null,u&&Ma(u,r,l))return Ge.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector('[style*="counter("], [style*="counters("]')?(Ge.set(e,{fingerprint:t,result:!0}),!0):(Ge.set(e,{fingerprint:t,result:!1}),!1)}function Qu(e){return(e||"").replace(/"([^"]*)"/g,"$1")}function Ju(e){if(!e)return"";let t=[],n=/"([^"]*)"/g,r;for(;r=n.exec(e);)t.push(r[1]);return t.length?t.join(""):Qu(e)}function Rr(e,t){let n=e.parentElement,r=n?Ye.get(n):null;return r?{get(o,i){let a=t.get(o,i),l=r.get(i);return typeof l=="number"?Math.max(a,l):a},getStack(o,i){let a=t.getStack(o,i);if(!a.length)return a;let l=r.get(i);if(typeof l=="number"){let s=a.slice();return s[s.length-1]=Math.max(s[s.length-1],l),s}return a}}:t}function Nr(e,t,n){let r=new Map;function o(s){let c=[];if(!s||s==="none")return c;for(let u of String(s).split(",")){let f=u.trim().split(/\s+/),d=f[0],p=Number.isFinite(Number(f[1]))?Number(f[1]):void 0;d&&c.push({name:d,num:p})}return c}let i=o(t?.counterReset),a=o(t?.counterIncrement);function l(s){if(r.has(s))return r.get(s).slice();let c=n.getStack(e,s);c=c.length?c.slice():[];let u=i.find(d=>d.name===s);if(u){let d=Number.isFinite(u.num)?u.num:0;c=c.length?[...c,d]:[d]}let f=a.find(d=>d.name===s);if(f){let d=Number.isFinite(f.num)?f.num:1;c.length===0&&(c=[0]),c[c.length-1]+=d}return r.set(s,c.slice()),c}return{get(s,c){let u=l(c);return u.length?u[u.length-1]:0},getStack(s,c){return l(c)},__incs:a}}function ed(e,t,n){let r;try{r=getComputedStyle(e,t)}catch{}let o=r?.content;if(!o||o==="none"||o==="normal")return{text:"",incs:[]};let i=Rr(e,n),a=Nr(e,r,i),l=ju(o)?Zu(o,e,a):o;return{text:Ju(l),incs:a.__incs||[]}}async function Pr(e,t,n,r){if(!(e instanceof Element)||!(t instanceof Element))return;let o=e.ownerDocument||document;if(!Ku(o,n))return;let i=S?.session?.__counterEpoch??0;if(_a!==i&&(Ye=new WeakMap,n&&(n.__counterCtx=null),_a=i),!n.__counterCtx)try{n.__counterCtx=Yu(e.ownerDocument||document)}catch{}let a=n.__counterCtx;for(let s of["::before","::after","::first-letter"])try{let c=Ia(e,s);if(!c||c.content==="none"&&c.backgroundImage==="none"&&c.backgroundColor==="transparent"&&(c.borderStyle==="none"||parseFloat(c.borderWidth)===0)&&(!c.transform||c.transform==="none")&&c.display==="inline")continue;if(s==="::first-letter"){let F=getComputedStyle(e);if(!(c.color!==F.color||c.fontSize!==F.fontSize||c.fontWeight!==F.fontWeight))continue;let O=Array.from(t.childNodes).find(Et=>Et.nodeType===Node.TEXT_NODE&&Et.textContent?.trim().length>0);if(!O)continue;let q=O.textContent,D=q.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],fe=q.slice(D?.length||0);if(!D||/[\uD800-\uDFFF]/.test(D))continue;let oe=document.createElement("span");oe.textContent=D,oe.dataset.snapdomPseudo="::first-letter";let Le=da(c),Ct=Mr(Le,"span");n.styleMap.set(oe,Ct);let Ke=document.createTextNode(fe);t.replaceChild(Ke,O),t.insertBefore(oe,Ke);continue}let u=c.content??"",f=u===""||u==="none"||u==="normal",{text:d,incs:p}=ed(e,s,a),m=c.backgroundImage,h=c.backgroundColor,g=c.fontFamily,y=parseInt(c.fontSize)||32,w=parseInt(c.fontWeight)||!1,v=c.color||"#000",b=c.borderStyle,C=parseFloat(c.borderWidth),x=c.transform,M=de(g),k=!f&&d!=="",T=m&&m!=="none",N=h&&h!=="transparent"&&h!=="rgba(0, 0, 0, 0)",L=b&&b!=="none"&&C>0,P=x&&x!=="none";if(!(k||T||N||L||P)){if(p&&p.length&&e.parentElement){let F=Ye.get(e.parentElement)||new Map;for(let{name:O}of p){if(!O)continue;let q=Rr(e,a),D=Nr(e,getComputedStyle(e,s),q).get(e,O);F.set(O,D)}Ye.set(e.parentElement,F)}continue}let _=document.createElement("span");_.dataset.snapdomPseudo=s,_.style.pointerEvents="none";let V=da(c),Q=Mr(V,"span");if(n.styleMap.set(_,Q),M&&d&&d.length===1){let{dataUrl:F,width:O,height:q}=await ku(d,g,w,y,v),D=document.createElement("img");D.src=F,D.style=`height:${y}px;width:${O/q*y}px;object-fit:contain;`,_.appendChild(D),t.dataset.snapdomHasIcon="true"}else if(d&&d.startsWith("url(")){let F=zr(d);if(F?.trim())try{let O=await ne(dn(F),{as:"dataURL",useProxy:r.useProxy});if(O?.ok&&typeof O.data=="string"){let q=document.createElement("img");q.src=O.data,q.style=`width:${y}px;height:auto;object-fit:contain;`,_.appendChild(q)}}catch(O){console.error(`[snapdom] Error in pseudo ${s} for`,e,O)}}else!M&&k&&(_.textContent=d);_.style.backgroundImage="none","maskImage"in _.style&&(_.style.maskImage="none"),"webkitMaskImage"in _.style&&(_.style.webkitMaskImage="none");try{_.style.backgroundRepeat=c.backgroundRepeat,_.style.backgroundSize=c.backgroundSize,c.backgroundPositionX&&c.backgroundPositionY?(_.style.backgroundPositionX=c.backgroundPositionX,_.style.backgroundPositionY=c.backgroundPositionY):_.style.backgroundPosition=c.backgroundPosition,_.style.backgroundOrigin=c.backgroundOrigin,_.style.backgroundClip=c.backgroundClip,_.style.backgroundAttachment=c.backgroundAttachment,_.style.backgroundBlendMode=c.backgroundBlendMode}catch{}if(T)try{let F=$a(m),O=await Promise.all(F.map(Ta));_.style.backgroundImage=O.join(", ")}catch(F){console.warn(`[snapdom] Failed to inline background-image for ${s}`,F)}N&&(_.style.backgroundColor=h);let Y=_.childNodes.length>0||_.textContent?.trim()!==""||T||N||L||P;if(p&&p.length&&e.parentElement){let F=Ye.get(e.parentElement)||new Map,O=Rr(e,a),q=Nr(e,getComputedStyle(e,s),O);for(let{name:D}of p){if(!D)continue;let fe=q.get(e,D);F.set(D,fe)}Ye.set(e.parentElement,F)}if(!Y)continue;s==="::before"?t.insertBefore(_,t.firstChild):t.appendChild(_)}catch(c){console.warn(`[snapdom] Failed to capture ${s} for`,e,c)}let l=Array.from(t.children).filter(s=>!s.dataset.snapdomPseudo);if(n.nodeMap)for(let s of l){let c=n.nodeMap.get(s);c instanceof Element&&await Pr(c,s,n,r)}else{let s=Array.from(e.children);for(let c=0;cwindow.CSS&&CSS.escape?CSS.escape(b):b.replace(/[^a-zA-Z0-9_-]/g,"\\$&"),s="http://www.w3.org/1999/xlink",c=b=>{if(!b||!b.getAttribute)return null;let C=b.getAttribute("href")||b.getAttribute("xlink:href")||(typeof b.getAttributeNS=="function"?b.getAttributeNS(s,"href"):null);if(C)return C;let x=b.attributes;if(!x)return null;for(let M=0;Mb.id)),f=new Set,d=!1,p=(b,C=null)=>{if(!b)return;i.lastIndex=0;let x;for(;x=i.exec(b);){d=!0;let M=(x[1]||"").trim();M&&(u.has(M)||(f.add(M),C&&!C.has(M)&&C.add(M)))}},m=b=>{let C=b.querySelectorAll("use");for(let M of C){let k=c(M);if(!k||!k.startsWith("#"))continue;d=!0;let T=k.slice(1).trim();T&&!u.has(T)&&f.add(T)}let x=b.querySelectorAll('*[style*="url("],*[fill^="url("], *[stroke^="url("],*[filter^="url("],*[clip-path^="url("],*[mask^="url("],*[marker^="url("],*[marker-start^="url("],*[marker-mid^="url("],*[marker-end^="url("]');for(let M of x){p(M.getAttribute("style")||"");for(let k of a)p(M.getAttribute(k))}};for(let b of o)m(b);if(!d)return;let h=e.querySelector("svg.inline-defs-container");h||(h=n.createElementNS("http://www.w3.org/2000/svg","svg"),h.classList.add("inline-defs-container"),h.setAttribute("aria-hidden","true"),h.setAttribute("style","position:absolute;width:0;height:0;overflow:hidden"),e.insertBefore(h,e.firstChild||null));let g=h.querySelector("defs")||null,y=b=>{if(!b||u.has(b))return null;let C=l(b),x=M=>{let k=r.querySelector(M);return k&&!e.contains(k)?k:null};return x(`svg defs > *#${C}`)||x(`svg > symbol#${C}`)||x(`*#${C}`)};if(!f.size)return;let w=new Set(f),v=new Set;for(;w.size;){let b=w.values().next().value;if(w.delete(b),!b||u.has(b)||v.has(b))continue;let C=y(b);if(!C){v.add(b);continue}g||(g=n.createElementNS("http://www.w3.org/2000/svg","defs"),h.appendChild(g));let x=C.cloneNode(!0);x.id||x.setAttribute("id",b),g.appendChild(x),v.add(b),u.add(b);let M=[x,...x.querySelectorAll("*")];for(let k of M){let T=c(k);if(T&&T.startsWith("#")){let L=T.slice(1).trim();L&&!u.has(L)&&!v.has(L)&&w.add(L)}let N=k.getAttribute?.("style")||"";N&&p(N,w);for(let L of a){let P=k.getAttribute?.(L);P&&p(P,w)}}}}function nd(e,t){if(!e||!t)return;let n=e.scrollTop||0;if(!n)return;getComputedStyle(t).position==="static"&&(t.style.position="relative");let r=e.getBoundingClientRect(),o=e.clientHeight,i="data-snap-ph",a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;a.nextNode();){let l=a.currentNode,s=getComputedStyle(l),c=s.position;if(c!=="sticky"&&c!=="-webkit-sticky")continue;let u=La(s.top),f=La(s.bottom);if(u==null&&f==null)continue;let d=rd(l,e),p=od(t,d,i);if(!p)continue;let m=l.getBoundingClientRect(),h=m.width,g=m.height,y=m.left-r.left;if(!(h>0&&g>0)||!Number.isFinite(y))continue;let w=u!=null?u+n:n+(o-g-f);if(!Number.isFinite(w))continue;let v=Number.parseInt(s.zIndex,10),b=Number.isFinite(v),C=b?Math.max(v,1)+1:2,x=b?v-1:0,M=p.cloneNode(!1);M.setAttribute(i,"1"),M.style.position="sticky",M.style.left=`${y}px`,M.style.top=`${w}px`,M.style.width=`${h}px`,M.style.height=`${g}px`,M.style.visibility="hidden",M.style.zIndex=String(x),M.style.overflow="hidden",M.style.background="transparent",M.style.boxShadow="none",M.style.filter="none",p.parentElement?.insertBefore(M,p),p.style.position="absolute",p.style.left=`${y}px`,p.style.top=`${w}px`,p.style.bottom="auto",p.style.zIndex=String(C),p.style.pointerEvents="none"}}function La(e){if(!e||e==="auto")return null;let t=Number.parseFloat(e);return Number.isFinite(t)?t:null}function rd(e,t){let n=[];for(let r=e;r&&r!==t;){let o=r.parentElement;if(!o)break;n.push(Array.prototype.indexOf.call(o.children,r)),r=o}return n.reverse()}function od(e,t,n){let r=e;for(let o=0;o0,l=o==="none"||parseFloat(i)===0;a&&l&&(e.style.border=`${r} solid transparent`)}async function ld(e,t={}){let n={styleMap:S.session.styleMap,styleCache:S.session.styleCache,nodeMap:S.session.nodeMap},r,o="",i="";ad(e);try{td(e)}catch(s){console.warn("inlineExternal defs or symbol failed:",s)}try{r=await sn(e,n,t,e)}catch(s){throw console.warn("deepClone failed:",s),s}try{await Pr(e,r,n,t)}catch(s){console.warn("inlinePseudoElements failed:",s)}await bu(r);try{let s=r.querySelectorAll("style[data-sd]");for(let c of s)i+=c.textContent||"",c.remove()}catch{}let a=Oc(n.styleMap);o=Array.from(a.entries()).map(([s,c])=>`.${c}{${s}}`).join(""),o=i+o;for(let[s,c]of n.styleMap.entries()){if(s.tagName==="STYLE")continue;if(s.getRootNode&&s.getRootNode()instanceof ShadowRoot){s.setAttribute("style",c.replace(/;/g,"; "));continue}let u=a.get(c);u&&s.classList.add(u);let f=s.style?.backgroundImage,d=s.dataset?.snapdomHasIcon;f&&f!=="none"&&(s.style.backgroundImage=f),d&&(s.style.verticalAlign="middle",s.style.display="inline")}for(let[s,c]of n.nodeMap.entries()){let u=c.scrollLeft,f=c.scrollTop;if((u||f)&&s instanceof HTMLElement){s.style.overflow="hidden",s.style.scrollbarWidth="none",s.style.msOverflowStyle="none";let d=document.createElement("div");for(d.style.transform=`translate(${-u}px, ${-f}px)`,d.style.willChange="transform",d.style.display="inline-block",d.style.width="100%";s.firstChild;)d.appendChild(s.firstChild);s.appendChild(d)}}let l=r instanceof HTMLElement&&r.firstElementChild instanceof HTMLElement?r.firstElementChild:r;if(nd(e,l),e===n.nodeMap.get(r)){let s=n.styleCache.get(e)||window.getComputedStyle(e);n.styleCache.set(e,s);let c=vc(s.transform);r.style.margin="0",r.style.top="auto",r.style.left="auto",r.style.right="auto",r.style.bottom="auto",r.style.animation="none",r.style.transition="none",r.style.willChange="auto",r.style.float="none",r.style.clear="none",r.style.transform=c||""}for(let[s,c]of n.nodeMap.entries())c.tagName==="PRE"&&(s.style.marginTop="0",s.style.marginBlockStart="0");return{clone:r,classCSS:o,styleCache:n.styleCache}}function sd(e){let t=parseInt(e.dataset?.snapdomWidth||"",10)||0,n=parseInt(e.dataset?.snapdomHeight||"",10)||0,r=parseInt(e.getAttribute("width")||"",10)||0,o=parseInt(e.getAttribute("height")||"",10)||0,i=parseFloat(e.style?.width||"")||0,a=parseFloat(e.style?.height||"")||0,l=t||i||r||e.width||e.naturalWidth||100,s=n||a||o||e.height||e.naturalHeight||100;return{width:l,height:s}}async function cd(e,t={}){let n=Array.from(e.querySelectorAll("img")),r=async o=>{if(!o.getAttribute("src")){let u=o.currentSrc||o.src||"";u&&o.setAttribute("src",u)}o.removeAttribute("srcset"),o.removeAttribute("sizes");let i=o.src||"";if(!i)return;let a=await ne(i,{as:"dataURL",useProxy:t.useProxy});if(a.ok&&typeof a.data=="string"&&a.data.startsWith("data:")){o.src=a.data,o.width||(o.width=o.naturalWidth||100),o.height||(o.height=o.naturalHeight||100);return}let{width:l,height:s}=sd(o),{fallbackURL:c}=t||{};if(c)try{let u=typeof c=="function"?await c({width:l,height:s,src:i,element:o}):c;if(u){let f=await ne(u,{as:"dataURL",useProxy:t.useProxy});if(f?.ok&&typeof f.data=="string"){o.src=f.data,o.width||(o.width=l),o.height||(o.height=s);return}}}catch{}if(t.placeholders!==!1){let u=document.createElement("div");u.style.cssText=[`width:${l}px`,`height:${s}px`,"background:#ccc","display:inline-block","text-align:center",`line-height:${s}px`,"color:#666","font-size:12px","overflow:hidden"].join(";"),u.textContent="img",o.replaceWith(u)}else{let u=document.createElement("div");u.style.cssText=`display:inline-block;width:${l}px;height:${s}px;visibility:hidden;`,o.replaceWith(u)}};for(let o=0;o{let h=f.getPropertyValue("border-image"),g=f.getPropertyValue("border-image-source");return h&&h!=="none"||g&&g!=="none"})();for(let h of l){let g=f.getPropertyValue(h);g&&u.style.setProperty(h,g)}for(let h of i){let g=f.getPropertyValue(h);if(!g||g==="none")continue;let y=$a(g),w=await Promise.all(y.map(v=>Ta(v,r)));w.some(v=>v&&v!=="none"&&!/^url\(undefined/.test(v))&&u.style.setProperty(h,w.join(", "))}for(let h of a){let g=f.getPropertyValue(h);!g||g==="initial"||u.style.setProperty(h,g)}if(d)for(let h of s){let g=f.getPropertyValue(h);!g||g==="initial"||u.style.setProperty(h,g)}let p=c.shadowRoot?Array.from(c.shadowRoot.children).filter(h=>h.tagName!=="STYLE"):Array.from(c.children),m=Array.from(u.children).filter(h=>!(h.dataset?.snapdomPseudo||h.tagName==="STYLE"&&h.dataset?.sd));for(let h=0;h{};let t=fd(e);if(t<=0)return()=>{};if(!pd(e))return()=>{};let n=getComputedStyle(e),r=Math.round(hd(n)*t+md(n)),o=e.textContent??"",i=o;if(e.scrollHeight<=r+.5)return()=>{};let a=0,l=o.length,s=-1;for(;a<=l;){let c=a+l>>1;e.textContent=o.slice(0,c)+"\u2026",e.scrollHeight<=r+.5?(s=c,a=c+1):l=c-1}return e.textContent=(s>=0?o.slice(0,s):"")+"\u2026",()=>{e.textContent=i}}function fd(e){let t=getComputedStyle(e),n=t.getPropertyValue("-webkit-line-clamp")||t.getPropertyValue("line-clamp");n=(n||"").trim();let r=parseInt(n,10);return Number.isFinite(r)&&r>0?r:0}function hd(e){let t=(e.lineHeight||"").trim(),n=parseFloat(e.fontSize)||16;return!t||t==="normal"?Math.round(n*1.2):t.endsWith("px")?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith("%")?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function md(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function pd(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(t=>t.nodeType===Node.TEXT_NODE)}function Za(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t=="function"?t(n):t}if(typeof e=="object"&&"plugin"in e){let{plugin:t,options:n}=e;return typeof t=="function"?t(n):t}return typeof e=="function"?e():e}function gd(...e){let t=e.flat();for(let n of t){let r=Za(n);r&&(St.some(o=>o&&o.name&&r.name&&o.name===r.name)||St.push(r))}}function Ka(e){return(e&&Array.isArray(e.plugins)?e.plugins:St)||St}async function Se(e,t,n){let r=n,o=Ka(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let l=await a(t,r);typeof l<"u"&&(r=l)}return r}async function yd(e,t,n){let r=[],o=Ka(t);for(let i of o){let a=i&&typeof i[e]=="function"?i[e]:null;if(!a)continue;let l=await a(t,n);typeof l<"u"&&r.push(l)}return r}function wd(e){let t=[];if(Array.isArray(e))for(let n of e){let r=Za(n);if(!r||!r.name)continue;let o=t.findIndex(i=>i&&i.name===r.name);o>=0&&t.splice(o,1),t.push(r)}for(let n of St)n&&n.name&&!t.some(r=>r.name===n.name)&&t.push(n);return Object.freeze(t)}function bd(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=wd(t)),e}function vd(e,t){if(!e||!t||!t.style)return;let n=getComputedStyle(e);try{t.style.boxShadow="none"}catch{}try{t.style.textShadow="none"}catch{}try{t.style.outline="none"}catch{}let r=(n.filter||"").replace(/\bblur\([^()]*\)\s*/gi,"").replace(/\bdrop-shadow\([^()]*\)\s*/gi,"").trim().replace(/\s+/g," ");try{t.style.filter=r.length?r:"none"}catch{}}function Sd(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),n=[];for(;t.nextNode();)n.push(t.currentNode);for(let r of n)r.remove()}function xd(e,t={}){let{stripFrameworkDirectives:n=!0}=t,r=new Set(["xml","xlink"]),o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;o.nextNode();){let i=o.currentNode;for(let a of Array.from(i.attributes)){let l=a.name;if(l.includes("@")){i.removeAttribute(l);continue}if(l.includes(":")){let s=l.split(":",1)[0];if(!r.has(s)){i.removeAttribute(l);continue}}if(n&&(l.startsWith("x-")||l.startsWith("v-")||l.startsWith(":")||l.startsWith("on:")||l.startsWith("bind:")||l.startsWith("let:")||l.startsWith("class:"))){i.removeAttribute(l);continue}}}}function Cd(e,t={}){e&&(xd(e,t),Sd(e))}function Ed(e){try{let t=e.getAttribute?.("style")||"";return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}function Md(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLIFrameElement||e instanceof SVGElement||e instanceof HTMLObjectElement||e instanceof HTMLEmbedElement}function Ad(e,t){if(!(e instanceof Element)||Ed(e)||Md(e))return!1;let n=t.position;if(n==="absolute"||n==="fixed"||n==="sticky")return!1;let r=t.display||"";return!(r.includes("flex")||r.includes("grid")||r.startsWith("table")||t.transform&&t.transform!=="none")}function _d(e,t,n=new Map){function r(o,i){if(!(o instanceof Element)||!(i instanceof Element))return;let a=o.childElementCount>i.childElementCount,l=n.get(o)||getComputedStyle(o);if(n.has(o)||n.set(o,l),a&&Ad(o,l)){i.style.height||(i.style.height="auto"),i.style.width||(i.style.width="auto"),i.style.removeProperty("block-size"),i.style.removeProperty("inline-size"),i.style.minHeight||(i.style.minHeight="0"),i.style.minWidth||(i.style.minWidth="0"),i.style.maxHeight||(i.style.maxHeight="none"),i.style.maxWidth||(i.style.maxWidth="none");let u=l.overflowY||l.overflowBlock||"visible",f=l.overflowX||l.overflowInline||"visible";(u!=="visible"||f!=="visible")&&(i.style.overflow="visible")}let s=Array.from(o.children),c=Array.from(i.children);for(let u=0;ui&&(i=g),a=!0)}let s=a?Math.max(0,i-o):0,c=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,f=parseFloat(n.paddingTop)||0,d=parseFloat(n.paddingBottom)||0;return c+u+f+d+s}function Od(e){let t=e.boxShadow||"";if(!t||t==="none")return{top:0,right:0,bottom:0,left:0};let n=t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map(l=>l.trim()),r=0,o=0,i=0,a=0;for(let l of n){let s=l.match(/-?\d+(\.\d+)?px/g)?.map(h=>parseFloat(h))||[];if(s.length<2)continue;let[c,u,f=0,d=0]=s,p=Math.abs(c)+f+d,m=Math.abs(u)+f+d;o=Math.max(o,p+Math.max(c,0)),a=Math.max(a,p+Math.max(-c,0)),i=Math.max(i,m+Math.max(u,0)),r=Math.max(r,m+Math.max(-u,0))}return{top:Math.ceil(r),right:Math.ceil(o),bottom:Math.ceil(i),left:Math.ceil(a)}}function Id(e){let t=(e.filter||"").match(/blur\(\s*([0-9.]+)px\s*\)/),n=t?Math.ceil(parseFloat(t[1])||0):0;return{top:n,right:n,bottom:n,left:n}}function $d(e){if((e.outlineStyle||"none")==="none")return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||"0")||0);return{top:t,right:t,bottom:t,left:t}}function Rd(e){let t=`${e.filter||""} ${e.webkitFilter||""}`.trim();if(!t||t==="none")return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,o=0,i=0,a=0,l=!1;for(let s of n){l=!0;let c=s.match(/-?\d+(?:\.\d+)?px/gi)?.map(h=>parseFloat(h))||[],[u=0,f=0,d=0]=c,p=Math.abs(u)+d,m=Math.abs(f)+d;o=Math.max(o,p+Math.max(u,0)),a=Math.max(a,p+Math.max(-u,0)),i=Math.max(i,m+Math.max(f,0)),r=Math.max(r,m+Math.max(-f,0))}return{bleed:{top:A(r),right:A(o),bottom:A(i),left:A(a)},has:l}}function Nd(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin="0 0"}catch{}try{"translate"in t.style&&(t.style.translate="none"),"rotate"in t.style&&(t.style.rotate="none")}catch{}let r=n.transform||"none";if(!r||r==="none")try{let i=Qa(e);if(i.a===1&&i.b===0&&i.c===0&&i.d===1)return t.style.transform="none",{a:1,b:0,c:0,d:1}}catch{}let o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let i=o[1].split(",").map(a=>parseFloat(a.trim()));if(i.length===6&&i.every(Number.isFinite)){let[a,l,s,c]=i,u=Math.sqrt(a*a+l*l)||0,f=0,d=0,p=0,m=0,h=0,g=0;u>0&&(f=a/u,d=l/u,p=f*s+d*c,m=s-f*p,h=c-d*p,g=Math.sqrt(m*m+h*h)||0,g>0?p=p/g:p=0);let y=u,w=0,v=p*g,b=g;try{t.style.transform=`matrix(${y}, ${w}, ${v}, ${b}, 0, 0)`}catch{}return{a:y,b:w,c:v,d:b}}}try{let i=String(r).trim();return t.style.transform=i+" translate(0px, 0px) rotate(0deg)",null}catch{return null}}function ka(e,t,n,r,o){let i=n.a,a=n.b,l=n.c,s=n.d,c=n.e||0,u=n.f||0;function f(y,w){let v=y-r,b=w-o,C=i*v+l*b,x=a*v+s*b;return C+=r+c,x+=o+u,[C,x]}let d=[f(0,0),f(e,0),f(0,t),f(e,t)],p=1/0,m=1/0,h=-1/0,g=-1/0;for(let[y,w]of d)yh&&(h=y),w>g&&(g=w);return{minX:p,minY:m,maxX:h,maxY:g,width:h-p,height:g-m}}function Pd(e,t,n){let r=(e.transformOrigin||"0 0").trim().split(/\s+/),[o,i]=[r[0]||"0",r[1]||"0"],a=(l,s)=>{let c=l.toLowerCase();return c==="left"||c==="top"?0:c==="center"?s/2:c==="right"||c==="bottom"?s:c.endsWith("px")?parseFloat(c)||0:c.endsWith("%")?(parseFloat(c)||0)*s/100:/^-?\d+(\.\d+)?$/.test(c)&&parseFloat(c)||0};return{ox:a(o,t),oy:a(i,n)}}function Fd(e){let t={rotate:"0deg",scale:null,translate:null},n=typeof e.computedStyleMap=="function"?e.computedStyleMap():null;if(n){let o=s=>{try{return typeof n.has=="function"&&!n.has(s)||typeof n.get!="function"?null:n.get(s)}catch{return null}},i=o("rotate");if(i)if(i.angle){let s=i.angle;t.rotate=s.unit==="rad"?s.value*180/Math.PI+"deg":s.value+s.unit}else i.unit?t.rotate=i.unit==="rad"?i.value*180/Math.PI+"deg":i.value+i.unit:t.rotate=String(i);else{let s=getComputedStyle(e);t.rotate=s.rotate&&s.rotate!=="none"?s.rotate:"0deg"}let a=o("scale");if(a){let s="x"in a&&a.x?.value!=null?a.x.value:Array.isArray(a)?a[0]?.value:Number(a)||1,c="y"in a&&a.y?.value!=null?a.y.value:Array.isArray(a)?a[1]?.value:s;t.scale=`${s} ${c}`}else{let s=getComputedStyle(e);t.scale=s.scale&&s.scale!=="none"?s.scale:null}let l=o("translate");if(l){let s="x"in l&&"value"in l.x?l.x.value:Array.isArray(l)?l[0]?.value:0,c="y"in l&&"value"in l.y?l.y.value:Array.isArray(l)?l[1]?.value:0,u="x"in l&&l.x?.unit?l.x.unit:"px",f="y"in l&&l.y?.unit?l.y.unit:"px";t.translate=`${s}${u} ${c}${f}`}else{let s=getComputedStyle(e);t.translate=s.translate&&s.translate!=="none"?s.translate:null}return t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!=="none"?r.rotate:"0deg",t.scale=r.scale&&r.scale!=="none"?r.scale:null,t.translate=r.translate&&r.translate!=="none"?r.translate:null,t}function zd(){if(Cr)return Cr;let e=document.createElement("div");return e.id="snapdom-measure-slot",e.setAttribute("aria-hidden","true"),Object.assign(e.style,{position:"absolute",left:"-99999px",top:"0px",width:"0px",height:"0px",overflow:"hidden",opacity:"0",pointerEvents:"none",contain:"size layout style"}),document.documentElement.appendChild(e),Cr=e,e}function Hd(e){let t=zd(),n=document.createElement("div");n.style.transformOrigin="0 0",e.baseTransform&&(n.style.transform=e.baseTransform),e.rotate&&(n.style.rotate=e.rotate),e.scale&&(n.style.scale=e.scale),e.translate&&(n.style.translate=e.translate),t.appendChild(n);let r=Qa(n);return t.removeChild(n),r}function Dd(e){let t=getComputedStyle(e),n=t.transform||"none";if(n!=="none"&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&t.rotate!=="none"&&t.rotate!=="0deg",o=t.scale&&t.scale!=="none"&&t.scale!=="1",i=t.translate&&t.translate!=="none"&&t.translate!=="0px 0px";return!!(r||o||i)}function Qa(e){let t=getComputedStyle(e).transform;if(!t||t==="none")return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}async function Ja(e,t){if(!e)throw new Error("Element cannot be null or undefined");bc(t.cache);let n=t.fast,r=t.outerTransforms!==!1,o=!!t.outerShadows,i={element:e,options:t,plugins:t.plugins},a,l,s,c="",u="",f,d,p=null;await Se("beforeSnap",i),await Se("beforeClone",i);let m=dd(i.element);try{({clone:a,classCSS:l,styleCache:s}=await ld(i.element,i.options)),!r&&a&&(p=Nd(i.element,a)),!o&&a&&vd(i.element,a)}finally{m()}if(i={clone:a,classCSS:l,styleCache:s,...i},await Se("afterClone",i),Cd(i.clone),i.options?.excludeMode==="remove")try{_d(i.element,i.clone,i.styleCache)}catch(w){console.warn("[snapdom] shrink pass failed:",w)}try{await Lu(i.clone,i.element)}catch{}await new Promise(w=>{je(async()=>{await cd(i.clone,i.options),w()},{fast:n})}),await new Promise(w=>{je(async()=>{await ud(i.element,i.clone,i.styleCache,i.options),w()},{fast:n})}),t.embedFonts&&await new Promise(w=>{je(async()=>{let v=Uu(i.element),b=Vu(i.element);if(_e()){let C=new Set(Array.from(v).map(x=>String(x).split("__")[0]).filter(Boolean));await Gu(C,1)}c=await Bu({required:v,usedCodepoints:b,preCached:!1,exclude:i.options.excludeFonts,useProxy:i.options.useProxy}),w()},{fast:n})});let h=kc(i.clone).sort(),g=h.join(",");S.baseStyle.has(g)?u=S.baseStyle.get(g):await new Promise(w=>{je(()=>{u=Tc(h),S.baseStyle.set(g,u),w()},{fast:n})}),i={fontsCSS:c,baseCSS:u,...i},await Se("beforeRender",i),await new Promise(w=>{je(()=>{let v=getComputedStyle(i.element),b=i.element.getBoundingClientRect(),C=Math.max(1,A(i.element.offsetWidth||parseFloat(v.width)||b.width||1)),x=Math.max(1,A(i.element.offsetHeight||parseFloat(v.height)||b.height||1));if(i.options?.excludeMode==="remove"){let Z=Td(i.element,i.options);Number.isFinite(Z)&&Z>0&&(x=Math.max(1,Math.min(x,A(Z+1))))}let M=(Z,J=NaN)=>{let Te=typeof Z=="string"?parseFloat(Z):Z;return Number.isFinite(Te)?Te:J},k=M(i.options.width),T=M(i.options.height),N=C,L=x,P=Number.isFinite(k),_=Number.isFinite(T),V=x>0?C/x:1;P&&_?(N=Math.max(1,A(k)),L=Math.max(1,A(T))):P?(N=Math.max(1,A(k)),L=Math.max(1,A(N/(V||1)))):_?(L=Math.max(1,A(T)),N=Math.max(1,A(L*(V||1)))):(N=C,L=x);let Q=0,Y=0,F=C,O=x;if(!r&&p&&Number.isFinite(p.a)){let Z={a:p.a,b:p.b||0,c:p.c||0,d:p.d||1,e:0,f:0},J=ka(C,x,Z,0,0);Q=A(J.minX),Y=A(J.minY),F=A(J.maxX),O=A(J.maxY)}else if(r&&Wd(i.element)){let Z=v.transform&&v.transform!=="none"?v.transform:"",J=Fd(i.element),Te=Hd({baseTransform:Z,rotate:J.rotate||"0deg",scale:J.scale,translate:J.translate}),{ox:vl,oy:Sl}=Pd(v,C,x),xl=Te.is2D?Te:new DOMMatrix(Te.toString()),Mt=ka(C,x,xl,vl,Sl);Q=A(Mt.minX),Y=A(Mt.minY),F=A(Mt.maxX),O=A(Mt.maxY)}let q=Od(v),D=Id(v),fe=$d(v),oe=Rd(v),Le=o?{top:A(q.top+D.top+fe.top+oe.bleed.top),right:A(q.right+D.right+fe.right+oe.bleed.right),bottom:A(q.bottom+D.bottom+fe.bottom+oe.bleed.bottom),left:A(q.left+D.left+fe.left+oe.bleed.left)}:{top:0,right:0,bottom:0,left:0};Q=A(Q-Le.left),Y=A(Y-Le.top),F=A(F+Le.right),O=A(O+Le.bottom);let Ct=Math.max(1,A(F-Q)),Ke=Math.max(1,A(O-Y)),Et=P||_?A(N/C):1,ul=_||P?A(L/x):1,dl=Math.max(1,A(Ct*Et)),fl=Math.max(1,A(Ke*ul)),qr="http://www.w3.org/2000/svg",hl=_e()?1:0,he=A(hl+(r?0:1)),me=document.createElementNS(qr,"foreignObject"),ml=A(Q),pl=A(Y);me.setAttribute("x",String(A(-(ml-he)))),me.setAttribute("y",String(A(-(pl-he)))),me.setAttribute("width",String(A(C+he*2))),me.setAttribute("height",String(A(x+he*2))),me.style.overflow="visible";let Br=document.createElement("style");Br.textContent=i.baseCSS+i.fontsCSS+"svg{overflow:visible;} foreignObject{overflow:visible;}"+i.classCSS,me.appendChild(Br);let ke=document.createElement("div");ke.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),ke.style.width=`${A(C)}px`,ke.style.height=`${A(x)}px`,ke.style.overflow="visible",ke.appendChild(i.clone),me.appendChild(ke);let gl=new XMLSerializer().serializeToString(me),yn=A(Ct+he*2),wn=A(Ke+he*2),Ur=P||_;t.meta={w0:C,h0:x,vbW:yn,vbH:wn,targetW:N,targetH:L};let yl=_e()&&Ur?yn:A(dl+he*2),wl=_e()&&Ur?wn:A(fl+he*2),bl=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;d=``+gl+"",f=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,i={svgString:d,dataURL:f,...i},w()},{fast:n})}),await Se("afterRender",i);let y=document.getElementById("snapdom-sandbox");return y&&y.style.position==="absolute"&&y.remove(),i.dataURL}function Wd(e){return Dd(e)}function qd(e){if(typeof e=="string"){let t=e.toLowerCase().trim();if(t==="disabled"||t==="full"||t==="auto"||t==="soft")return t}return"soft"}function Bd(e={}){let t=e.format??"png";t==="jpg"&&(t="jpeg");let n=qd(e.cache);return{debug:e.debug??!1,fast:e.fast??!0,scale:e.scale??1,exclude:e.exclude??[],excludeMode:e.excludeMode??"hide",filter:e.filter??null,filterMode:e.filterMode??"hide",placeholders:e.placeholders!==!1,embedFonts:e.embedFonts??!1,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fallbackURL:e.fallbackURL??void 0,cache:n,useProxy:typeof e.useProxy=="string"?e.useProxy:"",width:e.width??null,height:e.height??null,format:t,type:e.type??"svg",quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??(["jpeg","webp"].includes(t)?"#ffffff":null),filename:e.filename??"snapDOM",outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1}}function Ud(...e){return gd(...e),R}async function Vd(e,t){if(!e)throw new Error("Element cannot be null or undefined");let n=Bd(t);if(bd(n,t&&t.plugins),_e()&&(n.embedFonts===!0||jd(e)))for(let r=0;r<3;r++)try{await Gd(e,t),Fr=!1}catch{}return n.iconFonts&&n.iconFonts.length>0&&Su(n.iconFonts),n.snap||(n.snap={toPng:(r,o)=>R.toPng(r,o),toSvg:(r,o)=>R.toSvg(r,o)}),R.capture(e,n,el)}async function Gd(e,t){if(Fr)return;let n={...t,fast:!0,embedFonts:!0,scale:.2},r;try{r=await Ja(e,n)}catch{}await new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(o))),r&&await new Promise(o=>{let i=new Image;try{i.decoding="sync",i.loading="eager"}catch{}i.style.cssText="position:fixed;left:0px;top:0px;width:10px;height:10px;opacity:0.01;pointer-events:none;",i.src=r,document.body.appendChild(i),(async()=>{try{typeof i.decode=="function"&&await i.decode()}catch{}let a=performance.now();for(;!(i.complete&&i.naturalWidth>0)&&performance.now()-a<900;)await new Promise(l=>setTimeout(l,200));await new Promise(l=>requestAnimationFrame(l));try{i.remove()}catch{}o()})()}),e.querySelectorAll("canvas").forEach(o=>{try{let i=o.getContext("2d",{willReadFrequently:!0});i&&i.getImageData(0,0,1,1)}catch{}}),Fr=!0}function jd(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();){let n=t.currentNode,r=getComputedStyle(n),o=r.backgroundImage&&r.backgroundImage!=="none",i=r.maskImage&&r.maskImage!=="none"||r.webkitMaskImage&&r.webkitMaskImage!=="none";if(o||i||n.tagName==="CANVAS")return!0}return!1}var wc,X,xt,S,re,hn,Er,ln,gt,Ze,_c,Ra,mn,Ic,Na,Pa,Fa,za,Hr,xe,Ar,vt,be,ve,yt,rn,_r,Lr,qa,qc,ha,kr,Tr,ma,pa,Ba,ga,pt,gu,vu,Ve,Or,wa,Tu,Ou,Ir,fn,Ua,Hu,Ge,Ea,Ye,_a,St,A,Cr,R,el,we,Fr,tl=Vr(()=>{wc=Object.defineProperty,X=(e,t)=>()=>(e&&(t=e(e=0)),t),xt=(e,t)=>{for(var n in t)wc(e,n,{get:t[n],enumerable:!0})};re=X(()=>{S={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}}});hn=X(()=>{});Ze=X(()=>{hn(),Er=Sc("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),ln=new Map,gt=new Map});_c=X(()=>{re(),hn(),Ze()});za=X(()=>{re(),Ra=new Set(["meta","script","noscript","title","link","template"]),mn=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]),Ic=["div","span","p","a","img","ul","li","button","input","select","textarea","label","section","article","header","footer","nav","main","aside","h1","h2","h3","h4","h5","h6","table","thead","tbody","tr","td","th"],Na=/(?:^|-)(animation|transition)(?:-|$)/i,Pa=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Fa=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"])});Hr=X(()=>{}),xe=X(()=>{_c(),za(),Hr(),hn()}),Ar={};xt(Ar,{toCanvas:()=>pn});vt=X(()=>{Hr()}),be={};xt(be,{rasterize:()=>Da});ve=X(()=>{vt()}),yt={};xt(yt,{toImg:()=>fa,toSvg:()=>fa});rn=X(()=>{xe(),ve()}),_r={};xt(_r,{toBlob:()=>Wa});Lr=X(()=>{vt()}),qa={};xt(qa,{download:()=>Wc});qc=X(()=>{Lr(),vt()});xe();xe();re();ha=new WeakMap,kr=new Map,Tr=0;ma=!1;pa=new WeakMap;za();Ba=["fill","stroke","color","background-color","stop-color"],ga=new Map;xe();re();Ze();pt=new Map;gu=/\bblob:[^)"'\s]+/g;xe();hn();re();vu=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Ve=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),Or=[];wa=new Map;Ze();Tu=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]),Ou=["katex","mathjax","mathml"];Ir=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,fn=4;Ua=/url\((["']?)([^"')]+)\1\)/g,Hu=/@font-face[^{}]*\{[^}]*\}/g;re();Ze();re();Ge=new WeakMap,Ea=300;Ye=new WeakMap,_a=-1;re();Ze();xe();xe();re();St=[];A=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e;Cr=null;Hr();xe();Ze();re();R=Object.assign(Vd,{plugins:Ud}),el=Symbol("snapdom.internal"),we=Symbol("snapdom.internal.silent"),Fr=!1;R.capture=async(e,t,n)=>{if(n!==el)throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");let r=await Ja(e,t),o={img:async(m,h)=>{let{toImg:g}=await Promise.resolve().then(()=>(rn(),yt));return g(r,{...m,...h||{}})},svg:async(m,h)=>{let{toSvg:g}=await Promise.resolve().then(()=>(rn(),yt));return g(r,{...m,...h||{}})},canvas:async(m,h)=>{let{toCanvas:g}=await Promise.resolve().then(()=>(vt(),Ar));return g(r,{...m,...h||{}})},blob:async(m,h)=>{let{toBlob:g}=await Promise.resolve().then(()=>(Lr(),_r));return g(r,{...m,...h||{}})},png:async(m,h)=>{let{rasterize:g}=await Promise.resolve().then(()=>(ve(),be));return g(r,{...m,...h||{},format:"png"})},jpeg:async(m,h)=>{let{rasterize:g}=await Promise.resolve().then(()=>(ve(),be));return g(r,{...m,...h||{},format:"jpeg"})},webp:async(m,h)=>{let{rasterize:g}=await Promise.resolve().then(()=>(ve(),be));return g(r,{...m,...h||{},format:"webp"})},download:async(m,h)=>{let{download:g}=await Promise.resolve().then(()=>(qc(),qa));return g(r,{...m,...h||{}})}},i={...t,export:{url:r},exports:{svg:async m=>{let{toSvg:h}=await Promise.resolve().then(()=>(rn(),yt));return h(r,{...t,...m||{},[we]:!0})},canvas:async m=>{let{toCanvas:h}=await Promise.resolve().then(()=>(vt(),Ar));return h(r,{...t,...m||{},[we]:!0})},png:async m=>{let{rasterize:h}=await Promise.resolve().then(()=>(ve(),be));return h(r,{...t,...m||{},format:"png",[we]:!0})},jpeg:async m=>{let{rasterize:h}=await Promise.resolve().then(()=>(ve(),be));return h(r,{...t,...m||{},format:"jpeg",[we]:!0})},jpg:async m=>{let{rasterize:h}=await Promise.resolve().then(()=>(ve(),be));return h(r,{...t,...m||{},format:"jpeg",[we]:!0})},webp:async m=>{let{rasterize:h}=await Promise.resolve().then(()=>(ve(),be));return h(r,{...t,...m||{},format:"webp",[we]:!0})},blob:async m=>{let{toBlob:h}=await Promise.resolve().then(()=>(Lr(),_r));return h(r,{...t,...m||{},[we]:!0})},img:async m=>{let{toImg:h}=await Promise.resolve().then(()=>(rn(),yt));return h(r,{...t,...m||{},[we]:!0})}}},a=await yd("defineExports",i),l=Object.assign({},...a.filter(m=>m&&typeof m=="object")),s={...o,...l};s.jpeg&&!s.jpg&&(s.jpg=(m,h)=>s.jpeg(m,h));function c(m,h){let g={...t,...h||{}};return(m==="jpeg"||m==="jpg")&&(g.backgroundColor==null||g.backgroundColor==="transparent")&&(g.backgroundColor="#ffffff"),g}let u=!1,f=Promise.resolve();async function d(m,h){let g=async()=>{let y=s[m];if(!y)throw new Error(`[snapdom] Unknown export type: ${m}`);let w=c(m,h),v={...t,export:{type:m,options:w,url:r}};await Se("beforeExport",v);let b=await y(v,w);return await Se("afterExport",v,b),u||(u=!0,await Se("afterSnap",t)),b};return f=f.then(g)}let p={url:r,toRaw:()=>r,to:(m,h)=>d(m,h),toImg:m=>d("img",m),toSvg:m=>d("svg",m),toCanvas:m=>d("canvas",m),toBlob:m=>d("blob",m),toPng:m=>d("png",m),toJpg:m=>d("jpg",m),toWebp:m=>d("webp",m),download:m=>d("download",m)};for(let m of Object.keys(s)){let h="to"+m.charAt(0).toUpperCase()+m.slice(1);p[h]||(p[h]=g=>d(m,g))}return p};R.toRaw=(e,t)=>R(e,t).then(n=>n.toRaw());R.toImg=(e,t)=>R(e,t).then(n=>n.toImg());R.toSvg=(e,t)=>R(e,t).then(n=>n.toSvg());R.toCanvas=(e,t)=>R(e,t).then(n=>n.toCanvas());R.toBlob=(e,t)=>R(e,t).then(n=>n.toBlob());R.toPng=(e,t)=>R(e,{...t,format:"png"}).then(n=>n.toPng());R.toJpg=(e,t)=>R(e,{...t,format:"jpeg"}).then(n=>n.toJpg());R.toWebp=(e,t)=>R(e,{...t,format:"webp"}).then(n=>n.toWebp());R.download=(e,t)=>R(e,t).then(n=>n.download())});var nl={};Ll(nl,{captureScreenshot:()=>Xd});async function Xd(){let e=document.querySelector("a.branding-pill");e&&(e.style.display="none");let t=new Map,n=[...document.querySelectorAll("*")].filter(r=>r.children.length===0&&[...r.childNodes].every(o=>o.nodeType===Node.TEXT_NODE));for(let r of n){let o=r;if(!o.style)continue;let i=o.style.whiteSpace,a=r.getBoundingClientRect().height;o.style.whiteSpace="nowrap",r.getBoundingClientRect().height{o.style.whiteSpace=r}),e&&(e.style.display="")}}async function Yd(e){let t=await createImageBitmap(e),n=t.width/document.body.scrollWidth,r=t.height/document.body.scrollHeight,o=window.devicePixelRatio||1,i=document.createElement("canvas");i.width=Math.floor(window.innerWidth*o),i.height=Math.floor(window.innerHeight*o);let a=i.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high";let l=Math.max(0,window.scrollX*n),s=Math.max(0,window.scrollY*r),c=Math.min(window.innerWidth*n,t.width-l),u=Math.min(window.innerHeight*r,t.height-s);return a.drawImage(t,l,s,c,u,0,0,i.width,i.height),t.close(),new Promise((f,d)=>{i.toBlob(p=>p?f(p):d(new Error("toBlob failed")),"image/png")})}var rl=Vr(()=>{"use strict";tl()});function Tl(){let e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)},clear:()=>{e.clear()},key:t=>[...e.keys()][t]??null,get length(){return e.size}}}function Ol(e){try{let t=window[e];return t.setItem("__test__","1"),t.removeItem("__test__"),!0}catch{return!1}}function Gr(e){if(!Ol(e))try{Object.defineProperty(window,e,{value:Tl(),configurable:!0,writable:!0})}catch{}}Gr("localStorage");Gr("sessionStorage");var cl=At(jr(),1);var Xr=["usageToken","zite-dev","branding"];var $l="zite-dev-sandbox.com",Rl="zite-sandbox.com",ie=window.location.hostname.includes($l)||window.location.hostname.includes(Rl),Yr=` `,Zr=` `;var Ce=null;function Kr(e){Ce=e}function Qr(e){let t=()=>{let n=document.location.href,r=document.querySelector("body"),o=new MutationObserver(()=>{n!==document.location.href&&(n=document.location.href,e.send("navigation",{url:document.location.pathname}),Ce&&Ce(document.location.pathname))});r&&o.observe(r,{childList:!0,subtree:!0})};document.readyState==="complete"?t():window.addEventListener("load",t)}function Jr(){let e=()=>{let t=document.location.href,n=document.querySelector("body"),r=new MutationObserver(()=>{t!==document.location.href&&(t=document.location.href,Ce&&Ce(document.location.pathname))});n&&r.observe(n,{childList:!0,subtree:!0}),window.addEventListener("popstate",()=>{t!==document.location.href&&(t=document.location.href,Ce&&Ce(document.location.pathname))})};document.readyState==="complete"?e():window.addEventListener("load",e)}function eo(){let e=history.pushState.bind(history),t={apply(r,o,i){let[a,l,s]=i,u=new URL(window.location.href).searchParams,f=new URL(s,window.location.origin);return u.forEach((d,p)=>{Xr.includes(p)&&(f.searchParams.has(p)||f.searchParams.append(p,d))}),r.call(o,a,l,f.toString())}},n=new Proxy(e,t);history.pushState=n}var to="zite_visitor_id",Sn="zite_session_id",kt="zite_session_start",no="zite_last_activity",Nl=30*60*1e3,Pl=5e3,Fl=500,Ie=null,Tt=null,Oe=null,Lt=[],Qe=null,xn=null,Cn=0;function Je(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function zl(){try{let e=localStorage.getItem(to);return e||(e=Je(),localStorage.setItem(to,e)),e}catch{return Je()}}function Hl(){try{let e=sessionStorage.getItem(Sn);return e||(e=Je(),sessionStorage.setItem(Sn,e)),e}catch{return Je()}}function Dl(){try{let e=sessionStorage.getItem(kt);if(e)return parseInt(e,10);let t=Date.now();return sessionStorage.setItem(kt,t.toString()),t}catch{return Date.now()}}function Wl(){let e=Date.now();try{sessionStorage.setItem(kt,e.toString())}catch{}return e}function ql(){try{let e=sessionStorage.getItem(no);return e?parseInt(e,10):0}catch{return 0}}function Bl(){try{sessionStorage.setItem(no,Date.now().toString())}catch{}}function ro(){let e=ql();return e===0?!1:Date.now()-e>Nl}function oo(){Oe=Je();try{sessionStorage.setItem(Sn,Oe)}catch{}Wl(),io({eventType:"session_start",appId:Ie.appId,visitorId:Tt,sessionId:Oe,path:window.location.pathname,timestamp:Date.now(),referrer:document.referrer||void 0,userAgent:navigator.userAgent,screenWidth:window.screen?.width,screenHeight:window.screen?.height})}function Ul(){try{return!sessionStorage.getItem(kt)}catch{return!0}}function Vl(e){if(!Ie||e.length===0)return;let t=`${Ie.endpointUrl}/public/zite/analytics`,n=JSON.stringify({events:e});if(navigator.sendBeacon){let r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}else fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}function io(e){Lt.push(e)}function ao(){if(Lt.length===0)return;let e=[...Lt];Lt=[],Vl(e)}function Gl(){Qe||(Qe=setInterval(ao,Pl))}function jl(){Qe&&(clearInterval(Qe),Qe=null)}function En(e,t,n){if(!Ie||!Tt||!Oe)return;ro()&&oo(),Bl();let r={eventType:e,appId:Ie.appId,visitorId:Tt,sessionId:Oe,path:t,timestamp:Date.now(),...n};io(r)}function Xl(e){let t=Date.now();e===xn&&t-Cn5&&it.shift()}var As=["Failed to fetch","Load failed","NetworkError when attempting to fetch resource."],ti=e=>As.some(t=>e.includes(t));function _s(e){if(!e)return"";let t=e.stack?.split(` `)||[],n=t.find(r=>r.includes("/src/")||!r.includes("node_modules/")&&!r.includes("at new Error"))||t[0]||"";return[e.name,e.message,n.trim()].join(":")}function ni(e){let t=new Set;window._ziteOnFixError=async n=>{try{let r=n?.error??n;if(!r||!r.stack){console.warn("Invalid error object",n);return}let o=await new Ut.default(r).withSourcesAsync().then(i=>i.asTable());e.send("fix",{message:n.message,stack:o})}catch(r){console.error("Error in error handler:",r);let o=n.lineno&&n.colno&&n.filename;(n.message||o)&&e.send("fix",{message:n.message||"An unexpected error occurred.",stack:o?`at ${n.filename}:${n.lineno}:${n.colno}`:void 0})}},window._ziteOnReload=async()=>{window.location.reload()},window.addEventListener("error",async n=>{if(n.message==="Script error."&&!n.filename&&!n.error){console.warn("[Zite] A third-party script threw an error.");return}if(!ti(n.message))try{let r=_s(n.error),o=await new Ut.default(n.error).cleanAsync().then(i=>i.asTable());t.has(r)||(t.add(r),e.send("error",{message:n.message,stack:ie?o:void 0})),Bt({message:n.message,stack:ie?o:void 0})}catch(r){console.error("Error in error handler:",r);let o=n.lineno&&n.colno&&n.filename;(n.message||o)&&e.send("fix",{message:n.message||"An unexpected error occurred.",stack:o?`at ${n.filename}:${n.lineno}:${n.colno}`:void 0})}}),window.addEventListener("unhandledrejection",async n=>{let r=n.reason?.message||"Unhandled promise rejection";if(ti(r))return;let o=await new Ut.default(n.reason).cleanAsync().then(a=>a.asTable()),i=`${n.reason?.name||"UnhandledRejection"}:${r}:${o.split(` `)[1]||""}`;t.has(i)||(t.add(i),e.send("error",{message:r,stack:ie?o:void 0}))})}var Mi=At(Ei(),1);var Ai=At(Gn(),1);var nc=["the above error occurred in","warning:"];function _i(e){let t={log:console.log,warn:console.warn,error:console.error},n={log:"info",warn:"warn",error:"error"};Object.keys(n).forEach(r=>{let o=n[r],i=t[r];console[r]=function(...a){i.apply(console,a);let l=a.map(u=>typeof u=="string"?u:(0,Mi.default)(u)).join(" "),s=l.toLowerCase(),c=nc.some(u=>s.startsWith(u));if((r==="error"||r==="warn")&&ie&&!c){let f=new Error().stack?.split(` `).slice(2).join(` `);new Ai.default(f).cleanAsync().then(d=>{let p=d.asTable();Bt({message:l,stack:p}),e.send("console",{logLevel:o,message:l+` `+p})})}else e.send("console",{logLevel:o,message:l})}})}var Li="rgba(245, 180, 20, 0.1)",ki="1px solid rgba(245, 180, 20, 0.6)",ir="0 0 0 2px rgba(254, 199, 57, 1)",ar="0 0 0 2px rgba(254, 199, 57, 0.6)",Ti="rgba(254, 199, 57, 1)",Oi="#000000",Ii="11px",$i="2px 6px",Ri="3px";var zi=e=>{let[t,n,r]=e.split("|");return{fileName:t,line:parseInt(n||"0",10),column:parseInt(r||"0",10)}},fr="__app_root__",Hi=!0,Di=!1;function hr(e){Di=e}var sr=null;function Wi(e){sr=new Set(e)}function Kt(e){if(e===fr||!sr)return!0;let{fileName:t}=zi(e);return t?sr.has(t):!1}function qi(e){Hi=e}var oc={div:"Container",span:"Text",p:"Paragraph",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",a:"Link",button:"Button",img:"Image",input:"Input",textarea:"Text Area",select:"Select",form:"Form",label:"Label",ul:"List",ol:"List",li:"List Item",table:"Table",tr:"Table Row",td:"Table Cell",th:"Table Header",nav:"Navigation",header:"Header",footer:"Footer",main:"Main",section:"Section",article:"Article",aside:"Aside",svg:"SVG",video:"Video",audio:"Audio",iframe:"Frame"};function ic(e,t){let n=t?.startsWith("motion.")?t:e.startsWith("motion.")?e:null,r=!!n,o=r?n.slice(7):e;if(t&&!t.startsWith("motion."))return t;let i=Hi&&oc[o]||o;return r?`Animated ${i}`:i}var W=null,$=null,Xt=new Map,Be=new Map,ce=new Map,Bi=2147483647,Ni=Bi-10;function mr(e,t){if(e.getAttribute("data-zite-id")!==t)e.setAttribute("contenteditable","false");else{e.setAttribute("contenteditable","true");let r=e.parentElement;for(;r;)r.hasAttribute("data-zite-id")&&r.getAttribute("data-zite-id")!==t&&r.setAttribute("contenteditable","false"),r=r.parentElement}}function ft(e,t){let n=document.querySelectorAll(`[data-zite-id="${e}"]`);for(let r of n)ac(r,t)}function ac(e,t){let n=t.isSelected?Be:Xt;if(n.has(e))return;let r=document.createElement("div");r.classList.add("zite-highlight-overlay");let o=getComputedStyle(e).borderRadius,i=`${Math.max(parseInt(o)||0,4)}px`;if(t.isSelected){let a=e.getAttribute("contenteditable")==="true"&&document.activeElement===e;Object.assign(r.style,{position:"absolute",backgroundColor:"transparent",border:"none",boxShadow:a?ar:ir,borderRadius:i,pointerEvents:"none",zIndex:String(Ni),transition:"opacity 200ms ease-out"})}else Object.assign(r.style,{position:"absolute",backgroundColor:Li,border:ki,borderRadius:i,pointerEvents:"none",zIndex:String(Ni)});cr(e,r),document.body.appendChild(r),n.set(e,r)}function cr(e,t){let n=e.getBoundingClientRect(),r=getComputedStyle(e).borderRadius;Object.assign(t.style,{top:`${window.scrollY+n.top}px`,left:`${window.scrollX+n.left}px`,width:`${n.width}px`,height:`${n.height}px`,borderRadius:`${Math.max(parseInt(r)||0,4)}px`})}function ye(){for(let[e,t]of Xt.entries())cr(e,t);for(let[e,t]of Be.entries())cr(e,t);for(let[e,t]of ce.entries()){let n=document.querySelector(`[data-zite-id="${e}"]`);n&&ji(n,t)}}function Ue(){for(let e of Xt.values())e.parentNode?.removeChild(e);Xt.clear()}function Ui(){for(let e of Be.values())e.parentNode?.removeChild(e);Be.clear()}function Vi(){Ue(),Ui()}function Gi(e){let t=e?"1":"0";for(let n of Be.values())n.style.opacity=t;for(let n of ce.values())n.style.opacity=t}function ht(){for(let[e,t]of Be.entries()){let n=e.getAttribute("contenteditable")==="true"&&document.activeElement===e;t.style.boxShadow=n?ar:ir}}function mt(e,t=!1){if(ce.has(e))return;let n=document.querySelector(`[data-zite-id="${e}"]`);if(!n)return;let r=n.getAttribute("data-zite-component"),o=n.tagName.toLowerCase(),i=ic(o,r),a=t&&e!==fr,l=document.createElement("div");l.className="zite-element-label",Object.assign(l.style,{position:"fixed",backgroundColor:Ti,color:Oi,fontSize:Ii,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontWeight:"500",padding:$i,borderRadius:Ri,pointerEvents:a?"auto":"none",cursor:a?"pointer":"default",zIndex:Bi,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.2)",display:"flex",alignItems:"center",gap:"4px",transition:"opacity 200ms ease-out"});let s=document.createElement("span");if(s.textContent=i,l.appendChild(s),a){let c=document.createElement("span");c.className="zite-ai-edit-icon",c.innerHTML=dr?ra:na,Object.assign(c.style,{display:"flex",alignItems:"center",lineHeight:"0",...!dr&&{position:"relative",top:"-0.5px"}}),l.appendChild(c),l.addEventListener("mousedown",u=>{u.preventDefault(),u.stopPropagation(),ur&&ur()})}ji(n,l),document.body.appendChild(l),ce.set(e,l)}function ji(e,t){let n=e.getBoundingClientRect();n.top<24?Object.assign(t.style,{top:`${n.top+4}px`,left:`${n.left+4}px`}):Object.assign(t.style,{top:`${n.top-20-4}px`,left:`${n.left}px`})}function pr(e){let t=ce.get(e);t&&t.parentNode&&t.parentNode.removeChild(t),ce.delete(e)}function Qt(){for(let e of ce.values())e.parentNode&&e.parentNode.removeChild(e);ce.clear()}function gr(e){let t=e.target,n=t.getAttribute("data-zite-id");if(!n&&t instanceof SVGElement){let r=t;for(;r&&!(r instanceof SVGSVGElement);)r=r.parentElement;r&&(n=r.getAttribute("data-zite-id"))}if(n&&!Kt(n)&&(n=null),n!==W){if(W&&W!==n){let r=document.querySelectorAll(`[data-zite-id="${W}"]`);for(let o of r)o.removeAttribute("data-zite-highlight");W!==$&&pr(W)}if(n){let r=document.querySelectorAll(`[data-zite-id="${n}"]`);for(let o of r)o.setAttribute("data-zite-highlight","true");W=n,n!==$&&(Ue(),ft(n,{isSelected:!1})),n!==$&&mt(n,!1)}}}function Jt(){if(W){let e=document.querySelectorAll(`[data-zite-id="${W}"]`);for(let t of e)t.removeAttribute("data-zite-highlight");$&&$!==W?(Ue(),pr(W)):$||(Ue(),Qt())}W=null}function Xi(){Jt()}function lc(e){let t=e.filter(r=>r.startsWith("lucide-")).reverse();return t.length?t[0].replace("lucide-","").replace(/([a-z])(\d)/g,"$1-$2"):void 0}function Pi(e){return Array.prototype.filter.call(e.childNodes,t=>t.nodeType===Node.TEXT_NODE).map(t=>t.textContent).join("")}function Fi(e){let t=[...e.classList];return t.includes("lucide")?lc(t):void 0}function Yi(e,t){let{fileName:n,line:r,column:o}=zi(e);if(!n)return null;let i=Pi(t),a=window.getComputedStyle(t),l=window.getComputedStyle(document.documentElement),s=Fi(t),c=document.querySelectorAll(`[data-zite-id="${e}"]`),u,f;if(c.length>1){u=c.length;let d=[{key:"textContent",getValue:m=>Pi(m)},{key:"lucideIcon",getValue:m=>Fi(m)??""},{key:"src",getValue:m=>m.getAttribute("src")||""},{key:"href",getValue:m=>m.getAttribute("href")||""}],p=[];for(let m of d){let h=new Set;for(let g of c)h.add(m.getValue(g));h.size>1&&p.push(m.key)}p.length>0&&(f=p)}return{id:e,fileName:n,line:r,column:o,elementType:t.tagName.toLowerCase(),componentName:t.getAttribute("data-zite-component")||void 0,elementState:{textContent:i,className:t.getAttribute("class")||"",editable:t.getAttribute("data-zite-editable")==="true",textColor:a.color,backgroundColor:a.backgroundColor,computedFontFamily:a.fontFamily,computedTextAlign:a.textAlign,computedFontWeight:a.fontWeight,computedFontSize:a.fontSize,computedFontStyle:a.fontStyle,computedTextDecorationLine:a.textDecorationLine,computedDisplay:a.display,themeFontSans:l.getPropertyValue("--font-sans").trim(),themeFontMono:l.getPropertyValue("--font-mono").trim(),href:t.getAttribute("href")||void 0,src:t.getAttribute("src")||void 0,cssText:t.style.cssText,lucideIcon:s},...u?{instanceCount:u}:{},...f?{mixedContentKeys:f}:{}}}var Zi=e=>t=>{if(!W||!Kt(W))return;let n=document.querySelectorAll(`[data-zite-id="${W}"]`),r=n[0];if(!r)return;r.contentEditable||(t.preventDefault(),t.stopPropagation());let o=Yi(W,r);if(!o)return;if(e.send("debug.click",{element:o}),$){let a=document.querySelectorAll(`[data-zite-id="${$}"]`);for(let l of a)l.setAttribute("data-zite-selected","false")}Qt();for(let a of n)a.setAttribute("data-zite-selected","true"),a.removeAttribute("data-zite-highlight");$=W;let i=document.querySelectorAll('[data-zite-editable="true"]');for(let a of i)mr(a,$);document.body.style.cursor="",Ue(),Ui(),ft($,{isSelected:!0}),mt($,!0)};function ue(e){e.preventDefault(),e.stopPropagation()}function yr(){let e=document.querySelectorAll('[data-zite-selected="true"]');for(let n of e)n.setAttribute("data-zite-selected","false"),n.removeAttribute("data-zite-highlight");$=null;let t=document.querySelectorAll('[data-zite-editable="true"]');for(let n of t)n.setAttribute("contenteditable","false");document.body.style.cursor="pointer",Vi(),Qt()}function Ki(e,t){if(!Di)return;let n=document.querySelectorAll("[data-zite-highlight], [data-zite-selected]");for(let a of n)a.removeAttribute("data-zite-highlight"),a.setAttribute("data-zite-selected","false");W=null,$=null,Vi(),Qt();let r=document.querySelectorAll('[data-zite-editable="true"]');for(let a of r)a.setAttribute("contenteditable","false");if(!e||!Kt(e))return;let o=document.querySelectorAll(`[data-zite-id="${e}"]`);if(!o.length)return;let i=o[0];if(i&&t){let a=Yi(e,i);a&&t.send("debug.click",{element:a})}for(let a of o)a.setAttribute("data-zite-selected","true");$=e,i.scrollIntoView({behavior:"smooth",block:"center"});for(let a of r)mr(a,$);document.body.style.cursor="",ft(e,{isSelected:!0}),mt(e,!0)}async function wr(e){for(let[t,n]of Object.entries(e)){let r=document.querySelectorAll(`[data-zite-id="${t}"]`);for(let o of r)if(n.style!==void 0&&(o.style.cssText=n.style),n.textContent!==void 0&&document.activeElement!==o&&(o.textContent=n.textContent),n.href!==void 0&&o.setAttribute("href",n.href),n.src!==void 0&&o.setAttribute("src",n.src),n.lucideIcon!==void 0){let i=await fetch(`https://cdn.jsdelivr.net/npm/lucide-static/icons/${n.lucideIcon}.svg`).then(d=>d.text()),s=new DOMParser().parseFromString(i,"image/svg+xml").documentElement,c=o.getAttribute("class"),u=o.getAttribute("id"),f={};for(Array.from(o.attributes).forEach(d=>{d.name.startsWith("data-")&&(f[d.name]=d.value)});o.firstChild;)o.removeChild(o.firstChild);if(Array.from(s.attributes).forEach(d=>{d.name!=="xmlns"&&d.name!=="version"&&o.setAttribute(d.name,d.value)}),c){let d=c.split(" ").filter(p=>!p.startsWith("lucide"));for(let p of d)o.classList.add(p)}for(u&&o.setAttribute("id",u),Object.entries(f).forEach(([d,p])=>{o.setAttribute(d,p)});s.firstChild;)o.appendChild(s.firstChild)}}ye()}function Qi(e){for(let t of e){let n=document.querySelectorAll(`[data-zite-id="${t}"]`);for(let r of n)r.dataset.ziteOriginalDisplay=r.style.display||"",r.dataset.ziteHiddenId=t,r.style.display="none"}ye()}function Ji(e){for(let t of e){let n=document.querySelectorAll(`[data-zite-id="${t}"]`);for(let r of n){let o=r.dataset.ziteOriginalDisplay;o!==void 0?(r.style.display=o,delete r.dataset.ziteOriginalDisplay):r.style.display="",delete r.dataset.ziteHiddenId}}ye()}function sc(){let e=document.querySelectorAll("[data-zite-hidden-id]");for(let t of e){let n=t.dataset.ziteHiddenId,r=t.getAttribute("data-zite-id");if(n!==r){let o=t.dataset.ziteOriginalDisplay;t.style.display=o!==void 0?o:"",delete t.dataset.ziteOriginalDisplay,delete t.dataset.ziteHiddenId}}}function ea(e){if($)return;let t=document.querySelectorAll(`[data-zite-id="${e}"]`);if(!t.length)return;for(let r of t)r.setAttribute("data-zite-selected","true");$=e;let n=document.querySelectorAll('[data-zite-editable="true"]');for(let r of n)mr(r,$);document.body.style.cursor="",ft(e,{isSelected:!0}),mt(e,!0)}function ta(){if(!$)return;let e=document.querySelectorAll(`[data-zite-id="${$}"]`);for(let t of e)if(t.getAttribute("contenteditable")==="true"){t.focus();let n=window.getSelection(),r=document.createRange();n&&(r.selectNodeContents(t),n.removeAllRanges(),n.addRange(r))}}var cc=["flex","grid","block","inline","hidden","absolute","relative","fixed","sticky","static","w-","h-","min-","max-","p-","px-","py-","pt-","pb-","pl-","pr-","m-","mx-","my-","mt-","mb-","ml-","mr-","gap-","space-","text-","font-","bg-","border","rounded","shadow","opacity-","overflow","z-","top-","bottom-","left-","right-","inset-","items-","justify-","self-","place-","order-","col-","row-","transform","transition","duration-","ease-","delay-","animate-","cursor-","select-","resize","appearance-","outline","ring","fill-","stroke-","sr-","not-","group","peer","dark:","hover:","focus:","active:","disabled:","first:","last:","odd:","even:","sm:","md:","lg:","xl:","2xl:","shrink","grow","basis-","truncate","break-","whitespace-","leading-","tracking-","align-","decoration-","underline","line-through","no-underline","uppercase","lowercase","capitalize","normal-case","italic","not-italic","antialiased","subpixel-antialiased","ordinal","slashed-zero","lining-nums","oldstyle-nums","proportional-nums","tabular-nums","diagonal-fractions","stacked-fractions","list-","aspect-","container","object-","overscroll-","scroll-","snap-","touch-","will-change-","content-","from-","via-","to-","gradient-","bg-clip-","bg-origin-","mix-blend-","bg-blend-","filter","blur","brightness-","contrast-","drop-shadow","grayscale","hue-rotate-","invert","saturate-","sepia","backdrop-","table-","caption-","columns-","break-","auto-","pointer-events-","visibility-","isolate","isolation-","float-","clear-","box-","display-","accent-","caret-","scroll-","divide-"];function uc(e){return cc.some(t=>e.startsWith(t)||e===t.replace("-","")||e.includes(":"))}function lr(e){let t=Array.prototype.filter.call(e.childNodes,l=>l.nodeType===Node.TEXT_NODE).map(l=>l.textContent?.trim()).filter(Boolean).join(" ").trim(),n=t.slice(0,25);if(n&&n.length>1)return`"${n}${t.length>25?"...":""}"`;let r=[...e.classList];if(r.includes("lucide"))return"Icon";let o=r.filter(l=>!l.startsWith("data-")&&!l.includes("zite")&&!uc(l)&&l.length>1);if(o.length>0)return o[0];let i=e.tagName.toLowerCase(),a=25;if(i==="button"){let l=e.textContent?.trim()||"";if(l)return`"${l.slice(0,a)}${l.length>a?"...":""}"`}if(i==="a"){let l=e.textContent?.trim()||"";if(l)return`"${l.slice(0,a)}${l.length>a?"...":""}"`}if(i==="img"){let l=e.getAttribute("alt");return l?l.length>a?l.slice(0,a)+"...":l:"image"}if(i==="input"){let l=e.getAttribute("type")||"text",s=e.getAttribute("placeholder");return s?s.length>a?s.slice(0,a)+"...":s:l}return""}function en(){let e=new Set,t=150,n=0,r=new Map,o=document.querySelectorAll("[data-zite-id]");for(let u of o){let f=u.getAttribute("data-zite-id");f&&r.set(f,(r.get(f)||0)+1)}function i(u,f,d){if(n>=t)return null;let p=u.getAttribute("data-zite-id"),m=p&&r.get(p)||1,h=Math.max(d,m),g=[];for(let y of u.children){if(n>=t)break;let w=i(y,f+(p?1:0),h);w&&g.push(w)}if(p&&!e.has(p)&&!Kt(p))return g.length===1?g[0]:null;if(p&&!e.has(p)){e.add(p),n++;let y=u.getAttribute("data-zite-component")||void 0,w=m>1&&m>d,v;if(m>1){let b=document.querySelectorAll(`[data-zite-id="${p}"]`),C=new Set;for(let x of b)C.add(lr(x));v=C.size===1?[...C][0]:""}else v=lr(u);return{id:p,tagName:u.tagName.toLowerCase(),componentName:y,label:v,children:g,depth:f,...w?{instanceCount:m}:{}}}return g.length>0&&g.length===1?g[0]:null}let a=[];for(let u of document.body.children){let f=i(u,0,1);f&&a.push(f)}function l(u){let f=[],d=u.getAttribute("data-zite-id");if(d&&!e.has(d)&&np.id===d.id)||a.push(d)}let s={id:fr,tagName:"App",componentName:"App",label:"",children:a,depth:0};function c(u,f){for(let d of u)d.depth+=f,d.children.length>0&&c(d.children,f)}return c(a,1),[s]}function tn(){if(!$)return null;let e=document.querySelector(`[data-zite-id="${$}"]`);if(!e)return null;let t=e.getBoundingClientRect();return{rect:{top:t.top,left:t.left,bottom:t.bottom,right:t.right,width:t.width,height:t.height},scrollX:window.scrollX,scrollY:window.scrollY}}var ur=null;function nn(e){ur=e}var dr=!1,na='',ra='';function br(e){dr=e;for(let t of ce.values()){let n=t.querySelector(".zite-ai-edit-icon");n&&(n.innerHTML=e?ra:na)}}var ut=null,dt=null,qe=null,Yt=null;function oa(e){return JSON.stringify(e.map(function t(n){return{id:n.id,tagName:n.tagName,componentName:n.componentName,label:n.label,children:n.children.map(t)}}))}var Zt=null;function dc(){if(!Zt)return;let e=en(),t=oa(e);t!==Yt&&(Yt=t,Zt(e))}function ia(e){vr(),Zt=e;let t=en();Yt=oa(t),dt=new MutationObserver(()=>{qe&&clearTimeout(qe),qe=setTimeout(()=>{sc(),dc()},100)}),dt.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-zite-id","data-zite-component","class"]})}function vr(){qe&&(clearTimeout(qe),qe=null),dt&&(dt.disconnect(),dt=null),Zt=null,Yt=null}function aa(e){if(ut){let t=document.querySelectorAll(`[data-zite-id="${ut}"]`);for(let n of t)n.getAttribute("data-zite-selected")!=="true"&&n.removeAttribute("data-zite-highlight");ut!==$&&(Ue(),pr(ut))}if(ut=e,e){let t=document.querySelectorAll(`[data-zite-id="${e}"]`);for(let n of t)n.setAttribute("data-zite-highlight","true");ft(e,{isSelected:!1}),e!==$&&mt(e,!1)}}function la(){let e=document.createElement("style");e.textContent=` [contenteditable] { position: relative; white-space: pre-wrap; cursor: text; } [contenteditable]:focus { outline: none; } /* Re-enable pointer events on SVGs with zite-id so they can be selected in the editor */ svg[data-zite-id] { pointer-events: auto !important; }`,document.head.appendChild(e)}function fc(e){let t=document.createElement("style");t.textContent=` .branding-pill { display: flex; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; align-items: center; border-radius: 45.02px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); overflow: visible; margin-bottom: 2px; margin-left: 1px; margin-right: 1px; padding-left: 1px; padding-right: 14px; transition: all 150ms; cursor: pointer; background-color: white; border: 1px solid #ccc; position: relative; } .branding-pill:hover { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 0 2px #FFC738; border-color: #FFC738; } .branding-pill-text { display: flex; align-items: center; margin-left: 9px; padding-top: 7px; padding-bottom: 7px; } .branding-pill-made-with { margin-left: 6px; margin-right: 5px; font-size: 12px; color: #777; } .branding-close { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; background-color: #f0f0f0; border: 1px solid #ccc; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #777; cursor: pointer; opacity: 0; transition: opacity 150ms; z-index: 10000; } .branding-pill:hover .branding-close { opacity: 1; } .branding-close:hover { background-color: #e0e0e0; color: #555; } `,document.head.appendChild(t);let n=document.createElement("div");Object.assign(n.style,{display:"flex",justifyContent:"center",alignItems:"center",paddingBottom:"0",paddingTop:"2px",position:"fixed",bottom:"25px",right:"25px",backgroundColor:"transparent",zIndex:9999});let r=document.createElement("a");r.target="_blank",r.rel="noreferrer",r.href="proxy.php?url=https://zite.com",r.className="branding-pill",e&&r.addEventListener("click",c=>{c.preventDefault(),e.send("branding.click")});let o=document.createElement("div");o.className="branding-close",o.textContent="\u2715",o.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),n.style.display="none"});let i=document.createElement("div");i.className="branding-pill-text";let a=document.createElement("div");a.innerHTML=Yr;let l=document.createElement("div");l.textContent="Made with",l.className="branding-pill-made-with";let s=document.createElement("div");s.innerHTML=Zr,i.appendChild(a),i.appendChild(l),i.appendChild(s),r.appendChild(i),r.appendChild(o),n.appendChild(r),document.body.appendChild(n)}async function Sr(e){(window.__ziteBranding||window.location.search.includes("branding"))&&fc(e)}var hc="root",mc=200,pc=100,gc=["react","React","facebook.github.io/react","reactjs.org","Cannot read","undefined is not an object","is not a function","Invalid hook call"];function yc(e){let t=`${e.message} ${e.stack||""}`;return gc.some(n=>t.includes(n))}function sa(e){let t=document.getElementById(hc);if(!t){console.info("[zite/app-runtime] skipping crash reporting: missing #root element");return}let r=t.childElementCount>0,o=!1,i=null;new MutationObserver(l=>{for(let s of l)s.type==="childList"&&(s.addedNodes.length>0&&t.childElementCount>0&&(r=!0,i&&(clearTimeout(i),i=null),o&&(console.log("[zite/app-runtime] React app recovered from crash"),o=!1)),r&&!o&&t.childElementCount===0&&s.removedNodes.length>0&&(i&&clearTimeout(i),i=window.setTimeout(()=>{if(t.childElementCount===0){let c=Date.now(),u=it.find(f=>yc(f)&&c-f.timestamp{document.body.addEventListener("click",e=>{if(e.target instanceof HTMLAnchorElement)try{let{origin:t}=new URL(e.target.href);t!==location.origin&&(window.open(e.target.href),e.preventDefault())}catch{}})};async function ol(){return await new Promise(e=>{document.readyState==="loading"?window.addEventListener("DOMContentLoaded",()=>e()):e()}),!0}async function il(e,t,n){let r=new URL(e);r.searchParams.set("flowPublicIdentifier",t);let o=new URLSearchParams(window.location.search),i=window._ziteUsageToken||o.get("usageToken");i&&r.searchParams.set("usageToken",i),r.searchParams.set("redirectUrl",n),window.location.href=r.toString()}async function Zd(){if(window.location.search.includes("zite-dev")){await import("http://localhost:2500/runtime/app-runtime.js");return}if(window.top!==window.self){let e=(0,cl.createChannel)(window.parent);e.on("refresh",()=>{location.reload()});let t=Zi(e),n=u=>{t(u),requestAnimationFrame(()=>{let f=tn();e.send("debugging.elementPosition",f)})},r=u=>{let f=u.target,d=f.getAttribute("data-zite-id");!d||!f.textContent||e.send("debug.edit",{id:d,textContent:f.textContent})},o=u=>{let{ctrlKey:f,metaKey:d,key:p,shiftKey:m}=u;if(u.currentTarget&&((f||d)&&["b","i","u"].includes(p)&&(u.preventDefault(),u.stopPropagation()),p==="Enter"&&!m)){u.preventDefault(),document.execCommand("insertLineBreak");let h=new InputEvent("input",{bubbles:!0,cancelable:!0});u.currentTarget.dispatchEvent(h)}};document.addEventListener("paste",u=>{if(!u.target.isContentEditable)return;u.preventDefault();let d=u.clipboardData?.getData("text/plain");document.execCommand("insertText",!1,d)});let i=null,a=()=>{i&&clearTimeout(i),i=setTimeout(()=>{let u=tn();e.send("debugging.elementPosition",u)},50)},l=()=>{if(hr(!0),ie){document.addEventListener("mouseover",gr),document.addEventListener("mouseout",Jt),document.addEventListener("click",n,!0),document.addEventListener("click",ue,!0),document.addEventListener("submit",ue,!0),document.addEventListener("touchstart",ue,!0),document.addEventListener("touchend",ue,!0),document.addEventListener("scroll",ye),window.addEventListener("resize",ye),document.addEventListener("focusin",ht),document.addEventListener("focusout",ht),document.addEventListener("scroll",a),window.addEventListener("resize",a),document.body.style.cursor="pointer";let u=document.querySelectorAll('[data-zite-editable="true"]');for(let f of u)f.setAttribute("contenteditable","false"),f.addEventListener("mousedown",n),f.addEventListener("input",r),f.addEventListener("keydown",o);ia(f=>{e.send("debugging.elementTree",{tree:f})}),nn(()=>{e.send("debugging.openAIEdit")})}};e.on("debugging.enable",({translateTagNames:u,editableFiles:f})=>{qi(u),f&&Wi(f),l()}),e.on("debugging.disable",()=>{if(hr(!1),ie){document.removeEventListener("mouseover",gr),document.removeEventListener("mouseout",Jt),document.removeEventListener("click",n,!0),document.removeEventListener("click",ue,!0),document.removeEventListener("submit",ue,!0),document.removeEventListener("touchstart",ue,!0),document.removeEventListener("touchend",ue,!0),document.removeEventListener("scroll",ye),window.removeEventListener("resize",ye),document.removeEventListener("focusin",ht),document.removeEventListener("focusout",ht),document.removeEventListener("scroll",a),window.removeEventListener("resize",a),nn(null),br(!1),yr(),Xi(),vr(),document.body.style.cursor="";let u=document.querySelectorAll('[data-zite-editable="true"]');for(let f of u)f.removeAttribute("contenteditable"),f.removeEventListener("mousedown",n),f.removeEventListener("input",r),f.removeEventListener("keydown",o)}}),document.addEventListener("keydown",u=>{u.key==="Escape"&&e.send("debugging.escape"),u.key==="s"&&(u.metaKey||u.ctrlKey)&&(u.preventDefault(),e.send("debugging.save"))}),e.on("debugging.deselect",()=>{yr()}),e.on("debugging.apply",({edits:u})=>{wr(u)}),e.on("debugging.hideElements",({ids:u})=>{Qi(u)}),e.on("debugging.showElements",({ids:u})=>{Ji(u)}),e.on("debugging.setOverlayVisibility",({visible:u})=>{Gi(u)}),e.on("debugging.getElementTree",()=>{let u=en();e.send("debugging.elementTree",{tree:u})}),e.on("debugging.highlightElement",({id:u})=>{aa(u)}),e.on("debugging.selectElement",({id:u})=>{Ki(u,e)});let s=null,c=null;e.on("theme.apply",({cssVariables:u,fontUrl:f})=>{if(s&&(s.remove(),s=null),f&&(!c||c.href!==f)&&(c&&(c.remove(),c=null),c=document.createElement("link"),c.id="zite-preview-fonts",c.rel="stylesheet",c.href=f,document.head.appendChild(c)),!u)return;s=document.createElement("style"),s.id="zite-theme-preview";let d=`:root { ${Object.entries(u).map(([p,m])=>` ${p}: ${m} !important;`).join(` `)} }`;s.textContent=d,document.head.appendChild(s)}),e.on("zite.init",({debug:u,id:f,edits:d,usageToken:p,isInternalMode:m,authUrl:h,appPublicIdentifier:g,redirectUrl:y,storedCurrentPath:w,shouldRestorePath:v})=>{console.info("[zite/app-runtime] received zite.init"),v&&w&&w!==document.location.pathname&&!h&&(document.location.pathname=w),u&&l(),f&&ea(f),d&&wr(d),p&&(window._ziteUsageToken=p),m!==void 0&&(window._ziteIsInternalMode=m),h&&g&&y&&il(h,g,y)}),e.on("navigation.back",()=>{history.back()}),e.on("navigation.forward",()=>{history.forward()}),e.on("navigation.path",u=>{document.location.pathname=u.path}),e.on("debugging.selectText",()=>{ta()}),e.on("debugging.getElementPosition",()=>{let u=tn();e.send("debugging.elementPosition",u)}),nn(()=>{e.send("debugging.openAIEdit")}),e.on("debugging.setAIEditOpen",({open:u})=>{br(u)}),Qr(e),ni(e),_i(e),la(),eo(),e.on("screenshot.capture",async()=>{let{captureScreenshot:u}=await Promise.resolve().then(()=>(rl(),nl));return await u()}),e.on("navigation.auth",u=>{il(u.authUrl,u.appPublicIdentifier,u.redirectUrl)}),e.start(),ol().then(()=>{console.info("[zite/app-runtime] sent ready"),e.send("ready"),sa(e),Sr(e),ca(),window.__ziteAnalytics?.enabled&&Mn()}),window.addEventListener("message",u=>{if(u.source===window.parent&&u.data?.type==="auth.sync"){let{token:f}=u.data.data;f?localStorage.setItem("zite.auth.token",f):localStorage.removeItem("zite.auth.token"),window.dispatchEvent(new CustomEvent("zite:auth-sync"))}}),console.info("[zite/app-runtime] initialized")}else ol().then(()=>{Sr(),window.__ziteAnalytics?.enabled&&Mn()})}Zd();var Wr=new URLSearchParams(window.location.search),al=Wr.get("usageToken");al&&(window._ziteUsageToken=al);var ll=Wr.get("isInternalMode");ll!==null&&(window._ziteIsInternalMode=ll==="true");var sl=Wr.get("ziteAuthToken");if(sl){try{localStorage.setItem("zite.auth.token",sl)}catch{}try{let e=new URL(window.location.href);e.searchParams.delete("ziteAuthToken"),history.replaceState(null,"",e.href)}catch{}}