@shgysk8zer0/polyfills 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/all.min.js +4 -4
- package/all.min.js.map +1 -1
- package/array.js +3 -3
- package/assets/dedent.js +0 -2
- package/assets/url-pattern.cjs +0 -1
- package/assets/url-pattern.js +0 -2
- package/browser.min.js +4 -4
- package/browser.min.js.map +1 -1
- package/node.cjs +1 -1
- package/node.min.js +1 -1
- package/node.min.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [v0.6.3] - 2026-03-23
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Fix missing `omitPadding` option in `Uint8Array.toBase64()`
|
|
14
|
+
|
|
10
15
|
## [v0.6.2] - 2026-02-05
|
|
11
16
|
|
|
12
17
|
### Fixed
|
package/all.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}();var t,r,n,o={exports:{}};function i(){return t||(t=1,o.exports=function(){const e=new WeakMap,t=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice,i="0".charCodeAt(0),a="9".charCodeAt(0),s="a".charCodeAt(0),l="f".charCodeAt(0),c="A".charCodeAt(0),u="F".charCodeAt(0);function p(e){if("string"==typeof e)return d([e])[0];if("function"==typeof e)return function(){const t=o.call(arguments);return t[0]=f(t[0]),e.apply(this,t)};const t=f(e);let r=h(t,0);for(let e=1;e<t.length;e++)r+=arguments[e]+h(t,e);return r}function h(e,t){const r=e[t];if(void 0===r)throw new TypeError(`invalid cooked string at index ${t}`);return r}function f(t){const r=e.get(t);if(r)return r;const n=d(t.raw),o=n.map(b);return Object.defineProperty(o,"raw",{value:Object.freeze(n)}),Object.freeze(o),e.set(t,o),o}function d(e){const o=e.map(e=>e.split(t));let i;for(let e=0;e<o.length;e++){const t=o[e],a=0===e,s=e+1===o.length;if(a){if(1===t.length||t[0].length>0)throw new Error("invalid content on opening line");t[1]=""}if(s){if(1===t.length||n.test(t[t.length-1]))throw new Error("invalid content on closing line");t[t.length-2]="",t[t.length-1]=""}for(let e=2;e<t.length;e+=2){const n=t[e],o=e+1===t.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=m(a,i):t[e]=""}}const a=i?i.length:0;return o.map(e=>{let t=e[0];for(let r=1;r<e.length;r+=2)t+=e[r]+e[r+1].slice(a);return t})}function m(e,t){if(void 0===t||e===t)return e;let r=0;for(const n=Math.min(e.length,t.length);r<n&&e[r]===t[r];r++);return e.slice(0,r)}function b(e){let t="",r=0,n=0;for(;(n=e.indexOf("\\",n))>-1;){if(t+=e.slice(r,n),++n===e.length)return;const o=e[n++];switch(o){case"b":t+="\b";break;case"t":t+="\t";break;case"n":t+="\n";break;case"v":t+="\v";break;case"f":t+="\f";break;case"r":t+="\r";break;case"\r":n<e.length&&"\n"===e[n]&&++n;case"\n":case"\u2028":case"\u2029":break;case"0":if(g(e,n))return;t+="\0";break;case"x":{const r=y(e,n,n+2);if(-1===r)return;n+=2,t+=String.fromCharCode(r);break}case"u":{let r;if(n<e.length&&"{"===e[n]){const t=e.indexOf("}",++n);if(-1===t)return;r=y(e,n,t),n=t+1}else r=y(e,n,n+4),n+=4;if(-1===r||r>1114111)return;t+=String.fromCodePoint(r);break}default:if(g(o,0))return;t+=o}r=n}return t+e.slice(r)}function g(e,t){const r=e.charCodeAt(t);return r>=i&&r<=a}function y(e,t,r){if(r>=e.length)return-1;let n=0;for(;t<r;t++){const r=w(e.charCodeAt(t));if(-1===r)return-1;n=16*n+r}return n}function w(e){return e>=i&&e<=a?e-i:e>=s&&e<=l?e-s+10:e>=c&&e<=u?e-c+10:-1}return p}()),o.exports}var a=e(n?r:(n=1,r=i()));String.dedent instanceof Function||(String.dedent=a),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){return Array.from(e).reduce((e,r,n)=>{const o=t.call(e,r,n);return e.hasOwnProperty(o)?e[o].push(r):e[o]=[r],e},{})}),Map.prototype.getOrInsert instanceof Function||(Map.prototype.getOrInsert=function(e,t){return this.has(e)?this.get(e):(this.set(e,t),t)},Map.prototype.getOrInsertComputed=function(e,t){if(this.has(e))return this.get(e);{const r=t.call(this,e);return this.set(e,r),r}}),WeakMap.prototype.getOrInsert instanceof Function||(WeakMap.prototype.getOrInsert=function(e,t){return Map.prototype.getOrInsert.call(this,e,t)},WeakMap.prototype.getOrInsertComputed=function(e,t){return WeakMap.prototype.getOrInsertComputed.call(this,e,t)}),Map.groupBy instanceof Function||(Map.groupBy=function(e,t){return Array.from(e).reduce((e,r,n)=>(e.emplace(t.call(e,r,n),{insert:()=>[r],update:e=>(e.push(r),e)}),e),new Map)}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:r}={}){console.warn("`Map.prototype.emplace()` has been removed from the proposal and will be removed in the future.");const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,n),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")});const s=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const r=(e,n)=>{Array.isArray(e)&&n>=0?e.forEach(e=>r(e,n-1)):t.push(e)};return r(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let r;return this.forEach((n,o,i)=>{e.call(t,n,o,i)&&(r=n)},t),r}),"lastIndex"in Array.prototype||Object.defineProperty(Array.prototype,"lastIndex",{enumerable:!1,configurable:!1,get:function(){return Math.max(0,this.length-1)}}),"lastItem"in Array.prototype||Object.defineProperty(Array.prototype,"lastItem",{enumerable:!1,configurable:!1,get:function(){return this[this.lastIndex]},set:function(e){this[this.lastIndex]=e}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let r=-1;return this.forEach((n,o,i)=>{e.call(t,n,o,i)&&(r=o)},t),r}),!(Array.prototype.at instanceof Function)){const Ze=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const et of s)void 0!==et&&Object.defineProperty(et.prototype,"at",{value:Ze,writable:!0,enumerable:!1,configurable:!0})}function l(e,t,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:r,writable:n,enumerable:o,configurable:i})}function c(e,t,{get:r,set:n,enumerable:o=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:r,set:n,enumerable:o,configurable:i})}function u(e,t,r){const{value:n,enumerable:o,configurable:i,writable:a}=Object.getOwnPropertyDescriptor(e,t),s=r(n);if(!(s instanceof Function))throw new TypeError(`Error overwriting ${t}. The func MUST be a function that accepts the original as an argument and return a function.`);Object.defineProperty(e,t,{value:s,enumerable:o,configurable:i,writable:a})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(e){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(e){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(e){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(e){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,r=globalThis){let n=[];for await(const t of e)n.push(await t);return Array.from(n,t,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every((t,r)=>{const n=e[r];return Array.isArray(t)?Array.isArray(n)&&t.equals(n):Object.is(t,n)}))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){switch(typeof e){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy(t=>t[e]);case"function":{const t=new Set;return this.filter((...r)=>{const n=e.apply(this,r);return!t.has(n)&&(t.add(n),!0)})}default:throw new TypeError("Not a valid argument for uniqueBy")}}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...r){const n=[...this];return n.splice(e,t,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const r=[...this];return r[e]=t,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(e){return!!(Array.isArray(e)&&Array.isArray(e.raw)&&Object.isFrozen(e)&&Object.isFrozen(e.raw))&&(0!==e.length&&e.length===e.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,e=>e.toString(16).padStart(2,"0")).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:e="base64"}={}){if("base64"===e){const e=32768;let t="";for(let r=0;r<this.length;r+=e){const n=this.subarray(r,r+e);t+=String.fromCharCode.apply(null,n)}return btoa(t)}if("base64url"===e)return this.toBase64({alphabet:"base64"}).replaceAll("+","-").replaceAll("/","_");throw new TypeError('expected alphabet to be either "base64" or "base64url')}),Uint8Array.fromHex instanceof Function||(Uint8Array.fromHex=function(e){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(0===!(1&e.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,e.length,{step:2}),t=>parseInt(e.substring(t,t+2),16))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(e,{alphabet:t="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(t))throw new TypeError('expected alphabet to be either "base64" or "base64url');if(!["loose","strict","stop-before-partial"].includes(r))throw new TypeError(`Invalid \`lastChunkHandling\`: "${r}".`);if("base64"!==t)return Uint8Array.fromBase64(e.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const t=e.length%4;if(1===t)throw new TypeError("Invalid string length.");if(0===t)return Uint8Array.from(atob(e),e=>e.charCodeAt(0));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(e.padEnd(e.length+(4-t),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(e.slice(0,e.length-t),{alphabet:"base64",lastChunkHandling:"strict"})}}}),"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol("Symbol.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol("Symbol.asyncDispose")),void 0===globalThis.SuppressedError&&(globalThis.SuppressedError=class extends Error{constructor(e,t,r=""){super(r),this.name="SuppressedError",this.error=e,this.suppressed=t}}),void 0===globalThis.AsyncDisposableStack&&(globalThis.AsyncDisposableStack=class e{#e=[];#t=!1;get[Symbol.toStringTag](){return"AsyncDisposableStack"}async[Symbol.asyncDispose](){if(!this.#t){let e;for(this.#t=!0;0!==this.#e.length;){const t=this.#e.pop();await Promise.try(t).catch(t=>{e=void 0===e?t:new SuppressedError(e,t,"An error is suppressed because another error happened while disposing an object")})}if(void 0!==e)throw e}}get disposed(){return this.#t}adopt(e,t){if(this.#t)throw new ReferenceError("AsyncDisposableStack has already been disposed");if("function"!=typeof t)throw new TypeError(`(${t}) is not a function.`);return this.#e.push(()=>t(e)),e}defer(e){if(this.#t)throw new ReferenceError("AsyncDisposableStack has already been disposed");if("function"!=typeof e)throw new TypeError(`${e} is not a function`);this.#e.push(e)}async disposeAsync(){await this[Symbol.asyncDispose]()}move(){if(this.#t)throw new ReferenceError("AsyncDisposableStack has already been disposed");{const t=new e;return t.#e=this.#e,this.#e=[],this.#t=!0,t}}use(e){switch(typeof e){case"function":case"object":if("function"==typeof e?.[Symbol.asyncDispose])return this.#e.push(e[Symbol.asyncDispose].bind(e)),e;if("function"==typeof e?.[Symbol.dispose])return this.#e.push(e[Symbol.dispose].bind(e)),e;if(null===e)return null;throw new TypeError("'Symbol.asyncDispose' property is not callable");case"undefined":break;default:throw new TypeError("Value to be disposed is not an object")}}}),void 0===globalThis.DisposableStack&&(globalThis.DisposableStack=class e{#e=[];#t=!1;get[Symbol.toStringTag](){return"DisposableStack"}[Symbol.dispose](){if(!this.#t){let e;for(this.#t=!0;0!==this.#e.length;){const t=this.#e.pop();try{t()}catch(t){e=void 0===e?t:new SuppressedError(e,t,"An error is suppressed because another error happened while disposing an object")}}if(void 0!==e)throw e}}get disposed(){return this.#t}adopt(e,t){if(this.#t)throw new ReferenceError("DisposableStack has already been disposed");if("function"!=typeof t)throw new TypeError(`(${t}) is not a function.`);return this.#e.push(()=>t(e)),e}defer(e){if(this.#t)throw new ReferenceError("DisposableStack has already been disposed");if("function"!=typeof e)throw new TypeError(`${e} is not a function`);this.#e.push(e)}dispose(){this[Symbol.dispose]()}move(){if(this.#t)throw new ReferenceError("DisposableStack has already been disposed");{const t=new e;return t.#e=this.#e,this.#e=[],this.#t=!0,t}}use(e){switch(typeof e){case"function":case"object":if("function"==typeof e?.[Symbol.dispose])return this.#e.push(e[Symbol.dispose].bind(e)),e;if(null===e)return null;throw new TypeError("'Symbol.dispose' property is not callable");case"undefined":break;default:throw new TypeError("Value to be disposed is not an object")}}}),"Symbol"in globalThis){const tt=new Set(Reflect.ownKeys(Symbol).filter(e=>"symbol"==typeof Symbol[e]).map(e=>Symbol[e]));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),l(Symbol,"isRegistered",function(e){return"symbol"==typeof e&&"string"==typeof Symbol.keyFor(e)}),l(Symbol,"isWellKnown",function(e){return tt.has(e)})}function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h,f,d,m,b,g;function y(){if(f)return h;f=1;var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(e,r)=>t(e,"name",{value:r,configurable:!0}),a={};((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(a,{URLPattern:()=>oe}),e=a,h=((e,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of n(i))!o.call(e,l)&&l!==a&&t(e,l,{get:()=>i[l],enumerable:!(s=r(i,l))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e);var s=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(e,t,r,n,o,i){this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}};i(s,"Part");var l=/[$_\p{ID_Start}]/u,c=/[$_\u200C\u200D\p{ID_Continue}]/u,u=".*";function p(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function d(e,t=!1){let r=[],n=0;for(;n<e.length;){let o=e[n],a=i(function(o){if(!t)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})},"ErrorOrInvalid");if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o){if(":"===o){let t="",o=n+1;for(;o<e.length;){let r=e.substr(o,1);if(!(o===n+1&&l.test(r)||o!==n+1&&c.test(r)))break;t+=e[o++]}if(!t){a(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:t}),n=o;continue}if("("===o){let t=1,o="",i=n+1,s=!1;if("?"===e[i]){a(`Pattern cannot start with "?" at ${i}`);continue}for(;i<e.length;){if(!p(e[i],!1)){a(`Invalid character '${e[i]}' at ${i}.`),s=!0;break}if("\\"!==e[i]){if(")"===e[i]){if(t--,0===t){i++;break}}else if("("===e[i]&&(t++,"?"!==e[i+1])){a(`Capturing groups are not allowed at ${i}`),s=!0;break}o+=e[i++]}else o+=e[i++]+e[i++]}if(s)continue;if(t){a(`Unbalanced pattern at ${n}`);continue}if(!o){a(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=i;continue}r.push({type:"CHAR",index:n,value:e[n++]})}else r.push({type:"CLOSE",index:n,value:e[n++]});else r.push({type:"OPEN",index:n,value:e[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});else r.push({type:"ASTERISK",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function m(e,t={}){let r=d(e);t.delimiter??="/#?",t.prefixes??="./";let n=`[^${b(t.delimiter)}]+?`,o=[],a=0,l=0,c=new Set,p=i(e=>{if(l<r.length&&r[l].type===e)return r[l++].value},"tryConsume"),h=i(()=>p("OTHER_MODIFIER")??p("ASTERISK"),"tryConsumeModifier"),f=i(e=>{let t=p(e);if(void 0!==t)return t;let{type:n,index:o}=r[l];throw new TypeError(`Unexpected ${n} at ${o}, expected ${e}`)},"mustConsume"),m=i(()=>{let e,t="";for(;e=p("CHAR")??p("ESCAPED_CHAR");)t+=e;return t},"consumeText"),g=i(e=>e,"DefaultEncodePart"),y=t.encodePart||g,w="",v=i(e=>{w+=e},"appendToPendingFixedValue"),T=i(()=>{w.length&&(o.push(new s(3,"","",y(w),"",3)),w="")},"maybeAddPartFromPendingFixedValue"),E=i((e,t,r,i,l)=>{let p,h=3;switch(l){case"?":h=1;break;case"*":h=0;break;case"+":h=2}if(!t&&!r&&3===h)return void v(e);if(T(),!t&&!r){if(!e)return;return void o.push(new s(3,"","",y(e),"",h))}p=r?"*"===r?u:r:n;let f,d=2;if(p===n?(d=1,p=""):p===u&&(d=0,p=""),t?f=t:r&&(f=a++),c.has(f))throw new TypeError(`Duplicate name '${f}'.`);c.add(f),o.push(new s(d,f,y(e),p,y(i),h))},"addPart");for(;l<r.length;){let e=p("CHAR"),r=p("NAME"),n=p("REGEX");if(!r&&!n&&(n=p("ASTERISK")),r||n){let o=e??"";-1===t.prefixes.indexOf(o)&&(v(o),o=""),T(),E(o,r,n,"",h());continue}let o=e??p("ESCAPED_CHAR");if(o)v(o);else{if(p("OPEN")){let e=m(),t=p("NAME"),r=p("REGEX");!t&&!r&&(r=p("ASTERISK"));let n=m();f("CLOSE"),E(e,t,r,n,h());continue}T(),f("END")}}return o}function b(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(e){return e&&e.ignoreCase?"ui":"u"}function y(e,t,r){return v(m(e,r),t,r)}function w(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function v(e,t,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of e){if(3===o.type){3===o.modifier?n+=b(o.value):n+=`(?:${b(o.value)})${w(o.modifier)}`;continue}t&&t.push(o.name);let e=`[^${b(r.delimiter)}]+?`,i=o.value;(1===o.type?i=e:0===o.type&&(i=u),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${b(o.prefix)}`,n+=`((?:${i})(?:`,n+=b(o.suffix),n+=b(o.prefix),n+=`(?:${i}))*)${b(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${b(o.prefix)}(${i})${b(o.suffix)})`,n+=w(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${w(o.modifier)}`:n+=`((?:${i})${w(o.modifier)})`}let o=`[${b(r.endsWith)}]|$`,i=`[${b(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${o})`:n+="$",new RegExp(n,g(r));r.strict||(n+=`(?:${i}(?=${o}))?`);let a=!1;if(e.length){let t=e[e.length-1];3===t.type&&3===t.modifier&&(a=r.delimiter.indexOf(t)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}i(p,"isASCII"),i(d,"lexer"),i(m,"parse"),i(b,"escapeString"),i(g,"flags"),i(y,"stringToRegexp"),i(w,"modifierToString"),i(v,"partsToRegexp");var T={delimiter:"",prefixes:"",sensitive:!0,strict:!0},E={delimiter:".",prefixes:"",sensitive:!0,strict:!0},S={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function A(e,t){return!!e.length&&("/"===e[0]||!(!t||e.length<2)&&(("\\"==e[0]||"{"==e[0])&&"/"==e[1]))}function k(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function x(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function M(e){return!(!e||e.length<2)&&("["===e[0]||("\\"===e[0]||"{"===e[0])&&"["===e[1])}i(A,"isAbsolutePathname"),i(k,"maybeStripPrefix"),i(x,"maybeStripSuffix"),i(M,"treatAsIPv6Hostname");var L=["ftp","file","http","https","ws","wss"];function O(e){if(!e)return!0;for(let t of L)if(e.test(t))return!0;return!1}function P(e,t){if(e=k(e,"#"),t||""===e)return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function R(e,t){if(e=k(e,"?"),t||""===e)return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function F(e,t){return t||""===e?e:M(e)?B(e):q(e)}function C(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.password=e,r.password}function j(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.username=e,r.username}function I(e,t,r){if(r||""===e)return e;if(t&&!L.includes(t))return new URL(`${t}:${e}`).pathname;let n="/"==e[0];return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}function N(e,t,r){return D(t)===e&&(e=""),r||""===e?e:_(e)}function H(e,t){return e=x(e,":"),t||""===e?e:U(e)}function D(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function U(e){if(""===e)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function z(e){if(""===e)return e;let t=new URL("https://example.com");return t.username=e,t.username}function $(e){if(""===e)return e;let t=new URL("https://example.com");return t.password=e,t.password}function q(e){if(""===e)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function B(e){if(""===e)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function _(e){if(""===e||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function V(e){if(""===e)return e;let t=new URL("https://example.com");return t.pathname="/"!==e[0]?"/-"+e:e,"/"!==e[0]?t.pathname.substring(2,t.pathname.length):t.pathname}function W(e){return""===e?e:new URL(`data:${e}`).pathname}function G(e){if(""===e)return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function X(e){if(""===e)return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}i(O,"isSpecialScheme"),i(P,"canonicalizeHash"),i(R,"canonicalizeSearch"),i(F,"canonicalizeHostname"),i(C,"canonicalizePassword"),i(j,"canonicalizeUsername"),i(I,"canonicalizePathname"),i(N,"canonicalizePort"),i(H,"canonicalizeProtocol"),i(D,"defaultPortForProtocol"),i(U,"protocolEncodeCallback"),i(z,"usernameEncodeCallback"),i($,"passwordEncodeCallback"),i(q,"hostnameEncodeCallback"),i(B,"ipv6HostnameEncodeCallback"),i(_,"portEncodeCallback"),i(V,"standardURLPathnameEncodeCallback"),i(W,"pathURLPathnameEncodeCallback"),i(G,"searchEncodeCallback"),i(X,"hashEncodeCallback");var K=class{#r;#n=[];#o={};#i=0;#a=1;#s=0;#l=0;#c=0;#u=0;#p=!1;constructor(e){this.#r=e}get result(){return this.#o}parse(){for(this.#n=d(this.#r,!0);this.#i<this.#n.length;this.#i+=this.#a){if(this.#a=1,"END"===this.#n[this.#i].type){if(0===this.#l){this.#h(),this.#f()?this.#d(9,1):this.#m()?this.#d(8,1):this.#d(7,0);continue}if(2===this.#l){this.#b(5);continue}this.#d(10,0);break}if(this.#c>0){if(!this.#g())continue;this.#c-=1}if(this.#y())this.#c+=1;else switch(this.#l){case 0:this.#w()&&this.#b(1);break;case 1:if(this.#w()){this.#v();let e=7,t=1;this.#T()?(e=2,t=3):this.#p&&(e=2),this.#d(e,t)}break;case 2:this.#E()?this.#b(3):(this.#S()||this.#m()||this.#f())&&this.#b(5);break;case 3:this.#A()?this.#d(4,1):this.#E()&&this.#d(5,1);break;case 4:this.#E()&&this.#d(5,1);break;case 5:this.#k()?this.#u+=1:this.#x()&&(this.#u-=1),this.#M()&&!this.#u?this.#d(6,1):this.#S()?this.#d(7,0):this.#m()?this.#d(8,1):this.#f()&&this.#d(9,1);break;case 6:this.#S()?this.#d(7,0):this.#m()?this.#d(8,1):this.#f()&&this.#d(9,1);break;case 7:this.#m()?this.#d(8,1):this.#f()&&this.#d(9,1);break;case 8:this.#f()&&this.#d(9,1)}}void 0!==this.#o.hostname&&void 0===this.#o.port&&(this.#o.port="")}#d(e,t){switch(this.#l){case 0:case 2:break;case 1:this.#o.protocol=this.#L();break;case 3:this.#o.username=this.#L();break;case 4:this.#o.password=this.#L();break;case 5:this.#o.hostname=this.#L();break;case 6:this.#o.port=this.#L();break;case 7:this.#o.pathname=this.#L();break;case 8:this.#o.search=this.#L();break;case 9:this.#o.hash=this.#L()}0!==this.#l&&10!==e&&([1,2,3,4].includes(this.#l)&&[6,7,8,9].includes(e)&&(this.#o.hostname??=""),[1,2,3,4,5,6].includes(this.#l)&&[8,9].includes(e)&&(this.#o.pathname??=this.#p?"/":""),[1,2,3,4,5,6,7].includes(this.#l)&&9===e&&(this.#o.search??="")),this.#O(e,t)}#O(e,t){this.#l=e,this.#s=this.#i+t,this.#i+=t,this.#a=0}#h(){this.#i=this.#s,this.#a=0}#b(e){this.#h(),this.#l=e}#P(e){return e<0&&(e=this.#n.length-e),e<this.#n.length?this.#n[e]:this.#n[this.#n.length-1]}#R(e,t){let r=this.#P(e);return r.value===t&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#w(){return this.#R(this.#i,":")}#T(){return this.#R(this.#i+1,"/")&&this.#R(this.#i+2,"/")}#E(){return this.#R(this.#i,"@")}#A(){return this.#R(this.#i,":")}#M(){return this.#R(this.#i,":")}#S(){return this.#R(this.#i,"/")}#m(){if(this.#R(this.#i,"?"))return!0;if("?"!==this.#n[this.#i].value)return!1;let e=this.#P(this.#i-1);return"NAME"!==e.type&&"REGEX"!==e.type&&"CLOSE"!==e.type&&"ASTERISK"!==e.type}#f(){return this.#R(this.#i,"#")}#y(){return"OPEN"==this.#n[this.#i].type}#g(){return"CLOSE"==this.#n[this.#i].type}#k(){return this.#R(this.#i,"[")}#x(){return this.#R(this.#i,"]")}#L(){let e=this.#n[this.#i],t=this.#P(this.#s).index;return this.#r.substring(t,e.index)}#v(){let e={};Object.assign(e,T),e.encodePart=U;let t=y(this.#L(),void 0,e);this.#p=O(t)}};i(K,"Parser");var Q=["protocol","username","password","hostname","port","pathname","search","hash"],J="*";function Y(e,t){if("string"!=typeof e)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:""!==r.search?r.search.substring(1,r.search.length):void 0,hash:""!==r.hash?r.hash.substring(1,r.hash.length):void 0}}function Z(e,t){return t?te(e):e}function ee(e,t,r){let n;if("string"==typeof t.baseURL)try{n=new URL(t.baseURL),void 0===t.protocol&&(e.protocol=Z(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&(e.username=Z(n.username,r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&void 0===t.password&&(e.password=Z(n.password,r)),void 0===t.protocol&&void 0===t.hostname&&(e.hostname=Z(n.hostname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&(e.port=Z(n.port,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&(e.pathname=Z(n.pathname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&(e.search=Z(n.search.substring(1,n.search.length),r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&void 0===t.hash&&(e.hash=Z(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if("string"==typeof t.protocol&&(e.protocol=H(t.protocol,r)),"string"==typeof t.username&&(e.username=j(t.username,r)),"string"==typeof t.password&&(e.password=C(t.password,r)),"string"==typeof t.hostname&&(e.hostname=F(t.hostname,r)),"string"==typeof t.port&&(e.port=N(t.port,e.protocol,r)),"string"==typeof t.pathname){if(e.pathname=t.pathname,n&&!A(e.pathname,r)){let t=n.pathname.lastIndexOf("/");t>=0&&(e.pathname=Z(n.pathname.substring(0,t+1),r)+e.pathname)}e.pathname=I(e.pathname,e.protocol,r)}return"string"==typeof t.search&&(e.search=R(t.search,r)),"string"==typeof t.hash&&(e.hash=P(t.hash,r)),e}function te(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function re(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function ne(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=`[^${re(t.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<e.length;++i){let a=e[i];if(3===a.type){if(3===a.modifier){o+=te(a.value);continue}o+=`{${te(a.value)}}${w(a.modifier)}`;continue}let s=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!t.prefixes.includes(a.prefix)),c=i>0?e[i-1]:null,u=i<e.length-1?e[i+1]:null;if(!l&&s&&1===a.type&&3===a.modifier&&u&&!u.prefix.length&&!u.suffix.length)if(3===u.type){let e=u.value.length>0?u.value[0]:"";l=n.test(e)}else l=!u.hasCustomName();if(!l&&!a.prefix.length&&c&&3===c.type){let e=c.value[c.value.length-1];l=t.prefixes.includes(e)}l&&(o+="{"),o+=te(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||c&&3!==c.type&&3===c.modifier&&!l&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=te(a.suffix),l&&(o+="}"),3!==a.modifier&&(o+=w(a.modifier))}return o}i(Y,"extractValues"),i(Z,"processBaseURLString"),i(ee,"applyInit"),i(te,"escapePatternString"),i(re,"escapeRegexpString"),i(ne,"partsToPattern");var oe=class{#r;#n={};#o={};#i={};#a={};#s=!1;constructor(e={},t,r){try{let n;if("string"==typeof t?n=t:r=t,"string"==typeof e){let t=new K(e);if(t.parse(),e=t.result,void 0===n&&"string"!=typeof e.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||"object"!=typeof e)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let o,i={ignoreCase:!0===r.ignoreCase},a={pathname:J,protocol:J,username:J,password:J,hostname:J,port:J,search:J,hash:J};for(o of(this.#r=ee(a,e,!0),D(this.#r.protocol)===this.#r.port&&(this.#r.port=""),Q)){if(!(o in this.#r))continue;let e={},t=this.#r[o];switch(this.#o[o]=[],o){case"protocol":Object.assign(e,T),e.encodePart=U;break;case"username":Object.assign(e,T),e.encodePart=z;break;case"password":Object.assign(e,T),e.encodePart=$;break;case"hostname":Object.assign(e,E),M(t)?e.encodePart=B:e.encodePart=q;break;case"port":Object.assign(e,T),e.encodePart=_;break;case"pathname":O(this.#n.protocol)?(Object.assign(e,S,i),e.encodePart=V):(Object.assign(e,T,i),e.encodePart=W);break;case"search":Object.assign(e,T,i),e.encodePart=G;break;case"hash":Object.assign(e,T,i),e.encodePart=X}try{this.#a[o]=m(t,e),this.#n[o]=v(this.#a[o],this.#o[o],e),this.#i[o]=ne(this.#a[o],e),this.#s=this.#s||this.#a[o].some(e=>2===e.type)}catch{throw new TypeError(`invalid ${o} pattern '${this.#r[o]}'.`)}}}catch(e){throw new TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(e={},t){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{n=ee(n,"object"==typeof e?e:Y(e,t),!1)}catch{return!1}for(r of Q)if(!this.#n[r].exec(n[r]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{r=ee(r,"object"==typeof e?e:Y(e,t),!1)}catch{return null}let n,o={};for(n of(o.inputs=t?[e,t]:[e],Q)){let e=this.#n[n].exec(r[n]);if(!e)return null;let t={};for(let[r,o]of this.#o[n].entries())if("string"==typeof o||"number"==typeof o){let n=e[r+1];t[o]=n}o[n]={input:r[n]??"",groups:t}}return o}static compareComponent(e,t,r){let n=i((e,t)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(e[r]<t[r])return-1;if(e[r]!==t[r])return 1}return 0},"comparePart"),o=new s(3,"","","","",3),a=new s(0,"","","","",3),l=i((e,t)=>{let r=0;for(;r<Math.min(e.length,t.length);++r){let o=n(e[r],t[r]);if(o)return o}return e.length===t.length?0:n(e[r]??o,t[r]??o)},"comparePartList");return t.#i[e]||r.#i[e]?t.#i[e]&&!r.#i[e]?l(t.#a[e],[a]):!t.#i[e]&&r.#i[e]?l([a],r.#a[e]):l(t.#a[e],r.#a[e]):0}get protocol(){return this.#i.protocol}get username(){return this.#i.username}get password(){return this.#i.password}get hostname(){return this.#i.hostname}get port(){return this.#i.port}get pathname(){return this.#i.pathname}get search(){return this.#i.search}get hash(){return this.#i.hash}get hasRegExpGroups(){return this.#s}};return i(oe,"URLPattern"),h}var w=p(g?b:(g=1,b=function(){if(m)return d;m=1;const{URLPattern:e}=y();return d={URLPattern:e},globalThis.URLPattern||(globalThis.URLPattern=e),d}()));"URLPattern"in globalThis||(globalThis.URLPattern=w),l(URL,"parse",(e,t)=>{try{return new URL(e,t)}catch{return null}}),l(URL,"canParse",(e,t)=>{try{return new URL(e,t)instanceof URL}catch{return!1}}),Number.range instanceof Function||(Number.range=function(e,t,r=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:r})});const v="Iterator"in globalThis,T=v?globalThis.Iterator.prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),E=v?globalThis.Iterator:(e=>{class t{[Symbol.iterator](){return this}get[Symbol.toStringTag](){return"Iterator"}}return Object.setPrototypeOf(t,e),t})(T);var S;E.range instanceof Function||(E.range=function(e,t,r){if("number"==typeof r||"bigint"==typeof r)return E.range(e,t,{step:r});if("object"!=typeof r||Object.is(r,null))return E.range(e,t,{});{const{step:n=("number"==typeof e?e<t?1:-1:e<t?1n:-1n),inclusive:o=!1}=r;if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Start must be a number");if(Number.isNaN(e))throw new RangeError("Invalid start");if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("End must be a number");if(Number.isNaN(t))throw new RangeError("Invalid end");if("number"!=typeof n&&"bigint"!=typeof n)throw new TypeError("Step must be a number");if(Number.isNaN(n))throw new RangeError("Invalid step");if(0===n)throw new RangeError("Step must not be 0");if(n<0&&e<t||n>0&&e>t)return;if(o){let r=e;return n>0?E.from({next(){const e=r<=t?{value:r,done:!1}:{done:!0};return r+=n,e}}):E.from({next(){const e=r>=t?{value:r,done:!1}:{done:!0};return r+=n,e}})}{let r=e;if(n>0)return E.from({next(){const e=r<t?{value:r,done:!1}:{done:!0};return r+=n,e}});{let r=e;return E.from({next(){const e=r>t?{value:r,done:!1}:{done:!0};return r+=n,e}})}}}}),T[Symbol.toStringTag]||(T[Symbol.toStringTag]="Iterator"),T.take instanceof Function||(T.take=function(e){let t=0;const r=this;return E.from({next:()=>t++>=e?{done:!0}:r.next()})}),T.drop instanceof Function||(T.drop=function(e){for(let t=0;t<e;t++){const{done:e}=this.next();if(e)break}return this}),T.toArray instanceof Function||(T.toArray=function(){return Array.from(this)}),T.forEach instanceof Function||(T.forEach=function(e){for(const t of this)e.call(this,t)}),T.flatMap instanceof Function||(T.flatMap=function(e){const t=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?E.from({next:()=>({done:!0})}):E.from(e.call(t,r));let o=n(r);return E.from({next(){const{value:e,done:i=!0}=o.next();return r.done&&i?{done:!0}:i?r.done?{done:!0}:(r=t.next(),o=n(r),o.next()):{value:e,done:i}}})}),T.map instanceof Function||(T.map=function(e){const t=this;return E.from({next(){const{done:r,value:n}=t.next();return r?{done:r}:{value:e.call(t,n),done:!1}}})}),T.reduce instanceof Function||(T.reduce=function(e,t){let r=void 0===t?this.next().value:t;for(const t of this)r=e.call(this,r,t);return r}),T.filter instanceof Function||(T.filter=function(e){const t=this;let r,n=!1;return E.from({next(){for(;!n;){const o=t.next();if(n=o.done,n)break;if(e.call(t,o.value)){r=o.value;break}}return{done:n,value:r}}})}),T.some instanceof Function||(T.some=function(e){let t=!1;for(const r of this)if(e.call(this,r)){t=!0;break}return t}),T.every instanceof Function||(T.every=function(e){let t=!0;for(const r of this)if(!e.call(this,r)){t=!1;break}return t}),T.find instanceof Function||(T.find=function(e){for(const t of this)if(e.call(this,t))return t}),T.indexed instanceof Function||(T.indexed=function(){let e=0;return this.map(t=>[e++,t])}),T.chunks instanceof Function||(T.chunks=function(e){if(!Number.isSafeInteger(e)||e<1)throw new TypeError("Size must be a positive integer.");{const t=this;let r=!1;return E.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<e&&!r;){const e=t.next();if(e.done){r=!0,void 0!==e.value&&n.push(e.value);break}n.push(e.value)}return{value:n,done:!1}}}})}}),E.from instanceof Function||(E.from=function(e){if("object"!=typeof e||null===e)throw new TypeError("Not an object.");if(e.next instanceof Function){return Object.create(T,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...t)=>e.next(...t)}})}if(e[Symbol.iterator]instanceof Function)return E.from(e[Symbol.iterator]())}),v||(globalThis.Iterator=E),l(ReadableStream,"from",function(e){if(e[Symbol.iterator]instanceof Function)return new ReadableStream({start(t){try{for(const r of e)t.enqueue(r)}catch(e){t.error(e)}finally{t.close()}}});if(e[Symbol.asyncIterator]instanceof Function)return new ReadableStream({async start(t){try{for await(const r of e)t.enqueue(r)}catch(e){t.error(e)}finally{t.close()}}});throw new TypeError("`ReadableStream.from()` requires an iterable source.")}),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce((e,t)=>e+t**2,0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(S=new Float32Array(1),function(e){return S[0]=e,S[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,r){return Math.min(Math.max(e,t),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(e){let t=-0;for(const r of e){if(!Number.isFinite(r)){t=-0;break}t+=r}return t}),Math.sum instanceof Function||(Math.sum=function(...e){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(e)}),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",r=[t,"file:","wss:"],n=(e=globalThis.document)=>[...e.scripts].every(({src:r})=>{if(0===r.length)return!0;{const{protocol:n,hostname:o}=new URL(r,e.baseURI);return n===t||o===location.hostname}});Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!r.includes(location.protocol)&&!e.includes(location.hostname))&&n())}})}}();function A(e){return function(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}(e)||e instanceof Promise}
|
|
1
|
+
!function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(){"undefined"==typeof globalThis&&("undefined"!=typeof window?Object.defineProperty(Window.prototype,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:window}):"undefined"!=typeof global?Object.defineProperty(global,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:global}):"undefined"!=typeof self?Object.defineProperty(self,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:self}):Object.defineProperty(this,"globalThis",{enumerable:!1,writable:!0,configurable:!0,value:this}))}();var t,r,n,o={exports:{}};function i(){return t||(t=1,o.exports=function(){const e=new WeakMap,t=/(\n|\r\n?|\u2028|\u2029)/g,r=/^\s*/,n=/\S/,o=Array.prototype.slice,i="0".charCodeAt(0),a="9".charCodeAt(0),s="a".charCodeAt(0),l="f".charCodeAt(0),c="A".charCodeAt(0),u="F".charCodeAt(0);function p(e){if("string"==typeof e)return f([e])[0];if("function"==typeof e)return function(){const t=o.call(arguments);return t[0]=d(t[0]),e.apply(this,t)};const t=d(e);let r=h(t,0);for(let e=1;e<t.length;e++)r+=arguments[e]+h(t,e);return r}function h(e,t){const r=e[t];if(void 0===r)throw new TypeError(`invalid cooked string at index ${t}`);return r}function d(t){const r=e.get(t);if(r)return r;const n=f(t.raw),o=n.map(b);return Object.defineProperty(o,"raw",{value:Object.freeze(n)}),Object.freeze(o),e.set(t,o),o}function f(e){const o=e.map(e=>e.split(t));let i;for(let e=0;e<o.length;e++){const t=o[e],a=0===e,s=e+1===o.length;if(a){if(1===t.length||t[0].length>0)throw new Error("invalid content on opening line");t[1]=""}if(s){if(1===t.length||n.test(t[t.length-1]))throw new Error("invalid content on closing line");t[t.length-2]="",t[t.length-1]=""}for(let e=2;e<t.length;e+=2){const n=t[e],o=e+1===t.length&&!s,a=r.exec(n)[0];o||a.length!==n.length?i=m(a,i):t[e]=""}}const a=i?i.length:0;return o.map(e=>{let t=e[0];for(let r=1;r<e.length;r+=2)t+=e[r]+e[r+1].slice(a);return t})}function m(e,t){if(void 0===t||e===t)return e;let r=0;for(const n=Math.min(e.length,t.length);r<n&&e[r]===t[r];r++);return e.slice(0,r)}function b(e){let t="",r=0,n=0;for(;(n=e.indexOf("\\",n))>-1;){if(t+=e.slice(r,n),++n===e.length)return;const o=e[n++];switch(o){case"b":t+="\b";break;case"t":t+="\t";break;case"n":t+="\n";break;case"v":t+="\v";break;case"f":t+="\f";break;case"r":t+="\r";break;case"\r":n<e.length&&"\n"===e[n]&&++n;case"\n":case"\u2028":case"\u2029":break;case"0":if(g(e,n))return;t+="\0";break;case"x":{const r=y(e,n,n+2);if(-1===r)return;n+=2,t+=String.fromCharCode(r);break}case"u":{let r;if(n<e.length&&"{"===e[n]){const t=e.indexOf("}",++n);if(-1===t)return;r=y(e,n,t),n=t+1}else r=y(e,n,n+4),n+=4;if(-1===r||r>1114111)return;t+=String.fromCodePoint(r);break}default:if(g(o,0))return;t+=o}r=n}return t+e.slice(r)}function g(e,t){const r=e.charCodeAt(t);return r>=i&&r<=a}function y(e,t,r){if(r>=e.length)return-1;let n=0;for(;t<r;t++){const r=w(e.charCodeAt(t));if(-1===r)return-1;n=16*n+r}return n}function w(e){return e>=i&&e<=a?e-i:e>=s&&e<=l?e-s+10:e>=c&&e<=u?e-c+10:-1}return p}()),o.exports}var a=e(n?r:(n=1,r=i()));String.dedent instanceof Function||(String.dedent=a),!("crypto"in window)&&"msCrypto"in window&&(globalThis.crypto=globalThis.msCrypto),"Notification"in window||(globalThis.Notification=globalThis.notifications||globalThis.webkitNotifications||globalThis.oNotifications||globalThis.msNotifications||!1),"doNotTrack"in navigator||(navigator.doNotTrack=globalThis.doNotTrack||navigator.msDoNotTrack||"unspecified"),"indexedDB"in window||(globalThis.indexedDB=globalThis.indexedDB||globalThis.mozIndexedDB||globalThis.webkitIndexedDB||globalThis.msIndexedDB||!1),"hidden"in document||(document.hidden=document.webkitHidden||document.msHidden||document.mozHidden||!1),"visibilityState"in document||(document.visibilityState=document.webkitVisibilityState||document.msVisibilityState||document.mozVisibilityState||"visible"),"fullscreenElement"in document||(document.fullscreenElement=document.mozFullScreenElement||document.webkitFullscreenElement||!1),"requestAnimationFrame"in window||(globalThis.requestAnimationFrame=globalThis.mozRequestAnimationFrame||globalThis.webkitRequestAnimationFrame||globalThis.msRequestAnimationFrame||!1),"exitFullscreen"in Document.prototype||(Document.prototype.exitFullscreen=document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msCancelFullScreen||!1),"requestFullscreen"in HTMLElement.prototype||(HTMLElement.prototype.requestFullscreen=HTMLElement.prototype.requestFullScreen||HTMLElement.prototype.mozRequestFullScreen||HTMLElement.prototype.webkitRequestFullScreen||!1),"fullscreen"in Document.prototype||Object.defineProperty(Document.prototype,"fullscreen",{get:()=>document.fullscreenElement instanceof Element}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){return Array.from(e).reduce((e,r,n)=>{const o=t.call(e,r,n);return e.hasOwnProperty(o)?e[o].push(r):e[o]=[r],e},{})}),Map.prototype.getOrInsert instanceof Function||(Map.prototype.getOrInsert=function(e,t){return this.has(e)?this.get(e):(this.set(e,t),t)},Map.prototype.getOrInsertComputed=function(e,t){if(this.has(e))return this.get(e);{const r=t.call(this,e);return this.set(e,r),r}}),WeakMap.prototype.getOrInsert instanceof Function||(WeakMap.prototype.getOrInsert=function(e,t){return Map.prototype.getOrInsert.call(this,e,t)},WeakMap.prototype.getOrInsertComputed=function(e,t){return WeakMap.prototype.getOrInsertComputed.call(this,e,t)}),Map.groupBy instanceof Function||(Map.groupBy=function(e,t){return Array.from(e).reduce((e,r,n)=>(e.emplace(t.call(e,r,n),{insert:()=>[r],update:e=>(e.push(r),e)}),e),new Map)}),Map.prototype.emplace instanceof Function||(Map.prototype.emplace=function(e,{insert:t,update:r}={}){console.warn("`Map.prototype.emplace()` has been removed from the proposal and will be removed in the future.");const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,n),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")});const s=[Array,String,globalThis.Int8Array,globalThis.Uint8Array,globalThis.Uint8ClampedArray,globalThis.Int16Array,globalThis.Uint16Array,globalThis.Int32Array,globalThis.Uint32Array,globalThis.Float32Array,globalThis.Float64Array,globalThis.BigInt64Array,globalThis.BigUint64Array];if(Array.prototype.flat instanceof Function||(Array.prototype.flat=function(e=1){const t=[];e=Math.min(Number.MAX_SAFE_INTEGER,Math.max(0,e));const r=(e,n)=>{Array.isArray(e)&&n>=0?e.forEach(e=>r(e,n-1)):t.push(e)};return r(this,Number.isNaN(e)?0:e),t}),Array.prototype.flatMap instanceof Function||(Array.prototype.flatMap=function(e,t){return this.map(e,t).flat(1)}),Array.prototype.findLast instanceof Function||(Array.prototype.findLast=function(e,t){let r;return this.forEach((n,o,i)=>{e.call(t,n,o,i)&&(r=n)},t),r}),"lastIndex"in Array.prototype||Object.defineProperty(Array.prototype,"lastIndex",{enumerable:!1,configurable:!1,get:function(){return Math.max(0,this.length-1)}}),"lastItem"in Array.prototype||Object.defineProperty(Array.prototype,"lastItem",{enumerable:!1,configurable:!1,get:function(){return this[this.lastIndex]},set:function(e){this[this.lastIndex]=e}}),Array.prototype.findLastIndex instanceof Function||(Array.prototype.findLastIndex=function(e,t){let r=-1;return this.forEach((n,o,i)=>{e.call(t,n,o,i)&&(r=o)},t),r}),!(Array.prototype.at instanceof Function)){const Ze=function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]};for(const et of s)void 0!==et&&Object.defineProperty(et.prototype,"at",{value:Ze,writable:!0,enumerable:!1,configurable:!0})}function l(e,t,r,{writable:n=!0,enumerable:o=!0,configurable:i=!0}={}){e[t]instanceof Function||Object.defineProperty(e,t,{value:r,writable:n,enumerable:o,configurable:i})}function c(e,t,{get:r,set:n,enumerable:o=!0,configurable:i=!0}={}){e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:r,set:n,enumerable:o,configurable:i})}function u(e,t,r){const{value:n,enumerable:o,configurable:i,writable:a}=Object.getOwnPropertyDescriptor(e,t),s=r(n);if(!(s instanceof Function))throw new TypeError(`Error overwriting ${t}. The func MUST be a function that accepts the original as an argument and return a function.`);Object.defineProperty(e,t,{value:s,enumerable:o,configurable:i,writable:a})}if(!(Array.prototype.group instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.group=function(e){return console.warn("`Array.group()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupBy instanceof Function)&&Object.groupBy instanceof Function&&(Array.prototype.groupBy=function(e){return console.warn("`Array.goupBy()` is deprecated. Please use `Object.groupBy()` instead."),Object.groupBy(this,e)}),!(Array.prototype.groupToMap instanceof Function)&&Map.groupBy instanceof Function&&(Array.prototype.groupToMap=function(e){return console.warn("`Array.groupToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Map.groupBy instanceof Function&&(Array.prototype.groupByToMap=function(e){return console.warn("`Array.groupByToMap()` is deprecated. Please use `Map.groupBy()` instead."),Map.groupBy(this,e)}),Array.fromAsync instanceof Function||(Array.fromAsync=async function(e,t,r=globalThis){let n=[];for await(const t of e)n.push(await t);return Array.from(n,t,r)}),Array.prototype.equals instanceof Function||(Array.prototype.equals=function(e){return this===e||!!Array.isArray(e)&&(this.length===e.length&&this.every((t,r)=>{const n=e[r];return Array.isArray(t)?Array.isArray(n)&&t.equals(n):Object.is(t,n)}))}),Array.prototype.uniqueBy instanceof Function||(Array.prototype.uniqueBy=function(e){switch(typeof e){case"undefined":return[...new Set(this)];case"string":case"number":case"symbol":return this.uniqueBy(t=>t[e]);case"function":{const t=new Set;return this.filter((...r)=>{const n=e.apply(this,r);return!t.has(n)&&(t.add(n),!0)})}default:throw new TypeError("Not a valid argument for uniqueBy")}}),Array.prototype.toReversed instanceof Function||(Array.prototype.toReversed=function(){return[...this].reverse()}),Array.prototype.toSorted instanceof Function||(Array.prototype.toSorted=function(e){return[...this].sort(e)}),Array.prototype.toSpliced instanceof Function||(Array.prototype.toSpliced=function(e,t,...r){const n=[...this];return n.splice(e,t,...r),n}),Array.prototype.with instanceof Function||(Array.prototype.with=function(e,t){const r=[...this];return r[e]=t,r}),Array.isTemplateObject instanceof Function||(Array.isTemplateObject=function(e){return!!(Array.isArray(e)&&Array.isArray(e.raw)&&Object.isFrozen(e)&&Object.isFrozen(e.raw))&&(0!==e.length&&e.length===e.raw.length)}),Uint8Array.prototype.toHex instanceof Function||(Uint8Array.prototype.toHex=function(){return Array.from(this,e=>e.toString(16).padStart(2,"0")).join("")}),Uint8Array.prototype.toBase64 instanceof Function||(Uint8Array.prototype.toBase64=function({alphabet:e="base64",omitPadding:t=!1}={}){if("base64"===e){const e=32768;let r="";for(let t=0;t<this.length;t+=e){const n=this.subarray(t,t+e);r+=String.fromCharCode.apply(null,n)}return t?btoa(r).replace(/=+$/,""):btoa(r)}if("base64url"===e)return this.toBase64({alphabet:"base64",omitPadding:t}).replaceAll("+","-").replaceAll("/","_");throw new TypeError('expected alphabet to be either "base64" or "base64url')}),Uint8Array.fromHex instanceof Function||(Uint8Array.fromHex=function(e){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(0===!(1&e.length))throw new SyntaxError("string should be an even number of characters");return Uint8Array.from(globalThis.Iterator.range(0,e.length,{step:2}),t=>parseInt(e.substring(t,t+2),16))}),Uint8Array.fromBase64 instanceof Function||(Uint8Array.fromBase64=function(e,{alphabet:t="base64",lastChunkHandling:r="loose"}={}){if("string"!=typeof e)throw new TypeError("expected input to be a string");if(!["base64","base64url"].includes(t))throw new TypeError('expected alphabet to be either "base64" or "base64url');if(!["loose","strict","stop-before-partial"].includes(r))throw new TypeError(`Invalid \`lastChunkHandling\`: "${r}".`);if("base64"!==t)return Uint8Array.fromBase64(e.replaceAll("-","+").replaceAll("_","/"),{alphabet:"base64"});{const t=e.length%4;if(1===t)throw new TypeError("Invalid string length.");if(0===t)return Uint8Array.from(atob(e),e=>e.charCodeAt(0));switch(r){case"strict":throw new SyntaxError("Missing padding.");case"loose":return Uint8Array.fromBase64(e.padEnd(e.length+(4-t),"="),{alphabet:"base64",lastChunkHandling:"strict"});case"stop-before-partial":return Uint8Array.fromBase64(e.slice(0,e.length-t),{alphabet:"base64",lastChunkHandling:"strict"})}}}),"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol("Symbol.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol("Symbol.asyncDispose")),void 0===globalThis.SuppressedError&&(globalThis.SuppressedError=class extends Error{constructor(e,t,r=""){super(r),this.name="SuppressedError",this.error=e,this.suppressed=t}}),void 0===globalThis.AsyncDisposableStack&&(globalThis.AsyncDisposableStack=class e{#e=[];#t=!1;get[Symbol.toStringTag](){return"AsyncDisposableStack"}async[Symbol.asyncDispose](){if(!this.#t){let e;for(this.#t=!0;0!==this.#e.length;){const t=this.#e.pop();await Promise.try(t).catch(t=>{e=void 0===e?t:new SuppressedError(e,t,"An error is suppressed because another error happened while disposing an object")})}if(void 0!==e)throw e}}get disposed(){return this.#t}adopt(e,t){if(this.#t)throw new ReferenceError("AsyncDisposableStack has already been disposed");if("function"!=typeof t)throw new TypeError(`(${t}) is not a function.`);return this.#e.push(()=>t(e)),e}defer(e){if(this.#t)throw new ReferenceError("AsyncDisposableStack has already been disposed");if("function"!=typeof e)throw new TypeError(`${e} is not a function`);this.#e.push(e)}async disposeAsync(){await this[Symbol.asyncDispose]()}move(){if(this.#t)throw new ReferenceError("AsyncDisposableStack has already been disposed");{const t=new e;return t.#e=this.#e,this.#e=[],this.#t=!0,t}}use(e){switch(typeof e){case"function":case"object":if("function"==typeof e?.[Symbol.asyncDispose])return this.#e.push(e[Symbol.asyncDispose].bind(e)),e;if("function"==typeof e?.[Symbol.dispose])return this.#e.push(e[Symbol.dispose].bind(e)),e;if(null===e)return null;throw new TypeError("'Symbol.asyncDispose' property is not callable");case"undefined":break;default:throw new TypeError("Value to be disposed is not an object")}}}),void 0===globalThis.DisposableStack&&(globalThis.DisposableStack=class e{#e=[];#t=!1;get[Symbol.toStringTag](){return"DisposableStack"}[Symbol.dispose](){if(!this.#t){let e;for(this.#t=!0;0!==this.#e.length;){const t=this.#e.pop();try{t()}catch(t){e=void 0===e?t:new SuppressedError(e,t,"An error is suppressed because another error happened while disposing an object")}}if(void 0!==e)throw e}}get disposed(){return this.#t}adopt(e,t){if(this.#t)throw new ReferenceError("DisposableStack has already been disposed");if("function"!=typeof t)throw new TypeError(`(${t}) is not a function.`);return this.#e.push(()=>t(e)),e}defer(e){if(this.#t)throw new ReferenceError("DisposableStack has already been disposed");if("function"!=typeof e)throw new TypeError(`${e} is not a function`);this.#e.push(e)}dispose(){this[Symbol.dispose]()}move(){if(this.#t)throw new ReferenceError("DisposableStack has already been disposed");{const t=new e;return t.#e=this.#e,this.#e=[],this.#t=!0,t}}use(e){switch(typeof e){case"function":case"object":if("function"==typeof e?.[Symbol.dispose])return this.#e.push(e[Symbol.dispose].bind(e)),e;if(null===e)return null;throw new TypeError("'Symbol.dispose' property is not callable");case"undefined":break;default:throw new TypeError("Value to be disposed is not an object")}}}),"Symbol"in globalThis){const tt=new Set(Reflect.ownKeys(Symbol).filter(e=>"symbol"==typeof Symbol[e]).map(e=>Symbol[e]));void 0===Symbol.toStringTag&&(Symbol.toStringTag=Symbol("Symbol.toStringTag")),void 0===Symbol.iterator&&(Symbol.iterator=Symbol("Symbol.iterator")),l(Symbol,"isRegistered",function(e){return"symbol"==typeof e&&"string"==typeof Symbol.keyFor(e)}),l(Symbol,"isWellKnown",function(e){return tt.has(e)})}function p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h,d,f,m,b,g;function y(){if(d)return h;d=1;var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(e,r)=>t(e,"name",{value:r,configurable:!0}),a={};((e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})})(a,{URLPattern:()=>oe}),e=a,h=((e,i,a,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of n(i))!o.call(e,l)&&l!==a&&t(e,l,{get:()=>i[l],enumerable:!(s=r(i,l))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e);var s=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(e,t,r,n,o,i){this.type=e,this.name=t,this.prefix=r,this.value=n,this.suffix=o,this.modifier=i}hasCustomName(){return""!==this.name&&"number"!=typeof this.name}};i(s,"Part");var l=/[$_\p{ID_Start}]/u,c=/[$_\u200C\u200D\p{ID_Continue}]/u,u=".*";function p(e,t){return(t?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(e)}function f(e,t=!1){let r=[],n=0;for(;n<e.length;){let o=e[n],a=i(function(o){if(!t)throw new TypeError(o);r.push({type:"INVALID_CHAR",index:n,value:e[n++]})},"ErrorOrInvalid");if("*"!==o)if("+"!==o&&"?"!==o)if("\\"!==o)if("{"!==o)if("}"!==o){if(":"===o){let t="",o=n+1;for(;o<e.length;){let r=e.substr(o,1);if(!(o===n+1&&l.test(r)||o!==n+1&&c.test(r)))break;t+=e[o++]}if(!t){a(`Missing parameter name at ${n}`);continue}r.push({type:"NAME",index:n,value:t}),n=o;continue}if("("===o){let t=1,o="",i=n+1,s=!1;if("?"===e[i]){a(`Pattern cannot start with "?" at ${i}`);continue}for(;i<e.length;){if(!p(e[i],!1)){a(`Invalid character '${e[i]}' at ${i}.`),s=!0;break}if("\\"!==e[i]){if(")"===e[i]){if(t--,0===t){i++;break}}else if("("===e[i]&&(t++,"?"!==e[i+1])){a(`Capturing groups are not allowed at ${i}`),s=!0;break}o+=e[i++]}else o+=e[i++]+e[i++]}if(s)continue;if(t){a(`Unbalanced pattern at ${n}`);continue}if(!o){a(`Missing pattern at ${n}`);continue}r.push({type:"REGEX",index:n,value:o}),n=i;continue}r.push({type:"CHAR",index:n,value:e[n++]})}else r.push({type:"CLOSE",index:n,value:e[n++]});else r.push({type:"OPEN",index:n,value:e[n++]});else r.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else r.push({type:"OTHER_MODIFIER",index:n,value:e[n++]});else r.push({type:"ASTERISK",index:n,value:e[n++]})}return r.push({type:"END",index:n,value:""}),r}function m(e,t={}){let r=f(e);t.delimiter??="/#?",t.prefixes??="./";let n=`[^${b(t.delimiter)}]+?`,o=[],a=0,l=0,c=new Set,p=i(e=>{if(l<r.length&&r[l].type===e)return r[l++].value},"tryConsume"),h=i(()=>p("OTHER_MODIFIER")??p("ASTERISK"),"tryConsumeModifier"),d=i(e=>{let t=p(e);if(void 0!==t)return t;let{type:n,index:o}=r[l];throw new TypeError(`Unexpected ${n} at ${o}, expected ${e}`)},"mustConsume"),m=i(()=>{let e,t="";for(;e=p("CHAR")??p("ESCAPED_CHAR");)t+=e;return t},"consumeText"),g=i(e=>e,"DefaultEncodePart"),y=t.encodePart||g,w="",v=i(e=>{w+=e},"appendToPendingFixedValue"),T=i(()=>{w.length&&(o.push(new s(3,"","",y(w),"",3)),w="")},"maybeAddPartFromPendingFixedValue"),E=i((e,t,r,i,l)=>{let p,h=3;switch(l){case"?":h=1;break;case"*":h=0;break;case"+":h=2}if(!t&&!r&&3===h)return void v(e);if(T(),!t&&!r){if(!e)return;return void o.push(new s(3,"","",y(e),"",h))}p=r?"*"===r?u:r:n;let d,f=2;if(p===n?(f=1,p=""):p===u&&(f=0,p=""),t?d=t:r&&(d=a++),c.has(d))throw new TypeError(`Duplicate name '${d}'.`);c.add(d),o.push(new s(f,d,y(e),p,y(i),h))},"addPart");for(;l<r.length;){let e=p("CHAR"),r=p("NAME"),n=p("REGEX");if(!r&&!n&&(n=p("ASTERISK")),r||n){let o=e??"";-1===t.prefixes.indexOf(o)&&(v(o),o=""),T(),E(o,r,n,"",h());continue}let o=e??p("ESCAPED_CHAR");if(o)v(o);else{if(p("OPEN")){let e=m(),t=p("NAME"),r=p("REGEX");!t&&!r&&(r=p("ASTERISK"));let n=m();d("CLOSE"),E(e,t,r,n,h());continue}T(),d("END")}}return o}function b(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function g(e){return e&&e.ignoreCase?"ui":"u"}function y(e,t,r){return v(m(e,r),t,r)}function w(e){switch(e){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}function v(e,t,r={}){r.delimiter??="/#?",r.prefixes??="./",r.sensitive??=!1,r.strict??=!1,r.end??=!0,r.start??=!0,r.endsWith="";let n=r.start?"^":"";for(let o of e){if(3===o.type){3===o.modifier?n+=b(o.value):n+=`(?:${b(o.value)})${w(o.modifier)}`;continue}t&&t.push(o.name);let e=`[^${b(r.delimiter)}]+?`,i=o.value;(1===o.type?i=e:0===o.type&&(i=u),o.prefix.length||o.suffix.length)?3!==o.modifier&&1!==o.modifier?(n+=`(?:${b(o.prefix)}`,n+=`((?:${i})(?:`,n+=b(o.suffix),n+=b(o.prefix),n+=`(?:${i}))*)${b(o.suffix)})`,0===o.modifier&&(n+="?")):(n+=`(?:${b(o.prefix)}(${i})${b(o.suffix)})`,n+=w(o.modifier)):3===o.modifier||1===o.modifier?n+=`(${i})${w(o.modifier)}`:n+=`((?:${i})${w(o.modifier)})`}let o=`[${b(r.endsWith)}]|$`,i=`[${b(r.delimiter)}]`;if(r.end)return r.strict||(n+=`${i}?`),r.endsWith.length?n+=`(?=${o})`:n+="$",new RegExp(n,g(r));r.strict||(n+=`(?:${i}(?=${o}))?`);let a=!1;if(e.length){let t=e[e.length-1];3===t.type&&3===t.modifier&&(a=r.delimiter.indexOf(t)>-1)}return a||(n+=`(?=${i}|${o})`),new RegExp(n,g(r))}i(p,"isASCII"),i(f,"lexer"),i(m,"parse"),i(b,"escapeString"),i(g,"flags"),i(y,"stringToRegexp"),i(w,"modifierToString"),i(v,"partsToRegexp");var T={delimiter:"",prefixes:"",sensitive:!0,strict:!0},E={delimiter:".",prefixes:"",sensitive:!0,strict:!0},S={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function A(e,t){return!!e.length&&("/"===e[0]||!(!t||e.length<2)&&(("\\"==e[0]||"{"==e[0])&&"/"==e[1]))}function k(e,t){return e.startsWith(t)?e.substring(t.length,e.length):e}function x(e,t){return e.endsWith(t)?e.substr(0,e.length-t.length):e}function M(e){return!(!e||e.length<2)&&("["===e[0]||("\\"===e[0]||"{"===e[0])&&"["===e[1])}i(A,"isAbsolutePathname"),i(k,"maybeStripPrefix"),i(x,"maybeStripSuffix"),i(M,"treatAsIPv6Hostname");var L=["ftp","file","http","https","ws","wss"];function O(e){if(!e)return!0;for(let t of L)if(e.test(t))return!0;return!1}function P(e,t){if(e=k(e,"#"),t||""===e)return e;let r=new URL("https://example.com");return r.hash=e,r.hash?r.hash.substring(1,r.hash.length):""}function R(e,t){if(e=k(e,"?"),t||""===e)return e;let r=new URL("https://example.com");return r.search=e,r.search?r.search.substring(1,r.search.length):""}function F(e,t){return t||""===e?e:M(e)?B(e):q(e)}function C(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.password=e,r.password}function j(e,t){if(t||""===e)return e;let r=new URL("https://example.com");return r.username=e,r.username}function I(e,t,r){if(r||""===e)return e;if(t&&!L.includes(t))return new URL(`${t}:${e}`).pathname;let n="/"==e[0];return e=new URL(n?e:"/-"+e,"https://example.com").pathname,n||(e=e.substring(2,e.length)),e}function N(e,t,r){return D(t)===e&&(e=""),r||""===e?e:_(e)}function H(e,t){return e=x(e,":"),t||""===e?e:U(e)}function D(e){switch(e){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}function U(e){if(""===e)return e;if(/^[-+.A-Za-z0-9]*$/.test(e))return e.toLowerCase();throw new TypeError(`Invalid protocol '${e}'.`)}function z(e){if(""===e)return e;let t=new URL("https://example.com");return t.username=e,t.username}function $(e){if(""===e)return e;let t=new URL("https://example.com");return t.password=e,t.password}function q(e){if(""===e)return e;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(e))throw new TypeError(`Invalid hostname '${e}'`);let t=new URL("https://example.com");return t.hostname=e,t.hostname}function B(e){if(""===e)return e;if(/[^0-9a-fA-F[\]:]/g.test(e))throw new TypeError(`Invalid IPv6 hostname '${e}'`);return e.toLowerCase()}function _(e){if(""===e||/^[0-9]*$/.test(e)&&parseInt(e)<=65535)return e;throw new TypeError(`Invalid port '${e}'.`)}function V(e){if(""===e)return e;let t=new URL("https://example.com");return t.pathname="/"!==e[0]?"/-"+e:e,"/"!==e[0]?t.pathname.substring(2,t.pathname.length):t.pathname}function W(e){return""===e?e:new URL(`data:${e}`).pathname}function G(e){if(""===e)return e;let t=new URL("https://example.com");return t.search=e,t.search.substring(1,t.search.length)}function X(e){if(""===e)return e;let t=new URL("https://example.com");return t.hash=e,t.hash.substring(1,t.hash.length)}i(O,"isSpecialScheme"),i(P,"canonicalizeHash"),i(R,"canonicalizeSearch"),i(F,"canonicalizeHostname"),i(C,"canonicalizePassword"),i(j,"canonicalizeUsername"),i(I,"canonicalizePathname"),i(N,"canonicalizePort"),i(H,"canonicalizeProtocol"),i(D,"defaultPortForProtocol"),i(U,"protocolEncodeCallback"),i(z,"usernameEncodeCallback"),i($,"passwordEncodeCallback"),i(q,"hostnameEncodeCallback"),i(B,"ipv6HostnameEncodeCallback"),i(_,"portEncodeCallback"),i(V,"standardURLPathnameEncodeCallback"),i(W,"pathURLPathnameEncodeCallback"),i(G,"searchEncodeCallback"),i(X,"hashEncodeCallback");var K=class{#r;#n=[];#o={};#i=0;#a=1;#s=0;#l=0;#c=0;#u=0;#p=!1;constructor(e){this.#r=e}get result(){return this.#o}parse(){for(this.#n=f(this.#r,!0);this.#i<this.#n.length;this.#i+=this.#a){if(this.#a=1,"END"===this.#n[this.#i].type){if(0===this.#l){this.#h(),this.#d()?this.#f(9,1):this.#m()?this.#f(8,1):this.#f(7,0);continue}if(2===this.#l){this.#b(5);continue}this.#f(10,0);break}if(this.#c>0){if(!this.#g())continue;this.#c-=1}if(this.#y())this.#c+=1;else switch(this.#l){case 0:this.#w()&&this.#b(1);break;case 1:if(this.#w()){this.#v();let e=7,t=1;this.#T()?(e=2,t=3):this.#p&&(e=2),this.#f(e,t)}break;case 2:this.#E()?this.#b(3):(this.#S()||this.#m()||this.#d())&&this.#b(5);break;case 3:this.#A()?this.#f(4,1):this.#E()&&this.#f(5,1);break;case 4:this.#E()&&this.#f(5,1);break;case 5:this.#k()?this.#u+=1:this.#x()&&(this.#u-=1),this.#M()&&!this.#u?this.#f(6,1):this.#S()?this.#f(7,0):this.#m()?this.#f(8,1):this.#d()&&this.#f(9,1);break;case 6:this.#S()?this.#f(7,0):this.#m()?this.#f(8,1):this.#d()&&this.#f(9,1);break;case 7:this.#m()?this.#f(8,1):this.#d()&&this.#f(9,1);break;case 8:this.#d()&&this.#f(9,1)}}void 0!==this.#o.hostname&&void 0===this.#o.port&&(this.#o.port="")}#f(e,t){switch(this.#l){case 0:case 2:break;case 1:this.#o.protocol=this.#L();break;case 3:this.#o.username=this.#L();break;case 4:this.#o.password=this.#L();break;case 5:this.#o.hostname=this.#L();break;case 6:this.#o.port=this.#L();break;case 7:this.#o.pathname=this.#L();break;case 8:this.#o.search=this.#L();break;case 9:this.#o.hash=this.#L()}0!==this.#l&&10!==e&&([1,2,3,4].includes(this.#l)&&[6,7,8,9].includes(e)&&(this.#o.hostname??=""),[1,2,3,4,5,6].includes(this.#l)&&[8,9].includes(e)&&(this.#o.pathname??=this.#p?"/":""),[1,2,3,4,5,6,7].includes(this.#l)&&9===e&&(this.#o.search??="")),this.#O(e,t)}#O(e,t){this.#l=e,this.#s=this.#i+t,this.#i+=t,this.#a=0}#h(){this.#i=this.#s,this.#a=0}#b(e){this.#h(),this.#l=e}#P(e){return e<0&&(e=this.#n.length-e),e<this.#n.length?this.#n[e]:this.#n[this.#n.length-1]}#R(e,t){let r=this.#P(e);return r.value===t&&("CHAR"===r.type||"ESCAPED_CHAR"===r.type||"INVALID_CHAR"===r.type)}#w(){return this.#R(this.#i,":")}#T(){return this.#R(this.#i+1,"/")&&this.#R(this.#i+2,"/")}#E(){return this.#R(this.#i,"@")}#A(){return this.#R(this.#i,":")}#M(){return this.#R(this.#i,":")}#S(){return this.#R(this.#i,"/")}#m(){if(this.#R(this.#i,"?"))return!0;if("?"!==this.#n[this.#i].value)return!1;let e=this.#P(this.#i-1);return"NAME"!==e.type&&"REGEX"!==e.type&&"CLOSE"!==e.type&&"ASTERISK"!==e.type}#d(){return this.#R(this.#i,"#")}#y(){return"OPEN"==this.#n[this.#i].type}#g(){return"CLOSE"==this.#n[this.#i].type}#k(){return this.#R(this.#i,"[")}#x(){return this.#R(this.#i,"]")}#L(){let e=this.#n[this.#i],t=this.#P(this.#s).index;return this.#r.substring(t,e.index)}#v(){let e={};Object.assign(e,T),e.encodePart=U;let t=y(this.#L(),void 0,e);this.#p=O(t)}};i(K,"Parser");var Q=["protocol","username","password","hostname","port","pathname","search","hash"],J="*";function Y(e,t){if("string"!=typeof e)throw new TypeError("parameter 1 is not of type 'string'.");let r=new URL(e,t);return{protocol:r.protocol.substring(0,r.protocol.length-1),username:r.username,password:r.password,hostname:r.hostname,port:r.port,pathname:r.pathname,search:""!==r.search?r.search.substring(1,r.search.length):void 0,hash:""!==r.hash?r.hash.substring(1,r.hash.length):void 0}}function Z(e,t){return t?te(e):e}function ee(e,t,r){let n;if("string"==typeof t.baseURL)try{n=new URL(t.baseURL),void 0===t.protocol&&(e.protocol=Z(n.protocol.substring(0,n.protocol.length-1),r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&(e.username=Z(n.username,r)),!r&&void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.username&&void 0===t.password&&(e.password=Z(n.password,r)),void 0===t.protocol&&void 0===t.hostname&&(e.hostname=Z(n.hostname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&(e.port=Z(n.port,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&(e.pathname=Z(n.pathname,r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&(e.search=Z(n.search.substring(1,n.search.length),r)),void 0===t.protocol&&void 0===t.hostname&&void 0===t.port&&void 0===t.pathname&&void 0===t.search&&void 0===t.hash&&(e.hash=Z(n.hash.substring(1,n.hash.length),r))}catch{throw new TypeError(`invalid baseURL '${t.baseURL}'.`)}if("string"==typeof t.protocol&&(e.protocol=H(t.protocol,r)),"string"==typeof t.username&&(e.username=j(t.username,r)),"string"==typeof t.password&&(e.password=C(t.password,r)),"string"==typeof t.hostname&&(e.hostname=F(t.hostname,r)),"string"==typeof t.port&&(e.port=N(t.port,e.protocol,r)),"string"==typeof t.pathname){if(e.pathname=t.pathname,n&&!A(e.pathname,r)){let t=n.pathname.lastIndexOf("/");t>=0&&(e.pathname=Z(n.pathname.substring(0,t+1),r)+e.pathname)}e.pathname=I(e.pathname,e.protocol,r)}return"string"==typeof t.search&&(e.search=R(t.search,r)),"string"==typeof t.hash&&(e.hash=P(t.hash,r)),e}function te(e){return e.replace(/([+*?:{}()\\])/g,"\\$1")}function re(e){return e.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}function ne(e,t){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=`[^${re(t.delimiter)}]+?`,n=/[$_\u200C\u200D\p{ID_Continue}]/u,o="";for(let i=0;i<e.length;++i){let a=e[i];if(3===a.type){if(3===a.modifier){o+=te(a.value);continue}o+=`{${te(a.value)}}${w(a.modifier)}`;continue}let s=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(1!==a.prefix.length||!t.prefixes.includes(a.prefix)),c=i>0?e[i-1]:null,u=i<e.length-1?e[i+1]:null;if(!l&&s&&1===a.type&&3===a.modifier&&u&&!u.prefix.length&&!u.suffix.length)if(3===u.type){let e=u.value.length>0?u.value[0]:"";l=n.test(e)}else l=!u.hasCustomName();if(!l&&!a.prefix.length&&c&&3===c.type){let e=c.value[c.value.length-1];l=t.prefixes.includes(e)}l&&(o+="{"),o+=te(a.prefix),s&&(o+=`:${a.name}`),2===a.type?o+=`(${a.value})`:1===a.type?s||(o+=`(${r})`):0===a.type&&(s||c&&3!==c.type&&3===c.modifier&&!l&&""===a.prefix?o+="(.*)":o+="*"),1===a.type&&s&&a.suffix.length&&n.test(a.suffix[0])&&(o+="\\"),o+=te(a.suffix),l&&(o+="}"),3!==a.modifier&&(o+=w(a.modifier))}return o}i(Y,"extractValues"),i(Z,"processBaseURLString"),i(ee,"applyInit"),i(te,"escapePatternString"),i(re,"escapeRegexpString"),i(ne,"partsToPattern");var oe=class{#r;#n={};#o={};#i={};#a={};#s=!1;constructor(e={},t,r){try{let n;if("string"==typeof t?n=t:r=t,"string"==typeof e){let t=new K(e);if(t.parse(),e=t.result,void 0===n&&"string"!=typeof e.protocol)throw new TypeError("A base URL must be provided for a relative constructor string.");e.baseURL=n}else{if(!e||"object"!=typeof e)throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(n)throw new TypeError("parameter 1 is not of type 'string'.")}typeof r>"u"&&(r={ignoreCase:!1});let o,i={ignoreCase:!0===r.ignoreCase},a={pathname:J,protocol:J,username:J,password:J,hostname:J,port:J,search:J,hash:J};for(o of(this.#r=ee(a,e,!0),D(this.#r.protocol)===this.#r.port&&(this.#r.port=""),Q)){if(!(o in this.#r))continue;let e={},t=this.#r[o];switch(this.#o[o]=[],o){case"protocol":Object.assign(e,T),e.encodePart=U;break;case"username":Object.assign(e,T),e.encodePart=z;break;case"password":Object.assign(e,T),e.encodePart=$;break;case"hostname":Object.assign(e,E),M(t)?e.encodePart=B:e.encodePart=q;break;case"port":Object.assign(e,T),e.encodePart=_;break;case"pathname":O(this.#n.protocol)?(Object.assign(e,S,i),e.encodePart=V):(Object.assign(e,T,i),e.encodePart=W);break;case"search":Object.assign(e,T,i),e.encodePart=G;break;case"hash":Object.assign(e,T,i),e.encodePart=X}try{this.#a[o]=m(t,e),this.#n[o]=v(this.#a[o],this.#o[o],e),this.#i[o]=ne(this.#a[o],e),this.#s=this.#s||this.#a[o].some(e=>2===e.type)}catch{throw new TypeError(`invalid ${o} pattern '${this.#r[o]}'.`)}}}catch(e){throw new TypeError(`Failed to construct 'URLPattern': ${e.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(e={},t){let r,n={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return!1;try{n=ee(n,"object"==typeof e?e:Y(e,t),!1)}catch{return!1}for(r of Q)if(!this.#n[r].exec(n[r]))return!1;return!0}exec(e={},t){let r={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if("string"!=typeof e&&t)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof e>"u")return;try{r=ee(r,"object"==typeof e?e:Y(e,t),!1)}catch{return null}let n,o={};for(n of(o.inputs=t?[e,t]:[e],Q)){let e=this.#n[n].exec(r[n]);if(!e)return null;let t={};for(let[r,o]of this.#o[n].entries())if("string"==typeof o||"number"==typeof o){let n=e[r+1];t[o]=n}o[n]={input:r[n]??"",groups:t}}return o}static compareComponent(e,t,r){let n=i((e,t)=>{for(let r of["type","modifier","prefix","value","suffix"]){if(e[r]<t[r])return-1;if(e[r]!==t[r])return 1}return 0},"comparePart"),o=new s(3,"","","","",3),a=new s(0,"","","","",3),l=i((e,t)=>{let r=0;for(;r<Math.min(e.length,t.length);++r){let o=n(e[r],t[r]);if(o)return o}return e.length===t.length?0:n(e[r]??o,t[r]??o)},"comparePartList");return t.#i[e]||r.#i[e]?t.#i[e]&&!r.#i[e]?l(t.#a[e],[a]):!t.#i[e]&&r.#i[e]?l([a],r.#a[e]):l(t.#a[e],r.#a[e]):0}get protocol(){return this.#i.protocol}get username(){return this.#i.username}get password(){return this.#i.password}get hostname(){return this.#i.hostname}get port(){return this.#i.port}get pathname(){return this.#i.pathname}get search(){return this.#i.search}get hash(){return this.#i.hash}get hasRegExpGroups(){return this.#s}};return i(oe,"URLPattern"),h}var w=p(g?b:(g=1,b=function(){if(m)return f;m=1;const{URLPattern:e}=y();return f={URLPattern:e},globalThis.URLPattern||(globalThis.URLPattern=e),f}()));"URLPattern"in globalThis||(globalThis.URLPattern=w),l(URL,"parse",(e,t)=>{try{return new URL(e,t)}catch{return null}}),l(URL,"canParse",(e,t)=>{try{return new URL(e,t)instanceof URL}catch{return!1}}),Number.range instanceof Function||(Number.range=function(e,t,r=1){return console.warn("`Number.range()` is deprecated. Use `Iterator.range()` instead."),globalThis.Iterator.range(e,t,{step:r})});const v="Iterator"in globalThis,T=v?globalThis.Iterator.prototype:Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())),E=v?globalThis.Iterator:(e=>{class t{[Symbol.iterator](){return this}get[Symbol.toStringTag](){return"Iterator"}}return Object.setPrototypeOf(t,e),t})(T);var S;E.range instanceof Function||(E.range=function(e,t,r){if("number"==typeof r||"bigint"==typeof r)return E.range(e,t,{step:r});if("object"!=typeof r||Object.is(r,null))return E.range(e,t,{});{const{step:n=("number"==typeof e?e<t?1:-1:e<t?1n:-1n),inclusive:o=!1}=r;if("number"!=typeof e&&"bigint"!=typeof e)throw new TypeError("Start must be a number");if(Number.isNaN(e))throw new RangeError("Invalid start");if("number"!=typeof t&&"bigint"!=typeof t)throw new TypeError("End must be a number");if(Number.isNaN(t))throw new RangeError("Invalid end");if("number"!=typeof n&&"bigint"!=typeof n)throw new TypeError("Step must be a number");if(Number.isNaN(n))throw new RangeError("Invalid step");if(0===n)throw new RangeError("Step must not be 0");if(n<0&&e<t||n>0&&e>t)return;if(o){let r=e;return n>0?E.from({next(){const e=r<=t?{value:r,done:!1}:{done:!0};return r+=n,e}}):E.from({next(){const e=r>=t?{value:r,done:!1}:{done:!0};return r+=n,e}})}{let r=e;if(n>0)return E.from({next(){const e=r<t?{value:r,done:!1}:{done:!0};return r+=n,e}});{let r=e;return E.from({next(){const e=r>t?{value:r,done:!1}:{done:!0};return r+=n,e}})}}}}),T[Symbol.toStringTag]||(T[Symbol.toStringTag]="Iterator"),T.take instanceof Function||(T.take=function(e){let t=0;const r=this;return E.from({next:()=>t++>=e?{done:!0}:r.next()})}),T.drop instanceof Function||(T.drop=function(e){for(let t=0;t<e;t++){const{done:e}=this.next();if(e)break}return this}),T.toArray instanceof Function||(T.toArray=function(){return Array.from(this)}),T.forEach instanceof Function||(T.forEach=function(e){for(const t of this)e.call(this,t)}),T.flatMap instanceof Function||(T.flatMap=function(e){const t=this;let r=this.next();const n=({value:r,done:n=!0}={})=>n?E.from({next:()=>({done:!0})}):E.from(e.call(t,r));let o=n(r);return E.from({next(){const{value:e,done:i=!0}=o.next();return r.done&&i?{done:!0}:i?r.done?{done:!0}:(r=t.next(),o=n(r),o.next()):{value:e,done:i}}})}),T.map instanceof Function||(T.map=function(e){const t=this;return E.from({next(){const{done:r,value:n}=t.next();return r?{done:r}:{value:e.call(t,n),done:!1}}})}),T.reduce instanceof Function||(T.reduce=function(e,t){let r=void 0===t?this.next().value:t;for(const t of this)r=e.call(this,r,t);return r}),T.filter instanceof Function||(T.filter=function(e){const t=this;let r,n=!1;return E.from({next(){for(;!n;){const o=t.next();if(n=o.done,n)break;if(e.call(t,o.value)){r=o.value;break}}return{done:n,value:r}}})}),T.some instanceof Function||(T.some=function(e){let t=!1;for(const r of this)if(e.call(this,r)){t=!0;break}return t}),T.every instanceof Function||(T.every=function(e){let t=!0;for(const r of this)if(!e.call(this,r)){t=!1;break}return t}),T.find instanceof Function||(T.find=function(e){for(const t of this)if(e.call(this,t))return t}),T.indexed instanceof Function||(T.indexed=function(){let e=0;return this.map(t=>[e++,t])}),T.chunks instanceof Function||(T.chunks=function(e){if(!Number.isSafeInteger(e)||e<1)throw new TypeError("Size must be a positive integer.");{const t=this;let r=!1;return E.from({next(){if(r)return{done:r};{const n=[];let o=0;for(;o++<e&&!r;){const e=t.next();if(e.done){r=!0,void 0!==e.value&&n.push(e.value);break}n.push(e.value)}return{value:n,done:!1}}}})}}),E.from instanceof Function||(E.from=function(e){if("object"!=typeof e||null===e)throw new TypeError("Not an object.");if(e.next instanceof Function){return Object.create(T,{next:{enumerable:!0,configurable:!1,writable:!1,value:(...t)=>e.next(...t)}})}if(e[Symbol.iterator]instanceof Function)return E.from(e[Symbol.iterator]())}),v||(globalThis.Iterator=E),l(ReadableStream,"from",function(e){if(e[Symbol.iterator]instanceof Function)return new ReadableStream({start(t){try{for(const r of e)t.enqueue(r)}catch(e){t.error(e)}finally{t.close()}}});if(e[Symbol.asyncIterator]instanceof Function)return new ReadableStream({async start(t){try{for await(const r of e)t.enqueue(r)}catch(e){t.error(e)}finally{t.close()}}});throw new TypeError("`ReadableStream.from()` requires an iterable source.")}),Number.hasOwnProperty("isSafeInteger")||(Number.MAX_SAFE_INTEGER=2**53-1,Number.MIN_SAFE_INTEGER=-Number.MAX_SAFE_INTEGER,Number.isSafeInteger=e=>e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER),Number.hasOwnProperty("EPSILON")||(Number.EPSILON=2**-52),Math.hasOwnProperty("sign")||(Math.sign=e=>(e>0)-(e<0)||+e),Math.hasOwnProperty("trunc")||(Math.trunc=e=>{const t=e-e%1;return 0===t&&(e<0||0===e&&1/e!=1/0)?-0:t}),Math.hasOwnProperty("expm1")||(Math.expm1=e=>Math.exp(e)-1),Math.hasOwnProperty("hypot")||(Math.hypot=(...e)=>Math.sqrt(e.reduce((e,t)=>e+t**2,0))),Math.hasOwnProperty("cbrt")||(Math.cbrt=e=>e**(1/3)),Math.hasOwnProperty("log10")||(Math.log10=e=>Math.log(e)*Math.LOG10E),Math.hasOwnProperty("log2")||(Math.log2=e=>Math.log(e)*Math.LOG2E),Math.hasOwnProperty("log1p")||(Math.log1p=e=>Math.log(1+e)),Math.hasOwnProperty("fround")||(Math.fround=(S=new Float32Array(1),function(e){return S[0]=e,S[0]})),Math.clamp instanceof Function||(Math.clamp=function(e,t,r){return Math.min(Math.max(e,t),r)}),Math.constrain instanceof Function||(Math.constrain=Math.clamp),Math.sumPrecise instanceof Function||(Math.sumPrecise=function(e){let t=-0;for(const r of e){if(!Number.isFinite(r)){t=-0;break}t+=r}return t}),Math.sum instanceof Function||(Math.sum=function(...e){return console.warn("Math.sum is deprecated. Please use Math.sumPrecise instead."),Math.sumPrecise(e)}),function(){if(!("isSecureContext"in globalThis)){const e=["localhost","127.0.0.1"],t="https:",r=[t,"file:","wss:"],n=(e=globalThis.document)=>[...e.scripts].every(({src:r})=>{if(0===r.length)return!0;{const{protocol:n,hostname:o}=new URL(r,e.baseURI);return n===t||o===location.hostname}});Object.defineProperty(globalThis,"isSecureContext",{enumerable:!0,configurable:!0,get:function(){return window.parent===window&&(!(!r.includes(location.protocol)&&!e.includes(location.hostname))&&n())}})}}();function A(e){return function(e){return e instanceof Function&&"AsyncFunction"===e.constructor.name}(e)||e instanceof Promise}
|
|
2
2
|
/**
|
|
3
3
|
* @copyright 2023 Chris Zuber <admin@kernvalley.us>
|
|
4
4
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Lock
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
* cookie properties, such as expires, etc.
|
|
21
21
|
*
|
|
22
22
|
* @TODO verify spec compliance as best as is possible
|
|
23
|
-
*/;const G="cookieStore"in globalThis,X={constructor:Symbol("constructor")};function K(){return 0===document.cookie.length?[]:document.cookie.split(";").map(e=>{const[t,r=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof r?decodeURIComponent(r.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}})}function Q({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?K().filter(r=>r.name===e&&r.value===t):"string"==typeof e?K().filter(t=>t.name===e):"string"==typeof t?K().filter(e=>e.value===t):K()}function J({name:e,value:t,expires:r=null,maxAge:n=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(n))J({name:e,value:t,expires:Date.now()+n,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let n=`${encodeURIComponent(e)}=`;t&&(n+=encodeURIComponent(t)),Number.isInteger(r)?n+=`;expires=${new Date(r).toUTCString()}`:r instanceof Date&&(n+=`;expires=${r.toUTCString()}`),"string"==typeof o&&(n+=`;path=${o}`),"string"==typeof a&&(n+=`;domain=${a}`),"string"==typeof i&&(n+=`;sameSite=${i}`),!0===s&&(n+=";secure"),!0===l&&(n+=";partitioned"),document.cookie=n}}class Y extends EventTarget{constructor(e){if(e!==X.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,X.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[X.onchange]}set onchange(e){this[X.onchange]instanceof Function&&this.removeEventListener("change",this[X.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return Q("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:r=null,path:n="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:r,path:n,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);J(t);const r=new Event("change");r.changed=[t],r.deleted=[],this.dispatchEvent(r)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const r=new Event("change");r.changed=[],r.deleted=new Array(t.length),t.forEach((t,n)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",r.deleted[n]=t,J({...t,value:null,expires:1})}),this.dispatchEvent(r)}}}}}const Z=new Y(X.constructor);if(!G&&(globalThis.cookieStore=Z),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",()=>e(this),{once:!0}),this.addEventListener("error",e=>t(e),{once:!0}))})}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise((e,t)=>{this.pending?(this.addEventListener("ready",()=>e(this),{once:!0}),this.addEventListener("error",e=>t(e),{once:!0})):e(this)})}}),"HTMLElement"in globalThis&&!("trustedTypes"in globalThis)){const st={key:Symbol("trust:key")},lt=new Set(Object.keys(HTMLElement.prototype).filter(e=>e.startsWith("on"))),ct=()=>{const e=document.head.querySelector('meta[http-equiv="Content-Security-Policy"][content]');if(e instanceof HTMLMetaElement){const t=e.content.trim().split(";").filter(e=>0!==e.length).map(e=>e.trim()),r=Object.fromEntries(t.map(e=>{const[t,...r]=e.trim().split(" ").filter(e=>0!==e.length);return[t,r]})),n=Array.isArray(r["require-trusted-types-for"])&&r["require-trusted-types-for"].includes("'script'"),o=n&&Array.isArray(r["trusted-types"])?new Set(r["trusted-types"]):new Set,i=o.has("'allow-duplicates'");return o.has("'none'")?o.clear():i&&o.delete("'allow-duplicates'"),{enforced:n,allowedPolicies:o,allowDuplicates:i}}if(document.documentElement.dataset.hasOwnProperty("trustedPolicies")){const e=new Set(document.documentElement.dataset.trustedPolicies.split(" ")),t=e.has("'allow-duplicates'"),r=e.has("'none'");return t&&e.delete("'allow-duplicates'"),r&&e.clear(),{enforced:!0,allowedPolicies:e,allowDuplicates:t}}return{enforced:!1,allowedPolicies:new Set,allowDuplicates:!0}};class ut{#F;#C;#j;#I;constructor({enforced:e,allowedPolicies:t,allowDuplicates:r}={},n){if(n!==st.key)throw new TypeError("Invalid constructor of TrustedTypePolicyFactory.");if(!(t instanceof Set))throw new TypeError("`allowedPolicies` must be a Set.");this.#C=t,this.#j=e,this.#I=r,this.#F=new Map}get defaultPolicy(){return this.#F.has("default")?this.#F.get("default"):null}createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}){if(/^[-#a-zA-Z0-9=_/@.%]+$/.test(e.toString())){if(this.#j&&!this.#C.has(e))throw new TypeError(`${e} is not an allowed policy.`);if(!this.#I&&this.#F.has(e))throw new TypeError(`${e} has already been created and duplicates are not allowed.`);{const o=new pt(e.toString(),{createHTML:t,createScript:r,createScriptURL:n},st.key);return this.#F.set(o.name,o),o}}throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" contains invalid characters.`)}getAttributeType(e,t,r){if(e=e.toLowerCase(),t=t.toLowerCase(),"string"==typeof elementNS&&0!==r.length)return lt.has(t)?"TrustedScript":null;if(lt.has(t))return"TrustedScript";switch(e){case"script":return"src"===t?"TrustedScriptURL":null;case"iframe":return"srcdoc"===t?"TrustedHTML":"src"===t?"TrustedScriptURL":null;default:return null}}getPropertyType(e,t){if(e=e.toLowerCase(),lt.has(t.toLowerCase()))return"TrustedScript";switch(e){case"embed":case"iframe":return"src"===t?"TrustedScriptURL":null;case"script":return"src"===t?"TrustedScriptURL":["text","innerText","textContent","innerHTML"].includes(t)?"TrustedScript":["outerHTML"].includes(t)?"TrustedHTML":null;default:return["innerHTML","outerHTML"].includes(t)?"TrustedHTML":null}}isHTML(e){return e instanceof globalThis.TrustedHTML}isScript(e){return e instanceof globalThis.TrustedScript}isScriptURL(e){return e instanceof globalThis.TrustedScriptURL}get emptyHTML(){return new
|
|
23
|
+
*/;const G="cookieStore"in globalThis,X={constructor:Symbol("constructor")};function K(){return 0===document.cookie.length?[]:document.cookie.split(";").map(e=>{const[t,r=null]=e.split("=");return{name:decodeURIComponent(t.trim()),value:"string"==typeof r?decodeURIComponent(r.trim()):null,path:void 0,expires:void 0,domain:void 0,sameSite:void 0,secure:void 0,partitioned:!1}})}function Q({name:e=null,value:t=null}={}){return"string"==typeof e&&(e=decodeURIComponent(e)),"string"==typeof t&&(t=decodeURIComponent(t)),"string"==typeof e&&"string"==typeof t?K().filter(r=>r.name===e&&r.value===t):"string"==typeof e?K().filter(t=>t.name===e):"string"==typeof t?K().filter(e=>e.value===t):K()}function J({name:e,value:t,expires:r=null,maxAge:n=null,path:o="/",sameSite:i="lax",domain:a=null,secure:s=!1,partitioned:l=!1}){if(Number.isInteger(n))J({name:e,value:t,expires:Date.now()+n,path:o,sameSite:i,domain:a,secure:s,partitioned:l});else{let n=`${encodeURIComponent(e)}=`;t&&(n+=encodeURIComponent(t)),Number.isInteger(r)?n+=`;expires=${new Date(r).toUTCString()}`:r instanceof Date&&(n+=`;expires=${r.toUTCString()}`),"string"==typeof o&&(n+=`;path=${o}`),"string"==typeof a&&(n+=`;domain=${a}`),"string"==typeof i&&(n+=`;sameSite=${i}`),!0===s&&(n+=";secure"),!0===l&&(n+=";partitioned"),document.cookie=n}}class Y extends EventTarget{constructor(e){if(e!==X.constructor)throw new DOMException("Invalid constructor");super(),Object.defineProperty(this,X.onchange,{enumerable:!1,configurable:!1,writable:!0,value:null})}get onchange(){return this[X.onchange]}set onchange(e){this[X.onchange]instanceof Function&&this.removeEventListener("change",this[X.onchange]),e instanceof Function&&this.addEventListener("change",e)}async get(e){const t=await this.getAll(e);return Array.isArray(t)&&0!==t.length?t[0]:null}async getAll(e){return Q("string"==typeof e?{name:e}:e)}async set(...e){if(1===e.length&&"object"==typeof e[0]&&"string"==typeof e[0].name){const t=function({name:e,value:t=null,domain:r=null,path:n="/",expires:o=null,maxAge:i=null,sameSite:a="lax",secure:s=!1,partitioned:l=!1}){return{name:e,value:t,domain:r,path:n,expires:o,maxAge:i,sameSite:a,secure:s,partitioned:l}}(e[0]);J(t);const r=new Event("change");r.changed=[t],r.deleted=[],this.dispatchEvent(r)}else{if(2!==e.length)throw new Error("Invalid arguments");this.set({name:e[0],value:e[1]})}}async delete(e={}){if("string"==typeof e)this.delete({name:e});else{if("object"!=typeof e||"string"!=typeof e.name)throw new TypeError("Failed to execute 'delete' on 'CookieStore': required member name is undefined.");{const t=await this.getAll(e);if(0!==t.length){const r=new Event("change");r.changed=[],r.deleted=new Array(t.length),t.forEach((t,n)=>{t.path=e.path||"/",t.domain=e.domain||null,t.secure=e.secure||null,delete t.value,t.sameSite=e.sameSite||"lax",r.deleted[n]=t,J({...t,value:null,expires:1})}),this.dispatchEvent(r)}}}}}const Z=new Y(X.constructor);if(!G&&(globalThis.cookieStore=Z),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("finished")&&Object.defineProperty(Animation.prototype,"finished",{get:function(){return new Promise((e,t)=>{"finished"===this.playState?e(this):(this.addEventListener("finish",()=>e(this),{once:!0}),this.addEventListener("error",e=>t(e),{once:!0}))})}}),globalThis.hasOwnProperty("Animation")&&!Animation.prototype.hasOwnProperty("ready")&&Object.defineProperty(Animation.prototype,"ready",{get:function(){return new Promise((e,t)=>{this.pending?(this.addEventListener("ready",()=>e(this),{once:!0}),this.addEventListener("error",e=>t(e),{once:!0})):e(this)})}}),"HTMLElement"in globalThis&&!("trustedTypes"in globalThis)){const st={key:Symbol("trust:key")},lt=new Set(Object.keys(HTMLElement.prototype).filter(e=>e.startsWith("on"))),ct=()=>{const e=document.head.querySelector('meta[http-equiv="Content-Security-Policy"][content]');if(e instanceof HTMLMetaElement){const t=e.content.trim().split(";").filter(e=>0!==e.length).map(e=>e.trim()),r=Object.fromEntries(t.map(e=>{const[t,...r]=e.trim().split(" ").filter(e=>0!==e.length);return[t,r]})),n=Array.isArray(r["require-trusted-types-for"])&&r["require-trusted-types-for"].includes("'script'"),o=n&&Array.isArray(r["trusted-types"])?new Set(r["trusted-types"]):new Set,i=o.has("'allow-duplicates'");return o.has("'none'")?o.clear():i&&o.delete("'allow-duplicates'"),{enforced:n,allowedPolicies:o,allowDuplicates:i}}if(document.documentElement.dataset.hasOwnProperty("trustedPolicies")){const e=new Set(document.documentElement.dataset.trustedPolicies.split(" ")),t=e.has("'allow-duplicates'"),r=e.has("'none'");return t&&e.delete("'allow-duplicates'"),r&&e.clear(),{enforced:!0,allowedPolicies:e,allowDuplicates:t}}return{enforced:!1,allowedPolicies:new Set,allowDuplicates:!0}};class ut{#F;#C;#j;#I;constructor({enforced:e,allowedPolicies:t,allowDuplicates:r}={},n){if(n!==st.key)throw new TypeError("Invalid constructor of TrustedTypePolicyFactory.");if(!(t instanceof Set))throw new TypeError("`allowedPolicies` must be a Set.");this.#C=t,this.#j=e,this.#I=r,this.#F=new Map}get defaultPolicy(){return this.#F.has("default")?this.#F.get("default"):null}createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}){if(/^[-#a-zA-Z0-9=_/@.%]+$/.test(e.toString())){if(this.#j&&!this.#C.has(e))throw new TypeError(`${e} is not an allowed policy.`);if(!this.#I&&this.#F.has(e))throw new TypeError(`${e} has already been created and duplicates are not allowed.`);{const o=new pt(e.toString(),{createHTML:t,createScript:r,createScriptURL:n},st.key);return this.#F.set(o.name,o),o}}throw new TypeError(`Failed to execute 'createPolicy' on 'TrustedTypePolicyFactory': Policy: "${e}" contains invalid characters.`)}getAttributeType(e,t,r){if(e=e.toLowerCase(),t=t.toLowerCase(),"string"==typeof elementNS&&0!==r.length)return lt.has(t)?"TrustedScript":null;if(lt.has(t))return"TrustedScript";switch(e){case"script":return"src"===t?"TrustedScriptURL":null;case"iframe":return"srcdoc"===t?"TrustedHTML":"src"===t?"TrustedScriptURL":null;default:return null}}getPropertyType(e,t){if(e=e.toLowerCase(),lt.has(t.toLowerCase()))return"TrustedScript";switch(e){case"embed":case"iframe":return"src"===t?"TrustedScriptURL":null;case"script":return"src"===t?"TrustedScriptURL":["text","innerText","textContent","innerHTML"].includes(t)?"TrustedScript":["outerHTML"].includes(t)?"TrustedHTML":null;default:return["innerHTML","outerHTML"].includes(t)?"TrustedHTML":null}}isHTML(e){return e instanceof globalThis.TrustedHTML}isScript(e){return e instanceof globalThis.TrustedScript}isScriptURL(e){return e instanceof globalThis.TrustedScriptURL}get emptyHTML(){return new dt("",st.key)}get emptyScript(){return new ft("",st.key)}get[Symbol.for("polyfilled")](){return!0}get[Symbol.for("enforced")](){return this.#j}}class pt{#N;#H;#D;#U;constructor(e,{createHTML:t,createScript:r,createScriptURL:n},o){if(o!==st.key)throw new Error(`Invalid construction of ${e} policy.`);this.#N=e,this.#H=t,this.#D=r,this.#U=n}get name(){return this.#N}createHTML(e,...t){if(this.#H instanceof Function)return new dt(this.#H(e.toString(),...t).toString(),st.key);throw new TypeError("This policy does not provide `createHTML()`")}createScript(e,...t){if(this.#D instanceof Function)return new ft(this.#D(e.toString(),...t).toString(),st.key);throw new TypeError("This policy does not provide `createScript()`")}createScriptURL(e,...t){if(this.#U instanceof Function)return new mt(this.#U(e.toString(),...t).toString(),st.key);throw new TypeError("This policy does not provide `createScriptURL()`")}}class ht{#z;constructor(e,t){if(t!==st.key)throw new Error("Invalid constructor of TrustedType.");this.#z=e}toString(){return this.#z}toJSON(){return this.#z}}class dt extends ht{}class ft extends ht{}class mt extends ht{}globalThis.TrustedTypePolicyFactory=ut,globalThis.trustedTypes=new ut(ct(),st.key),globalThis.TrustedHTML=dt,globalThis.TrustedScript=ft,globalThis.TrustedScriptURL=mt}
|
|
24
24
|
/**
|
|
25
25
|
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
|
|
26
26
|
*/("HTMLElement"in globalThis&&!("trustedTypes"in globalThis)||"HTMLElement"in globalThis&&globalThis.trustedTypes[Symbol.for("polyfilled")]&&globalThis.trustedTypes[Symbol.for("enforced")])&&function(){function e(){return"trustedTypes"in globalThis}function t(){return e()&&!Object.is(trustedTypes.defaultPolicy,null)}function r(r){if(function(t){return e()&&trustedTypes.isHTML(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createHTML(r);throw new TypeError("Attempting to set HTML and no default policy is available.")}function n(r){if(function(t){return e()&&trustedTypes.isScript(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScript(r);throw new TypeError("Attempting to create script and no default policy is available.")}function o(r){if(function(t){return e()&&trustedTypes.isScriptURL(t)}(r)||!e())return r;if(t())return trustedTypes.defaultPolicy.createScriptURL(r);throw new TypeError("Attempting to create script URL and no default policy is available.")}function i(t,r,n){return e()?trustedTypes.getAttributeType(t,r,n):null}try{const{write:e,writeln:t,execCommand:n}=Object.getOwnPropertyDescriptors(Document.prototype);Object.defineProperties(Document.prototype,{write:{value:function(t){e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable},writeln:{value:function(e){t.value.call(this,r(e))},enumerable:t.enumerable,configurable:t.configurable,writable:t.writable},execCommand:{value:function(e,t,o){return["insertHTML"].includes(e)?n.value.call(this,e,t,r(o)):n.value.call(this,e,t,o)},enumerable:n.enumerable,configurable:n.configurable}})}catch(e){console.error(e)}if("ServiceWorkerContainer"in globalThis)try{const e=Object.getOwnPropertyDescriptor(ServiceWorkerContainer.prototype,"register");Object.defineProperty(ServiceWorkerContainer.prototype,"register",{value:function(t,r){return e.value.call(this,o(t),r)},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const e=Object.getOwnPropertyDescriptor(Range.prototype,"createContextualFragment");Object.defineProperty(Range.prototype,"createContextualFragment",{value:function(t){return e.value.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable})}catch(e){console.error(e)}try{const{parseFromString:e}=Object.getOwnPropertyDescriptors(DOMParser.prototype);Object.defineProperties(DOMParser.prototype,{parseFromString:{value:function(t,n){return"text/html"===n?e.value.call(this,r(t),n):e.value.call(this,t,n)},enumerable:e.enumerable,configurable:e.configurable,writable:e.writable}})}catch(e){console.error(e)}try{const{src:e,text:t}=Object.getOwnPropertyDescriptors(HTMLScriptElement.prototype);Object.defineProperties(HTMLScriptElement.prototype,{text:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,n(e))},enumerable:t.enumerable,configurable:t.configurable},src:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable}})}catch(e){console.error(e)}try{const{setAttribute:e,setAttributeNS:t,innerHTML:a,outerHTML:s,insertAdjacentHTML:l}=Object.getOwnPropertyDescriptors(Element.prototype);Object.defineProperties(Element.prototype,{setAttribute:{value:function(t,a){switch(i(this.tagName,t)){case"TrustedHTML":e.value.call(this,t,r(a));break;case"TrustedScript":e.value.call(this,t,n(a));break;case"TrustedScriptURL":e.value.call(this,t,o(a));break;default:e.value.call(this,t,a)}},enumerable:e.enumerable,configurable:e.configurable},setAttributeNS:{value:function(e,a,s){switch(i(this.tagName,a,e)){case"TrustedHTML":t.value.call(this,e,a,r(s));break;case"TrustedScript":t.value.call(this,e,a,n(s));break;case"TrustedScriptURL":t.value.call(this,e,a,o(s));break;default:t.value.call(this,e,a,s)}},enumerable:t.enumerable,configurable:t.configurable},innerHTML:{get:function(){return a.get.call(this)},set:function(e){a.set.call(this,r(e))},enumerable:a.enumerable,configurable:a.configurable},outerHTML:{get:function(){return s.get.call(this)},set:function(e){s.set.call(this,r(e))},enumerable:s.enumerable,configurable:s.configurable},insertAdjacentHTML:{value:function(e,t){l.value.call(this,e,r(t))},enumerable:l.enumerable,configurable:l.configurable}})}catch(e){console.error(e)}try{const{srcdoc:e,src:t}=Object.getOwnPropertyDescriptors(HTMLIFrameElement.prototype);Object.defineProperties(HTMLIFrameElement.prototype,{srcdoc:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,r(t))},enumerable:e.enumerable,configurable:e.configurable},src:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{data:e,codeBase:t}=Object.getOwnPropertyDescriptors(HTMLObjectElement.prototype);Object.defineProperties(HTMLObjectElement.prototype,{data:{get:function(){return e.get.call(this)},set:function(t){e.set.call(this,o(t))},enumerable:e.enumerable,configurable:e.configurable},codeBase:{get:function(){return t.get.call(this)},set:function(e){t.set.call(this,o(e))},enumerable:t.enumerable,configurable:t.configurable}})}catch(e){console.error(e)}try{const{eval:e,setTimeout:t,setInterval:r}=globalThis;globalThis.eval=function(t){return e(n(t).toString())},globalThis.setTimeout=function(e,r,...o){return"string"==typeof e?t(n(e),r,...o):t(e,r,...o)},globalThis.setInterval=function(e,t,...o){return"string"==typeof e?r(n(e),t,...o):r(e,t,...o)};try{const e=globalThis.Function;globalThis.Function=function(...t){if(0===t.length)return e();{const r=n(t.pop());return e(...t,r.toString())}},globalThis.Function.prototype=e.prototype,e.prototype.constructor=globalThis.Function}catch(e){console.error(e)}}catch(e){console.error(e)}}();const ee={get(){return Array.from(this.styleSheets).filter(e=>e.ownerNode.classList.contains("_adopted"))},set(e){if(!Array.isArray(e))throw new TypeError("Must be an array");{const t=new Set(this.adoptedStyleSheets);t.difference(e).forEach(e=>e.ownerNode.remove());const r=[...new Set(e).difference(t)].map(e=>{const t=document.createElement("link"),r=new AbortController,n=r.signal,o=URL.createObjectURL(new File([],"adopted.css",{type:"text/css"}));return t.rel="stylesheet",t.href=o,t.classList.add("_adopted"),t.disabled=e.disabled,t.addEventListener("load",({target:n})=>{r.abort(),t.media=e.media.mediaText,[...e.cssRules].forEach((e,t)=>{n.sheet.insertRule(e.cssText,t)}),setTimeout(()=>URL.revokeObjectURL(n.href),100)},{once:!0,signal:n}),t.addEventListener("error",({target:e})=>{r.abort(),URL.revokeObjectURL(e.href)},{once:!0,signal:n}),t});this instanceof Document?this.head.append(...r):this.append(...r)}}},te=Symbol("shadow:hosts");function re(e){if(e instanceof HTMLTemplateElement&&e.parentElement instanceof HTMLElement){e.parentElement.attachShadow({mode:e.getAttribute("shadowrootmode"),clonable:e.hasAttribute("shadowrootclonable"),delegatesFocus:e.hasAttribute("shadowrootdelegatesfocus"),serializable:e.hasAttribute("shadowrootserializable")}).append(e.content),e.remove()}}function ne(e,{serializableShadowRoots:t=!1,shadowRoots:r=[],[te]:n=[]}={}){return Array.from(e.childNodes,e=>{if(e.nodeType===Node.ELEMENT_NODE){const[o,i]=function(e){const t=e.cloneNode().outerHTML,r=t.indexOf("/")-1;return r>0?[t.substring(0,r),t.substring(r)]:[t,""]}(e);return o+e.getHTML({serializableShadowRoots:t,shadowRoots:r,[te]:n})+i}return e.textContent}).join("")}function oe(e,{serializableShadowRoots:t,shadowRoots:r,[te]:n=[]}={}){if(e.serializable){const o=`<template shadowrootmode="${e.mode}"`,i=[];e.clonable&&i.push(' shadowrootclonable=""'),e.serializable&&i.push(' shadowrootserializable=""'),e.delegatesFocus&&i.push(' shadowrootdelegatesfocus=""');return(0===i.length?o+">":o+" "+i.join("")+">")+ne(e,{serializableShadowRoots:t,shadowRoots:r,[te]:n})+"</template>"}return ne(e,{serializableShadowRoots:t,shadowRoots:r,[te]:n})}function ie(e){const t=(new DOMParser).parseFromString(e,"text/html"),r=document.createDocumentFragment();r.append(...t.body.childNodes),r.querySelectorAll("* > template[shadowrootmode]").forEach(re),this.replaceChildren(r)}function ae({serializableShadowRoots:e=!1,shadowRoots:t=[],[te]:r=[]}={}){switch(e&&0===r.length&&0!==t.length&&r.push(...t.map(e=>e.host)),this.nodeType){case Node.ELEMENT_NODE:if(e&&this.shadowRoot instanceof ShadowRoot&&(this.shadowRoot.serializable||t.includes(this.shadowRoot)))return this.shadowRoot.getHTML({serializableShadowRoots:e,shadowRoots:t,[te]:r})+ne(this,{serializableShadowRoots:e,shadowRoots:t,[te]:r});if(e&&r.includes(this)){return oe(t.find(e=>e.host.isSameNode(this)),{serializableShadowRoots:e,shadowRoots:t,[te]:r})+ne(this,{serializableShadowRoots:e,shadowRoots:t,[te]:r})}return this.innerHTML;case Node.DOCUMENT_FRAGMENT_NODE:return this instanceof ShadowRoot?e&&(this.serializable||t.includes(this))?oe(this,{serializableShadowRoots:e,shadowRoots:t,[te]:r}):ne(this,{serializableShadowRoots:e,shadowRoots:t,[te]:r}):"";default:throw new TypeError("'getHTML' called on an object that does not implement interface Element.")}}function se(e){for(;e.cssRules.length>0;)e.deleteRule(0)}c(Document.prototype,"adoptedStyleSheets",ee),l(Document,"parseHTMLUnsafe",function(e){const t=new DOMParser,r=document.implementation.createHTMLDocument(),n=t.parseFromString(e,"text/html");return r.head.append(...n.head.childNodes),r.body.append(...n.body.childNodes),r.querySelectorAll("* > template[shadowrootmode]").forEach(re),r}),"ShadowRoot"in globalThis&&(c(ShadowRoot.prototype,"adoptedStyleSheets",ee),l(ShadowRoot.prototype,"setHTMLUnsafe",ie),l(ShadowRoot.prototype,"getHTML",ae));try{new CSSStyleSheet}catch{const bt=globalThis.CSSStyleSheet;globalThis.CSSStyleSheet=function({disabled:e=!1,media:t}={}){const r=function(e="",{disabled:t=!1,media:r}={}){const n=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);return"string"==typeof r&&n.media.appendMedium(r),n.disabled=t,n}("#dfgbkjdfg{color:red;}",{disabled:e,media:t});return r.deleteRule(0),r},globalThis.CSSStyleSheet.prototype=bt.prototype,bt.prototype.constructor=globalThis.CSSStyleSheet}CSSStyleSheet.prototype.replace instanceof Function||(CSSStyleSheet.prototype.replace=function(e){const t=document.createElement("link"),r=new AbortController,{resolve:n,reject:o,promise:i}=Promise.withResolvers();return t.addEventListener("load",({target:e})=>{se(this),[...e.sheet.cssRules].forEach((e,t)=>this.insertRule(e.cssText,t)),n(this),r.abort(),URL.revokeObjectURL(e.href),e.remove()},{once:!0,signal:r.signal}),t.addEventListener("error",({target:e})=>{const t=new DOMException("Error loading stylesheet.");o(t),r.abort(t),URL.revokeObjectURL(e.href),e.remove()},{once:!0,signal:r.signal}),t.rel="stylesheet",t.crossOrigin="anonymous",t.referrerPolicy="no-referrer",t.media="no-op",t.href=URL.createObjectURL(new File([e],"tmp.css",{type:"text/css"})),document.head.append(t),i}),CSSStyleSheet.prototype.replaceSync instanceof Function||(CSSStyleSheet.prototype.replaceSync=function(e){const t=Document.parseHTML(`<style>${e}</style>`,{sanitizer:{allowElements:["style","html","head","body"]}}).styleSheets.item(0);se(this),[...t.cssRules].forEach((e,t)=>this.insertRule(e.cssText,t))});const le={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},ce="http://www.w3.org/1999/xhtml",ue="http://www.w3.org/1999/xlink",pe="http://www.w3.org/1998/Math/MathML",he=new Set(("HTMLElement"in globalThis?Object.keys(HTMLElement.prototype):[]).filter(e=>e.startsWith("on")));
|
|
27
27
|
/**
|
|
28
28
|
* @copyright 2023-2024 Chris Zuber <admin@kernvalley.us>
|
|
29
|
-
*/function fe(e,t=ce){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,attributes:o}=e;return Object.freeze({name:r,namespace:"string"==typeof n&&0!==n.length?n:t,attributes:o})}throw new TypeError("Invalid config entry for `elements`.")}function de({elements:e,allowElements:t},r=ce){if(Array.isArray(t))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),de({elements:t},r);if(Array.isArray(e))return e.map(e=>fe(e,r));throw new TypeError("`elements` expected to be an array.")}function me(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:o,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:o,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function be({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),be({attributes:t},r);if(Array.isArray(e))return e.map(e=>me(e,r));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),be({attributes:Object.entries(e).map(([e,t])=>({name:e,elements:t}))},r);throw new TypeError("`attributes` expected to be an array.")}function ge({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function ye({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(be({attributes:e,allowAttributes:t},r),({namespace:e})=>e??""))}function we({elements:e,allowElements:t},r=ce){return Object.freeze(Object.groupBy(de({elements:e,allowElements:t},r),({namespace:e})=>e))}function ve(e,{elementNS:t=ce,attributeNS:r}={}){if("object"!=typeof e||null===e)throw new TypeError("Sanitizer config must be an object.");return e.get instanceof Function?ve(e.get()):Object.freeze({elements:we(e,t),attributes:ye(e,r),comments:ge(e),dataAttributes:void 0===e.dataAttributes||e.dataAttributes})}const Te=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","height","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","width","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map(e=>me(e,null))),Ee=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","dir","template","strike","selectmenu","center"].map(e=>fe(e,ce))),Se=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","command","commandfor","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","wrap"].map(e=>me(e,null))),Ae=Object.freeze(Se.concat(Te)),ke=Object.freeze({comments:!0,elements:Ee,attributes:Ae,dataAttributes:!0}),xe=Object.freeze(["a","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tspan","view","missing-glyph","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","hkern","vkern","glyph","glyphRef","tref","cursor"].map(e=>fe(e,"http://www.w3.org/2000/svg"))),Me=Object.freeze(["accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clipPathUnits","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cursor","cx","cy","d","decelerate","descent","diffuseConstant","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","exponent","fill","fill-opacity","fill-rule","filter","filterUnits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","visibility","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","autoReverse","accelerate","xmlns",{name:"actuate",namespace:ue},{name:"arcrole",namespaec:ue},{name:"href",namespace:ue},{name:"role",namespace:ue},{name:"show",namespace:ue},{name:"title",namespace:ue},{name:"type",namespace:ue},{name:"space",namespace:"http://www.w3.org/XML/1998/namespace"}].map(e=>"string"==typeof e?me(e):e));
|
|
29
|
+
*/function de(e,t=ce){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,attributes:o}=e;return Object.freeze({name:r,namespace:"string"==typeof n&&0!==n.length?n:t,attributes:o})}throw new TypeError("Invalid config entry for `elements`.")}function fe({elements:e,allowElements:t},r=ce){if(Array.isArray(t))return console.warn("Use of `allowElements` is deprecated. Please use `elements` instead."),fe({elements:t},r);if(Array.isArray(e))return e.map(e=>de(e,r));throw new TypeError("`elements` expected to be an array.")}function me(e,t){if("string"==typeof e)return Object.freeze({name:e,namespace:t});if("object"==typeof e&&"string"==typeof e.name){const{name:r,namespace:n=t,elements:o,...i}=e;return Object.freeze({name:r,namespace:"string"==typeof n?n:t,elements:o,...i})}throw new TypeError("Invalid entry in `attributes` config.")}function be({attributes:e,allowAttributes:t},r){if(void 0!==t)return console.warn("Use of `allowAttributes` is deprecated. Please use `attributes` instead."),be({attributes:t},r);if(Array.isArray(e))return e.map(e=>me(e,r));if("object"==typeof e&&null!==e)return console.warn("`attributes` should be an array, not an oobject."),be({attributes:Object.entries(e).map(([e,t])=>({name:e,elements:t}))},r);throw new TypeError("`attributes` expected to be an array.")}function ge({comments:e,allowComments:t}){return"boolean"==typeof t?(console.warn("Use of `allowComments` is deprecated. Please use `comments` instead."),t):"boolean"!=typeof e||e}function ye({attributes:e,allowAttributes:t},r){return Object.freeze(Object.groupBy(be({attributes:e,allowAttributes:t},r),({namespace:e})=>e??""))}function we({elements:e,allowElements:t},r=ce){return Object.freeze(Object.groupBy(fe({elements:e,allowElements:t},r),({namespace:e})=>e))}function ve(e,{elementNS:t=ce,attributeNS:r}={}){if("object"!=typeof e||null===e)throw new TypeError("Sanitizer config must be an object.");return e.get instanceof Function?ve(e.get()):Object.freeze({elements:we(e,t),attributes:ye(e,r),comments:ge(e),dataAttributes:void 0===e.dataAttributes||e.dataAttributes})}const Te=Object.freeze(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","height","hidden","id","inert","inputmode","itemid","itemprop","itemref","itemscope","itemtype","lang","part","popover","slot","spellcheck","tabindex","title","translate","virtualkeyboardpolicy","width","aria-keyshortcuts","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-grabbed","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"].map(e=>me(e,null))),Ee=Object.freeze(["html","head","link","meta","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","search","blockquote","cite","div","dd","dt","dl","figcaption","figure","hr","li","ol","ul","menu","p","pre","a","abbr","b","bdi","bdo","br","code","data","dfn","em","i","kbd","mark","q","rp","ruby","rt","s","del","ins","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","picture","source","canvas","caption","col","colgroup","table","tbody","tr","td","tfoot","th","thead","button","datalist","option","fieldset","label","form","input","legend","meter","optgroup","select","output","progress","textarea","details","summary","dialog","slot","dir","template","strike","selectmenu","center"].map(e=>de(e,ce))),Se=Object.freeze(["abbr","accept","accept-charset","align","alink","allow","allowfullscreen","alt","anchor","archive","as","async","autocomplete","autocorrect","autopictureinpicture","autoplay","axis","background","behavior","border","bordercolor","capture","cellpadding","cellspacing","challenge","char","charoff","charset","checked","cite","classid","clear","code","codetype","color","cols","colspan","command","commandfor","compact","content","controls","controlslist","conversiondestination","coords","crossorigin","csp","data","datetime","declare","decoding","default","defer","direction","dirname","disabled","disablepictureinpicture","disableremoteplayback","disallowdocumentaccess","download","elementtiming","enctype","end","for","form","formenctype","formmethod","formnovalidate","formtarget","frameborder","headers","high","href","hreflang","hreftranslate","hspace","imagesizes","imagesrcset","importance","impressiondata","impressionexpiry","incremental","integrity","invisible","is","ismap","keytype","kind","label","language","latencyhint","leftmargin","link","list","loading","longdesc","loop","low","lowsrc","manifest","marginheight","marginwidth","max","maxlength","mayscript","media","method","min","minlength","multiple","muted","name","nohref","nomodule","noresize","noshade","novalidate","nowrap","object","open","optimum","pattern","ping","placeholder","playsinline","policy","popovertarget","popovertargetaction","poster","preload","pseudo","readonly","referrerpolicy","rel","reportingorigin","required","resources","rev","reversed","role","rows","rowspan","rules","sandbox","scheme","scope","scopes","scrollamount","scrolldelay","scrolling","select","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode","shadowrootserializable","shape","size","sizes","span","src","srcdoc","srclang","srcset","standby","start","step","summary","target","text","topmargin","truespeed","trusttoken","type","usemap","valign","value","valuetype","version","vlink","vspace","webkitdirectory","wrap"].map(e=>me(e,null))),Ae=Object.freeze(Se.concat(Te)),ke=Object.freeze({comments:!0,elements:Ee,attributes:Ae,dataAttributes:!0}),xe=Object.freeze(["a","animate","animateMotion","animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","line","linearGradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tspan","view","missing-glyph","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","hkern","vkern","glyph","glyphRef","tref","cursor"].map(e=>de(e,"http://www.w3.org/2000/svg"))),Me=Object.freeze(["accent-height","accumulate","additive","alignment-baseline","alphabetic","amplitude","arabic-form","ascent","attributeName","attributeType","azimuth","baseFrequency","baseline-shift","baseProfile","bbox","begin","bias","by","calcMode","cap-height","clip","clipPathUnits","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cursor","cx","cy","d","decelerate","descent","diffuseConstant","display","divisor","dominant-baseline","dur","dx","dy","edgeMode","elevation","enable-background","exponent","fill","fill-opacity","fill-rule","filter","filterUnits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","format","from","fr","fx","fy","g1","g2","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","glyphRef","gradientTransform","gradientUnits","hanging","horiz-adv-x","horiz-origin-x","ideographic","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letter-spacing","lighting-color","limitingConeAngle","local","marker-end","marker-mid","marker-start","markerHeight","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overline-position","overline-thickness","panose-1","paint-order","path","pathLength","patternContentUnits","patternTransform","patternUnits","pointer-events","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","rendering-intent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shape-rendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","string","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","surfaceScale","systemLanguage","tableValues","targetX","targetY","text-anchor","text-decoration","text-rendering","textLength","to","transform","transform-origin","u1","u2","underline-position","underline-thickness","unicode","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","values","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","viewBox","visibility","widths","word-spacing","writing-mode","x","x-height","x1","x2","xChannelSelector","y","y1","y2","yChannelSelector","z","zoomAndPan","autoReverse","accelerate","xmlns",{name:"actuate",namespace:ue},{name:"arcrole",namespaec:ue},{name:"href",namespace:ue},{name:"role",namespace:ue},{name:"show",namespace:ue},{name:"title",namespace:ue},{name:"type",namespace:ue},{name:"space",namespace:"http://www.w3.org/XML/1998/namespace"}].map(e=>"string"==typeof e?me(e):e));
|
|
30
30
|
/**
|
|
31
31
|
* @copyright 2023-2025 Chris Zuber <admin@kernvalley.us>
|
|
32
32
|
* @see https://wicg.github.io/sanitizer-api/#built-in-safe-default-configuration
|
|
33
|
-
*/Object.freeze(Me.concat(Te));const Le=Object.freeze(["math","maction","annotation","annotation-xml","menclose","merror","mfenced","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","semantics","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"].map(e=>fe(e,pe))),Oe=Object.freeze(["accent","accentunder","actiontype","align","background","close","color","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","fence","fontfamily","fontsize","fontstyle","fontweight","frame","framespacing","height","href","id","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","superscriptshift","symmetric","voffset","width","xmlns"].map(e=>me(e,pe)));Object.freeze(Oe.concat(Te)),Object.freeze([...Ee,...xe]),Object.freeze([...Te,...Se,...Me]),Object.freeze([...Ee,...xe,...Le]),Object.freeze([...Te,...Se,...Me,...Oe]);const Pe=new Set(["href","src","action","xlink:href"]),Re=new Set(["javascript:","data:","file:","ftp:"]),Fe=function(e,{createHTML:t,createScript:r,createScriptURL:n}){return"trustedTypes"in globalThis?trustedTypes.createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}):Object.freeze({[Symbol.for("policy-name")]:e.toString(),createHTML(r,...n){if(t instanceof Function){const e=t(r.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createHTML method.`)},createScript(t,...n){if(r instanceof Function){const e=r(t.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScript method.`)},createScriptURL(t,...r){if(n instanceof Function){const e=n(t.toString(),...r).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScriptURL method.`)}})}("aegis-sanitizer#html",{createHTML:e=>e});function Ce(e,t,{elements:r=ke.elements,attributes:n=ke.attributes,comments:o=ke.comments,dataAttributes:i=ke.dataAttributes,sanitizer:a,...s}=ke,{allowInsecure:l=!1}={}){const c=document.createElement("template");c.setHTMLUnsafe(Fe.createHTML(t)),Ie(c.content,{elements:r,attributes:n,comments:o,dataAttributes:i,sanitizer:a,...s},l),e.replaceChildren(c.content)}function je(e,{elements:t=ke.elements,attributes:r=ke.attributes,comments:n=ke.comments,dataAttributes:o=ke.dataAttributes,sanitizer:i,...a}=ke,{allowInsecure:s=!1}={}){const l=(new DOMParser).parseFromString(Fe.createHTML(e),"text/html");return Ie(l,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a},s),l}function Ie(e,t=ke,r=!1){if(e instanceof Node){return De(e,ve(t),r)}throw new TypeError("Not a node.")}const Ne="trustedTypes"in globalThis?e=>null!==trustedTypes.getAttributeType(e.ownerElement.tagName,e.localName,e.ownerElement.namespaceURI,e.namespaceURI):e=>he.has(e.localName);function He(e,t,r=!1){const n=e.namespaceURI||"";return(!("dataAttributes"in t)||t.dataAttributes)&&e.name.startsWith("data-")||n in t.attributes&&t.attributes[n].some(t=>t.name===e.localName)&&!(r||Ne(e))&&!(r||function(e){if(Pe.has(e.name)){if(URL.canParse(e.value)){const{protocol:t}=new URL(e.value);return Re.has(t)}return!1}return!1}(e))}function De(e,t,r=!1){switch(e.nodeType){case Node.ELEMENT_NODE:!function(e,t,r){if(function(e,t){return e.namespaceURI in t.elements&&t.elements[e.namespaceURI].some(t=>t.name===e.localName)}(e,t)){if(e.hasAttributes()){const n=e.attributes;for(let e=n.length-1;-1!==e;e--)Ue(n[e],t,r)}if("TEMPLATE"===e.tagName)ze(e.content,t,r);else if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)De(n[e],t,r)}}else e.remove()}(e,t,r);break;case Node.DOCUMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:ze(e,t,r);break;case Node.COMMENT_NODE:!function(e,t){t.comments||e.remove()}(e,t);break;case Node.ATTRIBUTE_NODE:Ue(e,t,r);break;case Node.TEXT_NODE:case Node.DOCUMENT_TYPE_NODE:break;default:e.ownerElement instanceof Element&&e.ownerElement.removeChild(e)}}function Ue(e,t,r=!1){!He(e,t,r)&&e.ownerElement instanceof Element&&e.ownerElement.removeAttributeNode(e)}function ze(e,t,r=!1){if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)De(n[e],t,r)}}if(Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}),URL.canParse instanceof Function||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch{return!1}}),URL.parse instanceof Function||(URL.parse=function(e,t){try{return new URL(e,t)}catch{return null}}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){const r={};for(const n of e){const e=t(n);e in r?r[e].push(n):r[e]=[n]}return r}),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){Ce(this,e,"object"==typeof i&&null!==i?i.getConfiguration instanceof Function?i.getConfiguration():i:{elements:t,attributes:r,comments:n,dataAttributes:o,...a})},DocumentFragment.prototype.setHTML=function(...e){Element.prototype.setHTML.apply(this,e)},HTMLTemplateElement.prototype.setHTML=function(e,t){this.content.setHTML(e,t)}),Document.parseHTML instanceof Function||(Document.parseHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){return"object"==typeof i&&null!==i?Document.parseHTML(e,i.getConfiguration instanceof Function?i.getConfiguration():i):je(e,{elements:t,attributes:r,comments:n,dataAttributes:o,...a})}),!("command"in HTMLButtonElement.prototype)){const gt=Symbol("command:for"),yt={passive:!0};Object.defineProperty(HTMLButtonElement.prototype,"command",{get(){return this.getAttribute("command")},set(e){"string"==typeof e?this.setAttribute("command",e):this.removeAttribute("command")}}),Object.defineProperty(HTMLButtonElement.prototype,"commandForElement",{get(){return this[gt]instanceof Element?this[gt]:this.hasAttribute("commandfor")?document.getElementById(this.getAttribute("commandfor")):null},set(e){e instanceof Element?0===e.id.length?(this.setAttribute("commandfor",""),this[gt]=e):(this.setAttribute("commandfor",e.id),this[gt]=null):(this.removeAttribute("commandfor"),this[gt]=null)}});class wt extends Event{#$=null;#q="";constructor(e,{source:t,command:r,bubbles:n,cancelable:o,composed:i}={}){super(e,{bubbles:n,cancelable:o,composed:i}),"string"==typeof r&&(this.#q=r),t instanceof HTMLButtonElement&&(this.#$=t)}get command(){return this.#q}get source(){return this.#$}}function vt({currentTarget:e}){if(e instanceof HTMLButtonElement&&e.hasAttribute("command")&&e.hasAttribute("commandfor")){const t=e.commandForElement,r=e.command;if(t instanceof Element&&"string"==typeof r){const n=new wt("command",{command:r,source:e,cancelable:!0});if(t.dispatchEvent(n),!n.defaultPrevented)switch(r){case"show-modal":t instanceof HTMLDialogElement&&t.showModal();break;case"close":t instanceof HTMLDialogElement&&t.close();break;case"request-close":t instanceof HTMLDialogElement&&t.requestClose();break;case"show-popover":t.showPopover();break;case"hide-popover":t.hidePopover();break;case"toggle-popover":t.togglePopover()}}}}const Tt=new MutationObserver(e=>{for(const t of e)if("childList"===t.type){for(const e of t.addedNodes)if(e instanceof HTMLButtonElement&&e.hasAttribute("command")&&e.hasAttribute("commandfor"))e.addEventListener("click",vt,yt);else if(e instanceof Element)for(const t of e.querySelectorAll("button[command][commandfor]"))t.addEventListener("click",vt,yt)}else"attributes"===t.type&&t.target instanceof HTMLButtonElement&&typeof t.oldValue!=typeof t.target.getAttribute(t.attributeName)&&(t.target.hasAttribute("command")&&t.target.hasAttribute("commandfor")?t.target.addEventListener("click",vt,yt):t.target.removeEventListener("click",vt,yt))}),Et={childList:!0,subtree:!0,attributes:!0,attributeFilter:["command","commandfor"],attributeOldValue:!0};Tt.observe(document,Et),document.querySelectorAll("button").forEach(e=>e.addEventListener("click",vt,yt)),globalThis.CommandEvent=wt,globalThis[Symbol.for("polyfill-command")]=e=>Tt.observe(e,Et)}if(l(Element.prototype,"setHTMLUnsafe",ie),l(Element.prototype,"getHTML",ae),"CustomElementRegistry"in globalThis&&!(CustomElementRegistry.prototype.getName instanceof Function)){const St=new Map;u(CustomElementRegistry.prototype,"define",e=>(t,r,n)=>{e.call(customElements,t,r,n),St.set(r,"string"==typeof n.extends?n.extends:t)}),l(CustomElementRegistry.prototype,"getName",e=>{if("function"==typeof e)return St.get(e)??null;throw"object"==typeof e&&null!==e?new TypeError("CustomElementRegistry.getName: Argument 1 is not callable."):new TypeError("CustomElementRegistry.getName: Argument 1 is not an object.")})}function $e({currentTarget:e}){switch(e.popoverTargetAction){case"show":e.popoverTargetElement.showPopover();break;case"hide":e.popoverTargetElement.hidePopover();break;default:e.popoverTargetElement.togglePopover()}}if(!(globalThis.ToggleEvent instanceof Function)){class At extends Event{#B;#_;constructor(e,{newState:t,oldState:r}){super(e,{bubbles:!0}),this.#B=t,this.#_=r}get newState(){return this.#B}get oldState(){return this.#_}}globalThis.ToggleEvent=At}if(!(HTMLElement.prototype.showPopover instanceof Function)){const kt=e=>e.classList.contains("_popover-open");Object.defineProperties(HTMLElement.prototype,{showPopover:{value:function(){if(!kt(this)){if(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"closed",newState:"open"})),"auto"===this.getAttribute("popover")){const e=new AbortController;document.body.addEventListener("click",({target:t})=>{this.contains(t)||this.isSameNode(t.popoverTargetElement)||(e.abort(),this.hidePopover())},{signal:e.signal,capture:!0}),document.body.addEventListener("keydown",({key:t})=>{"Escape"===t&&(e.abort(),this.hidePopover())},{signal:e.signal,capture:!0}),document.addEventListener("beforetoggle",({target:t})=>{t.isSameNode(this)||"auto"!==t.getAttribute("popover")||(e.abort(),this.hidePopover())},{signal:e.signal})}this.classList.add("_popover-open"),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"closed",newState:"open"}))}}},hidePopover:{value:function(){kt(this)&&(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"open",newState:"closed"})),queueMicrotask(()=>this.classList.remove("_popover-open")),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"open",newState:"closed"})))}},togglePopover:{value:function(){kt(this)?this.hidePopover():this.showPopover()}}}),Object.defineProperties(HTMLButtonElement.prototype,{popoverTargetElement:{get(){return document.getElementById(this.getAttribute("popovertarget"))}},popoverTargetAction:{get(){return this.getAttribute("popovertargetaction")||"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}}),function(e=document.body){e.querySelectorAll('button[popovertarget], input[type="button"][popovertarget]').forEach(e=>e.addEventListener("click",$e))}()}if(HTMLScriptElement.supports instanceof Function||(HTMLScriptElement.supports=function(e){switch(e.toLowerCase()){case"classic":return!0;case"module":return"noModule"in HTMLScriptElement.prototype;default:return!1}}),!Element.prototype.hasOwnProperty(le.role)){const xt=!0,Mt=!0,Lt=Object.fromEntries(Object.entries(le).map(([e,t])=>[e,{get:function(){return this.getAttribute(t)},set:function(e){"string"==typeof e?this.setAttribute(t,e):this.removeAttribute(t)},enumerable:xt,configurable:Mt}]));Object.defineProperties(Element.prototype,Lt)}if(!HTMLElement.prototype.hasOwnProperty("inert")){const Ot=new WeakMap,Pt=e=>{Ot.has(e)&&(e.tabIndex=Ot.get(e)),e.hasChildNodes()&&[...e.children].forEach(Pt)},Rt=e=>{-1!==e.tabIndex&&(Ot.set(e,e.tabIndex),e.tabIndex=-1),e.hasChildNodes()&&[...e.children].forEach(Rt)};Object.defineProperty(HTMLElement.prototype,"inert",{get:function(){return this.hasAttribute("inert")},set:function(e){e?(this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),Rt(this)):(this.removeAttribute("aria-hidden"),this.removeAttribute("inert"),Pt(this))},enumerable:!0,configurable:!0})}if(HTMLImageElement.prototype.hasOwnProperty("complete")||Object.defineProperty(HTMLImageElement.prototype,"complete",{get:function(){return""===this.src||this.naturalHeight>0}}),HTMLImageElement.prototype.decode instanceof Function||(HTMLImageElement.prototype.decode=function(){return this.complete?Promise.resolve():new Promise((e,t)=>{const r=()=>{this.removeEventListener("error",n),this.removeEventListener("load",r),e()},n=e=>{this.removeEventListener("error",n),this.removeEventListener("load",r),t(e)};this.addEventListener("load",r),this.addEventListener("error",n)})}),!HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode")){const Ft=new WeakMap;c(HTMLTemplateElement.prototype,"shadowRootMode",{get(){return this.getAttribute("shadowrootmode")},set(e){this.setAttribute("shadowrootmode",e)}}),c(HTMLTemplateElement.prototype,"shadowRootDelegatesFocus",{get(){return this.hasAttribute("shadowrootdelegatesfocus")},set(e){this.toggleAttribute("shadowrootdelegatesfocus",e)}}),c(HTMLTemplateElement.prototype,"shadowRootClonable",{get(){return this.hasAttribute("shadowrootclonable")},set(e){this.toggleAttribute("shadowrootclonable",e)}}),c(HTMLTemplateElement.prototype,"shadowRootSerializable",{get(){return this.hasAttribute("shadowrootserializable")},set(e){this.toggleAttribute("shadowrootserializable",e)}});const Ct=(e=document)=>{e.querySelectorAll("template[shadowrootmode]").forEach(e=>{const t=e.parentElement.attachShadow({mode:e.shadowRootMode,clonable:e.shadowRootClonable,delegatesFocus:e.shadowRootDelegatesFocus,serializable:e.shadowRootSerializable});t.append(e.content),e.remove(),Ct(t),Ft.set(t.host,t)})};u(HTMLElement.prototype,"attachShadow",function(e){return({mode:t,clonable:r=!1,delegatesFocus:n=!1,serializable:o=!1,slotAssignment:i="auto"})=>{if(Ft.has(this)){const e=Ft.get(this);if(t===e.shadowRootMode)return Ct.remove(this),e;throw new DOMException("Element.attachShadow: Unable to re-attach to existing ShadowDOM")}return e.call(this,{mode:t,clonable:r,delegatesFocus:n,serializable:o,slotAssignment:i})}}),"loading"===document.readyState?document.addEventListener("readystatechange",()=>Ct(document),{once:!0}):Ct(document)}HTMLFormElement.prototype.requestSubmit instanceof Function||(HTMLFormElement.prototype.requestSubmit=function(e){if(void 0===e){const e=document.createElement("button");e.type="submit",e.hidden=!0,this.append(e),this.requestSubmit(e),setTimeout(()=>e.remove(),100)}else{if(!(e instanceof HTMLButtonElement||e instanceof HTMLInputElement))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!("submit"===e.type||e instanceof HTMLInputElement&&"image"===e.type))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!this.isSameNode(e.form))throw new DOMException("HTMLFormElement.requestSubmit: The submitter is not owned by this form.","NotFoundError");e.click()}}),"loading"in HTMLIFrameElement.prototype||c(HTMLIFrameElement.prototype,"loading",{get:function(){return this.getAttribute("loading")||"auto"},set:function(e){this.setAttribute("loading",e)}}),"credentialless"in HTMLIFrameElement.prototype||c(HTMLIFrameElement.prototype,"credentialless",{get:function(){return this.hasAttribute("credentialless")},set:function(e){this.toggleAttribute("credentialless",e)}}),!("HTMLDialogElement"in globalThis)||HTMLDialogElement.prototype.requestClose instanceof Function||(HTMLDialogElement.prototype.requestClose=function(e){const t=new Event("cancel",{cancelable:!0,bubbles:!1});this.dispatchEvent(t),t.defaultPrevented||this.close(e)});const qe="Expected a set-like object.",Be=["has","keys"],_e=["size"],Ve=e=>e instanceof Set,We=e=>Ve(e)||"object"==typeof e&&null!==e&&Be.every(t=>e[t]instanceof Function)&&_e.every(t=>t in e);Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(e){if(!We(e))throw new TypeError(qe);return new Set([...this].filter(t=>e.has(t)))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(e){if(!We(e))throw new TypeError(qe);return new Set([...this].filter(t=>!e.has(t)))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(e){return new Set([...this,...e])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(e){if(!We(e))throw new TypeError(qe);return[...this].every(t=>e.has(t))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(e){if(!We(e))throw new TypeError(qe);return Ve(e)?e.isSubsetOf(this):new Set(e.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(e){if(!We(e))throw new TypeError(qe);return Ve(e)?new Set([...this.difference(e),...e.difference(this)]):new Set([...this.difference(e),...new Set(e.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(e){if(!We(e))throw new TypeError(qe);return new Set([...this,...e]).size===this.size+e.size}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(e,{insert:t,update:r}={}){const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,t),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")}),function(){if("screen"in globalThis&&!(globalThis.getScreenDetails instanceof Function)){class e extends EventTarget{get availHeight(){return screen.availHeight}get availLeft(){return screen.availLeft}get availTop(){return screen.availTop}get availWidth(){return screen.availWidth}get colorDepth(){return screen.colorDepth}get devicePixelRatio(){return globalThis.devicePixelRatio||1}get height(){return screen.height}get isExtended(){return screen.isExtended}get isInternal(){return!0}get isPrimary(){return!0}get label(){return"Unknown"}get orientation(){return screen.orientation}get pixelDepth(){return screen.pixelDepth}get top(){return screen.top}get width(){return screen.width}}class t extends EventTarget{get currentScreen(){return new e}get screens(){return[this.currentScreen]}}Object.defineProperty(Screen.prototype,"isExtended",{enumerable:!0,configurable:!0,get:()=>!1}),globalThis.getScreenDetails=async()=>new t}}();
|
|
33
|
+
*/Object.freeze(Me.concat(Te));const Le=Object.freeze(["math","maction","annotation","annotation-xml","menclose","merror","mfenced","mfrac","mi","mmultiscripts","mn","mo","mover","mpadded","mphantom","mprescripts","mroot","mrow","ms","semantics","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"].map(e=>de(e,pe))),Oe=Object.freeze(["accent","accentunder","actiontype","align","background","close","color","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","fence","fontfamily","fontsize","fontstyle","fontweight","frame","framespacing","height","href","id","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","superscriptshift","symmetric","voffset","width","xmlns"].map(e=>me(e,pe)));Object.freeze(Oe.concat(Te)),Object.freeze([...Ee,...xe]),Object.freeze([...Te,...Se,...Me]),Object.freeze([...Ee,...xe,...Le]),Object.freeze([...Te,...Se,...Me,...Oe]);const Pe=new Set(["href","src","action","xlink:href"]),Re=new Set(["javascript:","data:","file:","ftp:"]),Fe=function(e,{createHTML:t,createScript:r,createScriptURL:n}){return"trustedTypes"in globalThis?trustedTypes.createPolicy(e,{createHTML:t,createScript:r,createScriptURL:n}):Object.freeze({[Symbol.for("policy-name")]:e.toString(),createHTML(r,...n){if(t instanceof Function){const e=t(r.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createHTML method.`)},createScript(t,...n){if(r instanceof Function){const e=r(t.toString(),...n).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScript method.`)},createScriptURL(t,...r){if(n instanceof Function){const e=n(t.toString(),...r).toString();return Object.freeze({toString:()=>e})}throw new TypeError(`Policy "${e}" does not provide a createScriptURL method.`)}})}("aegis-sanitizer#html",{createHTML:e=>e});function Ce(e,t,{elements:r=ke.elements,attributes:n=ke.attributes,comments:o=ke.comments,dataAttributes:i=ke.dataAttributes,sanitizer:a,...s}=ke,{allowInsecure:l=!1}={}){const c=document.createElement("template");c.setHTMLUnsafe(Fe.createHTML(t)),Ie(c.content,{elements:r,attributes:n,comments:o,dataAttributes:i,sanitizer:a,...s},l),e.replaceChildren(c.content)}function je(e,{elements:t=ke.elements,attributes:r=ke.attributes,comments:n=ke.comments,dataAttributes:o=ke.dataAttributes,sanitizer:i,...a}=ke,{allowInsecure:s=!1}={}){const l=(new DOMParser).parseFromString(Fe.createHTML(e),"text/html");return Ie(l,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a},s),l}function Ie(e,t=ke,r=!1){if(e instanceof Node){return De(e,ve(t),r)}throw new TypeError("Not a node.")}const Ne="trustedTypes"in globalThis?e=>null!==trustedTypes.getAttributeType(e.ownerElement.tagName,e.localName,e.ownerElement.namespaceURI,e.namespaceURI):e=>he.has(e.localName);function He(e,t,r=!1){const n=e.namespaceURI||"";return(!("dataAttributes"in t)||t.dataAttributes)&&e.name.startsWith("data-")||n in t.attributes&&t.attributes[n].some(t=>t.name===e.localName)&&!(r||Ne(e))&&!(r||function(e){if(Pe.has(e.name)){if(URL.canParse(e.value)){const{protocol:t}=new URL(e.value);return Re.has(t)}return!1}return!1}(e))}function De(e,t,r=!1){switch(e.nodeType){case Node.ELEMENT_NODE:!function(e,t,r){if(function(e,t){return e.namespaceURI in t.elements&&t.elements[e.namespaceURI].some(t=>t.name===e.localName)}(e,t)){if(e.hasAttributes()){const n=e.attributes;for(let e=n.length-1;-1!==e;e--)Ue(n[e],t,r)}if("TEMPLATE"===e.tagName)ze(e.content,t,r);else if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)De(n[e],t,r)}}else e.remove()}(e,t,r);break;case Node.DOCUMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:ze(e,t,r);break;case Node.COMMENT_NODE:!function(e,t){t.comments||e.remove()}(e,t);break;case Node.ATTRIBUTE_NODE:Ue(e,t,r);break;case Node.TEXT_NODE:case Node.DOCUMENT_TYPE_NODE:break;default:e.ownerElement instanceof Element&&e.ownerElement.removeChild(e)}}function Ue(e,t,r=!1){!He(e,t,r)&&e.ownerElement instanceof Element&&e.ownerElement.removeAttributeNode(e)}function ze(e,t,r=!1){if(e.hasChildNodes()){const n=e.childNodes;for(let e=n.length-1;-1!==e;e--)De(n[e],t,r)}}if(Promise.withResolvers instanceof Function||(Promise.withResolvers=function(){const e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}),URL.canParse instanceof Function||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch{return!1}}),URL.parse instanceof Function||(URL.parse=function(e,t){try{return new URL(e,t)}catch{return null}}),Object.groupBy instanceof Function||(Object.groupBy=function(e,t){const r={};for(const n of e){const e=t(n);e in r?r[e].push(n):r[e]=[n]}return r}),Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){Ce(this,e,"object"==typeof i&&null!==i?i.getConfiguration instanceof Function?i.getConfiguration():i:{elements:t,attributes:r,comments:n,dataAttributes:o,...a})},DocumentFragment.prototype.setHTML=function(...e){Element.prototype.setHTML.apply(this,e)},HTMLTemplateElement.prototype.setHTML=function(e,t){this.content.setHTML(e,t)}),Document.parseHTML instanceof Function||(Document.parseHTML=function(e,{elements:t,attributes:r,comments:n,dataAttributes:o,sanitizer:i,...a}={}){return"object"==typeof i&&null!==i?Document.parseHTML(e,i.getConfiguration instanceof Function?i.getConfiguration():i):je(e,{elements:t,attributes:r,comments:n,dataAttributes:o,...a})}),!("command"in HTMLButtonElement.prototype)){const gt=Symbol("command:for"),yt={passive:!0};Object.defineProperty(HTMLButtonElement.prototype,"command",{get(){return this.getAttribute("command")},set(e){"string"==typeof e?this.setAttribute("command",e):this.removeAttribute("command")}}),Object.defineProperty(HTMLButtonElement.prototype,"commandForElement",{get(){return this[gt]instanceof Element?this[gt]:this.hasAttribute("commandfor")?document.getElementById(this.getAttribute("commandfor")):null},set(e){e instanceof Element?0===e.id.length?(this.setAttribute("commandfor",""),this[gt]=e):(this.setAttribute("commandfor",e.id),this[gt]=null):(this.removeAttribute("commandfor"),this[gt]=null)}});class wt extends Event{#$=null;#q="";constructor(e,{source:t,command:r,bubbles:n,cancelable:o,composed:i}={}){super(e,{bubbles:n,cancelable:o,composed:i}),"string"==typeof r&&(this.#q=r),t instanceof HTMLButtonElement&&(this.#$=t)}get command(){return this.#q}get source(){return this.#$}}function vt({currentTarget:e}){if(e instanceof HTMLButtonElement&&e.hasAttribute("command")&&e.hasAttribute("commandfor")){const t=e.commandForElement,r=e.command;if(t instanceof Element&&"string"==typeof r){const n=new wt("command",{command:r,source:e,cancelable:!0});if(t.dispatchEvent(n),!n.defaultPrevented)switch(r){case"show-modal":t instanceof HTMLDialogElement&&t.showModal();break;case"close":t instanceof HTMLDialogElement&&t.close();break;case"request-close":t instanceof HTMLDialogElement&&t.requestClose();break;case"show-popover":t.showPopover();break;case"hide-popover":t.hidePopover();break;case"toggle-popover":t.togglePopover()}}}}const Tt=new MutationObserver(e=>{for(const t of e)if("childList"===t.type){for(const e of t.addedNodes)if(e instanceof HTMLButtonElement&&e.hasAttribute("command")&&e.hasAttribute("commandfor"))e.addEventListener("click",vt,yt);else if(e instanceof Element)for(const t of e.querySelectorAll("button[command][commandfor]"))t.addEventListener("click",vt,yt)}else"attributes"===t.type&&t.target instanceof HTMLButtonElement&&typeof t.oldValue!=typeof t.target.getAttribute(t.attributeName)&&(t.target.hasAttribute("command")&&t.target.hasAttribute("commandfor")?t.target.addEventListener("click",vt,yt):t.target.removeEventListener("click",vt,yt))}),Et={childList:!0,subtree:!0,attributes:!0,attributeFilter:["command","commandfor"],attributeOldValue:!0};Tt.observe(document,Et),document.querySelectorAll("button").forEach(e=>e.addEventListener("click",vt,yt)),globalThis.CommandEvent=wt,globalThis[Symbol.for("polyfill-command")]=e=>Tt.observe(e,Et)}if(l(Element.prototype,"setHTMLUnsafe",ie),l(Element.prototype,"getHTML",ae),"CustomElementRegistry"in globalThis&&!(CustomElementRegistry.prototype.getName instanceof Function)){const St=new Map;u(CustomElementRegistry.prototype,"define",e=>(t,r,n)=>{e.call(customElements,t,r,n),St.set(r,"string"==typeof n.extends?n.extends:t)}),l(CustomElementRegistry.prototype,"getName",e=>{if("function"==typeof e)return St.get(e)??null;throw"object"==typeof e&&null!==e?new TypeError("CustomElementRegistry.getName: Argument 1 is not callable."):new TypeError("CustomElementRegistry.getName: Argument 1 is not an object.")})}function $e({currentTarget:e}){switch(e.popoverTargetAction){case"show":e.popoverTargetElement.showPopover();break;case"hide":e.popoverTargetElement.hidePopover();break;default:e.popoverTargetElement.togglePopover()}}if(!(globalThis.ToggleEvent instanceof Function)){class At extends Event{#B;#_;constructor(e,{newState:t,oldState:r}){super(e,{bubbles:!0}),this.#B=t,this.#_=r}get newState(){return this.#B}get oldState(){return this.#_}}globalThis.ToggleEvent=At}if(!(HTMLElement.prototype.showPopover instanceof Function)){const kt=e=>e.classList.contains("_popover-open");Object.defineProperties(HTMLElement.prototype,{showPopover:{value:function(){if(!kt(this)){if(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"closed",newState:"open"})),"auto"===this.getAttribute("popover")){const e=new AbortController;document.body.addEventListener("click",({target:t})=>{this.contains(t)||this.isSameNode(t.popoverTargetElement)||(e.abort(),this.hidePopover())},{signal:e.signal,capture:!0}),document.body.addEventListener("keydown",({key:t})=>{"Escape"===t&&(e.abort(),this.hidePopover())},{signal:e.signal,capture:!0}),document.addEventListener("beforetoggle",({target:t})=>{t.isSameNode(this)||"auto"!==t.getAttribute("popover")||(e.abort(),this.hidePopover())},{signal:e.signal})}this.classList.add("_popover-open"),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"closed",newState:"open"}))}}},hidePopover:{value:function(){kt(this)&&(this.dispatchEvent(new ToggleEvent("beforetoggle",{oldState:"open",newState:"closed"})),queueMicrotask(()=>this.classList.remove("_popover-open")),this.dispatchEvent(new ToggleEvent("toggle",{oldState:"open",newState:"closed"})))}},togglePopover:{value:function(){kt(this)?this.hidePopover():this.showPopover()}}}),Object.defineProperties(HTMLButtonElement.prototype,{popoverTargetElement:{get(){return document.getElementById(this.getAttribute("popovertarget"))}},popoverTargetAction:{get(){return this.getAttribute("popovertargetaction")||"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}}),function(e=document.body){e.querySelectorAll('button[popovertarget], input[type="button"][popovertarget]').forEach(e=>e.addEventListener("click",$e))}()}if(HTMLScriptElement.supports instanceof Function||(HTMLScriptElement.supports=function(e){switch(e.toLowerCase()){case"classic":return!0;case"module":return"noModule"in HTMLScriptElement.prototype;default:return!1}}),!Element.prototype.hasOwnProperty(le.role)){const xt=!0,Mt=!0,Lt=Object.fromEntries(Object.entries(le).map(([e,t])=>[e,{get:function(){return this.getAttribute(t)},set:function(e){"string"==typeof e?this.setAttribute(t,e):this.removeAttribute(t)},enumerable:xt,configurable:Mt}]));Object.defineProperties(Element.prototype,Lt)}if(!HTMLElement.prototype.hasOwnProperty("inert")){const Ot=new WeakMap,Pt=e=>{Ot.has(e)&&(e.tabIndex=Ot.get(e)),e.hasChildNodes()&&[...e.children].forEach(Pt)},Rt=e=>{-1!==e.tabIndex&&(Ot.set(e,e.tabIndex),e.tabIndex=-1),e.hasChildNodes()&&[...e.children].forEach(Rt)};Object.defineProperty(HTMLElement.prototype,"inert",{get:function(){return this.hasAttribute("inert")},set:function(e){e?(this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),Rt(this)):(this.removeAttribute("aria-hidden"),this.removeAttribute("inert"),Pt(this))},enumerable:!0,configurable:!0})}if(HTMLImageElement.prototype.hasOwnProperty("complete")||Object.defineProperty(HTMLImageElement.prototype,"complete",{get:function(){return""===this.src||this.naturalHeight>0}}),HTMLImageElement.prototype.decode instanceof Function||(HTMLImageElement.prototype.decode=function(){return this.complete?Promise.resolve():new Promise((e,t)=>{const r=()=>{this.removeEventListener("error",n),this.removeEventListener("load",r),e()},n=e=>{this.removeEventListener("error",n),this.removeEventListener("load",r),t(e)};this.addEventListener("load",r),this.addEventListener("error",n)})}),!HTMLTemplateElement.prototype.hasOwnProperty("shadowRootMode")){const Ft=new WeakMap;c(HTMLTemplateElement.prototype,"shadowRootMode",{get(){return this.getAttribute("shadowrootmode")},set(e){this.setAttribute("shadowrootmode",e)}}),c(HTMLTemplateElement.prototype,"shadowRootDelegatesFocus",{get(){return this.hasAttribute("shadowrootdelegatesfocus")},set(e){this.toggleAttribute("shadowrootdelegatesfocus",e)}}),c(HTMLTemplateElement.prototype,"shadowRootClonable",{get(){return this.hasAttribute("shadowrootclonable")},set(e){this.toggleAttribute("shadowrootclonable",e)}}),c(HTMLTemplateElement.prototype,"shadowRootSerializable",{get(){return this.hasAttribute("shadowrootserializable")},set(e){this.toggleAttribute("shadowrootserializable",e)}});const Ct=(e=document)=>{e.querySelectorAll("template[shadowrootmode]").forEach(e=>{const t=e.parentElement.attachShadow({mode:e.shadowRootMode,clonable:e.shadowRootClonable,delegatesFocus:e.shadowRootDelegatesFocus,serializable:e.shadowRootSerializable});t.append(e.content),e.remove(),Ct(t),Ft.set(t.host,t)})};u(HTMLElement.prototype,"attachShadow",function(e){return({mode:t,clonable:r=!1,delegatesFocus:n=!1,serializable:o=!1,slotAssignment:i="auto"})=>{if(Ft.has(this)){const e=Ft.get(this);if(t===e.shadowRootMode)return Ct.remove(this),e;throw new DOMException("Element.attachShadow: Unable to re-attach to existing ShadowDOM")}return e.call(this,{mode:t,clonable:r,delegatesFocus:n,serializable:o,slotAssignment:i})}}),"loading"===document.readyState?document.addEventListener("readystatechange",()=>Ct(document),{once:!0}):Ct(document)}HTMLFormElement.prototype.requestSubmit instanceof Function||(HTMLFormElement.prototype.requestSubmit=function(e){if(void 0===e){const e=document.createElement("button");e.type="submit",e.hidden=!0,this.append(e),this.requestSubmit(e),setTimeout(()=>e.remove(),100)}else{if(!(e instanceof HTMLButtonElement||e instanceof HTMLInputElement))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!("submit"===e.type||e instanceof HTMLInputElement&&"image"===e.type))throw new TypeError("HTMLFormElement.requestSubmit: The submitter is not a submit button.");if(!this.isSameNode(e.form))throw new DOMException("HTMLFormElement.requestSubmit: The submitter is not owned by this form.","NotFoundError");e.click()}}),"loading"in HTMLIFrameElement.prototype||c(HTMLIFrameElement.prototype,"loading",{get:function(){return this.getAttribute("loading")||"auto"},set:function(e){this.setAttribute("loading",e)}}),"credentialless"in HTMLIFrameElement.prototype||c(HTMLIFrameElement.prototype,"credentialless",{get:function(){return this.hasAttribute("credentialless")},set:function(e){this.toggleAttribute("credentialless",e)}}),!("HTMLDialogElement"in globalThis)||HTMLDialogElement.prototype.requestClose instanceof Function||(HTMLDialogElement.prototype.requestClose=function(e){const t=new Event("cancel",{cancelable:!0,bubbles:!1});this.dispatchEvent(t),t.defaultPrevented||this.close(e)});const qe="Expected a set-like object.",Be=["has","keys"],_e=["size"],Ve=e=>e instanceof Set,We=e=>Ve(e)||"object"==typeof e&&null!==e&&Be.every(t=>e[t]instanceof Function)&&_e.every(t=>t in e);Set.prototype.intersection instanceof Function||(Set.prototype.intersection=function(e){if(!We(e))throw new TypeError(qe);return new Set([...this].filter(t=>e.has(t)))}),Set.prototype.difference instanceof Function||(Set.prototype.difference=function(e){if(!We(e))throw new TypeError(qe);return new Set([...this].filter(t=>!e.has(t)))}),Set.prototype.union instanceof Function||(Set.prototype.union=function(e){return new Set([...this,...e])}),Set.prototype.isSubsetOf instanceof Function||(Set.prototype.isSubsetOf=function(e){if(!We(e))throw new TypeError(qe);return[...this].every(t=>e.has(t))}),Set.prototype.isSupersetOf instanceof Function||(Set.prototype.isSupersetOf=function(e){if(!We(e))throw new TypeError(qe);return Ve(e)?e.isSubsetOf(this):new Set(e.keys()).isSubsetOf(this)}),Set.prototype.symmetricDifference instanceof Function||(Set.prototype.symmetricDifference=function(e){if(!We(e))throw new TypeError(qe);return Ve(e)?new Set([...this.difference(e),...e.difference(this)]):new Set([...this.difference(e),...new Set(e.keys()).difference(this)])}),Set.prototype.isDisjointFrom instanceof Function||(Set.prototype.isDisjointFrom=function(e){if(!We(e))throw new TypeError(qe);return new Set([...this,...e]).size===this.size+e.size}),WeakMap.prototype.emplace instanceof Function||(WeakMap.prototype.emplace=function(e,{insert:t,update:r}={}){const n=this.has(e);if(n&&r instanceof Function){const t=this.get(e),n=r.call(this,t,e,this);return n!==t&&this.set(e,t),n}if(n)return this.get(e);if(t instanceof Function){const r=t.call(this,e,this);return this.set(e,r),r}throw new Error("Key is not found and no `insert()` given")}),function(){if("screen"in globalThis&&!(globalThis.getScreenDetails instanceof Function)){class e extends EventTarget{get availHeight(){return screen.availHeight}get availLeft(){return screen.availLeft}get availTop(){return screen.availTop}get availWidth(){return screen.availWidth}get colorDepth(){return screen.colorDepth}get devicePixelRatio(){return globalThis.devicePixelRatio||1}get height(){return screen.height}get isExtended(){return screen.isExtended}get isInternal(){return!0}get isPrimary(){return!0}get label(){return"Unknown"}get orientation(){return screen.orientation}get pixelDepth(){return screen.pixelDepth}get top(){return screen.top}get width(){return screen.width}}class t extends EventTarget{get currentScreen(){return new e}get screens(){return[this.currentScreen]}}Object.defineProperty(Screen.prototype,"isExtended",{enumerable:!0,configurable:!0,get:()=>!1}),globalThis.getScreenDetails=async()=>new t}}();
|
|
34
34
|
/**
|
|
35
35
|
* @copyright 2024 Chris Zuber <admin@kernvalley.us>
|
|
36
36
|
*/
|