@flarehr/apollo-workplace-policies 0.26.26 → 0.27.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var xr=Object.defineProperty;var Pr=(ee,te,ne)=>te in ee?xr(ee,te,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ee[te]=ne;var Lt=(ee,te,ne)=>(Pr(ee,typeof te!="symbol"?te+"":te,ne),ne),Ln=(ee,te,ne)=>{if(!te.has(ee))throw TypeError("Cannot "+ne)};var Fe=(ee,te,ne)=>(Ln(ee,te,"read from private field"),ne?ne.call(ee):te.get(ee)),Qe=(ee,te,ne)=>{if(te.has(ee))throw TypeError("Cannot add the same private member more than once");te instanceof WeakSet?te.add(ee):te.set(ee,ne)},pt=(ee,te,ne,re)=>(Ln(ee,te,"write to private field"),re?re.call(ee,ne):te.set(ee,ne),ne);var xn=(ee,te,ne,re)=>({set _(ie){pt(ee,te,ie,ne)},get _(){return Fe(ee,te,re)}}),it=(ee,te,ne)=>(Ln(ee,te,"access private method"),ne);(function(){"use strict";function _mergeNamespaces(ee,te){for(var ne=0;ne<te.length;ne++){const re=te[ne];if(typeof re!="string"&&!Array.isArray(re)){for(const ie in re)if(ie!=="default"&&!(ie in ee)){const se=Object.getOwnPropertyDescriptor(re,ie);se&&Object.defineProperty(ee,ie,se.get?se:{enumerable:!0,get:()=>re[ie]})}}}return Object.freeze(Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"}))}class Some{constructor(te){this.value=te}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return structuralHash(this.value)}Equals(te){return te==null?!1:equals$2(this.value,te instanceof Some?te.value:te)}CompareTo(te){return te==null?1:compare$2(this.value,te instanceof Some?te.value:te)}}function value(ee){if(ee==null)throw new Error("Option has no value");return ee instanceof Some?ee.value:ee}function isArrayLike(ee){return Array.isArray(ee)||ArrayBuffer.isView(ee)}function isEnumerable(ee){return ee!=null&&typeof ee.GetEnumerator=="function"}function isComparable(ee){return ee!=null&&typeof ee.CompareTo=="function"}function isEquatable(ee){return ee!=null&&typeof ee.Equals=="function"}function isHashable(ee){return ee!=null&&typeof ee.GetHashCode=="function"}function isDisposable(ee){return ee!=null&&typeof ee.Dispose=="function"}function disposeSafe(ee){isDisposable(ee)&&ee.Dispose()}function defaultOf(){return null}function sameConstructor(ee,te){var ne,re;return((ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor)===((re=Object.getPrototypeOf(te))==null?void 0:re.constructor)}class Enumerator{constructor(te){this.iter=te,this.current=defaultOf()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const te=this.iter.next();return this.current=te.value,!te.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function getEnumerator(ee){return isEnumerable(ee)?ee.GetEnumerator():new Enumerator(ee[Symbol.iterator]())}function toIterator(ee){return{next(){const te=ee["System.Collections.IEnumerator.MoveNext"](),ne=te?ee["System.Collections.Generic.IEnumerator`1.get_Current"]():void 0;return{done:!te,value:ne}}}}class Lazy{constructor(te){this.factory=te,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function padWithZeros(ee,te){let ne=ee.toString(10);for(;ne.length<te;)ne="0"+ne;return ne}function padLeftAndRightWithZeros(ee,te,ne){let re=ee.toString(10);for(;re.length<te;)re="0"+re;for(;re.length<ne;)re=re+"0";return re}function dateOffset(ee){const te=ee;return typeof te.offset=="number"?te.offset:ee.kind===1?0:ee.getTimezoneOffset()*-6e4}function int16ToString(ee,te){return ee=ee<0&&te!=null&&te!==10?65535+ee+1:ee,ee.toString(te)}function int32ToString(ee,te){return ee=ee<0&&te!=null&&te!==10?4294967295+ee+1:ee,ee.toString(te)}class ObjectRef{static id(te){return ObjectRef.idMap.has(te)||ObjectRef.idMap.set(te,++ObjectRef.count),ObjectRef.idMap.get(te)}}ObjectRef.idMap=new WeakMap,ObjectRef.count=0;function stringHash(ee){let te=0,ne=5381;const re=ee.length;for(;te<re;)ne=ne*33^ee.charCodeAt(te++);return ne}function numberHash(ee){return ee*2654435761|0}function combineHashCodes(ee){let te=0;const ne=ee.length;for(let re=0;re<ne;re++){const ie=ee[re];te=(te<<5)+te^ie}return te}function dateHash(ee){return ee.getTime()}function arrayHash(ee){const te=ee.length,ne=new Array(te);for(let re=0;re<te;re++)ne[re]=structuralHash(ee[re]);return combineHashCodes(ne)}function structuralHash(ee){var te;if(ee==null)return 0;switch(typeof ee){case"boolean":return ee?1:0;case"number":return numberHash(ee);case"string":return stringHash(ee);default:{if(isHashable(ee))return ee.GetHashCode();if(isArrayLike(ee))return arrayHash(ee);if(ee instanceof Date)return dateHash(ee);if(((te=Object.getPrototypeOf(ee))==null?void 0:te.constructor)===Object){const ne=Object.values(ee).map(re=>structuralHash(re));return combineHashCodes(ne)}else return numberHash(ObjectRef.id(ee))}}}function equalArraysWith(ee,te,ne){if(ee==null)return te==null;if(te==null||ee.length!==te.length)return!1;for(let re=0;re<ee.length;re++)if(!ne(ee[re],te[re]))return!1;return!0}function equalArrays(ee,te){return equalArraysWith(ee,te,equals$2)}function equalObjects(ee,te){const ne=Object.keys(ee),re=Object.keys(te);if(ne.length!==re.length)return!1;ne.sort(),re.sort();for(let ie=0;ie<ne.length;ie++)if(ne[ie]!==re[ie]||!equals$2(ee[ne[ie]],te[re[ie]]))return!1;return!0}function equals$2(ee,te){var ne;return ee===te?!0:ee==null?te==null:te==null?!1:isEquatable(ee)?ee.Equals(te):isArrayLike(ee)?isArrayLike(te)&&equalArrays(ee,te):typeof ee!="object"?!1:ee instanceof Date?te instanceof Date&&compareDates(ee,te)===0:((ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor)===Object&&equalObjects(ee,te)}function compareDates(ee,te){let ne,re;return"offset"in ee&&"offset"in te?(ne=ee.getTime(),re=te.getTime()):(ne=ee.getTime()+dateOffset(ee),re=te.getTime()+dateOffset(te)),ne===re?0:ne<re?-1:1}function comparePrimitives(ee,te){return ee===te?0:ee<te?-1:1}function compareArraysWith(ee,te,ne){if(ee==null)return te==null?0:1;if(te==null)return-1;if(ee.length!==te.length)return ee.length<te.length?-1:1;for(let re=0,ie=0;re<ee.length;re++)if(ie=ne(ee[re],te[re]),ie!==0)return ie;return 0}function compareArrays(ee,te){return compareArraysWith(ee,te,compare$2)}function compareObjects(ee,te){const ne=Object.keys(ee),re=Object.keys(te);if(ne.length!==re.length)return ne.length<re.length?-1:1;ne.sort(),re.sort();for(let ie=0,se=0;ie<ne.length;ie++){const oe=ne[ie];if(oe!==re[ie])return oe<re[ie]?-1:1;if(se=compare$2(ee[oe],te[oe]),se!==0)return se}return 0}function compare$2(ee,te){var ne;return ee===te?0:ee==null?te==null?0:-1:te==null?1:isComparable(ee)?ee.CompareTo(te):isArrayLike(ee)?isArrayLike(te)?compareArrays(ee,te):-1:typeof ee!="object"?ee<te?-1:1:ee instanceof Date?te instanceof Date?compareDates(ee,te):-1:((ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor)===Object?compareObjects(ee,te):-1}function min(ee,te,ne){return ee(te,ne)<0?te:ne}function max(ee,te,ne){return ee(te,ne)>0?te:ne}function createObj(ee){const te={};for(const ne of ee)te[ne[0]]=ne[1];return te}function clear(ee){isArrayLike(ee)?ee.splice(0):ee.clear()}const curried=new WeakMap;function uncurry2(ee){if(ee==null)return null;const te=(ne,re)=>ee(ne)(re);return curried.set(te,ee),te}function curry2(ee){var te;return(te=curried.get(ee))!=null?te:ne=>re=>ee(ne,re)}function uncurry3(ee){if(ee==null)return null;const te=(ne,re,ie)=>ee(ne)(re)(ie);return curried.set(te,ee),te}function curry3(ee){var te;return(te=curried.get(ee))!=null?te:ne=>re=>ie=>ee(ne,re,ie)}function seqToString(ee){let te=0,ne="[";for(const re of ee){if(te===0)ne+=toString$4(re);else if(te===100){ne+="; ...";break}else ne+="; "+toString$4(re);te++}return ne+"]"}function toString$4(ee,te=0){var ne,re;if(ee!=null&&typeof ee=="object"){if(typeof ee.toString=="function")return ee.toString();if(Symbol.iterator in ee)return seqToString(ee);{const ie=(ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor;return ie===Object&&te<10?"{ "+Object.entries(ee).map(([se,oe])=>se+" = "+toString$4(oe,te+1)).join("\n ")+" }":(re=ie==null?void 0:ie.name)!=null?re:""}}return String(ee)}function unionToString(ee,te){if(te.length===0)return ee;{let ne,re=!0;return te.length===1?(ne=toString$4(te[0]),re=ne.indexOf(" ")>=0):ne=te.map(ie=>toString$4(ie)).join(", "),ee+(re?" (":" ")+ne+(re?")":"")}}class Union{get name(){return this.cases()[this.tag]}toJSON(){return this.fields.length===0?this.name:[this.name].concat(this.fields)}toString(){return unionToString(this.name,this.fields)}GetHashCode(){const te=this.fields.map(ne=>structuralHash(ne));return te.splice(0,0,numberHash(this.tag)),combineHashCodes(te)}Equals(te){return this===te?!0:sameConstructor(this,te)&&this.tag===te.tag?equalArrays(this.fields,te.fields):!1}CompareTo(te){return this===te?0:sameConstructor(this,te)?this.tag===te.tag?compareArrays(this.fields,te.fields):this.tag<te.tag?-1:1:-1}}function recordToJSON(ee){const te={},ne=Object.keys(ee);for(let re=0;re<ne.length;re++)te[ne[re]]=ee[ne[re]];return te}function recordToString(ee){return"{ "+Object.entries(ee).map(([te,ne])=>te+" = "+toString$4(ne)).join("\n ")+" }"}function recordGetHashCode(ee){const te=Object.values(ee).map(ne=>structuralHash(ne));return combineHashCodes(te)}function recordEquals(ee,te){if(ee===te)return!0;if(sameConstructor(ee,te)){const ne=Object.keys(ee);for(let re=0;re<ne.length;re++)if(!equals$2(ee[ne[re]],te[ne[re]]))return!1;return!0}else return!1}function recordCompareTo(ee,te){if(ee===te)return 0;if(sameConstructor(ee,te)){const ne=Object.keys(ee);for(let re=0;re<ne.length;re++){const ie=compare$2(ee[ne[re]],te[ne[re]]);if(ie!==0)return ie}return 0}else return-1}class Record{toJSON(){return recordToJSON(this)}toString(){return recordToString(this)}GetHashCode(){return recordGetHashCode(this)}Equals(te){return recordEquals(this,te)}CompareTo(te){return recordCompareTo(this,te)}}class FSharpRef{get contents(){return this.getter()}set contents(te){this.setter(te)}constructor(te,ne){typeof ne=="function"?(this.getter=te,this.setter=ne):(this.getter=()=>te,this.setter=re=>{te=re})}}class Exception{constructor(te){this.message=te}}function isException(ee){return ee instanceof Exception||ee instanceof Error}function isPromise(ee){return ee instanceof Promise}function ensureErrorOrException(ee){return isException(ee)||isPromise(ee)?ee:new Error(String(ee))}const symbol=Symbol("numeric");function isNumeric(ee){return typeof ee=="number"||(ee==null?void 0:ee[symbol])}function compare$1(ee,te){return typeof ee=="number"?ee<te?-1:ee>te?1:0:ee.CompareTo(te)}function multiply$1(ee,te){return typeof ee=="number"?ee*te:ee[symbol]().multiply(te)}function toFixed(ee,te){return typeof ee=="number"?ee.toFixed(te):ee[symbol]().toFixed(te)}function toPrecision(ee,te){return typeof ee=="number"?ee.toPrecision(te):ee[symbol]().toPrecision(te)}function toExponential(ee,te){return typeof ee=="number"?ee.toExponential(te):ee[symbol]().toExponential(te)}function toHex(ee){return typeof ee=="number"?(Number(ee)>>>0).toString(16):ee[symbol]().toHex()}var NumberStyles;(function(ee){ee[ee.AllowHexSpecifier=512]="AllowHexSpecifier"})(NumberStyles||(NumberStyles={}));function validResponse(ee,te){const[,ne,re,ie]=ee;return{sign:ne||"",prefix:re||"",digits:ie,radix:te}}function getRange(ee,te){switch(te){case 8:return ee?[0,255]:[-128,127];case 16:return ee?[0,65535]:[-32768,32767];case 32:return ee?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function getInvalidDigits(ee){switch(ee){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}function getRadix(ee,te){if(te&NumberStyles.AllowHexSpecifier)return 16;switch(ee){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}function isValid(ee,te,ne){const ie=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(ee.replace(/_/g,""));if(ie!=null){const[,,se,oe]=ie;if(ne=ne||getRadix(se,te),!getInvalidDigits(ne).test(oe))return validResponse(ie,ne)}return null}function parse$4(ee,te,ne,re,ie){const se=isValid(ee,te,ie);if(se!=null){let oe=Number.parseInt(se.sign+se.digits,se.radix);if(!Number.isNaN(oe)){const[me,he]=getRange(!0,re);!ne&&se.radix!==10&&oe>=me&&oe<=he&&(oe=oe<<32-re>>32-re);const[fe,ae]=getRange(ne,re);if(oe>=fe&&oe<=ae)return oe}}throw new Error("Input string was not in a correct format.")}function tryParse$4(ee,te,ne,re,ie){try{return ie.contents=parse$4(ee,te,ne,re),!0}catch{return!1}}var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(ee){}function Long(ee,te,ne){this.low=ee|0,this.high=te|0,this.unsigned=!!ne}Long.prototype.GetHashCode=function(){let ee=this.unsigned?1:0;return ee=(ee<<5)+ee^this.high,ee=(ee<<5)+ee^this.low,ee},Long.prototype.Equals=function(ee){return equals$1(this,ee)},Long.prototype.CompareTo=function(ee){return compare(this,ee)},Long.prototype.toString=function(ee){return toString$3(this,ee)},Long.prototype.toJSON=function(){return toString$3(this)},Long.prototype[symbol]=function(){const ee=this;return{multiply:te=>multiply(ee,te),toPrecision:te=>String(ee)+0 .toPrecision(te).substr(1),toExponential:te=>String(ee)+0 .toExponential(te).substr(1),toFixed:te=>String(ee)+0 .toFixed(te).substr(1),toHex:()=>toString$3(ee.unsigned?ee:fromBytes(toBytes(ee),!0),16)}},Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0});function isLong(ee){return(ee&&ee.__isLong__)===!0}var INT_CACHE={},UINT_CACHE={};function fromInt(ee,te){var ne,re,ie;return te?(ee>>>=0,(ie=0<=ee&&ee<256)&&(re=UINT_CACHE[ee],re)?re:(ne=fromBits(ee,(ee|0)<0?-1:0,!0),ie&&(UINT_CACHE[ee]=ne),ne)):(ee|=0,(ie=-128<=ee&&ee<128)&&(re=INT_CACHE[ee],re)?re:(ne=fromBits(ee,ee<0?-1:0,!1),ie&&(INT_CACHE[ee]=ne),ne))}function fromNumber(ee,te){if(isNaN(ee))return te?UZERO:ZERO;if(te){if(ee<0)return UZERO;if(ee>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(ee<=-TWO_PWR_63_DBL)return MIN_VALUE;if(ee+1>=TWO_PWR_63_DBL)return MAX_VALUE}return ee<0?negate(fromNumber(-ee,te)):fromBits(ee%TWO_PWR_32_DBL|0,ee/TWO_PWR_32_DBL|0,te)}function fromBits(ee,te,ne){return new Long(ee,te,ne)}var pow_dbl=Math.pow;function fromString$1(ee,te,ne){if(ee.length===0)throw Error("empty string");if(ee==="NaN"||ee==="Infinity"||ee==="+Infinity"||ee==="-Infinity")return ZERO;if(typeof te=="number"?(ne=te,te=!1):te=!!te,ne=ne||10,ne<2||36<ne)throw RangeError("radix");var re=ee.indexOf("-");if(re>0)throw Error("interior hyphen");if(re===0)return negate(fromString$1(ee.substring(1),te,ne));for(var ie=fromNumber(pow_dbl(ne,8)),se=ZERO,oe=0;oe<ee.length;oe+=8){var me=Math.min(8,ee.length-oe),he=parseInt(ee.substring(oe,oe+me),ne);if(me<8){var fe=fromNumber(pow_dbl(ne,me));se=add$3(multiply(se,fe),fromNumber(he))}else se=multiply(se,ie),se=add$3(se,fromNumber(he))}return se.unsigned=te,se}function fromValue$1(ee,te){return typeof ee=="number"?fromNumber(ee,te):typeof ee=="string"?fromString$1(ee,te):fromBits(ee.low,ee.high,typeof te=="boolean"?te:ee.unsigned)}var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0),UZERO=fromInt(0,!0),ONE=fromInt(1),UONE=fromInt(1,!0),NEG_ONE=fromInt(-1),MAX_VALUE=fromBits(-1,2147483647,!1),MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0),MIN_VALUE=fromBits(0,-2147483648,!1);function toInt(ee){return ee.unsigned?ee.low>>>0:ee.low}function toNumber$1(ee){return ee.unsigned?(ee.high>>>0)*TWO_PWR_32_DBL+(ee.low>>>0):ee.high*TWO_PWR_32_DBL+(ee.low>>>0)}function toString$3(ee,te){if(te=te||10,te<2||36<te)throw RangeError("radix");if(isZero(ee))return"0";if(isNegative(ee))if(equals$1(ee,MIN_VALUE)){var ne=fromNumber(te),re=divide(ee,ne),ie=subtract(multiply(re,ne),ee);return toString$3(re,te)+toInt(ie).toString(te)}else return"-"+toString$3(negate(ee),te);for(var se=fromNumber(pow_dbl(te,6),ee.unsigned),oe=ee,me="";;){var he=divide(oe,se),fe=toInt(subtract(oe,multiply(he,se)))>>>0,ae=fe.toString(te);if(oe=he,isZero(oe))return ae+me;for(;ae.length<6;)ae="0"+ae;me=""+ae+me}}function isZero(ee){return ee.high===0&&ee.low===0}function isNegative(ee){return!ee.unsigned&&ee.high<0}function isOdd(ee){return(ee.low&1)===1}function equals$1(ee,te){return isLong(te)||(te=fromValue$1(te)),ee.unsigned!==te.unsigned&&ee.high>>>31===1&&te.high>>>31===1?!1:ee.high===te.high&&ee.low===te.low}function lessThan(ee,te){return compare(ee,te)<0}function greaterThan(ee,te){return compare(ee,te)>0}function greaterThanOrEqual(ee,te){return compare(ee,te)>=0}function compare(ee,te){if(isLong(te)||(te=fromValue$1(te)),equals$1(ee,te))return 0;var ne=isNegative(ee),re=isNegative(te);return ne&&!re?-1:!ne&&re?1:ee.unsigned?te.high>>>0>ee.high>>>0||te.high===ee.high&&te.low>>>0>ee.low>>>0?-1:1:isNegative(subtract(ee,te))?-1:1}function negate(ee){return!ee.unsigned&&equals$1(ee,MIN_VALUE)?MIN_VALUE:add$3(not(ee),ONE)}function add$3(ee,te){isLong(te)||(te=fromValue$1(te));var ne=ee.high>>>16,re=ee.high&65535,ie=ee.low>>>16,se=ee.low&65535,oe=te.high>>>16,me=te.high&65535,he=te.low>>>16,fe=te.low&65535,ae=0,le=0,ye=0,ve=0;return ve+=se+fe,ye+=ve>>>16,ve&=65535,ye+=ie+he,le+=ye>>>16,ye&=65535,le+=re+me,ae+=le>>>16,le&=65535,ae+=ne+oe,ae&=65535,fromBits(ye<<16|ve,ae<<16|le,ee.unsigned)}function subtract(ee,te){return isLong(te)||(te=fromValue$1(te)),add$3(ee,negate(te))}function multiply(ee,te){if(isZero(ee))return ee.unsigned?UZERO:ZERO;if(isLong(te)||(te=fromValue$1(te)),wasm){var ne=wasm.mul(ee.low,ee.high,te.low,te.high);return fromBits(ne,wasm.get_high(),ee.unsigned)}if(isZero(te))return ee.unsigned?UZERO:ZERO;if(equals$1(ee,MIN_VALUE))return isOdd(te)?MIN_VALUE:ZERO;if(equals$1(te,MIN_VALUE))return isOdd(ee)?MIN_VALUE:ZERO;if(isNegative(ee))return isNegative(te)?multiply(negate(ee),negate(te)):negate(multiply(negate(ee),te));if(isNegative(te))return negate(multiply(ee,negate(te)));if(lessThan(ee,TWO_PWR_24)&&lessThan(te,TWO_PWR_24))return fromNumber(toNumber$1(ee)*toNumber$1(te),ee.unsigned);var re=ee.high>>>16,ie=ee.high&65535,se=ee.low>>>16,oe=ee.low&65535,me=te.high>>>16,he=te.high&65535,fe=te.low>>>16,ae=te.low&65535,le=0,ye=0,ve=0,de=0;return de+=oe*ae,ve+=de>>>16,de&=65535,ve+=se*ae,ye+=ve>>>16,ve&=65535,ve+=oe*fe,ye+=ve>>>16,ve&=65535,ye+=ie*ae,le+=ye>>>16,ye&=65535,ye+=se*fe,le+=ye>>>16,ye&=65535,ye+=oe*he,le+=ye>>>16,ye&=65535,le+=re*ae+ie*fe+se*he+oe*me,le&=65535,fromBits(ve<<16|de,le<<16|ye,ee.unsigned)}function divide(ee,te){if(isLong(te)||(te=fromValue$1(te)),isZero(te))throw Error("division by zero");if(wasm){if(!ee.unsigned&&ee.high===-2147483648&&te.low===-1&&te.high===-1)return ee;var ne=(ee.unsigned?wasm.div_u:wasm.div_s)(ee.low,ee.high,te.low,te.high);return fromBits(ne,wasm.get_high(),ee.unsigned)}if(isZero(ee))return ee.unsigned?UZERO:ZERO;var re,ie,se;if(ee.unsigned){if(te.unsigned||(te=toUnsigned(te)),greaterThan(te,ee))return UZERO;if(greaterThan(te,shiftRightUnsigned(ee,1)))return UONE;se=UZERO}else{if(equals$1(ee,MIN_VALUE)){if(equals$1(te,ONE)||equals$1(te,NEG_ONE))return MIN_VALUE;if(equals$1(te,MIN_VALUE))return ONE;var oe=shiftRight(ee,1);return re=shiftLeft(divide(oe,te),1),equals$1(re,ZERO)?isNegative(te)?ONE:NEG_ONE:(ie=subtract(ee,multiply(te,re)),se=add$3(re,divide(ie,te)),se)}else if(equals$1(te,MIN_VALUE))return ee.unsigned?UZERO:ZERO;if(isNegative(ee))return isNegative(te)?divide(negate(ee),negate(te)):negate(divide(negate(ee),te));if(isNegative(te))return negate(divide(ee,negate(te)));se=ZERO}for(ie=ee;greaterThanOrEqual(ie,te);){re=Math.max(1,Math.floor(toNumber$1(ie)/toNumber$1(te)));for(var me=Math.ceil(Math.log(re)/Math.LN2),he=me<=48?1:pow_dbl(2,me-48),fe=fromNumber(re),ae=multiply(fe,te);isNegative(ae)||greaterThan(ae,ie);)re-=he,fe=fromNumber(re,ee.unsigned),ae=multiply(fe,te);isZero(fe)&&(fe=ONE),se=add$3(se,fe),ie=subtract(ie,ae)}return se}function not(ee){return fromBits(~ee.low,~ee.high,ee.unsigned)}function shiftLeft(ee,te){return isLong(te)&&(te=toInt(te)),(te&=63)===0?ee:te<32?fromBits(ee.low<<te,ee.high<<te|ee.low>>>32-te,ee.unsigned):fromBits(0,ee.low<<te-32,ee.unsigned)}function shiftRight(ee,te){return isLong(te)&&(te=toInt(te)),(te&=63)===0?ee:te<32?fromBits(ee.low>>>te|ee.high<<32-te,ee.high>>te,ee.unsigned):fromBits(ee.high>>te-32,ee.high>=0?0:-1,ee.unsigned)}function shiftRightUnsigned(ee,te){if(isLong(te)&&(te=toInt(te)),te&=63,te===0)return ee;var ne=ee.high;if(te<32){var re=ee.low;return fromBits(re>>>te|ne<<32-te,ne>>>te,ee.unsigned)}else return fromBits(te===32?ne:ne>>>te-32,0,ee.unsigned)}function toUnsigned(ee){return ee.unsigned?ee:fromBits(ee.low,ee.high,!0)}function toBytes(ee,te){return te?toBytesLE(ee):toBytesBE(ee)}function toBytesLE(ee){var te=ee.high,ne=ee.low;return[ne&255,ne>>>8&255,ne>>>16&255,ne>>>24,te&255,te>>>8&255,te>>>16&255,te>>>24]}function toBytesBE(ee){var te=ee.high,ne=ee.low;return[te>>>24,te>>>16&255,te>>>8&255,te&255,ne>>>24,ne>>>16&255,ne>>>8&255,ne&255]}function fromBytes(ee,te,ne){return ne?fromBytesLE(ee,te):fromBytesBE(ee,te)}function fromBytesLE(ee,te){return new Long(ee[0]|ee[1]<<8|ee[2]<<16|ee[3]<<24,ee[4]|ee[5]<<8|ee[6]<<16|ee[7]<<24,te)}function fromBytesBE(ee,te){return new Long(ee[4]<<24|ee[5]<<16|ee[6]<<8|ee[7],ee[0]<<24|ee[1]<<16|ee[2]<<8|ee[3],te)}const op_Division=divide,toNumber=toNumber$1;class CaseInfo{constructor(te,ne,re,ie){this.declaringType=te,this.tag=ne,this.name=re,this.fields=ie}}class TypeInfo{constructor(te,ne,re,ie,se,oe,me){this.fullname=te,this.generics=ne,this.construct=re,this.parent=ie,this.fields=se,this.cases=oe,this.enumCases=me}toString(){return fullName(this)}GetHashCode(){return getHashCode(this)}Equals(te){return equals(this,te)}}function getGenerics(ee){return ee.generics!=null?ee.generics:[]}function getHashCode(ee){const te=stringHash(ee.fullname),ne=getGenerics(ee).map(getHashCode);return combineHashCodes([te,...ne])}function equals(ee,te){return ee.fullname===""?te.fullname===""&&equalArraysWith(getRecordElements(ee),getRecordElements(te),([ne,re],[ie,se])=>ne===ie&&equals(re,se)):ee.fullname===te.fullname&&equalArraysWith(getGenerics(ee),getGenerics(te),equals)}function class_type(ee,te,ne,re){return new TypeInfo(ee,te,ne,re)}function record_type(ee,te,ne,re){return new TypeInfo(ee,te,ne,void 0,re)}function anonRecord_type(...ee){return new TypeInfo("",void 0,void 0,void 0,()=>ee)}function union_type(ee,te,ne,re){const ie=new TypeInfo(ee,te,ne,void 0,void 0,()=>{const se=ne.prototype.cases();return re().map((oe,me)=>new CaseInfo(ie,me,se[me],oe))});return ie}function list_type(ee){return new TypeInfo("Microsoft.FSharp.Collections.FSharpList`1",[ee])}const obj_type=new TypeInfo("System.Object"),string_type=new TypeInfo("System.String"),int32_type=new TypeInfo("System.Int32");function name(ee){if(Array.isArray(ee))return ee[0];if(ee instanceof TypeInfo){const te=getElementType(ee);if(te!=null)return name(te)+"[]";{const ne=ee.fullname.lastIndexOf(".");return ne===-1?ee.fullname:ee.fullname.substr(ne+1)}}else return ee.name}function fullName(ee){const te=getElementType(ee);return te!=null?fullName(te)+"[]":ee.generics==null||ee.generics.length===0?ee.fullname:ee.fullname+"["+ee.generics.map(ne=>fullName(ne)).join(",")+"]"}function isArray(ee){return getElementType(ee)!=null}function getElementType(ee){var te;return ee.fullname==="[]"&&((te=ee.generics)==null?void 0:te.length)===1?ee.generics[0]:void 0}function isGenericType(ee){return ee.generics!=null&&ee.generics.length>0}function isEnum(ee){return ee.enumCases!=null&&ee.enumCases.length>0}function getGenericTypeDefinition(ee){return ee.generics==null?ee:new TypeInfo(ee.fullname,ee.generics.map(()=>obj_type))}function getEnumUnderlyingType(ee){var te;return(te=ee.generics)==null?void 0:te[0]}function getEnumValues(ee){if(isEnum(ee)&&ee.enumCases!=null)return ee.enumCases.map(te=>te[1]);throw new Error("".concat(ee.fullname," is not an enum type"))}function getEnumCase(ee,te){if(ee.enumCases!=null)if(typeof te=="string"){for(const ne of ee.enumCases)if(ne[0]===te)return ne;throw new Error("'".concat(te,"' was not found in ").concat(ee.fullname))}else{for(const ne of ee.enumCases)if(ne[1]===te)return ne;return["",te]}else throw new Error("".concat(ee.fullname," is not an enum type"))}function parseEnum(ee,te){const ne=parseInt(te,10);return getEnumCase(ee,isNaN(ne)?te:ne)[1]}function getUnionCases(ee){if(ee.cases!=null)return ee.cases();throw new Error("".concat(ee.fullname," is not an F# union type"))}function getRecordElements(ee){if(ee.fields!=null)return ee.fields();throw new Error("".concat(ee.fullname," is not an F# record type"))}function getTupleElements(ee){if(isTuple(ee)&&ee.generics!=null)return ee.generics;throw new Error("".concat(ee.fullname," is not a tuple type"))}function isUnion(ee){return ee instanceof TypeInfo?ee.cases!=null:ee instanceof Union}function isRecord(ee){return ee instanceof TypeInfo?ee.fields!=null:ee instanceof Record}function isTuple(ee){return ee.fullname.startsWith("System.Tuple")}function getUnionFields(ee,te){const re=getUnionCases(te)[ee.tag];if(re==null)throw new Error("Cannot find case ".concat(ee.name," in union type"));return[re,ee.fields]}function getUnionCaseFields(ee){return ee.fields==null?[]:ee.fields}function getRecordField(ee,te){return ee[te[0]]}function getTupleFields(ee){return ee}function makeUnion$1(ee,te){const ne=(ee.fields||[]).length;if(te.length!==ne)throw new Error("Expected an array of length ".concat(ne," but got ").concat(te.length));return ee.declaringType.construct!=null?new ee.declaringType.construct(ee.tag,te):{}}function makeRecord(ee,te){const ne=getRecordElements(ee);if(ne.length!==te.length)throw new Error("Expected an array of length ".concat(ne.length," but got ").concat(te.length));return ee.construct!=null?new ee.construct(...te):ne.reduce((re,[ie,se],oe)=>(re[ie]=te[oe],re),{})}function makeTuple(ee,te){return ee}var n$1,l$3,u$3,i$2,o$1,r$4,f$1,e$2,c$2={},s$2=[],a$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h$2=Array.isArray;function v$1(ee,te){for(var ne in te)ee[ne]=te[ne];return ee}function p$2(ee){var te=ee.parentNode;te&&te.removeChild(ee)}function y$1(ee,te,ne){var re,ie,se,oe={};for(se in te)se=="key"?re=te[se]:se=="ref"?ie=te[se]:oe[se]=te[se];if(arguments.length>2&&(oe.children=arguments.length>3?n$1.call(arguments,2):ne),typeof ee=="function"&&ee.defaultProps!=null)for(se in ee.defaultProps)oe[se]===void 0&&(oe[se]=ee.defaultProps[se]);return d$1(ee,oe,re,ie,null)}function d$1(ee,te,ne,re,ie){var se={type:ee,props:te,key:ne,ref:re,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:ie==null?++u$3:ie};return ie==null&&l$3.vnode!=null&&l$3.vnode(se),se}function _$1(){return{current:null}}function k$3(ee){return ee.children}function b$1(ee,te){this.props=ee,this.context=te}function g$2(ee,te){if(te==null)return ee.__?g$2(ee.__,ee.__.__k.indexOf(ee)+1):null;for(var ne;te<ee.__k.length;te++)if((ne=ee.__k[te])!=null&&ne.__e!=null)return ne.__e;return typeof ee.type=="function"?g$2(ee):null}function m$2(ee){var te,ne;if((ee=ee.__)!=null&&ee.__c!=null){for(ee.__e=ee.__c.base=null,te=0;te<ee.__k.length;te++)if((ne=ee.__k[te])!=null&&ne.__e!=null){ee.__e=ee.__c.base=ne.__e;break}return m$2(ee)}}function w$2(ee){(!ee.__d&&(ee.__d=!0)&&i$2.push(ee)&&!x$2.__r++||o$1!==l$3.debounceRendering)&&((o$1=l$3.debounceRendering)||r$4)(x$2)}function x$2(){var ee,te,ne,re,ie,se,oe,me,he;for(i$2.sort(f$1);ee=i$2.shift();)ee.__d&&(te=i$2.length,re=void 0,ie=void 0,se=void 0,me=(oe=(ne=ee).__v).__e,(he=ne.__P)&&(re=[],ie=[],(se=v$1({},oe)).__v=oe.__v+1,L$1(he,oe,se,ne.__n,he.ownerSVGElement!==void 0,oe.__h!=null?[me]:null,re,me==null?g$2(oe):me,oe.__h,ie),M$1(re,oe,ie),oe.__e!=me&&m$2(oe)),i$2.length>te&&i$2.sort(f$1));x$2.__r=0}function P$2(ee,te,ne,re,ie,se,oe,me,he,fe,ae){var le,ye,ve,de,ge,ue,Te,$e,ke,Ce,ce=0,be=re&&re.__k||s$2,we=be.length,_e=we,Ee=te.length;for(ne.__k=[],le=0;le<Ee;le++)(de=ne.__k[le]=(de=te[le])==null||typeof de=="boolean"||typeof de=="function"?null:typeof de=="string"||typeof de=="number"||typeof de=="bigint"?d$1(null,de,null,null,de):h$2(de)?d$1(k$3,{children:de},null,null,null):de.__b>0?d$1(de.type,de.props,de.key,de.ref?de.ref:null,de.__v):de)!=null&&(de.__=ne,de.__b=ne.__b+1,($e=A$2(de,be,Te=le+ce,_e))===-1?ve=c$2:(ve=be[$e]||c$2,be[$e]=void 0,_e--),L$1(ee,de,ve,ie,se,oe,me,he,fe,ae),ge=de.__e,(ye=de.ref)&&ve.ref!=ye&&(ve.ref&&O$1(ve.ref,null,de),ae.push(ye,de.__c||ge,de)),ge!=null&&(ue==null&&(ue=ge),Ce=!(ke=ve===c$2||ve.__v===null)&&$e===Te,ke?$e==-1&&ce--:$e!==Te&&($e===Te+1?(ce++,Ce=!0):$e>Te?_e>Ee-Te?(ce+=$e-Te,Ce=!0):ce--:ce=$e<Te&&$e==Te-1?$e-Te:0),Te=le+ce,Ce=Ce||$e==le&&!ke,typeof de.type!="function"||$e===Te&&ve.__k!==de.__k?typeof de.type=="function"||Ce?de.__d!==void 0?(he=de.__d,de.__d=void 0):he=ge.nextSibling:he=$$1(ee,ge,he):he=C$1(de,he,ee),typeof ne.type=="function"&&(ne.__d=he)));for(ne.__e=ue,le=we;le--;)be[le]!=null&&(typeof ne.type=="function"&&be[le].__e!=null&&be[le].__e==ne.__d&&(ne.__d=be[le].__e.nextSibling),q$3(be[le],be[le]))}function C$1(ee,te,ne){for(var re,ie=ee.__k,se=0;ie&&se<ie.length;se++)(re=ie[se])&&(re.__=ee,te=typeof re.type=="function"?C$1(re,te,ne):$$1(ne,re.__e,te));return te}function S(ee,te){return te=te||[],ee==null||typeof ee=="boolean"||(h$2(ee)?ee.some(function(ne){S(ne,te)}):te.push(ee)),te}function $$1(ee,te,ne){return ne==null||ne.parentNode!==ee?ee.insertBefore(te,null):te==ne&&te.parentNode!=null||ee.insertBefore(te,ne),te.nextSibling}function A$2(ee,te,ne,re){var ie=ee.key,se=ee.type,oe=ne-1,me=ne+1,he=te[ne];if(he===null||he&&ie==he.key&&se===he.type)return ne;if(re>(he!=null?1:0))for(;oe>=0||me<te.length;){if(oe>=0){if((he=te[oe])&&ie==he.key&&se===he.type)return oe;oe--}if(me<te.length){if((he=te[me])&&ie==he.key&&se===he.type)return me;me++}}return-1}function H$1(ee,te,ne,re,ie){var se;for(se in ne)se==="children"||se==="key"||se in te||T$2(ee,se,null,ne[se],re);for(se in te)ie&&typeof te[se]!="function"||se==="children"||se==="key"||se==="value"||se==="checked"||ne[se]===te[se]||T$2(ee,se,te[se],ne[se],re)}function I$1(ee,te,ne){te[0]==="-"?ee.setProperty(te,ne==null?"":ne):ee[te]=ne==null?"":typeof ne!="number"||a$2.test(te)?ne:ne+"px"}function T$2(ee,te,ne,re,ie){var se;e:if(te==="style")if(typeof ne=="string")ee.style.cssText=ne;else{if(typeof re=="string"&&(ee.style.cssText=re=""),re)for(te in re)ne&&te in ne||I$1(ee.style,te,"");if(ne)for(te in ne)re&&ne[te]===re[te]||I$1(ee.style,te,ne[te])}else if(te[0]==="o"&&te[1]==="n")se=te!==(te=te.replace(/Capture$/,"")),te=te.toLowerCase()in ee?te.toLowerCase().slice(2):te.slice(2),ee.l||(ee.l={}),ee.l[te+se]=ne,ne?re||ee.addEventListener(te,se?z$2:j$2,se):ee.removeEventListener(te,se?z$2:j$2,se);else if(te!=="dangerouslySetInnerHTML"){if(ie)te=te.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(te!=="width"&&te!=="height"&&te!=="href"&&te!=="list"&&te!=="form"&&te!=="tabIndex"&&te!=="download"&&te!=="rowSpan"&&te!=="colSpan"&&te in ee)try{ee[te]=ne==null?"":ne;break e}catch{}typeof ne=="function"||(ne==null||ne===!1&&te[4]!=="-"?ee.removeAttribute(te):ee.setAttribute(te,ne))}}function j$2(ee){return this.l[ee.type+!1](l$3.event?l$3.event(ee):ee)}function z$2(ee){return this.l[ee.type+!0](l$3.event?l$3.event(ee):ee)}function L$1(ee,te,ne,re,ie,se,oe,me,he,fe){var ae,le,ye,ve,de,ge,ue,Te,$e,ke,Ce,ce,be,we,_e,Ee=te.type;if(te.constructor!==void 0)return null;ne.__h!=null&&(he=ne.__h,me=te.__e=ne.__e,te.__h=null,se=[me]),(ae=l$3.__b)&&ae(te);try{e:if(typeof Ee=="function"){if(Te=te.props,$e=(ae=Ee.contextType)&&re[ae.__c],ke=ae?$e?$e.props.value:ae.__:re,ne.__c?ue=(le=te.__c=ne.__c).__=le.__E:("prototype"in Ee&&Ee.prototype.render?te.__c=le=new Ee(Te,ke):(te.__c=le=new b$1(Te,ke),le.constructor=Ee,le.render=B$2),$e&&$e.sub(le),le.props=Te,le.state||(le.state={}),le.context=ke,le.__n=re,ye=le.__d=!0,le.__h=[],le._sb=[]),le.__s==null&&(le.__s=le.state),Ee.getDerivedStateFromProps!=null&&(le.__s==le.state&&(le.__s=v$1({},le.__s)),v$1(le.__s,Ee.getDerivedStateFromProps(Te,le.__s))),ve=le.props,de=le.state,le.__v=te,ye)Ee.getDerivedStateFromProps==null&&le.componentWillMount!=null&&le.componentWillMount(),le.componentDidMount!=null&&le.__h.push(le.componentDidMount);else{if(Ee.getDerivedStateFromProps==null&&Te!==ve&&le.componentWillReceiveProps!=null&&le.componentWillReceiveProps(Te,ke),!le.__e&&(le.shouldComponentUpdate!=null&&le.shouldComponentUpdate(Te,le.__s,ke)===!1||te.__v===ne.__v)){for(te.__v!==ne.__v&&(le.props=Te,le.state=le.__s,le.__d=!1),te.__e=ne.__e,te.__k=ne.__k,te.__k.forEach(function(De){De&&(De.__=te)}),Ce=0;Ce<le._sb.length;Ce++)le.__h.push(le._sb[Ce]);le._sb=[],le.__h.length&&oe.push(le);break e}le.componentWillUpdate!=null&&le.componentWillUpdate(Te,le.__s,ke),le.componentDidUpdate!=null&&le.__h.push(function(){le.componentDidUpdate(ve,de,ge)})}if(le.context=ke,le.props=Te,le.__P=ee,le.__e=!1,ce=l$3.__r,be=0,"prototype"in Ee&&Ee.prototype.render){for(le.state=le.__s,le.__d=!1,ce&&ce(te),ae=le.render(le.props,le.state,le.context),we=0;we<le._sb.length;we++)le.__h.push(le._sb[we]);le._sb=[]}else do le.__d=!1,ce&&ce(te),ae=le.render(le.props,le.state,le.context),le.state=le.__s;while(le.__d&&++be<25);le.state=le.__s,le.getChildContext!=null&&(re=v$1(v$1({},re),le.getChildContext())),ye||le.getSnapshotBeforeUpdate==null||(ge=le.getSnapshotBeforeUpdate(ve,de)),P$2(ee,h$2(_e=ae!=null&&ae.type===k$3&&ae.key==null?ae.props.children:ae)?_e:[_e],te,ne,re,ie,se,oe,me,he,fe),le.base=te.__e,te.__h=null,le.__h.length&&oe.push(le),ue&&(le.__E=le.__=null)}else se==null&&te.__v===ne.__v?(te.__k=ne.__k,te.__e=ne.__e):te.__e=N$1(ne.__e,te,ne,re,ie,se,oe,he,fe);(ae=l$3.diffed)&&ae(te)}catch(De){te.__v=null,(he||se!=null)&&(te.__e=me,te.__h=!!he,se[se.indexOf(me)]=null),l$3.__e(De,te,ne)}}function M$1(ee,te,ne){for(var re=0;re<ne.length;re++)O$1(ne[re],ne[++re],ne[++re]);l$3.__c&&l$3.__c(te,ee),ee.some(function(ie){try{ee=ie.__h,ie.__h=[],ee.some(function(se){se.call(ie)})}catch(se){l$3.__e(se,ie.__v)}})}function N$1(ee,te,ne,re,ie,se,oe,me,he){var fe,ae,le,ye=ne.props,ve=te.props,de=te.type,ge=0;if(de==="svg"&&(ie=!0),se!=null){for(;ge<se.length;ge++)if((fe=se[ge])&&"setAttribute"in fe==!!de&&(de?fe.localName===de:fe.nodeType===3)){ee=fe,se[ge]=null;break}}if(ee==null){if(de===null)return document.createTextNode(ve);ee=ie?document.createElementNS("http://www.w3.org/2000/svg",de):document.createElement(de,ve.is&&ve),se=null,me=!1}if(de===null)ye===ve||me&&ee.data===ve||(ee.data=ve);else{if(se=se&&n$1.call(ee.childNodes),ae=(ye=ne.props||c$2).dangerouslySetInnerHTML,le=ve.dangerouslySetInnerHTML,!me){if(se!=null)for(ye={},ge=0;ge<ee.attributes.length;ge++)ye[ee.attributes[ge].name]=ee.attributes[ge].value;(le||ae)&&(le&&(ae&&le.__html==ae.__html||le.__html===ee.innerHTML)||(ee.innerHTML=le&&le.__html||""))}if(H$1(ee,ve,ye,ie,me),le)te.__k=[];else if(P$2(ee,h$2(ge=te.props.children)?ge:[ge],te,ne,re,ie&&de!=="foreignObject",se,oe,se?se[0]:ne.__k&&g$2(ne,0),me,he),se!=null)for(ge=se.length;ge--;)se[ge]!=null&&p$2(se[ge]);me||("value"in ve&&(ge=ve.value)!==void 0&&(ge!==ee.value||de==="progress"&&!ge||de==="option"&&ge!==ye.value)&&T$2(ee,"value",ge,ye.value,!1),"checked"in ve&&(ge=ve.checked)!==void 0&&ge!==ee.checked&&T$2(ee,"checked",ge,ye.checked,!1))}return ee}function O$1(ee,te,ne){try{typeof ee=="function"?ee(te):ee.current=te}catch(re){l$3.__e(re,ne)}}function q$3(ee,te,ne){var re,ie;if(l$3.unmount&&l$3.unmount(ee),(re=ee.ref)&&(re.current&&re.current!==ee.__e||O$1(re,null,te)),(re=ee.__c)!=null){if(re.componentWillUnmount)try{re.componentWillUnmount()}catch(se){l$3.__e(se,te)}re.base=re.__P=null,ee.__c=void 0}if(re=ee.__k)for(ie=0;ie<re.length;ie++)re[ie]&&q$3(re[ie],te,ne||typeof ee.type!="function");ne||ee.__e==null||p$2(ee.__e),ee.__=ee.__e=ee.__d=void 0}function B$2(ee,te,ne){return this.constructor(ee,ne)}function D$1(ee,te,ne){var re,ie,se,oe;l$3.__&&l$3.__(ee,te),ie=(re=typeof ne=="function")?null:ne&&ne.__k||te.__k,se=[],oe=[],L$1(te,ee=(!re&&ne||te).__k=y$1(k$3,null,[ee]),ie||c$2,c$2,te.ownerSVGElement!==void 0,!re&&ne?[ne]:ie?null:te.firstChild?n$1.call(te.childNodes):null,se,!re&&ne?ne:ie?ie.__e:te.firstChild,re,oe),M$1(se,ee,oe)}function E$1(ee,te){D$1(ee,te,E$1)}function F$2(ee,te,ne){var re,ie,se,oe,me=v$1({},ee.props);for(se in ee.type&&ee.type.defaultProps&&(oe=ee.type.defaultProps),te)se=="key"?re=te[se]:se=="ref"?ie=te[se]:me[se]=te[se]===void 0&&oe!==void 0?oe[se]:te[se];return arguments.length>2&&(me.children=arguments.length>3?n$1.call(arguments,2):ne),d$1(ee.type,me,re||ee.key,ie||ee.ref,null)}function G$1(ee,te){var ne={__c:te="__cC"+e$2++,__:ee,Consumer:function(re,ie){return re.children(ie)},Provider:function(re){var ie,se;return this.getChildContext||(ie=[],(se={})[te]=this,this.getChildContext=function(){return se},this.shouldComponentUpdate=function(oe){this.props.value!==oe.value&&ie.some(function(me){me.__e=!0,w$2(me)})},this.sub=function(oe){ie.push(oe);var me=oe.componentWillUnmount;oe.componentWillUnmount=function(){ie.splice(ie.indexOf(oe),1),me&&me.call(oe)}}),re.children}};return ne.Provider.__=ne.Consumer.contextType=ne}n$1=s$2.slice,l$3={__e:function(ee,te,ne,re){for(var ie,se,oe;te=te.__;)if((ie=te.__c)&&!ie.__)try{if((se=ie.constructor)&&se.getDerivedStateFromError!=null&&(ie.setState(se.getDerivedStateFromError(ee)),oe=ie.__d),ie.componentDidCatch!=null&&(ie.componentDidCatch(ee,re||{}),oe=ie.__d),oe)return ie.__E=ie}catch(me){ee=me}throw ee}},u$3=0,b$1.prototype.setState=function(ee,te){var ne;ne=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=v$1({},this.state),typeof ee=="function"&&(ee=ee(v$1({},ne),this.props)),ee&&v$1(ne,ee),ee!=null&&this.__v&&(te&&this._sb.push(te),w$2(this))},b$1.prototype.forceUpdate=function(ee){this.__v&&(this.__e=!0,ee&&this.__h.push(ee),w$2(this))},b$1.prototype.render=k$3,i$2=[],r$4=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(ee,te){return ee.__v.__b-te.__v.__b},x$2.__r=0,e$2=0;var t$1,r$3,u$2,i$1,o=0,f=[],c$1=[],e$1=l$3.__b,a$1=l$3.__r,v=l$3.diffed,l$2=l$3.__c,m$1=l$3.unmount;function d(ee,te){l$3.__h&&l$3.__h(r$3,ee,o||te),o=0;var ne=r$3.__H||(r$3.__H={__:[],__h:[]});return ee>=ne.__.length&&ne.__.push({__V:c$1}),ne.__[ee]}function h$1(ee){return o=1,s$1(B$1,ee)}function s$1(ee,te,ne){var re=d(t$1++,2);if(re.t=ee,!re.__c&&(re.__=[ne?ne(te):B$1(void 0,te),function(me){var he=re.__N?re.__N[0]:re.__[0],fe=re.t(he,me);he!==fe&&(re.__N=[fe,re.__[1]],re.__c.setState({}))}],re.__c=r$3,!r$3.u)){var ie=function(me,he,fe){if(!re.__c.__H)return!0;var ae=re.__c.__H.__.filter(function(ye){return ye.__c});if(ae.every(function(ye){return!ye.__N}))return!se||se.call(this,me,he,fe);var le=!1;return ae.forEach(function(ye){if(ye.__N){var ve=ye.__[0];ye.__=ye.__N,ye.__N=void 0,ve!==ye.__[0]&&(le=!0)}}),!(!le&&re.__c.props===me)&&(!se||se.call(this,me,he,fe))};r$3.u=!0;var se=r$3.shouldComponentUpdate,oe=r$3.componentWillUpdate;r$3.componentWillUpdate=function(me,he,fe){if(this.__e){var ae=se;se=void 0,ie(me,he,fe),se=ae}oe&&oe.call(this,me,he,fe)},r$3.shouldComponentUpdate=ie}return re.__N||re.__}function p$1(ee,te){var ne=d(t$1++,3);!l$3.__s&&z$1(ne.__H,te)&&(ne.__=ee,ne.i=te,r$3.__H.__h.push(ne))}function y(ee,te){var ne=d(t$1++,4);!l$3.__s&&z$1(ne.__H,te)&&(ne.__=ee,ne.i=te,r$3.__h.push(ne))}function _(ee){return o=5,F$1(function(){return{current:ee}},[])}function A$1(ee,te,ne){o=6,y(function(){return typeof ee=="function"?(ee(te()),function(){return ee(null)}):ee?(ee.current=te(),function(){return ee.current=null}):void 0},ne==null?ne:ne.concat(ee))}function F$1(ee,te){var ne=d(t$1++,7);return z$1(ne.__H,te)?(ne.__V=ee(),ne.i=te,ne.__h=ee,ne.__V):ne.__}function T$1(ee,te){return o=8,F$1(function(){return ee},te)}function q$2(ee){var te=r$3.context[ee.__c],ne=d(t$1++,9);return ne.c=ee,te?(ne.__==null&&(ne.__=!0,te.sub(r$3)),te.props.value):ee.__}function x$1(ee,te){l$3.useDebugValue&&l$3.useDebugValue(te?te(ee):ee)}function P$1(ee){var te=d(t$1++,10),ne=h$1();return te.__=ee,r$3.componentDidCatch||(r$3.componentDidCatch=function(re,ie){te.__&&te.__(re,ie),ne[1](re)}),[ne[0],function(){ne[1](void 0)}]}function V$1(){var ee=d(t$1++,11);if(!ee.__){for(var te=r$3.__v;te!==null&&!te.__m&&te.__!==null;)te=te.__;var ne=te.__m||(te.__m=[0,0]);ee.__="P"+ne[0]+"-"+ne[1]++}return ee.__}function b(){for(var ee;ee=f.shift();)if(ee.__P&&ee.__H)try{ee.__H.__h.forEach(k$2),ee.__H.__h.forEach(w$1),ee.__H.__h=[]}catch(te){ee.__H.__h=[],l$3.__e(te,ee.__v)}}l$3.__b=function(ee){r$3=null,e$1&&e$1(ee)},l$3.__r=function(ee){a$1&&a$1(ee),t$1=0;var te=(r$3=ee.__c).__H;te&&(u$2===r$3?(te.__h=[],r$3.__h=[],te.__.forEach(function(ne){ne.__N&&(ne.__=ne.__N),ne.__V=c$1,ne.__N=ne.i=void 0})):(te.__h.forEach(k$2),te.__h.forEach(w$1),te.__h=[],t$1=0)),u$2=r$3},l$3.diffed=function(ee){v&&v(ee);var te=ee.__c;te&&te.__H&&(te.__H.__h.length&&(f.push(te)!==1&&i$1===l$3.requestAnimationFrame||((i$1=l$3.requestAnimationFrame)||j$1)(b)),te.__H.__.forEach(function(ne){ne.i&&(ne.__H=ne.i),ne.__V!==c$1&&(ne.__=ne.__V),ne.i=void 0,ne.__V=c$1})),u$2=r$3=null},l$3.__c=function(ee,te){te.some(function(ne){try{ne.__h.forEach(k$2),ne.__h=ne.__h.filter(function(re){return!re.__||w$1(re)})}catch(re){te.some(function(ie){ie.__h&&(ie.__h=[])}),te=[],l$3.__e(re,ne.__v)}}),l$2&&l$2(ee,te)},l$3.unmount=function(ee){m$1&&m$1(ee);var te,ne=ee.__c;ne&&ne.__H&&(ne.__H.__.forEach(function(re){try{k$2(re)}catch(ie){te=ie}}),ne.__H=void 0,te&&l$3.__e(te,ne.__v))};var g$1=typeof requestAnimationFrame=="function";function j$1(ee){var te,ne=function(){clearTimeout(re),g$1&&cancelAnimationFrame(te),setTimeout(ee)},re=setTimeout(ne,100);g$1&&(te=requestAnimationFrame(ne))}function k$2(ee){var te=r$3,ne=ee.__c;typeof ne=="function"&&(ee.__c=void 0,ne()),r$3=te}function w$1(ee){var te=r$3;ee.__c=ee.__(),r$3=te}function z$1(ee,te){return!ee||ee.length!==te.length||te.some(function(ne,re){return ne!==ee[re]})}function B$1(ee,te){return typeof te=="function"?te(ee):te}function g(ee,te){for(var ne in te)ee[ne]=te[ne];return ee}function C(ee,te){for(var ne in ee)if(ne!=="__source"&&!(ne in te))return!0;for(var re in te)if(re!=="__source"&&ee[re]!==te[re])return!0;return!1}function E(ee,te){return ee===te&&(ee!==0||1/ee==1/te)||ee!=ee&&te!=te}function w(ee){this.props=ee}function x(ee,te){function ne(ie){var se=this.props.ref,oe=se==ie.ref;return!oe&&se&&(se.call?se(null):se.current=null),te?!te(this.props,ie)||!oe:C(this.props,ie)}function re(ie){return this.shouldComponentUpdate=ne,y$1(ee,ie)}return re.displayName="Memo("+(ee.displayName||ee.name)+")",re.prototype.isReactComponent=!0,re.__f=!0,re}(w.prototype=new b$1).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(ee,te){return C(this.props,ee)||C(this.state,te)};var R=l$3.__b;l$3.__b=function(ee){ee.type&&ee.type.__f&&ee.ref&&(ee.props.ref=ee.ref,ee.ref=null),R&&R(ee)};var N=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k$1(ee){function te(ne){var re=g({},ne);return delete re.ref,ee(re,ne.ref||null)}return te.$$typeof=N,te.render=te,te.prototype.isReactComponent=te.__f=!0,te.displayName="ForwardRef("+(ee.displayName||ee.name)+")",te}var A=function(ee,te){return ee==null?null:S(S(ee).map(te))},O={map:A,forEach:A,count:function(ee){return ee?S(ee).length:0},only:function(ee){var te=S(ee);if(te.length!==1)throw"Children.only";return te[0]},toArray:S},T=l$3.__e;l$3.__e=function(ee,te,ne,re){if(ee.then){for(var ie,se=te;se=se.__;)if((ie=se.__c)&&ie.__c)return te.__e==null&&(te.__e=ne.__e,te.__k=ne.__k),ie.__c(ee,te)}T(ee,te,ne,re)};var I=l$3.unmount;function L(ee,te,ne){return ee&&(ee.__c&&ee.__c.__H&&(ee.__c.__H.__.forEach(function(re){typeof re.__c=="function"&&re.__c()}),ee.__c.__H=null),(ee=g({},ee)).__c!=null&&(ee.__c.__P===ne&&(ee.__c.__P=te),ee.__c=null),ee.__k=ee.__k&&ee.__k.map(function(re){return L(re,te,ne)})),ee}function U(ee,te,ne){return ee&&(ee.__v=null,ee.__k=ee.__k&&ee.__k.map(function(re){return U(re,te,ne)}),ee.__c&&ee.__c.__P===te&&(ee.__e&&ne.insertBefore(ee.__e,ee.__d),ee.__c.__e=!0,ee.__c.__P=ne)),ee}function D(){this.__u=0,this.t=null,this.__b=null}function F(ee){var te=ee.__.__c;return te&&te.__a&&te.__a(ee)}function M(ee){var te,ne,re;function ie(se){if(te||(te=ee()).then(function(oe){ne=oe.default||oe},function(oe){re=oe}),re)throw re;if(!ne)throw te;return y$1(ne,se)}return ie.displayName="Lazy",ie.__f=!0,ie}function V(){this.u=null,this.o=null}l$3.unmount=function(ee){var te=ee.__c;te&&te.__R&&te.__R(),te&&ee.__h===!0&&(ee.type=null),I&&I(ee)},(D.prototype=new b$1).__c=function(ee,te){var ne=te.__c,re=this;re.t==null&&(re.t=[]),re.t.push(ne);var ie=F(re.__v),se=!1,oe=function(){se||(se=!0,ne.__R=null,ie?ie(me):me())};ne.__R=oe;var me=function(){if(!--re.__u){if(re.state.__a){var fe=re.state.__a;re.__v.__k[0]=U(fe,fe.__c.__P,fe.__c.__O)}var ae;for(re.setState({__a:re.__b=null});ae=re.t.pop();)ae.forceUpdate()}},he=te.__h===!0;re.__u++||he||re.setState({__a:re.__b=re.__v.__k[0]}),ee.then(oe,oe)},D.prototype.componentWillUnmount=function(){this.t=[]},D.prototype.render=function(ee,te){if(this.__b){if(this.__v.__k){var ne=document.createElement("div"),re=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,ne,re.__O=re.__P)}this.__b=null}var ie=te.__a&&y$1(k$3,null,ee.fallback);return ie&&(ie.__h=null),[y$1(k$3,null,te.__a?null:ee.children),ie]};var W=function(ee,te,ne){if(++ne[1]===ne[0]&&ee.o.delete(te),ee.props.revealOrder&&(ee.props.revealOrder[0]!=="t"||!ee.o.size))for(ne=ee.u;ne;){for(;ne.length>3;)ne.pop()();if(ne[1]<ne[0])break;ee.u=ne=ne[2]}};function P(ee){return this.getChildContext=function(){return ee.context},ee.children}function j(ee){var te=this,ne=ee.i;te.componentWillUnmount=function(){D$1(null,te.l),te.l=null,te.i=null},te.i&&te.i!==ne&&te.componentWillUnmount(),ee.__v?(te.l||(te.i=ne,te.l={nodeType:1,parentNode:ne,childNodes:[],appendChild:function(re){this.childNodes.push(re),te.i.appendChild(re)},insertBefore:function(re,ie){this.childNodes.push(re),te.i.appendChild(re)},removeChild:function(re){this.childNodes.splice(this.childNodes.indexOf(re)>>>1,1),te.i.removeChild(re)}}),D$1(y$1(P,{context:te.context},ee.__v),te.l)):te.l&&te.componentWillUnmount()}function z(ee,te){var ne=y$1(j,{__v:ee,i:te});return ne.containerInfo=te,ne}(V.prototype=new b$1).__a=function(ee){var te=this,ne=F(te.__v),re=te.o.get(ee);return re[0]++,function(ie){var se=function(){te.props.revealOrder?(re.push(ie),W(te,ee,re)):ie()};ne?ne(se):se()}},V.prototype.render=function(ee){this.u=null,this.o=new Map;var te=S(ee.children);ee.revealOrder&&ee.revealOrder[0]==="b"&&te.reverse();for(var ne=te.length;ne--;)this.o.set(te[ne],this.u=[1,0,this.u]);return ee.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var ee=this;this.o.forEach(function(te,ne){W(ee,ne,te)})};var B=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$=typeof document<"u",q$1=function(ee){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(ee)};function G(ee,te,ne){return te.__k==null&&(te.textContent=""),D$1(ee,te),typeof ne=="function"&&ne(),ee?ee.__c:null}function J(ee,te,ne){return E$1(ee,te),typeof ne=="function"&&ne(),ee?ee.__c:null}b$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(ee){Object.defineProperty(b$1.prototype,ee,{configurable:!0,get:function(){return this["UNSAFE_"+ee]},set:function(te){Object.defineProperty(this,ee,{configurable:!0,writable:!0,value:te})}})});var K=l$3.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}l$3.event=function(ee){return K&&(ee=K(ee)),ee.persist=Q,ee.isPropagationStopped=X,ee.isDefaultPrevented=nn,ee.nativeEvent=ee};var tn,en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=l$3.vnode;l$3.vnode=function(ee){typeof ee.type=="string"&&function(te){var ne=te.props,re=te.type,ie={};for(var se in ne){var oe=ne[se];if(!(se==="value"&&"defaultValue"in ne&&oe==null||$&&se==="children"&&re==="noscript"||se==="class"||se==="className")){var me=se.toLowerCase();se==="defaultValue"&&"value"in ne&&ne.value==null?se="value":se==="download"&&oe===!0?oe="":me==="ondoubleclick"?se="ondblclick":me!=="onchange"||re!=="input"&&re!=="textarea"||q$1(ne.type)?me==="onfocus"?se="onfocusin":me==="onblur"?se="onfocusout":Z.test(se)?se=me:re.indexOf("-")===-1&&H.test(se)?se=se.replace(Y,"-$&").toLowerCase():oe===null&&(oe=void 0):me=se="oninput",me==="oninput"&&ie[se=me]&&(se="oninputCapture"),ie[se]=oe}}re=="select"&&ie.multiple&&Array.isArray(ie.value)&&(ie.value=S(ne.children).forEach(function(he){he.props.selected=ie.value.indexOf(he.props.value)!=-1})),re=="select"&&ie.defaultValue!=null&&(ie.value=S(ne.children).forEach(function(he){he.props.selected=ie.multiple?ie.defaultValue.indexOf(he.props.value)!=-1:ie.defaultValue==he.props.value})),ne.class&&!ne.className?(ie.class=ne.class,Object.defineProperty(ie,"className",en)):(ne.className&&!ne.class||ne.class&&ne.className)&&(ie.class=ie.className=ne.className),te.props=ie}(ee),ee.$$typeof=B,rn&&rn(ee)};var un=l$3.__r;l$3.__r=function(ee){un&&un(ee),tn=ee.__c};var on=l$3.diffed;l$3.diffed=function(ee){on&&on(ee);var te=ee.props,ne=ee.__e;ne!=null&&ee.type==="textarea"&&"value"in te&&te.value!==ne.value&&(ne.value=te.value==null?"":te.value),tn=null};var ln={ReactCurrentDispatcher:{current:{readContext:function(ee){return tn.__n[ee.__c].props.value}}}},cn="17.0.2";function fn(ee){return y$1.bind(null,ee)}function an(ee){return!!ee&&ee.$$typeof===B}function sn(ee){return an(ee)?F$2.apply(null,arguments):ee}function hn(ee){return!!ee.__k&&(D$1(null,ee),!0)}function vn(ee){return ee&&(ee.base||ee.nodeType===1&&ee)||null}var dn=function(ee,te){return ee(te)},pn=function(ee,te){return ee(te)},mn=k$3;function yn(ee){ee()}function _n(ee){return ee}function bn(){return[!1,yn]}var Sn=y;function gn(ee,te){var ne=te(),re=h$1({h:{__:ne,v:te}}),ie=re[0].h,se=re[1];return y(function(){ie.__=ne,ie.v=te,E(ie.__,te())||se({h:ie})},[ee,ne,te]),p$1(function(){return E(ie.__,ie.v())||se({h:ie}),ee(function(){E(ie.__,ie.v())||se({h:ie})})},[ee]),ne}var Cn={useState:h$1,useId:V$1,useReducer:s$1,useEffect:p$1,useLayoutEffect:y,useInsertionEffect:Sn,useTransition:bn,useDeferredValue:_n,useSyncExternalStore:gn,startTransition:yn,useRef:_,useImperativeHandle:A$1,useMemo:F$1,useCallback:T$1,useContext:q$2,useDebugValue:x$1,version:"17.0.2",Children:O,render:G,hydrate:J,unmountComponentAtNode:hn,createPortal:z,createElement:y$1,createContext:G$1,createFactory:fn,cloneElement:sn,createRef:_$1,Fragment:k$3,isValidElement:an,findDOMNode:vn,Component:b$1,PureComponent:w,memo:x,forwardRef:k$1,flushSync:pn,unstable_batchedUpdates:dn,StrictMode:mn,Suspense:D,SuspenseList:V,lazy:M,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ln};const compat_module=Object.freeze(Object.defineProperty({__proto__:null,Children:O,Component:b$1,Fragment:k$3,PureComponent:w,StrictMode:mn,Suspense:D,SuspenseList:V,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ln,cloneElement:sn,createContext:G$1,createElement:y$1,createFactory:fn,createPortal:z,createRef:_$1,default:Cn,findDOMNode:vn,flushSync:pn,forwardRef:k$1,hydrate:J,isValidElement:an,lazy:M,memo:x,render:G,startTransition:yn,unmountComponentAtNode:hn,unstable_batchedUpdates:dn,useCallback:T$1,useContext:q$2,useDebugValue:x$1,useDeferredValue:_n,useEffect:p$1,useErrorBoundary:P$1,useId:V$1,useImperativeHandle:A$1,useInsertionEffect:Sn,useLayoutEffect:y,useMemo:F$1,useReducer:s$1,useRef:_,useState:h$1,useSyncExternalStore:gn,useTransition:bn,version:cn},Symbol.toStringTag,{value:"Module"}));function dateOffsetToString(ee){const te=ee<0;ee=Math.abs(ee);const ne=~~(ee/36e5),re=ee%36e5/6e4;return(te?"-":"+")+padWithZeros(ne,2)+":"+padWithZeros(re,2)}function dateToHalfUTCString(ee,te){const ne=ee.toISOString();return te==="first"?ne.substring(0,ne.indexOf("T")):ne.substring(ne.indexOf("T")+1,ne.length-1)}function dateToISOString(ee,te){if(te)return ee.toISOString();{const ne=ee.kind==null?!0:ee.kind===2;return padWithZeros(ee.getFullYear(),4)+"-"+padWithZeros(ee.getMonth()+1,2)+"-"+padWithZeros(ee.getDate(),2)+"T"+padWithZeros(ee.getHours(),2)+":"+padWithZeros(ee.getMinutes(),2)+":"+padWithZeros(ee.getSeconds(),2)+"."+padWithZeros(ee.getMilliseconds(),3)+(ne?dateOffsetToString(ee.getTimezoneOffset()*-6e4):"")}}function dateToISOStringWithOffset(ee,te){const ne=ee.toISOString();return ne.substring(0,ne.length-1)+dateOffsetToString(te)}function dateToStringWithCustomFormat(ee,te,ne){return te.replace(/(\w)\1*/g,re=>{let ie=Number.NaN;switch(re.substring(0,1)){case"y":const se=ne?ee.getUTCFullYear():ee.getFullYear();ie=re.length<4?se%100:se;break;case"M":ie=(ne?ee.getUTCMonth():ee.getMonth())+1;break;case"d":ie=ne?ee.getUTCDate():ee.getDate();break;case"H":ie=ne?ee.getUTCHours():ee.getHours();break;case"h":const oe=ne?ee.getUTCHours():ee.getHours();ie=oe>12?oe%12:oe;break;case"m":ie=ne?ee.getUTCMinutes():ee.getMinutes();break;case"s":ie=ne?ee.getUTCSeconds():ee.getSeconds();break;case"f":ie=ne?ee.getUTCMilliseconds():ee.getMilliseconds();break}return Number.isNaN(ie)?re:padWithZeros(ie,re.length)})}function dateToStringWithOffset(ee,te){var re,ie,se;const ne=new Date(ee.getTime()+((re=ee.offset)!=null?re:0));if(typeof te!="string")return ne.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+dateOffsetToString((ie=ee.offset)!=null?ie:0);if(te.length===1)switch(te){case"D":case"d":return dateToHalfUTCString(ne,"first");case"T":case"t":return dateToHalfUTCString(ne,"second");case"O":case"o":return dateToISOStringWithOffset(ne,(se=ee.offset)!=null?se:0);default:throw new Error("Unrecognized Date print format")}else return dateToStringWithCustomFormat(ne,te,!0)}function dateToStringWithKind(ee,te){const ne=ee.kind===1;if(typeof te!="string")return ne?ee.toUTCString():ee.toLocaleString();if(te.length===1)switch(te){case"D":case"d":return ne?dateToHalfUTCString(ee,"first"):ee.toLocaleDateString();case"T":case"t":return ne?dateToHalfUTCString(ee,"second"):ee.toLocaleTimeString();case"O":case"o":return dateToISOString(ee,ne);default:throw new Error("Unrecognized Date print format")}else return dateToStringWithCustomFormat(ee,te,ne)}function toString$2(ee,te,ne){return ee.offset!=null?dateToStringWithOffset(ee,te):dateToStringWithKind(ee,te)}function DateTime(ee,te){const ne=new Date(ee);return ne.kind=(te==null?0:te)|0,ne}function minValue$1(){return DateTime(-621355968e5,0)}function parseRaw(ee){function te(){throw new Error("The string is not a valid Date: ".concat(ee))}(ee==null||ee.trim()==="")&&te(),ee.length===10&&ee[4]==="-"&&ee[7]==="-"&&(ee+="T00:00:00");let ne=new Date(ee),re=null;if(isNaN(ne.getTime())){const ie=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(ee);if(ie!=null){let se,oe=0;if(ie[2]!=null){const me=ie[2].split(":");oe=parseInt(me[0],10)*3600+parseInt(me[1]||"0",10)*60+parseFloat(me[2]||"0"),ie[3]!=null&&ie[3].toUpperCase()==="PM"&&(oe+=720)}if(ie[4]!=null){if(ie[1]!=null)se=new Date(ie[1]+" UTC");else{const me=new Date;se=new Date(me.getUTCFullYear()+"/"+(me.getUTCMonth()+1)+"/"+me.getUTCDate())}if(ie[4]==="Z")re="Z";else{let me=parseInt(ie[5],10)*60+parseInt(ie[6]||"0",10);ie[4][0]==="-"&&(me*=-1),re=me,oe-=me*60}}else if(ie[1]!=null)se=new Date(ie[1]);else{const me=new Date;se=new Date(me.getFullYear()+"/"+(me.getMonth()+1)+"/"+me.getDate())}ne=new Date(se.getTime()+oe*1e3),ne=new Date(ne.getTime()+(ne.getTimezoneOffset()-se.getTimezoneOffset())*6e4)}else te();isNaN(ne.getTime())&&te()}return[ne,re]}function parse$3(ee,te=!1){const[ne,re]=parseRaw(ee),ie=re!=null?te&&re==="Z"?1:2:0;return DateTime(ne.getTime(),ie)}function tryParse$3(ee,te){try{return te.contents=parse$3(ee),!0}catch{return!1}}function toUniversalTime(ee){return ee.kind===1?ee:DateTime(ee.getTime(),1)}function create$1(ee,te=0){if(te&-284)throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");let ne="gu";return ne+=te&1?"i":"",ne+=te&2?"m":"",ne+=te&16?"s":"",new RegExp(ee,ne)}function escape$1(ee){return ee.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function matches(ee,te,ne=0){if(te==null)throw new Error("Input cannot ve null");if(!ee.global)throw new Error("Non-global RegExp");ee.lastIndex=ne;const re=[];let ie,se=-1;for(;(ie=ee.exec(te))!=null;)ie.index===se?ee.lastIndex++:(se=ie.index,re.push(ie));return re}function replace(ee,te,ne,re,ie=0){function se(){let oe=arguments[0];if(re){re--;const me=[],he=arguments.length,fe=typeof arguments[he-1]!="string";let ae=fe?he-3:he-2;for(let le=0;le<ae;le++)me.push(arguments[le]);me.index=arguments[ae++],me.input=arguments[ae++],fe&&(me.groups=arguments[ae]),oe=ne(me)}return oe}if(typeof ee=="string"){const oe=ee;ee=create$1(te,re!=null?re:0),te=oe,re=void 0}if(typeof ne=="function")return re=re==null?-1:re,te.substring(0,ie)+te.substring(ie).replace(ee,se);if(ne=ne.replace(/\$0/g,oe=>"$&").replace(/\${([^}]+)}/g,"$<$1>"),re!=null){let oe;const me=te.substring(ie),he=matches(ee,me),fe=matches.length>re?(oe=he[re-1],me.substring(0,oe.index+oe[0].length)):me;return te.substring(0,ie)+fe.replace(ee,ne)+te.substring(ie+fe.length)}else return te.replace(ee,ne)}const fsFormatRegExp=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,formatRegExp=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function isLessThan(ee,te){return compare$1(ee,te)<0}function printf(ee){return{input:ee,cont:fsFormat(ee)}}function continuePrint(ee,te){return typeof te=="string"?ee(te):te.cont(ee)}function toText(ee){return continuePrint(te=>te,ee)}function toFail(ee){return continuePrint(te=>{throw new Error(te)},ee)}function formatReplacement(ee,te,ne,re,ie){let se="";if(te=te||"",ie=ie||"",isNumeric(ee))switch(ie.toLowerCase()!=="x"&&(isLessThan(ee,0)?(ee=multiply$1(ee,-1),se="-"):te.indexOf(" ")>=0?se=" ":te.indexOf("+")>=0&&(se="+")),re=re==null?null:parseInt(re,10),ie){case"f":case"F":re=re!=null?re:6,ee=toFixed(ee,re);break;case"g":case"G":ee=re!=null?toPrecision(ee,re):toPrecision(ee);break;case"e":case"E":ee=re!=null?toExponential(ee,re):toExponential(ee);break;case"x":ee=toHex(ee);break;case"X":ee=toHex(ee).toUpperCase();break;default:ee=String(ee);break}else ee instanceof Date?ee=toString$2(ee):ee=toString$4(ee);if(ne=typeof ne=="number"?ne:parseInt(ne,10),isNaN(ne))ee=se+ee;else{const oe=te.indexOf("0")>=0,me=te.indexOf("-")>=0,he=me||!oe?" ":"0";he==="0"?(ee=pad(ee,ne-se.length,he,me),ee=se+ee):ee=pad(se+ee,ne,he,me)}return ee}function createPrinter(ee,te,ne,re="",ie=-1){return(...se)=>{let oe=re;const me=te.slice(),he=ne.slice();for(const fe of se){const[,,ae,le,ye,ve]=he[0];let de=le;if(ie>=0)de=ie,ie=-1;else if(de==="*"){if(fe<0)throw new Error("Non-negative number required");ie=fe;continue}oe+=me[0],oe+=formatReplacement(fe,ae,de,ye,ve),me.splice(0,1),he.splice(0,1)}return he.length===0?(oe+=me[0],ee(oe)):createPrinter(ee,me,he,oe,ie)}}function fsFormat(ee){return te=>{fsFormatRegExp.lastIndex=0;const ne=[],re=[];let ie=0,se=fsFormatRegExp.exec(ee);for(;se;){const oe=se.index+(se[1]||"").length;ne.push(ee.substring(ie,oe).replace(/%%/g,"%")),re.push(se),ie=fsFormatRegExp.lastIndex,fsFormatRegExp.lastIndex-=1,se=fsFormatRegExp.exec(ee)}return ne.length===0?te(ee.replace(/%%/g,"%")):(ne.push(ee.substring(ie).replace(/%%/g,"%")),createPrinter(te,ne,re))}}function format(ee,...te){let ne;return typeof ee=="object"?(ne=String(te[0]),te.shift()):ne=ee,ne.replace(formatRegExp,(re,ie,se,oe,me,he)=>{if(ie<0||ie>=te.length)throw new Error("Index must be greater or equal to zero and less than the arguments' length.");let fe=te[ie];if(isNumeric(fe))switch(me=me==null?null:parseInt(me,10),oe){case"f":case"F":me=me!=null?me:2,fe=toFixed(fe,me);break;case"g":case"G":fe=me!=null?toPrecision(fe,me):toPrecision(fe);break;case"e":case"E":fe=me!=null?toExponential(fe,me):toExponential(fe);break;case"p":case"P":me=me!=null?me:2,fe=toFixed(multiply$1(fe,100),me)+" %";break;case"d":case"D":fe=me!=null?padLeft(String(fe),me,"0"):String(fe);break;case"x":case"X":fe=me!=null?padLeft(toHex(fe),me,"0"):toHex(fe),oe==="X"&&(fe=fe.toUpperCase());break;default:if(he){let ae="";fe=he.replace(/([0#,]+)(\.[0#]+)?/,(le,ye,ve)=>{isLessThan(fe,0)&&(fe=multiply$1(fe,-1),ae="-"),ve=ve==null?"":ve.substring(1),fe=toFixed(fe,Math.max(ve.length,0));let[de,ge]=fe.split(".");ge||(ge="");const ue=ye.replace(/,/g,"").replace(/^#+/,"").length;de=padLeft(de,ue,"0");const Te=ve.replace(/#+$/,"").length;if(Te>ge.length?ge=padRight(ge,Te,"0"):Te<ge.length&&(ge=ge.substring(0,Te)+ge.substring(Te).replace(/0+$/,"")),ye.indexOf(",")>0){const $e=de.length%3,ke=Math.floor(de.length/3);let Ce=$e>0?de.substr(0,$e)+(ke>0?",":""):"";for(let ce=0;ce<ke;ce++)Ce+=de.substr($e+ce*3,3)+(ce<ke-1?",":"");de=Ce}return ge.length>0?de+"."+ge:de}),fe=ae+fe}}else fe instanceof Date?fe=toString$2(fe,he||oe):fe=toString$4(fe);return se=parseInt((se||" ").substring(1),10),isNaN(se)||(fe=pad(String(fe),Math.abs(se)," ",se<0)),fe})}function isNullOrEmpty(ee){return typeof ee!="string"||ee.length===0}function join(ee,te){return Array.isArray(te)?te.join(ee):Array.from(te).join(ee)}function pad(ee,te,ne,re){ne=ne||" ",te=te-ee.length;for(let ie=0;ie<te;ie++)ee=re?ee+ne:ne+ee;return ee}function padLeft(ee,te,ne){return pad(ee,te,ne)}function padRight(ee,te,ne){return pad(ee,te,ne,!0)}function split(ee,te,ne,re){if(ne=typeof ne=="number"?ne:void 0,re=typeof re=="number"?re:0,ne&&ne<0)throw new Error("Count cannot be less than zero");if(ne===0)return[];const ie=(re&1)===1,se=(re&2)===2;te=te||[],te=te.filter(ae=>ae).map(escape$1),te=te.length>0?te:["\\s"];const oe=[],me=new RegExp(te.join("|"),"g");let he=!0,fe=0;do{const ae=me.exec(ee);if(ae===null){const le=se?ee.substring(fe).trim():ee.substring(fe);(!ie||le.length>0)&&oe.push(le),he=!1}else{const le=se?ee.substring(fe,ae.index).trim():ee.substring(fe,ae.index);(!ie||le.length>0)&&(ne!=null&&oe.length+1===ne?(oe.push(se?ee.substring(fe).trim():ee.substring(fe)),he=!1):oe.push(le)),fe=me.lastIndex}}while(he);return oe}function trim(ee,...te){if(te.length===0)return ee.trim();const ne="["+escape$1(te.join(""))+"]+";return ee.replace(new RegExp("^"+ne),"").replace(new RegExp(ne+"$"),"")}const guidRegex=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,guidRegexNoHyphen=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,guidRegexHex=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function parse$2(ee){function te(re){return re.replace(guidRegexNoHyphen,"$1-$2-$3-$4-$5")}const ne=ee.trim().toLowerCase();if(guidRegex.test(ne))return trim(ne,"{","}","(",")");if(guidRegexNoHyphen.test(ne))return te(ne);if(guidRegexHex.test(ne))return te(ne.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}function tryParse$2(ee,te){try{return te.contents=parse$2(ee),!0}catch{return!1}}function some(ee){return ee==null||ee instanceof Some?new Some(ee):ee}function defaultArg(ee,te){return ee!=null?value(ee):te}function defaultArgWith(ee,te){return ee!=null?value(ee):te()}function map$5(ee,te){return te!=null?some(ee(value(te))):void 0}class FSharpResult$2 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Ok","Error"]}}function Result_Map(ee,te){return te.tag===0?new FSharpResult$2(0,[ee(te.fields[0])]):new FSharpResult$2(1,[te.fields[0]])}function Result_Bind(ee,te){return te.tag===0?ee(te.fields[0]):new FSharpResult$2(1,[te.fields[0]])}class FSharpChoice$2 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Choice1Of2","Choice2Of2"]}}function Choice_makeChoice1Of2(ee){return new FSharpChoice$2(0,[ee])}function Choice_makeChoice2Of2(ee){return new FSharpChoice$2(1,[ee])}const SR_inputWasEmpty="Collection was empty.";function Helpers_allocateArrayFromCons(ee,te){return typeof ee=="function"?new ee(te):new Array(te)}function fill(ee,te,ne,re){const ie=te|0;return ee.fill(re,ie,ie+ne)}function map$4(ee,te,ne){const re=te.length|0,ie=Helpers_allocateArrayFromCons(ne,re);for(let se=0;se<=re-1;se++)ie[se]=ee(te[se]);return ie}function singleton$3(ee,te){const ne=Helpers_allocateArrayFromCons(te,1);return ne[0]=ee,ne}function reverse$2(ee){return ee.slice().reverse()}function tryFind$1(ee,te){return te.find(ee)}function choose$1(ee,te,ne){const re=[];for(let ie=0;ie<=te.length-1;ie++){const se=ee(te[ie]);if(se!=null){const oe=value(se);re.push(oe)}}return equals$2(ne,defaultOf())?re:map$4(ie=>ie,re,ne)}function fold$2(ee,te,ne){return ne.reduce(ee,te)}function foldBack$1(ee,te,ne){return te.reduceRight((re,ie)=>ee(ie,re),ne)}class FSharpList extends Record{constructor(te,ne){super(),this.head=te,this.tail=ne}toString(){return"["+join("; ",this)+"]"}Equals(te){const ne=this;return ne===te?!0:((ie,se)=>{e:for(;;){const oe=ie,me=se,he=oe.tail,fe=me.tail;if(he!=null)if(fe!=null){const ae=he,le=fe;if(equals$2(oe.head,me.head)){ie=ae,se=le;continue e}else return!1}else return!1;else return fe==null}})(ne,te)}GetHashCode(){return((re,ie,se)=>{e:for(;;){const oe=re,me=ie,he=se,fe=he.tail;if(fe!=null){const ae=fe;if(oe>18)return me|0;re=oe+1,ie=(me<<1)+structuralHash(he.head)+631*oe,se=ae;continue e}else return me|0}})(0,0,this)|0}toJSON(){const te=this;return Array.from(te)}CompareTo(te){return((ie,se)=>{e:for(;;){const oe=ie,me=se,he=oe.tail,fe=me.tail;if(he!=null)if(fe!=null){const ae=he,le=fe,ye=compare$2(oe.head,me.head)|0;if(ye===0){ie=ae,se=le;continue e}else return ye|0}else return 1;else return fe!=null?-1:0}})(this,te)|0}GetEnumerator(){return ListEnumerator$1_$ctor_3002E699(this)}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return getEnumerator(this)}}class ListEnumerator$1{constructor(te){this.xs=te,this.it=this.xs,this.current=defaultOf()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const te=this,ne=te.it.tail;if(ne!=null){const re=ne;return te.current=te.it.head,te.it=re,!0}else return!1}"System.Collections.IEnumerator.Reset"(){const te=this;te.it=te.xs,te.current=defaultOf()}Dispose(){}}function ListEnumerator$1_$ctor_3002E699(ee){return new ListEnumerator$1(ee)}function FSharpList_get_Empty(){return new FSharpList(defaultOf(),void 0)}function FSharpList_Cons_305B8EAC(ee,te){return new FSharpList(ee,te)}function FSharpList__get_IsEmpty(ee){return ee.tail==null}function FSharpList__get_Length(ee){return((ne,re)=>{e:for(;;){const ie=ne,oe=re.tail;if(oe!=null){ne=ie+1,re=oe;continue e}else return ie|0}})(0,ee)|0}function FSharpList__get_Head(ee){if(ee.tail!=null)return ee.head;throw new Error(SR_inputWasEmpty+"\\nParameter name: list")}function FSharpList__get_Tail(ee){const te=ee.tail;if(te!=null)return te;throw new Error(SR_inputWasEmpty+"\\nParameter name: list")}function empty$3(){return FSharpList_get_Empty()}function cons(ee,te){return FSharpList_Cons_305B8EAC(ee,te)}function singleton$2(ee){return FSharpList_Cons_305B8EAC(ee,FSharpList_get_Empty())}function isEmpty(ee){return FSharpList__get_IsEmpty(ee)}function head(ee){return FSharpList__get_Head(ee)}function tail(ee){return FSharpList__get_Tail(ee)}function toArray$1(ee){const te=FSharpList__get_Length(ee)|0,ne=fill(new Array(te),0,te,null);return((ie,se)=>{e:for(;;){const oe=ie,me=se;if(!FSharpList__get_IsEmpty(me)){ne[oe]=FSharpList__get_Head(me),ie=oe+1,se=FSharpList__get_Tail(me);continue e}break}})(0,ee),ne}function fold$1(ee,te,ne){let re=te,ie=ne;for(;!FSharpList__get_IsEmpty(ie);)re=ee(re,head(ie)),ie=FSharpList__get_Tail(ie);return re}function reverse$1(ee){return fold$1((te,ne)=>FSharpList_Cons_305B8EAC(ne,te),FSharpList_get_Empty(),ee)}function foldBack(ee,te,ne){return foldBack$1(ee,toArray$1(te),ne)}function iterate$1(ee,te){fold$1((ne,re)=>{ee(re)},void 0,te)}function ofArrayWithTail(ee,te){let ne=te;for(let re=ee.length-1;re>=0;re--)ne=FSharpList_Cons_305B8EAC(ee[re],ne);return ne}function ofArray$2(ee){return ofArrayWithTail(ee,FSharpList_get_Empty())}function ofSeq$3(ee){let te,ne;if(isArrayLike(ee))return ofArray$2(ee);if(ee instanceof FSharpList)return ee;{const re=FSharpList_get_Empty();let ie=re;const se=getEnumerator(ee);try{for(;se["System.Collections.IEnumerator.MoveNext"]();){const he=se["System.Collections.Generic.IEnumerator`1.get_Current"]();ie=(te=ie,ne=new FSharpList(he,void 0),te.tail=ne,ne)}}finally{disposeSafe(se)}const oe=ie,me=FSharpList_get_Empty();return oe.tail=me,FSharpList__get_Tail(re)}}function append$1(ee,te){return fold$1((ne,re)=>FSharpList_Cons_305B8EAC(re,ne),te,reverse$1(ee))}function map$3(ee,te){const ne=FSharpList_get_Empty(),re=fold$1((se,oe)=>{const me=new FSharpList(ee(oe),void 0);return se.tail=me,me},ne,te),ie=FSharpList_get_Empty();return re.tail=ie,FSharpList__get_Tail(ne)}function filter(ee,te){const ne=FSharpList_get_Empty(),re=fold$1((se,oe)=>{if(ee(oe)){const me=new FSharpList(oe,void 0);return se.tail=me,me}else return se},ne,te),ie=FSharpList_get_Empty();return re.tail=ie,FSharpList__get_Tail(ne)}function partition(ee,te){const ne=FSharpList_get_Empty(),re=FSharpList_get_Empty(),ie=ne,se=fold$1((he,fe)=>{let ae,le;const ye=he[0],ve=he[1];return ee(fe)?[(ae=new FSharpList(fe,void 0),ye.tail=ae,ae),ve]:[ye,(le=new FSharpList(fe,void 0),ve.tail=le,le)]},[ie,re],te),oe=FSharpList_get_Empty();se[0].tail=oe;const me=FSharpList_get_Empty();return se[1].tail=me,[FSharpList__get_Tail(ie),FSharpList__get_Tail(re)]}function choose(ee,te){const ne=FSharpList_get_Empty(),re=fold$1((se,oe)=>{const me=ee(oe);if(me==null)return se;{const he=new FSharpList(value(me),void 0);return se.tail=he,he}},ne,te),ie=FSharpList_get_Empty();return re.tail=ie,FSharpList__get_Tail(ne)}function forAll(ee,te){return fold$1((ne,re)=>ne&&ee(re),!0,te)}function Operators_NullArg(ee){throw new Error(ee)}const SR_enumerationAlreadyFinished="Enumeration already finished.",SR_enumerationNotStarted="Enumeration has not started. Call MoveNext.",SR_notEnoughElements="The input sequence has an insufficient number of elements.",SR_resetNotSupported="Reset is not supported on this enumerator.";function Enumerator_noReset(){throw new Error(SR_resetNotSupported)}function Enumerator_notStarted(){throw new Error(SR_enumerationNotStarted)}function Enumerator_alreadyFinished(){throw new Error(SR_enumerationAlreadyFinished)}class Enumerator_Seq{constructor(te){this.f=te}toString(){const te=this;let ne=0,re="seq [";const ie=getEnumerator(te);try{for(;ne<4&&ie["System.Collections.IEnumerator.MoveNext"]();)ne>0&&(re=re+"; "),re=re+toString$4(ie["System.Collections.Generic.IEnumerator`1.get_Current"]()),ne=ne+1|0;return ne===4&&(re=re+"; ..."),re+"]"}finally{disposeSafe(ie)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}function Enumerator_Seq_$ctor_673A07F2(ee){return new Enumerator_Seq(ee)}class Enumerator_FromFunctions$1{constructor(te,ne,re){this.current=te,this.next=ne,this.dispose=re}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){Enumerator_noReset()}Dispose(){this.dispose()}}function Enumerator_FromFunctions$1_$ctor_58C54629(ee,te,ne){return new Enumerator_FromFunctions$1(ee,te,ne)}function Enumerator_concat(ee){let te,ne,re=!1,ie=!1,se;const oe=()=>{if(ie=!0,ne!=null){const me=ne;try{disposeSafe(me)}finally{ne=void 0}}if(te!=null){const me=te;try{disposeSafe(me)}finally{te=void 0}}};return Enumerator_FromFunctions$1_$ctor_58C54629(()=>(re?ie&&Enumerator_alreadyFinished():Enumerator_notStarted(),se!=null?value(se):Enumerator_alreadyFinished()),()=>{let me;if(re||(re=!0),ie)return!1;{let he;for(;he==null;){const fe=te,ae=ne;if(fe!=null)if(ae!=null){const le=ae;if(le["System.Collections.IEnumerator.MoveNext"]())se=some(le["System.Collections.Generic.IEnumerator`1.get_Current"]()),he=!0;else try{disposeSafe(le)}finally{ne=void 0}}else{const le=fe;le["System.Collections.IEnumerator.MoveNext"]()?ne=(me=le["System.Collections.Generic.IEnumerator`1.get_Current"](),getEnumerator(me)):(oe(),he=!1)}else te=getEnumerator(ee)}return value(he)}},()=>{ie||oe()})}function Enumerator_enumerateThenFinally(ee,te){return Enumerator_FromFunctions$1_$ctor_58C54629(()=>te["System.Collections.Generic.IEnumerator`1.get_Current"](),()=>te["System.Collections.IEnumerator.MoveNext"](),()=>{try{disposeSafe(te)}finally{ee()}})}function Enumerator_generateWhileSome(ee,te,ne){let re=!1,ie,se=some(ee());const oe=()=>{if(se!=null){const he=value(se);try{ne(he)}finally{se=void 0}}},me=()=>{try{oe()}finally{ie=void 0}};return Enumerator_FromFunctions$1_$ctor_58C54629(()=>(re||Enumerator_notStarted(),ie!=null?value(ie):Enumerator_alreadyFinished()),()=>{if(re||(re=!0),se!=null){const he=value(se);let fe;try{fe=te(he)}catch(ae){throw me(),ae}return fe!=null?(ie=fe,!0):(me(),!1)}else return!1},oe)}function Enumerator_unfold(ee,te){let ne,re=te;return Enumerator_FromFunctions$1_$ctor_58C54629(()=>{if(ne!=null){const ie=ne[0];return ne[1],ie}else return Enumerator_notStarted()},()=>(ne=ee(re),ne!=null?(ne[0],re=ne[1],!0):!1),()=>{})}function checkNonNull(ee,te){te==null&&Operators_NullArg(ee)}function mkSeq(ee){return Enumerator_Seq_$ctor_673A07F2(ee)}function ofSeq$2(ee){return checkNonNull("source",ee),getEnumerator(ee)}function delay(ee){return mkSeq(()=>getEnumerator(ee()))}function concat(ee){return mkSeq(()=>Enumerator_concat(ee))}function unfold(ee,te){return mkSeq(()=>Enumerator_unfold(ee,te))}function empty$2(){return delay(()=>new Array(0))}function singleton$1(ee){return delay(()=>singleton$3(ee))}function ofArray$1(ee){return ee}function toArray(ee){return ee instanceof FSharpList?toArray$1(ee):Array.from(ee)}function toList(ee){return isArrayLike(ee)?ofArray$2(ee):ee instanceof FSharpList?ee:ofSeq$3(ee)}function generate(ee,te,ne){return mkSeq(()=>Enumerator_generateWhileSome(ee,te,ne))}function generateIndexed(ee,te,ne){return mkSeq(()=>{let re=-1;return Enumerator_generateWhileSome(ee,ie=>(re=re+1|0,te(re,ie)),ne)})}function append(ee,te){return concat([ee,te])}function compareWith(ee,te,ne){const re=ofSeq$2(te);try{const ie=ofSeq$2(ne);try{let se=0,oe=re["System.Collections.IEnumerator.MoveNext"](),me=ie["System.Collections.IEnumerator.MoveNext"]();for(;se===0&&oe&&me;)se=ee(re["System.Collections.Generic.IEnumerator`1.get_Current"](),ie["System.Collections.Generic.IEnumerator`1.get_Current"]())|0,se===0&&(oe=re["System.Collections.IEnumerator.MoveNext"](),me=ie["System.Collections.IEnumerator.MoveNext"]());return(se!==0?se:oe?1:me?-1:0)|0}finally{disposeSafe(ie)}}finally{disposeSafe(re)}}function contains$1(ee,te,ne){const re=ofSeq$2(te);try{let ie=!1;for(;!ie&&re["System.Collections.IEnumerator.MoveNext"]();)ie=ne.Equals(ee,re["System.Collections.Generic.IEnumerator`1.get_Current"]());return ie}finally{disposeSafe(re)}}function fold(ee,te,ne){const re=ofSeq$2(ne);try{let ie=te;for(;re["System.Collections.IEnumerator.MoveNext"]();)ie=ee(ie,re["System.Collections.Generic.IEnumerator`1.get_Current"]());return ie}finally{disposeSafe(re)}}function iterate(ee,te){fold((ne,re)=>{ee(re)},void 0,te)}function map$2(ee,te){return generate(()=>ofSeq$2(te),ne=>ne["System.Collections.IEnumerator.MoveNext"]()?some(ee(ne["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,ne=>{disposeSafe(ne)})}function mapIndexed(ee,te){return generateIndexed(()=>ofSeq$2(te),(ne,re)=>re["System.Collections.IEnumerator.MoveNext"]()?some(ee(ne,re["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,ne=>{disposeSafe(ne)})}function reverse(ee){return delay(()=>reverse$2(toArray(ee)))}function skip(ee,te){return mkSeq(()=>{const ne=ofSeq$2(te);try{for(let re=1;re<=ee;re++)if(!ne["System.Collections.IEnumerator.MoveNext"]())throw new Error(SR_notEnoughElements+"\\nParameter name: source");return Enumerator_enumerateThenFinally(()=>{},ne)}catch(re){throw disposeSafe(ne),re}})}function take(ee,te){return generateIndexed(()=>ofSeq$2(te),(ne,re)=>{if(ne<ee){if(re["System.Collections.IEnumerator.MoveNext"]())return some(re["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(SR_notEnoughElements+"\\nParameter name: source")}else return},ne=>{disposeSafe(ne)})}function collect(ee,te){return delay(()=>concat(map$2(ee,te)))}class PolicyTypeDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["InformationStatement","Custom"]}}function PolicyTypeDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.Common.PolicyTypeDto",[],PolicyTypeDto,()=>[[],[]])}class PathDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["BlobStorage","Unused"]}}function PathDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.Common.PathDto",[],PathDto,()=>[[["Item",string_type]],[]])}function PathDto__get_Value(ee){if(ee.tag===1)throw new Error("PathDto.Unused");return ee.fields[0]}class FileDto extends Record{constructor(te,ne){super(),this.Name=te,this.Path=ne}}function FileDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.Common.FileDto",[],FileDto,()=>[["Name",string_type],["Path",PathDto$reflection()]])}class AboutDto extends Record{constructor(te,ne){super(),this.Copy=te,this.Link=ne}}function AboutDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.Common.AboutDto",[],AboutDto,()=>[["Copy",string_type],["Link",string_type]])}const CaseRules={None:0,LowerFirst:1,SnakeCase:2,SnakeCaseAllCaps:3,KebabCase:4};function dashify(ee,te){return ee.replace(/[a-z]?[A-Z]/g,ne=>ne.length===1?ne.toLowerCase():ne.charAt(0)+te+ne.charAt(1).toLowerCase())}function changeCase(ee,te){switch(te){case CaseRules.LowerFirst:return ee.charAt(0).toLowerCase()+ee.slice(1);case CaseRules.SnakeCase:return dashify(ee,"_");case CaseRules.SnakeCaseAllCaps:return dashify(ee,"_").toUpperCase();case CaseRules.KebabCase:return dashify(ee,"-");case CaseRules.None:default:return ee}}function keyValueList(ee,te=CaseRules.None){const ne={},re=te;function ie(oe){throw new Error("Cannot infer key and value of "+String(oe))}function se(oe,me,he){oe=changeCase(oe,me),ne[oe]=he}for(let oe of ee){let me=CaseRules.None;if(oe==null&&ie(oe),oe instanceof Union){const he=oe.cases()[oe.tag];oe=oe.fields.length===0?he:[he].concat(oe.fields),me=re}if(Array.isArray(oe))switch(oe.length){case 0:ie(oe);break;case 1:se(oe[0],me,!0);break;case 2:const he=oe[1];se(oe[0],me,he);break;default:se(oe[0],me,oe.slice(1))}else typeof oe=="string"?se(oe,me,!0):ie(oe)}return ne}function makeRangeStepFunction(ee,te,ne,re){const ie=compare$2(ee,ne)|0;if(ie===0)throw new Error("The step of a range cannot be zero");const se=ie>0;return oe=>{const me=compare$2(oe,te)|0;return se&&me<=0||!se&&me>=0?[oe,re(oe,ee)]:void 0}}function integralRangeStep(ee,te,ne,re,ie){const se=makeRangeStepFunction(te,ne,re,ie);return delay(()=>unfold(se,ee))}function rangeDouble(ee,te,ne){return integralRangeStep(ee,te,ne,0,(re,ie)=>re+ie)}class PolicyIdentifierDto extends Record{constructor(te,ne,re){super(),this.PolicyId=te,this.PolicyType=ne,this.VersionNumber=re|0}}function PolicyIdentifierDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyIdentifierDto",[],PolicyIdentifierDto,()=>[["PolicyId",string_type],["PolicyType",PolicyTypeDto$reflection()],["VersionNumber",int32_type]])}class PolicyReviewItemStatusDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Presented","Opened","Accepted"]}}function PolicyReviewItemStatusDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyReviewItemStatusDto",[],PolicyReviewItemStatusDto,()=>[[],[],[]])}function PolicyReviewItemStatusDto__ToNextStatus_468E0CC(ee,te){let ne;switch(ee.tag===1?te.tag===2?ne=1:te.tag===0?ne=2:ne=1:ee.tag===2?(te.tag===1||te.tag,ne=3):(te.tag===1||te.tag,ne=0),ne){case 0:return te;case 1:return te;case 2:return ee;case 3:return ee}}class PolicyReviewItemDto extends Record{constructor(te,ne){super(),this.Policy=te,this.Status=ne}}function PolicyReviewItemDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyReviewItemDto",[],PolicyReviewItemDto,()=>[["Policy",anonRecord_type(["About",AboutDto$reflection()],["CreatedAt",class_type("System.DateTime")],["Description",string_type],["File",FileDto$reflection()],["Identifier",PolicyIdentifierDto$reflection()],["Title",string_type])],["Status",PolicyReviewItemStatusDto$reflection()]])}class InitResponse extends Record{constructor(te){super(),this.PolicyReviewList=te}}function InitResponse$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.InitResponse",[],InitResponse,()=>[["PolicyReviewList",list_type(PolicyReviewItemDto$reflection())]])}class InitResponseError extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["NoConfigFound"]}}function InitResponseError$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.InitResponseError",[],InitResponseError,()=>[[]])}class CommandRequest extends Record{constructor(te){super(),this.Type=te}}function CommandRequest$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.CommandRequest",[],CommandRequest,()=>[["Type",CommandTypeDto$reflection()]])}class CommandTypeDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Present","Open","Accept","Complete"]}}function CommandTypeDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.CommandTypeDto",[],CommandTypeDto,()=>[[["Item",anonRecord_type(["PolicyIdentifierList",list_type(PolicyIdentifierDto$reflection())])]],[["Item",PolicyIdentifierDto$reflection()]],[["Item",PolicyIdentifierDto$reflection()]],[["Item",anonRecord_type(["PolicyIdentifierList",list_type(PolicyIdentifierDto$reflection())])]]])}class CancellationToken{constructor(te=!1){this._id=0,this._cancelled=te,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,te]of this._listeners)te()}}addListener(te){const ne=this._id;return this._listeners.set(this._id++,te),ne}removeListener(te){return this._listeners.delete(te)}register(te,ne){const re=this,ie=this.addListener(ne==null?te:()=>te(ne));return{Dispose(){re.removeListener(ie)}}}Dispose(){}}class OperationCanceledError extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,OperationCanceledError.prototype)}}class Trampoline{static get maxTrampolineCallCount(){return 2e3}constructor(){this.callCount=0}incrementAndCheck(){return this.callCount++>Trampoline.maxTrampolineCallCount}hijack(te){this.callCount=0,setTimeout(te,0)}}function protectedCont(ee){return te=>{if(te.cancelToken.isCancelled)te.onCancel(new OperationCanceledError);else if(te.trampoline.incrementAndCheck())te.trampoline.hijack(()=>{try{ee(te)}catch(ne){te.onError(ensureErrorOrException(ne))}});else try{ee(te)}catch(ne){te.onError(ensureErrorOrException(ne))}}}function protectedBind(ee,te){return protectedCont(ne=>{ee({onSuccess:re=>{try{te(re)(ne)}catch(ie){ne.onError(ensureErrorOrException(ie))}},onError:ne.onError,onCancel:ne.onCancel,cancelToken:ne.cancelToken,trampoline:ne.trampoline})})}function protectedReturn(ee){return protectedCont(te=>te.onSuccess(ee))}class AsyncBuilder{Bind(te,ne){return protectedBind(te,ne)}Combine(te,ne){return this.Bind(te,()=>ne)}Delay(te){return protectedCont(ne=>te()(ne))}For(te,ne){const re=te[Symbol.iterator]();let ie=re.next();return this.While(()=>!ie.done,this.Delay(()=>{const se=ne(ie.value);return ie=re.next(),se}))}Return(te){return protectedReturn(te)}ReturnFrom(te){return te}TryFinally(te,ne){return protectedCont(re=>{te({onSuccess:ie=>{ne(),re.onSuccess(ie)},onError:ie=>{ne(),re.onError(ie)},onCancel:ie=>{ne(),re.onCancel(ie)},cancelToken:re.cancelToken,trampoline:re.trampoline})})}TryWith(te,ne){return protectedCont(re=>{te({onSuccess:re.onSuccess,onCancel:re.onCancel,cancelToken:re.cancelToken,trampoline:re.trampoline,onError:ie=>{try{ne(ie)(re)}catch(se){re.onError(ensureErrorOrException(se))}}})})}Using(te,ne){return this.TryFinally(ne(te),()=>te.Dispose())}While(te,ne){return te()?this.Bind(ne,()=>this.While(te,ne)):this.Return(void 0)}Zero(){return protectedCont(te=>te.onSuccess(void 0))}}const singleton=new AsyncBuilder;function emptyContinuation(ee){}function awaitPromise(ee){return fromContinuations(te=>ee.then(te[0]).catch(ne=>(ne instanceof OperationCanceledError?te[2]:te[1])(ne)))}const defaultCancellationToken=new CancellationToken;function catchAsync(ee){return protectedCont(te=>{ee({onSuccess:ne=>te.onSuccess(Choice_makeChoice1Of2(ne)),onError:ne=>te.onSuccess(Choice_makeChoice2Of2(ne)),onCancel:te.onCancel,cancelToken:te.cancelToken,trampoline:te.trampoline})})}function fromContinuations(ee){return protectedCont(te=>ee([te.onSuccess,te.onError,te.onCancel]))}function sleep(ee){return protectedCont(te=>{let ne;const re=setTimeout(()=>{te.cancelToken.removeListener(ne),te.onSuccess(void 0)},ee);ne=te.cancelToken.addListener(()=>{clearTimeout(re),te.onCancel(new OperationCanceledError)})})}function start(ee,te){return startWithContinuations(ee,te)}function startImmediate(ee,te){return start(ee,te)}function startWithContinuations(ee,te,ne,re,ie){typeof te!="function"&&(ie=te,te=void 0);const se=new Trampoline;ee({onSuccess:te||emptyContinuation,onError:ne||emptyContinuation,onCancel:re||emptyContinuation,cancelToken:ie||defaultCancellationToken,trampoline:se})}class HttpMethod extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Header extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Header"]}}class BodyContent extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Empty","Text","Binary","Form"]}}class HttpRequest extends Record{constructor(te,ne,re,ie,se,oe,me,he){super(),this.url=te,this.method=ne,this.headers=re,this.withCredentials=ie,this.overridenMimeType=se,this.overridenResponseType=oe,this.timeout=me,this.content=he}}class ResponseContent extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class HttpResponse extends Record{constructor(te,ne,re,ie,se,oe){super(),this.statusCode=te|0,this.responseText=ne,this.responseType=re,this.responseUrl=ie,this.responseHeaders=se,this.content=oe}}class MapTreeLeaf$2{constructor(te,ne){this.k=te,this.v=ne}}function MapTreeLeaf$2_$ctor_5BDDA1(ee,te){return new MapTreeLeaf$2(ee,te)}function MapTreeLeaf$2__get_Key(ee){return ee.k}function MapTreeLeaf$2__get_Value(ee){return ee.v}class MapTreeNode$2 extends MapTreeLeaf$2{constructor(te,ne,re,ie,se){super(te,ne),this.left=re,this.right=ie,this.h=se|0}}function MapTreeNode$2_$ctor_Z39DE9543(ee,te,ne,re,ie){return new MapTreeNode$2(ee,te,ne,re,ie)}function MapTreeNode$2__get_Left(ee){return ee.left}function MapTreeNode$2__get_Right(ee){return ee.right}function MapTreeNode$2__get_Height(ee){return ee.h}function MapTreeModule_empty(){}function MapTreeModule_sizeAux(ee,te){e:for(;;){const ne=ee,re=te;if(re!=null){const ie=re;if(ie instanceof MapTreeNode$2){const se=ie;ee=MapTreeModule_sizeAux(ne+1,MapTreeNode$2__get_Left(se)),te=MapTreeNode$2__get_Right(se);continue e}else return ne+1|0}else return ne|0}}function MapTreeModule_size(ee){return MapTreeModule_sizeAux(0,ee)}function MapTreeModule_mk(ee,te,ne,re){let ie,se,oe;const me=ee;if(me!=null){const le=me;oe=le instanceof MapTreeNode$2?(ie=le,MapTreeNode$2__get_Height(ie)):1}else oe=0;let he;const fe=re;if(fe!=null){const le=fe;he=le instanceof MapTreeNode$2?(se=le,MapTreeNode$2__get_Height(se)):1}else he=0;const ae=(oe<he?he:oe)|0;return ae===0?MapTreeLeaf$2_$ctor_5BDDA1(te,ne):MapTreeNode$2_$ctor_Z39DE9543(te,ne,ee,re,ae+1)}function MapTreeModule_rebalance(ee,te,ne,re){let ie,se,oe,me,he,fe,ae,le,ye;const ve=ee;if(ve!=null){const ue=ve;ye=ue instanceof MapTreeNode$2?(ie=ue,MapTreeNode$2__get_Height(ie)):1}else ye=0;let de;const ge=re;if(ge!=null){const ue=ge;de=ue instanceof MapTreeNode$2?(se=ue,MapTreeNode$2__get_Height(se)):1}else de=0;if(de>ye+2){const ue=value(re);if(ue instanceof MapTreeNode$2){const Te=ue;if(oe=MapTreeNode$2__get_Left(Te),(oe!=null?(me=oe,me instanceof MapTreeNode$2?(he=me,MapTreeNode$2__get_Height(he)):1):0)>ye+1){const $e=value(MapTreeNode$2__get_Left(Te));if($e instanceof MapTreeNode$2){const ke=$e;return MapTreeModule_mk(MapTreeModule_mk(ee,te,ne,MapTreeNode$2__get_Left(ke)),MapTreeLeaf$2__get_Key(ke),MapTreeLeaf$2__get_Value(ke),MapTreeModule_mk(MapTreeNode$2__get_Right(ke),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeNode$2__get_Right(Te)))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(MapTreeModule_mk(ee,te,ne,MapTreeNode$2__get_Left(Te)),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeNode$2__get_Right(Te))}else throw new Error("internal error: Map.rebalance")}else if(ye>de+2){const ue=value(ee);if(ue instanceof MapTreeNode$2){const Te=ue;if(fe=MapTreeNode$2__get_Right(Te),(fe!=null?(ae=fe,ae instanceof MapTreeNode$2?(le=ae,MapTreeNode$2__get_Height(le)):1):0)>de+1){const $e=value(MapTreeNode$2__get_Right(Te));if($e instanceof MapTreeNode$2){const ke=$e;return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(Te),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeNode$2__get_Left(ke)),MapTreeLeaf$2__get_Key(ke),MapTreeLeaf$2__get_Value(ke),MapTreeModule_mk(MapTreeNode$2__get_Right(ke),te,ne,re))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(MapTreeNode$2__get_Left(Te),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeModule_mk(MapTreeNode$2__get_Right(Te),te,ne,re))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(ee,te,ne,re)}function MapTreeModule_add(ee,te,ne,re){if(re!=null){const ie=re,se=ee.Compare(te,MapTreeLeaf$2__get_Key(ie))|0;if(ie instanceof MapTreeNode$2){const oe=ie;return se<0?MapTreeModule_rebalance(MapTreeModule_add(ee,te,ne,MapTreeNode$2__get_Left(oe)),MapTreeLeaf$2__get_Key(oe),MapTreeLeaf$2__get_Value(oe),MapTreeNode$2__get_Right(oe)):se===0?MapTreeNode$2_$ctor_Z39DE9543(te,ne,MapTreeNode$2__get_Left(oe),MapTreeNode$2__get_Right(oe),MapTreeNode$2__get_Height(oe)):MapTreeModule_rebalance(MapTreeNode$2__get_Left(oe),MapTreeLeaf$2__get_Key(oe),MapTreeLeaf$2__get_Value(oe),MapTreeModule_add(ee,te,ne,MapTreeNode$2__get_Right(oe)))}else return se<0?MapTreeNode$2_$ctor_Z39DE9543(te,ne,void 0,re,2):se===0?MapTreeLeaf$2_$ctor_5BDDA1(te,ne):MapTreeNode$2_$ctor_Z39DE9543(te,ne,re,void 0,2)}else return MapTreeLeaf$2_$ctor_5BDDA1(te,ne)}function MapTreeModule_tryFind(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se!=null){const oe=se,me=re.Compare(ie,MapTreeLeaf$2__get_Key(oe))|0;if(me===0)return some(MapTreeLeaf$2__get_Value(oe));if(oe instanceof MapTreeNode$2){const he=oe;ee=re,te=ie,ne=me<0?MapTreeNode$2__get_Left(he):MapTreeNode$2__get_Right(he);continue e}else return}else return}}function MapTreeModule_find(ee,te,ne){const re=MapTreeModule_tryFind(ee,te,ne);if(re==null)throw new Error;return value(re)}function MapTreeModule_mem(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se!=null){const oe=se,me=re.Compare(ie,MapTreeLeaf$2__get_Key(oe))|0;if(oe instanceof MapTreeNode$2){const he=oe;if(me<0){ee=re,te=ie,ne=MapTreeNode$2__get_Left(he);continue e}else{if(me===0)return!0;ee=re,te=ie,ne=MapTreeNode$2__get_Right(he);continue e}}else return me===0}else return!1}}function MapTreeModule_iterOpt(ee,te){e:for(;;){const ne=ee,re=te;if(re!=null){const ie=re;if(ie instanceof MapTreeNode$2){const se=ie;MapTreeModule_iterOpt(ne,MapTreeNode$2__get_Left(se)),ne(MapTreeLeaf$2__get_Key(se),MapTreeLeaf$2__get_Value(se)),ee=ne,te=MapTreeNode$2__get_Right(se);continue e}else ne(MapTreeLeaf$2__get_Key(ie),MapTreeLeaf$2__get_Value(ie))}break}}function MapTreeModule_iter(ee,te){MapTreeModule_iterOpt(ee,te)}function MapTreeModule_mapiOpt(ee,te){if(te!=null){const ne=te;if(ne instanceof MapTreeNode$2){const re=ne,ie=MapTreeModule_mapiOpt(ee,MapTreeNode$2__get_Left(re)),se=ee(MapTreeLeaf$2__get_Key(re),MapTreeLeaf$2__get_Value(re)),oe=MapTreeModule_mapiOpt(ee,MapTreeNode$2__get_Right(re));return MapTreeNode$2_$ctor_Z39DE9543(MapTreeLeaf$2__get_Key(re),se,ie,oe,MapTreeNode$2__get_Height(re))}else return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(ne),ee(MapTreeLeaf$2__get_Key(ne),MapTreeLeaf$2__get_Value(ne)))}else return void 0}function MapTreeModule_mapi(ee,te){return MapTreeModule_mapiOpt(ee,te)}function MapTreeModule_copyToArray(ee,te,ne){let re=ne;MapTreeModule_iter((ie,se)=>{te[re]=[ie,se],re=re+1|0},ee)}function MapTreeModule_ofList(ee,te){return fold$1((ne,re)=>MapTreeModule_add(ee,re[0],re[1],ne),void 0,te)}function MapTreeModule_mkFromEnumerator(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se["System.Collections.IEnumerator.MoveNext"]()){const oe=se["System.Collections.Generic.IEnumerator`1.get_Current"]();ee=re,te=MapTreeModule_add(re,oe[0],oe[1],ie),ne=se;continue e}else return ie}}function MapTreeModule_ofArray(ee,te){let ne=void 0;for(let re=0;re<=te.length-1;re++){const ie=te[re];ne=MapTreeModule_add(ee,ie[0],ie[1],ne)}return ne}function MapTreeModule_ofSeq(ee,te){if(isArrayLike(te))return MapTreeModule_ofArray(ee,te);if(te instanceof FSharpList)return MapTreeModule_ofList(ee,te);{const ne=getEnumerator(te);try{return MapTreeModule_mkFromEnumerator(ee,void 0,ne)}finally{disposeSafe(ne)}}}class MapTreeModule_MapIterator$2 extends Record{constructor(te,ne){super(),this.stack=te,this.started=ne}}function MapTreeModule_collapseLHS(ee){e:for(;;){const te=ee;if(isEmpty(te))return empty$3();{const ne=tail(te),re=head(te);if(re!=null){const ie=re;if(ie instanceof MapTreeNode$2){const se=ie;ee=ofArrayWithTail([MapTreeNode$2__get_Left(se),MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(se),MapTreeLeaf$2__get_Value(se)),MapTreeNode$2__get_Right(se)],ne);continue e}else return te}else{ee=ne;continue e}}}}function MapTreeModule_mkIterator(ee){return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton$2(ee)),!1)}function MapTreeModule_notStarted(){throw new Error("enumeration not started")}function MapTreeModule_alreadyFinished(){throw new Error("enumeration already finished")}function MapTreeModule_current(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return MapTreeModule_alreadyFinished();if(head(te)!=null){const ne=head(te);if(ne instanceof MapTreeNode$2)throw new Error("Please report error: Map iterator, unexpected stack for current");return[MapTreeLeaf$2__get_Key(ne),MapTreeLeaf$2__get_Value(ne)]}else throw new Error("Please report error: Map iterator, unexpected stack for current")}else return MapTreeModule_notStarted()}function MapTreeModule_moveNext(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return!1;if(head(te)!=null){if(head(te)instanceof MapTreeNode$2)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return ee.stack=MapTreeModule_collapseLHS(tail(te)),!isEmpty(ee.stack)}else throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}else return ee.started=!0,!isEmpty(ee.stack)}function MapTreeModule_mkIEnumerator(ee){let te=MapTreeModule_mkIterator(ee);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return MapTreeModule_current(te)},"System.Collections.IEnumerator.get_Current"(){return MapTreeModule_current(te)},"System.Collections.IEnumerator.MoveNext"(){return MapTreeModule_moveNext(te)},"System.Collections.IEnumerator.Reset"(){te=MapTreeModule_mkIterator(ee)},Dispose(){}}}class FSharpMap{constructor(te,ne){this.comparer=te,this.tree=ne}GetHashCode(){return FSharpMap__ComputeHashCode(this)|0}Equals(te){const ne=this;if(te instanceof FSharpMap){const re=te,ie=getEnumerator(ne);try{const se=getEnumerator(re);try{const oe=()=>{const me=ie["System.Collections.IEnumerator.MoveNext"]();if(me===se["System.Collections.IEnumerator.MoveNext"]())if(me){const he=ie["System.Collections.Generic.IEnumerator`1.get_Current"](),fe=se["System.Collections.Generic.IEnumerator`1.get_Current"]();return equals$2(he[0],fe[0])&&equals$2(he[1],fe[1])?oe():!1}else return!0;else return!1};return oe()}finally{disposeSafe(se)}}finally{disposeSafe(ie)}}else return!1}toString(){return"map ["+join("; ",map$2(ne=>format("({0}, {1})",ne[0],ne[1]),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(){const te=this;return Array.from(te)}GetEnumerator(){return MapTreeModule_mkIEnumerator(this.tree)}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return MapTreeModule_mkIEnumerator(this.tree)}CompareTo(te){const ne=this;if(te instanceof FSharpMap)return compareWith((ie,se)=>{const oe=ne.comparer.Compare(ie[0],se[0])|0;return(oe!==0?oe:compare$2(ie[1],se[1]))|0},ne,te)|0;throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(te){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(te){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(te){const ne=this;return FSharpMap__ContainsKey(ne,te[0])&&equals$2(FSharpMap__get_Item(ne,te[0]),te[1])}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(te,ne){MapTreeModule_copyToArray(this.tree,te,ne)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return FSharpMap__get_Count(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return FSharpMap__get_Count(this)|0}get size(){return FSharpMap__get_Count(this)|0}clear(){throw new Error("Map cannot be mutated")}delete(te){throw new Error("Map cannot be mutated")}entries(){return map$2(ne=>[ne[0],ne[1]],this)}get(te){return FSharpMap__get_Item(this,te)}has(te){return FSharpMap__ContainsKey(this,te)}keys(){return map$2(ne=>ne[0],this)}set(te,ne){throw new Error("Map cannot be mutated")}values(){return map$2(ne=>ne[1],this)}forEach(te,ne){const re=this;iterate(ie=>{te(ie[1],ie[0],re)},re)}}function FSharpMap_$ctor(ee,te){return new FSharpMap(ee,te)}function FSharpMap_Empty(ee){return FSharpMap_$ctor(ee,void 0)}function FSharpMap__Add(ee,te,ne){return FSharpMap_$ctor(ee.comparer,MapTreeModule_add(ee.comparer,te,ne,ee.tree))}function FSharpMap__get_Item(ee,te){return MapTreeModule_find(ee.comparer,te,ee.tree)}function FSharpMap__Map(ee,te){return FSharpMap_$ctor(ee.comparer,MapTreeModule_mapi(te,ee.tree))}function FSharpMap__get_Count(ee){return MapTreeModule_size(ee.tree)}function FSharpMap__ContainsKey(ee,te){return MapTreeModule_mem(ee.comparer,te,ee.tree)}function FSharpMap__TryFind(ee,te){return MapTreeModule_tryFind(ee.comparer,te,ee.tree)}function FSharpMap__ComputeHashCode(ee){const te=(ie,se)=>(ie<<1)+se+631;let ne=0;const re=getEnumerator(ee);try{for(;re["System.Collections.IEnumerator.MoveNext"]();){const ie=re["System.Collections.Generic.IEnumerator`1.get_Current"]();ne=te(ne,structuralHash(ie[0]))|0,ne=te(ne,structuralHash(ie[1]))|0}}finally{disposeSafe(re)}return ne|0}function add$2(ee,te,ne){return FSharpMap__Add(ne,ee,te)}function tryFind(ee,te){return FSharpMap__TryFind(te,ee)}function map$1(ee,te){return FSharpMap__Map(te,ee)}function ofSeq$1(ee,te){return FSharpMap_$ctor(te,MapTreeModule_ofSeq(te,ee))}function ofArray(ee,te){return FSharpMap_$ctor(te,MapTreeModule_ofSeq(te,ee))}function empty$1(ee){return FSharpMap_Empty(ee)}function Headers_contentType(ee){return new Header(0,["Content-Type",ee])}function Headers_authorization(ee){return new Header(0,["Authorization",ee])}const Http_defaultRequest=new HttpRequest("",new HttpMethod(0,[]),empty$3(),!1,void 0,void 0,void 0,new BodyContent(0,[]));new HttpResponse(0,"","","",empty$1({Compare:comparePrimitives}),new ResponseContent(0,[""]));function Http_splitAt(ee,te){return isNullOrEmpty(te)?[te]:split(te,[ee],void 0,0)}function Http_serializeMethod(ee){switch(ee.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}function Http_request(ee){return new HttpRequest(ee,Http_defaultRequest.method,Http_defaultRequest.headers,Http_defaultRequest.withCredentials,Http_defaultRequest.overridenMimeType,Http_defaultRequest.overridenResponseType,Http_defaultRequest.timeout,Http_defaultRequest.content)}function Http_method(ee,te){return new HttpRequest(te.url,ee,te.headers,te.withCredentials,te.overridenMimeType,te.overridenResponseType,te.timeout,te.content)}function Http_header(ee,te){return new HttpRequest(te.url,te.method,append$1(te.headers,singleton$2(ee)),te.withCredentials,te.overridenMimeType,te.overridenResponseType,te.timeout,te.content)}function Http_content(ee,te){return new HttpRequest(te.url,te.method,te.headers,te.withCredentials,te.overridenMimeType,te.overridenResponseType,te.timeout,ee)}function Http_send(ee){return fromContinuations(te=>{const ne=new XMLHttpRequest;ne.open(Http_serializeMethod(ee.method),ee.url),ne.onreadystatechange=()=>{let he,fe,ae,le,ye,ve,de;ne.readyState===4&&te[0]((he=(fe=ne.responseType,fe===""||fe==="text"?ne.responseText:""),ae=ne.status|0,le=ne.responseType,ye=(ve=ne.responseType,ve===""?new ResponseContent(0,[ne.responseText]):ve==="text"?new ResponseContent(0,[ne.responseText]):ve==="arraybuffer"?new ResponseContent(2,[ne.response]):ve==="blob"?new ResponseContent(1,[ne.response]):new ResponseContent(3,[ne.response])),de=ofArray(choose$1(ge=>{const ue=ofArray$2(Http_splitAt(":",ge));if(!isEmpty(ue))return[head(ue).toLocaleLowerCase(),join(":",tail(ue)).trim()]},Http_splitAt("\r\n",ne.getAllResponseHeaders())),{Compare:comparePrimitives}),new HttpResponse(ae,he,le,ne.responseURL,de,ye)))};const re=getEnumerator(ee.headers);try{for(;re["System.Collections.IEnumerator.MoveNext"]();){const he=re["System.Collections.Generic.IEnumerator`1.get_Current"]();ne.setRequestHeader(he.fields[0],he.fields[1])}}finally{disposeSafe(re)}ne.withCredentials=ee.withCredentials;const ie=ee.overridenMimeType;if(ie!=null){const he=ie;ne.overrideMimeType(he)}const se=ee.overridenResponseType;se==null||(se.tag===1?ne.responseType="blob":se.tag===2?ne.responseType="arraybuffer":ne.responseType="text");const oe=ee.timeout;if(oe!=null){const he=oe|0;ne.timeout=he|0}const me=ee.content;switch(me.tag){case 1:{ne.send(some(me.fields[0]));break}case 3:{ne.send(some(me.fields[0]));break}case 2:{ne.send(some(me.fields[0]));break}default:ne.send()}})}class ErrorReason extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class CaseStrategy extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["PascalCase","CamelCase","SnakeCase"]}}function Util_Casing_lowerFirst(ee){return ee.slice(void 0,0+1).toLowerCase()+ee.slice(1,ee.length)}function Util_Casing_convert(ee,te){switch(ee.tag){case 2:return replace(Util_Casing_lowerFirst(te),"[A-Z]","_$0").toLowerCase();case 0:return te;default:return Util_Casing_lowerFirst(te)}}function DateTimeOffset(ee,te){checkOffsetInRange(te);const ne=new Date(ee);return ne.offset=te!=null?te:new Date().getTimezoneOffset()*-6e4,ne}function checkOffsetInRange(ee){if(ee!=null&&ee!==0){if(ee%6e4!==0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(ee/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}function minValue(){return DateTimeOffset(-621355968e5,0)}function parse$1(ee){const[te,ne]=parseRaw(ee),re=ne==null?te.getTimezoneOffset()*-6e4:ne==="Z"?0:ne*6e4;return DateTimeOffset(te.getTime(),re)}function tryParse$1(ee,te){try{return te.contents=parse$1(ee),!0}catch{return!1}}function signedRound(ee){return ee<0?Math.ceil(ee):Math.floor(ee)}function create(ee=0,te=0,ne=0,re=0,ie=0){switch(arguments.length){case 1:return fromTicks(arguments[0]);case 3:ee=0,te=arguments[0],ne=arguments[1],re=arguments[2],ie=0;break}return ee*864e5+te*36e5+ne*6e4+re*1e3+ie}function fromTicks(ee){return toNumber(op_Division(ee,1e4))}function days(ee){return signedRound(ee/864e5)}function hours(ee){return signedRound(ee%864e5/36e5)}function minutes(ee){return signedRound(ee%36e5/6e4)}function seconds(ee){return signedRound(ee%6e4/1e3)}function milliseconds(ee){return signedRound(ee%1e3)}function toString$1(ee,te="c",ne){if(["c","g","G"].indexOf(te)===-1)throw new Error("Custom formats are not supported");const re=Math.abs(days(ee)),ie=Math.abs(hours(ee)),se=Math.abs(minutes(ee)),oe=Math.abs(seconds(ee)),me=Math.abs(milliseconds(ee)),he=ee<0?"-":"";return"".concat(he).concat(re===0&&(te==="c"||te==="g")?"":te==="c"?re+".":re+":").concat(te==="g"?ie:padWithZeros(ie,2),":").concat(padWithZeros(se,2),":").concat(padWithZeros(oe,2)).concat(me===0&&(te==="c"||te==="g")?"":te==="g"?"."+padWithZeros(me,3):"."+padLeftAndRightWithZeros(me,3,7))}function parse(ee){const te=ee.search("\\."),ne=ee.search("\\:");if(te===-1&&ne===-1){const re=parseInt(ee,0);if(isNaN(re))throw new Error("String '".concat(ee,"' was not recognized as a valid TimeSpan."));return create(re,0,0,0,0)}if(ne>0){const re=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(ee);if(re!=null&&re[4]!=null&&re[5]!=null){let ie=0,se=0,oe=0;const me=re[1]!=null&&re[1]==="-"?-1:1,he=+re[4],fe=+re[5];if(re[3]!=null&&(ie=+re[3]),re[7]!=null&&(oe=+re[7]),re[8]!=null)switch(re[8].length){case 1:se=+re[8]*100;break;case 2:se=+re[8]*10;break;case 3:se=+re[8];break;case 4:se=+re[8]/10;break;case 5:se=+re[8]/100;break;case 6:se=+re[8]/1e3;break;case 7:se=+re[8]/1e4;break;default:throw new Error("String '".concat(ee,"' was not recognized as a valid TimeSpan."))}return me*create(ie,he,fe,oe,se)}}throw new Error("String '".concat(ee,"' was not recognized as a valid TimeSpan."))}function tryParse(ee,te){try{return te.contents=parse(ee),!0}catch{return!1}}class SetTreeLeaf$1{constructor(te){this.k=te}}function SetTreeLeaf$1_$ctor_2B595(ee){return new SetTreeLeaf$1(ee)}function SetTreeLeaf$1__get_Key(ee){return ee.k}class SetTreeNode$1 extends SetTreeLeaf$1{constructor(te,ne,re,ie){super(te),this.left=ne,this.right=re,this.h=ie|0}}function SetTreeNode$1_$ctor_5F465FC9(ee,te,ne,re){return new SetTreeNode$1(ee,te,ne,re)}function SetTreeNode$1__get_Left(ee){return ee.left}function SetTreeNode$1__get_Right(ee){return ee.right}function SetTreeNode$1__get_Height(ee){return ee.h}function SetTreeModule_empty(){}function SetTreeModule_countAux(ee,te){e:for(;;){const ne=ee,re=te;if(ne!=null){const ie=ne;if(ie instanceof SetTreeNode$1){const se=ie;ee=SetTreeNode$1__get_Left(se),te=SetTreeModule_countAux(SetTreeNode$1__get_Right(se),re+1);continue e}else return re+1|0}else return re|0}}function SetTreeModule_count(ee){return SetTreeModule_countAux(ee,0)}function SetTreeModule_mk(ee,te,ne){let re,ie,se;const oe=ee;if(oe!=null){const ae=oe;se=ae instanceof SetTreeNode$1?(re=ae,SetTreeNode$1__get_Height(re)):1}else se=0;let me;const he=ne;if(he!=null){const ae=he;me=ae instanceof SetTreeNode$1?(ie=ae,SetTreeNode$1__get_Height(ie)):1}else me=0;const fe=(se<me?me:se)|0;return fe===0?SetTreeLeaf$1_$ctor_2B595(te):SetTreeNode$1_$ctor_5F465FC9(te,ee,ne,fe+1)}function SetTreeModule_rebalance(ee,te,ne){let re,ie,se,oe,me,he,fe,ae,le;const ye=ee;if(ye!=null){const ge=ye;le=ge instanceof SetTreeNode$1?(re=ge,SetTreeNode$1__get_Height(re)):1}else le=0;let ve;const de=ne;if(de!=null){const ge=de;ve=ge instanceof SetTreeNode$1?(ie=ge,SetTreeNode$1__get_Height(ie)):1}else ve=0;if(ve>le+2){const ge=value(ne);if(ge instanceof SetTreeNode$1){const ue=ge;if(se=SetTreeNode$1__get_Left(ue),(se!=null?(oe=se,oe instanceof SetTreeNode$1?(me=oe,SetTreeNode$1__get_Height(me)):1):0)>le+1){const Te=value(SetTreeNode$1__get_Left(ue));if(Te instanceof SetTreeNode$1){const $e=Te;return SetTreeModule_mk(SetTreeModule_mk(ee,te,SetTreeNode$1__get_Left($e)),SetTreeLeaf$1__get_Key($e),SetTreeModule_mk(SetTreeNode$1__get_Right($e),SetTreeLeaf$1__get_Key(ue),SetTreeNode$1__get_Right(ue)))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(SetTreeModule_mk(ee,te,SetTreeNode$1__get_Left(ue)),SetTreeLeaf$1__get_Key(ue),SetTreeNode$1__get_Right(ue))}else throw new Error("internal error: Set.rebalance")}else if(le>ve+2){const ge=value(ee);if(ge instanceof SetTreeNode$1){const ue=ge;if(he=SetTreeNode$1__get_Right(ue),(he!=null?(fe=he,fe instanceof SetTreeNode$1?(ae=fe,SetTreeNode$1__get_Height(ae)):1):0)>ve+1){const Te=value(SetTreeNode$1__get_Right(ue));if(Te instanceof SetTreeNode$1){const $e=Te;return SetTreeModule_mk(SetTreeModule_mk(SetTreeNode$1__get_Left(ue),SetTreeLeaf$1__get_Key(ue),SetTreeNode$1__get_Left($e)),SetTreeLeaf$1__get_Key($e),SetTreeModule_mk(SetTreeNode$1__get_Right($e),te,ne))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(SetTreeNode$1__get_Left(ue),SetTreeLeaf$1__get_Key(ue),SetTreeModule_mk(SetTreeNode$1__get_Right(ue),te,ne))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(ee,te,ne)}function SetTreeModule_add(ee,te,ne){if(ne!=null){const re=ne,ie=ee.Compare(te,SetTreeLeaf$1__get_Key(re))|0;if(re instanceof SetTreeNode$1){const se=re;return ie<0?SetTreeModule_rebalance(SetTreeModule_add(ee,te,SetTreeNode$1__get_Left(se)),SetTreeLeaf$1__get_Key(se),SetTreeNode$1__get_Right(se)):ie===0?ne:SetTreeModule_rebalance(SetTreeNode$1__get_Left(se),SetTreeLeaf$1__get_Key(se),SetTreeModule_add(ee,te,SetTreeNode$1__get_Right(se)))}else{const se=ee.Compare(te,SetTreeLeaf$1__get_Key(re))|0;return se<0?SetTreeNode$1_$ctor_5F465FC9(te,void 0,ne,2):se===0?ne:SetTreeNode$1_$ctor_5F465FC9(te,ne,void 0,2)}}else return SetTreeLeaf$1_$ctor_2B595(te)}function SetTreeModule_mem(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se!=null){const oe=se,me=re.Compare(ie,SetTreeLeaf$1__get_Key(oe))|0;if(oe instanceof SetTreeNode$1){const he=oe;if(me<0){ee=re,te=ie,ne=SetTreeNode$1__get_Left(he);continue e}else{if(me===0)return!0;ee=re,te=ie,ne=SetTreeNode$1__get_Right(he);continue e}}else return me===0}else return!1}}function SetTreeModule_iter(ee,te){e:for(;;){const ne=ee,re=te;if(re!=null){const ie=re;if(ie instanceof SetTreeNode$1){const se=ie;SetTreeModule_iter(ne,SetTreeNode$1__get_Left(se)),ne(SetTreeLeaf$1__get_Key(se)),ee=ne,te=SetTreeNode$1__get_Right(se);continue e}else ne(SetTreeLeaf$1__get_Key(ie))}break}}class SetTreeModule_SetIterator$1 extends Record{constructor(te,ne){super(),this.stack=te,this.started=ne}}function SetTreeModule_collapseLHS(ee){e:for(;;){const te=ee;if(isEmpty(te))return empty$3();{const ne=head(te),re=tail(te);if(ne!=null){const ie=ne;if(ie instanceof SetTreeNode$1){const se=ie;ee=ofArrayWithTail([SetTreeNode$1__get_Left(se),SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(se)),SetTreeNode$1__get_Right(se)],re);continue e}else return te}else{ee=re;continue e}}}}function SetTreeModule_mkIterator(ee){return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton$2(ee)),!1)}function SetTreeModule_notStarted(){throw new Error("Enumeration not started")}function SetTreeModule_alreadyFinished(){throw new Error("Enumeration already started")}function SetTreeModule_current(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return SetTreeModule_alreadyFinished();if(head(te)!=null){const ne=head(te);return SetTreeLeaf$1__get_Key(ne)}else throw new Error("Please report error: Set iterator, unexpected stack for current")}else return SetTreeModule_notStarted()}function SetTreeModule_moveNext(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return!1;if(head(te)!=null){if(head(te)instanceof SetTreeNode$1)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return ee.stack=SetTreeModule_collapseLHS(tail(te)),!isEmpty(ee.stack)}else throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}else return ee.started=!0,!isEmpty(ee.stack)}function SetTreeModule_mkIEnumerator(ee){let te=SetTreeModule_mkIterator(ee);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return SetTreeModule_current(te)},"System.Collections.IEnumerator.get_Current"(){return SetTreeModule_current(te)},"System.Collections.IEnumerator.MoveNext"(){return SetTreeModule_moveNext(te)},"System.Collections.IEnumerator.Reset"(){te=SetTreeModule_mkIterator(ee)},Dispose(){}}}function SetTreeModule_compareStacks(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(isEmpty(ie))return isEmpty(se)?0:-1;if(isEmpty(se))return 1;if(head(se)!=null)if(head(ie)!=null){const oe=head(ie),me=head(se);if(oe instanceof SetTreeNode$1){const he=oe;if(SetTreeNode$1__get_Left(he)==null)if(me instanceof SetTreeNode$1){const fe=me;if(SetTreeNode$1__get_Left(fe)==null){const ae=re.Compare(SetTreeLeaf$1__get_Key(he),SetTreeLeaf$1__get_Key(fe))|0;if(ae!==0)return ae|0;ee=re,te=cons(SetTreeNode$1__get_Right(he),tail(ie)),ne=cons(SetTreeNode$1__get_Right(fe),tail(se));continue e}else{let ae,le,ye,ve,de;switch(isEmpty(ie)?isEmpty(se)?ae=2:head(se)!=null?(ae=1,ve=tail(se),de=head(se)):ae=2:head(ie)!=null?(ae=0,le=tail(ie),ye=head(ie)):isEmpty(se)?ae=2:head(se)!=null?(ae=1,ve=tail(se),de=head(se)):ae=2,ae){case 0:if(ye instanceof SetTreeNode$1){const ge=ye;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(ge),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ge),void 0,SetTreeNode$1__get_Right(ge),0)],le),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ye))],le),ne=se;continue e}case 1:if(de instanceof SetTreeNode$1){const ge=de;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(ge),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ge),void 0,SetTreeNode$1__get_Right(ge),0)],ve);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(de))],ve);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const fe=re.Compare(SetTreeLeaf$1__get_Key(he),SetTreeLeaf$1__get_Key(me))|0;if(fe!==0)return fe|0;ee=re,te=cons(SetTreeNode$1__get_Right(he),tail(ie)),ne=cons(void 0,tail(se));continue e}else{let fe,ae,le,ye,ve;switch(isEmpty(ie)?isEmpty(se)?fe=2:head(se)!=null?(fe=1,ye=tail(se),ve=head(se)):fe=2:head(ie)!=null?(fe=0,ae=tail(ie),le=head(ie)):isEmpty(se)?fe=2:head(se)!=null?(fe=1,ye=tail(se),ve=head(se)):fe=2,fe){case 0:if(le instanceof SetTreeNode$1){const de=le;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],ae),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(le))],ae),ne=se;continue e}case 1:if(ve instanceof SetTreeNode$1){const de=ve;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],ye);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ve))],ye);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else if(me instanceof SetTreeNode$1){const he=me;if(SetTreeNode$1__get_Left(he)==null){const fe=re.Compare(SetTreeLeaf$1__get_Key(oe),SetTreeLeaf$1__get_Key(he))|0;if(fe!==0)return fe|0;ee=re,te=cons(void 0,tail(ie)),ne=cons(SetTreeNode$1__get_Right(he),tail(se));continue e}else{let fe,ae,le,ye,ve;switch(isEmpty(ie)?isEmpty(se)?fe=2:head(se)!=null?(fe=1,ye=tail(se),ve=head(se)):fe=2:head(ie)!=null?(fe=0,ae=tail(ie),le=head(ie)):isEmpty(se)?fe=2:head(se)!=null?(fe=1,ye=tail(se),ve=head(se)):fe=2,fe){case 0:if(le instanceof SetTreeNode$1){const de=le;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],ae),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(le))],ae),ne=se;continue e}case 1:if(ve instanceof SetTreeNode$1){const de=ve;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(de),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(de),void 0,SetTreeNode$1__get_Right(de),0)],ye);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ve))],ye);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const he=re.Compare(SetTreeLeaf$1__get_Key(oe),SetTreeLeaf$1__get_Key(me))|0;if(he!==0)return he|0;ee=re,te=tail(ie),ne=tail(se);continue e}}else{head(se);let oe,me,he,fe,ae;switch(isEmpty(ie)?isEmpty(se)?oe=2:head(se)!=null?(oe=1,fe=tail(se),ae=head(se)):oe=2:head(ie)!=null?(oe=0,me=tail(ie),he=head(ie)):isEmpty(se)?oe=2:head(se)!=null?(oe=1,fe=tail(se),ae=head(se)):oe=2,oe){case 0:if(he instanceof SetTreeNode$1){const le=he;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],me),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(he))],me),ne=se;continue e}case 1:if(ae instanceof SetTreeNode$1){const le=ae;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],fe);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ae))],fe);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else if(head(ie)!=null){head(ie);let oe,me,he,fe,ae;switch(isEmpty(ie)?isEmpty(se)?oe=2:head(se)!=null?(oe=1,fe=tail(se),ae=head(se)):oe=2:head(ie)!=null?(oe=0,me=tail(ie),he=head(ie)):isEmpty(se)?oe=2:head(se)!=null?(oe=1,fe=tail(se),ae=head(se)):oe=2,oe){case 0:if(he instanceof SetTreeNode$1){const le=he;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],me),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(he))],me),ne=se;continue e}case 1:if(ae instanceof SetTreeNode$1){const le=ae;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],fe);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ae))],fe);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{ee=re,te=tail(ie),ne=tail(se);continue e}break}}function SetTreeModule_compare(ee,te,ne){return te==null?ne==null?0:-1:ne==null?1:SetTreeModule_compareStacks(ee,singleton$2(te),singleton$2(ne))|0}function SetTreeModule_copyToArray(ee,te,ne){let re=ne;SetTreeModule_iter(ie=>{te[re]=ie,re=re+1|0},ee)}function SetTreeModule_mkFromEnumerator(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se["System.Collections.IEnumerator.MoveNext"]()){ee=re,te=SetTreeModule_add(re,se["System.Collections.Generic.IEnumerator`1.get_Current"](),ie),ne=se;continue e}else return ie}}function SetTreeModule_ofArray(ee,te){return fold$2((ne,re)=>SetTreeModule_add(ee,re,ne),void 0,te)}function SetTreeModule_ofList(ee,te){return fold$1((ne,re)=>SetTreeModule_add(ee,re,ne),void 0,te)}function SetTreeModule_ofSeq(ee,te){if(isArrayLike(te))return SetTreeModule_ofArray(ee,te);if(te instanceof FSharpList)return SetTreeModule_ofList(ee,te);{const ne=getEnumerator(te);try{return SetTreeModule_mkFromEnumerator(ee,void 0,ne)}finally{disposeSafe(ne)}}}class FSharpSet{constructor(te,ne){this.comparer=te,this.tree=ne}GetHashCode(){return FSharpSet__ComputeHashCode(this)|0}Equals(te){let ne;const re=this;return te instanceof FSharpSet&&(ne=te,SetTreeModule_compare(FSharpSet__get_Comparer(re),FSharpSet__get_Tree(re),FSharpSet__get_Tree(ne))===0)}toString(){return"set ["+join("; ",map$2(ne=>toString$4(ne),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(){const te=this;return Array.from(te)}CompareTo(te){const ne=this;return SetTreeModule_compare(FSharpSet__get_Comparer(ne),FSharpSet__get_Tree(ne),FSharpSet__get_Tree(te))|0}"System.Collections.Generic.ICollection`1.Add2B595"(te){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(te){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(te){const ne=this;return SetTreeModule_mem(FSharpSet__get_Comparer(ne),te,FSharpSet__get_Tree(ne))}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(te,ne){SetTreeModule_copyToArray(FSharpSet__get_Tree(this),te,ne)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return FSharpSet__get_Count(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return FSharpSet__get_Count(this)|0}GetEnumerator(){return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(this))}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(this))}get size(){return FSharpSet__get_Count(this)|0}add(te){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(te){throw new Error("Set cannot be mutated")}has(te){return FSharpSet__Contains(this,te)}keys(){return map$2(ne=>ne,this)}values(){return map$2(ne=>ne,this)}entries(){return map$2(ne=>[ne,ne],this)}forEach(te,ne){const re=this;iterate(ie=>{te(ie,ie,re)},re)}}function FSharpSet_$ctor(ee,te){return new FSharpSet(ee,te)}function FSharpSet__get_Comparer(ee){return ee.comparer}function FSharpSet__get_Tree(ee){return ee.tree}function FSharpSet_Empty(ee){return FSharpSet_$ctor(ee,void 0)}function FSharpSet__Add(ee,te){return FSharpSet_$ctor(FSharpSet__get_Comparer(ee),SetTreeModule_add(FSharpSet__get_Comparer(ee),te,FSharpSet__get_Tree(ee)))}function FSharpSet__get_Count(ee){return SetTreeModule_count(FSharpSet__get_Tree(ee))}function FSharpSet__Contains(ee,te){return SetTreeModule_mem(FSharpSet__get_Comparer(ee),te,FSharpSet__get_Tree(ee))}function FSharpSet__ComputeHashCode(ee){let te=0;const ne=getEnumerator(ee);try{for(;ne["System.Collections.IEnumerator.MoveNext"]();){const re=ne["System.Collections.Generic.IEnumerator`1.get_Current"]();te=(te<<1)+structuralHash(re)+631|0}}finally{disposeSafe(ne)}return Math.abs(te)|0}function contains(ee,te){return FSharpSet__Contains(te,ee)}function add$1(ee,te){return FSharpSet__Add(te,ee)}function empty(ee){return FSharpSet_Empty(ee)}function ofList(ee,te){return FSharpSet_$ctor(te,SetTreeModule_ofSeq(te,ee))}function ofSeq(ee,te){return FSharpSet_$ctor(te,SetTreeModule_ofSeq(te,ee))}function genericMsg(ee,te,ne){try{return"Expecting "+ee+" but instead got:"+(ne?"\n":" ")+(JSON.stringify(te,null,4)+"")}catch{return"Expecting "+ee+" but decoder failed. Couldn't report given value due to circular structure."+(ne?"\n":" ")}}function errorToString(ee,te){const ne=te.tag===2?genericMsg(te.fields[0],te.fields[1],!0):te.tag===1?genericMsg(te.fields[0],te.fields[1],!1)+"\nReason: "+te.fields[2]:te.tag===3?genericMsg(te.fields[0],te.fields[1],!0):te.tag===4?genericMsg(te.fields[0],te.fields[1],!0)+("\nNode `"+te.fields[2]+"` is unkown."):te.tag===5?"Expecting "+te.fields[0]+".\n"+(JSON.stringify(te.fields[1],null,4)+""):te.tag===7?"The following errors were found:\n\n"+join("\n\n",te.fields[0]):te.tag===6?"The following `failure` occurred with the decoder: "+te.fields[0]:genericMsg(te.fields[0],te.fields[1],!1);return te.tag===7?ne:"Error at: `"+ee+"`\n"+ne}function fromValue(ee,te,ne){const re=te(ee,ne);if(re.tag===1){const ie=re.fields[0];return new FSharpResult$2(1,[errorToString(ie[0],ie[1])])}else return new FSharpResult$2(0,[re.fields[0]])}function fromString(ee,te){try{return fromValue("$",ee,JSON.parse(te))}catch(ne){if(ne instanceof SyntaxError)return new FSharpResult$2(1,["Given an invalid JSON: "+ne.message]);throw ne}}function string(ee,te){return typeof te=="string"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a string",te])]])}function char(ee,te){if(typeof te=="string"){const ne=te;return ne.length===1?new FSharpResult$2(0,[ne[0]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a single character string",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a char",te])]])}function guid$1(ee,te){if(typeof te=="string"){let ne,re="00000000-0000-0000-0000-000000000000";return ne=[tryParse$2(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a guid",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a guid",te])]])}function unit$1(ee,te){return te==null?new FSharpResult$2(0,[void 0]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["null",te])]])}const sbyte=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?-128<=ie&&ie<=127?new FSharpResult$2(0,[(ie+128&255)-128]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a sbyte",ie,"Value was either too large or too small for a sbyte"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a sbyte",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!1,8,new FSharpRef(()=>se,oe=>{se=oe|0})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["a sbyte",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["a sbyte",re])]])},byte=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?0<=ie&&ie<=255?new FSharpResult$2(0,[ie&255]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a byte",ie,"Value was either too large or too small for a byte"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a byte",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!0,8,new FSharpRef(()=>se,oe=>{se=oe})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["a byte",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["a byte",re])]])},int16=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?-32768<=ie&&ie<=32767?new FSharpResult$2(0,[(ie+32768&65535)-32768]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int16",ie,"Value was either too large or too small for an int16"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int16",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!1,16,new FSharpRef(()=>se,oe=>{se=oe|0})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int16",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int16",re])]])},uint16=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?0<=ie&&ie<=65535?new FSharpResult$2(0,[ie&65535]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint16",ie,"Value was either too large or too small for an uint16"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint16",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!0,16,new FSharpRef(()=>se,oe=>{se=oe})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint16",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint16",re])]])},int=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?-2147483648<=ie&&ie<=2147483647?new FSharpResult$2(0,[~~ie]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int",ie,"Value was either too large or too small for an int"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!1,32,new FSharpRef(()=>se,oe=>{se=oe|0})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int",re])]])},uint32=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?0<=ie&&ie<=4294967295?new FSharpResult$2(0,[ie>>>0]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint32",ie,"Value was either too large or too small for an uint32"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint32",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!0,32,new FSharpRef(()=>se,oe=>{se=oe})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint32",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint32",re])]])};function bool(ee,te){return typeof te=="boolean"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a boolean",te])]])}function float(ee,te){return typeof te=="number"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a float",te])]])}function float32(ee,te){return typeof te=="number"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a float32",te])]])}function datetimeUtc(ee,te){if(typeof te=="string"){let ne,re=minValue$1();return ne=[tryParse$3(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[toUniversalTime(ne[1])]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetime",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetime",te])]])}function datetimeOffset$1(ee,te){if(typeof te=="string"){let ne,re=minValue();return ne=[tryParse$1(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetimeoffset",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetime",te])]])}function timespan$1(ee,te){if(typeof te=="string"){let ne,re=0;return ne=[tryParse(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a timespan",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a timespan",te])]])}function index$2(ee,te,ne,re){let ie;const se=ne+".["+int32ToString(ee)+"]";if(Array.isArray(re)){const oe=re;return ee<oe.length?te(se,oe[ee]):new FSharpResult$2(1,[[se,new ErrorReason(5,["a longer array. Need index `"+int32ToString(ee)+"` but there are only `"+(ie=oe.length,int32ToString(ie))+"` entries",re])]])}else return new FSharpResult$2(1,[[se,new ErrorReason(0,["an array",re])]])}function option$1(ee,te,ne){return ne==null?new FSharpResult$2(0,[void 0]):Result_Map(some,ee(te,ne))}function list(ee,te,ne){if(Array.isArray(ne)){let re=-1;return Result_Map(reverse$1,fold$2((ie,se)=>{if(re=re+1|0,ie.tag===0){const oe=ee(te+".["+int32ToString(re)+"]",se);return oe.tag===0?new FSharpResult$2(0,[cons(oe.fields[0],ie.fields[0])]):new FSharpResult$2(1,[oe.fields[0]])}else return ie},new FSharpResult$2(0,[empty$3()]),ne))}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a list",ne])]])}function seq$1(ee,te,ne){if(Array.isArray(ne)){let re=-1;return Result_Map(reverse,fold$2((ie,se)=>{if(re=re+1|0,ie.tag===0){const oe=ee(te+".["+int32ToString(re)+"]",se);return oe.tag===0?new FSharpResult$2(0,[append([oe.fields[0]],ie.fields[0])]):new FSharpResult$2(1,[oe.fields[0]])}else return ie},new FSharpResult$2(0,[[]]),ne))}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a seq",ne])]])}function array(ee,te,ne){if(Array.isArray(ne)){let re=-1;const ie=ne;return fold$2((se,oe)=>{if(re=re+1|0,se.tag===0){const me=se.fields[0],he=ee(te+".["+int32ToString(re)+"]",oe);return he.tag===0?(me[re]=he.fields[0],new FSharpResult$2(0,[me])):new FSharpResult$2(1,[he.fields[0]])}else return se},new FSharpResult$2(0,[fill(new Array(ie.length),0,ie.length,null)]),ie)}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["an array",ne])]])}function oneOf(ee,te,ne){return((ie,se)=>{e:for(;;){const oe=ie,me=se;if(isEmpty(oe))return new FSharpResult$2(1,[[te,new ErrorReason(7,[me])]]);{const he=fromValue(te,uncurry2(head(oe)),ne);if(he.tag===1){ie=tail(oe),se=append$1(me,singleton$2(he.fields[0]));continue e}else return new FSharpResult$2(0,[he.fields[0]])}}})(ee,empty$3())}function succeed(ee,te,ne){return new FSharpResult$2(0,[ee])}function andThen(ee,te,ne,re){const ie=te(ne,re);return ie.tag===0?ee(ie.fields[0],ne,re):new FSharpResult$2(1,[ie.fields[0]])}function map(ee,te,ne,re){const ie=te(ne,re);return ie.tag===1?new FSharpResult$2(1,[ie.fields[0]]):new FSharpResult$2(0,[ee(ie.fields[0])])}function tuple2(ee,te){let ne;const re=ee;return ne=ie=>se=>index$2(0,re,ie,se),ie=>se=>andThen(uncurry3(oe=>{let me;const he=te;return me=fe=>ae=>index$2(1,he,fe,ae),fe=>ae=>andThen((le,ye,ve)=>succeed([oe,le]),uncurry2(me),fe,ae)}),uncurry2(ne),ie,se)}function toMap(ee){return ofSeq$1(ee,{Compare:compare$2})}function toSet(ee){return ofSeq(ee,{Compare:compare$2})}function autoObject(ee,te,ne){return ne!==null&&Object.getPrototypeOf(ne||!1)===Object.prototype?foldBack$1((re,ie)=>{const se=re[0];return ie.tag===0?Result_Map(oe=>cons(oe,ie.fields[0]),re[1](te+"."+se)(ne[se])):ie},ee,new FSharpResult$2(0,[empty$3()])):new FSharpResult$2(1,[[te,new ErrorReason(0,["an object",ne])]])}function autoObject2(ee,te,ne,re){return re!==null&&Object.getPrototypeOf(re||!1)===Object.prototype?fold((ie,se)=>{if(ie.tag===0){const oe=ee(ne,se);if(oe.tag===0){const me=te(ne+"."+se,re[se]);return me.tag===0?new FSharpResult$2(0,[cons([oe.fields[0],me.fields[0]],ie.fields[0])]):new FSharpResult$2(1,[me.fields[0]])}else return new FSharpResult$2(1,[oe.fields[0]])}else return ie},new FSharpResult$2(0,[empty$3()]),Object.keys(re)):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an object",re])]])}function mixedArray(ee,te,ne,re){let ie;const se=te.length+ee|0;if(se!==re.length)return new FSharpResult$2(1,[[ne,new ErrorReason(6,[(ie=re.length|0,toText(printf("Expected array of length %i but got %i"))(se)(ie))])]]);{let oe=new FSharpResult$2(0,[empty$3()]);for(let me=ee;me<=re.length-1;me++)if(oe.tag===0){const he=oe.fields[0],fe=toText(printf("%s[%i]"))(ne)(me),ae=te[me-ee],le=re[me];oe=Result_Map(ye=>cons(ye,he),ae(fe)(le))}return Result_Map(reverse$1,oe)}}function makeUnion(ee,te,ne,re,ie,se){const oe=tryFind$1(me=>name(me)===re,getUnionCases(ne));if(oe!=null){const me=oe,he=map$4(fe=>autoDecoder(ee,te,!1,fe[1]),getUnionCaseFields(me));return Result_Map(fe=>makeUnion$1(me,toArray$1(fe)),he.length===0&&se.length<=1?new FSharpResult$2(0,[empty$3()]):mixedArray(1,he,ie,se))}else return new FSharpResult$2(1,[[ie,new ErrorReason(6,["Cannot find case "+re+" in "+fullName(ne)])]])}function autoDecodeRecordsAndUnions(ee,te,ne,re){let ie;const se=new FSharpRef(defaultOf());let oe;const me=fullName(re);oe=me===""?ee:add$2(me,se,ee);let he;if(isRecord(re)){const fe=map$4(ae=>[Util_Casing_convert(te,name(ae)),autoDecoder(oe,te,!1,ae[1])],getRecordElements(re));he=ae=>le=>Result_Map(ye=>makeRecord(re,toArray$1(ye)),autoObject(fe,ae,le))}else if(isUnion(re))he=fe=>ae=>{if(typeof ae=="string")return makeUnion(oe,te,re,ae,fe,[]);if(Array.isArray(ae)){const le=ae;return Result_Bind(ye=>makeUnion(oe,te,re,ye,fe,le),string(fe+"[0]",le[0]))}else return new FSharpResult$2(1,[[fe,new ErrorReason(0,["a string or array",ae])]])};else if(ne)he=fe=>ae=>new FSharpResult$2(1,[[fe,new ErrorReason(2,["an extra coder for "+fullName(re),ae])]]);else throw new Error((ie=fullName(re),toText(printf("Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(ie)));return se.contents=he,he}function autoDecoder(ee,te,ne,re){let ie,se,oe,me;const he=fullName(re),fe=tryFind(he,ee);if(fe==null)if(isArray(re)){const ae=autoDecoder(ee,te,!1,getElementType(re));return le=>ye=>array(uncurry2(ae),le,ye)}else if(isEnum(re)){const ae=fullName(getEnumUnderlyingType(re));if(ae==="System.SByte")return le=>ye=>{const ve=re,de=le,ge=ye,ue=sbyte(de)(ge);if(ue.tag===1)return new FSharpResult$2(1,[ue.fields[0]]);{const Te=ue.fields[0]|0;return contains$1(Te,getEnumValues(ve),{Equals:($e,ke)=>$e===ke,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(ve,Te.toString())]):new FSharpResult$2(1,[[de,new ErrorReason(1,[fullName(ve),ge,"Unkown value provided for the enum"])]])}};if(ae==="System.Byte")return le=>ye=>{const ve=re,de=le,ge=ye,ue=byte(de)(ge);if(ue.tag===1)return new FSharpResult$2(1,[ue.fields[0]]);{const Te=ue.fields[0];return contains$1(Te,getEnumValues(ve),{Equals:($e,ke)=>$e===ke,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(ve,Te.toString())]):new FSharpResult$2(1,[[de,new ErrorReason(1,[fullName(ve),ge,"Unkown value provided for the enum"])]])}};if(ae==="System.Int16")return le=>ye=>{const ve=re,de=le,ge=ye,ue=int16(de)(ge);if(ue.tag===1)return new FSharpResult$2(1,[ue.fields[0]]);{const Te=ue.fields[0]|0;return contains$1(Te,getEnumValues(ve),{Equals:($e,ke)=>$e===ke,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(ve,int16ToString(Te))]):new FSharpResult$2(1,[[de,new ErrorReason(1,[fullName(ve),ge,"Unkown value provided for the enum"])]])}};if(ae==="System.UInt16")return le=>ye=>{const ve=re,de=le,ge=ye,ue=uint16(de)(ge);if(ue.tag===1)return new FSharpResult$2(1,[ue.fields[0]]);{const Te=ue.fields[0];return contains$1(Te,getEnumValues(ve),{Equals:($e,ke)=>$e===ke,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(ve,Te.toString())]):new FSharpResult$2(1,[[de,new ErrorReason(1,[fullName(ve),ge,"Unkown value provided for the enum"])]])}};if(ae==="System.Int32")return le=>ye=>{const ve=re,de=le,ge=ye,ue=int(de)(ge);if(ue.tag===1)return new FSharpResult$2(1,[ue.fields[0]]);{const Te=ue.fields[0]|0;return contains$1(Te,getEnumValues(ve),{Equals:($e,ke)=>$e===ke,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(ve,int32ToString(Te))]):new FSharpResult$2(1,[[de,new ErrorReason(1,[fullName(ve),ge,"Unkown value provided for the enum"])]])}};if(ae==="System.UInt32")return le=>ye=>{const ve=re,de=le,ge=ye,ue=uint32(de)(ge);if(ue.tag===1)return new FSharpResult$2(1,[ue.fields[0]]);{const Te=ue.fields[0];return contains$1(Te,getEnumValues(ve),{Equals:($e,ke)=>$e===ke,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(ve,Te.toString())]):new FSharpResult$2(1,[[de,new ErrorReason(1,[fullName(ve),ge,"Unkown value provided for the enum"])]])}};{const le=fullName(re),ye=toFail(printf("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n "))(le);return ve=>ye(ve)}}else if(isGenericType(re))if(isTuple(re)){const ae=map$4(le=>autoDecoder(ee,te,!1,le),getTupleElements(re));return le=>ye=>Array.isArray(ye)?Result_Map(ve=>makeTuple(toArray$1(ve)),mixedArray(0,ae,le,ye)):new FSharpResult$2(1,[[le,new ErrorReason(0,["an array",ye])]])}else{const ae=fullName(getGenericTypeDefinition(re));if(ae==="Microsoft.FSharp.Core.FSharpOption`1[System.Object]")return ie=autoDecoder(ee,te,!0,getGenerics(re)[0]),le=>ye=>option$1(uncurry2(ie),le,ye);if(ae==="Microsoft.FSharp.Collections.FSharpList`1[System.Object]")return se=autoDecoder(ee,te,!1,getGenerics(re)[0]),le=>ye=>list(uncurry2(se),le,ye);if(ae==="System.Collections.Generic.IEnumerable`1[System.Object]")return oe=autoDecoder(ee,te,!1,getGenerics(re)[0]),le=>ye=>seq$1(uncurry2(oe),le,ye);if(ae==="Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"){const le=autoDecoder(ee,te,!1,getGenerics(re)[0]),ye=autoDecoder(ee,te,!1,getGenerics(re)[1]);let ve;const de=ofArray$2([ge=>ue=>autoObject2(uncurry2(le),uncurry2(ye),ge,ue),(me=tuple2(uncurry2(le),uncurry2(ye)),ge=>ue=>list(uncurry2(me),ge,ue))]);return ve=ge=>ue=>oneOf(de,ge,ue),ge=>ue=>map(toMap,uncurry2(ve),ge,ue)}else if(ae==="Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"){const le=autoDecoder(ee,te,!1,getGenerics(re)[0]);return ye=>ve=>{const de=array(uncurry2(le),ye,ve);return de.tag===0?new FSharpResult$2(0,[toSet(de.fields[0])]):new FSharpResult$2(1,[de.fields[0]])}}else return autoDecodeRecordsAndUnions(ee,te,ne,re)}else return he==="System.Boolean"?ae=>le=>bool(ae,le):he==="Microsoft.FSharp.Core.Unit"?ae=>le=>unit$1(ae,le):he==="System.String"?ae=>le=>string(ae,le):he==="System.Char"?ae=>le=>char(ae,le):he==="System.SByte"?sbyte:he==="System.Byte"?byte:he==="System.Int16"?int16:he==="System.UInt16"?uint16:he==="System.Int32"?int:he==="System.UInt32"?uint32:he==="System.Double"?ae=>le=>float(ae,le):he==="System.Single"?ae=>le=>float32(ae,le):he==="System.DateTime"?ae=>le=>datetimeUtc(ae,le):he==="System.DateTimeOffset"?ae=>le=>datetimeOffset$1(ae,le):he==="System.TimeSpan"?ae=>le=>timespan$1(ae,le):he==="System.Guid"?ae=>le=>guid$1(ae,le):he==="System.Object"?ae=>le=>new FSharpResult$2(0,[le]):autoDecodeRecordsAndUnions(ee,te,ne,re);else{const ae=fe;return le=>ye=>ae.contents(le)(ye)}}function makeExtra$1(ee){return ee!=null?map$1((te,ne)=>new FSharpRef(ne[1]),ee.Coders):empty$1({Compare:comparePrimitives})}function Auto_generateBoxedDecoder_Z6670B51(ee,te,ne){const re=defaultArg(te,new CaseStrategy(0,[]));return autoDecoder(makeExtra$1(ne),re,!1,ee)}function guid(ee){return ee}const nil=defaultOf();function seq(ee){return Array.from(ee)}function datetimeOffset(ee){return toString$2(ee,"O")}function timespan(ee){return toString$1(ee)}function unit(){return defaultOf()}function datetime(ee){return toString$2(ee,"O")}function toString(ee,te){return JSON.stringify(te,void 0,some(ee))}function option(ee){return te=>defaultArgWith(map$5(ee,te),()=>nil)}function autoEncodeRecordsAndUnions(ee,te,ne,re){let ie;const se=new FSharpRef(defaultOf());let oe;const me=fullName(re);oe=me===""?ee:add$2(me,se,ee);let he;if(isRecord(re)){const fe=map$4(ae=>{const le=Util_Casing_convert(te,name(ae)),ye=autoEncoder(oe,te,ne,ae[1]);return ve=>de=>{const ge=getRecordField(ve,ae);return(!ne||ne&&ge!=null)&&(de[le]=ye(ge)),de}},getRecordElements(re));he=ae=>fold((le,ye)=>ye(ae)(le),{},fe)}else if(isUnion(re))he=fe=>{const ae=getUnionFields(fe,re),le=ae[0],ye=ae[1],ve=ye.length|0;if(ve===0)return name(le);{const de=ve|0,ge=getUnionCaseFields(le),ue=fill(new Array(de+1),0,de+1,null);ue[0]=name(le);for(let Te=1;Te<=de;Te++){const $e=autoEncoder(oe,te,ne,ge[Te-1][1]);ue[Te]=$e(ye[Te-1])}return ue}};else throw new Error((ie=fullName(re),toText(printf("Cannot generate auto encoder for %s. Please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(ie)));return se.contents=he,he}function autoEncoder(ee,te,ne,re){const ie=fullName(re),se=tryFind(ie,ee);if(se==null)if(isArray(re)){const oe=autoEncoder(ee,te,ne,getElementType(re));return me=>seq(map$2(oe,me))}else if(isEnum(re)){const oe=fullName(getEnumUnderlyingType(re));if(oe==="System.SByte")return me=>me;if(oe==="System.Byte")return me=>me;if(oe==="System.Int16")return me=>me;if(oe==="System.UInt16")return me=>me;if(oe==="System.Int32")return me=>me;if(oe==="System.UInt32")return me=>me;{const me=fullName(re);return toFail(printf("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\n\nIf you can't use one of these types, please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\n "))(me)}}else if(isGenericType(re))if(isTuple(re)){const oe=map$4(me=>autoEncoder(ee,te,ne,me),getTupleElements(re));return me=>seq(mapIndexed((he,fe)=>oe[he](fe),me))}else{const oe=fullName(getGenericTypeDefinition(re));if(oe==="Microsoft.FSharp.Core.FSharpOption`1[System.Object]"){const me=new Lazy(()=>option(autoEncoder(ee,te,ne,getGenerics(re)[0])));return he=>he==null?nil:me.Value(he)}else if(oe==="Microsoft.FSharp.Collections.FSharpList`1[System.Object]"||oe==="Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"||oe==="System.Collections.Generic.IEnumerable`1[System.Object]"){const me=autoEncoder(ee,te,ne,getGenerics(re)[0]);return he=>seq(map$2(me,he))}else if(oe==="Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"){const me=getGenerics(re)[0],he=autoEncoder(ee,te,ne,getGenerics(re)[1]);if(fullName(me)==="System.String"||fullName(me)==="System.Guid")return fe=>fold((ae,le)=>{const ye=le;return ae[ye[0]]=he(ye[1]),ae},{},fe);{let fe;return fe=autoEncoder(ee,te,ne,me),le=>seq(map$2(ye=>{const ve=ye;return[fe(ve[0]),he(ve[1])]},le))}}else return autoEncodeRecordsAndUnions(ee,te,ne,re)}else return ie==="System.Boolean"?oe=>oe:ie==="Microsoft.FSharp.Core.Unit"?unit:ie==="System.String"?oe=>oe:ie==="System.Char"?oe=>oe:ie==="System.SByte"?oe=>oe:ie==="System.Byte"?oe=>oe:ie==="System.Int16"?oe=>oe:ie==="System.UInt16"?oe=>oe:ie==="System.Int32"?oe=>oe:ie==="System.UInt32"?oe=>oe:ie==="System.Double"?oe=>oe:ie==="System.Single"?oe=>oe:ie==="System.DateTime"?datetime:ie==="System.DateTimeOffset"?datetimeOffset:ie==="System.TimeSpan"?timespan:ie==="System.Guid"?guid:ie==="System.Object"?oe=>oe:autoEncodeRecordsAndUnions(ee,te,ne,re);else{const oe=se;return me=>oe.contents(me)}}function makeExtra(ee){return ee!=null?map$1((te,ne)=>new FSharpRef(ne[0]),ee.Coders):empty$1({Compare:comparePrimitives})}function Auto_generateBoxedEncoder_437914C6(ee,te,ne,re){const ie=defaultArg(te,new CaseStrategy(0,[])),se=defaultArg(re,!0);return autoEncoder(makeExtra(ne),ie,se,ee)}class GetInitStateResult extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Success","Failure"]}}class BackendService{constructor(te,ne){this.accessToken=ne,this.baseUrl="".concat(te,"/workplace-policies/backend")}}function BackendService_$ctor_Z384F8060(ee,te){return new BackendService(ee,te)}function BackendService__GetInitState(ee){return singleton.Delay(()=>{let te;return singleton.Bind(Http_send((te=Http_method(new HttpMethod(0,[]),Http_request("".concat(ee.baseUrl,"/init"))),Http_header(Headers_authorization("Bearer ".concat(ee.accessToken)),te))),ne=>{const re=ne;return re.statusCode===200?singleton.Return(Result_Map(ie=>new GetInitStateResult(0,[ie]),fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(InitResponse$reflection(),new CaseStrategy(1,[]),void 0)),re.responseText))):singleton.Return(Result_Map(ie=>new GetInitStateResult(1,[ie]),fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(InitResponseError$reflection(),new CaseStrategy(1,[]),void 0)),re.responseText)))})})}function BackendService__SendCommand_Z3B2D738(ee,te){return singleton.Delay(()=>{let ne,re,ie;const se=new CommandRequest(te);return singleton.Bind(Http_send((ne=(re=(ie=Http_method(new HttpMethod(1,[]),Http_request("".concat(ee.baseUrl,"/command"))),Http_header(Headers_authorization("Bearer ".concat(ee.accessToken)),ie)),Http_content(new BodyContent(1,[toString(0,Auto_generateBoxedEncoder_437914C6(CommandRequest$reflection(),new CaseStrategy(1,[]),void 0,void 0)(se))]),re)),Http_header(Headers_contentType("application/json"),ne))),oe=>oe.statusCode===200?singleton.Return(new FSharpResult$2(0,[void 0])):singleton.Return(new FSharpResult$2(1,["Command request error"])))})}function Sub_none(){return empty$3()}function Sub_Internal_SubId_toString(ee){return join("/",ee)}function Sub_Internal_Fx_warnDupe(ee,te){const ne=new Error("Duplicate SubId");return ee(["Duplicate SubId: "+Sub_Internal_SubId_toString(te),ne])}function Sub_Internal_Fx_tryStop(ee,te,ne){try{disposeSafe(ne)}catch(re){ee(["Error stopping subscription: "+Sub_Internal_SubId_toString(te),re])}}function Sub_Internal_Fx_tryStart(ee,te,ne,re){try{return[ne,re(te)]}catch(ie){ee(["Error starting subscription: "+Sub_Internal_SubId_toString(ne),ie]);return}}function Sub_Internal_Fx_stop(ee,te){iterate$1(ne=>{Sub_Internal_Fx_tryStop(ee,ne[0],ne[1])},te)}function Sub_Internal_Fx_change(ee,te,ne,re,ie,se){return iterate$1(oe=>{Sub_Internal_Fx_warnDupe(ee,oe)},ne),iterate$1(oe=>{Sub_Internal_Fx_tryStop(ee,oe[0],oe[1])},re),append$1(ie,choose(oe=>Sub_Internal_Fx_tryStart(ee,te,oe[0],oe[1]),se))}function Sub_Internal_NewSubs_init(){return[empty$3(),empty({Compare:compare$2}),empty$3()]}function Sub_Internal_NewSubs_update(ee,te,ne,re,ie){return contains(ee,re)?[cons(ee,ne),re,ie]:[ne,add$1(ee,re),cons([ee,te],ie)]}function Sub_Internal_NewSubs_calculate(ee){return foldBack((te,ne)=>Sub_Internal_NewSubs_update(te[0],te[1],ne[0],ne[1],ne[2]),ee,Sub_Internal_NewSubs_init())}const Sub_Internal_empty=empty$3();function Sub_Internal_diff(ee,te){const ne=ofList(map$3(oe=>oe[0],ee),{Compare:compare$2}),re=Sub_Internal_NewSubs_calculate(te),ie=re[1],se=re[0];if(ne.Equals(ie))return[se,empty$3(),ee,empty$3()];{const oe=partition(me=>contains(me[0],ie),ee);return[se,oe[1],oe[0],filter(me=>!contains(me[0],ne),re[2])]}}class Observer{constructor(te,ne,re){this.OnNext=te,this.OnError=ne||(ie=>{}),this.OnCompleted=re||(()=>{})}}function add(ee,te){te.Subscribe(new Observer(ee))}class Event$2{constructor(){this.delegates=[]}_add(te){this.delegates.push(te)}_remove(te){const ne=this.delegates.indexOf(te);ne>-1&&this.delegates.splice(ne,1)}get Publish(){return createEvent(te=>{this._add(te)},te=>{this._remove(te)})}Trigger(te,ne){let re=null;const ie=ne===void 0?te:(re=te,ne);this.delegates.forEach(se=>{se(re,ie)})}}let Event$1=class extends Event$2{};function createEvent(ee,te){return{AddHandler(ne){ee(ne)},RemoveHandler(ne){te(ne)},Subscribe(ne){const re=(ie,se)=>ne.OnNext(se);return ee(re),{Dispose(){te(re)}}}}}class Timer{constructor(te){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=te&&te>0?te:100,this.AutoReset=!0,this._elapsed=new Event$1}Elapsed(){return this._elapsed.Publish}get Enabled(){return this._enabled}set Enabled(te){!this._isDisposed&&this._enabled!==te&&(this._enabled=te,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}}const Timer$1=Timer;function Log_onError(ee,te){console.error(some(ee),te)}function Timer_delay(ee,te){let ne,re=new Timer$1(ee);re.AutoReset=!1,ne=re,add(te,ne.Elapsed()),ne.Enabled=!0,ne.Start()}function Cmd_exec(ee,te,ne){iterate$1(re=>{try{re(te)}catch(ie){ee(ie)}},ne)}function Cmd_none(){return empty$3()}function Cmd_ofEffect(ee){return singleton$2(ee)}function Cmd_OfAsyncWith_perform(ee,te,ne,re){return singleton$2(ie=>{ee(singleton.Delay(()=>singleton.Bind(catchAsync(te(ne)),se=>{const oe=se;return oe.tag===0&&ie(re(oe.fields[0])),singleton.Zero()})))})}function Cmd_OfAsync_start(ee){Timer_delay(1,te=>{startImmediate(ee)})}class RingState$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Writable","ReadWritable"]}}class RingBuffer$1{constructor(te){this.state=new RingState$1(0,[fill(new Array(max(comparePrimitives,te,10)),0,max(comparePrimitives,te,10),null),0])}}function RingBuffer$1_$ctor_Z524259A4(ee){return new RingBuffer$1(ee)}function RingBuffer$1__Pop(ee){const te=ee.state;if(te.tag===1){const ne=te.fields[1]|0,re=te.fields[2]|0,ie=te.fields[0],se=(re+1)%ie.length|0;return se===ne?ee.state=new RingState$1(0,[ie,ne]):ee.state=new RingState$1(1,[ie,ne,se]),some(ie[re])}else return}function RingBuffer$1__Push_2B595(ee,te){const ne=ee.state;if(ne.tag===1){const re=ne.fields[1]|0,ie=ne.fields[2]|0,se=ne.fields[0];se[re]=te;const oe=(re+1)%se.length|0;oe===ie?ee.state=new RingState$1(1,[RingBuffer$1__doubleSize(ee,ie,se),se.length,0]):ee.state=new RingState$1(1,[se,oe,ie])}else{const re=ne.fields[1]|0,ie=ne.fields[0];ie[re]=te;const se=(re+1)%ie.length|0;ee.state=new RingState$1(1,[ie,se,re])}}function RingBuffer$1__doubleSize(ee,te,ne){return Array.from(delay(()=>append(skip(te,ne),delay(()=>append(take(te,ne),delay(()=>collect(re=>singleton$1(defaultOf()),rangeDouble(0,1,ne.length))))))))}class Program$4 extends Record{constructor(te,ne,re,ie,se,oe,me){super(),this.init=te,this.update=ne,this.subscribe=re,this.view=ie,this.setState=se,this.onError=oe,this.termination=me}}function ProgramModule_mkProgram(ee,te,ne){return new Program$4(ee,te,re=>Sub_none(),ne,uncurry2(re=>{const ie=curry2(ne)(re);return se=>{ie(se)}}),re=>{Log_onError(re[0],re[1])},[re=>!1,re=>{}])}function ProgramModule_withSetState(ee,te){return new Program$4(te.init,te.update,te.subscribe,te.view,ee,te.onError,te.termination)}function ProgramModule_init(ee){return ee.init}function ProgramModule_map(ee,te,ne,re,ie,se,oe){const me=curry2(ee)(oe.init),he=curry3(te)(curry2(oe.update)),fe=curry3(ne)(curry2(oe.view)),ae=curry3(re)(curry2(oe.setState));return new Program$4(me,uncurry2(he),curry2(ie)(oe.subscribe),uncurry2(fe),uncurry2(ae),oe.onError,se(oe.termination))}function ProgramModule_runWithDispatch(ee,te,ne){let re;const ie=ne.init(te),se=ie[0],oe=ne.subscribe(se),me=ne.termination,he=RingBuffer$1_$ctor_Z524259A4(10);let fe=!1,ae=se,le=Sub_Internal_empty,ye=!1;const ve=ue=>{ye||(RingBuffer$1__Push_2B595(he,ue),fe||(fe=!0,ge(),fe=!1))},de=curry2(ee)(ve),ge=()=>{let ue,Te=RingBuffer$1__Pop(he);for(;!ye&&Te!=null;){const $e=value(Te);if(me[0]($e))Sub_Internal_Fx_stop(ne.onError,le),me[1](ae),ye=!0;else{const ke=ne.update($e,ae),Ce=ke[0],ce=ne.subscribe(Ce);ne.setState(Ce,de),Cmd_exec(be=>{ne.onError([toText(printf("Error handling the message: %A"))($e),be])},de,ke[1]),ae=Ce,le=(ue=Sub_Internal_diff(le,ce),Sub_Internal_Fx_change(ne.onError,de,ue[0],ue[1],ue[2],ue[3])),Te=RingBuffer$1__Pop(he)}}};fe=!0,ne.setState(se,de),Cmd_exec(ue=>{ne.onError([toText(printf("Error intitializing:")),ue])},de,ie[1]),le=(re=Sub_Internal_diff(le,oe),Sub_Internal_Fx_change(ne.onError,de,re[0],re[1],re[2],re[3])),ge(),fe=!1}function ProgramModule_runWith(ee,te){ProgramModule_runWithDispatch(uncurry2(ne=>ne),ee,te)}function getDefaultExportFromCjs(ee){return ee&&ee.__esModule&&Object.prototype.hasOwnProperty.call(ee,"default")?ee.default:ee}function getAugmentedNamespace(ee){if(ee.__esModule)return ee;var te=ee.default;if(typeof te=="function"){var ne=function re(){return this instanceof re?Reflect.construct(te,arguments,this.constructor):te.apply(this,arguments)};ne.prototype=te.prototype}else ne={};return Object.defineProperty(ne,"__esModule",{value:!0}),Object.keys(ee).forEach(function(re){var ie=Object.getOwnPropertyDescriptor(ee,re);Object.defineProperty(ne,re,ie.get?ie:{enumerable:!0,get:function(){return ee[re]}})}),ne}var shim={exports:{}},useSyncExternalStoreShim_production_min={};const require$$0=getAugmentedNamespace(compat_module);/**
|
|
1
|
+
var wi=Object.defineProperty;var Ai=(ee,te,ne)=>te in ee?wi(ee,te,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ee[te]=ne;var An=(ee,te,ne)=>(Ai(ee,typeof te!="symbol"?te+"":te,ne),ne),or=(ee,te,ne)=>{if(!te.has(ee))throw TypeError("Cannot "+ne)};var ce=(ee,te,ne)=>(or(ee,te,"read from private field"),ne?ne.call(ee):te.get(ee)),We=(ee,te,ne)=>{if(te.has(ee))throw TypeError("Cannot add the same private member more than once");te instanceof WeakSet?te.add(ee):te.set(ee,ne)},st=(ee,te,ne,re)=>(or(ee,te,"write to private field"),re?re.call(ee,ne):te.set(ee,ne),ne);var Nn=(ee,te,ne,re)=>({set _(ie){st(ee,te,ie,ne)},get _(){return ce(ee,te,re)}}),Ke=(ee,te,ne)=>(or(ee,te,"access private method"),ne);(function(){"use strict";function _mergeNamespaces(ee,te){for(var ne=0;ne<te.length;ne++){const re=te[ne];if(typeof re!="string"&&!Array.isArray(re)){for(const ie in re)if(ie!=="default"&&!(ie in ee)){const se=Object.getOwnPropertyDescriptor(re,ie);se&&Object.defineProperty(ee,ie,se.get?se:{enumerable:!0,get:()=>re[ie]})}}}return Object.freeze(Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"}))}class Some{constructor(te){this.value=te}toJSON(){return this.value}toString(){return String(this.value)}GetHashCode(){return structuralHash(this.value)}Equals(te){return te==null?!1:equals$2(this.value,te instanceof Some?te.value:te)}CompareTo(te){return te==null?1:compare$2(this.value,te instanceof Some?te.value:te)}}function value(ee){if(ee==null)throw new Error("Option has no value");return ee instanceof Some?ee.value:ee}function isArrayLike(ee){return Array.isArray(ee)||ArrayBuffer.isView(ee)}function isEnumerable(ee){return ee!=null&&typeof ee.GetEnumerator=="function"}function isComparable(ee){return ee!=null&&typeof ee.CompareTo=="function"}function isEquatable(ee){return ee!=null&&typeof ee.Equals=="function"}function isHashable(ee){return ee!=null&&typeof ee.GetHashCode=="function"}function isDisposable(ee){return ee!=null&&typeof ee.Dispose=="function"}function disposeSafe(ee){isDisposable(ee)&&ee.Dispose()}function defaultOf(){return null}function sameConstructor(ee,te){var ne,re;return((ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor)===((re=Object.getPrototypeOf(te))==null?void 0:re.constructor)}class Enumerator{constructor(te){this.iter=te,this.current=defaultOf()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const te=this.iter.next();return this.current=te.value,!te.done}"System.Collections.IEnumerator.Reset"(){throw new Error("JS iterators cannot be reset")}Dispose(){}}function getEnumerator(ee){return isEnumerable(ee)?ee.GetEnumerator():new Enumerator(ee[Symbol.iterator]())}function toIterator(ee){return{next(){const te=ee["System.Collections.IEnumerator.MoveNext"](),ne=te?ee["System.Collections.Generic.IEnumerator`1.get_Current"]():void 0;return{done:!te,value:ne}}}}class Lazy{constructor(te){this.factory=te,this.isValueCreated=!1}get Value(){return this.isValueCreated||(this.createdValue=this.factory(),this.isValueCreated=!0),this.createdValue}get IsValueCreated(){return this.isValueCreated}}function padWithZeros(ee,te){let ne=ee.toString(10);for(;ne.length<te;)ne="0"+ne;return ne}function padLeftAndRightWithZeros(ee,te,ne){let re=ee.toString(10);for(;re.length<te;)re="0"+re;for(;re.length<ne;)re=re+"0";return re}function dateOffset(ee){const te=ee;return typeof te.offset=="number"?te.offset:ee.kind===1?0:ee.getTimezoneOffset()*-6e4}function int16ToString(ee,te){return ee=ee<0&&te!=null&&te!==10?65535+ee+1:ee,ee.toString(te)}function int32ToString(ee,te){return ee=ee<0&&te!=null&&te!==10?4294967295+ee+1:ee,ee.toString(te)}class ObjectRef{static id(te){return ObjectRef.idMap.has(te)||ObjectRef.idMap.set(te,++ObjectRef.count),ObjectRef.idMap.get(te)}}ObjectRef.idMap=new WeakMap,ObjectRef.count=0;function stringHash(ee){let te=0,ne=5381;const re=ee.length;for(;te<re;)ne=ne*33^ee.charCodeAt(te++);return ne}function numberHash(ee){return ee*2654435761|0}function combineHashCodes(ee){let te=0;const ne=ee.length;for(let re=0;re<ne;re++){const ie=ee[re];te=(te<<5)+te^ie}return te}function dateHash(ee){return ee.getTime()}function arrayHash(ee){const te=ee.length,ne=new Array(te);for(let re=0;re<te;re++)ne[re]=structuralHash(ee[re]);return combineHashCodes(ne)}function structuralHash(ee){var te;if(ee==null)return 0;switch(typeof ee){case"boolean":return ee?1:0;case"number":return numberHash(ee);case"string":return stringHash(ee);default:{if(isHashable(ee))return ee.GetHashCode();if(isArrayLike(ee))return arrayHash(ee);if(ee instanceof Date)return dateHash(ee);if(((te=Object.getPrototypeOf(ee))==null?void 0:te.constructor)===Object){const ne=Object.values(ee).map(re=>structuralHash(re));return combineHashCodes(ne)}else return numberHash(ObjectRef.id(ee))}}}function equalArraysWith(ee,te,ne){if(ee==null)return te==null;if(te==null||ee.length!==te.length)return!1;for(let re=0;re<ee.length;re++)if(!ne(ee[re],te[re]))return!1;return!0}function equalArrays(ee,te){return equalArraysWith(ee,te,equals$2)}function equalObjects(ee,te){const ne=Object.keys(ee),re=Object.keys(te);if(ne.length!==re.length)return!1;ne.sort(),re.sort();for(let ie=0;ie<ne.length;ie++)if(ne[ie]!==re[ie]||!equals$2(ee[ne[ie]],te[re[ie]]))return!1;return!0}function equals$2(ee,te){var ne;return ee===te?!0:ee==null?te==null:te==null?!1:isEquatable(ee)?ee.Equals(te):isArrayLike(ee)?isArrayLike(te)&&equalArrays(ee,te):typeof ee!="object"?!1:ee instanceof Date?te instanceof Date&&compareDates(ee,te)===0:((ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor)===Object&&equalObjects(ee,te)}function compareDates(ee,te){let ne,re;return"offset"in ee&&"offset"in te?(ne=ee.getTime(),re=te.getTime()):(ne=ee.getTime()+dateOffset(ee),re=te.getTime()+dateOffset(te)),ne===re?0:ne<re?-1:1}function comparePrimitives(ee,te){return ee===te?0:ee<te?-1:1}function compareArraysWith(ee,te,ne){if(ee==null)return te==null?0:1;if(te==null)return-1;if(ee.length!==te.length)return ee.length<te.length?-1:1;for(let re=0,ie=0;re<ee.length;re++)if(ie=ne(ee[re],te[re]),ie!==0)return ie;return 0}function compareArrays(ee,te){return compareArraysWith(ee,te,compare$2)}function compareObjects(ee,te){const ne=Object.keys(ee),re=Object.keys(te);if(ne.length!==re.length)return ne.length<re.length?-1:1;ne.sort(),re.sort();for(let ie=0,se=0;ie<ne.length;ie++){const oe=ne[ie];if(oe!==re[ie])return oe<re[ie]?-1:1;if(se=compare$2(ee[oe],te[oe]),se!==0)return se}return 0}function compare$2(ee,te){var ne;return ee===te?0:ee==null?te==null?0:-1:te==null?1:isComparable(ee)?ee.CompareTo(te):isArrayLike(ee)?isArrayLike(te)?compareArrays(ee,te):-1:typeof ee!="object"?ee<te?-1:1:ee instanceof Date?te instanceof Date?compareDates(ee,te):-1:((ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor)===Object?compareObjects(ee,te):-1}function min(ee,te,ne){return ee(te,ne)<0?te:ne}function max(ee,te,ne){return ee(te,ne)>0?te:ne}function createObj(ee){const te={};for(const ne of ee)te[ne[0]]=ne[1];return te}function clear(ee){isArrayLike(ee)?ee.splice(0):ee.clear()}const curried=new WeakMap;function uncurry2(ee){if(ee==null)return null;const te=(ne,re)=>ee(ne)(re);return curried.set(te,ee),te}function curry2(ee){var te;return(te=curried.get(ee))!=null?te:ne=>re=>ee(ne,re)}function uncurry3(ee){if(ee==null)return null;const te=(ne,re,ie)=>ee(ne)(re)(ie);return curried.set(te,ee),te}function curry3(ee){var te;return(te=curried.get(ee))!=null?te:ne=>re=>ie=>ee(ne,re,ie)}function seqToString(ee){let te=0,ne="[";for(const re of ee){if(te===0)ne+=toString$4(re);else if(te===100){ne+="; ...";break}else ne+="; "+toString$4(re);te++}return ne+"]"}function toString$4(ee,te=0){var ne,re;if(ee!=null&&typeof ee=="object"){if(typeof ee.toString=="function")return ee.toString();if(Symbol.iterator in ee)return seqToString(ee);{const ie=(ne=Object.getPrototypeOf(ee))==null?void 0:ne.constructor;return ie===Object&&te<10?"{ "+Object.entries(ee).map(([se,oe])=>se+" = "+toString$4(oe,te+1)).join("\n ")+" }":(re=ie==null?void 0:ie.name)!=null?re:""}}return String(ee)}function unionToString(ee,te){if(te.length===0)return ee;{let ne,re=!0;return te.length===1?(ne=toString$4(te[0]),re=ne.indexOf(" ")>=0):ne=te.map(ie=>toString$4(ie)).join(", "),ee+(re?" (":" ")+ne+(re?")":"")}}class Union{get name(){return this.cases()[this.tag]}toJSON(){return this.fields.length===0?this.name:[this.name].concat(this.fields)}toString(){return unionToString(this.name,this.fields)}GetHashCode(){const te=this.fields.map(ne=>structuralHash(ne));return te.splice(0,0,numberHash(this.tag)),combineHashCodes(te)}Equals(te){return this===te?!0:sameConstructor(this,te)&&this.tag===te.tag?equalArrays(this.fields,te.fields):!1}CompareTo(te){return this===te?0:sameConstructor(this,te)?this.tag===te.tag?compareArrays(this.fields,te.fields):this.tag<te.tag?-1:1:-1}}function recordToJSON(ee){const te={},ne=Object.keys(ee);for(let re=0;re<ne.length;re++)te[ne[re]]=ee[ne[re]];return te}function recordToString(ee){return"{ "+Object.entries(ee).map(([te,ne])=>te+" = "+toString$4(ne)).join("\n ")+" }"}function recordGetHashCode(ee){const te=Object.values(ee).map(ne=>structuralHash(ne));return combineHashCodes(te)}function recordEquals(ee,te){if(ee===te)return!0;if(sameConstructor(ee,te)){const ne=Object.keys(ee);for(let re=0;re<ne.length;re++)if(!equals$2(ee[ne[re]],te[ne[re]]))return!1;return!0}else return!1}function recordCompareTo(ee,te){if(ee===te)return 0;if(sameConstructor(ee,te)){const ne=Object.keys(ee);for(let re=0;re<ne.length;re++){const ie=compare$2(ee[ne[re]],te[ne[re]]);if(ie!==0)return ie}return 0}else return-1}class Record{toJSON(){return recordToJSON(this)}toString(){return recordToString(this)}GetHashCode(){return recordGetHashCode(this)}Equals(te){return recordEquals(this,te)}CompareTo(te){return recordCompareTo(this,te)}}class FSharpRef{get contents(){return this.getter()}set contents(te){this.setter(te)}constructor(te,ne){typeof ne=="function"?(this.getter=te,this.setter=ne):(this.getter=()=>te,this.setter=re=>{te=re})}}class Exception{constructor(te){this.message=te}}function isException(ee){return ee instanceof Exception||ee instanceof Error}function isPromise(ee){return ee instanceof Promise}function ensureErrorOrException(ee){return isException(ee)||isPromise(ee)?ee:new Error(String(ee))}const symbol=Symbol("numeric");function isNumeric(ee){return typeof ee=="number"||(ee==null?void 0:ee[symbol])}function compare$1(ee,te){return typeof ee=="number"?ee<te?-1:ee>te?1:0:ee.CompareTo(te)}function multiply$1(ee,te){return typeof ee=="number"?ee*te:ee[symbol]().multiply(te)}function toFixed(ee,te){return typeof ee=="number"?ee.toFixed(te):ee[symbol]().toFixed(te)}function toPrecision(ee,te){return typeof ee=="number"?ee.toPrecision(te):ee[symbol]().toPrecision(te)}function toExponential(ee,te){return typeof ee=="number"?ee.toExponential(te):ee[symbol]().toExponential(te)}function toHex(ee){return typeof ee=="number"?(Number(ee)>>>0).toString(16):ee[symbol]().toHex()}var NumberStyles;(function(ee){ee[ee.AllowHexSpecifier=512]="AllowHexSpecifier"})(NumberStyles||(NumberStyles={}));function validResponse(ee,te){const[,ne,re,ie]=ee;return{sign:ne||"",prefix:re||"",digits:ie,radix:te}}function getRange(ee,te){switch(te){case 8:return ee?[0,255]:[-128,127];case 16:return ee?[0,65535]:[-32768,32767];case 32:return ee?[0,4294967295]:[-2147483648,2147483647];default:throw new Error("Invalid bit size.")}}function getInvalidDigits(ee){switch(ee){case 2:return/[^0-1]/;case 8:return/[^0-7]/;case 10:return/[^0-9]/;case 16:return/[^0-9a-fA-F]/;default:throw new Error("Invalid Base.")}}function getRadix(ee,te){if(te&NumberStyles.AllowHexSpecifier)return 16;switch(ee){case"0b":case"0B":return 2;case"0o":case"0O":return 8;case"0x":case"0X":return 16;default:return 10}}function isValid(ee,te,ne){const ie=/^\s*([\+\-])?(0[xXoObB])?([0-9a-fA-F]+)\s*$/.exec(ee.replace(/_/g,""));if(ie!=null){const[,,se,oe]=ie;if(ne=ne||getRadix(se,te),!getInvalidDigits(ne).test(oe))return validResponse(ie,ne)}return null}function parse$4(ee,te,ne,re,ie){const se=isValid(ee,te,ie);if(se!=null){let oe=Number.parseInt(se.sign+se.digits,se.radix);if(!Number.isNaN(oe)){const[he,ue]=getRange(!0,re);!ne&&se.radix!==10&&oe>=he&&oe<=ue&&(oe=oe<<32-re>>32-re);const[de,ae]=getRange(ne,re);if(oe>=de&&oe<=ae)return oe}}throw new Error("Input string was not in a correct format.")}function tryParse$4(ee,te,ne,re,ie){try{return ie.contents=parse$4(ee,te,ne,re),!0}catch{return!1}}var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(ee){}function Long(ee,te,ne){this.low=ee|0,this.high=te|0,this.unsigned=!!ne}Long.prototype.GetHashCode=function(){let ee=this.unsigned?1:0;return ee=(ee<<5)+ee^this.high,ee=(ee<<5)+ee^this.low,ee},Long.prototype.Equals=function(ee){return equals$1(this,ee)},Long.prototype.CompareTo=function(ee){return compare(this,ee)},Long.prototype.toString=function(ee){return toString$3(this,ee)},Long.prototype.toJSON=function(){return toString$3(this)},Long.prototype[symbol]=function(){const ee=this;return{multiply:te=>multiply(ee,te),toPrecision:te=>String(ee)+0 .toPrecision(te).substr(1),toExponential:te=>String(ee)+0 .toExponential(te).substr(1),toFixed:te=>String(ee)+0 .toFixed(te).substr(1),toHex:()=>toString$3(ee.unsigned?ee:fromBytes(toBytes(ee),!0),16)}},Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0});function isLong(ee){return(ee&&ee.__isLong__)===!0}var INT_CACHE={},UINT_CACHE={};function fromInt(ee,te){var ne,re,ie;return te?(ee>>>=0,(ie=0<=ee&&ee<256)&&(re=UINT_CACHE[ee],re)?re:(ne=fromBits(ee,(ee|0)<0?-1:0,!0),ie&&(UINT_CACHE[ee]=ne),ne)):(ee|=0,(ie=-128<=ee&&ee<128)&&(re=INT_CACHE[ee],re)?re:(ne=fromBits(ee,ee<0?-1:0,!1),ie&&(INT_CACHE[ee]=ne),ne))}function fromNumber(ee,te){if(isNaN(ee))return te?UZERO:ZERO;if(te){if(ee<0)return UZERO;if(ee>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(ee<=-TWO_PWR_63_DBL)return MIN_VALUE;if(ee+1>=TWO_PWR_63_DBL)return MAX_VALUE}return ee<0?negate(fromNumber(-ee,te)):fromBits(ee%TWO_PWR_32_DBL|0,ee/TWO_PWR_32_DBL|0,te)}function fromBits(ee,te,ne){return new Long(ee,te,ne)}var pow_dbl=Math.pow;function fromString$1(ee,te,ne){if(ee.length===0)throw Error("empty string");if(ee==="NaN"||ee==="Infinity"||ee==="+Infinity"||ee==="-Infinity")return ZERO;if(typeof te=="number"?(ne=te,te=!1):te=!!te,ne=ne||10,ne<2||36<ne)throw RangeError("radix");var re=ee.indexOf("-");if(re>0)throw Error("interior hyphen");if(re===0)return negate(fromString$1(ee.substring(1),te,ne));for(var ie=fromNumber(pow_dbl(ne,8)),se=ZERO,oe=0;oe<ee.length;oe+=8){var he=Math.min(8,ee.length-oe),ue=parseInt(ee.substring(oe,oe+he),ne);if(he<8){var de=fromNumber(pow_dbl(ne,he));se=add$3(multiply(se,de),fromNumber(ue))}else se=multiply(se,ie),se=add$3(se,fromNumber(ue))}return se.unsigned=te,se}function fromValue$1(ee,te){return typeof ee=="number"?fromNumber(ee,te):typeof ee=="string"?fromString$1(ee,te):fromBits(ee.low,ee.high,typeof te=="boolean"?te:ee.unsigned)}var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL*TWO_PWR_32_DBL,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0),UZERO=fromInt(0,!0),ONE=fromInt(1),UONE=fromInt(1,!0),NEG_ONE=fromInt(-1),MAX_VALUE=fromBits(-1,2147483647,!1),MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0),MIN_VALUE=fromBits(0,-2147483648,!1);function toInt(ee){return ee.unsigned?ee.low>>>0:ee.low}function toNumber$1(ee){return ee.unsigned?(ee.high>>>0)*TWO_PWR_32_DBL+(ee.low>>>0):ee.high*TWO_PWR_32_DBL+(ee.low>>>0)}function toString$3(ee,te){if(te=te||10,te<2||36<te)throw RangeError("radix");if(isZero(ee))return"0";if(isNegative(ee))if(equals$1(ee,MIN_VALUE)){var ne=fromNumber(te),re=divide(ee,ne),ie=subtract(multiply(re,ne),ee);return toString$3(re,te)+toInt(ie).toString(te)}else return"-"+toString$3(negate(ee),te);for(var se=fromNumber(pow_dbl(te,6),ee.unsigned),oe=ee,he="";;){var ue=divide(oe,se),de=toInt(subtract(oe,multiply(ue,se)))>>>0,ae=de.toString(te);if(oe=ue,isZero(oe))return ae+he;for(;ae.length<6;)ae="0"+ae;he=""+ae+he}}function isZero(ee){return ee.high===0&&ee.low===0}function isNegative(ee){return!ee.unsigned&&ee.high<0}function isOdd(ee){return(ee.low&1)===1}function equals$1(ee,te){return isLong(te)||(te=fromValue$1(te)),ee.unsigned!==te.unsigned&&ee.high>>>31===1&&te.high>>>31===1?!1:ee.high===te.high&&ee.low===te.low}function lessThan(ee,te){return compare(ee,te)<0}function greaterThan(ee,te){return compare(ee,te)>0}function greaterThanOrEqual(ee,te){return compare(ee,te)>=0}function compare(ee,te){if(isLong(te)||(te=fromValue$1(te)),equals$1(ee,te))return 0;var ne=isNegative(ee),re=isNegative(te);return ne&&!re?-1:!ne&&re?1:ee.unsigned?te.high>>>0>ee.high>>>0||te.high===ee.high&&te.low>>>0>ee.low>>>0?-1:1:isNegative(subtract(ee,te))?-1:1}function negate(ee){return!ee.unsigned&&equals$1(ee,MIN_VALUE)?MIN_VALUE:add$3(not(ee),ONE)}function add$3(ee,te){isLong(te)||(te=fromValue$1(te));var ne=ee.high>>>16,re=ee.high&65535,ie=ee.low>>>16,se=ee.low&65535,oe=te.high>>>16,he=te.high&65535,ue=te.low>>>16,de=te.low&65535,ae=0,le=0,Ae=0,_e=0;return _e+=se+de,Ae+=_e>>>16,_e&=65535,Ae+=ie+ue,le+=Ae>>>16,Ae&=65535,le+=re+he,ae+=le>>>16,le&=65535,ae+=ne+oe,ae&=65535,fromBits(Ae<<16|_e,ae<<16|le,ee.unsigned)}function subtract(ee,te){return isLong(te)||(te=fromValue$1(te)),add$3(ee,negate(te))}function multiply(ee,te){if(isZero(ee))return ee.unsigned?UZERO:ZERO;if(isLong(te)||(te=fromValue$1(te)),wasm){var ne=wasm.mul(ee.low,ee.high,te.low,te.high);return fromBits(ne,wasm.get_high(),ee.unsigned)}if(isZero(te))return ee.unsigned?UZERO:ZERO;if(equals$1(ee,MIN_VALUE))return isOdd(te)?MIN_VALUE:ZERO;if(equals$1(te,MIN_VALUE))return isOdd(ee)?MIN_VALUE:ZERO;if(isNegative(ee))return isNegative(te)?multiply(negate(ee),negate(te)):negate(multiply(negate(ee),te));if(isNegative(te))return negate(multiply(ee,negate(te)));if(lessThan(ee,TWO_PWR_24)&&lessThan(te,TWO_PWR_24))return fromNumber(toNumber$1(ee)*toNumber$1(te),ee.unsigned);var re=ee.high>>>16,ie=ee.high&65535,se=ee.low>>>16,oe=ee.low&65535,he=te.high>>>16,ue=te.high&65535,de=te.low>>>16,ae=te.low&65535,le=0,Ae=0,_e=0,me=0;return me+=oe*ae,_e+=me>>>16,me&=65535,_e+=se*ae,Ae+=_e>>>16,_e&=65535,_e+=oe*de,Ae+=_e>>>16,_e&=65535,Ae+=ie*ae,le+=Ae>>>16,Ae&=65535,Ae+=se*de,le+=Ae>>>16,Ae&=65535,Ae+=oe*ue,le+=Ae>>>16,Ae&=65535,le+=re*ae+ie*de+se*ue+oe*he,le&=65535,fromBits(_e<<16|me,le<<16|Ae,ee.unsigned)}function divide(ee,te){if(isLong(te)||(te=fromValue$1(te)),isZero(te))throw Error("division by zero");if(wasm){if(!ee.unsigned&&ee.high===-2147483648&&te.low===-1&&te.high===-1)return ee;var ne=(ee.unsigned?wasm.div_u:wasm.div_s)(ee.low,ee.high,te.low,te.high);return fromBits(ne,wasm.get_high(),ee.unsigned)}if(isZero(ee))return ee.unsigned?UZERO:ZERO;var re,ie,se;if(ee.unsigned){if(te.unsigned||(te=toUnsigned(te)),greaterThan(te,ee))return UZERO;if(greaterThan(te,shiftRightUnsigned(ee,1)))return UONE;se=UZERO}else{if(equals$1(ee,MIN_VALUE)){if(equals$1(te,ONE)||equals$1(te,NEG_ONE))return MIN_VALUE;if(equals$1(te,MIN_VALUE))return ONE;var oe=shiftRight(ee,1);return re=shiftLeft(divide(oe,te),1),equals$1(re,ZERO)?isNegative(te)?ONE:NEG_ONE:(ie=subtract(ee,multiply(te,re)),se=add$3(re,divide(ie,te)),se)}else if(equals$1(te,MIN_VALUE))return ee.unsigned?UZERO:ZERO;if(isNegative(ee))return isNegative(te)?divide(negate(ee),negate(te)):negate(divide(negate(ee),te));if(isNegative(te))return negate(divide(ee,negate(te)));se=ZERO}for(ie=ee;greaterThanOrEqual(ie,te);){re=Math.max(1,Math.floor(toNumber$1(ie)/toNumber$1(te)));for(var he=Math.ceil(Math.log(re)/Math.LN2),ue=he<=48?1:pow_dbl(2,he-48),de=fromNumber(re),ae=multiply(de,te);isNegative(ae)||greaterThan(ae,ie);)re-=ue,de=fromNumber(re,ee.unsigned),ae=multiply(de,te);isZero(de)&&(de=ONE),se=add$3(se,de),ie=subtract(ie,ae)}return se}function not(ee){return fromBits(~ee.low,~ee.high,ee.unsigned)}function shiftLeft(ee,te){return isLong(te)&&(te=toInt(te)),(te&=63)===0?ee:te<32?fromBits(ee.low<<te,ee.high<<te|ee.low>>>32-te,ee.unsigned):fromBits(0,ee.low<<te-32,ee.unsigned)}function shiftRight(ee,te){return isLong(te)&&(te=toInt(te)),(te&=63)===0?ee:te<32?fromBits(ee.low>>>te|ee.high<<32-te,ee.high>>te,ee.unsigned):fromBits(ee.high>>te-32,ee.high>=0?0:-1,ee.unsigned)}function shiftRightUnsigned(ee,te){if(isLong(te)&&(te=toInt(te)),te&=63,te===0)return ee;var ne=ee.high;if(te<32){var re=ee.low;return fromBits(re>>>te|ne<<32-te,ne>>>te,ee.unsigned)}else return fromBits(te===32?ne:ne>>>te-32,0,ee.unsigned)}function toUnsigned(ee){return ee.unsigned?ee:fromBits(ee.low,ee.high,!0)}function toBytes(ee,te){return te?toBytesLE(ee):toBytesBE(ee)}function toBytesLE(ee){var te=ee.high,ne=ee.low;return[ne&255,ne>>>8&255,ne>>>16&255,ne>>>24,te&255,te>>>8&255,te>>>16&255,te>>>24]}function toBytesBE(ee){var te=ee.high,ne=ee.low;return[te>>>24,te>>>16&255,te>>>8&255,te&255,ne>>>24,ne>>>16&255,ne>>>8&255,ne&255]}function fromBytes(ee,te,ne){return ne?fromBytesLE(ee,te):fromBytesBE(ee,te)}function fromBytesLE(ee,te){return new Long(ee[0]|ee[1]<<8|ee[2]<<16|ee[3]<<24,ee[4]|ee[5]<<8|ee[6]<<16|ee[7]<<24,te)}function fromBytesBE(ee,te){return new Long(ee[4]<<24|ee[5]<<16|ee[6]<<8|ee[7],ee[0]<<24|ee[1]<<16|ee[2]<<8|ee[3],te)}const op_Division=divide,toNumber=toNumber$1;class CaseInfo{constructor(te,ne,re,ie){this.declaringType=te,this.tag=ne,this.name=re,this.fields=ie}}class TypeInfo{constructor(te,ne,re,ie,se,oe,he){this.fullname=te,this.generics=ne,this.construct=re,this.parent=ie,this.fields=se,this.cases=oe,this.enumCases=he}toString(){return fullName(this)}GetHashCode(){return getHashCode(this)}Equals(te){return equals(this,te)}}function getGenerics(ee){return ee.generics!=null?ee.generics:[]}function getHashCode(ee){const te=stringHash(ee.fullname),ne=getGenerics(ee).map(getHashCode);return combineHashCodes([te,...ne])}function equals(ee,te){return ee.fullname===""?te.fullname===""&&equalArraysWith(getRecordElements(ee),getRecordElements(te),([ne,re],[ie,se])=>ne===ie&&equals(re,se)):ee.fullname===te.fullname&&equalArraysWith(getGenerics(ee),getGenerics(te),equals)}function class_type(ee,te,ne,re){return new TypeInfo(ee,te,ne,re)}function record_type(ee,te,ne,re){return new TypeInfo(ee,te,ne,void 0,re)}function anonRecord_type(...ee){return new TypeInfo("",void 0,void 0,void 0,()=>ee)}function union_type(ee,te,ne,re){const ie=new TypeInfo(ee,te,ne,void 0,void 0,()=>{const se=ne.prototype.cases();return re().map((oe,he)=>new CaseInfo(ie,he,se[he],oe))});return ie}function list_type(ee){return new TypeInfo("Microsoft.FSharp.Collections.FSharpList`1",[ee])}const obj_type=new TypeInfo("System.Object"),string_type=new TypeInfo("System.String"),int32_type=new TypeInfo("System.Int32");function name(ee){if(Array.isArray(ee))return ee[0];if(ee instanceof TypeInfo){const te=getElementType(ee);if(te!=null)return name(te)+"[]";{const ne=ee.fullname.lastIndexOf(".");return ne===-1?ee.fullname:ee.fullname.substr(ne+1)}}else return ee.name}function fullName(ee){const te=getElementType(ee);return te!=null?fullName(te)+"[]":ee.generics==null||ee.generics.length===0?ee.fullname:ee.fullname+"["+ee.generics.map(ne=>fullName(ne)).join(",")+"]"}function isArray(ee){return getElementType(ee)!=null}function getElementType(ee){var te;return ee.fullname==="[]"&&((te=ee.generics)==null?void 0:te.length)===1?ee.generics[0]:void 0}function isGenericType(ee){return ee.generics!=null&&ee.generics.length>0}function isEnum(ee){return ee.enumCases!=null&&ee.enumCases.length>0}function getGenericTypeDefinition(ee){return ee.generics==null?ee:new TypeInfo(ee.fullname,ee.generics.map(()=>obj_type))}function getEnumUnderlyingType(ee){var te;return(te=ee.generics)==null?void 0:te[0]}function getEnumValues(ee){if(isEnum(ee)&&ee.enumCases!=null)return ee.enumCases.map(te=>te[1]);throw new Error("".concat(ee.fullname," is not an enum type"))}function getEnumCase(ee,te){if(ee.enumCases!=null)if(typeof te=="string"){for(const ne of ee.enumCases)if(ne[0]===te)return ne;throw new Error("'".concat(te,"' was not found in ").concat(ee.fullname))}else{for(const ne of ee.enumCases)if(ne[1]===te)return ne;return["",te]}else throw new Error("".concat(ee.fullname," is not an enum type"))}function parseEnum(ee,te){const ne=parseInt(te,10);return getEnumCase(ee,isNaN(ne)?te:ne)[1]}function getUnionCases(ee){if(ee.cases!=null)return ee.cases();throw new Error("".concat(ee.fullname," is not an F# union type"))}function getRecordElements(ee){if(ee.fields!=null)return ee.fields();throw new Error("".concat(ee.fullname," is not an F# record type"))}function getTupleElements(ee){if(isTuple(ee)&&ee.generics!=null)return ee.generics;throw new Error("".concat(ee.fullname," is not a tuple type"))}function isUnion(ee){return ee instanceof TypeInfo?ee.cases!=null:ee instanceof Union}function isRecord(ee){return ee instanceof TypeInfo?ee.fields!=null:ee instanceof Record}function isTuple(ee){return ee.fullname.startsWith("System.Tuple")}function getUnionFields(ee,te){const re=getUnionCases(te)[ee.tag];if(re==null)throw new Error("Cannot find case ".concat(ee.name," in union type"));return[re,ee.fields]}function getUnionCaseFields(ee){return ee.fields==null?[]:ee.fields}function getRecordField(ee,te){return ee[te[0]]}function getTupleFields(ee){return ee}function makeUnion$1(ee,te){const ne=(ee.fields||[]).length;if(te.length!==ne)throw new Error("Expected an array of length ".concat(ne," but got ").concat(te.length));return ee.declaringType.construct!=null?new ee.declaringType.construct(ee.tag,te):{}}function makeRecord(ee,te){const ne=getRecordElements(ee);if(ne.length!==te.length)throw new Error("Expected an array of length ".concat(ne.length," but got ").concat(te.length));return ee.construct!=null?new ee.construct(...te):ne.reduce((re,[ie,se],oe)=>(re[ie]=te[oe],re),{})}function makeTuple(ee,te){return ee}var n$1,l$3,u$3,i$2,o$1,r$4,f$1,e$2,c$2={},s$2=[],a$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h$2=Array.isArray;function v$1(ee,te){for(var ne in te)ee[ne]=te[ne];return ee}function p$2(ee){var te=ee.parentNode;te&&te.removeChild(ee)}function y$1(ee,te,ne){var re,ie,se,oe={};for(se in te)se=="key"?re=te[se]:se=="ref"?ie=te[se]:oe[se]=te[se];if(arguments.length>2&&(oe.children=arguments.length>3?n$1.call(arguments,2):ne),typeof ee=="function"&&ee.defaultProps!=null)for(se in ee.defaultProps)oe[se]===void 0&&(oe[se]=ee.defaultProps[se]);return d$1(ee,oe,re,ie,null)}function d$1(ee,te,ne,re,ie){var se={type:ee,props:te,key:ne,ref:re,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:ie==null?++u$3:ie};return ie==null&&l$3.vnode!=null&&l$3.vnode(se),se}function _$1(){return{current:null}}function k$3(ee){return ee.children}function b$1(ee,te){this.props=ee,this.context=te}function g$2(ee,te){if(te==null)return ee.__?g$2(ee.__,ee.__.__k.indexOf(ee)+1):null;for(var ne;te<ee.__k.length;te++)if((ne=ee.__k[te])!=null&&ne.__e!=null)return ne.__e;return typeof ee.type=="function"?g$2(ee):null}function m$2(ee){var te,ne;if((ee=ee.__)!=null&&ee.__c!=null){for(ee.__e=ee.__c.base=null,te=0;te<ee.__k.length;te++)if((ne=ee.__k[te])!=null&&ne.__e!=null){ee.__e=ee.__c.base=ne.__e;break}return m$2(ee)}}function w$2(ee){(!ee.__d&&(ee.__d=!0)&&i$2.push(ee)&&!x$2.__r++||o$1!==l$3.debounceRendering)&&((o$1=l$3.debounceRendering)||r$4)(x$2)}function x$2(){var ee,te,ne,re,ie,se,oe,he,ue;for(i$2.sort(f$1);ee=i$2.shift();)ee.__d&&(te=i$2.length,re=void 0,ie=void 0,se=void 0,he=(oe=(ne=ee).__v).__e,(ue=ne.__P)&&(re=[],ie=[],(se=v$1({},oe)).__v=oe.__v+1,L$1(ue,oe,se,ne.__n,ue.ownerSVGElement!==void 0,oe.__h!=null?[he]:null,re,he==null?g$2(oe):he,oe.__h,ie),M$1(re,oe,ie),oe.__e!=he&&m$2(oe)),i$2.length>te&&i$2.sort(f$1));x$2.__r=0}function P$2(ee,te,ne,re,ie,se,oe,he,ue,de,ae){var le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye=0,Ee=re&&re.__k||s$2,Ne=Ee.length,Me=Ne,we=te.length;for(ne.__k=[],le=0;le<we;le++)(me=ne.__k[le]=(me=te[le])==null||typeof me=="boolean"||typeof me=="function"?null:typeof me=="string"||typeof me=="number"||typeof me=="bigint"?d$1(null,me,null,null,me):h$2(me)?d$1(k$3,{children:me},null,null,null):me.__b>0?d$1(me.type,me.props,me.key,me.ref?me.ref:null,me.__v):me)!=null&&(me.__=ne,me.__b=ne.__b+1,(Pe=A$2(me,Ee,Te=le+ye,Me))===-1?_e=c$2:(_e=Ee[Pe]||c$2,Ee[Pe]=void 0,Me--),L$1(ee,me,_e,ie,se,oe,he,ue,de,ae),ve=me.__e,(Ae=me.ref)&&_e.ref!=Ae&&(_e.ref&&O$1(_e.ref,null,me),ae.push(Ae,me.__c||ve,me)),ve!=null&&(Se==null&&(Se=ve),$e=!(Re=_e===c$2||_e.__v===null)&&Pe===Te,Re?Pe==-1&&ye--:Pe!==Te&&(Pe===Te+1?(ye++,$e=!0):Pe>Te?Me>we-Te?(ye+=Pe-Te,$e=!0):ye--:ye=Pe<Te&&Pe==Te-1?Pe-Te:0),Te=le+ye,$e=$e||Pe==le&&!Re,typeof me.type!="function"||Pe===Te&&_e.__k!==me.__k?typeof me.type=="function"||$e?me.__d!==void 0?(ue=me.__d,me.__d=void 0):ue=ve.nextSibling:ue=$$1(ee,ve,ue):ue=C$1(me,ue,ee),typeof ne.type=="function"&&(ne.__d=ue)));for(ne.__e=Se,le=Ne;le--;)Ee[le]!=null&&(typeof ne.type=="function"&&Ee[le].__e!=null&&Ee[le].__e==ne.__d&&(ne.__d=Ee[le].__e.nextSibling),q$3(Ee[le],Ee[le]))}function C$1(ee,te,ne){for(var re,ie=ee.__k,se=0;ie&&se<ie.length;se++)(re=ie[se])&&(re.__=ee,te=typeof re.type=="function"?C$1(re,te,ne):$$1(ne,re.__e,te));return te}function S(ee,te){return te=te||[],ee==null||typeof ee=="boolean"||(h$2(ee)?ee.some(function(ne){S(ne,te)}):te.push(ee)),te}function $$1(ee,te,ne){return ne==null||ne.parentNode!==ee?ee.insertBefore(te,null):te==ne&&te.parentNode!=null||ee.insertBefore(te,ne),te.nextSibling}function A$2(ee,te,ne,re){var ie=ee.key,se=ee.type,oe=ne-1,he=ne+1,ue=te[ne];if(ue===null||ue&&ie==ue.key&&se===ue.type)return ne;if(re>(ue!=null?1:0))for(;oe>=0||he<te.length;){if(oe>=0){if((ue=te[oe])&&ie==ue.key&&se===ue.type)return oe;oe--}if(he<te.length){if((ue=te[he])&&ie==ue.key&&se===ue.type)return he;he++}}return-1}function H$1(ee,te,ne,re,ie){var se;for(se in ne)se==="children"||se==="key"||se in te||T$2(ee,se,null,ne[se],re);for(se in te)ie&&typeof te[se]!="function"||se==="children"||se==="key"||se==="value"||se==="checked"||ne[se]===te[se]||T$2(ee,se,te[se],ne[se],re)}function I$1(ee,te,ne){te[0]==="-"?ee.setProperty(te,ne==null?"":ne):ee[te]=ne==null?"":typeof ne!="number"||a$2.test(te)?ne:ne+"px"}function T$2(ee,te,ne,re,ie){var se;e:if(te==="style")if(typeof ne=="string")ee.style.cssText=ne;else{if(typeof re=="string"&&(ee.style.cssText=re=""),re)for(te in re)ne&&te in ne||I$1(ee.style,te,"");if(ne)for(te in ne)re&&ne[te]===re[te]||I$1(ee.style,te,ne[te])}else if(te[0]==="o"&&te[1]==="n")se=te!==(te=te.replace(/Capture$/,"")),te=te.toLowerCase()in ee?te.toLowerCase().slice(2):te.slice(2),ee.l||(ee.l={}),ee.l[te+se]=ne,ne?re||ee.addEventListener(te,se?z$2:j$2,se):ee.removeEventListener(te,se?z$2:j$2,se);else if(te!=="dangerouslySetInnerHTML"){if(ie)te=te.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(te!=="width"&&te!=="height"&&te!=="href"&&te!=="list"&&te!=="form"&&te!=="tabIndex"&&te!=="download"&&te!=="rowSpan"&&te!=="colSpan"&&te in ee)try{ee[te]=ne==null?"":ne;break e}catch{}typeof ne=="function"||(ne==null||ne===!1&&te[4]!=="-"?ee.removeAttribute(te):ee.setAttribute(te,ne))}}function j$2(ee){return this.l[ee.type+!1](l$3.event?l$3.event(ee):ee)}function z$2(ee){return this.l[ee.type+!0](l$3.event?l$3.event(ee):ee)}function L$1(ee,te,ne,re,ie,se,oe,he,ue,de){var ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,Ne,Me,we=te.type;if(te.constructor!==void 0)return null;ne.__h!=null&&(ue=ne.__h,he=te.__e=ne.__e,te.__h=null,se=[he]),(ae=l$3.__b)&&ae(te);try{e:if(typeof we=="function"){if(Te=te.props,Pe=(ae=we.contextType)&&re[ae.__c],Re=ae?Pe?Pe.props.value:ae.__:re,ne.__c?Se=(le=te.__c=ne.__c).__=le.__E:("prototype"in we&&we.prototype.render?te.__c=le=new we(Te,Re):(te.__c=le=new b$1(Te,Re),le.constructor=we,le.render=B$2),Pe&&Pe.sub(le),le.props=Te,le.state||(le.state={}),le.context=Re,le.__n=re,Ae=le.__d=!0,le.__h=[],le._sb=[]),le.__s==null&&(le.__s=le.state),we.getDerivedStateFromProps!=null&&(le.__s==le.state&&(le.__s=v$1({},le.__s)),v$1(le.__s,we.getDerivedStateFromProps(Te,le.__s))),_e=le.props,me=le.state,le.__v=te,Ae)we.getDerivedStateFromProps==null&&le.componentWillMount!=null&&le.componentWillMount(),le.componentDidMount!=null&&le.__h.push(le.componentDidMount);else{if(we.getDerivedStateFromProps==null&&Te!==_e&&le.componentWillReceiveProps!=null&&le.componentWillReceiveProps(Te,Re),!le.__e&&(le.shouldComponentUpdate!=null&&le.shouldComponentUpdate(Te,le.__s,Re)===!1||te.__v===ne.__v)){for(te.__v!==ne.__v&&(le.props=Te,le.state=le.__s,le.__d=!1),te.__e=ne.__e,te.__k=ne.__k,te.__k.forEach(function(Oe){Oe&&(Oe.__=te)}),$e=0;$e<le._sb.length;$e++)le.__h.push(le._sb[$e]);le._sb=[],le.__h.length&&oe.push(le);break e}le.componentWillUpdate!=null&&le.componentWillUpdate(Te,le.__s,Re),le.componentDidUpdate!=null&&le.__h.push(function(){le.componentDidUpdate(_e,me,ve)})}if(le.context=Re,le.props=Te,le.__P=ee,le.__e=!1,ye=l$3.__r,Ee=0,"prototype"in we&&we.prototype.render){for(le.state=le.__s,le.__d=!1,ye&&ye(te),ae=le.render(le.props,le.state,le.context),Ne=0;Ne<le._sb.length;Ne++)le.__h.push(le._sb[Ne]);le._sb=[]}else do le.__d=!1,ye&&ye(te),ae=le.render(le.props,le.state,le.context),le.state=le.__s;while(le.__d&&++Ee<25);le.state=le.__s,le.getChildContext!=null&&(re=v$1(v$1({},re),le.getChildContext())),Ae||le.getSnapshotBeforeUpdate==null||(ve=le.getSnapshotBeforeUpdate(_e,me)),P$2(ee,h$2(Me=ae!=null&&ae.type===k$3&&ae.key==null?ae.props.children:ae)?Me:[Me],te,ne,re,ie,se,oe,he,ue,de),le.base=te.__e,te.__h=null,le.__h.length&&oe.push(le),Se&&(le.__E=le.__=null)}else se==null&&te.__v===ne.__v?(te.__k=ne.__k,te.__e=ne.__e):te.__e=N$1(ne.__e,te,ne,re,ie,se,oe,ue,de);(ae=l$3.diffed)&&ae(te)}catch(Oe){te.__v=null,(ue||se!=null)&&(te.__e=he,te.__h=!!ue,se[se.indexOf(he)]=null),l$3.__e(Oe,te,ne)}}function M$1(ee,te,ne){for(var re=0;re<ne.length;re++)O$1(ne[re],ne[++re],ne[++re]);l$3.__c&&l$3.__c(te,ee),ee.some(function(ie){try{ee=ie.__h,ie.__h=[],ee.some(function(se){se.call(ie)})}catch(se){l$3.__e(se,ie.__v)}})}function N$1(ee,te,ne,re,ie,se,oe,he,ue){var de,ae,le,Ae=ne.props,_e=te.props,me=te.type,ve=0;if(me==="svg"&&(ie=!0),se!=null){for(;ve<se.length;ve++)if((de=se[ve])&&"setAttribute"in de==!!me&&(me?de.localName===me:de.nodeType===3)){ee=de,se[ve]=null;break}}if(ee==null){if(me===null)return document.createTextNode(_e);ee=ie?document.createElementNS("http://www.w3.org/2000/svg",me):document.createElement(me,_e.is&&_e),se=null,he=!1}if(me===null)Ae===_e||he&&ee.data===_e||(ee.data=_e);else{if(se=se&&n$1.call(ee.childNodes),ae=(Ae=ne.props||c$2).dangerouslySetInnerHTML,le=_e.dangerouslySetInnerHTML,!he){if(se!=null)for(Ae={},ve=0;ve<ee.attributes.length;ve++)Ae[ee.attributes[ve].name]=ee.attributes[ve].value;(le||ae)&&(le&&(ae&&le.__html==ae.__html||le.__html===ee.innerHTML)||(ee.innerHTML=le&&le.__html||""))}if(H$1(ee,_e,Ae,ie,he),le)te.__k=[];else if(P$2(ee,h$2(ve=te.props.children)?ve:[ve],te,ne,re,ie&&me!=="foreignObject",se,oe,se?se[0]:ne.__k&&g$2(ne,0),he,ue),se!=null)for(ve=se.length;ve--;)se[ve]!=null&&p$2(se[ve]);he||("value"in _e&&(ve=_e.value)!==void 0&&(ve!==ee.value||me==="progress"&&!ve||me==="option"&&ve!==Ae.value)&&T$2(ee,"value",ve,Ae.value,!1),"checked"in _e&&(ve=_e.checked)!==void 0&&ve!==ee.checked&&T$2(ee,"checked",ve,Ae.checked,!1))}return ee}function O$1(ee,te,ne){try{typeof ee=="function"?ee(te):ee.current=te}catch(re){l$3.__e(re,ne)}}function q$3(ee,te,ne){var re,ie;if(l$3.unmount&&l$3.unmount(ee),(re=ee.ref)&&(re.current&&re.current!==ee.__e||O$1(re,null,te)),(re=ee.__c)!=null){if(re.componentWillUnmount)try{re.componentWillUnmount()}catch(se){l$3.__e(se,te)}re.base=re.__P=null,ee.__c=void 0}if(re=ee.__k)for(ie=0;ie<re.length;ie++)re[ie]&&q$3(re[ie],te,ne||typeof ee.type!="function");ne||ee.__e==null||p$2(ee.__e),ee.__=ee.__e=ee.__d=void 0}function B$2(ee,te,ne){return this.constructor(ee,ne)}function D$1(ee,te,ne){var re,ie,se,oe;l$3.__&&l$3.__(ee,te),ie=(re=typeof ne=="function")?null:ne&&ne.__k||te.__k,se=[],oe=[],L$1(te,ee=(!re&&ne||te).__k=y$1(k$3,null,[ee]),ie||c$2,c$2,te.ownerSVGElement!==void 0,!re&&ne?[ne]:ie?null:te.firstChild?n$1.call(te.childNodes):null,se,!re&&ne?ne:ie?ie.__e:te.firstChild,re,oe),M$1(se,ee,oe)}function E$1(ee,te){D$1(ee,te,E$1)}function F$2(ee,te,ne){var re,ie,se,oe,he=v$1({},ee.props);for(se in ee.type&&ee.type.defaultProps&&(oe=ee.type.defaultProps),te)se=="key"?re=te[se]:se=="ref"?ie=te[se]:he[se]=te[se]===void 0&&oe!==void 0?oe[se]:te[se];return arguments.length>2&&(he.children=arguments.length>3?n$1.call(arguments,2):ne),d$1(ee.type,he,re||ee.key,ie||ee.ref,null)}function G$1(ee,te){var ne={__c:te="__cC"+e$2++,__:ee,Consumer:function(re,ie){return re.children(ie)},Provider:function(re){var ie,se;return this.getChildContext||(ie=[],(se={})[te]=this,this.getChildContext=function(){return se},this.shouldComponentUpdate=function(oe){this.props.value!==oe.value&&ie.some(function(he){he.__e=!0,w$2(he)})},this.sub=function(oe){ie.push(oe);var he=oe.componentWillUnmount;oe.componentWillUnmount=function(){ie.splice(ie.indexOf(oe),1),he&&he.call(oe)}}),re.children}};return ne.Provider.__=ne.Consumer.contextType=ne}n$1=s$2.slice,l$3={__e:function(ee,te,ne,re){for(var ie,se,oe;te=te.__;)if((ie=te.__c)&&!ie.__)try{if((se=ie.constructor)&&se.getDerivedStateFromError!=null&&(ie.setState(se.getDerivedStateFromError(ee)),oe=ie.__d),ie.componentDidCatch!=null&&(ie.componentDidCatch(ee,re||{}),oe=ie.__d),oe)return ie.__E=ie}catch(he){ee=he}throw ee}},u$3=0,b$1.prototype.setState=function(ee,te){var ne;ne=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=v$1({},this.state),typeof ee=="function"&&(ee=ee(v$1({},ne),this.props)),ee&&v$1(ne,ee),ee!=null&&this.__v&&(te&&this._sb.push(te),w$2(this))},b$1.prototype.forceUpdate=function(ee){this.__v&&(this.__e=!0,ee&&this.__h.push(ee),w$2(this))},b$1.prototype.render=k$3,i$2=[],r$4=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$1=function(ee,te){return ee.__v.__b-te.__v.__b},x$2.__r=0,e$2=0;var t$1,r$3,u$2,i$1,o=0,f=[],c$1=[],e$1=l$3.__b,a$1=l$3.__r,v=l$3.diffed,l$2=l$3.__c,m$1=l$3.unmount;function d(ee,te){l$3.__h&&l$3.__h(r$3,ee,o||te),o=0;var ne=r$3.__H||(r$3.__H={__:[],__h:[]});return ee>=ne.__.length&&ne.__.push({__V:c$1}),ne.__[ee]}function h$1(ee){return o=1,s$1(B$1,ee)}function s$1(ee,te,ne){var re=d(t$1++,2);if(re.t=ee,!re.__c&&(re.__=[ne?ne(te):B$1(void 0,te),function(he){var ue=re.__N?re.__N[0]:re.__[0],de=re.t(ue,he);ue!==de&&(re.__N=[de,re.__[1]],re.__c.setState({}))}],re.__c=r$3,!r$3.u)){var ie=function(he,ue,de){if(!re.__c.__H)return!0;var ae=re.__c.__H.__.filter(function(Ae){return Ae.__c});if(ae.every(function(Ae){return!Ae.__N}))return!se||se.call(this,he,ue,de);var le=!1;return ae.forEach(function(Ae){if(Ae.__N){var _e=Ae.__[0];Ae.__=Ae.__N,Ae.__N=void 0,_e!==Ae.__[0]&&(le=!0)}}),!(!le&&re.__c.props===he)&&(!se||se.call(this,he,ue,de))};r$3.u=!0;var se=r$3.shouldComponentUpdate,oe=r$3.componentWillUpdate;r$3.componentWillUpdate=function(he,ue,de){if(this.__e){var ae=se;se=void 0,ie(he,ue,de),se=ae}oe&&oe.call(this,he,ue,de)},r$3.shouldComponentUpdate=ie}return re.__N||re.__}function p$1(ee,te){var ne=d(t$1++,3);!l$3.__s&&z$1(ne.__H,te)&&(ne.__=ee,ne.i=te,r$3.__H.__h.push(ne))}function y(ee,te){var ne=d(t$1++,4);!l$3.__s&&z$1(ne.__H,te)&&(ne.__=ee,ne.i=te,r$3.__h.push(ne))}function _(ee){return o=5,F$1(function(){return{current:ee}},[])}function A$1(ee,te,ne){o=6,y(function(){return typeof ee=="function"?(ee(te()),function(){return ee(null)}):ee?(ee.current=te(),function(){return ee.current=null}):void 0},ne==null?ne:ne.concat(ee))}function F$1(ee,te){var ne=d(t$1++,7);return z$1(ne.__H,te)?(ne.__V=ee(),ne.i=te,ne.__h=ee,ne.__V):ne.__}function T$1(ee,te){return o=8,F$1(function(){return ee},te)}function q$2(ee){var te=r$3.context[ee.__c],ne=d(t$1++,9);return ne.c=ee,te?(ne.__==null&&(ne.__=!0,te.sub(r$3)),te.props.value):ee.__}function x$1(ee,te){l$3.useDebugValue&&l$3.useDebugValue(te?te(ee):ee)}function P$1(ee){var te=d(t$1++,10),ne=h$1();return te.__=ee,r$3.componentDidCatch||(r$3.componentDidCatch=function(re,ie){te.__&&te.__(re,ie),ne[1](re)}),[ne[0],function(){ne[1](void 0)}]}function V$1(){var ee=d(t$1++,11);if(!ee.__){for(var te=r$3.__v;te!==null&&!te.__m&&te.__!==null;)te=te.__;var ne=te.__m||(te.__m=[0,0]);ee.__="P"+ne[0]+"-"+ne[1]++}return ee.__}function b(){for(var ee;ee=f.shift();)if(ee.__P&&ee.__H)try{ee.__H.__h.forEach(k$2),ee.__H.__h.forEach(w$1),ee.__H.__h=[]}catch(te){ee.__H.__h=[],l$3.__e(te,ee.__v)}}l$3.__b=function(ee){r$3=null,e$1&&e$1(ee)},l$3.__r=function(ee){a$1&&a$1(ee),t$1=0;var te=(r$3=ee.__c).__H;te&&(u$2===r$3?(te.__h=[],r$3.__h=[],te.__.forEach(function(ne){ne.__N&&(ne.__=ne.__N),ne.__V=c$1,ne.__N=ne.i=void 0})):(te.__h.forEach(k$2),te.__h.forEach(w$1),te.__h=[],t$1=0)),u$2=r$3},l$3.diffed=function(ee){v&&v(ee);var te=ee.__c;te&&te.__H&&(te.__H.__h.length&&(f.push(te)!==1&&i$1===l$3.requestAnimationFrame||((i$1=l$3.requestAnimationFrame)||j$1)(b)),te.__H.__.forEach(function(ne){ne.i&&(ne.__H=ne.i),ne.__V!==c$1&&(ne.__=ne.__V),ne.i=void 0,ne.__V=c$1})),u$2=r$3=null},l$3.__c=function(ee,te){te.some(function(ne){try{ne.__h.forEach(k$2),ne.__h=ne.__h.filter(function(re){return!re.__||w$1(re)})}catch(re){te.some(function(ie){ie.__h&&(ie.__h=[])}),te=[],l$3.__e(re,ne.__v)}}),l$2&&l$2(ee,te)},l$3.unmount=function(ee){m$1&&m$1(ee);var te,ne=ee.__c;ne&&ne.__H&&(ne.__H.__.forEach(function(re){try{k$2(re)}catch(ie){te=ie}}),ne.__H=void 0,te&&l$3.__e(te,ne.__v))};var g$1=typeof requestAnimationFrame=="function";function j$1(ee){var te,ne=function(){clearTimeout(re),g$1&&cancelAnimationFrame(te),setTimeout(ee)},re=setTimeout(ne,100);g$1&&(te=requestAnimationFrame(ne))}function k$2(ee){var te=r$3,ne=ee.__c;typeof ne=="function"&&(ee.__c=void 0,ne()),r$3=te}function w$1(ee){var te=r$3;ee.__c=ee.__(),r$3=te}function z$1(ee,te){return!ee||ee.length!==te.length||te.some(function(ne,re){return ne!==ee[re]})}function B$1(ee,te){return typeof te=="function"?te(ee):te}function g(ee,te){for(var ne in te)ee[ne]=te[ne];return ee}function C(ee,te){for(var ne in ee)if(ne!=="__source"&&!(ne in te))return!0;for(var re in te)if(re!=="__source"&&ee[re]!==te[re])return!0;return!1}function E(ee,te){return ee===te&&(ee!==0||1/ee==1/te)||ee!=ee&&te!=te}function w(ee){this.props=ee}function x(ee,te){function ne(ie){var se=this.props.ref,oe=se==ie.ref;return!oe&&se&&(se.call?se(null):se.current=null),te?!te(this.props,ie)||!oe:C(this.props,ie)}function re(ie){return this.shouldComponentUpdate=ne,y$1(ee,ie)}return re.displayName="Memo("+(ee.displayName||ee.name)+")",re.prototype.isReactComponent=!0,re.__f=!0,re}(w.prototype=new b$1).isPureReactComponent=!0,w.prototype.shouldComponentUpdate=function(ee,te){return C(this.props,ee)||C(this.state,te)};var R=l$3.__b;l$3.__b=function(ee){ee.type&&ee.type.__f&&ee.ref&&(ee.props.ref=ee.ref,ee.ref=null),R&&R(ee)};var N=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function k$1(ee){function te(ne){var re=g({},ne);return delete re.ref,ee(re,ne.ref||null)}return te.$$typeof=N,te.render=te,te.prototype.isReactComponent=te.__f=!0,te.displayName="ForwardRef("+(ee.displayName||ee.name)+")",te}var A=function(ee,te){return ee==null?null:S(S(ee).map(te))},O={map:A,forEach:A,count:function(ee){return ee?S(ee).length:0},only:function(ee){var te=S(ee);if(te.length!==1)throw"Children.only";return te[0]},toArray:S},T=l$3.__e;l$3.__e=function(ee,te,ne,re){if(ee.then){for(var ie,se=te;se=se.__;)if((ie=se.__c)&&ie.__c)return te.__e==null&&(te.__e=ne.__e,te.__k=ne.__k),ie.__c(ee,te)}T(ee,te,ne,re)};var I=l$3.unmount;function L(ee,te,ne){return ee&&(ee.__c&&ee.__c.__H&&(ee.__c.__H.__.forEach(function(re){typeof re.__c=="function"&&re.__c()}),ee.__c.__H=null),(ee=g({},ee)).__c!=null&&(ee.__c.__P===ne&&(ee.__c.__P=te),ee.__c=null),ee.__k=ee.__k&&ee.__k.map(function(re){return L(re,te,ne)})),ee}function U(ee,te,ne){return ee&&(ee.__v=null,ee.__k=ee.__k&&ee.__k.map(function(re){return U(re,te,ne)}),ee.__c&&ee.__c.__P===te&&(ee.__e&&ne.insertBefore(ee.__e,ee.__d),ee.__c.__e=!0,ee.__c.__P=ne)),ee}function D(){this.__u=0,this.t=null,this.__b=null}function F(ee){var te=ee.__.__c;return te&&te.__a&&te.__a(ee)}function M(ee){var te,ne,re;function ie(se){if(te||(te=ee()).then(function(oe){ne=oe.default||oe},function(oe){re=oe}),re)throw re;if(!ne)throw te;return y$1(ne,se)}return ie.displayName="Lazy",ie.__f=!0,ie}function V(){this.u=null,this.o=null}l$3.unmount=function(ee){var te=ee.__c;te&&te.__R&&te.__R(),te&&ee.__h===!0&&(ee.type=null),I&&I(ee)},(D.prototype=new b$1).__c=function(ee,te){var ne=te.__c,re=this;re.t==null&&(re.t=[]),re.t.push(ne);var ie=F(re.__v),se=!1,oe=function(){se||(se=!0,ne.__R=null,ie?ie(he):he())};ne.__R=oe;var he=function(){if(!--re.__u){if(re.state.__a){var de=re.state.__a;re.__v.__k[0]=U(de,de.__c.__P,de.__c.__O)}var ae;for(re.setState({__a:re.__b=null});ae=re.t.pop();)ae.forceUpdate()}},ue=te.__h===!0;re.__u++||ue||re.setState({__a:re.__b=re.__v.__k[0]}),ee.then(oe,oe)},D.prototype.componentWillUnmount=function(){this.t=[]},D.prototype.render=function(ee,te){if(this.__b){if(this.__v.__k){var ne=document.createElement("div"),re=this.__v.__k[0].__c;this.__v.__k[0]=L(this.__b,ne,re.__O=re.__P)}this.__b=null}var ie=te.__a&&y$1(k$3,null,ee.fallback);return ie&&(ie.__h=null),[y$1(k$3,null,te.__a?null:ee.children),ie]};var W=function(ee,te,ne){if(++ne[1]===ne[0]&&ee.o.delete(te),ee.props.revealOrder&&(ee.props.revealOrder[0]!=="t"||!ee.o.size))for(ne=ee.u;ne;){for(;ne.length>3;)ne.pop()();if(ne[1]<ne[0])break;ee.u=ne=ne[2]}};function P(ee){return this.getChildContext=function(){return ee.context},ee.children}function j(ee){var te=this,ne=ee.i;te.componentWillUnmount=function(){D$1(null,te.l),te.l=null,te.i=null},te.i&&te.i!==ne&&te.componentWillUnmount(),ee.__v?(te.l||(te.i=ne,te.l={nodeType:1,parentNode:ne,childNodes:[],appendChild:function(re){this.childNodes.push(re),te.i.appendChild(re)},insertBefore:function(re,ie){this.childNodes.push(re),te.i.appendChild(re)},removeChild:function(re){this.childNodes.splice(this.childNodes.indexOf(re)>>>1,1),te.i.removeChild(re)}}),D$1(y$1(P,{context:te.context},ee.__v),te.l)):te.l&&te.componentWillUnmount()}function z(ee,te){var ne=y$1(j,{__v:ee,i:te});return ne.containerInfo=te,ne}(V.prototype=new b$1).__a=function(ee){var te=this,ne=F(te.__v),re=te.o.get(ee);return re[0]++,function(ie){var se=function(){te.props.revealOrder?(re.push(ie),W(te,ee,re)):ie()};ne?ne(se):se()}},V.prototype.render=function(ee){this.u=null,this.o=new Map;var te=S(ee.children);ee.revealOrder&&ee.revealOrder[0]==="b"&&te.reverse();for(var ne=te.length;ne--;)this.o.set(te[ne],this.u=[1,0,this.u]);return ee.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var ee=this;this.o.forEach(function(te,ne){W(ee,ne,te)})};var B=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,H=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Y=/[A-Z0-9]/g,$=typeof document<"u",q$1=function(ee){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(ee)};function G(ee,te,ne){return te.__k==null&&(te.textContent=""),D$1(ee,te),typeof ne=="function"&&ne(),ee?ee.__c:null}function J(ee,te,ne){return E$1(ee,te),typeof ne=="function"&&ne(),ee?ee.__c:null}b$1.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(ee){Object.defineProperty(b$1.prototype,ee,{configurable:!0,get:function(){return this["UNSAFE_"+ee]},set:function(te){Object.defineProperty(this,ee,{configurable:!0,writable:!0,value:te})}})});var K=l$3.event;function Q(){}function X(){return this.cancelBubble}function nn(){return this.defaultPrevented}l$3.event=function(ee){return K&&(ee=K(ee)),ee.persist=Q,ee.isPropagationStopped=X,ee.isDefaultPrevented=nn,ee.nativeEvent=ee};var tn,en={enumerable:!1,configurable:!0,get:function(){return this.class}},rn=l$3.vnode;l$3.vnode=function(ee){typeof ee.type=="string"&&function(te){var ne=te.props,re=te.type,ie={};for(var se in ne){var oe=ne[se];if(!(se==="value"&&"defaultValue"in ne&&oe==null||$&&se==="children"&&re==="noscript"||se==="class"||se==="className")){var he=se.toLowerCase();se==="defaultValue"&&"value"in ne&&ne.value==null?se="value":se==="download"&&oe===!0?oe="":he==="ondoubleclick"?se="ondblclick":he!=="onchange"||re!=="input"&&re!=="textarea"||q$1(ne.type)?he==="onfocus"?se="onfocusin":he==="onblur"?se="onfocusout":Z.test(se)?se=he:re.indexOf("-")===-1&&H.test(se)?se=se.replace(Y,"-$&").toLowerCase():oe===null&&(oe=void 0):he=se="oninput",he==="oninput"&&ie[se=he]&&(se="oninputCapture"),ie[se]=oe}}re=="select"&&ie.multiple&&Array.isArray(ie.value)&&(ie.value=S(ne.children).forEach(function(ue){ue.props.selected=ie.value.indexOf(ue.props.value)!=-1})),re=="select"&&ie.defaultValue!=null&&(ie.value=S(ne.children).forEach(function(ue){ue.props.selected=ie.multiple?ie.defaultValue.indexOf(ue.props.value)!=-1:ie.defaultValue==ue.props.value})),ne.class&&!ne.className?(ie.class=ne.class,Object.defineProperty(ie,"className",en)):(ne.className&&!ne.class||ne.class&&ne.className)&&(ie.class=ie.className=ne.className),te.props=ie}(ee),ee.$$typeof=B,rn&&rn(ee)};var un=l$3.__r;l$3.__r=function(ee){un&&un(ee),tn=ee.__c};var on=l$3.diffed;l$3.diffed=function(ee){on&&on(ee);var te=ee.props,ne=ee.__e;ne!=null&&ee.type==="textarea"&&"value"in te&&te.value!==ne.value&&(ne.value=te.value==null?"":te.value),tn=null};var ln={ReactCurrentDispatcher:{current:{readContext:function(ee){return tn.__n[ee.__c].props.value}}}},cn="17.0.2";function fn(ee){return y$1.bind(null,ee)}function an(ee){return!!ee&&ee.$$typeof===B}function sn(ee){return an(ee)?F$2.apply(null,arguments):ee}function hn(ee){return!!ee.__k&&(D$1(null,ee),!0)}function vn(ee){return ee&&(ee.base||ee.nodeType===1&&ee)||null}var dn=function(ee,te){return ee(te)},pn=function(ee,te){return ee(te)},mn=k$3;function yn(ee){ee()}function _n(ee){return ee}function bn(){return[!1,yn]}var Sn=y;function gn(ee,te){var ne=te(),re=h$1({h:{__:ne,v:te}}),ie=re[0].h,se=re[1];return y(function(){ie.__=ne,ie.v=te,E(ie.__,te())||se({h:ie})},[ee,ne,te]),p$1(function(){return E(ie.__,ie.v())||se({h:ie}),ee(function(){E(ie.__,ie.v())||se({h:ie})})},[ee]),ne}var Cn={useState:h$1,useId:V$1,useReducer:s$1,useEffect:p$1,useLayoutEffect:y,useInsertionEffect:Sn,useTransition:bn,useDeferredValue:_n,useSyncExternalStore:gn,startTransition:yn,useRef:_,useImperativeHandle:A$1,useMemo:F$1,useCallback:T$1,useContext:q$2,useDebugValue:x$1,version:"17.0.2",Children:O,render:G,hydrate:J,unmountComponentAtNode:hn,createPortal:z,createElement:y$1,createContext:G$1,createFactory:fn,cloneElement:sn,createRef:_$1,Fragment:k$3,isValidElement:an,findDOMNode:vn,Component:b$1,PureComponent:w,memo:x,forwardRef:k$1,flushSync:pn,unstable_batchedUpdates:dn,StrictMode:mn,Suspense:D,SuspenseList:V,lazy:M,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ln};const compat_module=Object.freeze(Object.defineProperty({__proto__:null,Children:O,Component:b$1,Fragment:k$3,PureComponent:w,StrictMode:mn,Suspense:D,SuspenseList:V,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ln,cloneElement:sn,createContext:G$1,createElement:y$1,createFactory:fn,createPortal:z,createRef:_$1,default:Cn,findDOMNode:vn,flushSync:pn,forwardRef:k$1,hydrate:J,isValidElement:an,lazy:M,memo:x,render:G,startTransition:yn,unmountComponentAtNode:hn,unstable_batchedUpdates:dn,useCallback:T$1,useContext:q$2,useDebugValue:x$1,useDeferredValue:_n,useEffect:p$1,useErrorBoundary:P$1,useId:V$1,useImperativeHandle:A$1,useInsertionEffect:Sn,useLayoutEffect:y,useMemo:F$1,useReducer:s$1,useRef:_,useState:h$1,useSyncExternalStore:gn,useTransition:bn,version:cn},Symbol.toStringTag,{value:"Module"}));function dateOffsetToString(ee){const te=ee<0;ee=Math.abs(ee);const ne=~~(ee/36e5),re=ee%36e5/6e4;return(te?"-":"+")+padWithZeros(ne,2)+":"+padWithZeros(re,2)}function dateToHalfUTCString(ee,te){const ne=ee.toISOString();return te==="first"?ne.substring(0,ne.indexOf("T")):ne.substring(ne.indexOf("T")+1,ne.length-1)}function dateToISOString(ee,te){if(te)return ee.toISOString();{const ne=ee.kind==null?!0:ee.kind===2;return padWithZeros(ee.getFullYear(),4)+"-"+padWithZeros(ee.getMonth()+1,2)+"-"+padWithZeros(ee.getDate(),2)+"T"+padWithZeros(ee.getHours(),2)+":"+padWithZeros(ee.getMinutes(),2)+":"+padWithZeros(ee.getSeconds(),2)+"."+padWithZeros(ee.getMilliseconds(),3)+(ne?dateOffsetToString(ee.getTimezoneOffset()*-6e4):"")}}function dateToISOStringWithOffset(ee,te){const ne=ee.toISOString();return ne.substring(0,ne.length-1)+dateOffsetToString(te)}function dateToStringWithCustomFormat(ee,te,ne){return te.replace(/(\w)\1*/g,re=>{let ie=Number.NaN;switch(re.substring(0,1)){case"y":const se=ne?ee.getUTCFullYear():ee.getFullYear();ie=re.length<4?se%100:se;break;case"M":ie=(ne?ee.getUTCMonth():ee.getMonth())+1;break;case"d":ie=ne?ee.getUTCDate():ee.getDate();break;case"H":ie=ne?ee.getUTCHours():ee.getHours();break;case"h":const oe=ne?ee.getUTCHours():ee.getHours();ie=oe>12?oe%12:oe;break;case"m":ie=ne?ee.getUTCMinutes():ee.getMinutes();break;case"s":ie=ne?ee.getUTCSeconds():ee.getSeconds();break;case"f":ie=ne?ee.getUTCMilliseconds():ee.getMilliseconds();break}return Number.isNaN(ie)?re:padWithZeros(ie,re.length)})}function dateToStringWithOffset(ee,te){var re,ie,se;const ne=new Date(ee.getTime()+((re=ee.offset)!=null?re:0));if(typeof te!="string")return ne.toISOString().replace(/\.\d+/,"").replace(/[A-Z]|\.\d+/g," ")+dateOffsetToString((ie=ee.offset)!=null?ie:0);if(te.length===1)switch(te){case"D":case"d":return dateToHalfUTCString(ne,"first");case"T":case"t":return dateToHalfUTCString(ne,"second");case"O":case"o":return dateToISOStringWithOffset(ne,(se=ee.offset)!=null?se:0);default:throw new Error("Unrecognized Date print format")}else return dateToStringWithCustomFormat(ne,te,!0)}function dateToStringWithKind(ee,te){const ne=ee.kind===1;if(typeof te!="string")return ne?ee.toUTCString():ee.toLocaleString();if(te.length===1)switch(te){case"D":case"d":return ne?dateToHalfUTCString(ee,"first"):ee.toLocaleDateString();case"T":case"t":return ne?dateToHalfUTCString(ee,"second"):ee.toLocaleTimeString();case"O":case"o":return dateToISOString(ee,ne);default:throw new Error("Unrecognized Date print format")}else return dateToStringWithCustomFormat(ee,te,ne)}function toString$2(ee,te,ne){return ee.offset!=null?dateToStringWithOffset(ee,te):dateToStringWithKind(ee,te)}function DateTime(ee,te){const ne=new Date(ee);return ne.kind=(te==null?0:te)|0,ne}function minValue$1(){return DateTime(-621355968e5,0)}function parseRaw(ee){function te(){throw new Error("The string is not a valid Date: ".concat(ee))}(ee==null||ee.trim()==="")&&te(),ee.length===10&&ee[4]==="-"&&ee[7]==="-"&&(ee+="T00:00:00");let ne=new Date(ee),re=null;if(isNaN(ne.getTime())){const ie=/^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(ee);if(ie!=null){let se,oe=0;if(ie[2]!=null){const he=ie[2].split(":");oe=parseInt(he[0],10)*3600+parseInt(he[1]||"0",10)*60+parseFloat(he[2]||"0"),ie[3]!=null&&ie[3].toUpperCase()==="PM"&&(oe+=720)}if(ie[4]!=null){if(ie[1]!=null)se=new Date(ie[1]+" UTC");else{const he=new Date;se=new Date(he.getUTCFullYear()+"/"+(he.getUTCMonth()+1)+"/"+he.getUTCDate())}if(ie[4]==="Z")re="Z";else{let he=parseInt(ie[5],10)*60+parseInt(ie[6]||"0",10);ie[4][0]==="-"&&(he*=-1),re=he,oe-=he*60}}else if(ie[1]!=null)se=new Date(ie[1]);else{const he=new Date;se=new Date(he.getFullYear()+"/"+(he.getMonth()+1)+"/"+he.getDate())}ne=new Date(se.getTime()+oe*1e3),ne=new Date(ne.getTime()+(ne.getTimezoneOffset()-se.getTimezoneOffset())*6e4)}else te();isNaN(ne.getTime())&&te()}return[ne,re]}function parse$3(ee,te=!1){const[ne,re]=parseRaw(ee),ie=re!=null?te&&re==="Z"?1:2:0;return DateTime(ne.getTime(),ie)}function tryParse$3(ee,te){try{return te.contents=parse$3(ee),!0}catch{return!1}}function toUniversalTime(ee){return ee.kind===1?ee:DateTime(ee.getTime(),1)}function create$1(ee,te=0){if(te&-284)throw new Error("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");let ne="gu";return ne+=te&1?"i":"",ne+=te&2?"m":"",ne+=te&16?"s":"",new RegExp(ee,ne)}function escape$1(ee){return ee.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function matches(ee,te,ne=0){if(te==null)throw new Error("Input cannot ve null");if(!ee.global)throw new Error("Non-global RegExp");ee.lastIndex=ne;const re=[];let ie,se=-1;for(;(ie=ee.exec(te))!=null;)ie.index===se?ee.lastIndex++:(se=ie.index,re.push(ie));return re}function replace(ee,te,ne,re,ie=0){function se(){let oe=arguments[0];if(re){re--;const he=[],ue=arguments.length,de=typeof arguments[ue-1]!="string";let ae=de?ue-3:ue-2;for(let le=0;le<ae;le++)he.push(arguments[le]);he.index=arguments[ae++],he.input=arguments[ae++],de&&(he.groups=arguments[ae]),oe=ne(he)}return oe}if(typeof ee=="string"){const oe=ee;ee=create$1(te,re!=null?re:0),te=oe,re=void 0}if(typeof ne=="function")return re=re==null?-1:re,te.substring(0,ie)+te.substring(ie).replace(ee,se);if(ne=ne.replace(/\$0/g,oe=>"$&").replace(/\${([^}]+)}/g,"$<$1>"),re!=null){let oe;const he=te.substring(ie),ue=matches(ee,he),de=matches.length>re?(oe=ue[re-1],he.substring(0,oe.index+oe[0].length)):he;return te.substring(0,ie)+de.replace(ee,ne)+te.substring(ie+de.length)}else return te.replace(ee,ne)}const fsFormatRegExp=/(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g,formatRegExp=/\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;function isLessThan(ee,te){return compare$1(ee,te)<0}function printf(ee){return{input:ee,cont:fsFormat(ee)}}function continuePrint(ee,te){return typeof te=="string"?ee(te):te.cont(ee)}function toText(ee){return continuePrint(te=>te,ee)}function toFail(ee){return continuePrint(te=>{throw new Error(te)},ee)}function formatReplacement(ee,te,ne,re,ie){let se="";if(te=te||"",ie=ie||"",isNumeric(ee))switch(ie.toLowerCase()!=="x"&&(isLessThan(ee,0)?(ee=multiply$1(ee,-1),se="-"):te.indexOf(" ")>=0?se=" ":te.indexOf("+")>=0&&(se="+")),re=re==null?null:parseInt(re,10),ie){case"f":case"F":re=re!=null?re:6,ee=toFixed(ee,re);break;case"g":case"G":ee=re!=null?toPrecision(ee,re):toPrecision(ee);break;case"e":case"E":ee=re!=null?toExponential(ee,re):toExponential(ee);break;case"x":ee=toHex(ee);break;case"X":ee=toHex(ee).toUpperCase();break;default:ee=String(ee);break}else ee instanceof Date?ee=toString$2(ee):ee=toString$4(ee);if(ne=typeof ne=="number"?ne:parseInt(ne,10),isNaN(ne))ee=se+ee;else{const oe=te.indexOf("0")>=0,he=te.indexOf("-")>=0,ue=he||!oe?" ":"0";ue==="0"?(ee=pad(ee,ne-se.length,ue,he),ee=se+ee):ee=pad(se+ee,ne,ue,he)}return ee}function createPrinter(ee,te,ne,re="",ie=-1){return(...se)=>{let oe=re;const he=te.slice(),ue=ne.slice();for(const de of se){const[,,ae,le,Ae,_e]=ue[0];let me=le;if(ie>=0)me=ie,ie=-1;else if(me==="*"){if(de<0)throw new Error("Non-negative number required");ie=de;continue}oe+=he[0],oe+=formatReplacement(de,ae,me,Ae,_e),he.splice(0,1),ue.splice(0,1)}return ue.length===0?(oe+=he[0],ee(oe)):createPrinter(ee,he,ue,oe,ie)}}function fsFormat(ee){return te=>{fsFormatRegExp.lastIndex=0;const ne=[],re=[];let ie=0,se=fsFormatRegExp.exec(ee);for(;se;){const oe=se.index+(se[1]||"").length;ne.push(ee.substring(ie,oe).replace(/%%/g,"%")),re.push(se),ie=fsFormatRegExp.lastIndex,fsFormatRegExp.lastIndex-=1,se=fsFormatRegExp.exec(ee)}return ne.length===0?te(ee.replace(/%%/g,"%")):(ne.push(ee.substring(ie).replace(/%%/g,"%")),createPrinter(te,ne,re))}}function format(ee,...te){let ne;return typeof ee=="object"?(ne=String(te[0]),te.shift()):ne=ee,ne.replace(formatRegExp,(re,ie,se,oe,he,ue)=>{if(ie<0||ie>=te.length)throw new Error("Index must be greater or equal to zero and less than the arguments' length.");let de=te[ie];if(isNumeric(de))switch(he=he==null?null:parseInt(he,10),oe){case"f":case"F":he=he!=null?he:2,de=toFixed(de,he);break;case"g":case"G":de=he!=null?toPrecision(de,he):toPrecision(de);break;case"e":case"E":de=he!=null?toExponential(de,he):toExponential(de);break;case"p":case"P":he=he!=null?he:2,de=toFixed(multiply$1(de,100),he)+" %";break;case"d":case"D":de=he!=null?padLeft(String(de),he,"0"):String(de);break;case"x":case"X":de=he!=null?padLeft(toHex(de),he,"0"):toHex(de),oe==="X"&&(de=de.toUpperCase());break;default:if(ue){let ae="";de=ue.replace(/([0#,]+)(\.[0#]+)?/,(le,Ae,_e)=>{isLessThan(de,0)&&(de=multiply$1(de,-1),ae="-"),_e=_e==null?"":_e.substring(1),de=toFixed(de,Math.max(_e.length,0));let[me,ve]=de.split(".");ve||(ve="");const Se=Ae.replace(/,/g,"").replace(/^#+/,"").length;me=padLeft(me,Se,"0");const Te=_e.replace(/#+$/,"").length;if(Te>ve.length?ve=padRight(ve,Te,"0"):Te<ve.length&&(ve=ve.substring(0,Te)+ve.substring(Te).replace(/0+$/,"")),Ae.indexOf(",")>0){const Pe=me.length%3,Re=Math.floor(me.length/3);let $e=Pe>0?me.substr(0,Pe)+(Re>0?",":""):"";for(let ye=0;ye<Re;ye++)$e+=me.substr(Pe+ye*3,3)+(ye<Re-1?",":"");me=$e}return ve.length>0?me+"."+ve:me}),de=ae+de}}else de instanceof Date?de=toString$2(de,ue||oe):de=toString$4(de);return se=parseInt((se||" ").substring(1),10),isNaN(se)||(de=pad(String(de),Math.abs(se)," ",se<0)),de})}function isNullOrEmpty(ee){return typeof ee!="string"||ee.length===0}function join(ee,te){return Array.isArray(te)?te.join(ee):Array.from(te).join(ee)}function pad(ee,te,ne,re){ne=ne||" ",te=te-ee.length;for(let ie=0;ie<te;ie++)ee=re?ee+ne:ne+ee;return ee}function padLeft(ee,te,ne){return pad(ee,te,ne)}function padRight(ee,te,ne){return pad(ee,te,ne,!0)}function split(ee,te,ne,re){if(ne=typeof ne=="number"?ne:void 0,re=typeof re=="number"?re:0,ne&&ne<0)throw new Error("Count cannot be less than zero");if(ne===0)return[];const ie=(re&1)===1,se=(re&2)===2;te=te||[],te=te.filter(ae=>ae).map(escape$1),te=te.length>0?te:["\\s"];const oe=[],he=new RegExp(te.join("|"),"g");let ue=!0,de=0;do{const ae=he.exec(ee);if(ae===null){const le=se?ee.substring(de).trim():ee.substring(de);(!ie||le.length>0)&&oe.push(le),ue=!1}else{const le=se?ee.substring(de,ae.index).trim():ee.substring(de,ae.index);(!ie||le.length>0)&&(ne!=null&&oe.length+1===ne?(oe.push(se?ee.substring(de).trim():ee.substring(de)),ue=!1):oe.push(le)),de=he.lastIndex}}while(ue);return oe}function trim(ee,...te){if(te.length===0)return ee.trim();const ne="["+escape$1(te.join(""))+"]+";return ee.replace(new RegExp("^"+ne),"").replace(new RegExp(ne+"$"),"")}const guidRegex=/^[\(\{]{0,2}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[\)\}]{0,2}$/,guidRegexNoHyphen=/^([0-9a-f]{8})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{12})$/,guidRegexHex=/^\{0x[0-9a-f]{8},(0x[0-9a-f]{4},){2}\{(0x[0-9a-f]{2},){7}0x[0-9a-f]{2}\}\}$/;function parse$2(ee){function te(re){return re.replace(guidRegexNoHyphen,"$1-$2-$3-$4-$5")}const ne=ee.trim().toLowerCase();if(guidRegex.test(ne))return trim(ne,"{","}","(",")");if(guidRegexNoHyphen.test(ne))return te(ne);if(guidRegexHex.test(ne))return te(ne.replace(/[\{\},]|0x/g,""));throw new Error("Guid should contain 32 digits with 4 dashes: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")}function tryParse$2(ee,te){try{return te.contents=parse$2(ee),!0}catch{return!1}}function some(ee){return ee==null||ee instanceof Some?new Some(ee):ee}function defaultArg(ee,te){return ee!=null?value(ee):te}function defaultArgWith(ee,te){return ee!=null?value(ee):te()}function map$5(ee,te){return te!=null?some(ee(value(te))):void 0}class FSharpResult$2 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Ok","Error"]}}function Result_Map(ee,te){return te.tag===0?new FSharpResult$2(0,[ee(te.fields[0])]):new FSharpResult$2(1,[te.fields[0]])}function Result_Bind(ee,te){return te.tag===0?ee(te.fields[0]):new FSharpResult$2(1,[te.fields[0]])}class FSharpChoice$2 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Choice1Of2","Choice2Of2"]}}function Choice_makeChoice1Of2(ee){return new FSharpChoice$2(0,[ee])}function Choice_makeChoice2Of2(ee){return new FSharpChoice$2(1,[ee])}const SR_inputWasEmpty="Collection was empty.";function Helpers_allocateArrayFromCons(ee,te){return typeof ee=="function"?new ee(te):new Array(te)}function fill(ee,te,ne,re){const ie=te|0;return ee.fill(re,ie,ie+ne)}function map$4(ee,te,ne){const re=te.length|0,ie=Helpers_allocateArrayFromCons(ne,re);for(let se=0;se<=re-1;se++)ie[se]=ee(te[se]);return ie}function singleton$3(ee,te){const ne=Helpers_allocateArrayFromCons(te,1);return ne[0]=ee,ne}function reverse$2(ee){return ee.slice().reverse()}function tryFind$1(ee,te){return te.find(ee)}function choose$1(ee,te,ne){const re=[];for(let ie=0;ie<=te.length-1;ie++){const se=ee(te[ie]);if(se!=null){const oe=value(se);re.push(oe)}}return equals$2(ne,defaultOf())?re:map$4(ie=>ie,re,ne)}function fold$2(ee,te,ne){return ne.reduce(ee,te)}function foldBack$1(ee,te,ne){return te.reduceRight((re,ie)=>ee(ie,re),ne)}class FSharpList extends Record{constructor(te,ne){super(),this.head=te,this.tail=ne}toString(){return"["+join("; ",this)+"]"}Equals(te){const ne=this;return ne===te?!0:((ie,se)=>{e:for(;;){const oe=ie,he=se,ue=oe.tail,de=he.tail;if(ue!=null)if(de!=null){const ae=ue,le=de;if(equals$2(oe.head,he.head)){ie=ae,se=le;continue e}else return!1}else return!1;else return de==null}})(ne,te)}GetHashCode(){return((re,ie,se)=>{e:for(;;){const oe=re,he=ie,ue=se,de=ue.tail;if(de!=null){const ae=de;if(oe>18)return he|0;re=oe+1,ie=(he<<1)+structuralHash(ue.head)+631*oe,se=ae;continue e}else return he|0}})(0,0,this)|0}toJSON(){const te=this;return Array.from(te)}CompareTo(te){return((ie,se)=>{e:for(;;){const oe=ie,he=se,ue=oe.tail,de=he.tail;if(ue!=null)if(de!=null){const ae=ue,le=de,Ae=compare$2(oe.head,he.head)|0;if(Ae===0){ie=ae,se=le;continue e}else return Ae|0}else return 1;else return de!=null?-1:0}})(this,te)|0}GetEnumerator(){return ListEnumerator$1_$ctor_3002E699(this)}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return getEnumerator(this)}}class ListEnumerator$1{constructor(te){this.xs=te,this.it=this.xs,this.current=defaultOf()}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current}"System.Collections.IEnumerator.get_Current"(){return this.current}"System.Collections.IEnumerator.MoveNext"(){const te=this,ne=te.it.tail;if(ne!=null){const re=ne;return te.current=te.it.head,te.it=re,!0}else return!1}"System.Collections.IEnumerator.Reset"(){const te=this;te.it=te.xs,te.current=defaultOf()}Dispose(){}}function ListEnumerator$1_$ctor_3002E699(ee){return new ListEnumerator$1(ee)}function FSharpList_get_Empty(){return new FSharpList(defaultOf(),void 0)}function FSharpList_Cons_305B8EAC(ee,te){return new FSharpList(ee,te)}function FSharpList__get_IsEmpty(ee){return ee.tail==null}function FSharpList__get_Length(ee){return((ne,re)=>{e:for(;;){const ie=ne,oe=re.tail;if(oe!=null){ne=ie+1,re=oe;continue e}else return ie|0}})(0,ee)|0}function FSharpList__get_Head(ee){if(ee.tail!=null)return ee.head;throw new Error(SR_inputWasEmpty+"\\nParameter name: list")}function FSharpList__get_Tail(ee){const te=ee.tail;if(te!=null)return te;throw new Error(SR_inputWasEmpty+"\\nParameter name: list")}function empty$3(){return FSharpList_get_Empty()}function cons(ee,te){return FSharpList_Cons_305B8EAC(ee,te)}function singleton$2(ee){return FSharpList_Cons_305B8EAC(ee,FSharpList_get_Empty())}function isEmpty(ee){return FSharpList__get_IsEmpty(ee)}function head(ee){return FSharpList__get_Head(ee)}function tail(ee){return FSharpList__get_Tail(ee)}function toArray$1(ee){const te=FSharpList__get_Length(ee)|0,ne=fill(new Array(te),0,te,null);return((ie,se)=>{e:for(;;){const oe=ie,he=se;if(!FSharpList__get_IsEmpty(he)){ne[oe]=FSharpList__get_Head(he),ie=oe+1,se=FSharpList__get_Tail(he);continue e}break}})(0,ee),ne}function fold$1(ee,te,ne){let re=te,ie=ne;for(;!FSharpList__get_IsEmpty(ie);)re=ee(re,head(ie)),ie=FSharpList__get_Tail(ie);return re}function reverse$1(ee){return fold$1((te,ne)=>FSharpList_Cons_305B8EAC(ne,te),FSharpList_get_Empty(),ee)}function foldBack(ee,te,ne){return foldBack$1(ee,toArray$1(te),ne)}function iterate$1(ee,te){fold$1((ne,re)=>{ee(re)},void 0,te)}function ofArrayWithTail(ee,te){let ne=te;for(let re=ee.length-1;re>=0;re--)ne=FSharpList_Cons_305B8EAC(ee[re],ne);return ne}function ofArray$2(ee){return ofArrayWithTail(ee,FSharpList_get_Empty())}function ofSeq$3(ee){let te,ne;if(isArrayLike(ee))return ofArray$2(ee);if(ee instanceof FSharpList)return ee;{const re=FSharpList_get_Empty();let ie=re;const se=getEnumerator(ee);try{for(;se["System.Collections.IEnumerator.MoveNext"]();){const ue=se["System.Collections.Generic.IEnumerator`1.get_Current"]();ie=(te=ie,ne=new FSharpList(ue,void 0),te.tail=ne,ne)}}finally{disposeSafe(se)}const oe=ie,he=FSharpList_get_Empty();return oe.tail=he,FSharpList__get_Tail(re)}}function append$1(ee,te){return fold$1((ne,re)=>FSharpList_Cons_305B8EAC(re,ne),te,reverse$1(ee))}function map$3(ee,te){const ne=FSharpList_get_Empty(),re=fold$1((se,oe)=>{const he=new FSharpList(ee(oe),void 0);return se.tail=he,he},ne,te),ie=FSharpList_get_Empty();return re.tail=ie,FSharpList__get_Tail(ne)}function filter(ee,te){const ne=FSharpList_get_Empty(),re=fold$1((se,oe)=>{if(ee(oe)){const he=new FSharpList(oe,void 0);return se.tail=he,he}else return se},ne,te),ie=FSharpList_get_Empty();return re.tail=ie,FSharpList__get_Tail(ne)}function partition(ee,te){const ne=FSharpList_get_Empty(),re=FSharpList_get_Empty(),ie=ne,se=fold$1((ue,de)=>{let ae,le;const Ae=ue[0],_e=ue[1];return ee(de)?[(ae=new FSharpList(de,void 0),Ae.tail=ae,ae),_e]:[Ae,(le=new FSharpList(de,void 0),_e.tail=le,le)]},[ie,re],te),oe=FSharpList_get_Empty();se[0].tail=oe;const he=FSharpList_get_Empty();return se[1].tail=he,[FSharpList__get_Tail(ie),FSharpList__get_Tail(re)]}function choose(ee,te){const ne=FSharpList_get_Empty(),re=fold$1((se,oe)=>{const he=ee(oe);if(he==null)return se;{const ue=new FSharpList(value(he),void 0);return se.tail=ue,ue}},ne,te),ie=FSharpList_get_Empty();return re.tail=ie,FSharpList__get_Tail(ne)}function forAll(ee,te){return fold$1((ne,re)=>ne&&ee(re),!0,te)}function Operators_NullArg(ee){throw new Error(ee)}const SR_enumerationAlreadyFinished="Enumeration already finished.",SR_enumerationNotStarted="Enumeration has not started. Call MoveNext.",SR_notEnoughElements="The input sequence has an insufficient number of elements.",SR_resetNotSupported="Reset is not supported on this enumerator.";function Enumerator_noReset(){throw new Error(SR_resetNotSupported)}function Enumerator_notStarted(){throw new Error(SR_enumerationNotStarted)}function Enumerator_alreadyFinished(){throw new Error(SR_enumerationAlreadyFinished)}class Enumerator_Seq{constructor(te){this.f=te}toString(){const te=this;let ne=0,re="seq [";const ie=getEnumerator(te);try{for(;ne<4&&ie["System.Collections.IEnumerator.MoveNext"]();)ne>0&&(re=re+"; "),re=re+toString$4(ie["System.Collections.Generic.IEnumerator`1.get_Current"]()),ne=ne+1|0;return ne===4&&(re=re+"; ..."),re+"]"}finally{disposeSafe(ie)}}GetEnumerator(){return this.f()}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return this.f()}}function Enumerator_Seq_$ctor_673A07F2(ee){return new Enumerator_Seq(ee)}class Enumerator_FromFunctions$1{constructor(te,ne,re){this.current=te,this.next=ne,this.dispose=re}"System.Collections.Generic.IEnumerator`1.get_Current"(){return this.current()}"System.Collections.IEnumerator.get_Current"(){return this.current()}"System.Collections.IEnumerator.MoveNext"(){return this.next()}"System.Collections.IEnumerator.Reset"(){Enumerator_noReset()}Dispose(){this.dispose()}}function Enumerator_FromFunctions$1_$ctor_58C54629(ee,te,ne){return new Enumerator_FromFunctions$1(ee,te,ne)}function Enumerator_concat(ee){let te,ne,re=!1,ie=!1,se;const oe=()=>{if(ie=!0,ne!=null){const he=ne;try{disposeSafe(he)}finally{ne=void 0}}if(te!=null){const he=te;try{disposeSafe(he)}finally{te=void 0}}};return Enumerator_FromFunctions$1_$ctor_58C54629(()=>(re?ie&&Enumerator_alreadyFinished():Enumerator_notStarted(),se!=null?value(se):Enumerator_alreadyFinished()),()=>{let he;if(re||(re=!0),ie)return!1;{let ue;for(;ue==null;){const de=te,ae=ne;if(de!=null)if(ae!=null){const le=ae;if(le["System.Collections.IEnumerator.MoveNext"]())se=some(le["System.Collections.Generic.IEnumerator`1.get_Current"]()),ue=!0;else try{disposeSafe(le)}finally{ne=void 0}}else{const le=de;le["System.Collections.IEnumerator.MoveNext"]()?ne=(he=le["System.Collections.Generic.IEnumerator`1.get_Current"](),getEnumerator(he)):(oe(),ue=!1)}else te=getEnumerator(ee)}return value(ue)}},()=>{ie||oe()})}function Enumerator_enumerateThenFinally(ee,te){return Enumerator_FromFunctions$1_$ctor_58C54629(()=>te["System.Collections.Generic.IEnumerator`1.get_Current"](),()=>te["System.Collections.IEnumerator.MoveNext"](),()=>{try{disposeSafe(te)}finally{ee()}})}function Enumerator_generateWhileSome(ee,te,ne){let re=!1,ie,se=some(ee());const oe=()=>{if(se!=null){const ue=value(se);try{ne(ue)}finally{se=void 0}}},he=()=>{try{oe()}finally{ie=void 0}};return Enumerator_FromFunctions$1_$ctor_58C54629(()=>(re||Enumerator_notStarted(),ie!=null?value(ie):Enumerator_alreadyFinished()),()=>{if(re||(re=!0),se!=null){const ue=value(se);let de;try{de=te(ue)}catch(ae){throw he(),ae}return de!=null?(ie=de,!0):(he(),!1)}else return!1},oe)}function Enumerator_unfold(ee,te){let ne,re=te;return Enumerator_FromFunctions$1_$ctor_58C54629(()=>{if(ne!=null){const ie=ne[0];return ne[1],ie}else return Enumerator_notStarted()},()=>(ne=ee(re),ne!=null?(ne[0],re=ne[1],!0):!1),()=>{})}function checkNonNull(ee,te){te==null&&Operators_NullArg(ee)}function mkSeq(ee){return Enumerator_Seq_$ctor_673A07F2(ee)}function ofSeq$2(ee){return checkNonNull("source",ee),getEnumerator(ee)}function delay(ee){return mkSeq(()=>getEnumerator(ee()))}function concat(ee){return mkSeq(()=>Enumerator_concat(ee))}function unfold(ee,te){return mkSeq(()=>Enumerator_unfold(ee,te))}function empty$2(){return delay(()=>new Array(0))}function singleton$1(ee){return delay(()=>singleton$3(ee))}function ofArray$1(ee){return ee}function toArray(ee){return ee instanceof FSharpList?toArray$1(ee):Array.from(ee)}function toList(ee){return isArrayLike(ee)?ofArray$2(ee):ee instanceof FSharpList?ee:ofSeq$3(ee)}function generate(ee,te,ne){return mkSeq(()=>Enumerator_generateWhileSome(ee,te,ne))}function generateIndexed(ee,te,ne){return mkSeq(()=>{let re=-1;return Enumerator_generateWhileSome(ee,ie=>(re=re+1|0,te(re,ie)),ne)})}function append(ee,te){return concat([ee,te])}function compareWith(ee,te,ne){const re=ofSeq$2(te);try{const ie=ofSeq$2(ne);try{let se=0,oe=re["System.Collections.IEnumerator.MoveNext"](),he=ie["System.Collections.IEnumerator.MoveNext"]();for(;se===0&&oe&&he;)se=ee(re["System.Collections.Generic.IEnumerator`1.get_Current"](),ie["System.Collections.Generic.IEnumerator`1.get_Current"]())|0,se===0&&(oe=re["System.Collections.IEnumerator.MoveNext"](),he=ie["System.Collections.IEnumerator.MoveNext"]());return(se!==0?se:oe?1:he?-1:0)|0}finally{disposeSafe(ie)}}finally{disposeSafe(re)}}function contains$1(ee,te,ne){const re=ofSeq$2(te);try{let ie=!1;for(;!ie&&re["System.Collections.IEnumerator.MoveNext"]();)ie=ne.Equals(ee,re["System.Collections.Generic.IEnumerator`1.get_Current"]());return ie}finally{disposeSafe(re)}}function fold(ee,te,ne){const re=ofSeq$2(ne);try{let ie=te;for(;re["System.Collections.IEnumerator.MoveNext"]();)ie=ee(ie,re["System.Collections.Generic.IEnumerator`1.get_Current"]());return ie}finally{disposeSafe(re)}}function iterate(ee,te){fold((ne,re)=>{ee(re)},void 0,te)}function map$2(ee,te){return generate(()=>ofSeq$2(te),ne=>ne["System.Collections.IEnumerator.MoveNext"]()?some(ee(ne["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,ne=>{disposeSafe(ne)})}function mapIndexed(ee,te){return generateIndexed(()=>ofSeq$2(te),(ne,re)=>re["System.Collections.IEnumerator.MoveNext"]()?some(ee(ne,re["System.Collections.Generic.IEnumerator`1.get_Current"]())):void 0,ne=>{disposeSafe(ne)})}function reverse(ee){return delay(()=>reverse$2(toArray(ee)))}function skip(ee,te){return mkSeq(()=>{const ne=ofSeq$2(te);try{for(let re=1;re<=ee;re++)if(!ne["System.Collections.IEnumerator.MoveNext"]())throw new Error(SR_notEnoughElements+"\\nParameter name: source");return Enumerator_enumerateThenFinally(()=>{},ne)}catch(re){throw disposeSafe(ne),re}})}function take(ee,te){return generateIndexed(()=>ofSeq$2(te),(ne,re)=>{if(ne<ee){if(re["System.Collections.IEnumerator.MoveNext"]())return some(re["System.Collections.Generic.IEnumerator`1.get_Current"]());throw new Error(SR_notEnoughElements+"\\nParameter name: source")}else return},ne=>{disposeSafe(ne)})}function collect(ee,te){return delay(()=>concat(map$2(ee,te)))}class PolicyTypeDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["InformationStatement","Custom"]}}function PolicyTypeDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.Common.PolicyTypeDto",[],PolicyTypeDto,()=>[[],[]])}class PathDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["BlobStorage","Unused"]}}function PathDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.Common.PathDto",[],PathDto,()=>[[["Item",string_type]],[]])}function PathDto__get_Value(ee){if(ee.tag===1)throw new Error("PathDto.Unused");return ee.fields[0]}class FileDto extends Record{constructor(te,ne){super(),this.Name=te,this.Path=ne}}function FileDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.Common.FileDto",[],FileDto,()=>[["Name",string_type],["Path",PathDto$reflection()]])}class AboutDto extends Record{constructor(te,ne){super(),this.Copy=te,this.Link=ne}}function AboutDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.Common.AboutDto",[],AboutDto,()=>[["Copy",string_type],["Link",string_type]])}const CaseRules={None:0,LowerFirst:1,SnakeCase:2,SnakeCaseAllCaps:3,KebabCase:4};function dashify(ee,te){return ee.replace(/[a-z]?[A-Z]/g,ne=>ne.length===1?ne.toLowerCase():ne.charAt(0)+te+ne.charAt(1).toLowerCase())}function changeCase(ee,te){switch(te){case CaseRules.LowerFirst:return ee.charAt(0).toLowerCase()+ee.slice(1);case CaseRules.SnakeCase:return dashify(ee,"_");case CaseRules.SnakeCaseAllCaps:return dashify(ee,"_").toUpperCase();case CaseRules.KebabCase:return dashify(ee,"-");case CaseRules.None:default:return ee}}function keyValueList(ee,te=CaseRules.None){const ne={},re=te;function ie(oe){throw new Error("Cannot infer key and value of "+String(oe))}function se(oe,he,ue){oe=changeCase(oe,he),ne[oe]=ue}for(let oe of ee){let he=CaseRules.None;if(oe==null&&ie(oe),oe instanceof Union){const ue=oe.cases()[oe.tag];oe=oe.fields.length===0?ue:[ue].concat(oe.fields),he=re}if(Array.isArray(oe))switch(oe.length){case 0:ie(oe);break;case 1:se(oe[0],he,!0);break;case 2:const ue=oe[1];se(oe[0],he,ue);break;default:se(oe[0],he,oe.slice(1))}else typeof oe=="string"?se(oe,he,!0):ie(oe)}return ne}function makeRangeStepFunction(ee,te,ne,re){const ie=compare$2(ee,ne)|0;if(ie===0)throw new Error("The step of a range cannot be zero");const se=ie>0;return oe=>{const he=compare$2(oe,te)|0;return se&&he<=0||!se&&he>=0?[oe,re(oe,ee)]:void 0}}function integralRangeStep(ee,te,ne,re,ie){const se=makeRangeStepFunction(te,ne,re,ie);return delay(()=>unfold(se,ee))}function rangeDouble(ee,te,ne){return integralRangeStep(ee,te,ne,0,(re,ie)=>re+ie)}class PolicyIdentifierDto extends Record{constructor(te,ne,re){super(),this.PolicyId=te,this.PolicyType=ne,this.VersionNumber=re|0}}function PolicyIdentifierDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyIdentifierDto",[],PolicyIdentifierDto,()=>[["PolicyId",string_type],["PolicyType",PolicyTypeDto$reflection()],["VersionNumber",int32_type]])}class PolicyReviewItemStatusDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Presented","Opened","Accepted"]}}function PolicyReviewItemStatusDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyReviewItemStatusDto",[],PolicyReviewItemStatusDto,()=>[[],[],[]])}function PolicyReviewItemStatusDto__ToNextStatus_468E0CC(ee,te){let ne;switch(ee.tag===1?te.tag===2?ne=1:te.tag===0?ne=2:ne=1:ee.tag===2?(te.tag===1||te.tag,ne=3):(te.tag===1||te.tag,ne=0),ne){case 0:return te;case 1:return te;case 2:return ee;case 3:return ee}}class PolicyReviewItemDto extends Record{constructor(te,ne){super(),this.Policy=te,this.Status=ne}}function PolicyReviewItemDto$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.PolicyReviewItemDto",[],PolicyReviewItemDto,()=>[["Policy",anonRecord_type(["About",AboutDto$reflection()],["CreatedAt",class_type("System.DateTime")],["Description",string_type],["File",FileDto$reflection()],["Identifier",PolicyIdentifierDto$reflection()],["Title",string_type])],["Status",PolicyReviewItemStatusDto$reflection()]])}class InitResponse extends Record{constructor(te){super(),this.PolicyReviewList=te}}function InitResponse$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.InitResponse",[],InitResponse,()=>[["PolicyReviewList",list_type(PolicyReviewItemDto$reflection())]])}class InitResponseError extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["NoConfigFound"]}}function InitResponseError$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.InitResponseError",[],InitResponseError,()=>[[]])}class CommandRequest extends Record{constructor(te){super(),this.Type=te}}function CommandRequest$reflection(){return record_type("WorkplacePolicies.Api.Shared.BackendApiModels.CommandRequest",[],CommandRequest,()=>[["Type",CommandTypeDto$reflection()]])}class CommandTypeDto extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Present","Open","Accept","Complete"]}}function CommandTypeDto$reflection(){return union_type("WorkplacePolicies.Api.Shared.BackendApiModels.CommandTypeDto",[],CommandTypeDto,()=>[[["Item",anonRecord_type(["PolicyIdentifierList",list_type(PolicyIdentifierDto$reflection())])]],[["Item",PolicyIdentifierDto$reflection()]],[["Item",PolicyIdentifierDto$reflection()]],[["Item",anonRecord_type(["PolicyIdentifierList",list_type(PolicyIdentifierDto$reflection())])]]])}class CancellationToken{constructor(te=!1){this._id=0,this._cancelled=te,this._listeners=new Map}get isCancelled(){return this._cancelled}cancel(){if(!this._cancelled){this._cancelled=!0;for(const[,te]of this._listeners)te()}}addListener(te){const ne=this._id;return this._listeners.set(this._id++,te),ne}removeListener(te){return this._listeners.delete(te)}register(te,ne){const re=this,ie=this.addListener(ne==null?te:()=>te(ne));return{Dispose(){re.removeListener(ie)}}}Dispose(){}}class OperationCanceledError extends Error{constructor(){super("The operation was canceled"),Object.setPrototypeOf(this,OperationCanceledError.prototype)}}class Trampoline{static get maxTrampolineCallCount(){return 2e3}constructor(){this.callCount=0}incrementAndCheck(){return this.callCount++>Trampoline.maxTrampolineCallCount}hijack(te){this.callCount=0,setTimeout(te,0)}}function protectedCont(ee){return te=>{if(te.cancelToken.isCancelled)te.onCancel(new OperationCanceledError);else if(te.trampoline.incrementAndCheck())te.trampoline.hijack(()=>{try{ee(te)}catch(ne){te.onError(ensureErrorOrException(ne))}});else try{ee(te)}catch(ne){te.onError(ensureErrorOrException(ne))}}}function protectedBind(ee,te){return protectedCont(ne=>{ee({onSuccess:re=>{try{te(re)(ne)}catch(ie){ne.onError(ensureErrorOrException(ie))}},onError:ne.onError,onCancel:ne.onCancel,cancelToken:ne.cancelToken,trampoline:ne.trampoline})})}function protectedReturn(ee){return protectedCont(te=>te.onSuccess(ee))}class AsyncBuilder{Bind(te,ne){return protectedBind(te,ne)}Combine(te,ne){return this.Bind(te,()=>ne)}Delay(te){return protectedCont(ne=>te()(ne))}For(te,ne){const re=te[Symbol.iterator]();let ie=re.next();return this.While(()=>!ie.done,this.Delay(()=>{const se=ne(ie.value);return ie=re.next(),se}))}Return(te){return protectedReturn(te)}ReturnFrom(te){return te}TryFinally(te,ne){return protectedCont(re=>{te({onSuccess:ie=>{ne(),re.onSuccess(ie)},onError:ie=>{ne(),re.onError(ie)},onCancel:ie=>{ne(),re.onCancel(ie)},cancelToken:re.cancelToken,trampoline:re.trampoline})})}TryWith(te,ne){return protectedCont(re=>{te({onSuccess:re.onSuccess,onCancel:re.onCancel,cancelToken:re.cancelToken,trampoline:re.trampoline,onError:ie=>{try{ne(ie)(re)}catch(se){re.onError(ensureErrorOrException(se))}}})})}Using(te,ne){return this.TryFinally(ne(te),()=>te.Dispose())}While(te,ne){return te()?this.Bind(ne,()=>this.While(te,ne)):this.Return(void 0)}Zero(){return protectedCont(te=>te.onSuccess(void 0))}}const singleton=new AsyncBuilder;function emptyContinuation(ee){}function awaitPromise(ee){return fromContinuations(te=>ee.then(te[0]).catch(ne=>(ne instanceof OperationCanceledError?te[2]:te[1])(ne)))}const defaultCancellationToken=new CancellationToken;function catchAsync(ee){return protectedCont(te=>{ee({onSuccess:ne=>te.onSuccess(Choice_makeChoice1Of2(ne)),onError:ne=>te.onSuccess(Choice_makeChoice2Of2(ne)),onCancel:te.onCancel,cancelToken:te.cancelToken,trampoline:te.trampoline})})}function fromContinuations(ee){return protectedCont(te=>ee([te.onSuccess,te.onError,te.onCancel]))}function sleep(ee){return protectedCont(te=>{let ne;const re=setTimeout(()=>{te.cancelToken.removeListener(ne),te.onSuccess(void 0)},ee);ne=te.cancelToken.addListener(()=>{clearTimeout(re),te.onCancel(new OperationCanceledError)})})}function start(ee,te){return startWithContinuations(ee,te)}function startImmediate(ee,te){return start(ee,te)}function startWithContinuations(ee,te,ne,re,ie){typeof te!="function"&&(ie=te,te=void 0);const se=new Trampoline;ee({onSuccess:te||emptyContinuation,onError:ne||emptyContinuation,onCancel:re||emptyContinuation,cancelToken:ie||defaultCancellationToken,trampoline:se})}class HttpMethod extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]}}class Header extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Header"]}}class BodyContent extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Empty","Text","Binary","Form"]}}class HttpRequest extends Record{constructor(te,ne,re,ie,se,oe,he,ue){super(),this.url=te,this.method=ne,this.headers=re,this.withCredentials=ie,this.overridenMimeType=se,this.overridenResponseType=oe,this.timeout=he,this.content=ue}}class ResponseContent extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Text","Blob","ArrayBuffer","Unknown"]}}class HttpResponse extends Record{constructor(te,ne,re,ie,se,oe){super(),this.statusCode=te|0,this.responseText=ne,this.responseType=re,this.responseUrl=ie,this.responseHeaders=se,this.content=oe}}class MapTreeLeaf$2{constructor(te,ne){this.k=te,this.v=ne}}function MapTreeLeaf$2_$ctor_5BDDA1(ee,te){return new MapTreeLeaf$2(ee,te)}function MapTreeLeaf$2__get_Key(ee){return ee.k}function MapTreeLeaf$2__get_Value(ee){return ee.v}class MapTreeNode$2 extends MapTreeLeaf$2{constructor(te,ne,re,ie,se){super(te,ne),this.left=re,this.right=ie,this.h=se|0}}function MapTreeNode$2_$ctor_Z39DE9543(ee,te,ne,re,ie){return new MapTreeNode$2(ee,te,ne,re,ie)}function MapTreeNode$2__get_Left(ee){return ee.left}function MapTreeNode$2__get_Right(ee){return ee.right}function MapTreeNode$2__get_Height(ee){return ee.h}function MapTreeModule_empty(){}function MapTreeModule_sizeAux(ee,te){e:for(;;){const ne=ee,re=te;if(re!=null){const ie=re;if(ie instanceof MapTreeNode$2){const se=ie;ee=MapTreeModule_sizeAux(ne+1,MapTreeNode$2__get_Left(se)),te=MapTreeNode$2__get_Right(se);continue e}else return ne+1|0}else return ne|0}}function MapTreeModule_size(ee){return MapTreeModule_sizeAux(0,ee)}function MapTreeModule_mk(ee,te,ne,re){let ie,se,oe;const he=ee;if(he!=null){const le=he;oe=le instanceof MapTreeNode$2?(ie=le,MapTreeNode$2__get_Height(ie)):1}else oe=0;let ue;const de=re;if(de!=null){const le=de;ue=le instanceof MapTreeNode$2?(se=le,MapTreeNode$2__get_Height(se)):1}else ue=0;const ae=(oe<ue?ue:oe)|0;return ae===0?MapTreeLeaf$2_$ctor_5BDDA1(te,ne):MapTreeNode$2_$ctor_Z39DE9543(te,ne,ee,re,ae+1)}function MapTreeModule_rebalance(ee,te,ne,re){let ie,se,oe,he,ue,de,ae,le,Ae;const _e=ee;if(_e!=null){const Se=_e;Ae=Se instanceof MapTreeNode$2?(ie=Se,MapTreeNode$2__get_Height(ie)):1}else Ae=0;let me;const ve=re;if(ve!=null){const Se=ve;me=Se instanceof MapTreeNode$2?(se=Se,MapTreeNode$2__get_Height(se)):1}else me=0;if(me>Ae+2){const Se=value(re);if(Se instanceof MapTreeNode$2){const Te=Se;if(oe=MapTreeNode$2__get_Left(Te),(oe!=null?(he=oe,he instanceof MapTreeNode$2?(ue=he,MapTreeNode$2__get_Height(ue)):1):0)>Ae+1){const Pe=value(MapTreeNode$2__get_Left(Te));if(Pe instanceof MapTreeNode$2){const Re=Pe;return MapTreeModule_mk(MapTreeModule_mk(ee,te,ne,MapTreeNode$2__get_Left(Re)),MapTreeLeaf$2__get_Key(Re),MapTreeLeaf$2__get_Value(Re),MapTreeModule_mk(MapTreeNode$2__get_Right(Re),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeNode$2__get_Right(Te)))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(MapTreeModule_mk(ee,te,ne,MapTreeNode$2__get_Left(Te)),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeNode$2__get_Right(Te))}else throw new Error("internal error: Map.rebalance")}else if(Ae>me+2){const Se=value(ee);if(Se instanceof MapTreeNode$2){const Te=Se;if(de=MapTreeNode$2__get_Right(Te),(de!=null?(ae=de,ae instanceof MapTreeNode$2?(le=ae,MapTreeNode$2__get_Height(le)):1):0)>me+1){const Pe=value(MapTreeNode$2__get_Right(Te));if(Pe instanceof MapTreeNode$2){const Re=Pe;return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(Te),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeNode$2__get_Left(Re)),MapTreeLeaf$2__get_Key(Re),MapTreeLeaf$2__get_Value(Re),MapTreeModule_mk(MapTreeNode$2__get_Right(Re),te,ne,re))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(MapTreeNode$2__get_Left(Te),MapTreeLeaf$2__get_Key(Te),MapTreeLeaf$2__get_Value(Te),MapTreeModule_mk(MapTreeNode$2__get_Right(Te),te,ne,re))}else throw new Error("internal error: Map.rebalance")}else return MapTreeModule_mk(ee,te,ne,re)}function MapTreeModule_add(ee,te,ne,re){if(re!=null){const ie=re,se=ee.Compare(te,MapTreeLeaf$2__get_Key(ie))|0;if(ie instanceof MapTreeNode$2){const oe=ie;return se<0?MapTreeModule_rebalance(MapTreeModule_add(ee,te,ne,MapTreeNode$2__get_Left(oe)),MapTreeLeaf$2__get_Key(oe),MapTreeLeaf$2__get_Value(oe),MapTreeNode$2__get_Right(oe)):se===0?MapTreeNode$2_$ctor_Z39DE9543(te,ne,MapTreeNode$2__get_Left(oe),MapTreeNode$2__get_Right(oe),MapTreeNode$2__get_Height(oe)):MapTreeModule_rebalance(MapTreeNode$2__get_Left(oe),MapTreeLeaf$2__get_Key(oe),MapTreeLeaf$2__get_Value(oe),MapTreeModule_add(ee,te,ne,MapTreeNode$2__get_Right(oe)))}else return se<0?MapTreeNode$2_$ctor_Z39DE9543(te,ne,void 0,re,2):se===0?MapTreeLeaf$2_$ctor_5BDDA1(te,ne):MapTreeNode$2_$ctor_Z39DE9543(te,ne,re,void 0,2)}else return MapTreeLeaf$2_$ctor_5BDDA1(te,ne)}function MapTreeModule_tryFind(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se!=null){const oe=se,he=re.Compare(ie,MapTreeLeaf$2__get_Key(oe))|0;if(he===0)return some(MapTreeLeaf$2__get_Value(oe));if(oe instanceof MapTreeNode$2){const ue=oe;ee=re,te=ie,ne=he<0?MapTreeNode$2__get_Left(ue):MapTreeNode$2__get_Right(ue);continue e}else return}else return}}function MapTreeModule_find(ee,te,ne){const re=MapTreeModule_tryFind(ee,te,ne);if(re==null)throw new Error;return value(re)}function MapTreeModule_mem(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se!=null){const oe=se,he=re.Compare(ie,MapTreeLeaf$2__get_Key(oe))|0;if(oe instanceof MapTreeNode$2){const ue=oe;if(he<0){ee=re,te=ie,ne=MapTreeNode$2__get_Left(ue);continue e}else{if(he===0)return!0;ee=re,te=ie,ne=MapTreeNode$2__get_Right(ue);continue e}}else return he===0}else return!1}}function MapTreeModule_iterOpt(ee,te){e:for(;;){const ne=ee,re=te;if(re!=null){const ie=re;if(ie instanceof MapTreeNode$2){const se=ie;MapTreeModule_iterOpt(ne,MapTreeNode$2__get_Left(se)),ne(MapTreeLeaf$2__get_Key(se),MapTreeLeaf$2__get_Value(se)),ee=ne,te=MapTreeNode$2__get_Right(se);continue e}else ne(MapTreeLeaf$2__get_Key(ie),MapTreeLeaf$2__get_Value(ie))}break}}function MapTreeModule_iter(ee,te){MapTreeModule_iterOpt(ee,te)}function MapTreeModule_mapiOpt(ee,te){if(te!=null){const ne=te;if(ne instanceof MapTreeNode$2){const re=ne,ie=MapTreeModule_mapiOpt(ee,MapTreeNode$2__get_Left(re)),se=ee(MapTreeLeaf$2__get_Key(re),MapTreeLeaf$2__get_Value(re)),oe=MapTreeModule_mapiOpt(ee,MapTreeNode$2__get_Right(re));return MapTreeNode$2_$ctor_Z39DE9543(MapTreeLeaf$2__get_Key(re),se,ie,oe,MapTreeNode$2__get_Height(re))}else return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(ne),ee(MapTreeLeaf$2__get_Key(ne),MapTreeLeaf$2__get_Value(ne)))}else return void 0}function MapTreeModule_mapi(ee,te){return MapTreeModule_mapiOpt(ee,te)}function MapTreeModule_copyToArray(ee,te,ne){let re=ne;MapTreeModule_iter((ie,se)=>{te[re]=[ie,se],re=re+1|0},ee)}function MapTreeModule_ofList(ee,te){return fold$1((ne,re)=>MapTreeModule_add(ee,re[0],re[1],ne),void 0,te)}function MapTreeModule_mkFromEnumerator(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se["System.Collections.IEnumerator.MoveNext"]()){const oe=se["System.Collections.Generic.IEnumerator`1.get_Current"]();ee=re,te=MapTreeModule_add(re,oe[0],oe[1],ie),ne=se;continue e}else return ie}}function MapTreeModule_ofArray(ee,te){let ne=void 0;for(let re=0;re<=te.length-1;re++){const ie=te[re];ne=MapTreeModule_add(ee,ie[0],ie[1],ne)}return ne}function MapTreeModule_ofSeq(ee,te){if(isArrayLike(te))return MapTreeModule_ofArray(ee,te);if(te instanceof FSharpList)return MapTreeModule_ofList(ee,te);{const ne=getEnumerator(te);try{return MapTreeModule_mkFromEnumerator(ee,void 0,ne)}finally{disposeSafe(ne)}}}class MapTreeModule_MapIterator$2 extends Record{constructor(te,ne){super(),this.stack=te,this.started=ne}}function MapTreeModule_collapseLHS(ee){e:for(;;){const te=ee;if(isEmpty(te))return empty$3();{const ne=tail(te),re=head(te);if(re!=null){const ie=re;if(ie instanceof MapTreeNode$2){const se=ie;ee=ofArrayWithTail([MapTreeNode$2__get_Left(se),MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(se),MapTreeLeaf$2__get_Value(se)),MapTreeNode$2__get_Right(se)],ne);continue e}else return te}else{ee=ne;continue e}}}}function MapTreeModule_mkIterator(ee){return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton$2(ee)),!1)}function MapTreeModule_notStarted(){throw new Error("enumeration not started")}function MapTreeModule_alreadyFinished(){throw new Error("enumeration already finished")}function MapTreeModule_current(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return MapTreeModule_alreadyFinished();if(head(te)!=null){const ne=head(te);if(ne instanceof MapTreeNode$2)throw new Error("Please report error: Map iterator, unexpected stack for current");return[MapTreeLeaf$2__get_Key(ne),MapTreeLeaf$2__get_Value(ne)]}else throw new Error("Please report error: Map iterator, unexpected stack for current")}else return MapTreeModule_notStarted()}function MapTreeModule_moveNext(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return!1;if(head(te)!=null){if(head(te)instanceof MapTreeNode$2)throw new Error("Please report error: Map iterator, unexpected stack for moveNext");return ee.stack=MapTreeModule_collapseLHS(tail(te)),!isEmpty(ee.stack)}else throw new Error("Please report error: Map iterator, unexpected stack for moveNext")}else return ee.started=!0,!isEmpty(ee.stack)}function MapTreeModule_mkIEnumerator(ee){let te=MapTreeModule_mkIterator(ee);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return MapTreeModule_current(te)},"System.Collections.IEnumerator.get_Current"(){return MapTreeModule_current(te)},"System.Collections.IEnumerator.MoveNext"(){return MapTreeModule_moveNext(te)},"System.Collections.IEnumerator.Reset"(){te=MapTreeModule_mkIterator(ee)},Dispose(){}}}class FSharpMap{constructor(te,ne){this.comparer=te,this.tree=ne}GetHashCode(){return FSharpMap__ComputeHashCode(this)|0}Equals(te){const ne=this;if(te instanceof FSharpMap){const re=te,ie=getEnumerator(ne);try{const se=getEnumerator(re);try{const oe=()=>{const he=ie["System.Collections.IEnumerator.MoveNext"]();if(he===se["System.Collections.IEnumerator.MoveNext"]())if(he){const ue=ie["System.Collections.Generic.IEnumerator`1.get_Current"](),de=se["System.Collections.Generic.IEnumerator`1.get_Current"]();return equals$2(ue[0],de[0])&&equals$2(ue[1],de[1])?oe():!1}else return!0;else return!1};return oe()}finally{disposeSafe(se)}}finally{disposeSafe(ie)}}else return!1}toString(){return"map ["+join("; ",map$2(ne=>format("({0}, {1})",ne[0],ne[1]),this))+"]"}get[Symbol.toStringTag](){return"FSharpMap"}toJSON(){const te=this;return Array.from(te)}GetEnumerator(){return MapTreeModule_mkIEnumerator(this.tree)}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return MapTreeModule_mkIEnumerator(this.tree)}CompareTo(te){const ne=this;if(te instanceof FSharpMap)return compareWith((ie,se)=>{const oe=ne.comparer.Compare(ie[0],se[0])|0;return(oe!==0?oe:compare$2(ie[1],se[1]))|0},ne,te)|0;throw new Error("not comparable\\nParameter name: obj")}"System.Collections.Generic.ICollection`1.Add2B595"(te){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Remove2B595"(te){throw new Error("Map cannot be mutated")}"System.Collections.Generic.ICollection`1.Contains2B595"(te){const ne=this;return FSharpMap__ContainsKey(ne,te[0])&&equals$2(FSharpMap__get_Item(ne,te[0]),te[1])}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(te,ne){MapTreeModule_copyToArray(this.tree,te,ne)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return FSharpMap__get_Count(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return FSharpMap__get_Count(this)|0}get size(){return FSharpMap__get_Count(this)|0}clear(){throw new Error("Map cannot be mutated")}delete(te){throw new Error("Map cannot be mutated")}entries(){return map$2(ne=>[ne[0],ne[1]],this)}get(te){return FSharpMap__get_Item(this,te)}has(te){return FSharpMap__ContainsKey(this,te)}keys(){return map$2(ne=>ne[0],this)}set(te,ne){throw new Error("Map cannot be mutated")}values(){return map$2(ne=>ne[1],this)}forEach(te,ne){const re=this;iterate(ie=>{te(ie[1],ie[0],re)},re)}}function FSharpMap_$ctor(ee,te){return new FSharpMap(ee,te)}function FSharpMap_Empty(ee){return FSharpMap_$ctor(ee,void 0)}function FSharpMap__Add(ee,te,ne){return FSharpMap_$ctor(ee.comparer,MapTreeModule_add(ee.comparer,te,ne,ee.tree))}function FSharpMap__get_Item(ee,te){return MapTreeModule_find(ee.comparer,te,ee.tree)}function FSharpMap__Map(ee,te){return FSharpMap_$ctor(ee.comparer,MapTreeModule_mapi(te,ee.tree))}function FSharpMap__get_Count(ee){return MapTreeModule_size(ee.tree)}function FSharpMap__ContainsKey(ee,te){return MapTreeModule_mem(ee.comparer,te,ee.tree)}function FSharpMap__TryFind(ee,te){return MapTreeModule_tryFind(ee.comparer,te,ee.tree)}function FSharpMap__ComputeHashCode(ee){const te=(ie,se)=>(ie<<1)+se+631;let ne=0;const re=getEnumerator(ee);try{for(;re["System.Collections.IEnumerator.MoveNext"]();){const ie=re["System.Collections.Generic.IEnumerator`1.get_Current"]();ne=te(ne,structuralHash(ie[0]))|0,ne=te(ne,structuralHash(ie[1]))|0}}finally{disposeSafe(re)}return ne|0}function add$2(ee,te,ne){return FSharpMap__Add(ne,ee,te)}function tryFind(ee,te){return FSharpMap__TryFind(te,ee)}function map$1(ee,te){return FSharpMap__Map(te,ee)}function ofSeq$1(ee,te){return FSharpMap_$ctor(te,MapTreeModule_ofSeq(te,ee))}function ofArray(ee,te){return FSharpMap_$ctor(te,MapTreeModule_ofSeq(te,ee))}function empty$1(ee){return FSharpMap_Empty(ee)}function Headers_contentType(ee){return new Header(0,["Content-Type",ee])}function Headers_authorization(ee){return new Header(0,["Authorization",ee])}const Http_defaultRequest=new HttpRequest("",new HttpMethod(0,[]),empty$3(),!1,void 0,void 0,void 0,new BodyContent(0,[]));new HttpResponse(0,"","","",empty$1({Compare:comparePrimitives}),new ResponseContent(0,[""]));function Http_splitAt(ee,te){return isNullOrEmpty(te)?[te]:split(te,[ee],void 0,0)}function Http_serializeMethod(ee){switch(ee.tag){case 1:return"POST";case 3:return"PATCH";case 2:return"PUT";case 4:return"DELETE";case 6:return"OPTIONS";case 5:return"HEAD";default:return"GET"}}function Http_request(ee){return new HttpRequest(ee,Http_defaultRequest.method,Http_defaultRequest.headers,Http_defaultRequest.withCredentials,Http_defaultRequest.overridenMimeType,Http_defaultRequest.overridenResponseType,Http_defaultRequest.timeout,Http_defaultRequest.content)}function Http_method(ee,te){return new HttpRequest(te.url,ee,te.headers,te.withCredentials,te.overridenMimeType,te.overridenResponseType,te.timeout,te.content)}function Http_header(ee,te){return new HttpRequest(te.url,te.method,append$1(te.headers,singleton$2(ee)),te.withCredentials,te.overridenMimeType,te.overridenResponseType,te.timeout,te.content)}function Http_content(ee,te){return new HttpRequest(te.url,te.method,te.headers,te.withCredentials,te.overridenMimeType,te.overridenResponseType,te.timeout,ee)}function Http_send(ee){return fromContinuations(te=>{const ne=new XMLHttpRequest;ne.open(Http_serializeMethod(ee.method),ee.url),ne.onreadystatechange=()=>{let ue,de,ae,le,Ae,_e,me;ne.readyState===4&&te[0]((ue=(de=ne.responseType,de===""||de==="text"?ne.responseText:""),ae=ne.status|0,le=ne.responseType,Ae=(_e=ne.responseType,_e===""?new ResponseContent(0,[ne.responseText]):_e==="text"?new ResponseContent(0,[ne.responseText]):_e==="arraybuffer"?new ResponseContent(2,[ne.response]):_e==="blob"?new ResponseContent(1,[ne.response]):new ResponseContent(3,[ne.response])),me=ofArray(choose$1(ve=>{const Se=ofArray$2(Http_splitAt(":",ve));if(!isEmpty(Se))return[head(Se).toLocaleLowerCase(),join(":",tail(Se)).trim()]},Http_splitAt("\r\n",ne.getAllResponseHeaders())),{Compare:comparePrimitives}),new HttpResponse(ae,ue,le,ne.responseURL,me,Ae)))};const re=getEnumerator(ee.headers);try{for(;re["System.Collections.IEnumerator.MoveNext"]();){const ue=re["System.Collections.Generic.IEnumerator`1.get_Current"]();ne.setRequestHeader(ue.fields[0],ue.fields[1])}}finally{disposeSafe(re)}ne.withCredentials=ee.withCredentials;const ie=ee.overridenMimeType;if(ie!=null){const ue=ie;ne.overrideMimeType(ue)}const se=ee.overridenResponseType;se==null||(se.tag===1?ne.responseType="blob":se.tag===2?ne.responseType="arraybuffer":ne.responseType="text");const oe=ee.timeout;if(oe!=null){const ue=oe|0;ne.timeout=ue|0}const he=ee.content;switch(he.tag){case 1:{ne.send(some(he.fields[0]));break}case 3:{ne.send(some(he.fields[0]));break}case 2:{ne.send(some(he.fields[0]));break}default:ne.send()}})}class ErrorReason extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["BadPrimitive","BadPrimitiveExtra","BadType","BadField","BadPath","TooSmallArray","FailMessage","BadOneOf"]}}class CaseStrategy extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["PascalCase","CamelCase","SnakeCase"]}}function Util_Casing_lowerFirst(ee){return ee.slice(void 0,0+1).toLowerCase()+ee.slice(1,ee.length)}function Util_Casing_convert(ee,te){switch(ee.tag){case 2:return replace(Util_Casing_lowerFirst(te),"[A-Z]","_$0").toLowerCase();case 0:return te;default:return Util_Casing_lowerFirst(te)}}function DateTimeOffset(ee,te){checkOffsetInRange(te);const ne=new Date(ee);return ne.offset=te!=null?te:new Date().getTimezoneOffset()*-6e4,ne}function checkOffsetInRange(ee){if(ee!=null&&ee!==0){if(ee%6e4!==0)throw new Error("Offset must be specified in whole minutes.");if(Math.abs(ee/36e5)>14)throw new Error("Offset must be within plus or minus 14 hours.")}}function minValue(){return DateTimeOffset(-621355968e5,0)}function parse$1(ee){const[te,ne]=parseRaw(ee),re=ne==null?te.getTimezoneOffset()*-6e4:ne==="Z"?0:ne*6e4;return DateTimeOffset(te.getTime(),re)}function tryParse$1(ee,te){try{return te.contents=parse$1(ee),!0}catch{return!1}}function signedRound(ee){return ee<0?Math.ceil(ee):Math.floor(ee)}function create(ee=0,te=0,ne=0,re=0,ie=0){switch(arguments.length){case 1:return fromTicks(arguments[0]);case 3:ee=0,te=arguments[0],ne=arguments[1],re=arguments[2],ie=0;break}return ee*864e5+te*36e5+ne*6e4+re*1e3+ie}function fromTicks(ee){return toNumber(op_Division(ee,1e4))}function days(ee){return signedRound(ee/864e5)}function hours(ee){return signedRound(ee%864e5/36e5)}function minutes(ee){return signedRound(ee%36e5/6e4)}function seconds(ee){return signedRound(ee%6e4/1e3)}function milliseconds(ee){return signedRound(ee%1e3)}function toString$1(ee,te="c",ne){if(["c","g","G"].indexOf(te)===-1)throw new Error("Custom formats are not supported");const re=Math.abs(days(ee)),ie=Math.abs(hours(ee)),se=Math.abs(minutes(ee)),oe=Math.abs(seconds(ee)),he=Math.abs(milliseconds(ee)),ue=ee<0?"-":"";return"".concat(ue).concat(re===0&&(te==="c"||te==="g")?"":te==="c"?re+".":re+":").concat(te==="g"?ie:padWithZeros(ie,2),":").concat(padWithZeros(se,2),":").concat(padWithZeros(oe,2)).concat(he===0&&(te==="c"||te==="g")?"":te==="g"?"."+padWithZeros(he,3):"."+padLeftAndRightWithZeros(he,3,7))}function parse(ee){const te=ee.search("\\."),ne=ee.search("\\:");if(te===-1&&ne===-1){const re=parseInt(ee,0);if(isNaN(re))throw new Error("String '".concat(ee,"' was not recognized as a valid TimeSpan."));return create(re,0,0,0,0)}if(ne>0){const re=/^(-?)((\d+)\.)?(?:0*)([0-9]|0[0-9]|1[0-9]|2[0-3]):(?:0*)([0-5][0-9]|[0-9])(:(?:0*)([0-5][0-9]|[0-9]))?\.?(\d+)?$/.exec(ee);if(re!=null&&re[4]!=null&&re[5]!=null){let ie=0,se=0,oe=0;const he=re[1]!=null&&re[1]==="-"?-1:1,ue=+re[4],de=+re[5];if(re[3]!=null&&(ie=+re[3]),re[7]!=null&&(oe=+re[7]),re[8]!=null)switch(re[8].length){case 1:se=+re[8]*100;break;case 2:se=+re[8]*10;break;case 3:se=+re[8];break;case 4:se=+re[8]/10;break;case 5:se=+re[8]/100;break;case 6:se=+re[8]/1e3;break;case 7:se=+re[8]/1e4;break;default:throw new Error("String '".concat(ee,"' was not recognized as a valid TimeSpan."))}return he*create(ie,ue,de,oe,se)}}throw new Error("String '".concat(ee,"' was not recognized as a valid TimeSpan."))}function tryParse(ee,te){try{return te.contents=parse(ee),!0}catch{return!1}}class SetTreeLeaf$1{constructor(te){this.k=te}}function SetTreeLeaf$1_$ctor_2B595(ee){return new SetTreeLeaf$1(ee)}function SetTreeLeaf$1__get_Key(ee){return ee.k}class SetTreeNode$1 extends SetTreeLeaf$1{constructor(te,ne,re,ie){super(te),this.left=ne,this.right=re,this.h=ie|0}}function SetTreeNode$1_$ctor_5F465FC9(ee,te,ne,re){return new SetTreeNode$1(ee,te,ne,re)}function SetTreeNode$1__get_Left(ee){return ee.left}function SetTreeNode$1__get_Right(ee){return ee.right}function SetTreeNode$1__get_Height(ee){return ee.h}function SetTreeModule_empty(){}function SetTreeModule_countAux(ee,te){e:for(;;){const ne=ee,re=te;if(ne!=null){const ie=ne;if(ie instanceof SetTreeNode$1){const se=ie;ee=SetTreeNode$1__get_Left(se),te=SetTreeModule_countAux(SetTreeNode$1__get_Right(se),re+1);continue e}else return re+1|0}else return re|0}}function SetTreeModule_count(ee){return SetTreeModule_countAux(ee,0)}function SetTreeModule_mk(ee,te,ne){let re,ie,se;const oe=ee;if(oe!=null){const ae=oe;se=ae instanceof SetTreeNode$1?(re=ae,SetTreeNode$1__get_Height(re)):1}else se=0;let he;const ue=ne;if(ue!=null){const ae=ue;he=ae instanceof SetTreeNode$1?(ie=ae,SetTreeNode$1__get_Height(ie)):1}else he=0;const de=(se<he?he:se)|0;return de===0?SetTreeLeaf$1_$ctor_2B595(te):SetTreeNode$1_$ctor_5F465FC9(te,ee,ne,de+1)}function SetTreeModule_rebalance(ee,te,ne){let re,ie,se,oe,he,ue,de,ae,le;const Ae=ee;if(Ae!=null){const ve=Ae;le=ve instanceof SetTreeNode$1?(re=ve,SetTreeNode$1__get_Height(re)):1}else le=0;let _e;const me=ne;if(me!=null){const ve=me;_e=ve instanceof SetTreeNode$1?(ie=ve,SetTreeNode$1__get_Height(ie)):1}else _e=0;if(_e>le+2){const ve=value(ne);if(ve instanceof SetTreeNode$1){const Se=ve;if(se=SetTreeNode$1__get_Left(Se),(se!=null?(oe=se,oe instanceof SetTreeNode$1?(he=oe,SetTreeNode$1__get_Height(he)):1):0)>le+1){const Te=value(SetTreeNode$1__get_Left(Se));if(Te instanceof SetTreeNode$1){const Pe=Te;return SetTreeModule_mk(SetTreeModule_mk(ee,te,SetTreeNode$1__get_Left(Pe)),SetTreeLeaf$1__get_Key(Pe),SetTreeModule_mk(SetTreeNode$1__get_Right(Pe),SetTreeLeaf$1__get_Key(Se),SetTreeNode$1__get_Right(Se)))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(SetTreeModule_mk(ee,te,SetTreeNode$1__get_Left(Se)),SetTreeLeaf$1__get_Key(Se),SetTreeNode$1__get_Right(Se))}else throw new Error("internal error: Set.rebalance")}else if(le>_e+2){const ve=value(ee);if(ve instanceof SetTreeNode$1){const Se=ve;if(ue=SetTreeNode$1__get_Right(Se),(ue!=null?(de=ue,de instanceof SetTreeNode$1?(ae=de,SetTreeNode$1__get_Height(ae)):1):0)>_e+1){const Te=value(SetTreeNode$1__get_Right(Se));if(Te instanceof SetTreeNode$1){const Pe=Te;return SetTreeModule_mk(SetTreeModule_mk(SetTreeNode$1__get_Left(Se),SetTreeLeaf$1__get_Key(Se),SetTreeNode$1__get_Left(Pe)),SetTreeLeaf$1__get_Key(Pe),SetTreeModule_mk(SetTreeNode$1__get_Right(Pe),te,ne))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(SetTreeNode$1__get_Left(Se),SetTreeLeaf$1__get_Key(Se),SetTreeModule_mk(SetTreeNode$1__get_Right(Se),te,ne))}else throw new Error("internal error: Set.rebalance")}else return SetTreeModule_mk(ee,te,ne)}function SetTreeModule_add(ee,te,ne){if(ne!=null){const re=ne,ie=ee.Compare(te,SetTreeLeaf$1__get_Key(re))|0;if(re instanceof SetTreeNode$1){const se=re;return ie<0?SetTreeModule_rebalance(SetTreeModule_add(ee,te,SetTreeNode$1__get_Left(se)),SetTreeLeaf$1__get_Key(se),SetTreeNode$1__get_Right(se)):ie===0?ne:SetTreeModule_rebalance(SetTreeNode$1__get_Left(se),SetTreeLeaf$1__get_Key(se),SetTreeModule_add(ee,te,SetTreeNode$1__get_Right(se)))}else{const se=ee.Compare(te,SetTreeLeaf$1__get_Key(re))|0;return se<0?SetTreeNode$1_$ctor_5F465FC9(te,void 0,ne,2):se===0?ne:SetTreeNode$1_$ctor_5F465FC9(te,ne,void 0,2)}}else return SetTreeLeaf$1_$ctor_2B595(te)}function SetTreeModule_mem(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se!=null){const oe=se,he=re.Compare(ie,SetTreeLeaf$1__get_Key(oe))|0;if(oe instanceof SetTreeNode$1){const ue=oe;if(he<0){ee=re,te=ie,ne=SetTreeNode$1__get_Left(ue);continue e}else{if(he===0)return!0;ee=re,te=ie,ne=SetTreeNode$1__get_Right(ue);continue e}}else return he===0}else return!1}}function SetTreeModule_iter(ee,te){e:for(;;){const ne=ee,re=te;if(re!=null){const ie=re;if(ie instanceof SetTreeNode$1){const se=ie;SetTreeModule_iter(ne,SetTreeNode$1__get_Left(se)),ne(SetTreeLeaf$1__get_Key(se)),ee=ne,te=SetTreeNode$1__get_Right(se);continue e}else ne(SetTreeLeaf$1__get_Key(ie))}break}}class SetTreeModule_SetIterator$1 extends Record{constructor(te,ne){super(),this.stack=te,this.started=ne}}function SetTreeModule_collapseLHS(ee){e:for(;;){const te=ee;if(isEmpty(te))return empty$3();{const ne=head(te),re=tail(te);if(ne!=null){const ie=ne;if(ie instanceof SetTreeNode$1){const se=ie;ee=ofArrayWithTail([SetTreeNode$1__get_Left(se),SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(se)),SetTreeNode$1__get_Right(se)],re);continue e}else return te}else{ee=re;continue e}}}}function SetTreeModule_mkIterator(ee){return new SetTreeModule_SetIterator$1(SetTreeModule_collapseLHS(singleton$2(ee)),!1)}function SetTreeModule_notStarted(){throw new Error("Enumeration not started")}function SetTreeModule_alreadyFinished(){throw new Error("Enumeration already started")}function SetTreeModule_current(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return SetTreeModule_alreadyFinished();if(head(te)!=null){const ne=head(te);return SetTreeLeaf$1__get_Key(ne)}else throw new Error("Please report error: Set iterator, unexpected stack for current")}else return SetTreeModule_notStarted()}function SetTreeModule_moveNext(ee){if(ee.started){const te=ee.stack;if(isEmpty(te))return!1;if(head(te)!=null){if(head(te)instanceof SetTreeNode$1)throw new Error("Please report error: Set iterator, unexpected stack for moveNext");return ee.stack=SetTreeModule_collapseLHS(tail(te)),!isEmpty(ee.stack)}else throw new Error("Please report error: Set iterator, unexpected stack for moveNext")}else return ee.started=!0,!isEmpty(ee.stack)}function SetTreeModule_mkIEnumerator(ee){let te=SetTreeModule_mkIterator(ee);return{"System.Collections.Generic.IEnumerator`1.get_Current"(){return SetTreeModule_current(te)},"System.Collections.IEnumerator.get_Current"(){return SetTreeModule_current(te)},"System.Collections.IEnumerator.MoveNext"(){return SetTreeModule_moveNext(te)},"System.Collections.IEnumerator.Reset"(){te=SetTreeModule_mkIterator(ee)},Dispose(){}}}function SetTreeModule_compareStacks(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(isEmpty(ie))return isEmpty(se)?0:-1;if(isEmpty(se))return 1;if(head(se)!=null)if(head(ie)!=null){const oe=head(ie),he=head(se);if(oe instanceof SetTreeNode$1){const ue=oe;if(SetTreeNode$1__get_Left(ue)==null)if(he instanceof SetTreeNode$1){const de=he;if(SetTreeNode$1__get_Left(de)==null){const ae=re.Compare(SetTreeLeaf$1__get_Key(ue),SetTreeLeaf$1__get_Key(de))|0;if(ae!==0)return ae|0;ee=re,te=cons(SetTreeNode$1__get_Right(ue),tail(ie)),ne=cons(SetTreeNode$1__get_Right(de),tail(se));continue e}else{let ae,le,Ae,_e,me;switch(isEmpty(ie)?isEmpty(se)?ae=2:head(se)!=null?(ae=1,_e=tail(se),me=head(se)):ae=2:head(ie)!=null?(ae=0,le=tail(ie),Ae=head(ie)):isEmpty(se)?ae=2:head(se)!=null?(ae=1,_e=tail(se),me=head(se)):ae=2,ae){case 0:if(Ae instanceof SetTreeNode$1){const ve=Ae;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(ve),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ve),void 0,SetTreeNode$1__get_Right(ve),0)],le),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(Ae))],le),ne=se;continue e}case 1:if(me instanceof SetTreeNode$1){const ve=me;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(ve),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(ve),void 0,SetTreeNode$1__get_Right(ve),0)],_e);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(me))],_e);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const de=re.Compare(SetTreeLeaf$1__get_Key(ue),SetTreeLeaf$1__get_Key(he))|0;if(de!==0)return de|0;ee=re,te=cons(SetTreeNode$1__get_Right(ue),tail(ie)),ne=cons(void 0,tail(se));continue e}else{let de,ae,le,Ae,_e;switch(isEmpty(ie)?isEmpty(se)?de=2:head(se)!=null?(de=1,Ae=tail(se),_e=head(se)):de=2:head(ie)!=null?(de=0,ae=tail(ie),le=head(ie)):isEmpty(se)?de=2:head(se)!=null?(de=1,Ae=tail(se),_e=head(se)):de=2,de){case 0:if(le instanceof SetTreeNode$1){const me=le;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(me),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(me),void 0,SetTreeNode$1__get_Right(me),0)],ae),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(le))],ae),ne=se;continue e}case 1:if(_e instanceof SetTreeNode$1){const me=_e;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(me),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(me),void 0,SetTreeNode$1__get_Right(me),0)],Ae);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(_e))],Ae);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else if(he instanceof SetTreeNode$1){const ue=he;if(SetTreeNode$1__get_Left(ue)==null){const de=re.Compare(SetTreeLeaf$1__get_Key(oe),SetTreeLeaf$1__get_Key(ue))|0;if(de!==0)return de|0;ee=re,te=cons(void 0,tail(ie)),ne=cons(SetTreeNode$1__get_Right(ue),tail(se));continue e}else{let de,ae,le,Ae,_e;switch(isEmpty(ie)?isEmpty(se)?de=2:head(se)!=null?(de=1,Ae=tail(se),_e=head(se)):de=2:head(ie)!=null?(de=0,ae=tail(ie),le=head(ie)):isEmpty(se)?de=2:head(se)!=null?(de=1,Ae=tail(se),_e=head(se)):de=2,de){case 0:if(le instanceof SetTreeNode$1){const me=le;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(me),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(me),void 0,SetTreeNode$1__get_Right(me),0)],ae),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(le))],ae),ne=se;continue e}case 1:if(_e instanceof SetTreeNode$1){const me=_e;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(me),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(me),void 0,SetTreeNode$1__get_Right(me),0)],Ae);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(_e))],Ae);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}}else{const ue=re.Compare(SetTreeLeaf$1__get_Key(oe),SetTreeLeaf$1__get_Key(he))|0;if(ue!==0)return ue|0;ee=re,te=tail(ie),ne=tail(se);continue e}}else{head(se);let oe,he,ue,de,ae;switch(isEmpty(ie)?isEmpty(se)?oe=2:head(se)!=null?(oe=1,de=tail(se),ae=head(se)):oe=2:head(ie)!=null?(oe=0,he=tail(ie),ue=head(ie)):isEmpty(se)?oe=2:head(se)!=null?(oe=1,de=tail(se),ae=head(se)):oe=2,oe){case 0:if(ue instanceof SetTreeNode$1){const le=ue;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],he),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ue))],he),ne=se;continue e}case 1:if(ae instanceof SetTreeNode$1){const le=ae;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],de);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ae))],de);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else if(head(ie)!=null){head(ie);let oe,he,ue,de,ae;switch(isEmpty(ie)?isEmpty(se)?oe=2:head(se)!=null?(oe=1,de=tail(se),ae=head(se)):oe=2:head(ie)!=null?(oe=0,he=tail(ie),ue=head(ie)):isEmpty(se)?oe=2:head(se)!=null?(oe=1,de=tail(se),ae=head(se)):oe=2,oe){case 0:if(ue instanceof SetTreeNode$1){const le=ue;ee=re,te=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],he),ne=se;continue e}else{ee=re,te=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ue))],he),ne=se;continue e}case 1:if(ae instanceof SetTreeNode$1){const le=ae;ee=re,te=ie,ne=ofArrayWithTail([SetTreeNode$1__get_Left(le),SetTreeNode$1_$ctor_5F465FC9(SetTreeLeaf$1__get_Key(le),void 0,SetTreeNode$1__get_Right(le),0)],de);continue e}else{ee=re,te=ie,ne=ofArrayWithTail([void 0,SetTreeLeaf$1_$ctor_2B595(SetTreeLeaf$1__get_Key(ae))],de);continue e}case 2:throw new Error("unexpected state in SetTree.compareStacks")}}else{ee=re,te=tail(ie),ne=tail(se);continue e}break}}function SetTreeModule_compare(ee,te,ne){return te==null?ne==null?0:-1:ne==null?1:SetTreeModule_compareStacks(ee,singleton$2(te),singleton$2(ne))|0}function SetTreeModule_copyToArray(ee,te,ne){let re=ne;SetTreeModule_iter(ie=>{te[re]=ie,re=re+1|0},ee)}function SetTreeModule_mkFromEnumerator(ee,te,ne){e:for(;;){const re=ee,ie=te,se=ne;if(se["System.Collections.IEnumerator.MoveNext"]()){ee=re,te=SetTreeModule_add(re,se["System.Collections.Generic.IEnumerator`1.get_Current"](),ie),ne=se;continue e}else return ie}}function SetTreeModule_ofArray(ee,te){return fold$2((ne,re)=>SetTreeModule_add(ee,re,ne),void 0,te)}function SetTreeModule_ofList(ee,te){return fold$1((ne,re)=>SetTreeModule_add(ee,re,ne),void 0,te)}function SetTreeModule_ofSeq(ee,te){if(isArrayLike(te))return SetTreeModule_ofArray(ee,te);if(te instanceof FSharpList)return SetTreeModule_ofList(ee,te);{const ne=getEnumerator(te);try{return SetTreeModule_mkFromEnumerator(ee,void 0,ne)}finally{disposeSafe(ne)}}}class FSharpSet{constructor(te,ne){this.comparer=te,this.tree=ne}GetHashCode(){return FSharpSet__ComputeHashCode(this)|0}Equals(te){let ne;const re=this;return te instanceof FSharpSet&&(ne=te,SetTreeModule_compare(FSharpSet__get_Comparer(re),FSharpSet__get_Tree(re),FSharpSet__get_Tree(ne))===0)}toString(){return"set ["+join("; ",map$2(ne=>toString$4(ne),this))+"]"}get[Symbol.toStringTag](){return"FSharpSet"}toJSON(){const te=this;return Array.from(te)}CompareTo(te){const ne=this;return SetTreeModule_compare(FSharpSet__get_Comparer(ne),FSharpSet__get_Tree(ne),FSharpSet__get_Tree(te))|0}"System.Collections.Generic.ICollection`1.Add2B595"(te){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Clear"(){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Remove2B595"(te){throw new Error("ReadOnlyCollection")}"System.Collections.Generic.ICollection`1.Contains2B595"(te){const ne=this;return SetTreeModule_mem(FSharpSet__get_Comparer(ne),te,FSharpSet__get_Tree(ne))}"System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(te,ne){SetTreeModule_copyToArray(FSharpSet__get_Tree(this),te,ne)}"System.Collections.Generic.ICollection`1.get_IsReadOnly"(){return!0}"System.Collections.Generic.ICollection`1.get_Count"(){return FSharpSet__get_Count(this)|0}"System.Collections.Generic.IReadOnlyCollection`1.get_Count"(){return FSharpSet__get_Count(this)|0}GetEnumerator(){return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(this))}[Symbol.iterator](){return toIterator(getEnumerator(this))}"System.Collections.IEnumerable.GetEnumerator"(){return SetTreeModule_mkIEnumerator(FSharpSet__get_Tree(this))}get size(){return FSharpSet__get_Count(this)|0}add(te){throw new Error("Set cannot be mutated")}clear(){throw new Error("Set cannot be mutated")}delete(te){throw new Error("Set cannot be mutated")}has(te){return FSharpSet__Contains(this,te)}keys(){return map$2(ne=>ne,this)}values(){return map$2(ne=>ne,this)}entries(){return map$2(ne=>[ne,ne],this)}forEach(te,ne){const re=this;iterate(ie=>{te(ie,ie,re)},re)}}function FSharpSet_$ctor(ee,te){return new FSharpSet(ee,te)}function FSharpSet__get_Comparer(ee){return ee.comparer}function FSharpSet__get_Tree(ee){return ee.tree}function FSharpSet_Empty(ee){return FSharpSet_$ctor(ee,void 0)}function FSharpSet__Add(ee,te){return FSharpSet_$ctor(FSharpSet__get_Comparer(ee),SetTreeModule_add(FSharpSet__get_Comparer(ee),te,FSharpSet__get_Tree(ee)))}function FSharpSet__get_Count(ee){return SetTreeModule_count(FSharpSet__get_Tree(ee))}function FSharpSet__Contains(ee,te){return SetTreeModule_mem(FSharpSet__get_Comparer(ee),te,FSharpSet__get_Tree(ee))}function FSharpSet__ComputeHashCode(ee){let te=0;const ne=getEnumerator(ee);try{for(;ne["System.Collections.IEnumerator.MoveNext"]();){const re=ne["System.Collections.Generic.IEnumerator`1.get_Current"]();te=(te<<1)+structuralHash(re)+631|0}}finally{disposeSafe(ne)}return Math.abs(te)|0}function contains(ee,te){return FSharpSet__Contains(te,ee)}function add$1(ee,te){return FSharpSet__Add(te,ee)}function empty(ee){return FSharpSet_Empty(ee)}function ofList(ee,te){return FSharpSet_$ctor(te,SetTreeModule_ofSeq(te,ee))}function ofSeq(ee,te){return FSharpSet_$ctor(te,SetTreeModule_ofSeq(te,ee))}function genericMsg(ee,te,ne){try{return"Expecting "+ee+" but instead got:"+(ne?"\n":" ")+(JSON.stringify(te,null,4)+"")}catch{return"Expecting "+ee+" but decoder failed. Couldn't report given value due to circular structure."+(ne?"\n":" ")}}function errorToString(ee,te){const ne=te.tag===2?genericMsg(te.fields[0],te.fields[1],!0):te.tag===1?genericMsg(te.fields[0],te.fields[1],!1)+"\nReason: "+te.fields[2]:te.tag===3?genericMsg(te.fields[0],te.fields[1],!0):te.tag===4?genericMsg(te.fields[0],te.fields[1],!0)+("\nNode `"+te.fields[2]+"` is unkown."):te.tag===5?"Expecting "+te.fields[0]+".\n"+(JSON.stringify(te.fields[1],null,4)+""):te.tag===7?"The following errors were found:\n\n"+join("\n\n",te.fields[0]):te.tag===6?"The following `failure` occurred with the decoder: "+te.fields[0]:genericMsg(te.fields[0],te.fields[1],!1);return te.tag===7?ne:"Error at: `"+ee+"`\n"+ne}function fromValue(ee,te,ne){const re=te(ee,ne);if(re.tag===1){const ie=re.fields[0];return new FSharpResult$2(1,[errorToString(ie[0],ie[1])])}else return new FSharpResult$2(0,[re.fields[0]])}function fromString(ee,te){try{return fromValue("$",ee,JSON.parse(te))}catch(ne){if(ne instanceof SyntaxError)return new FSharpResult$2(1,["Given an invalid JSON: "+ne.message]);throw ne}}function string(ee,te){return typeof te=="string"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a string",te])]])}function char(ee,te){if(typeof te=="string"){const ne=te;return ne.length===1?new FSharpResult$2(0,[ne[0]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a single character string",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a char",te])]])}function guid$1(ee,te){if(typeof te=="string"){let ne,re="00000000-0000-0000-0000-000000000000";return ne=[tryParse$2(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a guid",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a guid",te])]])}function unit$1(ee,te){return te==null?new FSharpResult$2(0,[void 0]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["null",te])]])}const sbyte=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?-128<=ie&&ie<=127?new FSharpResult$2(0,[(ie+128&255)-128]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a sbyte",ie,"Value was either too large or too small for a sbyte"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a sbyte",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!1,8,new FSharpRef(()=>se,oe=>{se=oe|0})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["a sbyte",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["a sbyte",re])]])},byte=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?0<=ie&&ie<=255?new FSharpResult$2(0,[ie&255]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a byte",ie,"Value was either too large or too small for a byte"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["a byte",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!0,8,new FSharpRef(()=>se,oe=>{se=oe})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["a byte",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["a byte",re])]])},int16=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?-32768<=ie&&ie<=32767?new FSharpResult$2(0,[(ie+32768&65535)-32768]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int16",ie,"Value was either too large or too small for an int16"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int16",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!1,16,new FSharpRef(()=>se,oe=>{se=oe|0})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int16",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int16",re])]])},uint16=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?0<=ie&&ie<=65535?new FSharpResult$2(0,[ie&65535]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint16",ie,"Value was either too large or too small for an uint16"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint16",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!0,16,new FSharpRef(()=>se,oe=>{se=oe})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint16",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint16",re])]])},int=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?-2147483648<=ie&&ie<=2147483647?new FSharpResult$2(0,[~~ie]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int",ie,"Value was either too large or too small for an int"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an int",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!1,32,new FSharpRef(()=>se,oe=>{se=oe|0})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an int",re])]])},uint32=ee=>te=>{const ne=ee,re=te;if(typeof re=="number"){const ie=re;return isFinite(ie)&&Math.floor(ie)===ie?0<=ie&&ie<=4294967295?new FSharpResult$2(0,[ie>>>0]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint32",ie,"Value was either too large or too small for an uint32"])]]):new FSharpResult$2(1,[[ne,new ErrorReason(1,["an uint32",ie,"Value is not an integral value"])]])}else if(typeof re=="string"){let ie,se=0;return ie=[tryParse$4(re,511,!0,32,new FSharpRef(()=>se,oe=>{se=oe})),se],ie[0]?new FSharpResult$2(0,[ie[1]]):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint32",re])]])}else return new FSharpResult$2(1,[[ne,new ErrorReason(0,["an uint32",re])]])};function bool(ee,te){return typeof te=="boolean"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a boolean",te])]])}function float(ee,te){return typeof te=="number"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a float",te])]])}function float32(ee,te){return typeof te=="number"?new FSharpResult$2(0,[te]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a float32",te])]])}function datetimeUtc(ee,te){if(typeof te=="string"){let ne,re=minValue$1();return ne=[tryParse$3(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[toUniversalTime(ne[1])]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetime",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetime",te])]])}function datetimeOffset$1(ee,te){if(typeof te=="string"){let ne,re=minValue();return ne=[tryParse$1(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetimeoffset",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a datetime",te])]])}function timespan$1(ee,te){if(typeof te=="string"){let ne,re=0;return ne=[tryParse(te,new FSharpRef(()=>re,ie=>{re=ie})),re],ne[0]?new FSharpResult$2(0,[ne[1]]):new FSharpResult$2(1,[[ee,new ErrorReason(0,["a timespan",te])]])}else return new FSharpResult$2(1,[[ee,new ErrorReason(0,["a timespan",te])]])}function index$2(ee,te,ne,re){let ie;const se=ne+".["+int32ToString(ee)+"]";if(Array.isArray(re)){const oe=re;return ee<oe.length?te(se,oe[ee]):new FSharpResult$2(1,[[se,new ErrorReason(5,["a longer array. Need index `"+int32ToString(ee)+"` but there are only `"+(ie=oe.length,int32ToString(ie))+"` entries",re])]])}else return new FSharpResult$2(1,[[se,new ErrorReason(0,["an array",re])]])}function option$1(ee,te,ne){return ne==null?new FSharpResult$2(0,[void 0]):Result_Map(some,ee(te,ne))}function list(ee,te,ne){if(Array.isArray(ne)){let re=-1;return Result_Map(reverse$1,fold$2((ie,se)=>{if(re=re+1|0,ie.tag===0){const oe=ee(te+".["+int32ToString(re)+"]",se);return oe.tag===0?new FSharpResult$2(0,[cons(oe.fields[0],ie.fields[0])]):new FSharpResult$2(1,[oe.fields[0]])}else return ie},new FSharpResult$2(0,[empty$3()]),ne))}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a list",ne])]])}function seq$1(ee,te,ne){if(Array.isArray(ne)){let re=-1;return Result_Map(reverse,fold$2((ie,se)=>{if(re=re+1|0,ie.tag===0){const oe=ee(te+".["+int32ToString(re)+"]",se);return oe.tag===0?new FSharpResult$2(0,[append([oe.fields[0]],ie.fields[0])]):new FSharpResult$2(1,[oe.fields[0]])}else return ie},new FSharpResult$2(0,[[]]),ne))}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["a seq",ne])]])}function array(ee,te,ne){if(Array.isArray(ne)){let re=-1;const ie=ne;return fold$2((se,oe)=>{if(re=re+1|0,se.tag===0){const he=se.fields[0],ue=ee(te+".["+int32ToString(re)+"]",oe);return ue.tag===0?(he[re]=ue.fields[0],new FSharpResult$2(0,[he])):new FSharpResult$2(1,[ue.fields[0]])}else return se},new FSharpResult$2(0,[fill(new Array(ie.length),0,ie.length,null)]),ie)}else return new FSharpResult$2(1,[[te,new ErrorReason(0,["an array",ne])]])}function oneOf(ee,te,ne){return((ie,se)=>{e:for(;;){const oe=ie,he=se;if(isEmpty(oe))return new FSharpResult$2(1,[[te,new ErrorReason(7,[he])]]);{const ue=fromValue(te,uncurry2(head(oe)),ne);if(ue.tag===1){ie=tail(oe),se=append$1(he,singleton$2(ue.fields[0]));continue e}else return new FSharpResult$2(0,[ue.fields[0]])}}})(ee,empty$3())}function succeed(ee,te,ne){return new FSharpResult$2(0,[ee])}function andThen(ee,te,ne,re){const ie=te(ne,re);return ie.tag===0?ee(ie.fields[0],ne,re):new FSharpResult$2(1,[ie.fields[0]])}function map(ee,te,ne,re){const ie=te(ne,re);return ie.tag===1?new FSharpResult$2(1,[ie.fields[0]]):new FSharpResult$2(0,[ee(ie.fields[0])])}function tuple2(ee,te){let ne;const re=ee;return ne=ie=>se=>index$2(0,re,ie,se),ie=>se=>andThen(uncurry3(oe=>{let he;const ue=te;return he=de=>ae=>index$2(1,ue,de,ae),de=>ae=>andThen((le,Ae,_e)=>succeed([oe,le]),uncurry2(he),de,ae)}),uncurry2(ne),ie,se)}function toMap(ee){return ofSeq$1(ee,{Compare:compare$2})}function toSet(ee){return ofSeq(ee,{Compare:compare$2})}function autoObject(ee,te,ne){return ne!==null&&Object.getPrototypeOf(ne||!1)===Object.prototype?foldBack$1((re,ie)=>{const se=re[0];return ie.tag===0?Result_Map(oe=>cons(oe,ie.fields[0]),re[1](te+"."+se)(ne[se])):ie},ee,new FSharpResult$2(0,[empty$3()])):new FSharpResult$2(1,[[te,new ErrorReason(0,["an object",ne])]])}function autoObject2(ee,te,ne,re){return re!==null&&Object.getPrototypeOf(re||!1)===Object.prototype?fold((ie,se)=>{if(ie.tag===0){const oe=ee(ne,se);if(oe.tag===0){const he=te(ne+"."+se,re[se]);return he.tag===0?new FSharpResult$2(0,[cons([oe.fields[0],he.fields[0]],ie.fields[0])]):new FSharpResult$2(1,[he.fields[0]])}else return new FSharpResult$2(1,[oe.fields[0]])}else return ie},new FSharpResult$2(0,[empty$3()]),Object.keys(re)):new FSharpResult$2(1,[[ne,new ErrorReason(0,["an object",re])]])}function mixedArray(ee,te,ne,re){let ie;const se=te.length+ee|0;if(se!==re.length)return new FSharpResult$2(1,[[ne,new ErrorReason(6,[(ie=re.length|0,toText(printf("Expected array of length %i but got %i"))(se)(ie))])]]);{let oe=new FSharpResult$2(0,[empty$3()]);for(let he=ee;he<=re.length-1;he++)if(oe.tag===0){const ue=oe.fields[0],de=toText(printf("%s[%i]"))(ne)(he),ae=te[he-ee],le=re[he];oe=Result_Map(Ae=>cons(Ae,ue),ae(de)(le))}return Result_Map(reverse$1,oe)}}function makeUnion(ee,te,ne,re,ie,se){const oe=tryFind$1(he=>name(he)===re,getUnionCases(ne));if(oe!=null){const he=oe,ue=map$4(de=>autoDecoder(ee,te,!1,de[1]),getUnionCaseFields(he));return Result_Map(de=>makeUnion$1(he,toArray$1(de)),ue.length===0&&se.length<=1?new FSharpResult$2(0,[empty$3()]):mixedArray(1,ue,ie,se))}else return new FSharpResult$2(1,[[ie,new ErrorReason(6,["Cannot find case "+re+" in "+fullName(ne)])]])}function autoDecodeRecordsAndUnions(ee,te,ne,re){let ie;const se=new FSharpRef(defaultOf());let oe;const he=fullName(re);oe=he===""?ee:add$2(he,se,ee);let ue;if(isRecord(re)){const de=map$4(ae=>[Util_Casing_convert(te,name(ae)),autoDecoder(oe,te,!1,ae[1])],getRecordElements(re));ue=ae=>le=>Result_Map(Ae=>makeRecord(re,toArray$1(Ae)),autoObject(de,ae,le))}else if(isUnion(re))ue=de=>ae=>{if(typeof ae=="string")return makeUnion(oe,te,re,ae,de,[]);if(Array.isArray(ae)){const le=ae;return Result_Bind(Ae=>makeUnion(oe,te,re,Ae,de,le),string(de+"[0]",le[0]))}else return new FSharpResult$2(1,[[de,new ErrorReason(0,["a string or array",ae])]])};else if(ne)ue=de=>ae=>new FSharpResult$2(1,[[de,new ErrorReason(2,["an extra coder for "+fullName(re),ae])]]);else throw new Error((ie=fullName(re),toText(printf("Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(ie)));return se.contents=ue,ue}function autoDecoder(ee,te,ne,re){let ie,se,oe,he;const ue=fullName(re),de=tryFind(ue,ee);if(de==null)if(isArray(re)){const ae=autoDecoder(ee,te,!1,getElementType(re));return le=>Ae=>array(uncurry2(ae),le,Ae)}else if(isEnum(re)){const ae=fullName(getEnumUnderlyingType(re));if(ae==="System.SByte")return le=>Ae=>{const _e=re,me=le,ve=Ae,Se=sbyte(me)(ve);if(Se.tag===1)return new FSharpResult$2(1,[Se.fields[0]]);{const Te=Se.fields[0]|0;return contains$1(Te,getEnumValues(_e),{Equals:(Pe,Re)=>Pe===Re,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(_e,Te.toString())]):new FSharpResult$2(1,[[me,new ErrorReason(1,[fullName(_e),ve,"Unkown value provided for the enum"])]])}};if(ae==="System.Byte")return le=>Ae=>{const _e=re,me=le,ve=Ae,Se=byte(me)(ve);if(Se.tag===1)return new FSharpResult$2(1,[Se.fields[0]]);{const Te=Se.fields[0];return contains$1(Te,getEnumValues(_e),{Equals:(Pe,Re)=>Pe===Re,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(_e,Te.toString())]):new FSharpResult$2(1,[[me,new ErrorReason(1,[fullName(_e),ve,"Unkown value provided for the enum"])]])}};if(ae==="System.Int16")return le=>Ae=>{const _e=re,me=le,ve=Ae,Se=int16(me)(ve);if(Se.tag===1)return new FSharpResult$2(1,[Se.fields[0]]);{const Te=Se.fields[0]|0;return contains$1(Te,getEnumValues(_e),{Equals:(Pe,Re)=>Pe===Re,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(_e,int16ToString(Te))]):new FSharpResult$2(1,[[me,new ErrorReason(1,[fullName(_e),ve,"Unkown value provided for the enum"])]])}};if(ae==="System.UInt16")return le=>Ae=>{const _e=re,me=le,ve=Ae,Se=uint16(me)(ve);if(Se.tag===1)return new FSharpResult$2(1,[Se.fields[0]]);{const Te=Se.fields[0];return contains$1(Te,getEnumValues(_e),{Equals:(Pe,Re)=>Pe===Re,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(_e,Te.toString())]):new FSharpResult$2(1,[[me,new ErrorReason(1,[fullName(_e),ve,"Unkown value provided for the enum"])]])}};if(ae==="System.Int32")return le=>Ae=>{const _e=re,me=le,ve=Ae,Se=int(me)(ve);if(Se.tag===1)return new FSharpResult$2(1,[Se.fields[0]]);{const Te=Se.fields[0]|0;return contains$1(Te,getEnumValues(_e),{Equals:(Pe,Re)=>Pe===Re,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(_e,int32ToString(Te))]):new FSharpResult$2(1,[[me,new ErrorReason(1,[fullName(_e),ve,"Unkown value provided for the enum"])]])}};if(ae==="System.UInt32")return le=>Ae=>{const _e=re,me=le,ve=Ae,Se=uint32(me)(ve);if(Se.tag===1)return new FSharpResult$2(1,[Se.fields[0]]);{const Te=Se.fields[0];return contains$1(Te,getEnumValues(_e),{Equals:(Pe,Re)=>Pe===Re,GetHashCode:numberHash})?new FSharpResult$2(0,[parseEnum(_e,Te.toString())]):new FSharpResult$2(1,[[me,new ErrorReason(1,[fullName(_e),ve,"Unkown value provided for the enum"])]])}};{const le=fullName(re),Ae=toFail(printf("Cannot generate auto decoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\nIf you can't use one of these types, please pass an extra decoder.\n "))(le);return _e=>Ae(_e)}}else if(isGenericType(re))if(isTuple(re)){const ae=map$4(le=>autoDecoder(ee,te,!1,le),getTupleElements(re));return le=>Ae=>Array.isArray(Ae)?Result_Map(_e=>makeTuple(toArray$1(_e)),mixedArray(0,ae,le,Ae)):new FSharpResult$2(1,[[le,new ErrorReason(0,["an array",Ae])]])}else{const ae=fullName(getGenericTypeDefinition(re));if(ae==="Microsoft.FSharp.Core.FSharpOption`1[System.Object]")return ie=autoDecoder(ee,te,!0,getGenerics(re)[0]),le=>Ae=>option$1(uncurry2(ie),le,Ae);if(ae==="Microsoft.FSharp.Collections.FSharpList`1[System.Object]")return se=autoDecoder(ee,te,!1,getGenerics(re)[0]),le=>Ae=>list(uncurry2(se),le,Ae);if(ae==="System.Collections.Generic.IEnumerable`1[System.Object]")return oe=autoDecoder(ee,te,!1,getGenerics(re)[0]),le=>Ae=>seq$1(uncurry2(oe),le,Ae);if(ae==="Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"){const le=autoDecoder(ee,te,!1,getGenerics(re)[0]),Ae=autoDecoder(ee,te,!1,getGenerics(re)[1]);let _e;const me=ofArray$2([ve=>Se=>autoObject2(uncurry2(le),uncurry2(Ae),ve,Se),(he=tuple2(uncurry2(le),uncurry2(Ae)),ve=>Se=>list(uncurry2(he),ve,Se))]);return _e=ve=>Se=>oneOf(me,ve,Se),ve=>Se=>map(toMap,uncurry2(_e),ve,Se)}else if(ae==="Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"){const le=autoDecoder(ee,te,!1,getGenerics(re)[0]);return Ae=>_e=>{const me=array(uncurry2(le),Ae,_e);return me.tag===0?new FSharpResult$2(0,[toSet(me.fields[0])]):new FSharpResult$2(1,[me.fields[0]])}}else return autoDecodeRecordsAndUnions(ee,te,ne,re)}else return ue==="System.Boolean"?ae=>le=>bool(ae,le):ue==="Microsoft.FSharp.Core.Unit"?ae=>le=>unit$1(ae,le):ue==="System.String"?ae=>le=>string(ae,le):ue==="System.Char"?ae=>le=>char(ae,le):ue==="System.SByte"?sbyte:ue==="System.Byte"?byte:ue==="System.Int16"?int16:ue==="System.UInt16"?uint16:ue==="System.Int32"?int:ue==="System.UInt32"?uint32:ue==="System.Double"?ae=>le=>float(ae,le):ue==="System.Single"?ae=>le=>float32(ae,le):ue==="System.DateTime"?ae=>le=>datetimeUtc(ae,le):ue==="System.DateTimeOffset"?ae=>le=>datetimeOffset$1(ae,le):ue==="System.TimeSpan"?ae=>le=>timespan$1(ae,le):ue==="System.Guid"?ae=>le=>guid$1(ae,le):ue==="System.Object"?ae=>le=>new FSharpResult$2(0,[le]):autoDecodeRecordsAndUnions(ee,te,ne,re);else{const ae=de;return le=>Ae=>ae.contents(le)(Ae)}}function makeExtra$1(ee){return ee!=null?map$1((te,ne)=>new FSharpRef(ne[1]),ee.Coders):empty$1({Compare:comparePrimitives})}function Auto_generateBoxedDecoder_Z6670B51(ee,te,ne){const re=defaultArg(te,new CaseStrategy(0,[]));return autoDecoder(makeExtra$1(ne),re,!1,ee)}function guid(ee){return ee}const nil=defaultOf();function seq(ee){return Array.from(ee)}function datetimeOffset(ee){return toString$2(ee,"O")}function timespan(ee){return toString$1(ee)}function unit(){return defaultOf()}function datetime(ee){return toString$2(ee,"O")}function toString(ee,te){return JSON.stringify(te,void 0,some(ee))}function option(ee){return te=>defaultArgWith(map$5(ee,te),()=>nil)}function autoEncodeRecordsAndUnions(ee,te,ne,re){let ie;const se=new FSharpRef(defaultOf());let oe;const he=fullName(re);oe=he===""?ee:add$2(he,se,ee);let ue;if(isRecord(re)){const de=map$4(ae=>{const le=Util_Casing_convert(te,name(ae)),Ae=autoEncoder(oe,te,ne,ae[1]);return _e=>me=>{const ve=getRecordField(_e,ae);return(!ne||ne&&ve!=null)&&(me[le]=Ae(ve)),me}},getRecordElements(re));ue=ae=>fold((le,Ae)=>Ae(ae)(le),{},de)}else if(isUnion(re))ue=de=>{const ae=getUnionFields(de,re),le=ae[0],Ae=ae[1],_e=Ae.length|0;if(_e===0)return name(le);{const me=_e|0,ve=getUnionCaseFields(le),Se=fill(new Array(me+1),0,me+1,null);Se[0]=name(le);for(let Te=1;Te<=me;Te++){const Pe=autoEncoder(oe,te,ne,ve[Te-1][1]);Se[Te]=Pe(Ae[Te-1])}return Se}};else throw new Error((ie=fullName(re),toText(printf("Cannot generate auto encoder for %s. Please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(ie)));return se.contents=ue,ue}function autoEncoder(ee,te,ne,re){const ie=fullName(re),se=tryFind(ie,ee);if(se==null)if(isArray(re)){const oe=autoEncoder(ee,te,ne,getElementType(re));return he=>seq(map$2(oe,he))}else if(isEnum(re)){const oe=fullName(getEnumUnderlyingType(re));if(oe==="System.SByte")return he=>he;if(oe==="System.Byte")return he=>he;if(oe==="System.Int16")return he=>he;if(oe==="System.UInt16")return he=>he;if(oe==="System.Int32")return he=>he;if(oe==="System.UInt32")return he=>he;{const he=fullName(re);return toFail(printf("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\n\nIf you can't use one of these types, please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\n "))(he)}}else if(isGenericType(re))if(isTuple(re)){const oe=map$4(he=>autoEncoder(ee,te,ne,he),getTupleElements(re));return he=>seq(mapIndexed((ue,de)=>oe[ue](de),he))}else{const oe=fullName(getGenericTypeDefinition(re));if(oe==="Microsoft.FSharp.Core.FSharpOption`1[System.Object]"){const he=new Lazy(()=>option(autoEncoder(ee,te,ne,getGenerics(re)[0])));return ue=>ue==null?nil:he.Value(ue)}else if(oe==="Microsoft.FSharp.Collections.FSharpList`1[System.Object]"||oe==="Microsoft.FSharp.Collections.FSharpSet`1[System.Object]"||oe==="System.Collections.Generic.IEnumerable`1[System.Object]"){const he=autoEncoder(ee,te,ne,getGenerics(re)[0]);return ue=>seq(map$2(he,ue))}else if(oe==="Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]"){const he=getGenerics(re)[0],ue=autoEncoder(ee,te,ne,getGenerics(re)[1]);if(fullName(he)==="System.String"||fullName(he)==="System.Guid")return de=>fold((ae,le)=>{const Ae=le;return ae[Ae[0]]=ue(Ae[1]),ae},{},de);{let de;return de=autoEncoder(ee,te,ne,he),le=>seq(map$2(Ae=>{const _e=Ae;return[de(_e[0]),ue(_e[1])]},le))}}else return autoEncodeRecordsAndUnions(ee,te,ne,re)}else return ie==="System.Boolean"?oe=>oe:ie==="Microsoft.FSharp.Core.Unit"?unit:ie==="System.String"?oe=>oe:ie==="System.Char"?oe=>oe:ie==="System.SByte"?oe=>oe:ie==="System.Byte"?oe=>oe:ie==="System.Int16"?oe=>oe:ie==="System.UInt16"?oe=>oe:ie==="System.Int32"?oe=>oe:ie==="System.UInt32"?oe=>oe:ie==="System.Double"?oe=>oe:ie==="System.Single"?oe=>oe:ie==="System.DateTime"?datetime:ie==="System.DateTimeOffset"?datetimeOffset:ie==="System.TimeSpan"?timespan:ie==="System.Guid"?guid:ie==="System.Object"?oe=>oe:autoEncodeRecordsAndUnions(ee,te,ne,re);else{const oe=se;return he=>oe.contents(he)}}function makeExtra(ee){return ee!=null?map$1((te,ne)=>new FSharpRef(ne[0]),ee.Coders):empty$1({Compare:comparePrimitives})}function Auto_generateBoxedEncoder_437914C6(ee,te,ne,re){const ie=defaultArg(te,new CaseStrategy(0,[])),se=defaultArg(re,!0);return autoEncoder(makeExtra(ne),ie,se,ee)}class GetInitStateResult extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Success","Failure"]}}class BackendService{constructor(te,ne){this.accessToken=ne,this.baseUrl="".concat(te,"/workplace-policies/backend")}}function BackendService_$ctor_Z384F8060(ee,te){return new BackendService(ee,te)}function BackendService__GetInitState(ee){return singleton.Delay(()=>{let te;return singleton.Bind(Http_send((te=Http_method(new HttpMethod(0,[]),Http_request("".concat(ee.baseUrl,"/init"))),Http_header(Headers_authorization("Bearer ".concat(ee.accessToken)),te))),ne=>{const re=ne;return re.statusCode===200?singleton.Return(Result_Map(ie=>new GetInitStateResult(0,[ie]),fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(InitResponse$reflection(),new CaseStrategy(1,[]),void 0)),re.responseText))):singleton.Return(Result_Map(ie=>new GetInitStateResult(1,[ie]),fromString(uncurry2(Auto_generateBoxedDecoder_Z6670B51(InitResponseError$reflection(),new CaseStrategy(1,[]),void 0)),re.responseText)))})})}function BackendService__SendCommand_Z3B2D738(ee,te){return singleton.Delay(()=>{let ne,re,ie;const se=new CommandRequest(te);return singleton.Bind(Http_send((ne=(re=(ie=Http_method(new HttpMethod(1,[]),Http_request("".concat(ee.baseUrl,"/command"))),Http_header(Headers_authorization("Bearer ".concat(ee.accessToken)),ie)),Http_content(new BodyContent(1,[toString(0,Auto_generateBoxedEncoder_437914C6(CommandRequest$reflection(),new CaseStrategy(1,[]),void 0,void 0)(se))]),re)),Http_header(Headers_contentType("application/json"),ne))),oe=>oe.statusCode===200?singleton.Return(new FSharpResult$2(0,[void 0])):singleton.Return(new FSharpResult$2(1,["Command request error"])))})}function Sub_none(){return empty$3()}function Sub_Internal_SubId_toString(ee){return join("/",ee)}function Sub_Internal_Fx_warnDupe(ee,te){const ne=new Error("Duplicate SubId");return ee(["Duplicate SubId: "+Sub_Internal_SubId_toString(te),ne])}function Sub_Internal_Fx_tryStop(ee,te,ne){try{disposeSafe(ne)}catch(re){ee(["Error stopping subscription: "+Sub_Internal_SubId_toString(te),re])}}function Sub_Internal_Fx_tryStart(ee,te,ne,re){try{return[ne,re(te)]}catch(ie){ee(["Error starting subscription: "+Sub_Internal_SubId_toString(ne),ie]);return}}function Sub_Internal_Fx_stop(ee,te){iterate$1(ne=>{Sub_Internal_Fx_tryStop(ee,ne[0],ne[1])},te)}function Sub_Internal_Fx_change(ee,te,ne,re,ie,se){return iterate$1(oe=>{Sub_Internal_Fx_warnDupe(ee,oe)},ne),iterate$1(oe=>{Sub_Internal_Fx_tryStop(ee,oe[0],oe[1])},re),append$1(ie,choose(oe=>Sub_Internal_Fx_tryStart(ee,te,oe[0],oe[1]),se))}function Sub_Internal_NewSubs_init(){return[empty$3(),empty({Compare:compare$2}),empty$3()]}function Sub_Internal_NewSubs_update(ee,te,ne,re,ie){return contains(ee,re)?[cons(ee,ne),re,ie]:[ne,add$1(ee,re),cons([ee,te],ie)]}function Sub_Internal_NewSubs_calculate(ee){return foldBack((te,ne)=>Sub_Internal_NewSubs_update(te[0],te[1],ne[0],ne[1],ne[2]),ee,Sub_Internal_NewSubs_init())}const Sub_Internal_empty=empty$3();function Sub_Internal_diff(ee,te){const ne=ofList(map$3(oe=>oe[0],ee),{Compare:compare$2}),re=Sub_Internal_NewSubs_calculate(te),ie=re[1],se=re[0];if(ne.Equals(ie))return[se,empty$3(),ee,empty$3()];{const oe=partition(he=>contains(he[0],ie),ee);return[se,oe[1],oe[0],filter(he=>!contains(he[0],ne),re[2])]}}class Observer{constructor(te,ne,re){this.OnNext=te,this.OnError=ne||(ie=>{}),this.OnCompleted=re||(()=>{})}}function add(ee,te){te.Subscribe(new Observer(ee))}class Event$2{constructor(){this.delegates=[]}_add(te){this.delegates.push(te)}_remove(te){const ne=this.delegates.indexOf(te);ne>-1&&this.delegates.splice(ne,1)}get Publish(){return createEvent(te=>{this._add(te)},te=>{this._remove(te)})}Trigger(te,ne){let re=null;const ie=ne===void 0?te:(re=te,ne);this.delegates.forEach(se=>{se(re,ie)})}}let Event$1=class extends Event$2{};function createEvent(ee,te){return{AddHandler(ne){ee(ne)},RemoveHandler(ne){te(ne)},Subscribe(ne){const re=(ie,se)=>ne.OnNext(se);return ee(re),{Dispose(){te(re)}}}}}class Timer{constructor(te){this._enabled=!1,this._isDisposed=!1,this._intervalId=0,this._timeoutId=0,this.Interval=te&&te>0?te:100,this.AutoReset=!0,this._elapsed=new Event$1}Elapsed(){return this._elapsed.Publish}get Enabled(){return this._enabled}set Enabled(te){!this._isDisposed&&this._enabled!==te&&(this._enabled=te,this._enabled?this.AutoReset?this._intervalId=setInterval(()=>{this.AutoReset||(this.Enabled=!1),this._elapsed.Trigger(new Date)},this.Interval):this._timeoutId=setTimeout(()=>{this.Enabled=!1,this._timeoutId=0,this.AutoReset&&(this.Enabled=!0),this._elapsed.Trigger(new Date)},this.Interval):(this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=0),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=0)))}Dispose(){this.Enabled=!1,this._isDisposed=!0}Close(){this.Dispose()}Start(){this.Enabled=!0}Stop(){this.Enabled=!1}}const Timer$1=Timer;function Log_onError(ee,te){console.error(some(ee),te)}function Timer_delay(ee,te){let ne,re=new Timer$1(ee);re.AutoReset=!1,ne=re,add(te,ne.Elapsed()),ne.Enabled=!0,ne.Start()}function Cmd_exec(ee,te,ne){iterate$1(re=>{try{re(te)}catch(ie){ee(ie)}},ne)}function Cmd_none(){return empty$3()}function Cmd_ofEffect(ee){return singleton$2(ee)}function Cmd_OfAsyncWith_perform(ee,te,ne,re){return singleton$2(ie=>{ee(singleton.Delay(()=>singleton.Bind(catchAsync(te(ne)),se=>{const oe=se;return oe.tag===0&&ie(re(oe.fields[0])),singleton.Zero()})))})}function Cmd_OfAsync_start(ee){Timer_delay(1,te=>{startImmediate(ee)})}class RingState$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Writable","ReadWritable"]}}class RingBuffer$1{constructor(te){this.state=new RingState$1(0,[fill(new Array(max(comparePrimitives,te,10)),0,max(comparePrimitives,te,10),null),0])}}function RingBuffer$1_$ctor_Z524259A4(ee){return new RingBuffer$1(ee)}function RingBuffer$1__Pop(ee){const te=ee.state;if(te.tag===1){const ne=te.fields[1]|0,re=te.fields[2]|0,ie=te.fields[0],se=(re+1)%ie.length|0;return se===ne?ee.state=new RingState$1(0,[ie,ne]):ee.state=new RingState$1(1,[ie,ne,se]),some(ie[re])}else return}function RingBuffer$1__Push_2B595(ee,te){const ne=ee.state;if(ne.tag===1){const re=ne.fields[1]|0,ie=ne.fields[2]|0,se=ne.fields[0];se[re]=te;const oe=(re+1)%se.length|0;oe===ie?ee.state=new RingState$1(1,[RingBuffer$1__doubleSize(ee,ie,se),se.length,0]):ee.state=new RingState$1(1,[se,oe,ie])}else{const re=ne.fields[1]|0,ie=ne.fields[0];ie[re]=te;const se=(re+1)%ie.length|0;ee.state=new RingState$1(1,[ie,se,re])}}function RingBuffer$1__doubleSize(ee,te,ne){return Array.from(delay(()=>append(skip(te,ne),delay(()=>append(take(te,ne),delay(()=>collect(re=>singleton$1(defaultOf()),rangeDouble(0,1,ne.length))))))))}class Program$4 extends Record{constructor(te,ne,re,ie,se,oe,he){super(),this.init=te,this.update=ne,this.subscribe=re,this.view=ie,this.setState=se,this.onError=oe,this.termination=he}}function ProgramModule_mkProgram(ee,te,ne){return new Program$4(ee,te,re=>Sub_none(),ne,uncurry2(re=>{const ie=curry2(ne)(re);return se=>{ie(se)}}),re=>{Log_onError(re[0],re[1])},[re=>!1,re=>{}])}function ProgramModule_withSetState(ee,te){return new Program$4(te.init,te.update,te.subscribe,te.view,ee,te.onError,te.termination)}function ProgramModule_init(ee){return ee.init}function ProgramModule_map(ee,te,ne,re,ie,se,oe){const he=curry2(ee)(oe.init),ue=curry3(te)(curry2(oe.update)),de=curry3(ne)(curry2(oe.view)),ae=curry3(re)(curry2(oe.setState));return new Program$4(he,uncurry2(ue),curry2(ie)(oe.subscribe),uncurry2(de),uncurry2(ae),oe.onError,se(oe.termination))}function ProgramModule_runWithDispatch(ee,te,ne){let re;const ie=ne.init(te),se=ie[0],oe=ne.subscribe(se),he=ne.termination,ue=RingBuffer$1_$ctor_Z524259A4(10);let de=!1,ae=se,le=Sub_Internal_empty,Ae=!1;const _e=Se=>{Ae||(RingBuffer$1__Push_2B595(ue,Se),de||(de=!0,ve(),de=!1))},me=curry2(ee)(_e),ve=()=>{let Se,Te=RingBuffer$1__Pop(ue);for(;!Ae&&Te!=null;){const Pe=value(Te);if(he[0](Pe))Sub_Internal_Fx_stop(ne.onError,le),he[1](ae),Ae=!0;else{const Re=ne.update(Pe,ae),$e=Re[0],ye=ne.subscribe($e);ne.setState($e,me),Cmd_exec(Ee=>{ne.onError([toText(printf("Error handling the message: %A"))(Pe),Ee])},me,Re[1]),ae=$e,le=(Se=Sub_Internal_diff(le,ye),Sub_Internal_Fx_change(ne.onError,me,Se[0],Se[1],Se[2],Se[3])),Te=RingBuffer$1__Pop(ue)}}};de=!0,ne.setState(se,me),Cmd_exec(Se=>{ne.onError([toText(printf("Error intitializing:")),Se])},me,ie[1]),le=(re=Sub_Internal_diff(le,oe),Sub_Internal_Fx_change(ne.onError,me,re[0],re[1],re[2],re[3])),ve(),de=!1}function ProgramModule_runWith(ee,te){ProgramModule_runWithDispatch(uncurry2(ne=>ne),ee,te)}function getDefaultExportFromCjs(ee){return ee&&ee.__esModule&&Object.prototype.hasOwnProperty.call(ee,"default")?ee.default:ee}function getAugmentedNamespace(ee){if(ee.__esModule)return ee;var te=ee.default;if(typeof te=="function"){var ne=function re(){return this instanceof re?Reflect.construct(te,arguments,this.constructor):te.apply(this,arguments)};ne.prototype=te.prototype}else ne={};return Object.defineProperty(ne,"__esModule",{value:!0}),Object.keys(ee).forEach(function(re){var ie=Object.getOwnPropertyDescriptor(ee,re);Object.defineProperty(ne,re,ie.get?ie:{enumerable:!0,get:function(){return ee[re]}})}),ne}var shim={exports:{}},useSyncExternalStoreShim_production_min={};const require$$0=getAugmentedNamespace(compat_module);/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.min.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@ var xr=Object.defineProperty;var Pr=(ee,te,ne)=>te in ee?xr(ee,te,{enumerable:!0
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var e=require$$0;function h(ee,te){return ee===te&&(ee!==0||1/ee===1/te)||ee!==ee&&te!==te}var k=typeof Object.is=="function"?Object.is:h,l$1=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(ee,te){var ne=te(),re=l$1({inst:{value:ne,getSnapshot:te}}),ie=re[0].inst,se=re[1];return n(function(){ie.value=ne,ie.getSnapshot=te,r$2(ie)&&se({inst:ie})},[ee,ne,te]),m(function(){return r$2(ie)&&se({inst:ie}),ee(function(){r$2(ie)&&se({inst:ie})})},[ee]),p(ne),ne}function r$2(ee){var te=ee.getSnapshot;ee=ee.value;try{var ne=te();return!k(ee,ne)}catch{return!0}}function t(ee,te){return te()}var u$1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u$1,shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;class Util_ElmishState$3{constructor(te,ne,re){this.arg=ne,this.dependencies=re;const ie=te(),se=[];let oe;const me=ProgramModule_init(ie)(this.arg);let he=me[0],fe=me[1];oe=[[he,ae=>{se.push(ae)},!1,se],fe],this.state=oe[0],this.cmd=oe[1],this.subscribe=ae=>{let le=!1;const ye=isDisposable(this.state[0]);return ProgramModule_runWith(this.arg,ProgramModule_withSetState((ve,de)=>{const ge=this.state;this.state=[ve,de,!0,se],ve!==ge[0]&&ae()},ProgramModule_map((ve,de)=>{const ge=this.cmd;return this.cmd=Cmd_none(),[this.state[0],ge]},(ve,de,ge)=>ve(de)(this.state[0]),uncurry3(ve=>ve),uncurry3(ve=>ve),uncurry2(ve=>ve),ve=>[de=>ve[0](de)?!0:ye&&le,de=>{const ge=de;isDisposable(ge)?disposeSafe(ge):ve[1](de)}],ie))),()=>{le=!0}}}}function Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne){return new Util_ElmishState$3(ee,te,ne)}function Util_ElmishState$3__get_State(ee){return ee.state}function Util_ElmishState$3__get_Subscribe(ee){return ee.subscribe}function Util_ElmishState$3__IsOutdated_1954DBC6(ee,te,ne){return equals$2(ee.arg,te)?!equals$2(ee.dependencies,ne):!0}function React_useElmish_Z6C327F2E(ee,te,ne){const re=h$1(()=>Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne)),ie=re[0];Util_ElmishState$3__IsOutdated_1954DBC6(ie,te,ne)&&re[1](Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne));const se=shimExports.useSyncExternalStore(Util_ElmishState$3__get_Subscribe(ie),()=>Util_ElmishState$3__get_State(ie)),oe=se[2],me=se[3],he=se[1];return p$1(()=>{if(oe&&me.length>0){let fe=getEnumerator(me);try{for(;fe["System.Collections.IEnumerator.MoveNext"]();){const ae=fe["System.Collections.Generic.IEnumerator`1.get_Current"]();setTimeout(()=>{he(ae)})}}finally{disposeSafe(fe)}clear(me)}},[oe,me]),[se[0],he]}const useEffectWithDeps=(ee,te)=>{p$1(()=>{const ne=ee();return()=>{ne.Dispose()}},te)},Interop_reactApi=Cn,ReactInterop_useEffectWithDeps=useEffectWithDeps;function React_createDisposable_3A5B6456(ee){return{Dispose(){ee()}}}function useReact_useEffectOnce_3A5B6456(ee){const te=Interop_reactApi.useRef(!1);useReact_useEffect_311B4086(()=>{te.current||(te.current=!0,ee())},[])}function useReact_useEffect_311B4086(ee,te){ReactInterop_useEffectWithDeps(ne=>(ee(),React_createDisposable_3A5B6456(()=>{})),te)}function useReact_useRef_1505(ee){return Interop_reactApi.useRef(ee)}function useFeliz_React__React_useState_Static_1505(ee){return Interop_reactApi.useState(ee)}class Deferred$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function Deferred_inProgress(ee){return ee.tag===1}function notifyCompletion(ee){let te;te=new CustomEvent("step-completion",{bubbles:!0}),ee.dispatchEvent(te)}class AsyncOperationStatus$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Requested","Finished"]}}let Page$2=class extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Main","ReviewPolicy"]}};class State extends Record{constructor(te,ne,re,ie,se,oe,me){super(),this.Page=te,this.ReviewItemList=ne,this.GetInitStateStatus=re,this.PresentPoliciesStatus=ie,this.OpenPolicyStatus=se,this.AcceptPolicyStatus=oe,this.ContinueStatus=me}}class Msg extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["FetchReviewItemList","NavigatePage","PresentPolicies","OpenPolicy","AcceptPolicy","Continue","NotifyCompletion"]}}function StateModule_init(){return[new State(new Page$2(0,[]),empty$3(),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[])),singleton$2(ee=>{ee(new Msg(0,[new AsyncOperationStatus$1(0,[])]))})]}function StateModule_update(ee,te,ne){let re,ie;if(te.tag===1)return[new State(te.fields[0],ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(0,[]),ne.ContinueStatus),te.fields[0].tag===1?singleton$2(se=>{se(new Msg(3,[te.fields[0].fields[0],new AsyncOperationStatus$1(0,[])]))}):Cmd_none()];if(te.tag===2)return te.fields[1].tag===1?[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(1,[]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(0,[{PolicyIdentifierList:map$3(se=>se.Policy.Identifier,te.fields[0])}]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(2,[oe[0],oe[1]])})];if(te.tag===3)return te.fields[1].tag===1?[new State(ne.Page,map$3(se=>equals$2(te.fields[0].Policy.Identifier,se.Policy.Identifier)?new PolicyReviewItemDto(se.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(se.Status,new PolicyReviewItemStatusDto(1,[]))):se,ne.ReviewItemList),ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(1,[]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(1,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(3,[oe[0],oe[1]])})];if(te.tag===4)if(te.fields[1].tag===1){const se=map$3(oe=>equals$2(te.fields[0].Policy.Identifier,oe.Policy.Identifier)?new PolicyReviewItemDto(oe.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(oe.Status,new PolicyReviewItemStatusDto(2,[]))):oe,ne.ReviewItemList);return[new State((re=ne.Page,re.tag===1?(ie=re.fields[0],new Page$2(1,[new PolicyReviewItemDto(ie.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(ie.Status,new PolicyReviewItemStatusDto(2,[])))])):new Page$2(0,[])),se,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.ContinueStatus),te.fields[1].fields[0].tag===0?Cmd_ofEffect(oe=>{startImmediate(singleton.Delay(()=>singleton.Bind(sleep(1e3),()=>(oe(new Msg(1,[new Page$2(0,[])])),singleton.Zero()))))}):Cmd_none()]}else return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(1,[]),ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(2,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(4,[oe[0],oe[1]])})];else if(te.tag===5){if(te.fields[1].tag===1)return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]])),singleton$2(se=>{se(new Msg(6,[]))})];switch(ne.ContinueStatus.tag){case 0:case 2:case 3:return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(1,[])),Cmd_OfAsyncWith_perform(oe=>{Cmd_OfAsync_start(oe)},oe=>BackendService__SendCommand_Z3B2D738(ee,oe),new CommandTypeDto(3,[{PolicyIdentifierList:map$3(oe=>oe.Policy.Identifier,te.fields[0])}]),oe=>{const me=[te.fields[0],new AsyncOperationStatus$1(1,[oe])];return new Msg(5,[me[0],me[1]])})];default:return[ne,Cmd_none()]}}else{if(te.tag===6)return notifyCompletion(document.querySelector("apollo-workplace-policies-app")),[ne,Cmd_none()];if(te.fields[0].tag===1){let se,oe;switch(te.fields[0].fields[0].tag===1||te.fields[0].fields[0].fields[0].tag===1?oe=1:oe=0,oe){case 0:{const he=te.fields[0].fields[0].fields[0].fields[0];se=[he.PolicyReviewList,singleton$2(fe=>{fe(new Msg(2,[he.PolicyReviewList,new AsyncOperationStatus$1(0,[])]))})];break}case 1:{se=[void 0,Cmd_none()];break}}const me=se[0];return[new State(ne.Page,me==null?ne.ReviewItemList:me,new Deferred$1(2,[te.fields[0].fields[0]]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),se[1]]}else return[new State(ne.Page,ne.ReviewItemList,new Deferred$1(1,[]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},()=>BackendService__GetInitState(ee),void 0,se=>new Msg(0,[new AsyncOperationStatus$1(1,[se])]))]}}const scriptRel="modulepreload",assetsURL=function(ee){return"https://npm-cdn.flarehr.com/@flarehr/apollo-workplace-policies/dist/"+ee},seen={},__vitePreload=function(te,ne,re){return te()},TextLayer$1=':root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}\n',AnnotationLayer$1=":root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url(\"data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>\");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation=\"90\"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation=\"180\"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation=\"270\"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:\"\";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}\n",reactPdf=__vitePreload(()=>Promise.resolve().then(()=>index),void 0);function startImport(ee,te){startImmediate(singleton.Delay(()=>singleton.TryWith(singleton.Delay(()=>singleton.Bind(awaitPromise(reactPdf),ne=>{const re=ne;return re.pdfjs.GlobalWorkerOptions.workerSrc=new URL("https://npm-cdn.flarehr.com/@flarehr/apollo-workplace-policies/dist/assets/pdf.worker.min-bc10fb5c.js",self.location).toString(),ee(re),singleton.Zero()})),ne=>(te(),singleton.Zero()))))}const PdfCss_textLayer=(()=>toString$4(TextLayer$1))(),PdfCss_annotationLayer=(()=>toString$4(AnnotationLayer$1))(),PdfCss_all=PdfCss_textLayer+PdfCss_annotationLayer;class Document_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["File","OnLoadSuccess","ClassName","OnItemClick","Children"]}}function Document_Component(ee,te){return Interop_reactApi.createElement(ee.Document,keyValueList(te,1))}class Page_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["PageNumber","Width"]}}function Page_Component(ee,te){return Interop_reactApi.createElement(ee.Page,keyValueList(te,1))}class Thumbnail_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Key","PageNumber","Width"]}}function Thumbnail_Component(ee,te){return Interop_reactApi.createElement(ee.Thumbnail,keyValueList(te,1))}const index$1='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-10{height:2.5rem}.h-20{height:5rem}.h-full{height:100%}.w-20{width:5rem}.w-\\[4\\.75rem\\]{width:4.75rem}.w-full{width:100%}.max-w-\\[560px\\]{max-width:560px}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-progress{cursor:progress}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-4{border-width:4px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-primary-base{border-color:var(--fl-color-primary)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-primary-base{background-color:var(--fl-color-primary)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-bottom{vertical-align:bottom}.font-inter{font-family:Inter,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.leading-tight{line-height:1.25}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-primary-base{color:var(--fl-color-primary)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-2{text-underline-offset:2px}.opacity-\\[0\\.07\\]{opacity:.07}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-primary-base{--tw-ring-color: var(--fl-color-primary)}.ring-opacity-5{--tw-ring-opacity: .05}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:text-primary-base:hover{color:var(--fl-color-primary)}.hover\\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\\:ring-primary-base:hover{--tw-ring-color: var(--fl-color-primary)}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-primary-base:focus-visible{outline-color:var(--fl-color-primary)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:cursor-progress:disabled{cursor:progress}.disabled\\:border:disabled{border-width:1px}.disabled\\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:mr-2{margin-right:.5rem}.sm\\:mr-2\\.5{margin-right:.625rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-10{margin-top:2.5rem}.sm\\:mt-6{margin-top:1.5rem}.sm\\:mt-\\[1px\\]{margin-top:1px}.sm\\:w-\\[12\\.5rem\\]{width:12.5rem}.sm\\:w-\\[35rem\\]{width:35rem}.sm\\:max-w-\\[57rem\\]{max-width:57rem}.sm\\:flex-row{flex-direction:row}.sm\\:p-5{padding:1.25rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\\:py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\\:py-20{padding-top:5rem;padding-bottom:5rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:leading-6{line-height:1.5rem}.sm\\:leading-7{line-height:1.75rem}.sm\\:leading-8{line-height:2rem}.sm\\:leading-9{line-height:2.25rem}}@media (min-width: 768px){.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:py-4{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.lg\\:visible{visibility:visible}}\n',css=(()=>toString$4(index$1))(),SvgCheck=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{clipPath:"url(#clip0_3040_23717)"},y$1("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"currentColor"}),y$1("path",{d:"M6 12L10 16L18 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),y$1("defs",null,y$1("clipPath",{id:"clip0_3040_23717"},y$1("rect",{width:24,height:24,fill:"white"})))),SvgChevronLeft=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgChevronRight=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M9 6L15 12L9 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgDownload=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 16L4 17C4 18.6569 5.34315 20 7 20L17 20C18.6569 20 20 18.6569 20 17L20 16M16 12L12 16M12 16L8 12M12 16L12 4",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgFileNoAccess=ee=>y$1("svg",{width:33,height:32,viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"file-no-access 1"},y$1("g",{id:"Group"},y$1("path",{id:"Vector",d:"M29.5 1H3.5V31H29.5V1Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_2",d:"M11.5566 20.944L21.4406 11.06",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_3",d:"M16.5 23C20.366 23 23.5 19.866 23.5 16C23.5 12.134 20.366 9 16.5 9C12.634 9 9.5 12.134 9.5 16C9.5 19.866 12.634 23 16.5 23Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))),SvgFolderXmark=ee=>y$1("svg",{width:32,height:28,viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M28 4C30.1875 4 32 5.8125 32 8V24C32 26.25 30.1875 28 28 28H4C1.75 28 0 26.25 0 24V4C0 1.8125 1.75 0 4 0H11.3125C12.375 0 13.375 0.4375 14.125 1.1875L17 4H28ZM30 24V8C30 6.9375 29.0625 6 28 6H16.125L12.75 2.625C12.375 2.25 11.875 2 11.3125 2H4C2.875 2 2 2.9375 2 4V24C2 25.125 2.875 26 4 26H28C29.0625 26 30 25.125 30 24ZM20.6875 11.3125C21.0625 11.6875 21.0625 12.375 20.6875 12.75L17.375 16L20.6875 19.3125C21.0625 19.6875 21.0625 20.375 20.6875 20.75C20.3125 21.125 19.625 21.125 19.25 20.75L16 17.4375L12.6875 20.75C12.3125 21.125 11.625 21.125 11.25 20.75C10.875 20.375 10.875 19.6875 11.25 19.3125L14.5625 16L11.25 12.75C10.875 12.375 10.875 11.6875 11.25 11.3125C11.625 10.9375 12.3125 10.9375 12.6875 11.3125L16 14.625L19.25 11.3125C19.625 10.9375 20.3125 10.9375 20.6875 11.3125Z",fill:"currentColor"})),SvgLaunch=ee=>y$1("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4H15.5C15.6326 4 15.7597 4.05268 15.8535 4.14645C15.9473 4.24022 16 4.36739 16 4.5V9.5C15.9999 9.59894 15.9706 9.69565 15.9156 9.77789C15.8606 9.86013 15.7824 9.92421 15.691 9.962C15.6303 9.98677 15.5655 9.99967 15.5 10C15.4343 10.0001 15.3692 9.98729 15.3084 9.96223C15.2477 9.93718 15.1925 9.9004 15.146 9.854L13.354 8.061L10.707 10.707C10.6147 10.8025 10.5044 10.8787 10.3824 10.9311C10.2604 10.9835 10.1291 11.0111 9.99636 11.0123C9.86358 11.0134 9.7319 10.9881 9.609 10.9378C9.48611 10.8875 9.37446 10.8133 9.28056 10.7194C9.18667 10.6255 9.11242 10.5139 9.06214 10.391C9.01186 10.2681 8.98655 10.1364 8.98771 10.0036C8.98886 9.87082 9.01645 9.7396 9.06886 9.6176C9.12127 9.49559 9.19745 9.38525 9.29296 9.293L11.939 6.646L10.146 4.854C10.0759 4.78407 10.0281 4.6949 10.0087 4.59779C9.98935 4.50068 9.99926 4.40001 10.0372 4.30854C10.0751 4.21706 10.1393 4.13891 10.2217 4.08398C10.3041 4.02905 10.4009 3.99982 10.5 4ZM12 16H6C5.46957 16 4.96086 15.7893 4.58579 15.4142C4.21071 15.0391 4 14.5304 4 14V8C4 7.46957 4.21071 6.96086 4.58579 6.58579C4.96086 6.21071 5.46957 6 6 6H7C7.26522 6 7.51957 6.10536 7.70711 6.29289C7.89464 6.48043 8 6.73478 8 7C8 7.26522 7.89464 7.51957 7.70711 7.70711C7.51957 7.89464 7.26522 8 7 8H6V14H12V13C12 12.7348 12.1054 12.4804 12.2929 12.2929C12.4804 12.1054 12.7348 12 13 12C13.2652 12 13.5196 12.1054 13.7071 12.2929C13.8946 12.4804 14 12.7348 14 13V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16Z",fill:"currentColor"})),SvgLoader=ee=>y$1("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"Loader Mini"},y$1("path",{id:"Ellipse 2",d:"M18.5 10C18.5 14.4183 14.9183 18 10.5 18C6.08172 18 2.5 14.4183 2.5 10C2.5 5.58172 6.08172 2 10.5 2C14.9183 2 18.5 5.58172 18.5 10ZM4.49743 10C4.49743 13.3151 7.18487 16.0026 10.5 16.0026C13.8151 16.0026 16.5026 13.3151 16.5026 10C16.5026 6.68487 13.8151 3.99743 10.5 3.99743C7.18487 3.99743 4.49743 6.68487 4.49743 10Z",fill:"white",fillOpacity:.3}),y$1("path",{id:"Ellipse 2_2",d:"M10.5 3C10.5 2.44772 10.9494 1.99356 11.4974 2.06242C12.2053 2.15137 12.8996 2.3348 13.5615 2.60896C14.5321 3.011 15.414 3.60028 16.1569 4.34315C16.8997 5.08602 17.489 5.96793 17.891 6.93853C18.1652 7.60043 18.3486 8.29473 18.4376 9.0026C18.5064 9.55057 18.0523 10 17.5 10C16.9477 10 16.5085 9.54925 16.4169 9.00462C16.342 8.55939 16.2169 8.12298 16.0433 7.7039C15.7417 6.97595 15.2998 6.31451 14.7426 5.75736C14.1855 5.20021 13.5241 4.75825 12.7961 4.45672C12.377 4.28313 11.9406 4.15804 11.4954 4.08314C10.9508 3.99152 10.5 3.55228 10.5 3Z",fill:"white"}))),SvgMenu=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 6H20M4 12H20M4 18H20",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgMinus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M18 12H6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgPlus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M12 6V12M12 12V18M12 12H18M12 12L6 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));class Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Height","Width","ClassName"]}}function importSvg(ee,te){return Interop_reactApi.createElement(ee,keyValueList(te,1))}function check(ee){return importSvg(SvgCheck,ee)}function chevronLeft(ee){return importSvg(SvgChevronLeft,ee)}function chevronRight(ee){return importSvg(SvgChevronRight,ee)}function download(ee){return importSvg(SvgDownload,ee)}function fileNoAccess(ee){return importSvg(SvgFileNoAccess,ee)}function folderXmark(ee){return importSvg(SvgFolderXmark,ee)}function launch(ee){return importSvg(SvgLaunch,ee)}function loader(ee){return importSvg(SvgLoader,ee)}function menu(ee){return importSvg(SvgMenu,ee)}function minus(ee){return importSvg(SvgMinus,ee)}function plus(ee){return importSvg(SvgPlus,ee)}function getKey(ee){return ee.PolicyType.tag===1?"".concat(ee.PolicyId,"-C"):"".concat(ee.PolicyId,"-I")}function Component$5(ee){let te,ne,re;const ie=ee.item,se=ee.dispatch,oe=useFeliz_React__React_useState_Static_1505(!1),me=oe[1],he=equals$2(ie.Status,new PolicyReviewItemStatusDto(2,[]));return y$1("div",createObj(ofArray$2([["key",getKey(ie.Policy.Identifier)],["onMouseEnter",fe=>{me(!0)}],["onMouseLeave",fe=>{me(!1)}],["onClick",fe=>{se(new Msg(1,[new Page$2(1,[ie])]))}],["className",join(" ",toList(delay(()=>append(singleton$1("py-6 px-4 sm:px-6 shadow-sm rounded-lg text-left cursor-pointer"),delay(()=>singleton$1(he?"ring-2 ring-primary-base":"ring-1 ring-gray-300 hover:ring-2 hover:ring-primary-base"))))))],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between"],(ne=[y$1("div",{className:"text-base leading-6 font-semibold text-gray-900 mr-4",children:ie.Policy.Title}),y$1("div",createObj(ofArray$2([["className",join(" ",toList(delay(()=>append(singleton$1("ml-2"),delay(()=>singleton$1(he?"text-primary-base":"text-gray-400"))))))],(re=toList(delay(()=>singleton$1(he?check(empty$3()):chevronRight(singleton$2(new Prop(2,[oe[0]?"text-primary-base":""])))))),["children",Interop_reactApi.Children.toArray(Array.from(re))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",{className:"text-sm leading-5 font-normal text-gray-500 mt-2",children:ie.Policy.Description}),y$1("div",{className:"text-sm leading-5 font-medium mt-3 text-primary-base hover:underline underline-offset-2",children:"View document (PDF)"})],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function canContinue(ee){return forAll(te=>equals$2(te.Status,new PolicyReviewItemStatusDto(2,[])),ee)}function title(ee){return y$1("div",{className:"text-gray-900 text-2xl sm:text-3xl leading-8 sm:leading-9 font-bold",children:ee})}function container(ee){let te;return y$1("div",createObj(ofArray$2([["className","w-full sm:w-[35rem] text-center bg-white mx-auto px-1 py-5 sm:py-16"],(te=toList(delay(()=>ee)),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function noPoliciesConfigured(ee){let te,ne;return container([y$1("div",createObj(ofArray$2([["className","mb-4 mx-auto w-20 h-20 p-6 relative"],(te=[y$1("div",{className:"absolute top-0 left-0 w-full h-full bg-primary-base opacity-[0.07] rounded-full"}),folderXmark(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])]))),title("No statements available"),y$1("div",{className:"text-center text-gray-600 text-lg font-normal leading-7 sm:leading-8 mt-4",children:"It looks like there are no statements for you to review from your employer at this time."}),y$1("button",createObj(ofArray$2([["type","button"],(ne="mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base",["className",ne]),["onClick",re=>{ee(new Msg(6,[]))}],["children","Continue"]])))])}function Component$4(ee,te,ne){let re,ie,se;return container([title("Employment information statements"),y$1("div",createObj(ofArray$2([["className","text-gray-600 text-base sm:text-lg font-normal leading-7 sm:leading-8 mt-4"],(re="Please review and accept the below information statement. They outline your entitlements and protections as an employee in Australia.",["children",re])]))),y$1("div",createObj(ofArray$2([["className","space-y-4 mt-8 sm:mt-10"],(ie=toList(delay(()=>map$3(oe=>y$1(Component$5,{dispatch:ne,item:oe}),ee))),["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","text-gray-900 text-sm font-normal leading-5 mt-4 sm:mt-6 text-left"],(se="As a new employee, your employer is required to give you a copy of the Fair Work Information Statements provided by the Fair Work Ombudsman, before, or as soon as possible after, you start your new job.",["children",se])]))),y$1("button",createObj(toList(delay(()=>{const oe=te.tag===1?!0:!canContinue(ee);return append(singleton$1(["disabled",oe]),delay(()=>append(singleton$1(["type","button"]),delay(()=>append(singleton$1(["className",join(" ",toList(delay(()=>append(singleton$1("mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base"),delay(()=>append(Deferred_inProgress(te)?singleton$1("cursor-progress"):empty$2(),delay(()=>!Deferred_inProgress(te)&&oe?singleton$1("disabled:text-gray-400 disabled:cursor-not-allowed\n disabled:border disabled:border-gray-300 disabled:bg-gray-100"):empty$2())))))))]),delay(()=>append(singleton$1(["onClick",me=>{ne(new Msg(5,[ee,new AsyncOperationStatus$1(0,[])]))}]),delay(()=>{let me;return singleton$1((me=toList(delay(()=>te.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Continue"))),["children",Interop_reactApi.Children.toArray(Array.from(me))]))}))))))))}))))])}function Component$3(ee){let te,ne,re,ie;return y$1("div",createObj(ofArray$2([(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100 py-10 px-4 sm:py-20",["className",te]),(ne=[fileNoAccess(empty$3()),y$1("h1",{className:"mt-4 text-gray-900 text-base leading-6 font-semibold",children:"Unable to load PDF"}),y$1("p",createObj(ofArray$2([["className","mt-2 text-gray-700 text-sm leading-5 font-normal max-w-[560px] text-center"],(re="It looks like we’re unable to load the PDF at this time. Download the document below to view the statement.",["children",re])]))),y$1("a",createObj(ofArray$2([(ie="mt-4 text-primary-base text-sm leading-5 font-medium cursor-pointer hover:underline underline-offset-2",["className",ie]),["href",PathDto__get_Value(ee.Path)],["download",ee.Name],["target","_blank"],["children","Download document (PDF)"]])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$2(ee){let te,ne,re,ie,se,oe,me,he;const fe=ee.file,ae=ee.reactPdf,le=useFeliz_React__React_useState_Static_1505(!1),ye=useFeliz_React__React_useState_Static_1505(!1),ve=ye[0],de=ye[1],ge=useFeliz_React__React_useState_Static_1505(1),ue=ge[0]|0,Te=useFeliz_React__React_useState_Static_1505(1),$e=Te[1],ke=Te[0]|0,Ce=useReact_useRef_1505(void 0);return y$1("div",createObj(ofArray$2([["ref",Ce],(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100",["className",te]),(ne=[y$1("style",{children:[PdfCss_all]}),y$1("div",createObj(ofArray$2([["className","flex justify-between items-center py-4 px-4 md:py-3 w-full shadow-sm bg-white rounded-t-lg"],(re=[y$1("button",createObj(ofArray$2([["className","invisible lg:visible p-1 rounded-full hover:bg-gray-100"],["type","button"],["onClick",ce=>{de(!ve)}],["title","Menu"],(ie=[menu(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","flex items-center"],(se=[y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",ke<=1],["onClick",ce=>{$e(ke-1)}],["title","Previous page"],(oe=[chevronLeft(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(oe))])]))),y$1("div",{className:"text-gray-900 text-sm font-normal leading-tight mx-4",children:"Page ".concat(ke," / ").concat(ue)}),y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",ke>=ue],["onClick",ce=>{$e(ke+1)}],["title","Next page"],(me=[chevronRight(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(me))])])))],["children",Interop_reactApi.Children.toArray(Array.from(se))])]))),y$1("a",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["href",PathDto__get_Value(fe.Path)],["download",fe.Name],["title","Download"],["target","_blank"],(he=[download(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(he))])])))],["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),Document_Component(ae,ofArray$2([new Document_Prop(0,[PathDto__get_Value(fe.Path)]),new Document_Prop(1,[ce=>{le[0]||(le[1](!0),ge[1](ce.numPages),de(value(Ce.current).clientWidth>=1024))}]),new Document_Prop(3,[ce=>{$e(ce.pageNumber)}]),new Document_Prop(2,["flex py-2 md:py-4"]),new Document_Prop(4,[[y$1("div",createObj(toList(delay(()=>ve?append(singleton$1(["className","flex flex-col space-y-4 p-4"]),delay(()=>{let ce;return singleton$1((ce=toList(delay(()=>map$2(be=>{const we=ofArray$2([y$1("div",createObj(toList(delay(()=>append(ke===be?singleton$1(["className","border-4 border-primary-base rounded"]):empty$2(),delay(()=>{let _e;return singleton$1((_e=[Thumbnail_Component(ae,ofArray$2([new Thumbnail_Prop(0,["thumbnail-".concat(be)]),new Thumbnail_Prop(1,[be]),new Thumbnail_Prop(2,[100])]))],["children",Interop_reactApi.Children.toArray(Array.from(_e))]))})))))),y$1("div",{className:"mt-1 text-center text-xs text-gray-600",children:be})]);return y$1("div",{children:Interop_reactApi.Children.toArray(Array.from(we))})},rangeDouble(1,1,ue)))),["children",Interop_reactApi.Children.toArray(Array.from(ce))]))})):empty$2())))),Page_Component(ae,toList(delay(()=>append(singleton$1(new Page_Prop(0,[ke])),delay(()=>Ce.current!=null?singleton$1(new Page_Prop(1,[min(comparePrimitives,value(Ce.current).clientWidth-32,768)])):empty$2())))))]])]))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$1(ee){let te,ne,re,ie;const se=ee.dispatch,oe=ee.reactPdf,me=ee.acceptPolicyStatus,he=ee.policyReviewItem,fe=useFeliz_React__React_useState_Static_1505(!1),ae=fe[0],le=fe[1];return y$1("div",createObj(ofArray$2([["className","w-full p-1 sm:p-5"],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between items-center"],(ne=toList(delay(()=>{let ye;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-start cursor-pointer text-gray-900 hover:text-primary-base"],["disabled",Deferred_inProgress(me)],["onClick",ve=>{se(new Msg(1,[new Page$2(0,[])]))}],(ye=[chevronLeft(singleton$2(new Prop(2,["sm:mt-[1px]"]))),y$1("div",{className:"ml-1 mr-4 text-base sm:text-lg leading-6 sm:leading-7 font-semibold text-gray-900",children:he.Policy.Title})],["children",Interop_reactApi.Children.toArray(Array.from(ye))])])))),delay(()=>{let ve,de,ge;return he.Status.tag===2?singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-center flex-col-reverse sm:flex-row"],(ve=[y$1("span",{className:"mt-1 sm:mt-0 sm:mr-2.5 sm:py-2.5 text-sm leading-5 font-medium text-gray-500",children:"Accepted"}),check(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(ve))])])))):singleton$1(y$1("button",createObj(ofArray$2([["type","button"],["disabled",Deferred_inProgress(me)],(de="\n shadow-sm w-[4.75rem] h-10 px-3 py-2 rounded-md flex justify-center items-center text-white\n text-sm font-semibold leading-5 cursor-pointer disabled:cursor-progress bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base\n ",["className",de]),["onClick",ue=>{se(new Msg(4,[he,new AsyncOperationStatus$1(0,[])]))}],(ge=toList(delay(()=>me.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Accept"))),["children",Interop_reactApi.Children.toArray(Array.from(ge))])]))))}))})),["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",createObj(ofArray$2([["className","mt-4 sm:mt-6 mb-6"],(re=toList(delay(()=>oe==null?singleton$1(y$1(Component$3,he.Policy.File)):singleton$1(y$1(Component$2,{reactPdf:oe,file:he.Policy.File})))),["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),y$1("div",createObj(ofArray$2([["className","p-4 sm:p-6 rounded-lg shadow-sm border border-gray-300"],(ie=toList(delay(()=>{let ye;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex justify-between cursor-pointer text-gray-400 hover:text-primary-base"],["onClick",ve=>{le(!ae)}],(ye=toList(delay(()=>append(singleton$1(y$1("div",{className:"text-sm mr-4 sm:text-base leading-5 sm:leading-6 font-semibold text-gray-900",children:"About the ".concat(he.Policy.Title)})),delay(()=>singleton$1(ae?minus(empty$3()):plus(empty$3())))))),["children",Interop_reactApi.Children.toArray(Array.from(ye))])])))),delay(()=>{let ve,de,ge;return ae?singleton$1(y$1("div",createObj(ofArray$2([["className","mt-2 space-y-3 sm:max-w-[57rem]"],["onClick",ue=>{le(!ae)}],(ve=[y$1("div",{className:"text-sm font-normal leading-6 text-gray-900",children:he.Policy.About.Copy}),y$1("a",createObj(ofArray$2([(de="text-sm font-medium leading-5 text-primary-base cursor-pointer hover:underline underline-offset-2 break-all",["className",de]),["target","_blank"],["rel","noopener"],["href",he.Policy.About.Link],(ge=[he.Policy.About.Link,launch(singleton$2(new Prop(2,["inline align-bottom"])))],["children",Interop_reactApi.Children.toArray(Array.from(ge))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ve))])])))):empty$2()}))})),["children",Interop_reactApi.Children.toArray(Array.from(ie))])])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function r$1(){return(r$1=Object.assign||function(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te];for(var re in ne)Object.prototype.hasOwnProperty.call(ne,re)&&(ee[re]=ne[re])}return ee}).apply(this,arguments)}function i(ee){this.getChildContext=function(){return ee.context};var te=ee.children,ne=function(re,ie){if(re==null)return{};var se,oe,me={},he=Object.keys(re);for(oe=0;oe<he.length;oe++)ie.indexOf(se=he[oe])>=0||(me[se]=re[se]);return me}(ee,["context","children"]);return F$2(te,ne)}function a(){var ee=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(ee),this._vdom=y$1(i,r$1({},this._props,{context:ee.detail.context}),function te(ne,re){if(ne.nodeType===3)return ne.data;if(ne.nodeType!==1)return null;var ie=[],se={},oe=0,me=ne.attributes,he=ne.childNodes;for(oe=me.length;oe--;)me[oe].name!=="slot"&&(se[me[oe].name]=me[oe].value,se[s(me[oe].name)]=me[oe].value);for(oe=he.length;oe--;){var fe=te(he[oe],null),ae=he[oe].slot;ae?se[ae]=y$1(u,{name:ae},fe):ie[oe]=fe}var le=re?y$1(u,null,ie):ie;return y$1(re||ne.nodeName.toLowerCase(),se,le)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?E$1:D$1)(this._vdom,this._root)}function s(ee){return ee.replace(/-(\w)/g,function(te,ne){return ne?ne.toUpperCase():""})}function c(ee,te,ne){if(this._vdom){var re={};re[ee]=ne=ne==null?void 0:ne,re[s(ee)]=ne,this._vdom=F$2(this._vdom,re),D$1(this._vdom,this._root)}}function l(){D$1(this._vdom=null,this._root)}function u(ee,te){var ne=this;return y$1("slot",r$1({},ee,{ref:function(re){re?(ne.ref=re,ne._listener||(ne._listener=function(ie){ie.stopPropagation(),ie.detail.context=te},re.addEventListener("_preact",ne._listener))):ne.ref.removeEventListener("_preact",ne._listener)}}))}function preact_custom_element(ee,te,ne,re){function ie(){var se=Reflect.construct(HTMLElement,[],ie);return se._vdomComponent=ee,se._root=re&&re.shadow?se.attachShadow({mode:"open"}):se,se}return(ie.prototype=Object.create(HTMLElement.prototype)).constructor=ie,ie.prototype.connectedCallback=a,ie.prototype.attributeChangedCallback=c,ie.prototype.disconnectedCallback=l,ne=ne||ee.observedAttributes||Object.keys(ee.propTypes||{}),ie.observedAttributes=ne,ne.forEach(function(se){Object.defineProperty(ie.prototype,se,{get:function(){return this._vdom.props[se]},set:function(oe){this._vdom?this.attributeChangedCallback(se,null,oe):(this._props||(this._props={}),this._props[se]=oe,this.connectedCallback());var me=typeof oe;oe!=null&&me!=="string"&&me!=="boolean"&&me!=="number"||this.setAttribute(se,oe)}})}),customElements.define(te||ee.tagName||ee.displayName||ee.name,ie)}function register(ee,te){preact_custom_element(ee,te,void 0,{shadow:!0})}class PdfModuleStatus extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Loading","Loaded"]}}function Component(ee){let te,ne;const re=BackendService_$ctor_Z384F8060(ee.backendUrl,ee.accessToken);ne=React_useElmish_Z6C327F2E(()=>ProgramModule_mkProgram(StateModule_init,(ae,le)=>StateModule_update(re,ae,le),(ae,le)=>{}),void 0,void 0);const ie=ne[0],se=ne[1],oe=useFeliz_React__React_useState_Static_1505(new PdfModuleStatus(0,[])),me=oe[1],he=oe[0];useReact_useEffectOnce_3A5B6456(()=>{startImport(ae=>{me(new PdfModuleStatus(1,[ae]))},()=>{me(new PdfModuleStatus(1,[void 0]))})});const fe=[y$1("style",{children:[css]}),y$1("div",createObj(ofArray$2([["className","font-inter"],(te=toList(delay(()=>{const ae=ie.GetInitStateStatus,le=ie.PresentPoliciesStatus;let ye,ve;switch(ae.tag===3?(le.tag===3||le.tag===0||le.tag===1||le.fields[0].tag,ye=0):ae.tag===0||ae.tag===1?le.tag===3?ye=0:le.tag===0||le.tag===1?ye=3:le.fields[0].tag===1?ye=0:ye=3:ae.fields[0].tag===0?le.tag===3?ye=0:le.tag===0||le.tag===1?ae.fields[0].fields[0].tag===1?ye=1:ye=3:le.fields[0].tag===0?ae.fields[0].fields[0].tag===0?he.tag===0?ye=3:(ye=2,ve=he.fields[0]):ye=1:ye=0:ye=0,ye){case 0:return singleton$1(y$1("div",{children:["Oops, we've encountered an error"]}));case 1:return singleton$1(noPoliciesConfigured(se));case 2:{const de=ie.Page;return de.tag===1?singleton$1(y$1(Component$1,{policyReviewItem:de.fields[0],acceptPolicyStatus:ie.AcceptPolicyStatus,reactPdf:ve,dispatch:se})):singleton$1(Component$4(ie.ReviewItemList,ie.ContinueStatus,se))}case 3:return singleton$1(y$1("div",{children:["Please wait..."]}))}})),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))];return y$1(k$3,{},...fe)}register(ee=>y$1(Component,ee),"apollo-workplace-policies-app");function commonjsRequire(ee){throw new Error('Could not dynamically require "'+ee+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(te,ne){module.exports=ne()})(globalThis,()=>(()=>{var __webpack_modules__=[,(ee,te)=>{var Rt;Object.defineProperty(te,"__esModule",{value:!0}),te.VerbosityLevel=te.Util=te.UnknownErrorException=te.UnexpectedResponseException=te.TextRenderingMode=te.RenderingIntentFlag=te.PromiseCapability=te.PermissionFlag=te.PasswordResponses=te.PasswordException=te.PageActionEventType=te.OPS=te.MissingPDFException=te.MAX_IMAGE_SIZE_TO_CACHE=te.LINE_FACTOR=te.LINE_DESCENT_FACTOR=te.InvalidPDFException=te.ImageKind=te.IDENTITY_MATRIX=te.FormatError=te.FeatureTest=te.FONT_IDENTITY_MATRIX=te.DocumentActionEventType=te.CMapCompressionType=te.BaseException=te.BASELINE_FACTOR=te.AnnotationType=te.AnnotationStateModelType=te.AnnotationReviewState=te.AnnotationReplyType=te.AnnotationMode=te.AnnotationMarkedState=te.AnnotationFlag=te.AnnotationFieldFlag=te.AnnotationEditorType=te.AnnotationEditorPrefix=te.AnnotationEditorParamsType=te.AnnotationBorderStyleType=te.AnnotationActionEventType=te.AbortException=void 0,te.assert=vt,te.bytesToString=Ue,te.createValidAbsoluteUrl=yt,te.getModificationDate=St,te.getVerbosityLevel=ut,te.info=st,te.isArrayBuffer=ft,te.isArrayEqual=wt,te.normalizeUnicode=bt,te.objectFromMap=Me,te.objectSize=Re,te.setVerbosityLevel=et,te.shadow=ze,te.string32=Ae,te.stringToBytes=pe,te.stringToPDFString=nt,te.stringToUTF8String=tt,te.unreachable=gt,te.utf8StringToString=ht,te.warn=ct;const ne=[1,0,0,1,0,0];te.IDENTITY_MATRIX=ne;const re=[.001,0,0,.001,0,0];te.FONT_IDENTITY_MATRIX=re;const ie=1e7;te.MAX_IMAGE_SIZE_TO_CACHE=ie;const se=1.35;te.LINE_FACTOR=se;const oe=.35;te.LINE_DESCENT_FACTOR=oe;const me=oe/se;te.BASELINE_FACTOR=me;const he={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};te.RenderingIntentFlag=he;const fe={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};te.AnnotationMode=fe;const ae="pdfjs_internal_editor_";te.AnnotationEditorPrefix=ae;const le={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};te.AnnotationEditorType=le;const ye={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};te.AnnotationEditorParamsType=ye;const ve={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};te.PermissionFlag=ve;const de={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};te.TextRenderingMode=de;const ge={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};te.ImageKind=ge;const ue={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};te.AnnotationType=ue;const Te={MARKED:"Marked",REVIEW:"Review"};te.AnnotationStateModelType=Te;const $e={MARKED:"Marked",UNMARKED:"Unmarked"};te.AnnotationMarkedState=$e;const ke={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};te.AnnotationReviewState=ke;const Ce={GROUP:"Group",REPLY:"R"};te.AnnotationReplyType=Ce;const ce={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};te.AnnotationFlag=ce;const be={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};te.AnnotationFieldFlag=be;const we={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};te.AnnotationBorderStyleType=we;const _e={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};te.AnnotationActionEventType=_e;const Ee={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};te.DocumentActionEventType=Ee;const De={O:"PageOpen",C:"PageClose"};te.PageActionEventType=De;const Se={ERRORS:0,WARNINGS:1,INFOS:5};te.VerbosityLevel=Se;const He={NONE:0,BINARY:1};te.CMapCompressionType=He;const qe={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};te.OPS=qe;const Ke={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};te.PasswordResponses=Ke;let Je=Se.WARNINGS;function et(dt){Number.isInteger(dt)&&(Je=dt)}function ut(){return Je}function st(dt){Je>=Se.INFOS&&console.log("Info: ".concat(dt))}function ct(dt){Je>=Se.WARNINGS&&console.log("Warning: ".concat(dt))}function gt(dt){throw new Error(dt)}function vt(dt,Ie){dt||gt(Ie)}function At(dt){switch(dt==null?void 0:dt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function yt(dt,Ie=null,Be=null){if(!dt)return null;try{if(Be&&typeof dt=="string"){if(Be.addDefaultProtocol&&dt.startsWith("www.")){const mt=dt.match(/\./g);(mt==null?void 0:mt.length)>=2&&(dt="http://".concat(dt))}if(Be.tryConvertEncoding)try{dt=tt(dt)}catch{}}const lt=Ie?new URL(dt,Ie):new URL(dt);if(At(lt))return lt}catch{}return null}function ze(dt,Ie,Be,lt=!1){return Object.defineProperty(dt,Ie,{value:Be,enumerable:!lt,configurable:!0,writable:!1}),Be}const xe=function(){function Ie(Be,lt){this.constructor===Ie&>("Cannot initialize BaseException."),this.message=Be,this.name=lt}return Ie.prototype=new Error,Ie.constructor=Ie,Ie}();te.BaseException=xe;class Pe extends xe{constructor(Ie,Be){super(Ie,"PasswordException"),this.code=Be}}te.PasswordException=Pe;class Le extends xe{constructor(Ie,Be){super(Ie,"UnknownErrorException"),this.details=Be}}te.UnknownErrorException=Le;class Ve extends xe{constructor(Ie){super(Ie,"InvalidPDFException")}}te.InvalidPDFException=Ve;class We extends xe{constructor(Ie){super(Ie,"MissingPDFException")}}te.MissingPDFException=We;class Xe extends xe{constructor(Ie,Be){super(Ie,"UnexpectedResponseException"),this.status=Be}}te.UnexpectedResponseException=Xe;class Ne extends xe{constructor(Ie){super(Ie,"FormatError")}}te.FormatError=Ne;class je extends xe{constructor(Ie){super(Ie,"AbortException")}}te.AbortException=je;function Ue(dt){(typeof dt!="object"||(dt==null?void 0:dt.length)===void 0)&>("Invalid argument for bytesToString");const Ie=dt.length,Be=8192;if(Ie<Be)return String.fromCharCode.apply(null,dt);const lt=[];for(let mt=0;mt<Ie;mt+=Be){const Et=Math.min(mt+Be,Ie),xt=dt.subarray(mt,Et);lt.push(String.fromCharCode.apply(null,xt))}return lt.join("")}function pe(dt){typeof dt!="string"&>("Invalid argument for stringToBytes");const Ie=dt.length,Be=new Uint8Array(Ie);for(let lt=0;lt<Ie;++lt)Be[lt]=dt.charCodeAt(lt)&255;return Be}function Ae(dt){return String.fromCharCode(dt>>24&255,dt>>16&255,dt>>8&255,dt&255)}function Re(dt){return Object.keys(dt).length}function Me(dt){const Ie=Object.create(null);for(const[Be,lt]of dt)Ie[Be]=lt;return Ie}function Oe(){const dt=new Uint8Array(4);return dt[0]=1,new Uint32Array(dt.buffer,0,1)[0]===1}function Ge(){try{return new Function(""),!0}catch{return!1}}class rt{static get isLittleEndian(){return ze(this,"isLittleEndian",Oe())}static get isEvalSupported(){return ze(this,"isEvalSupported",Ge())}static get isOffscreenCanvasSupported(){return ze(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?ze(this,"platform",{isWin:!1,isMac:!1}):ze(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}}te.FeatureTest=rt;const Ze=[...Array(256).keys()].map(dt=>dt.toString(16).padStart(2,"0"));class ot{static makeHexColor(Ie,Be,lt){return"#".concat(Ze[Ie]).concat(Ze[Be]).concat(Ze[lt])}static scaleMinMax(Ie,Be){let lt;Ie[0]?(Ie[0]<0&&(lt=Be[0],Be[0]=Be[1],Be[1]=lt),Be[0]*=Ie[0],Be[1]*=Ie[0],Ie[3]<0&&(lt=Be[2],Be[2]=Be[3],Be[3]=lt),Be[2]*=Ie[3],Be[3]*=Ie[3]):(lt=Be[0],Be[0]=Be[2],Be[2]=lt,lt=Be[1],Be[1]=Be[3],Be[3]=lt,Ie[1]<0&&(lt=Be[2],Be[2]=Be[3],Be[3]=lt),Be[2]*=Ie[1],Be[3]*=Ie[1],Ie[2]<0&&(lt=Be[0],Be[0]=Be[1],Be[1]=lt),Be[0]*=Ie[2],Be[1]*=Ie[2]),Be[0]+=Ie[4],Be[1]+=Ie[4],Be[2]+=Ie[5],Be[3]+=Ie[5]}static transform(Ie,Be){return[Ie[0]*Be[0]+Ie[2]*Be[1],Ie[1]*Be[0]+Ie[3]*Be[1],Ie[0]*Be[2]+Ie[2]*Be[3],Ie[1]*Be[2]+Ie[3]*Be[3],Ie[0]*Be[4]+Ie[2]*Be[5]+Ie[4],Ie[1]*Be[4]+Ie[3]*Be[5]+Ie[5]]}static applyTransform(Ie,Be){const lt=Ie[0]*Be[0]+Ie[1]*Be[2]+Be[4],mt=Ie[0]*Be[1]+Ie[1]*Be[3]+Be[5];return[lt,mt]}static applyInverseTransform(Ie,Be){const lt=Be[0]*Be[3]-Be[1]*Be[2],mt=(Ie[0]*Be[3]-Ie[1]*Be[2]+Be[2]*Be[5]-Be[4]*Be[3])/lt,Et=(-Ie[0]*Be[1]+Ie[1]*Be[0]+Be[4]*Be[1]-Be[5]*Be[0])/lt;return[mt,Et]}static getAxialAlignedBoundingBox(Ie,Be){const lt=ot.applyTransform(Ie,Be),mt=ot.applyTransform(Ie.slice(2,4),Be),Et=ot.applyTransform([Ie[0],Ie[3]],Be),xt=ot.applyTransform([Ie[2],Ie[1]],Be);return[Math.min(lt[0],mt[0],Et[0],xt[0]),Math.min(lt[1],mt[1],Et[1],xt[1]),Math.max(lt[0],mt[0],Et[0],xt[0]),Math.max(lt[1],mt[1],Et[1],xt[1])]}static inverseTransform(Ie){const Be=Ie[0]*Ie[3]-Ie[1]*Ie[2];return[Ie[3]/Be,-Ie[1]/Be,-Ie[2]/Be,Ie[0]/Be,(Ie[2]*Ie[5]-Ie[4]*Ie[3])/Be,(Ie[4]*Ie[1]-Ie[5]*Ie[0])/Be]}static singularValueDecompose2dScale(Ie){const Be=[Ie[0],Ie[2],Ie[1],Ie[3]],lt=Ie[0]*Be[0]+Ie[1]*Be[2],mt=Ie[0]*Be[1]+Ie[1]*Be[3],Et=Ie[2]*Be[0]+Ie[3]*Be[2],xt=Ie[2]*Be[1]+Ie[3]*Be[3],$t=(lt+xt)/2,Pt=Math.sqrt((lt+xt)**2-4*(lt*xt-Et*mt))/2,kt=$t+Pt||1,Ct=$t-Pt||1;return[Math.sqrt(kt),Math.sqrt(Ct)]}static normalizeRect(Ie){const Be=Ie.slice(0);return Ie[0]>Ie[2]&&(Be[0]=Ie[2],Be[2]=Ie[0]),Ie[1]>Ie[3]&&(Be[1]=Ie[3],Be[3]=Ie[1]),Be}static intersect(Ie,Be){const lt=Math.max(Math.min(Ie[0],Ie[2]),Math.min(Be[0],Be[2])),mt=Math.min(Math.max(Ie[0],Ie[2]),Math.max(Be[0],Be[2]));if(lt>mt)return null;const Et=Math.max(Math.min(Ie[1],Ie[3]),Math.min(Be[1],Be[3])),xt=Math.min(Math.max(Ie[1],Ie[3]),Math.max(Be[1],Be[3]));return Et>xt?null:[lt,Et,mt,xt]}static bezierBoundingBox(Ie,Be,lt,mt,Et,xt,$t,Pt){const kt=[],Ct=[[],[]];let It,Mt,Ot,Ft,jt,Bt,Ut,Wt;for(let zt=0;zt<2;++zt){if(zt===0?(Mt=6*Ie-12*lt+6*Et,It=-3*Ie+9*lt-9*Et+3*$t,Ot=3*lt-3*Ie):(Mt=6*Be-12*mt+6*xt,It=-3*Be+9*mt-9*xt+3*Pt,Ot=3*mt-3*Be),Math.abs(It)<1e-12){if(Math.abs(Mt)<1e-12)continue;Ft=-Ot/Mt,0<Ft&&Ft<1&&kt.push(Ft);continue}Ut=Mt*Mt-4*Ot*It,Wt=Math.sqrt(Ut),!(Ut<0)&&(jt=(-Mt+Wt)/(2*It),0<jt&&jt<1&&kt.push(jt),Bt=(-Mt-Wt)/(2*It),0<Bt&&Bt<1&&kt.push(Bt))}let Dt=kt.length,Nt;const Vt=Dt;for(;Dt--;)Ft=kt[Dt],Nt=1-Ft,Ct[0][Dt]=Nt*Nt*Nt*Ie+3*Nt*Nt*Ft*lt+3*Nt*Ft*Ft*Et+Ft*Ft*Ft*$t,Ct[1][Dt]=Nt*Nt*Nt*Be+3*Nt*Nt*Ft*mt+3*Nt*Ft*Ft*xt+Ft*Ft*Ft*Pt;return Ct[0][Vt]=Ie,Ct[1][Vt]=Be,Ct[0][Vt+1]=$t,Ct[1][Vt+1]=Pt,Ct[0].length=Ct[1].length=Vt+2,[Math.min(...Ct[0]),Math.min(...Ct[1]),Math.max(...Ct[0]),Math.max(...Ct[1])]}}te.Util=ot;const at=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function nt(dt){if(dt[0]>="ï"){let Be;if(dt[0]==="þ"&&dt[1]==="ÿ"?Be="utf-16be":dt[0]==="ÿ"&&dt[1]==="þ"?Be="utf-16le":dt[0]==="ï"&&dt[1]==="»"&&dt[2]==="¿"&&(Be="utf-8"),Be)try{const lt=new TextDecoder(Be,{fatal:!0}),mt=pe(dt);return lt.decode(mt)}catch(lt){ct('stringToPDFString: "'.concat(lt,'".'))}}const Ie=[];for(let Be=0,lt=dt.length;Be<lt;Be++){const mt=at[dt.charCodeAt(Be)];Ie.push(mt?String.fromCharCode(mt):dt.charAt(Be))}return Ie.join("")}function tt(dt){return decodeURIComponent(escape(dt))}function ht(dt){return unescape(encodeURIComponent(dt))}function ft(dt){return typeof dt=="object"&&(dt==null?void 0:dt.byteLength)!==void 0}function wt(dt,Ie){if(dt.length!==Ie.length)return!1;for(let Be=0,lt=dt.length;Be<lt;Be++)if(dt[Be]!==Ie[Be])return!1;return!0}function St(dt=new Date){return[dt.getUTCFullYear().toString(),(dt.getUTCMonth()+1).toString().padStart(2,"0"),dt.getUTCDate().toString().padStart(2,"0"),dt.getUTCHours().toString().padStart(2,"0"),dt.getUTCMinutes().toString().padStart(2,"0"),dt.getUTCSeconds().toString().padStart(2,"0")].join("")}class Tt{constructor(){Qe(this,Rt,!1);this.promise=new Promise((Ie,Be)=>{this.resolve=lt=>{pt(this,Rt,!0),Ie(lt)},this.reject=lt=>{pt(this,Rt,!0),Be(lt)}})}get settled(){return Fe(this,Rt)}}Rt=new WeakMap,te.PromiseCapability=Tt;let Ye=null,_t=null;function bt(dt){return Ye||(Ye=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,_t=new Map([["ſt","ſt"]])),dt.replaceAll(Ye,(Ie,Be,lt)=>Be?Be.normalize("NFKC"):_t.get(lt))}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var ee,ne,re,ie,Yt,oe,Pn,he,fe,ae,le,ye,ve,de,ge,On,Te,$e,In,Ce,ce;Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_is_node=__w_pdfjs_require__(10),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_xfa_text=__w_pdfjs_require__(19);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory:we,NodeCMapReaderFactory:_e,NodeFilterFactory:Ee,NodeStandardFontDataFactory:De}=__w_pdfjs_require__(20);exports.DefaultCanvasFactory=DefaultCanvasFactory=we,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=_e,exports.DefaultFilterFactory=DefaultFilterFactory=Ee,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=De}let createPDFNetworkStream;if(_is_node.isNodeJS){const{PDFNodeStream:we}=__w_pdfjs_require__(21);createPDFNetworkStream=_e=>new we(_e)}else{const{PDFNetworkStream:we}=__w_pdfjs_require__(24),{PDFFetchStream:_e}=__w_pdfjs_require__(25);createPDFNetworkStream=Ee=>(0,_display_utils.isValidFetchUrl)(Ee.url)?new _e(Ee):new we(Ee)}function getDocument(we){var ft,wt;if(typeof we=="string"||we instanceof URL?we={url:we}:(0,_util.isArrayBuffer)(we)&&(we={data:we}),typeof we!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!we.url&&!we.data&&!we.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const _e=new PDFDocumentLoadingTask,{docId:Ee}=_e,De=we.url?getUrlProp(we.url):null,Se=we.data?getDataProp(we.data):null,He=we.httpHeaders||null,qe=we.withCredentials===!0,Ke=(ft=we.password)!=null?ft:null,Je=we.range instanceof PDFDataRangeTransport?we.range:null,et=Number.isInteger(we.rangeChunkSize)&&we.rangeChunkSize>0?we.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let ut=we.worker instanceof PDFWorker?we.worker:null;const st=we.verbosity,ct=typeof we.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(we.docBaseUrl)?we.docBaseUrl:null,gt=typeof we.cMapUrl=="string"?we.cMapUrl:null,vt=we.cMapPacked!==!1,At=we.CMapReaderFactory||DefaultCMapReaderFactory,yt=typeof we.standardFontDataUrl=="string"?we.standardFontDataUrl:null,ze=we.StandardFontDataFactory||DefaultStandardFontDataFactory,xe=we.stopAtErrors!==!0,Pe=Number.isInteger(we.maxImageSize)&&we.maxImageSize>-1?we.maxImageSize:-1,Le=we.isEvalSupported!==!1,Ve=typeof we.isOffscreenCanvasSupported=="boolean"?we.isOffscreenCanvasSupported:!_is_node.isNodeJS,We=Number.isInteger(we.canvasMaxAreaInBytes)?we.canvasMaxAreaInBytes:-1,Xe=typeof we.disableFontFace=="boolean"?we.disableFontFace:_is_node.isNodeJS,Ne=we.fontExtraProperties===!0,je=we.enableXfa===!0,Ue=we.ownerDocument||globalThis.document,pe=we.disableRange===!0,Ae=we.disableStream===!0,Re=we.disableAutoFetch===!0,Me=we.pdfBug===!0,Oe=Je?Je.length:(wt=we.length)!=null?wt:NaN,Ge=typeof we.useSystemFonts=="boolean"?we.useSystemFonts:!_is_node.isNodeJS&&!Xe,rt=typeof we.useWorkerFetch=="boolean"?we.useWorkerFetch:At===_display_utils.DOMCMapReaderFactory&&ze===_display_utils.DOMStandardFontDataFactory&&(0,_display_utils.isValidFetchUrl)(gt,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(yt,document.baseURI),Ze=we.canvasFactory||new DefaultCanvasFactory({ownerDocument:Ue}),ot=we.filterFactory||new DefaultFilterFactory({docId:Ee,ownerDocument:Ue}),at=null;(0,_util.setVerbosityLevel)(st);const nt={canvasFactory:Ze,filterFactory:ot};if(rt||(nt.cMapReaderFactory=new At({baseUrl:gt,isCompressed:vt}),nt.standardFontDataFactory=new ze({baseUrl:yt})),!ut){const St={verbosity:st,port:_worker_options.GlobalWorkerOptions.workerPort};ut=St.port?PDFWorker.fromPort(St):new PDFWorker(St),_e._worker=ut}const tt={docId:Ee,apiVersion:"3.6.172",data:Se,password:Ke,disableAutoFetch:Re,rangeChunkSize:et,length:Oe,docBaseUrl:ct,enableXfa:je,evaluatorOptions:{maxImageSize:Pe,disableFontFace:Xe,ignoreErrors:xe,isEvalSupported:Le,isOffscreenCanvasSupported:Ve,canvasMaxAreaInBytes:We,fontExtraProperties:Ne,useSystemFonts:Ge,cMapUrl:rt?gt:null,standardFontDataUrl:rt?yt:null}},ht={ignoreErrors:xe,isEvalSupported:Le,disableFontFace:Xe,fontExtraProperties:Ne,enableXfa:je,ownerDocument:Ue,disableAutoFetch:Re,pdfBug:Me,styleElement:at};return ut.promise.then(function(){if(_e.destroyed)throw new Error("Loading aborted");const St=_fetchDocument(ut,tt),Tt=new Promise(function(Ye){let _t;Je?_t=new _transport_stream.PDFDataTransportStream({length:Oe,initialData:Je.initialData,progressiveDone:Je.progressiveDone,contentDispositionFilename:Je.contentDispositionFilename,disableRange:pe,disableStream:Ae},Je):Se||(_t=createPDFNetworkStream({url:De,length:Oe,httpHeaders:He,withCredentials:qe,rangeChunkSize:et,disableRange:pe,disableStream:Ae})),Ye(_t)});return Promise.all([St,Tt]).then(function([Ye,_t]){if(_e.destroyed)throw new Error("Loading aborted");const bt=new _message_handler.MessageHandler(Ee,Ye,ut.port),Rt=new WorkerTransport(bt,_e,_t,ht,nt);_e._transport=Rt,bt.send("Ready",null)})}).catch(_e._capability.reject),_e}async function _fetchDocument(we,_e){if(we.destroyed)throw new Error("Worker was destroyed");const Ee=await we.messageHandler.sendWithPromise("GetDocRequest",_e,_e.data?[_e.data.buffer]:null);if(we.destroyed)throw new Error("Worker was destroyed");return Ee}function getUrlProp(we){if(we instanceof URL)return we.href;try{return new URL(we,window.location).href}catch{if(_is_node.isNodeJS&&typeof we=="string")return we}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(we){if(_is_node.isNodeJS&&typeof Buffer<"u"&&we instanceof Buffer)return(0,_display_utils.deprecated)("Please provide binary data as `Uint8Array`, rather than `Buffer`."),new Uint8Array(we);if(we instanceof Uint8Array&&we.byteLength===we.buffer.byteLength)return we;if(typeof we=="string")return(0,_util.stringToBytes)(we);if(typeof we=="object"&&!isNaN(we==null?void 0:we.length)||(0,_util.isArrayBuffer)(we))return new Uint8Array(we);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const te=class te{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat(xn(te,ee)._++),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var _e;this.destroyed=!0,await((_e=this._transport)==null?void 0:_e.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};ee=new WeakMap,Qe(te,ee,0);let PDFDocumentLoadingTask=te;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(_e,Ee,De=!1,Se=null){this.length=_e,this.initialData=Ee,this.progressiveDone=De,this.contentDispositionFilename=Se,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(_e){this._rangeListeners.push(_e)}addProgressListener(_e){this._progressListeners.push(_e)}addProgressiveReadListener(_e){this._progressiveReadListeners.push(_e)}addProgressiveDoneListener(_e){this._progressiveDoneListeners.push(_e)}onDataRange(_e,Ee){for(const De of this._rangeListeners)De(_e,Ee)}onDataProgress(_e,Ee){this._readyCapability.promise.then(()=>{for(const De of this._progressListeners)De(_e,Ee)})}onDataProgressiveRead(_e){this._readyCapability.promise.then(()=>{for(const Ee of this._progressiveReadListeners)Ee(_e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const _e of this._progressiveDoneListeners)_e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(_e,Ee){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(_e,Ee){this._pdfInfo=_e,this._transport=Ee}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(_e){return this._transport.getPage(_e)}getPageIndex(_e){return this._transport.getPageIndex(_e)}getDestinations(){return this._transport.getDestinations()}getDestination(_e){return this._transport.getDestination(_e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(_e=!1){return this._transport.startCleanup(_e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(_e,Ee,De,Se=!1){Qe(this,ie);Qe(this,oe);Qe(this,ne,null);Qe(this,re,!1);this._pageIndex=_e,this._pageInfo=Ee,this._transport=De,this._stats=Se?new _display_utils.StatTimer:null,this._pdfBug=Se,this.commonObjs=De.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:_e,rotation:Ee=this.rotate,offsetX:De=0,offsetY:Se=0,dontFlip:He=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:_e,rotation:Ee,offsetX:De,offsetY:Se,dontFlip:He})}getAnnotations({intent:_e="display"}={}){const Ee=this._transport.getRenderingIntent(_e);return this._transport.getAnnotations(this._pageIndex,Ee.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var _e;return((_e=this._transport._htmlForXfa)==null?void 0:_e.children[this._pageIndex])||null}render({canvasContext:_e,viewport:Ee,intent:De="display",annotationMode:Se=_util.AnnotationMode.ENABLE,transform:He=null,background:qe=null,optionalContentConfigPromise:Ke=null,annotationCanvasMap:Je=null,pageColors:et=null,printAnnotationStorage:ut=null}){var ze,xe,Pe;if((ze=arguments[0])!=null&&ze.canvasFactory)throw new Error("render no longer accepts the `canvasFactory`-option, please pass it to the `getDocument`-function instead.");(xe=this._stats)==null||xe.time("Overall");const st=this._transport.getRenderingIntent(De,Se,ut);pt(this,re,!1),it(this,oe,Pn).call(this),Ke||(Ke=this._transport.getOptionalContentConfig());let ct=this._intentStates.get(st.cacheKey);ct||(ct=Object.create(null),this._intentStates.set(st.cacheKey,ct)),ct.streamReaderCancelTimeout&&(clearTimeout(ct.streamReaderCancelTimeout),ct.streamReaderCancelTimeout=null);const gt=!!(st.renderingIntent&_util.RenderingIntentFlag.PRINT);ct.displayReadyCapability||(ct.displayReadyCapability=new _util.PromiseCapability,ct.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Pe=this._stats)==null||Pe.time("Page Request"),this._pumpOperatorList(st));const vt=Le=>{var Ve,We;ct.renderTasks.delete(At),(this._maybeCleanupAfterRender||gt)&&pt(this,re,!0),it(this,ie,Yt).call(this,!gt),Le?(At.capability.reject(Le),this._abortOperatorList({intentState:ct,reason:Le instanceof Error?Le:new Error(Le)})):At.capability.resolve(),(Ve=this._stats)==null||Ve.timeEnd("Rendering"),(We=this._stats)==null||We.timeEnd("Overall")},At=new InternalRenderTask({callback:vt,params:{canvasContext:_e,viewport:Ee,transform:He,background:qe},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Je,operatorList:ct.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!gt,pdfBug:this._pdfBug,pageColors:et});(ct.renderTasks||(ct.renderTasks=new Set)).add(At);const yt=At.task;return Promise.all([ct.displayReadyCapability.promise,Ke]).then(([Le,Ve])=>{var We;if(Fe(this,re)){vt();return}(We=this._stats)==null||We.time("Rendering"),At.initializeGraphics({transparency:Le,optionalContentConfig:Ve}),At.operatorListChanged()}).catch(vt),yt}getOperatorList({intent:_e="display",annotationMode:Ee=_util.AnnotationMode.ENABLE,printAnnotationStorage:De=null}={}){var Je;function Se(){qe.operatorList.lastChunk&&(qe.opListReadCapability.resolve(qe.operatorList),qe.renderTasks.delete(Ke))}const He=this._transport.getRenderingIntent(_e,Ee,De,!0);let qe=this._intentStates.get(He.cacheKey);qe||(qe=Object.create(null),this._intentStates.set(He.cacheKey,qe));let Ke;return qe.opListReadCapability||(Ke=Object.create(null),Ke.operatorListChanged=Se,qe.opListReadCapability=new _util.PromiseCapability,(qe.renderTasks||(qe.renderTasks=new Set)).add(Ke),qe.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Je=this._stats)==null||Je.time("Page Request"),this._pumpOperatorList(He)),qe.opListReadCapability.promise}streamTextContent({includeMarkedContent:_e=!1,disableNormalization:Ee=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:_e===!0,disableNormalization:Ee===!0},{highWaterMark:100,size(Se){return Se.items.length}})}getTextContent(_e={}){if(this._transport._htmlForXfa)return this.getXfa().then(De=>_xfa_text.XfaText.textContent(De));const Ee=this.streamTextContent(_e);return new Promise(function(De,Se){function He(){qe.read().then(function({value:Je,done:et}){if(et){De(Ke);return}Object.assign(Ke.styles,Je.styles),Ke.items.push(...Je.items),He()},Se)}const qe=Ee.getReader(),Ke={items:[],styles:Object.create(null)};He()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const _e=[];for(const Ee of this._intentStates.values())if(this._abortOperatorList({intentState:Ee,reason:new Error("Page was destroyed."),force:!0}),!Ee.opListReadCapability)for(const De of Ee.renderTasks)_e.push(De.completed),De.cancel();return this.objs.clear(),pt(this,re,!1),it(this,oe,Pn).call(this),Promise.all(_e)}cleanup(_e=!1){pt(this,re,!0);const Ee=it(this,ie,Yt).call(this,!1);return _e&&Ee&&this._stats&&(this._stats=new _display_utils.StatTimer),Ee}_startRenderPage(_e,Ee){var Se,He;const De=this._intentStates.get(Ee);De&&((Se=this._stats)==null||Se.timeEnd("Page Request"),(He=De.displayReadyCapability)==null||He.resolve(_e))}_renderPageChunk(_e,Ee){for(let De=0,Se=_e.length;De<Se;De++)Ee.operatorList.fnArray.push(_e.fnArray[De]),Ee.operatorList.argsArray.push(_e.argsArray[De]);Ee.operatorList.lastChunk=_e.lastChunk,Ee.operatorList.separateAnnots=_e.separateAnnots;for(const De of Ee.renderTasks)De.operatorListChanged();_e.lastChunk&&it(this,ie,Yt).call(this,!0)}_pumpOperatorList({renderingIntent:_e,cacheKey:Ee,annotationStorageMap:De}){const He=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:_e,cacheKey:Ee,annotationStorage:De}).getReader(),qe=this._intentStates.get(Ee);qe.streamReader=He;const Ke=()=>{He.read().then(({value:Je,done:et})=>{if(et){qe.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Je,qe),Ke())},Je=>{if(qe.streamReader=null,!this._transport.destroyed){if(qe.operatorList){qe.operatorList.lastChunk=!0;for(const et of qe.renderTasks)et.operatorListChanged();it(this,ie,Yt).call(this,!0)}if(qe.displayReadyCapability)qe.displayReadyCapability.reject(Je);else if(qe.opListReadCapability)qe.opListReadCapability.reject(Je);else throw Je}})};Ke()}_abortOperatorList({intentState:_e,reason:Ee,force:De=!1}){if(_e.streamReader){if(_e.streamReaderCancelTimeout&&(clearTimeout(_e.streamReaderCancelTimeout),_e.streamReaderCancelTimeout=null),!De){if(_e.renderTasks.size>0)return;if(Ee instanceof _display_utils.RenderingCancelledException){let Se=RENDERING_CANCELLED_TIMEOUT;Ee.extraDelay>0&&Ee.extraDelay<1e3&&(Se+=Ee.extraDelay),_e.streamReaderCancelTimeout=setTimeout(()=>{_e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:_e,reason:Ee,force:!0})},Se);return}}if(_e.streamReader.cancel(new _util.AbortException(Ee.message)).catch(()=>{}),_e.streamReader=null,!this._transport.destroyed){for(const[Se,He]of this._intentStates)if(He===_e){this._intentStates.delete(Se);break}this.cleanup()}}}get stats(){return this._stats}}ne=new WeakMap,re=new WeakMap,ie=new WeakSet,Yt=function(_e=!1){if(it(this,oe,Pn).call(this),!Fe(this,re))return!1;if(_e)return pt(this,ne,setTimeout(()=>{pt(this,ne,null),it(this,ie,Yt).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Ee,operatorList:De}of this._intentStates.values())if(Ee.size>0||!De.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),pt(this,re,!1),!0},oe=new WeakSet,Pn=function(){Fe(this,ne)&&(clearTimeout(Fe(this,ne)),pt(this,ne,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){Qe(this,he,new Set);Qe(this,fe,Promise.resolve())}postMessage(_e,Ee){const De={data:structuredClone(_e,Ee?{transfer:Ee}:null)};Fe(this,fe).then(()=>{for(const Se of Fe(this,he))Se.call(this,De)})}addEventListener(_e,Ee){Fe(this,he).add(Ee)}removeEventListener(_e,Ee){Fe(this,he).delete(Ee)}terminate(){Fe(this,he).clear()}}he=new WeakMap,fe=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_is_node.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const we=(ae=document==null?void 0:document.currentScript)==null?void 0:ae.src;we&&(PDFWorkerUtil.fallbackWorkerSrc=we.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(we,_e){let Ee;try{if(Ee=new URL(we),!Ee.origin||Ee.origin==="null")return!1}catch{return!1}const De=new URL(_e,Ee);return Ee.origin===De.origin},PDFWorkerUtil.createCDNWrapper=function(we){const _e='importScripts("'.concat(we,'");');return URL.createObjectURL(new Blob([_e]))}}const _PDFWorker=class _PDFWorker{constructor({name:we=null,port:_e=null,verbosity:Ee=(0,_util.getVerbosityLevel)()}={}){if(_e&&Fe(_PDFWorker,le).has(_e))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=we,this.destroyed=!1,this.verbosity=Ee,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,_e){Fe(_PDFWorker,le).set(_e,this),this._initializeFromPort(_e);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(we){this._port=we,this._messageHandler=new _message_handler.MessageHandler("main","worker",we),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:we}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,we)||(we=PDFWorkerUtil.createCDNWrapper(new URL(we,window.location).href));const _e=new Worker(we),Ee=new _message_handler.MessageHandler("main","worker",_e),De=()=>{_e.removeEventListener("error",Se),Ee.destroy(),_e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},Se=()=>{this._webWorker||De()};_e.addEventListener("error",Se),Ee.on("test",qe=>{if(_e.removeEventListener("error",Se),this.destroyed){De();return}qe?(this._messageHandler=Ee,this._port=_e,this._webWorker=_e,this._readyCapability.resolve(),Ee.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Ee.destroy(),_e.terminate())}),Ee.on("ready",qe=>{if(_e.removeEventListener("error",Se),this.destroyed){De();return}try{He()}catch{this._setupFakeWorker()}});const He=()=>{const qe=new Uint8Array;Ee.send("test",qe,[qe.buffer])};He();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(we=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const _e=new LoopbackPort;this._port=_e;const Ee="fake".concat(PDFWorkerUtil.fakeWorkerId++),De=new _message_handler.MessageHandler(Ee+"_worker",Ee,_e);we.setup(De,_e);const Se=new _message_handler.MessageHandler(Ee,Ee+"_worker",_e);this._messageHandler=Se,this._readyCapability.resolve(),Se.send("configure",{verbosity:this.verbosity})}).catch(we=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(we.message,'".')))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),Fe(_PDFWorker,le).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(we){if(!(we!=null&&we.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Fe(this,le).has(we.port)?Fe(this,le).get(we.port):new _PDFWorker(we)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var we;try{return((we=globalThis.pdfjsWorker)==null?void 0:we.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};le=new WeakMap,Qe(_PDFWorker,le,new WeakMap);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(_e,Ee,De,Se,He){Qe(this,ge);Qe(this,ye,new Map);Qe(this,ve,new Map);Qe(this,de,new Map);this.messageHandler=_e,this.loadingTask=Ee,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:Se.ownerDocument,styleElement:Se.styleElement}),this._params=Se,this.canvasFactory=He.canvasFactory,this.filterFactory=He.filterFactory,this.cMapReaderFactory=He.cMapReaderFactory,this.standardFontDataFactory=He.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=De,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(_e,Ee=_util.AnnotationMode.ENABLE,De=null,Se=!1){let He=_util.RenderingIntentFlag.DISPLAY,qe=null;switch(_e){case"any":He=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":He=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(_e))}switch(Ee){case _util.AnnotationMode.DISABLE:He+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:He+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:He+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,qe=(He&_util.RenderingIntentFlag.PRINT&&De instanceof _annotation_storage.PrintAnnotationStorage?De:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(Ee))}return Se&&(He+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:He,cacheKey:"".concat(He,"_").concat(_annotation_storage.AnnotationStorage.getHash(qe)),annotationStorageMap:qe}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const _e=[];for(const De of Fe(this,ve).values())_e.push(De._destroy());Fe(this,ve).clear(),Fe(this,de).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Ee=this.messageHandler.sendWithPromise("Terminate",null);return _e.push(Ee),Promise.all(_e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),Fe(this,ye).clear(),this.filterFactory.destroy(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:_e,loadingTask:Ee}=this;_e.on("GetReader",(De,Se)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=He=>{this._lastProgress={loaded:He.loaded,total:He.total}},Se.onPull=()=>{this._fullReader.read().then(function({value:He,done:qe}){if(qe){Se.close();return}(0,_util.assert)(He instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),Se.enqueue(new Uint8Array(He),1,[He])}).catch(He=>{Se.error(He)})},Se.onCancel=He=>{this._fullReader.cancel(He),Se.ready.catch(qe=>{if(!this.destroyed)throw qe})}}),_e.on("ReaderHeadersReady",De=>{const Se=new _util.PromiseCapability,He=this._fullReader;return He.headersReady.then(()=>{var qe;(!He.isStreamingSupported||!He.isRangeSupported)&&(this._lastProgress&&((qe=Ee.onProgress)==null||qe.call(Ee,this._lastProgress)),He.onProgress=Ke=>{var Je;(Je=Ee.onProgress)==null||Je.call(Ee,{loaded:Ke.loaded,total:Ke.total})}),Se.resolve({isStreamingSupported:He.isStreamingSupported,isRangeSupported:He.isRangeSupported,contentLength:He.contentLength})},Se.reject),Se.promise}),_e.on("GetRangeReader",(De,Se)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const He=this._networkStream.getRangeReader(De.begin,De.end);if(!He){Se.close();return}Se.onPull=()=>{He.read().then(function({value:qe,done:Ke}){if(Ke){Se.close();return}(0,_util.assert)(qe instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),Se.enqueue(new Uint8Array(qe),1,[qe])}).catch(qe=>{Se.error(qe)})},Se.onCancel=qe=>{He.cancel(qe),Se.ready.catch(Ke=>{if(!this.destroyed)throw Ke})}}),_e.on("GetDoc",({pdfInfo:De})=>{this._numPages=De.numPages,this._htmlForXfa=De.htmlForXfa,delete De.htmlForXfa,Ee._capability.resolve(new PDFDocumentProxy(De,this))}),_e.on("DocException",function(De){let Se;switch(De.name){case"PasswordException":Se=new _util.PasswordException(De.message,De.code);break;case"InvalidPDFException":Se=new _util.InvalidPDFException(De.message);break;case"MissingPDFException":Se=new _util.MissingPDFException(De.message);break;case"UnexpectedResponseException":Se=new _util.UnexpectedResponseException(De.message,De.status);break;case"UnknownErrorException":Se=new _util.UnknownErrorException(De.message,De.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Ee._capability.reject(Se)}),_e.on("PasswordRequest",De=>{if(this._passwordCapability=new _util.PromiseCapability,Ee.onPassword){const Se=He=>{He instanceof Error?this._passwordCapability.reject(He):this._passwordCapability.resolve({password:He})};try{Ee.onPassword(Se,De.code)}catch(He){this._passwordCapability.reject(He)}}else this._passwordCapability.reject(new _util.PasswordException(De.message,De.code));return this._passwordCapability.promise}),_e.on("DataLoaded",De=>{var Se;(Se=Ee.onProgress)==null||Se.call(Ee,{loaded:De.length,total:De.length}),this.downloadInfoCapability.resolve(De)}),_e.on("StartRenderPage",De=>{if(this.destroyed)return;Fe(this,ve).get(De.pageIndex)._startRenderPage(De.transparency,De.cacheKey)}),_e.on("commonobj",([De,Se,He])=>{var qe;if(!this.destroyed&&!this.commonObjs.has(De))switch(Se){case"Font":const Ke=this._params;if("error"in He){const ut=He.error;(0,_util.warn)("Error during font loading: ".concat(ut)),this.commonObjs.resolve(De,ut);break}const Je=Ke.pdfBug&&((qe=globalThis.FontInspector)!=null&&qe.enabled)?(ut,st)=>globalThis.FontInspector.fontAdded(ut,st):null,et=new _font_loader.FontFaceObject(He,{isEvalSupported:Ke.isEvalSupported,disableFontFace:Ke.disableFontFace,ignoreErrors:Ke.ignoreErrors,inspectFont:Je});this.fontLoader.bind(et).catch(ut=>_e.sendWithPromise("FontFallback",{id:De})).finally(()=>{!Ke.fontExtraProperties&&et.data&&(et.data=null),this.commonObjs.resolve(De,et)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(De,He);break;default:throw new Error("Got unknown common object type ".concat(Se))}}),_e.on("obj",([De,Se,He,qe])=>{var Je;if(this.destroyed)return;const Ke=Fe(this,ve).get(Se);if(!Ke.objs.has(De))switch(He){case"Image":if(Ke.objs.resolve(De,qe),qe){let et;if(qe.bitmap){const{width:ut,height:st}=qe;et=ut*st*4}else et=((Je=qe.data)==null?void 0:Je.length)||0;et>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Ke._maybeCleanupAfterRender=!0)}break;case"Pattern":Ke.objs.resolve(De,qe);break;default:throw new Error("Got unknown object type ".concat(He))}}),_e.on("DocProgress",De=>{var Se;this.destroyed||(Se=Ee.onProgress)==null||Se.call(Ee,{loaded:De.loaded,total:De.total})}),_e.on("FetchBuiltInCMap",De=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(De):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),_e.on("FetchStandardFontData",De=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(De):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var _e,Ee;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(Ee=(_e=this._fullReader)==null?void 0:_e.filename)!=null?Ee:null}).finally(()=>{this.annotationStorage.resetModified()})}getPage(_e){if(!Number.isInteger(_e)||_e<=0||_e>this._numPages)return Promise.reject(new Error("Invalid page request."));const Ee=_e-1,De=Fe(this,de).get(Ee);if(De)return De;const Se=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Ee}).then(He=>{if(this.destroyed)throw new Error("Transport destroyed");const qe=new PDFPageProxy(Ee,He,this,this._params.pdfBug);return Fe(this,ve).set(Ee,qe),qe});return Fe(this,de).set(Ee,Se),Se}getPageIndex(_e){return typeof _e!="object"||_e===null||!Number.isInteger(_e.num)||_e.num<0||!Number.isInteger(_e.gen)||_e.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:_e.num,gen:_e.gen})}getAnnotations(_e,Ee){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:_e,intent:Ee})}getFieldObjects(){return it(this,ge,On).call(this,"GetFieldObjects")}hasJSActions(){return it(this,ge,On).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(_e){return typeof _e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:_e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(_e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:_e})}getStructTree(_e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:_e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(_e=>new _optional_content_config.OptionalContentConfig(_e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const _e="GetMetadata",Ee=Fe(this,ye).get(_e);if(Ee)return Ee;const De=this.messageHandler.sendWithPromise(_e,null).then(Se=>{var He,qe,Ke,Je;return{info:Se[0],metadata:Se[1]?new _metadata.Metadata(Se[1]):null,contentDispositionFilename:(qe=(He=this._fullReader)==null?void 0:He.filename)!=null?qe:null,contentLength:(Je=(Ke=this._fullReader)==null?void 0:Ke.contentLength)!=null?Je:null}});return Fe(this,ye).set(_e,De),De}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(_e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Ee of Fe(this,ve).values())if(!Ee.cleanup())throw new Error("startCleanup: Page ".concat(Ee.pageNumber," is currently rendering."));this.commonObjs.clear(),_e||this.fontLoader.clear(),Fe(this,ye).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:_e,enableXfa:Ee}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:_e,enableXfa:Ee})}}ye=new WeakMap,ve=new WeakMap,de=new WeakMap,ge=new WeakSet,On=function(_e,Ee=null){const De=Fe(this,ye).get(_e);if(De)return De;const Se=this.messageHandler.sendWithPromise(_e,Ee);return Fe(this,ye).set(_e,Se),Se};class PDFObjects{constructor(){Qe(this,$e);Qe(this,Te,Object.create(null))}get(_e,Ee=null){if(Ee){const Se=it(this,$e,In).call(this,_e);return Se.capability.promise.then(()=>Ee(Se.data)),null}const De=Fe(this,Te)[_e];if(!(De!=null&&De.capability.settled))throw new Error("Requesting object that isn't resolved yet ".concat(_e,"."));return De.data}has(_e){const Ee=Fe(this,Te)[_e];return(Ee==null?void 0:Ee.capability.settled)||!1}resolve(_e,Ee=null){const De=it(this,$e,In).call(this,_e);De.data=Ee,De.capability.resolve()}clear(){var _e;for(const Ee in Fe(this,Te)){const{data:De}=Fe(this,Te)[Ee];(_e=De==null?void 0:De.bitmap)==null||_e.close()}pt(this,Te,Object.create(null))}}Te=new WeakMap,$e=new WeakSet,In=function(_e){const Ee=Fe(this,Te)[_e];return Ee||(Fe(this,Te)[_e]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(_e){Qe(this,Ce,null);pt(this,Ce,_e),this.onContinue=null}get promise(){return Fe(this,Ce).capability.promise}cancel(_e=0){Fe(this,Ce).cancel(null,_e)}get separateAnnots(){const{separateAnnots:_e}=Fe(this,Ce).operatorList;if(!_e)return!1;const{annotationCanvasMap:Ee}=Fe(this,Ce);return _e.form||_e.canvas&&(Ee==null?void 0:Ee.size)>0}}Ce=new WeakMap,exports.RenderTask=RenderTask;const be=class be{constructor({callback:_e,params:Ee,objs:De,commonObjs:Se,annotationCanvasMap:He,operatorList:qe,pageIndex:Ke,canvasFactory:Je,filterFactory:et,useRequestAnimationFrame:ut=!1,pdfBug:st=!1,pageColors:ct=null}){this.callback=_e,this.params=Ee,this.objs=De,this.commonObjs=Se,this.annotationCanvasMap=He,this.operatorListIdx=null,this.operatorList=qe,this._pageIndex=Ke,this.canvasFactory=Je,this.filterFactory=et,this._pdfBug=st,this.pageColors=ct,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=ut===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Ee.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:_e=!1,optionalContentConfig:Ee}){var Ke,Je;if(this.cancelled)return;if(this._canvas){if(Fe(be,ce).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Fe(be,ce).add(this._canvas)}this._pdfBug&&((Ke=globalThis.StepperManager)!=null&&Ke.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:De,viewport:Se,transform:He,background:qe}=this.params;this.gfx=new _canvas.CanvasGraphics(De,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Ee},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:He,viewport:Se,transparency:_e,background:qe}),this.operatorListIdx=0,this.graphicsReady=!0,(Je=this.graphicsReadyCallback)==null||Je.call(this)}cancel(_e=null,Ee=0){var De;this.running=!1,this.cancelled=!0,(De=this.gfx)==null||De.endDrawing(),this._canvas&&Fe(be,ce).delete(this._canvas),this.callback(_e||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas",Ee))}operatorListChanged(){var _e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(_e=this.stepper)==null||_e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(this.pageColors),this._canvas&&Fe(be,ce).delete(this._canvas),this.callback())))}};ce=new WeakMap,Qe(be,ce,new WeakSet);let InternalRenderTask=be;const version="3.6.172";exports.version=version;const build="4d3dfe254";exports.build=build},(ee,te,ne)=>{var he,fe,ae,rr,ye;Object.defineProperty(te,"__esModule",{value:!0}),te.PrintAnnotationStorage=te.AnnotationStorage=void 0;var re=ne(1),ie=ne(4),se=ne(8);class oe{constructor(){Qe(this,ae);Qe(this,he,!1);Qe(this,fe,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(de,ge){const ue=Fe(this,fe).get(de);return ue===void 0?ge:Object.assign(ge,ue)}getRawValue(de){return Fe(this,fe).get(de)}remove(de){if(Fe(this,fe).delete(de),Fe(this,fe).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const ge of Fe(this,fe).values())if(ge instanceof ie.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(de,ge){const ue=Fe(this,fe).get(de);let Te=!1;if(ue!==void 0)for(const[$e,ke]of Object.entries(ge))ue[$e]!==ke&&(Te=!0,ue[$e]=ke);else Te=!0,Fe(this,fe).set(de,ge);Te&&it(this,ae,rr).call(this),ge instanceof ie.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(ge.constructor._type)}has(de){return Fe(this,fe).has(de)}getAll(){return Fe(this,fe).size>0?(0,re.objectFromMap)(Fe(this,fe)):null}setAll(de){for(const[ge,ue]of Object.entries(de))this.setValue(ge,ue)}get size(){return Fe(this,fe).size}resetModified(){Fe(this,he)&&(pt(this,he,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new me(this)}get serializable(){if(Fe(this,fe).size===0)return null;const de=new Map;for(const[ge,ue]of Fe(this,fe)){const Te=ue instanceof ie.AnnotationEditor?ue.serialize():ue;Te&&de.set(ge,Te)}return de}static getHash(de){if(!de)return"";const ge=new se.MurmurHash3_64;for(const[ue,Te]of de)ge.update("".concat(ue,":").concat(JSON.stringify(Te)));return ge.hexdigest()}}he=new WeakMap,fe=new WeakMap,ae=new WeakSet,rr=function(){Fe(this,he)||(pt(this,he,!0),typeof this.onSetModified=="function"&&this.onSetModified())},te.AnnotationStorage=oe;class me extends oe{constructor(ge){super();Qe(this,ye,null);pt(this,ye,structuredClone(ge.serializable))}get print(){(0,re.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return Fe(this,ye)}}ye=new WeakMap,te.PrintAnnotationStorage=me},(ee,te,ne)=>{var oe,me,he,fe,ae,le;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditor=void 0;var re=ne(5),ie=ne(1);const ye=class ye{constructor(de){Qe(this,oe,this.focusin.bind(this));Qe(this,me,this.focusout.bind(this));Qe(this,he,!1);Qe(this,fe,!1);Qe(this,ae,!1);Lt(this,"_uiManager",null);Qe(this,le,ye._zIndex++);this.constructor===ye&&(0,ie.unreachable)("Cannot initialize AnnotationEditor."),this.parent=de.parent,this.id=de.id,this.width=this.height=null,this.pageIndex=de.parent.pageIndex,this.name=de.name,this.div=null,this._uiManager=de.uiManager;const{rotation:ge,rawDims:{pageWidth:ue,pageHeight:Te,pageX:$e,pageY:ke}}=this.parent.viewport;this.rotation=ge,this.pageRotation=(360+ge-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[ue,Te],this.pageTranslation=[$e,ke];const[Ce,ce]=this.parentDimensions;this.x=de.x/Ce,this.y=de.y/ce,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,ie.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}addCommands(de){this._uiManager.addCommands(de)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Fe(this,le)}setParent(de){de!==null&&(this.pageIndex=de.pageIndex,this.pageDimensions=de.pageDimensions),this.parent=de}focusin(de){Fe(this,he)?pt(this,he,!1):this.parent.setSelected(this)}focusout(de){var ue;if(!this.isAttachedToDOM)return;const ge=de.relatedTarget;ge!=null&&ge.closest("#".concat(this.id))||(de.preventDefault(),(ue=this.parent)!=null&&ue.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}dragstart(de){const ge=this.parent.div.getBoundingClientRect();this.startX=de.clientX-ge.x,this.startY=de.clientY-ge.y,de.dataTransfer.setData("text/plain",this.id),de.dataTransfer.effectAllowed="move"}setAt(de,ge,ue,Te){const[$e,ke]=this.parentDimensions;[ue,Te]=this.screenToPageTranslation(ue,Te),this.x=(de+ue)/$e,this.y=(ge+Te)/ke,this.div.style.left="".concat(100*this.x,"%"),this.div.style.top="".concat(100*this.y,"%")}translate(de,ge){const[ue,Te]=this.parentDimensions;[de,ge]=this.screenToPageTranslation(de,ge),this.x+=de/ue,this.y+=ge/Te,this.div.style.left="".concat(100*this.x,"%"),this.div.style.top="".concat(100*this.y,"%")}screenToPageTranslation(de,ge){switch(this.parentRotation){case 90:return[ge,-de];case 180:return[-de,-ge];case 270:return[-ge,de];default:return[de,ge]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{realScale:de}=this._uiManager.viewParameters,[ge,ue]=this.pageDimensions;return[ge*de,ue*de]}setDims(de,ge){const[ue,Te]=this.parentDimensions;this.div.style.width="".concat(100*de/ue,"%"),this.div.style.height="".concat(100*ge/Te,"%")}fixDims(){const{style:de}=this.div,{height:ge,width:ue}=de,Te=ue.endsWith("%"),$e=ge.endsWith("%");if(Te&&$e)return;const[ke,Ce]=this.parentDimensions;Te||(de.width="".concat(100*parseFloat(ue)/ke,"%")),$e||(de.height="".concat(100*parseFloat(ge)/Ce,"%"))}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",Fe(this,oe)),this.div.addEventListener("focusout",Fe(this,me));const[de,ge]=this.getInitialTranslation();return this.translate(de,ge),(0,re.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(de){const{isMac:ge}=ie.FeatureTest.platform;if(de.button!==0||de.ctrlKey&&ge){de.preventDefault();return}de.ctrlKey&&!ge||de.shiftKey||de.metaKey&&ge?this.parent.toggleSelected(this):this.parent.setSelected(this),pt(this,he,!0)}getRect(de,ge){const ue=this.parentScale,[Te,$e]=this.pageDimensions,[ke,Ce]=this.pageTranslation,ce=de/ue,be=ge/ue,we=this.x*Te,_e=this.y*$e,Ee=this.width*Te,De=this.height*$e;switch(this.rotation){case 0:return[we+ce+ke,$e-_e-be-De+Ce,we+ce+Ee+ke,$e-_e-be+Ce];case 90:return[we+be+ke,$e-_e+ce+Ce,we+be+De+ke,$e-_e+ce+Ee+Ce];case 180:return[we-ce-Ee+ke,$e-_e+be+Ce,we-ce+ke,$e-_e+be+De+Ce];case 270:return[we-be-De+ke,$e-_e-ce-Ee+Ce,we-be+ke,$e-_e-ce+Ce];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(de,ge){const[ue,Te,$e,ke]=de,Ce=$e-ue,ce=ke-Te;switch(this.rotation){case 0:return[ue,ge-ke,Ce,ce];case 90:return[ue,ge-Te,ce,Ce];case 180:return[$e,ge-Te,Ce,ce];case 270:return[$e,ge-ke,ce,Ce];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){pt(this,ae,!0)}disableEditMode(){pt(this,ae,!1)}isInEditMode(){return Fe(this,ae)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var de;(de=this.div)==null||de.addEventListener("focusin",Fe(this,oe))}serialize(){(0,ie.unreachable)("An editor must be serializable")}static deserialize(de,ge,ue){const Te=new this.prototype.constructor({parent:ge,id:ge.getNextId(),uiManager:ue});Te.rotation=de.rotation;const[$e,ke]=Te.pageDimensions,[Ce,ce,be,we]=Te.getRectInCurrentCoords(de.rect,ke);return Te.x=Ce/$e,Te.y=ce/ke,Te.width=be/$e,Te.height=we/ke,Te}remove(){this.div.removeEventListener("focusin",Fe(this,oe)),this.div.removeEventListener("focusout",Fe(this,me)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var de;(de=this.div)==null||de.classList.add("selectedEditor")}unselect(){var de;(de=this.div)==null||de.classList.remove("selectedEditor")}updateParams(de,ge){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return Fe(this,fe)}set isEditing(de){pt(this,fe,de),de?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}};oe=new WeakMap,me=new WeakMap,he=new WeakMap,fe=new WeakMap,ae=new WeakMap,le=new WeakMap,Lt(ye,"_colorManager",new re.ColorManager),Lt(ye,"_zIndex",1);let se=ye;te.AnnotationEditor=se},(ee,te,ne)=>{var ye,ve,de,ge,ue,Te,ir,Ce,ce,be,we,_e,Ee,De,Se,He,qe,Ke,Je,et,ut,st,ct,gt,vt,At,yt,ze,xe,Pe,Le,sr,We,Dn,Ne,or,Ue,ar,Ae,Ht,Me,An,Ge,lr,Ze,cr,at,Nn,tt,wn,ft,jn;Object.defineProperty(te,"__esModule",{value:!0}),te.KeyboardManager=te.CommandManager=te.ColorManager=te.AnnotationEditorUIManager=void 0,te.bindEvents=se,te.opacityToHex=oe;var re=ne(1),ie=ne(6);function se(Tt,Ye,_t){for(const bt of _t)Ye.addEventListener(bt,Tt[bt].bind(Tt))}function oe(Tt){return Math.round(Math.min(255,Math.max(1,255*Tt))).toString(16).padStart(2,"0")}class me{constructor(){Qe(this,ye,0)}getId(){return"".concat(re.AnnotationEditorPrefix).concat(xn(this,ye)._++)}}ye=new WeakMap;class he{constructor(Ye=128){Qe(this,ve,[]);Qe(this,de,!1);Qe(this,ge,void 0);Qe(this,ue,-1);pt(this,ge,Ye)}add({cmd:Ye,undo:_t,mustExec:bt,type:Rt=NaN,overwriteIfSameType:dt=!1,keepUndo:Ie=!1}){if(bt&&Ye(),Fe(this,de))return;const Be={cmd:Ye,undo:_t,type:Rt};if(Fe(this,ue)===-1){Fe(this,ve).length>0&&(Fe(this,ve).length=0),pt(this,ue,0),Fe(this,ve).push(Be);return}if(dt&&Fe(this,ve)[Fe(this,ue)].type===Rt){Ie&&(Be.undo=Fe(this,ve)[Fe(this,ue)].undo),Fe(this,ve)[Fe(this,ue)]=Be;return}const lt=Fe(this,ue)+1;lt===Fe(this,ge)?Fe(this,ve).splice(0,1):(pt(this,ue,lt),lt<Fe(this,ve).length&&Fe(this,ve).splice(lt)),Fe(this,ve).push(Be)}undo(){Fe(this,ue)!==-1&&(pt(this,de,!0),Fe(this,ve)[Fe(this,ue)].undo(),pt(this,de,!1),pt(this,ue,Fe(this,ue)-1))}redo(){Fe(this,ue)<Fe(this,ve).length-1&&(pt(this,ue,Fe(this,ue)+1),pt(this,de,!0),Fe(this,ve)[Fe(this,ue)].cmd(),pt(this,de,!1))}hasSomethingToUndo(){return Fe(this,ue)!==-1}hasSomethingToRedo(){return Fe(this,ue)<Fe(this,ve).length-1}destroy(){pt(this,ve,null)}}ve=new WeakMap,de=new WeakMap,ge=new WeakMap,ue=new WeakMap,te.CommandManager=he;class fe{constructor(Ye){Qe(this,Te);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:_t}=re.FeatureTest.platform;for(const[bt,Rt]of Ye)for(const dt of bt){const Ie=dt.startsWith("mac+");_t&&Ie?(this.callbacks.set(dt.slice(4),Rt),this.allKeys.add(dt.split("+").at(-1))):!_t&&!Ie&&(this.callbacks.set(dt,Rt),this.allKeys.add(dt.split("+").at(-1)))}}exec(Ye,_t){if(!this.allKeys.has(_t.key))return;const bt=this.callbacks.get(it(this,Te,ir).call(this,_t));bt&&(bt.bind(Ye)(),_t.stopPropagation(),_t.preventDefault())}}Te=new WeakSet,ir=function(Ye){Ye.altKey&&this.buffer.push("alt"),Ye.ctrlKey&&this.buffer.push("ctrl"),Ye.metaKey&&this.buffer.push("meta"),Ye.shiftKey&&this.buffer.push("shift"),this.buffer.push(Ye.key);const _t=this.buffer.join("+");return this.buffer.length=0,_t},te.KeyboardManager=fe;const ke=class ke{get _colors(){const Ye=new Map([["CanvasText",null],["Canvas",null]]);return(0,ie.getColorValues)(Ye),(0,re.shadow)(this,"_colors",Ye)}convert(Ye){const _t=(0,ie.getRGB)(Ye);if(!window.matchMedia("(forced-colors: active)").matches)return _t;for(const[bt,Rt]of this._colors)if(Rt.every((dt,Ie)=>dt===_t[Ie]))return ke._colorsMapping.get(bt);return _t}getHexCode(Ye){const _t=this._colors.get(Ye);return _t?re.Util.makeHexColor(..._t):Ye}};Lt(ke,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let ae=ke;te.ColorManager=ae;const St=class St{constructor(Ye,_t,bt){Qe(this,Le);Qe(this,We);Qe(this,Ne);Qe(this,Ue);Qe(this,Ae);Qe(this,Me);Qe(this,Ge);Qe(this,Ze);Qe(this,at);Qe(this,tt);Qe(this,ft);Qe(this,Ce,null);Qe(this,ce,new Map);Qe(this,be,new Map);Qe(this,we,null);Qe(this,_e,new he);Qe(this,Ee,0);Qe(this,De,null);Qe(this,Se,new Set);Qe(this,He,null);Qe(this,qe,new me);Qe(this,Ke,!1);Qe(this,Je,re.AnnotationEditorType.NONE);Qe(this,et,new Set);Qe(this,ut,this.copy.bind(this));Qe(this,st,this.cut.bind(this));Qe(this,ct,this.paste.bind(this));Qe(this,gt,this.keydown.bind(this));Qe(this,vt,this.onEditingAction.bind(this));Qe(this,At,this.onPageChanging.bind(this));Qe(this,yt,this.onScaleChanging.bind(this));Qe(this,ze,this.onRotationChanging.bind(this));Qe(this,xe,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});Qe(this,Pe,null);pt(this,Pe,Ye),pt(this,He,_t),Fe(this,He)._on("editingaction",Fe(this,vt)),Fe(this,He)._on("pagechanging",Fe(this,At)),Fe(this,He)._on("scalechanging",Fe(this,yt)),Fe(this,He)._on("rotationchanging",Fe(this,ze)),pt(this,we,bt),this.viewParameters={realScale:ie.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){it(this,We,Dn).call(this),Fe(this,He)._off("editingaction",Fe(this,vt)),Fe(this,He)._off("pagechanging",Fe(this,At)),Fe(this,He)._off("scalechanging",Fe(this,yt)),Fe(this,He)._off("rotationchanging",Fe(this,ze));for(const Ye of Fe(this,be).values())Ye.destroy();Fe(this,be).clear(),Fe(this,ce).clear(),Fe(this,Se).clear(),pt(this,Ce,null),Fe(this,et).clear(),Fe(this,_e).destroy()}onPageChanging({pageNumber:Ye}){pt(this,Ee,Ye-1)}focusMainContainer(){Fe(this,Pe).focus()}addShouldRescale(Ye){Fe(this,Se).add(Ye)}removeShouldRescale(Ye){Fe(this,Se).delete(Ye)}onScaleChanging({scale:Ye}){this.commitOrRemove(),this.viewParameters.realScale=Ye*ie.PixelsPerInch.PDF_TO_CSS_UNITS;for(const _t of Fe(this,Se))_t.onScaleChanging()}onRotationChanging({pagesRotation:Ye}){this.commitOrRemove(),this.viewParameters.rotation=Ye}addToAnnotationStorage(Ye){!Ye.isEmpty()&&Fe(this,we)&&!Fe(this,we).has(Ye.id)&&Fe(this,we).setValue(Ye.id,Ye)}copy(Ye){if(Ye.preventDefault(),Fe(this,Ce)&&Fe(this,Ce).commitOrRemove(),!this.hasSelection)return;const _t=[];for(const bt of Fe(this,et))bt.isEmpty()||_t.push(bt.serialize());_t.length!==0&&Ye.clipboardData.setData("application/pdfjs",JSON.stringify(_t))}cut(Ye){this.copy(Ye),this.delete()}paste(Ye){Ye.preventDefault();let _t=Ye.clipboardData.getData("application/pdfjs");if(!_t)return;try{_t=JSON.parse(_t)}catch(Rt){(0,re.warn)('paste: "'.concat(Rt.message,'".'));return}if(!Array.isArray(_t))return;this.unselectAll();const bt=Fe(this,be).get(Fe(this,Ee));try{const Rt=[];for(const Be of _t){const lt=bt.deserialize(Be);if(!lt)return;Rt.push(lt)}const dt=()=>{for(const Be of Rt)it(this,at,Nn).call(this,Be);it(this,ft,jn).call(this,Rt)},Ie=()=>{for(const Be of Rt)Be.remove()};this.addCommands({cmd:dt,undo:Ie,mustExec:!0})}catch(Rt){(0,re.warn)('paste: "'.concat(Rt.message,'".'))}}keydown(Ye){var _t;(_t=this.getActive())!=null&&_t.shouldGetKeyboardEvents()||St._keyboardManager.exec(this,Ye)}onEditingAction(Ye){["undo","redo","delete","selectAll"].includes(Ye.name)&&this[Ye.name]()}setEditingState(Ye){Ye?(it(this,Le,sr).call(this),it(this,Ne,or).call(this),it(this,Ae,Ht).call(this,{isEditing:Fe(this,Je)!==re.AnnotationEditorType.NONE,isEmpty:it(this,tt,wn).call(this),hasSomethingToUndo:Fe(this,_e).hasSomethingToUndo(),hasSomethingToRedo:Fe(this,_e).hasSomethingToRedo(),hasSelectedEditor:!1})):(it(this,We,Dn).call(this),it(this,Ue,ar).call(this),it(this,Ae,Ht).call(this,{isEditing:!1}))}registerEditorTypes(Ye){if(!Fe(this,De)){pt(this,De,Ye);for(const _t of Fe(this,De))it(this,Me,An).call(this,_t.defaultPropertiesToUpdate)}}getId(){return Fe(this,qe).getId()}get currentLayer(){return Fe(this,be).get(Fe(this,Ee))}get currentPageIndex(){return Fe(this,Ee)}addLayer(Ye){Fe(this,be).set(Ye.pageIndex,Ye),Fe(this,Ke)?Ye.enable():Ye.disable()}removeLayer(Ye){Fe(this,be).delete(Ye.pageIndex)}updateMode(Ye){if(pt(this,Je,Ye),Ye===re.AnnotationEditorType.NONE)this.setEditingState(!1),it(this,Ze,cr).call(this);else{this.setEditingState(!0),it(this,Ge,lr).call(this);for(const _t of Fe(this,be).values())_t.updateMode(Ye)}}updateToolbar(Ye){Ye!==Fe(this,Je)&&Fe(this,He).dispatch("switchannotationeditormode",{source:this,mode:Ye})}updateParams(Ye,_t){if(Fe(this,De)){for(const bt of Fe(this,et))bt.updateParams(Ye,_t);for(const bt of Fe(this,De))bt.updateDefaultParams(Ye,_t)}}getEditors(Ye){const _t=[];for(const bt of Fe(this,ce).values())bt.pageIndex===Ye&&_t.push(bt);return _t}getEditor(Ye){return Fe(this,ce).get(Ye)}addEditor(Ye){Fe(this,ce).set(Ye.id,Ye)}removeEditor(Ye){var _t;Fe(this,ce).delete(Ye.id),this.unselect(Ye),(_t=Fe(this,we))==null||_t.remove(Ye.id)}setActiveEditor(Ye){Fe(this,Ce)!==Ye&&(pt(this,Ce,Ye),Ye&&it(this,Me,An).call(this,Ye.propertiesToUpdate))}toggleSelected(Ye){if(Fe(this,et).has(Ye)){Fe(this,et).delete(Ye),Ye.unselect(),it(this,Ae,Ht).call(this,{hasSelectedEditor:this.hasSelection});return}Fe(this,et).add(Ye),Ye.select(),it(this,Me,An).call(this,Ye.propertiesToUpdate),it(this,Ae,Ht).call(this,{hasSelectedEditor:!0})}setSelected(Ye){for(const _t of Fe(this,et))_t!==Ye&&_t.unselect();Fe(this,et).clear(),Fe(this,et).add(Ye),Ye.select(),it(this,Me,An).call(this,Ye.propertiesToUpdate),it(this,Ae,Ht).call(this,{hasSelectedEditor:!0})}isSelected(Ye){return Fe(this,et).has(Ye)}unselect(Ye){Ye.unselect(),Fe(this,et).delete(Ye),it(this,Ae,Ht).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return Fe(this,et).size!==0}undo(){Fe(this,_e).undo(),it(this,Ae,Ht).call(this,{hasSomethingToUndo:Fe(this,_e).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:it(this,tt,wn).call(this)})}redo(){Fe(this,_e).redo(),it(this,Ae,Ht).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:Fe(this,_e).hasSomethingToRedo(),isEmpty:it(this,tt,wn).call(this)})}addCommands(Ye){Fe(this,_e).add(Ye),it(this,Ae,Ht).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:it(this,tt,wn).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const Ye=[...Fe(this,et)],_t=()=>{for(const Rt of Ye)Rt.remove()},bt=()=>{for(const Rt of Ye)it(this,at,Nn).call(this,Rt)};this.addCommands({cmd:_t,undo:bt,mustExec:!0})}commitOrRemove(){var Ye;(Ye=Fe(this,Ce))==null||Ye.commitOrRemove()}selectAll(){for(const Ye of Fe(this,et))Ye.commit();it(this,ft,jn).call(this,Fe(this,ce).values())}unselectAll(){if(Fe(this,Ce)){Fe(this,Ce).commitOrRemove();return}if(Fe(this,et).size!==0){for(const Ye of Fe(this,et))Ye.unselect();Fe(this,et).clear(),it(this,Ae,Ht).call(this,{hasSelectedEditor:!1})}}isActive(Ye){return Fe(this,Ce)===Ye}getActive(){return Fe(this,Ce)}getMode(){return Fe(this,Je)}};Ce=new WeakMap,ce=new WeakMap,be=new WeakMap,we=new WeakMap,_e=new WeakMap,Ee=new WeakMap,De=new WeakMap,Se=new WeakMap,He=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Je=new WeakMap,et=new WeakMap,ut=new WeakMap,st=new WeakMap,ct=new WeakMap,gt=new WeakMap,vt=new WeakMap,At=new WeakMap,yt=new WeakMap,ze=new WeakMap,xe=new WeakMap,Pe=new WeakMap,Le=new WeakSet,sr=function(){Fe(this,Pe).addEventListener("keydown",Fe(this,gt))},We=new WeakSet,Dn=function(){Fe(this,Pe).removeEventListener("keydown",Fe(this,gt))},Ne=new WeakSet,or=function(){document.addEventListener("copy",Fe(this,ut)),document.addEventListener("cut",Fe(this,st)),document.addEventListener("paste",Fe(this,ct))},Ue=new WeakSet,ar=function(){document.removeEventListener("copy",Fe(this,ut)),document.removeEventListener("cut",Fe(this,st)),document.removeEventListener("paste",Fe(this,ct))},Ae=new WeakSet,Ht=function(Ye){Object.entries(Ye).some(([bt,Rt])=>Fe(this,xe)[bt]!==Rt)&&Fe(this,He).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(Fe(this,xe),Ye)})},Me=new WeakSet,An=function(Ye){Fe(this,He).dispatch("annotationeditorparamschanged",{source:this,details:Ye})},Ge=new WeakSet,lr=function(){if(!Fe(this,Ke)){pt(this,Ke,!0);for(const Ye of Fe(this,be).values())Ye.enable()}},Ze=new WeakSet,cr=function(){if(this.unselectAll(),Fe(this,Ke)){pt(this,Ke,!1);for(const Ye of Fe(this,be).values())Ye.disable()}},at=new WeakSet,Nn=function(Ye){const _t=Fe(this,be).get(Ye.pageIndex);_t?_t.addOrRebuild(Ye):this.addEditor(Ye)},tt=new WeakSet,wn=function(){if(Fe(this,ce).size===0)return!0;if(Fe(this,ce).size===1)for(const Ye of Fe(this,ce).values())return Ye.isEmpty();return!1},ft=new WeakSet,jn=function(Ye){Fe(this,et).clear();for(const _t of Ye)_t.isEmpty()||(Fe(this,et).add(_t),_t.select());it(this,Ae,Ht).call(this,{hasSelectedEditor:!0})},Lt(St,"_keyboardManager",new fe([[["ctrl+a","mac+meta+a"],St.prototype.selectAll],[["ctrl+z","mac+meta+z"],St.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],St.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],St.prototype.delete],[["Escape","mac+Escape"],St.prototype.unselectAll]]));let le=St;te.AnnotationEditorUIManager=le},(ee,te,ne)=>{var ut,st,ct,gt,vt,At,yt,ze,xe,Zt,Le,Xt,We,Gt;Object.defineProperty(te,"__esModule",{value:!0}),te.StatTimer=te.RenderingCancelledException=te.PixelsPerInch=te.PageViewport=te.PDFDateString=te.DOMStandardFontDataFactory=te.DOMSVGFactory=te.DOMFilterFactory=te.DOMCanvasFactory=te.DOMCMapReaderFactory=te.AnnotationPrefix=void 0,te.deprecated=we,te.getColorValues=He,te.getCurrentTransform=qe,te.getCurrentTransformInverse=Ke,te.getFilenameFromUrl=$e,te.getPdfFilenameFromUrl=ke,te.getRGB=Se,te.getXfaPageViewport=De,te.isDataScheme=ue,te.isPdfFile=Te,te.isValidFetchUrl=ce,te.loadScript=be,te.setLayerDimensions=Je;var re=ne(7),ie=ne(1);const se="http://www.w3.org/2000/svg",oe="pdfjs_internal_id_";te.AnnotationPrefix=oe;const et=class et{};Lt(et,"CSS",96),Lt(et,"PDF",72),Lt(et,"PDF_TO_CSS_UNITS",et.CSS/et.PDF);let me=et;te.PixelsPerInch=me;class he extends re.BaseFilterFactory{constructor({docId:Ue,ownerDocument:pe=globalThis.document}={}){super();Qe(this,xe);Qe(this,Le);Qe(this,We);Qe(this,ut,void 0);Qe(this,st,void 0);Qe(this,ct,void 0);Qe(this,gt,void 0);Qe(this,vt,void 0);Qe(this,At,void 0);Qe(this,yt,void 0);Qe(this,ze,0);pt(this,ct,Ue),pt(this,gt,pe)}addFilter(Ue){if(!Ue)return"none";let pe=Fe(this,xe,Zt).get(Ue);if(pe)return pe;let Ae,Re,Me,Oe;if(Ue.length===1){const at=Ue[0],nt=new Array(256);for(let tt=0;tt<256;tt++)nt[tt]=at[tt]/255;Oe=Ae=Re=Me=nt.join(",")}else{const[at,nt,tt]=Ue,ht=new Array(256),ft=new Array(256),wt=new Array(256);for(let St=0;St<256;St++)ht[St]=at[St]/255,ft[St]=nt[St]/255,wt[St]=tt[St]/255;Ae=ht.join(","),Re=ft.join(","),Me=wt.join(","),Oe="".concat(Ae).concat(Re).concat(Me)}if(pe=Fe(this,xe,Zt).get(Oe),pe)return Fe(this,xe,Zt).set(Ue,pe),pe;const Ge="g_".concat(Fe(this,ct),"_transfer_map_").concat(xn(this,ze)._++),rt="url(#".concat(Ge,")");Fe(this,xe,Zt).set(Ue,rt),Fe(this,xe,Zt).set(Oe,rt);const Ze=Fe(this,gt).createElementNS(se,"filter",se);Ze.setAttribute("id",Ge),Ze.setAttribute("color-interpolation-filters","sRGB");const ot=Fe(this,gt).createElementNS(se,"feComponentTransfer");return Ze.append(ot),it(this,We,Gt).call(this,ot,"feFuncR",Ae),it(this,We,Gt).call(this,ot,"feFuncG",Re),it(this,We,Gt).call(this,ot,"feFuncB",Me),Fe(this,Le,Xt).append(Ze),rt}addHCMFilter(Ue,pe){var tt;const Ae="".concat(Ue,"-").concat(pe);if(Fe(this,At)===Ae)return Fe(this,yt);if(pt(this,At,Ae),pt(this,yt,"none"),(tt=Fe(this,vt))==null||tt.remove(),!Ue||!pe)return Fe(this,yt);Fe(this,Le,Xt).style.color=Ue,Ue=getComputedStyle(Fe(this,Le,Xt)).getPropertyValue("color");const Re=Se(Ue);Ue=ie.Util.makeHexColor(...Re),Fe(this,Le,Xt).style.color=pe,pe=getComputedStyle(Fe(this,Le,Xt)).getPropertyValue("color");const Me=Se(pe);if(pe=ie.Util.makeHexColor(...Me),Fe(this,Le,Xt).style.color="",Ue==="#000000"&&pe==="#ffffff"||Ue===pe)return Fe(this,yt);const Oe=new Array(256);for(let ht=0;ht<=255;ht++){const ft=ht/255;Oe[ht]=ft<=.03928?ft/12.92:((ft+.055)/1.055)**2.4}const Ge=Oe.join(","),rt="g_".concat(Fe(this,ct),"_hcm_filter"),Ze=pt(this,vt,Fe(this,gt).createElementNS(se,"filter",se));Ze.setAttribute("id",rt),Ze.setAttribute("color-interpolation-filters","sRGB");let ot=Fe(this,gt).createElementNS(se,"feComponentTransfer");Ze.append(ot),it(this,We,Gt).call(this,ot,"feFuncR",Ge),it(this,We,Gt).call(this,ot,"feFuncG",Ge),it(this,We,Gt).call(this,ot,"feFuncB",Ge);const at=Fe(this,gt).createElementNS(se,"feColorMatrix");at.setAttribute("type","matrix"),at.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),Ze.append(at),ot=Fe(this,gt).createElementNS(se,"feComponentTransfer"),Ze.append(ot);const nt=(ht,ft)=>{const wt=Re[ht]/255,St=Me[ht]/255,Tt=new Array(ft+1);for(let Ye=0;Ye<=ft;Ye++)Tt[Ye]=wt+Ye/ft*(St-wt);return Tt.join(",")};return it(this,We,Gt).call(this,ot,"feFuncR",nt(0,5)),it(this,We,Gt).call(this,ot,"feFuncG",nt(1,5)),it(this,We,Gt).call(this,ot,"feFuncB",nt(2,5)),Fe(this,Le,Xt).append(Ze),pt(this,yt,"url(#".concat(rt,")")),Fe(this,yt)}destroy(Ue=!1){Ue&&Fe(this,yt)||(Fe(this,st)&&(Fe(this,st).parentNode.parentNode.remove(),pt(this,st,null)),Fe(this,ut)&&(Fe(this,ut).clear(),pt(this,ut,null)),pt(this,ze,0))}}ut=new WeakMap,st=new WeakMap,ct=new WeakMap,gt=new WeakMap,vt=new WeakMap,At=new WeakMap,yt=new WeakMap,ze=new WeakMap,xe=new WeakSet,Zt=function(){return Fe(this,ut)||pt(this,ut,new Map)},Le=new WeakSet,Xt=function(){if(!Fe(this,st)){const Ue=Fe(this,gt).createElement("div"),{style:pe}=Ue;pe.visibility="hidden",pe.contain="strict",pe.width=pe.height=0,pe.position="absolute",pe.top=pe.left=0,pe.zIndex=-1;const Ae=Fe(this,gt).createElementNS(se,"svg");Ae.setAttribute("width",0),Ae.setAttribute("height",0),pt(this,st,Fe(this,gt).createElementNS(se,"defs")),Ue.append(Ae),Ae.append(Fe(this,st)),Fe(this,gt).body.append(Ue)}return Fe(this,st)},We=new WeakSet,Gt=function(Ue,pe,Ae){const Re=Fe(this,gt).createElementNS(se,pe);Re.setAttribute("type","discrete"),Re.setAttribute("tableValues",Ae),Ue.append(Re)},te.DOMFilterFactory=he;class fe extends re.BaseCanvasFactory{constructor({ownerDocument:je=globalThis.document}={}){super(),this._document=je}_createCanvas(je,Ue){const pe=this._document.createElement("canvas");return pe.width=je,pe.height=Ue,pe}}te.DOMCanvasFactory=fe;async function ae(Ne,je=!1){if(ce(Ne,document.baseURI)){const Ue=await fetch(Ne);if(!Ue.ok)throw new Error(Ue.statusText);return je?new Uint8Array(await Ue.arrayBuffer()):(0,ie.stringToBytes)(await Ue.text())}return new Promise((Ue,pe)=>{const Ae=new XMLHttpRequest;Ae.open("GET",Ne,!0),je&&(Ae.responseType="arraybuffer"),Ae.onreadystatechange=()=>{if(Ae.readyState===XMLHttpRequest.DONE){if(Ae.status===200||Ae.status===0){let Re;if(je&&Ae.response?Re=new Uint8Array(Ae.response):!je&&Ae.responseText&&(Re=(0,ie.stringToBytes)(Ae.responseText)),Re){Ue(Re);return}}pe(new Error(Ae.statusText))}},Ae.send(null)})}class le extends re.BaseCMapReaderFactory{_fetchData(je,Ue){return ae(je,this.isCompressed).then(pe=>({cMapData:pe,compressionType:Ue}))}}te.DOMCMapReaderFactory=le;class ye extends re.BaseStandardFontDataFactory{_fetchData(je){return ae(je,!0)}}te.DOMStandardFontDataFactory=ye;class ve extends re.BaseSVGFactory{_createSVG(je){return document.createElementNS(se,je)}}te.DOMSVGFactory=ve;class de{constructor({viewBox:je,scale:Ue,rotation:pe,offsetX:Ae=0,offsetY:Re=0,dontFlip:Me=!1}){this.viewBox=je,this.scale=Ue,this.rotation=pe,this.offsetX=Ae,this.offsetY=Re;const Oe=(je[2]+je[0])/2,Ge=(je[3]+je[1])/2;let rt,Ze,ot,at;switch(pe%=360,pe<0&&(pe+=360),pe){case 180:rt=-1,Ze=0,ot=0,at=1;break;case 90:rt=0,Ze=1,ot=1,at=0;break;case 270:rt=0,Ze=-1,ot=-1,at=0;break;case 0:rt=1,Ze=0,ot=0,at=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Me&&(ot=-ot,at=-at);let nt,tt,ht,ft;rt===0?(nt=Math.abs(Ge-je[1])*Ue+Ae,tt=Math.abs(Oe-je[0])*Ue+Re,ht=(je[3]-je[1])*Ue,ft=(je[2]-je[0])*Ue):(nt=Math.abs(Oe-je[0])*Ue+Ae,tt=Math.abs(Ge-je[1])*Ue+Re,ht=(je[2]-je[0])*Ue,ft=(je[3]-je[1])*Ue),this.transform=[rt*Ue,Ze*Ue,ot*Ue,at*Ue,nt-rt*Ue*Oe-ot*Ue*Ge,tt-Ze*Ue*Oe-at*Ue*Ge],this.width=ht,this.height=ft}get rawDims(){const{viewBox:je}=this;return(0,ie.shadow)(this,"rawDims",{pageWidth:je[2]-je[0],pageHeight:je[3]-je[1],pageX:je[0],pageY:je[1]})}clone({scale:je=this.scale,rotation:Ue=this.rotation,offsetX:pe=this.offsetX,offsetY:Ae=this.offsetY,dontFlip:Re=!1}={}){return new de({viewBox:this.viewBox.slice(),scale:je,rotation:Ue,offsetX:pe,offsetY:Ae,dontFlip:Re})}convertToViewportPoint(je,Ue){return ie.Util.applyTransform([je,Ue],this.transform)}convertToViewportRectangle(je){const Ue=ie.Util.applyTransform([je[0],je[1]],this.transform),pe=ie.Util.applyTransform([je[2],je[3]],this.transform);return[Ue[0],Ue[1],pe[0],pe[1]]}convertToPdfPoint(je,Ue){return ie.Util.applyInverseTransform([je,Ue],this.transform)}}te.PageViewport=de;class ge extends ie.BaseException{constructor(je,Ue,pe=0){super(je,"RenderingCancelledException"),this.type=Ue,this.extraDelay=pe}}te.RenderingCancelledException=ge;function ue(Ne){const je=Ne.length;let Ue=0;for(;Ue<je&&Ne[Ue].trim()==="";)Ue++;return Ne.substring(Ue,Ue+5).toLowerCase()==="data:"}function Te(Ne){return typeof Ne=="string"&&/\.pdf$/i.test(Ne)}function $e(Ne,je=!1){return je||([Ne]=Ne.split(/[#?]/,1)),Ne.substring(Ne.lastIndexOf("/")+1)}function ke(Ne,je="document.pdf"){if(typeof Ne!="string")return je;if(ue(Ne))return(0,ie.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),je;const Ue=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,pe=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Ae=Ue.exec(Ne);let Re=pe.exec(Ae[1])||pe.exec(Ae[2])||pe.exec(Ae[3]);if(Re&&(Re=Re[0],Re.includes("%")))try{Re=pe.exec(decodeURIComponent(Re))[0]}catch{}return Re||je}class Ce{constructor(){Lt(this,"started",Object.create(null));Lt(this,"times",[])}time(je){je in this.started&&(0,ie.warn)("Timer is already running for ".concat(je)),this.started[je]=Date.now()}timeEnd(je){je in this.started||(0,ie.warn)("Timer has not been started for ".concat(je)),this.times.push({name:je,start:this.started[je],end:Date.now()}),delete this.started[je]}toString(){const je=[];let Ue=0;for(const{name:pe}of this.times)Ue=Math.max(pe.length,Ue);for(const{name:pe,start:Ae,end:Re}of this.times)je.push("".concat(pe.padEnd(Ue)," ").concat(Re-Ae,"ms\n"));return je.join("")}}te.StatTimer=Ce;function ce(Ne,je){try{const{protocol:Ue}=je?new URL(Ne,je):new URL(Ne);return Ue==="http:"||Ue==="https:"}catch{return!1}}function be(Ne,je=!1){return new Promise((Ue,pe)=>{const Ae=document.createElement("script");Ae.src=Ne,Ae.onload=function(Re){je&&Ae.remove(),Ue(Re)},Ae.onerror=function(){pe(new Error("Cannot load script at: ".concat(Ae.src)))},(document.head||document.documentElement).append(Ae)})}function we(Ne){console.log("Deprecated API usage: "+Ne)}let _e;class Ee{static toDateObject(je){if(!je||typeof je!="string")return null;_e||(_e=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const Ue=_e.exec(je);if(!Ue)return null;const pe=parseInt(Ue[1],10);let Ae=parseInt(Ue[2],10);Ae=Ae>=1&&Ae<=12?Ae-1:0;let Re=parseInt(Ue[3],10);Re=Re>=1&&Re<=31?Re:1;let Me=parseInt(Ue[4],10);Me=Me>=0&&Me<=23?Me:0;let Oe=parseInt(Ue[5],10);Oe=Oe>=0&&Oe<=59?Oe:0;let Ge=parseInt(Ue[6],10);Ge=Ge>=0&&Ge<=59?Ge:0;const rt=Ue[7]||"Z";let Ze=parseInt(Ue[8],10);Ze=Ze>=0&&Ze<=23?Ze:0;let ot=parseInt(Ue[9],10)||0;return ot=ot>=0&&ot<=59?ot:0,rt==="-"?(Me+=Ze,Oe+=ot):rt==="+"&&(Me-=Ze,Oe-=ot),new Date(Date.UTC(pe,Ae,Re,Me,Oe,Ge))}}te.PDFDateString=Ee;function De(Ne,{scale:je=1,rotation:Ue=0}){const{width:pe,height:Ae}=Ne.attributes.style,Re=[0,0,parseInt(pe),parseInt(Ae)];return new de({viewBox:Re,scale:je,rotation:Ue})}function Se(Ne){if(Ne.startsWith("#")){const je=parseInt(Ne.slice(1),16);return[(je&16711680)>>16,(je&65280)>>8,je&255]}return Ne.startsWith("rgb(")?Ne.slice(4,-1).split(",").map(je=>parseInt(je)):Ne.startsWith("rgba(")?Ne.slice(5,-1).split(",").map(je=>parseInt(je)).slice(0,3):((0,ie.warn)('Not a valid color format: "'.concat(Ne,'"')),[0,0,0])}function He(Ne){const je=document.createElement("span");je.style.visibility="hidden",document.body.append(je);for(const Ue of Ne.keys()){je.style.color=Ue;const pe=window.getComputedStyle(je).color;Ne.set(Ue,Se(pe))}je.remove()}function qe(Ne){const{a:je,b:Ue,c:pe,d:Ae,e:Re,f:Me}=Ne.getTransform();return[je,Ue,pe,Ae,Re,Me]}function Ke(Ne){const{a:je,b:Ue,c:pe,d:Ae,e:Re,f:Me}=Ne.getTransform().invertSelf();return[je,Ue,pe,Ae,Re,Me]}function Je(Ne,je,Ue=!1,pe=!0){if(je instanceof de){const{pageWidth:Ae,pageHeight:Re}=je.rawDims,{style:Me}=Ne,Oe="calc(var(--scale-factor) * ".concat(Ae,"px)"),Ge="calc(var(--scale-factor) * ".concat(Re,"px)");!Ue||je.rotation%180===0?(Me.width=Oe,Me.height=Ge):(Me.width=Ge,Me.height=Oe)}pe&&Ne.setAttribute("data-main-rotation",je.rotation)}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.BaseStandardFontDataFactory=te.BaseSVGFactory=te.BaseFilterFactory=te.BaseCanvasFactory=te.BaseCMapReaderFactory=void 0;var re=ne(1);class ie{constructor(){this.constructor===ie&&(0,re.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(ae){return"none"}addHCMFilter(ae,le){return"none"}destroy(ae=!1){}}te.BaseFilterFactory=ie;class se{constructor(){this.constructor===se&&(0,re.unreachable)("Cannot initialize BaseCanvasFactory.")}create(ae,le){if(ae<=0||le<=0)throw new Error("Invalid canvas size");const ye=this._createCanvas(ae,le);return{canvas:ye,context:ye.getContext("2d")}}reset(ae,le,ye){if(!ae.canvas)throw new Error("Canvas is not specified");if(le<=0||ye<=0)throw new Error("Invalid canvas size");ae.canvas.width=le,ae.canvas.height=ye}destroy(ae){if(!ae.canvas)throw new Error("Canvas is not specified");ae.canvas.width=0,ae.canvas.height=0,ae.canvas=null,ae.context=null}_createCanvas(ae,le){(0,re.unreachable)("Abstract method `_createCanvas` called.")}}te.BaseCanvasFactory=se;class oe{constructor({baseUrl:ae=null,isCompressed:le=!0}){this.constructor===oe&&(0,re.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=ae,this.isCompressed=le}async fetch({name:ae}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!ae)throw new Error("CMap name must be specified.");const le=this.baseUrl+ae+(this.isCompressed?".bcmap":""),ye=this.isCompressed?re.CMapCompressionType.BINARY:re.CMapCompressionType.NONE;return this._fetchData(le,ye).catch(ve=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(le))})}_fetchData(ae,le){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseCMapReaderFactory=oe;class me{constructor({baseUrl:ae=null}){this.constructor===me&&(0,re.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=ae}async fetch({filename:ae}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!ae)throw new Error("Font filename must be specified.");const le="".concat(this.baseUrl).concat(ae);return this._fetchData(le).catch(ye=>{throw new Error("Unable to load font data at: ".concat(le))})}_fetchData(ae){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseStandardFontDataFactory=me;class he{constructor(){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseSVGFactory.")}create(ae,le,ye=!1){if(ae<=0||le<=0)throw new Error("Invalid SVG dimensions");const ve=this._createSVG("svg:svg");return ve.setAttribute("version","1.1"),ye||(ve.setAttribute("width","".concat(ae,"px")),ve.setAttribute("height","".concat(le,"px"))),ve.setAttribute("preserveAspectRatio","none"),ve.setAttribute("viewBox","0 0 ".concat(ae," ").concat(le)),ve}createElement(ae){if(typeof ae!="string")throw new Error("Invalid SVG element type");return this._createSVG(ae)}_createSVG(ae){(0,re.unreachable)("Abstract method `_createSVG` called.")}}te.BaseSVGFactory=he},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.MurmurHash3_64=void 0;var re=ne(1);const ie=3285377520,se=4294901760,oe=65535;class me{constructor(fe){this.h1=fe?fe&4294967295:ie,this.h2=fe?fe&4294967295:ie}update(fe){let ae,le;if(typeof fe=="string"){ae=new Uint8Array(fe.length*2),le=0;for(let we=0,_e=fe.length;we<_e;we++){const Ee=fe.charCodeAt(we);Ee<=255?ae[le++]=Ee:(ae[le++]=Ee>>>8,ae[le++]=Ee&255)}}else if((0,re.isArrayBuffer)(fe))ae=fe.slice(),le=ae.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const ye=le>>2,ve=le-ye*4,de=new Uint32Array(ae.buffer,0,ye);let ge=0,ue=0,Te=this.h1,$e=this.h2;const ke=3432918353,Ce=461845907,ce=ke&oe,be=Ce&oe;for(let we=0;we<ye;we++)we&1?(ge=de[we],ge=ge*ke&se|ge*ce&oe,ge=ge<<15|ge>>>17,ge=ge*Ce&se|ge*be&oe,Te^=ge,Te=Te<<13|Te>>>19,Te=Te*5+3864292196):(ue=de[we],ue=ue*ke&se|ue*ce&oe,ue=ue<<15|ue>>>17,ue=ue*Ce&se|ue*be&oe,$e^=ue,$e=$e<<13|$e>>>19,$e=$e*5+3864292196);switch(ge=0,ve){case 3:ge^=ae[ye*4+2]<<16;case 2:ge^=ae[ye*4+1]<<8;case 1:ge^=ae[ye*4],ge=ge*ke&se|ge*ce&oe,ge=ge<<15|ge>>>17,ge=ge*Ce&se|ge*be&oe,ye&1?Te^=ge:$e^=ge}this.h1=Te,this.h2=$e}hexdigest(){let fe=this.h1,ae=this.h2;return fe^=ae>>>1,fe=fe*3981806797&se|fe*36045&oe,ae=ae*4283543511&se|((ae<<16|fe>>>16)*2950163797&se)>>>16,fe^=ae>>>1,fe=fe*444984403&se|fe*60499&oe,ae=ae*3301882366&se|((ae<<16|fe>>>16)*3120437893&se)>>>16,fe^=ae>>>1,(fe>>>0).toString(16).padStart(8,"0")+(ae>>>0).toString(16).padStart(8,"0")}}te.MurmurHash3_64=me},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.FontLoader=te.FontFaceObject=void 0;var re=ne(1),ie=ne(10);class se{constructor({ownerDocument:he=globalThis.document,styleElement:fe=null}){this._document=he,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(he){this.nativeFontFaces.push(he),this._document.fonts.add(he)}insertRule(he){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const fe=this.styleElement.sheet;fe.insertRule(he,fe.cssRules.length)}clear(){for(const he of this.nativeFontFaces)this._document.fonts.delete(he);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(he){if(he.attached||he.missingFile)return;if(he.attached=!0,this.isFontLoadingAPISupported){const ae=he.createNativeFontFace();if(ae){this.addNativeFontFace(ae);try{await ae.loaded}catch(le){throw(0,re.warn)("Failed to load font '".concat(ae.family,"': '").concat(le,"'.")),he.disableFontFace=!0,le}}return}const fe=he.createFontFaceRule();if(fe){if(this.insertRule(fe),this.isSyncFontLoadingSupported)return;await new Promise(ae=>{const le=this._queueLoadingCallback(ae);this._prepareFontLoadEvent(he,le)})}}get isFontLoadingAPISupported(){var fe;const he=!!((fe=this._document)!=null&&fe.fonts);return(0,re.shadow)(this,"isFontLoadingAPISupported",he)}get isSyncFontLoadingSupported(){let he=!1;return(ie.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(he=!0),(0,re.shadow)(this,"isSyncFontLoadingSupported",he)}_queueLoadingCallback(he){function fe(){for((0,re.assert)(!le.done,"completeRequest() cannot be called twice."),le.done=!0;ae.length>0&&ae[0].done;){const ye=ae.shift();setTimeout(ye.callback,0)}}const{loadingRequests:ae}=this,le={done:!1,complete:fe,callback:he};return ae.push(le),le}get _loadTestFont(){const he=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,re.shadow)(this,"_loadTestFont",he)}_prepareFontLoadEvent(he,fe){function ae(Se,He){return Se.charCodeAt(He)<<24|Se.charCodeAt(He+1)<<16|Se.charCodeAt(He+2)<<8|Se.charCodeAt(He+3)&255}function le(Se,He,qe,Ke){const Je=Se.substring(0,He),et=Se.substring(He+qe);return Je+Ke+et}let ye,ve;const de=this._document.createElement("canvas");de.width=1,de.height=1;const ge=de.getContext("2d");let ue=0;function Te(Se,He){if(++ue>30){(0,re.warn)("Load test font never loaded."),He();return}if(ge.font="30px "+Se,ge.fillText(".",0,20),ge.getImageData(0,0,1,1).data[3]>0){He();return}setTimeout(Te.bind(null,Se,He))}const $e="lt".concat(Date.now()).concat(this.loadTestFontId++);let ke=this._loadTestFont;ke=le(ke,976,$e.length,$e);const ce=16,be=1482184792;let we=ae(ke,ce);for(ye=0,ve=$e.length-3;ye<ve;ye+=4)we=we-be+ae($e,ye)|0;ye<$e.length&&(we=we-be+ae($e+"XXX",ye)|0),ke=le(ke,ce,4,(0,re.string32)(we));const _e="url(data:font/opentype;base64,".concat(btoa(ke),");"),Ee='@font-face {font-family:"'.concat($e,'";src:').concat(_e,"}");this.insertRule(Ee);const De=this._document.createElement("div");De.style.visibility="hidden",De.style.width=De.style.height="10px",De.style.position="absolute",De.style.top=De.style.left="0px";for(const Se of[he.loadedName,$e]){const He=this._document.createElement("span");He.textContent="Hi",He.style.fontFamily=Se,De.append(He)}this._document.body.append(De),Te($e,()=>{De.remove(),fe.complete()})}}te.FontLoader=se;class oe{constructor(he,{isEvalSupported:fe=!0,disableFontFace:ae=!1,ignoreErrors:le=!1,inspectFont:ye=null}){this.compiledGlyphs=Object.create(null);for(const ve in he)this[ve]=he[ve];this.isEvalSupported=fe!==!1,this.disableFontFace=ae===!0,this.ignoreErrors=le===!0,this._inspectFont=ye}createNativeFontFace(){var fe;if(!this.data||this.disableFontFace)return null;let he;if(!this.cssFontInfo)he=new FontFace(this.loadedName,this.data,{});else{const ae={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(ae.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),he=new FontFace(this.cssFontInfo.fontFamily,this.data,ae)}return(fe=this._inspectFont)==null||fe.call(this,this),he}createFontFaceRule(){var le;if(!this.data||this.disableFontFace)return null;const he=(0,re.bytesToString)(this.data),fe="url(data:".concat(this.mimetype,";base64,").concat(btoa(he),");");let ae;if(!this.cssFontInfo)ae='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(fe,"}");else{let ye="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(ye+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),ae='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(ye,"src:").concat(fe,"}")}return(le=this._inspectFont)==null||le.call(this,this,fe),ae}getPathGenerator(he,fe){if(this.compiledGlyphs[fe]!==void 0)return this.compiledGlyphs[fe];let ae;try{ae=he.get(this.loadedName+"_path_"+fe)}catch(le){if(!this.ignoreErrors)throw le;return(0,re.warn)('getPathGenerator - ignoring character: "'.concat(le,'".')),this.compiledGlyphs[fe]=function(ye,ve){}}if(this.isEvalSupported&&re.FeatureTest.isEvalSupported){const le=[];for(const ye of ae){const ve=ye.args!==void 0?ye.args.join(","):"";le.push("c.",ye.cmd,"(",ve,");\n")}return this.compiledGlyphs[fe]=new Function("c","size",le.join(""))}return this.compiledGlyphs[fe]=function(le,ye){for(const ve of ae)ve.cmd==="scale"&&(ve.args=[ye,-ye]),le[ve.cmd].apply(le,ve.args)}}}te.FontFaceObject=oe},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.isNodeJS=void 0;const ne=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");te.isNodeJS=ne},(ee,te,ne)=>{var ct,Bn,vt,Un;Object.defineProperty(te,"__esModule",{value:!0}),te.CanvasGraphics=void 0;var re=ne(1),ie=ne(6),se=ne(12),oe=ne(13),me=ne(10);const he=16,fe=100,ae=4096,le=15,ye=10,ve=1e3,de=16;function ge(ze,xe){if(ze._removeMirroring)throw new Error("Context is already forwarding operations.");ze.__originalSave=ze.save,ze.__originalRestore=ze.restore,ze.__originalRotate=ze.rotate,ze.__originalScale=ze.scale,ze.__originalTranslate=ze.translate,ze.__originalTransform=ze.transform,ze.__originalSetTransform=ze.setTransform,ze.__originalResetTransform=ze.resetTransform,ze.__originalClip=ze.clip,ze.__originalMoveTo=ze.moveTo,ze.__originalLineTo=ze.lineTo,ze.__originalBezierCurveTo=ze.bezierCurveTo,ze.__originalRect=ze.rect,ze.__originalClosePath=ze.closePath,ze.__originalBeginPath=ze.beginPath,ze._removeMirroring=()=>{ze.save=ze.__originalSave,ze.restore=ze.__originalRestore,ze.rotate=ze.__originalRotate,ze.scale=ze.__originalScale,ze.translate=ze.__originalTranslate,ze.transform=ze.__originalTransform,ze.setTransform=ze.__originalSetTransform,ze.resetTransform=ze.__originalResetTransform,ze.clip=ze.__originalClip,ze.moveTo=ze.__originalMoveTo,ze.lineTo=ze.__originalLineTo,ze.bezierCurveTo=ze.__originalBezierCurveTo,ze.rect=ze.__originalRect,ze.closePath=ze.__originalClosePath,ze.beginPath=ze.__originalBeginPath,delete ze._removeMirroring},ze.save=function(){xe.save(),this.__originalSave()},ze.restore=function(){xe.restore(),this.__originalRestore()},ze.translate=function(Le,Ve){xe.translate(Le,Ve),this.__originalTranslate(Le,Ve)},ze.scale=function(Le,Ve){xe.scale(Le,Ve),this.__originalScale(Le,Ve)},ze.transform=function(Le,Ve,We,Xe,Ne,je){xe.transform(Le,Ve,We,Xe,Ne,je),this.__originalTransform(Le,Ve,We,Xe,Ne,je)},ze.setTransform=function(Le,Ve,We,Xe,Ne,je){xe.setTransform(Le,Ve,We,Xe,Ne,je),this.__originalSetTransform(Le,Ve,We,Xe,Ne,je)},ze.resetTransform=function(){xe.resetTransform(),this.__originalResetTransform()},ze.rotate=function(Le){xe.rotate(Le),this.__originalRotate(Le)},ze.clip=function(Le){xe.clip(Le),this.__originalClip(Le)},ze.moveTo=function(Pe,Le){xe.moveTo(Pe,Le),this.__originalMoveTo(Pe,Le)},ze.lineTo=function(Pe,Le){xe.lineTo(Pe,Le),this.__originalLineTo(Pe,Le)},ze.bezierCurveTo=function(Pe,Le,Ve,We,Xe,Ne){xe.bezierCurveTo(Pe,Le,Ve,We,Xe,Ne),this.__originalBezierCurveTo(Pe,Le,Ve,We,Xe,Ne)},ze.rect=function(Pe,Le,Ve,We){xe.rect(Pe,Le,Ve,We),this.__originalRect(Pe,Le,Ve,We)},ze.closePath=function(){xe.closePath(),this.__originalClosePath()},ze.beginPath=function(){xe.beginPath(),this.__originalBeginPath()}}class ue{constructor(xe){this.canvasFactory=xe,this.cache=Object.create(null)}getCanvas(xe,Pe,Le){let Ve;return this.cache[xe]!==void 0?(Ve=this.cache[xe],this.canvasFactory.reset(Ve,Pe,Le)):(Ve=this.canvasFactory.create(Pe,Le),this.cache[xe]=Ve),Ve}delete(xe){delete this.cache[xe]}clear(){for(const xe in this.cache){const Pe=this.cache[xe];this.canvasFactory.destroy(Pe),delete this.cache[xe]}}}function Te(ze,xe,Pe,Le,Ve,We,Xe,Ne,je,Ue){const[pe,Ae,Re,Me,Oe,Ge]=(0,ie.getCurrentTransform)(ze);if(Ae===0&&Re===0){const ot=Xe*pe+Oe,at=Math.round(ot),nt=Ne*Me+Ge,tt=Math.round(nt),ht=(Xe+je)*pe+Oe,ft=Math.abs(Math.round(ht)-at)||1,wt=(Ne+Ue)*Me+Ge,St=Math.abs(Math.round(wt)-tt)||1;return ze.setTransform(Math.sign(pe),0,0,Math.sign(Me),at,tt),ze.drawImage(xe,Pe,Le,Ve,We,0,0,ft,St),ze.setTransform(pe,Ae,Re,Me,Oe,Ge),[ft,St]}if(pe===0&&Me===0){const ot=Ne*Re+Oe,at=Math.round(ot),nt=Xe*Ae+Ge,tt=Math.round(nt),ht=(Ne+Ue)*Re+Oe,ft=Math.abs(Math.round(ht)-at)||1,wt=(Xe+je)*Ae+Ge,St=Math.abs(Math.round(wt)-tt)||1;return ze.setTransform(0,Math.sign(Ae),Math.sign(Re),0,at,tt),ze.drawImage(xe,Pe,Le,Ve,We,0,0,St,ft),ze.setTransform(pe,Ae,Re,Me,Oe,Ge),[St,ft]}ze.drawImage(xe,Pe,Le,Ve,We,Xe,Ne,je,Ue);const rt=Math.hypot(pe,Ae),Ze=Math.hypot(Re,Me);return[rt*je,Ze*Ue]}function $e(ze){const{width:xe,height:Pe}=ze;if(xe>ve||Pe>ve)return null;const Le=1e3,Ve=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),We=xe+1;let Xe=new Uint8Array(We*(Pe+1)),Ne,je,Ue;const pe=xe+7&-8;let Ae=new Uint8Array(pe*Pe),Re=0;for(const Ze of ze.data){let ot=128;for(;ot>0;)Ae[Re++]=Ze&ot?0:255,ot>>=1}let Me=0;for(Re=0,Ae[Re]!==0&&(Xe[0]=1,++Me),je=1;je<xe;je++)Ae[Re]!==Ae[Re+1]&&(Xe[je]=Ae[Re]?2:1,++Me),Re++;for(Ae[Re]!==0&&(Xe[je]=2,++Me),Ne=1;Ne<Pe;Ne++){Re=Ne*pe,Ue=Ne*We,Ae[Re-pe]!==Ae[Re]&&(Xe[Ue]=Ae[Re]?1:8,++Me);let Ze=(Ae[Re]?4:0)+(Ae[Re-pe]?8:0);for(je=1;je<xe;je++)Ze=(Ze>>2)+(Ae[Re+1]?4:0)+(Ae[Re-pe+1]?8:0),Ve[Ze]&&(Xe[Ue+je]=Ve[Ze],++Me),Re++;if(Ae[Re-pe]!==Ae[Re]&&(Xe[Ue+je]=Ae[Re]?2:4,++Me),Me>Le)return null}for(Re=pe*(Pe-1),Ue=Ne*We,Ae[Re]!==0&&(Xe[Ue]=8,++Me),je=1;je<xe;je++)Ae[Re]!==Ae[Re+1]&&(Xe[Ue+je]=Ae[Re]?4:8,++Me),Re++;if(Ae[Re]!==0&&(Xe[Ue+je]=4,++Me),Me>Le)return null;const Oe=new Int32Array([0,We,-1,0,-We,0,0,0,1]),Ge=new Path2D;for(Ne=0;Me&&Ne<=Pe;Ne++){let Ze=Ne*We;const ot=Ze+xe;for(;Ze<ot&&!Xe[Ze];)Ze++;if(Ze===ot)continue;Ge.moveTo(Ze%We,Ne);const at=Ze;let nt=Xe[Ze];do{const tt=Oe[nt];do Ze+=tt;while(!Xe[Ze]);const ht=Xe[Ze];ht!==5&&ht!==10?(nt=ht,Xe[Ze]=0):(nt=ht&51*nt>>4,Xe[Ze]&=nt>>2|nt<<2),Ge.lineTo(Ze%We,Ze/We|0),Xe[Ze]||--Me}while(at!==Ze);--Ne}return Ae=null,Xe=null,function(Ze){Ze.save(),Ze.scale(1/xe,-1/Pe),Ze.translate(0,-Pe),Ze.fill(Ge),Ze.beginPath(),Ze.restore()}}class ke{constructor(xe,Pe){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=re.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=re.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=re.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,xe,Pe])}clone(){const xe=Object.create(this);return xe.clipBox=this.clipBox.slice(),xe}setCurrentPoint(xe,Pe){this.x=xe,this.y=Pe}updatePathMinMax(xe,Pe,Le){[Pe,Le]=re.Util.applyTransform([Pe,Le],xe),this.minX=Math.min(this.minX,Pe),this.minY=Math.min(this.minY,Le),this.maxX=Math.max(this.maxX,Pe),this.maxY=Math.max(this.maxY,Le)}updateRectMinMax(xe,Pe){const Le=re.Util.applyTransform(Pe,xe),Ve=re.Util.applyTransform(Pe.slice(2),xe);this.minX=Math.min(this.minX,Le[0],Ve[0]),this.minY=Math.min(this.minY,Le[1],Ve[1]),this.maxX=Math.max(this.maxX,Le[0],Ve[0]),this.maxY=Math.max(this.maxY,Le[1],Ve[1])}updateScalingPathMinMax(xe,Pe){re.Util.scaleMinMax(xe,Pe),this.minX=Math.min(this.minX,Pe[0]),this.maxX=Math.max(this.maxX,Pe[1]),this.minY=Math.min(this.minY,Pe[2]),this.maxY=Math.max(this.maxY,Pe[3])}updateCurvePathMinMax(xe,Pe,Le,Ve,We,Xe,Ne,je,Ue,pe){const Ae=re.Util.bezierBoundingBox(Pe,Le,Ve,We,Xe,Ne,je,Ue);if(pe){pe[0]=Math.min(pe[0],Ae[0],Ae[2]),pe[1]=Math.max(pe[1],Ae[0],Ae[2]),pe[2]=Math.min(pe[2],Ae[1],Ae[3]),pe[3]=Math.max(pe[3],Ae[1],Ae[3]);return}this.updateRectMinMax(xe,Ae)}getPathBoundingBox(xe=se.PathType.FILL,Pe=null){const Le=[this.minX,this.minY,this.maxX,this.maxY];if(xe===se.PathType.STROKE){Pe||(0,re.unreachable)("Stroke bounding box must include transform.");const Ve=re.Util.singularValueDecompose2dScale(Pe),We=Ve[0]*this.lineWidth/2,Xe=Ve[1]*this.lineWidth/2;Le[0]-=We,Le[1]-=Xe,Le[2]+=We,Le[3]+=Xe}return Le}updateClipFromPath(){const xe=re.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(xe||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(xe){this.clipBox=xe,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(xe=se.PathType.FILL,Pe=null){return re.Util.intersect(this.clipBox,this.getPathBoundingBox(xe,Pe))}}function Ce(ze,xe){if(typeof ImageData<"u"&&xe instanceof ImageData){ze.putImageData(xe,0,0);return}const Pe=xe.height,Le=xe.width,Ve=Pe%de,We=(Pe-Ve)/de,Xe=Ve===0?We:We+1,Ne=ze.createImageData(Le,de);let je=0,Ue;const pe=xe.data,Ae=Ne.data;let Re,Me,Oe,Ge;if(xe.kind===re.ImageKind.GRAYSCALE_1BPP){const rt=pe.byteLength,Ze=new Uint32Array(Ae.buffer,0,Ae.byteLength>>2),ot=Ze.length,at=Le+7>>3,nt=4294967295,tt=re.FeatureTest.isLittleEndian?4278190080:255;for(Re=0;Re<Xe;Re++){for(Oe=Re<We?de:Ve,Ue=0,Me=0;Me<Oe;Me++){const ht=rt-je;let ft=0;const wt=ht>at?Le:ht*8-7,St=wt&-8;let Tt=0,Ye=0;for(;ft<St;ft+=8)Ye=pe[je++],Ze[Ue++]=Ye&128?nt:tt,Ze[Ue++]=Ye&64?nt:tt,Ze[Ue++]=Ye&32?nt:tt,Ze[Ue++]=Ye&16?nt:tt,Ze[Ue++]=Ye&8?nt:tt,Ze[Ue++]=Ye&4?nt:tt,Ze[Ue++]=Ye&2?nt:tt,Ze[Ue++]=Ye&1?nt:tt;for(;ft<wt;ft++)Tt===0&&(Ye=pe[je++],Tt=128),Ze[Ue++]=Ye&Tt?nt:tt,Tt>>=1}for(;Ue<ot;)Ze[Ue++]=0;ze.putImageData(Ne,0,Re*de)}}else if(xe.kind===re.ImageKind.RGBA_32BPP){for(Me=0,Ge=Le*de*4,Re=0;Re<We;Re++)Ae.set(pe.subarray(je,je+Ge)),je+=Ge,ze.putImageData(Ne,0,Me),Me+=de;Re<Xe&&(Ge=Le*Ve*4,Ae.set(pe.subarray(je,je+Ge)),ze.putImageData(Ne,0,Me))}else if(xe.kind===re.ImageKind.RGB_24BPP)for(Oe=de,Ge=Le*Oe,Re=0;Re<Xe;Re++){for(Re>=We&&(Oe=Ve,Ge=Le*Oe),Ue=0,Me=Ge;Me--;)Ae[Ue++]=pe[je++],Ae[Ue++]=pe[je++],Ae[Ue++]=pe[je++],Ae[Ue++]=255;ze.putImageData(Ne,0,Re*de)}else throw new Error("bad image kind: ".concat(xe.kind))}function ce(ze,xe){if(xe.bitmap){ze.drawImage(xe.bitmap,0,0);return}const Pe=xe.height,Le=xe.width,Ve=Pe%de,We=(Pe-Ve)/de,Xe=Ve===0?We:We+1,Ne=ze.createImageData(Le,de);let je=0;const Ue=xe.data,pe=Ne.data;for(let Ae=0;Ae<Xe;Ae++){const Re=Ae<We?de:Ve;({srcPos:je}=(0,oe.convertBlackAndWhiteToRGBA)({src:Ue,srcPos:je,dest:pe,width:Le,height:Re,nonBlackColor:0})),ze.putImageData(Ne,0,Ae*de)}}function be(ze,xe){const Pe=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const Le of Pe)ze[Le]!==void 0&&(xe[Le]=ze[Le]);ze.setLineDash!==void 0&&(xe.setLineDash(ze.getLineDash()),xe.lineDashOffset=ze.lineDashOffset)}function we(ze){ze.strokeStyle=ze.fillStyle="#000000",ze.fillRule="nonzero",ze.globalAlpha=1,ze.lineWidth=1,ze.lineCap="butt",ze.lineJoin="miter",ze.miterLimit=10,ze.globalCompositeOperation="source-over",ze.font="10px sans-serif",ze.setLineDash!==void 0&&(ze.setLineDash([]),ze.lineDashOffset=0),me.isNodeJS||(ze.filter="none")}function _e(ze,xe,Pe,Le){const Ve=ze.length;for(let We=3;We<Ve;We+=4){const Xe=ze[We];if(Xe===0)ze[We-3]=xe,ze[We-2]=Pe,ze[We-1]=Le;else if(Xe<255){const Ne=255-Xe;ze[We-3]=ze[We-3]*Xe+xe*Ne>>8,ze[We-2]=ze[We-2]*Xe+Pe*Ne>>8,ze[We-1]=ze[We-1]*Xe+Le*Ne>>8}}}function Ee(ze,xe,Pe){const Le=ze.length,Ve=1/255;for(let We=3;We<Le;We+=4){const Xe=Pe?Pe[ze[We]]:ze[We];xe[We]=xe[We]*Xe*Ve|0}}function De(ze,xe,Pe){const Le=ze.length;for(let Ve=3;Ve<Le;Ve+=4){const We=ze[Ve-3]*77+ze[Ve-2]*152+ze[Ve-1]*28;xe[Ve]=Pe?xe[Ve]*Pe[We>>8]>>8:xe[Ve]*We>>16}}function Se(ze,xe,Pe,Le,Ve,We,Xe,Ne,je,Ue,pe){const Ae=!!We,Re=Ae?We[0]:0,Me=Ae?We[1]:0,Oe=Ae?We[2]:0;let Ge;Ve==="Luminosity"?Ge=De:Ge=Ee;const Ze=Math.min(Le,Math.ceil(1048576/Pe));for(let ot=0;ot<Le;ot+=Ze){const at=Math.min(Ze,Le-ot),nt=ze.getImageData(Ne-Ue,ot+(je-pe),Pe,at),tt=xe.getImageData(Ne,ot+je,Pe,at);Ae&&_e(nt.data,Re,Me,Oe),Ge(nt.data,tt.data,Xe),xe.putImageData(tt,Ne,ot+je)}}function He(ze,xe,Pe,Le){const Ve=Le[0],We=Le[1],Xe=Le[2]-Ve,Ne=Le[3]-We;Xe===0||Ne===0||(Se(xe.context,Pe,Xe,Ne,xe.subtype,xe.backdrop,xe.transferMap,Ve,We,xe.offsetX,xe.offsetY),ze.save(),ze.globalAlpha=1,ze.globalCompositeOperation="source-over",ze.setTransform(1,0,0,1,0,0),ze.drawImage(Pe.canvas,0,0),ze.restore())}function qe(ze,xe){const Pe=re.Util.singularValueDecompose2dScale(ze);Pe[0]=Math.fround(Pe[0]),Pe[1]=Math.fround(Pe[1]);const Le=Math.fround((globalThis.devicePixelRatio||1)*ie.PixelsPerInch.PDF_TO_CSS_UNITS);return xe!==void 0?xe:Pe[0]<=Le||Pe[1]<=Le}const Ke=["butt","round","square"],Je=["miter","round","bevel"],et={},ut={},yt=class yt{constructor(xe,Pe,Le,Ve,We,{optionalContentConfig:Xe,markedContentStack:Ne=null},je,Ue){Qe(this,ct);Qe(this,vt);this.ctx=xe,this.current=new ke(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=Pe,this.objs=Le,this.canvasFactory=Ve,this.filterFactory=We,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=Ne||[],this.optionalContentConfig=Xe,this.cachedCanvases=new ue(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=je,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=Ue,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(xe,Pe=null){return typeof xe=="string"?xe.startsWith("g_")?this.commonObjs.get(xe):this.objs.get(xe):Pe}beginDrawing({transform:xe,viewport:Pe,transparency:Le=!1,background:Ve=null}){const We=this.ctx.canvas.width,Xe=this.ctx.canvas.height,Ne=this.ctx.fillStyle;if(this.ctx.fillStyle=Ve||"#ffffff",this.ctx.fillRect(0,0,We,Xe),this.ctx.fillStyle=Ne,Le){const je=this.cachedCanvases.getCanvas("transparent",We,Xe);this.compositeCtx=this.ctx,this.transparentCanvas=je.canvas,this.ctx=je.context,this.ctx.save(),this.ctx.transform(...(0,ie.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),we(this.ctx),xe&&(this.ctx.transform(...xe),this.outputScaleX=xe[0],this.outputScaleY=xe[0]),this.ctx.transform(...Pe.transform),this.viewportScale=Pe.scale,this.baseTransform=(0,ie.getCurrentTransform)(this.ctx)}executeOperatorList(xe,Pe,Le,Ve){const We=xe.argsArray,Xe=xe.fnArray;let Ne=Pe||0;const je=We.length;if(je===Ne)return Ne;const Ue=je-Ne>ye&&typeof Le=="function",pe=Ue?Date.now()+le:0;let Ae=0;const Re=this.commonObjs,Me=this.objs;let Oe;for(;;){if(Ve!==void 0&&Ne===Ve.nextBreakPoint)return Ve.breakIt(Ne,Le),Ne;if(Oe=Xe[Ne],Oe!==re.OPS.dependency)this[Oe].apply(this,We[Ne]);else for(const Ge of We[Ne]){const rt=Ge.startsWith("g_")?Re:Me;if(!rt.has(Ge))return rt.get(Ge,Le),Ne}if(Ne++,Ne===je)return Ne;if(Ue&&++Ae>ye){if(Date.now()>pe)return Le(),Ne;Ae=0}}}endDrawing(){it(this,ct,Bn).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const xe of this._cachedBitmapsMap.values()){for(const Pe of xe.values())typeof HTMLCanvasElement<"u"&&Pe instanceof HTMLCanvasElement&&(Pe.width=Pe.height=0);xe.clear()}this._cachedBitmapsMap.clear(),it(this,vt,Un).call(this)}_scaleImage(xe,Pe){const Le=xe.width,Ve=xe.height;let We=Math.max(Math.hypot(Pe[0],Pe[1]),1),Xe=Math.max(Math.hypot(Pe[2],Pe[3]),1),Ne=Le,je=Ve,Ue="prescale1",pe,Ae;for(;We>2&&Ne>1||Xe>2&&je>1;){let Re=Ne,Me=je;We>2&&Ne>1&&(Re=Ne>=16384?Math.floor(Ne/2)-1||1:Math.ceil(Ne/2),We/=Ne/Re),Xe>2&&je>1&&(Me=je>=16384?Math.floor(je/2)-1||1:Math.ceil(je)/2,Xe/=je/Me),pe=this.cachedCanvases.getCanvas(Ue,Re,Me),Ae=pe.context,Ae.clearRect(0,0,Re,Me),Ae.drawImage(xe,0,0,Ne,je,0,0,Re,Me),xe=pe.canvas,Ne=Re,je=Me,Ue=Ue==="prescale1"?"prescale2":"prescale1"}return{img:xe,paintWidth:Ne,paintHeight:je}}_createMaskCanvas(xe){const Pe=this.ctx,{width:Le,height:Ve}=xe,We=this.current.fillColor,Xe=this.current.patternFill,Ne=(0,ie.getCurrentTransform)(Pe);let je,Ue,pe,Ae;if((xe.bitmap||xe.data)&&xe.count>1){const ft=xe.bitmap||xe.data.buffer;Ue=JSON.stringify(Xe?Ne:[Ne.slice(0,4),We]),je=this._cachedBitmapsMap.get(ft),je||(je=new Map,this._cachedBitmapsMap.set(ft,je));const wt=je.get(Ue);if(wt&&!Xe){const St=Math.round(Math.min(Ne[0],Ne[2])+Ne[4]),Tt=Math.round(Math.min(Ne[1],Ne[3])+Ne[5]);return{canvas:wt,offsetX:St,offsetY:Tt}}pe=wt}pe||(Ae=this.cachedCanvases.getCanvas("maskCanvas",Le,Ve),ce(Ae.context,xe));let Re=re.Util.transform(Ne,[1/Le,0,0,-1/Ve,0,0]);Re=re.Util.transform(Re,[1,0,0,1,0,-Ve]);const Me=re.Util.applyTransform([0,0],Re),Oe=re.Util.applyTransform([Le,Ve],Re),Ge=re.Util.normalizeRect([Me[0],Me[1],Oe[0],Oe[1]]),rt=Math.round(Ge[2]-Ge[0])||1,Ze=Math.round(Ge[3]-Ge[1])||1,ot=this.cachedCanvases.getCanvas("fillCanvas",rt,Ze),at=ot.context,nt=Math.min(Me[0],Oe[0]),tt=Math.min(Me[1],Oe[1]);at.translate(-nt,-tt),at.transform(...Re),pe||(pe=this._scaleImage(Ae.canvas,(0,ie.getCurrentTransformInverse)(at)),pe=pe.img,je&&Xe&&je.set(Ue,pe)),at.imageSmoothingEnabled=qe((0,ie.getCurrentTransform)(at),xe.interpolate),Te(at,pe,0,0,pe.width,pe.height,0,0,Le,Ve),at.globalCompositeOperation="source-in";const ht=re.Util.transform((0,ie.getCurrentTransformInverse)(at),[1,0,0,1,-nt,-tt]);return at.fillStyle=Xe?We.getPattern(Pe,this,ht,se.PathType.FILL):We,at.fillRect(0,0,Le,Ve),je&&!Xe&&(this.cachedCanvases.delete("fillCanvas"),je.set(Ue,ot.canvas)),{canvas:ot.canvas,offsetX:Math.round(nt),offsetY:Math.round(tt)}}setLineWidth(xe){xe!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=xe,this.ctx.lineWidth=xe}setLineCap(xe){this.ctx.lineCap=Ke[xe]}setLineJoin(xe){this.ctx.lineJoin=Je[xe]}setMiterLimit(xe){this.ctx.miterLimit=xe}setDash(xe,Pe){const Le=this.ctx;Le.setLineDash!==void 0&&(Le.setLineDash(xe),Le.lineDashOffset=Pe)}setRenderingIntent(xe){}setFlatness(xe){}setGState(xe){for(const[Pe,Le]of xe)switch(Pe){case"LW":this.setLineWidth(Le);break;case"LC":this.setLineCap(Le);break;case"LJ":this.setLineJoin(Le);break;case"ML":this.setMiterLimit(Le);break;case"D":this.setDash(Le[0],Le[1]);break;case"RI":this.setRenderingIntent(Le);break;case"FL":this.setFlatness(Le);break;case"Font":this.setFont(Le[0],Le[1]);break;case"CA":this.current.strokeAlpha=Le;break;case"ca":this.current.fillAlpha=Le,this.ctx.globalAlpha=Le;break;case"BM":this.ctx.globalCompositeOperation=Le;break;case"SMask":this.current.activeSMask=Le?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(Le);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const xe=this.inSMaskMode;this.current.activeSMask&&!xe?this.beginSMaskMode():!this.current.activeSMask&&xe&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const xe=this.ctx.canvas.width,Pe=this.ctx.canvas.height,Le="smaskGroupAt"+this.groupLevel,Ve=this.cachedCanvases.getCanvas(Le,xe,Pe);this.suspendedCtx=this.ctx,this.ctx=Ve.context;const We=this.ctx;We.setTransform(...(0,ie.getCurrentTransform)(this.suspendedCtx)),be(this.suspendedCtx,We),ge(We,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),be(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(xe){if(!this.current.activeSMask)return;xe?(xe[0]=Math.floor(xe[0]),xe[1]=Math.floor(xe[1]),xe[2]=Math.ceil(xe[2]),xe[3]=Math.ceil(xe[3])):xe=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const Pe=this.current.activeSMask,Le=this.suspendedCtx;He(Le,Pe,this.ctx,xe),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(be(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const xe=this.current;this.stateStack.push(xe),this.current=xe.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),be(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(xe,Pe,Le,Ve,We,Xe){this.ctx.transform(xe,Pe,Le,Ve,We,Xe),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(xe,Pe,Le){const Ve=this.ctx,We=this.current;let Xe=We.x,Ne=We.y,je,Ue;const pe=(0,ie.getCurrentTransform)(Ve),Ae=pe[0]===0&&pe[3]===0||pe[1]===0&&pe[2]===0,Re=Ae?Le.slice(0):null;for(let Me=0,Oe=0,Ge=xe.length;Me<Ge;Me++)switch(xe[Me]|0){case re.OPS.rectangle:Xe=Pe[Oe++],Ne=Pe[Oe++];const rt=Pe[Oe++],Ze=Pe[Oe++],ot=Xe+rt,at=Ne+Ze;Ve.moveTo(Xe,Ne),rt===0||Ze===0?Ve.lineTo(ot,at):(Ve.lineTo(ot,Ne),Ve.lineTo(ot,at),Ve.lineTo(Xe,at)),Ae||We.updateRectMinMax(pe,[Xe,Ne,ot,at]),Ve.closePath();break;case re.OPS.moveTo:Xe=Pe[Oe++],Ne=Pe[Oe++],Ve.moveTo(Xe,Ne),Ae||We.updatePathMinMax(pe,Xe,Ne);break;case re.OPS.lineTo:Xe=Pe[Oe++],Ne=Pe[Oe++],Ve.lineTo(Xe,Ne),Ae||We.updatePathMinMax(pe,Xe,Ne);break;case re.OPS.curveTo:je=Xe,Ue=Ne,Xe=Pe[Oe+4],Ne=Pe[Oe+5],Ve.bezierCurveTo(Pe[Oe],Pe[Oe+1],Pe[Oe+2],Pe[Oe+3],Xe,Ne),We.updateCurvePathMinMax(pe,je,Ue,Pe[Oe],Pe[Oe+1],Pe[Oe+2],Pe[Oe+3],Xe,Ne,Re),Oe+=6;break;case re.OPS.curveTo2:je=Xe,Ue=Ne,Ve.bezierCurveTo(Xe,Ne,Pe[Oe],Pe[Oe+1],Pe[Oe+2],Pe[Oe+3]),We.updateCurvePathMinMax(pe,je,Ue,Xe,Ne,Pe[Oe],Pe[Oe+1],Pe[Oe+2],Pe[Oe+3],Re),Xe=Pe[Oe+2],Ne=Pe[Oe+3],Oe+=4;break;case re.OPS.curveTo3:je=Xe,Ue=Ne,Xe=Pe[Oe+2],Ne=Pe[Oe+3],Ve.bezierCurveTo(Pe[Oe],Pe[Oe+1],Xe,Ne,Xe,Ne),We.updateCurvePathMinMax(pe,je,Ue,Pe[Oe],Pe[Oe+1],Xe,Ne,Xe,Ne,Re),Oe+=4;break;case re.OPS.closePath:Ve.closePath();break}Ae&&We.updateScalingPathMinMax(pe,Re),We.setCurrentPoint(Xe,Ne)}closePath(){this.ctx.closePath()}stroke(xe=!0){const Pe=this.ctx,Le=this.current.strokeColor;Pe.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof Le=="object"&&(Le!=null&&Le.getPattern)?(Pe.save(),Pe.strokeStyle=Le.getPattern(Pe,this,(0,ie.getCurrentTransformInverse)(Pe),se.PathType.STROKE),this.rescaleAndStroke(!1),Pe.restore()):this.rescaleAndStroke(!0)),xe&&this.consumePath(this.current.getClippedPathBoundingBox()),Pe.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(xe=!0){const Pe=this.ctx,Le=this.current.fillColor,Ve=this.current.patternFill;let We=!1;Ve&&(Pe.save(),Pe.fillStyle=Le.getPattern(Pe,this,(0,ie.getCurrentTransformInverse)(Pe),se.PathType.FILL),We=!0);const Xe=this.current.getClippedPathBoundingBox();this.contentVisible&&Xe!==null&&(this.pendingEOFill?(Pe.fill("evenodd"),this.pendingEOFill=!1):Pe.fill()),We&&Pe.restore(),xe&&this.consumePath(Xe)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=et}eoClip(){this.pendingClip=ut}beginText(){this.current.textMatrix=re.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const xe=this.pendingTextPaths,Pe=this.ctx;if(xe===void 0){Pe.beginPath();return}Pe.save(),Pe.beginPath();for(const Le of xe)Pe.setTransform(...Le.transform),Pe.translate(Le.x,Le.y),Le.addToPath(Pe,Le.fontSize);Pe.restore(),Pe.clip(),Pe.beginPath(),delete this.pendingTextPaths}setCharSpacing(xe){this.current.charSpacing=xe}setWordSpacing(xe){this.current.wordSpacing=xe}setHScale(xe){this.current.textHScale=xe/100}setLeading(xe){this.current.leading=-xe}setFont(xe,Pe){const Le=this.commonObjs.get(xe),Ve=this.current;if(!Le)throw new Error("Can't find font for ".concat(xe));if(Ve.fontMatrix=Le.fontMatrix||re.FONT_IDENTITY_MATRIX,(Ve.fontMatrix[0]===0||Ve.fontMatrix[3]===0)&&(0,re.warn)("Invalid font matrix for font "+xe),Pe<0?(Pe=-Pe,Ve.fontDirection=-1):Ve.fontDirection=1,this.current.font=Le,this.current.fontSize=Pe,Le.isType3Font)return;const We=Le.loadedName||"sans-serif";let Xe="normal";Le.black?Xe="900":Le.bold&&(Xe="bold");const Ne=Le.italic?"italic":"normal",je='"'.concat(We,'", ').concat(Le.fallbackName);let Ue=Pe;Pe<he?Ue=he:Pe>fe&&(Ue=fe),this.current.fontSizeScale=Pe/Ue,this.ctx.font="".concat(Ne," ").concat(Xe," ").concat(Ue,"px ").concat(je)}setTextRenderingMode(xe){this.current.textRenderingMode=xe}setTextRise(xe){this.current.textRise=xe}moveText(xe,Pe){this.current.x=this.current.lineX+=xe,this.current.y=this.current.lineY+=Pe}setLeadingMoveText(xe,Pe){this.setLeading(-Pe),this.moveText(xe,Pe)}setTextMatrix(xe,Pe,Le,Ve,We,Xe){this.current.textMatrix=[xe,Pe,Le,Ve,We,Xe],this.current.textMatrixScale=Math.hypot(xe,Pe),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(xe,Pe,Le,Ve){const We=this.ctx,Xe=this.current,Ne=Xe.font,je=Xe.textRenderingMode,Ue=Xe.fontSize/Xe.fontSizeScale,pe=je&re.TextRenderingMode.FILL_STROKE_MASK,Ae=!!(je&re.TextRenderingMode.ADD_TO_PATH_FLAG),Re=Xe.patternFill&&!Ne.missingFile;let Me;(Ne.disableFontFace||Ae||Re)&&(Me=Ne.getPathGenerator(this.commonObjs,xe)),Ne.disableFontFace||Re?(We.save(),We.translate(Pe,Le),We.beginPath(),Me(We,Ue),Ve&&We.setTransform(...Ve),(pe===re.TextRenderingMode.FILL||pe===re.TextRenderingMode.FILL_STROKE)&&We.fill(),(pe===re.TextRenderingMode.STROKE||pe===re.TextRenderingMode.FILL_STROKE)&&We.stroke(),We.restore()):((pe===re.TextRenderingMode.FILL||pe===re.TextRenderingMode.FILL_STROKE)&&We.fillText(xe,Pe,Le),(pe===re.TextRenderingMode.STROKE||pe===re.TextRenderingMode.FILL_STROKE)&&We.strokeText(xe,Pe,Le)),Ae&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,ie.getCurrentTransform)(We),x:Pe,y:Le,fontSize:Ue,addToPath:Me})}get isFontSubpixelAAEnabled(){const{context:xe}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);xe.scale(1.5,1),xe.fillText("I",0,10);const Pe=xe.getImageData(0,0,10,10).data;let Le=!1;for(let Ve=3;Ve<Pe.length;Ve+=4)if(Pe[Ve]>0&&Pe[Ve]<255){Le=!0;break}return(0,re.shadow)(this,"isFontSubpixelAAEnabled",Le)}showText(xe){const Pe=this.current,Le=Pe.font;if(Le.isType3Font)return this.showType3Text(xe);const Ve=Pe.fontSize;if(Ve===0)return;const We=this.ctx,Xe=Pe.fontSizeScale,Ne=Pe.charSpacing,je=Pe.wordSpacing,Ue=Pe.fontDirection,pe=Pe.textHScale*Ue,Ae=xe.length,Re=Le.vertical,Me=Re?1:-1,Oe=Le.defaultVMetrics,Ge=Ve*Pe.fontMatrix[0],rt=Pe.textRenderingMode===re.TextRenderingMode.FILL&&!Le.disableFontFace&&!Pe.patternFill;We.save(),We.transform(...Pe.textMatrix),We.translate(Pe.x,Pe.y+Pe.textRise),Ue>0?We.scale(pe,-1):We.scale(pe,1);let Ze;if(Pe.patternFill){We.save();const ht=Pe.fillColor.getPattern(We,this,(0,ie.getCurrentTransformInverse)(We),se.PathType.FILL);Ze=(0,ie.getCurrentTransform)(We),We.restore(),We.fillStyle=ht}let ot=Pe.lineWidth;const at=Pe.textMatrixScale;if(at===0||ot===0){const ht=Pe.textRenderingMode&re.TextRenderingMode.FILL_STROKE_MASK;(ht===re.TextRenderingMode.STROKE||ht===re.TextRenderingMode.FILL_STROKE)&&(ot=this.getSinglePixelWidth())}else ot/=at;if(Xe!==1&&(We.scale(Xe,Xe),ot/=Xe),We.lineWidth=ot,Le.isInvalidPDFjsFont){const ht=[];let ft=0;for(const wt of xe)ht.push(wt.unicode),ft+=wt.width;We.fillText(ht.join(""),0,0),Pe.x+=ft*Ge*pe,We.restore(),this.compose();return}let nt=0,tt;for(tt=0;tt<Ae;++tt){const ht=xe[tt];if(typeof ht=="number"){nt+=Me*ht*Ve/1e3;continue}let ft=!1;const wt=(ht.isSpace?je:0)+Ne,St=ht.fontChar,Tt=ht.accent;let Ye,_t,bt=ht.width;if(Re){const dt=ht.vmetric||Oe,Ie=-(ht.vmetric?dt[1]:bt*.5)*Ge,Be=dt[2]*Ge;bt=dt?-dt[0]:bt,Ye=Ie/Xe,_t=(nt+Be)/Xe}else Ye=nt/Xe,_t=0;if(Le.remeasure&&bt>0){const dt=We.measureText(St).width*1e3/Ve*Xe;if(bt<dt&&this.isFontSubpixelAAEnabled){const Ie=bt/dt;ft=!0,We.save(),We.scale(Ie,1),Ye/=Ie}else bt!==dt&&(Ye+=(bt-dt)/2e3*Ve/Xe)}if(this.contentVisible&&(ht.isInFont||Le.missingFile)){if(rt&&!Tt)We.fillText(St,Ye,_t);else if(this.paintChar(St,Ye,_t,Ze),Tt){const dt=Ye+Ve*Tt.offset.x/Xe,Ie=_t-Ve*Tt.offset.y/Xe;this.paintChar(Tt.fontChar,dt,Ie,Ze)}}let Rt;Re?Rt=bt*Ge-wt*Ue:Rt=bt*Ge+wt*Ue,nt+=Rt,ft&&We.restore()}Re?Pe.y-=nt:Pe.x+=nt*pe,We.restore(),this.compose()}showType3Text(xe){const Pe=this.ctx,Le=this.current,Ve=Le.font,We=Le.fontSize,Xe=Le.fontDirection,Ne=Ve.vertical?1:-1,je=Le.charSpacing,Ue=Le.wordSpacing,pe=Le.textHScale*Xe,Ae=Le.fontMatrix||re.FONT_IDENTITY_MATRIX,Re=xe.length,Me=Le.textRenderingMode===re.TextRenderingMode.INVISIBLE;let Oe,Ge,rt,Ze;if(!(Me||We===0)){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,Pe.save(),Pe.transform(...Le.textMatrix),Pe.translate(Le.x,Le.y),Pe.scale(pe,Xe),Oe=0;Oe<Re;++Oe){if(Ge=xe[Oe],typeof Ge=="number"){Ze=Ne*Ge*We/1e3,this.ctx.translate(Ze,0),Le.x+=Ze*pe;continue}const ot=(Ge.isSpace?Ue:0)+je,at=Ve.charProcOperatorList[Ge.operatorListId];if(!at){(0,re.warn)('Type3 character "'.concat(Ge.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=Ge,this.save(),Pe.scale(We,We),Pe.transform(...Ae),this.executeOperatorList(at),this.restore()),rt=re.Util.applyTransform([Ge.width,0],Ae)[0]*We+ot,Pe.translate(rt,0),Le.x+=rt*pe}Pe.restore(),this.processingType3=null}}setCharWidth(xe,Pe){}setCharWidthAndBounds(xe,Pe,Le,Ve,We,Xe){this.ctx.rect(Le,Ve,We-Le,Xe-Ve),this.ctx.clip(),this.endPath()}getColorN_Pattern(xe){let Pe;if(xe[0]==="TilingPattern"){const Le=xe[1],Ve=this.baseTransform||(0,ie.getCurrentTransform)(this.ctx),We={createCanvasGraphics:Xe=>new yt(Xe,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};Pe=new se.TilingPattern(xe,Le,this.ctx,We,Ve)}else Pe=this._getPattern(xe[1],xe[2]);return Pe}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(xe,Pe,Le){const Ve=re.Util.makeHexColor(xe,Pe,Le);this.ctx.strokeStyle=Ve,this.current.strokeColor=Ve}setFillRGBColor(xe,Pe,Le){const Ve=re.Util.makeHexColor(xe,Pe,Le);this.ctx.fillStyle=Ve,this.current.fillColor=Ve,this.current.patternFill=!1}_getPattern(xe,Pe=null){let Le;return this.cachedPatterns.has(xe)?Le=this.cachedPatterns.get(xe):(Le=(0,se.getShadingPattern)(this.getObject(xe)),this.cachedPatterns.set(xe,Le)),Pe&&(Le.matrix=Pe),Le}shadingFill(xe){if(!this.contentVisible)return;const Pe=this.ctx;this.save();const Le=this._getPattern(xe);Pe.fillStyle=Le.getPattern(Pe,this,(0,ie.getCurrentTransformInverse)(Pe),se.PathType.SHADING);const Ve=(0,ie.getCurrentTransformInverse)(Pe);if(Ve){const We=Pe.canvas,Xe=We.width,Ne=We.height,je=re.Util.applyTransform([0,0],Ve),Ue=re.Util.applyTransform([0,Ne],Ve),pe=re.Util.applyTransform([Xe,0],Ve),Ae=re.Util.applyTransform([Xe,Ne],Ve),Re=Math.min(je[0],Ue[0],pe[0],Ae[0]),Me=Math.min(je[1],Ue[1],pe[1],Ae[1]),Oe=Math.max(je[0],Ue[0],pe[0],Ae[0]),Ge=Math.max(je[1],Ue[1],pe[1],Ae[1]);this.ctx.fillRect(Re,Me,Oe-Re,Ge-Me)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,re.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,re.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(xe,Pe){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(xe)&&xe.length===6&&this.transform(...xe),this.baseTransform=(0,ie.getCurrentTransform)(this.ctx),Pe)){const Le=Pe[2]-Pe[0],Ve=Pe[3]-Pe[1];this.ctx.rect(Pe[0],Pe[1],Le,Ve),this.current.updateRectMinMax((0,ie.getCurrentTransform)(this.ctx),Pe),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(xe){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const Pe=this.ctx;xe.isolated||(0,re.info)("TODO: Support non-isolated groups."),xe.knockout&&(0,re.warn)("Knockout groups not supported.");const Le=(0,ie.getCurrentTransform)(Pe);if(xe.matrix&&Pe.transform(...xe.matrix),!xe.bbox)throw new Error("Bounding box is required.");let Ve=re.Util.getAxialAlignedBoundingBox(xe.bbox,(0,ie.getCurrentTransform)(Pe));const We=[0,0,Pe.canvas.width,Pe.canvas.height];Ve=re.Util.intersect(Ve,We)||[0,0,0,0];const Xe=Math.floor(Ve[0]),Ne=Math.floor(Ve[1]);let je=Math.max(Math.ceil(Ve[2])-Xe,1),Ue=Math.max(Math.ceil(Ve[3])-Ne,1),pe=1,Ae=1;je>ae&&(pe=je/ae,je=ae),Ue>ae&&(Ae=Ue/ae,Ue=ae),this.current.startNewPathAndClipBox([0,0,je,Ue]);let Re="groupAt"+this.groupLevel;xe.smask&&(Re+="_smask_"+this.smaskCounter++%2);const Me=this.cachedCanvases.getCanvas(Re,je,Ue),Oe=Me.context;Oe.scale(1/pe,1/Ae),Oe.translate(-Xe,-Ne),Oe.transform(...Le),xe.smask?this.smaskStack.push({canvas:Me.canvas,context:Oe,offsetX:Xe,offsetY:Ne,scaleX:pe,scaleY:Ae,subtype:xe.smask.subtype,backdrop:xe.smask.backdrop,transferMap:xe.smask.transferMap||null,startTransformInverse:null}):(Pe.setTransform(1,0,0,1,0,0),Pe.translate(Xe,Ne),Pe.scale(pe,Ae),Pe.save()),be(Pe,Oe),this.ctx=Oe,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(Pe),this.groupLevel++}endGroup(xe){if(!this.contentVisible)return;this.groupLevel--;const Pe=this.ctx,Le=this.groupStack.pop();if(this.ctx=Le,this.ctx.imageSmoothingEnabled=!1,xe.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Ve=(0,ie.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Ve);const We=re.Util.getAxialAlignedBoundingBox([0,0,Pe.canvas.width,Pe.canvas.height],Ve);this.ctx.drawImage(Pe.canvas,0,0),this.ctx.restore(),this.compose(We)}}beginAnnotation(xe,Pe,Le,Ve,We){if(it(this,ct,Bn).call(this),we(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(Pe)&&Pe.length===4){const Xe=Pe[2]-Pe[0],Ne=Pe[3]-Pe[1];if(We&&this.annotationCanvasMap){Le=Le.slice(),Le[4]-=Pe[0],Le[5]-=Pe[1],Pe=Pe.slice(),Pe[0]=Pe[1]=0,Pe[2]=Xe,Pe[3]=Ne;const[je,Ue]=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(this.ctx)),{viewportScale:pe}=this,Ae=Math.ceil(Xe*this.outputScaleX*pe),Re=Math.ceil(Ne*this.outputScaleY*pe);this.annotationCanvas=this.canvasFactory.create(Ae,Re);const{canvas:Me,context:Oe}=this.annotationCanvas;this.annotationCanvasMap.set(xe,Me),this.annotationCanvas.savedCtx=this.ctx,this.ctx=Oe,this.ctx.save(),this.ctx.setTransform(je,0,0,-Ue,0,Ne*Ue),we(this.ctx)}else we(this.ctx),this.ctx.rect(Pe[0],Pe[1],Xe,Ne),this.ctx.clip(),this.endPath()}this.current=new ke(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...Le),this.transform(...Ve)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),it(this,vt,Un).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(xe){if(!this.contentVisible)return;const Pe=xe.count;xe=this.getObject(xe.data,xe),xe.count=Pe;const Le=this.ctx,Ve=this.processingType3;if(Ve&&(Ve.compiled===void 0&&(Ve.compiled=$e(xe)),Ve.compiled)){Ve.compiled(Le);return}const We=this._createMaskCanvas(xe),Xe=We.canvas;Le.save(),Le.setTransform(1,0,0,1,0,0),Le.drawImage(Xe,We.offsetX,We.offsetY),Le.restore(),this.compose()}paintImageMaskXObjectRepeat(xe,Pe,Le=0,Ve=0,We,Xe){if(!this.contentVisible)return;xe=this.getObject(xe.data,xe);const Ne=this.ctx;Ne.save();const je=(0,ie.getCurrentTransform)(Ne);Ne.transform(Pe,Le,Ve,We,0,0);const Ue=this._createMaskCanvas(xe);Ne.setTransform(1,0,0,1,Ue.offsetX-je[4],Ue.offsetY-je[5]);for(let pe=0,Ae=Xe.length;pe<Ae;pe+=2){const Re=re.Util.transform(je,[Pe,Le,Ve,We,Xe[pe],Xe[pe+1]]),[Me,Oe]=re.Util.applyTransform([0,0],Re);Ne.drawImage(Ue.canvas,Me,Oe)}Ne.restore(),this.compose()}paintImageMaskXObjectGroup(xe){if(!this.contentVisible)return;const Pe=this.ctx,Le=this.current.fillColor,Ve=this.current.patternFill;for(const We of xe){const{data:Xe,width:Ne,height:je,transform:Ue}=We,pe=this.cachedCanvases.getCanvas("maskCanvas",Ne,je),Ae=pe.context;Ae.save();const Re=this.getObject(Xe,We);ce(Ae,Re),Ae.globalCompositeOperation="source-in",Ae.fillStyle=Ve?Le.getPattern(Ae,this,(0,ie.getCurrentTransformInverse)(Pe),se.PathType.FILL):Le,Ae.fillRect(0,0,Ne,je),Ae.restore(),Pe.save(),Pe.transform(...Ue),Pe.scale(1,-1),Te(Pe,pe.canvas,0,0,Ne,je,0,-1,1,1),Pe.restore()}this.compose()}paintImageXObject(xe){if(!this.contentVisible)return;const Pe=this.getObject(xe);if(!Pe){(0,re.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(Pe)}paintImageXObjectRepeat(xe,Pe,Le,Ve){if(!this.contentVisible)return;const We=this.getObject(xe);if(!We){(0,re.warn)("Dependent image isn't ready yet");return}const Xe=We.width,Ne=We.height,je=[];for(let Ue=0,pe=Ve.length;Ue<pe;Ue+=2)je.push({transform:[Pe,0,0,Le,Ve[Ue],Ve[Ue+1]],x:0,y:0,w:Xe,h:Ne});this.paintInlineImageXObjectGroup(We,je)}applyTransferMapsToCanvas(xe){return this.current.transferMaps!=="none"&&(xe.filter=this.current.transferMaps,xe.drawImage(xe.canvas,0,0),xe.filter="none"),xe.canvas}applyTransferMapsToBitmap(xe){if(this.current.transferMaps==="none")return xe.bitmap;const{bitmap:Pe,width:Le,height:Ve}=xe,We=this.cachedCanvases.getCanvas("inlineImage",Le,Ve),Xe=We.context;return Xe.filter=this.current.transferMaps,Xe.drawImage(Pe,0,0),Xe.filter="none",We.canvas}paintInlineImageXObject(xe){if(!this.contentVisible)return;const Pe=xe.width,Le=xe.height,Ve=this.ctx;this.save(),me.isNodeJS||(Ve.filter="none"),Ve.scale(1/Pe,-1/Le);let We;if(xe.bitmap)We=this.applyTransferMapsToBitmap(xe);else if(typeof HTMLElement=="function"&&xe instanceof HTMLElement||!xe.data)We=xe;else{const je=this.cachedCanvases.getCanvas("inlineImage",Pe,Le).context;Ce(je,xe),We=this.applyTransferMapsToCanvas(je)}const Xe=this._scaleImage(We,(0,ie.getCurrentTransformInverse)(Ve));Ve.imageSmoothingEnabled=qe((0,ie.getCurrentTransform)(Ve),xe.interpolate),Te(Ve,Xe.img,0,0,Xe.paintWidth,Xe.paintHeight,0,-Le,Pe,Le),this.compose(),this.restore()}paintInlineImageXObjectGroup(xe,Pe){if(!this.contentVisible)return;const Le=this.ctx;let Ve;if(xe.bitmap)Ve=xe.bitmap;else{const We=xe.width,Xe=xe.height,je=this.cachedCanvases.getCanvas("inlineImage",We,Xe).context;Ce(je,xe),Ve=this.applyTransferMapsToCanvas(je)}for(const We of Pe)Le.save(),Le.transform(...We.transform),Le.scale(1,-1),Te(Le,Ve,We.x,We.y,We.w,We.h,0,-1,1,1),Le.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(xe){}markPointProps(xe,Pe){}beginMarkedContent(xe){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(xe,Pe){xe==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(Pe)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(xe){const Pe=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(xe);const Le=this.ctx;this.pendingClip&&(Pe||(this.pendingClip===ut?Le.clip("evenodd"):Le.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),Le.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const xe=(0,ie.getCurrentTransform)(this.ctx);if(xe[1]===0&&xe[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(xe[0]),Math.abs(xe[3]));else{const Pe=Math.abs(xe[0]*xe[3]-xe[2]*xe[1]),Le=Math.hypot(xe[0],xe[2]),Ve=Math.hypot(xe[1],xe[3]);this._cachedGetSinglePixelWidth=Math.max(Le,Ve)/Pe}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:xe}=this.current,Pe=(0,ie.getCurrentTransform)(this.ctx);let Le,Ve;if(Pe[1]===0&&Pe[2]===0){const We=Math.abs(Pe[0]),Xe=Math.abs(Pe[3]);if(xe===0)Le=1/We,Ve=1/Xe;else{const Ne=We*xe,je=Xe*xe;Le=Ne<1?1/Ne:1,Ve=je<1?1/je:1}}else{const We=Math.abs(Pe[0]*Pe[3]-Pe[2]*Pe[1]),Xe=Math.hypot(Pe[0],Pe[1]),Ne=Math.hypot(Pe[2],Pe[3]);if(xe===0)Le=Ne/We,Ve=Xe/We;else{const je=xe*We;Le=Ne>je?Ne/je:1,Ve=Xe>je?Xe/je:1}}this._cachedScaleForStroking=[Le,Ve]}return this._cachedScaleForStroking}rescaleAndStroke(xe){const{ctx:Pe}=this,{lineWidth:Le}=this.current,[Ve,We]=this.getScaleForStroking();if(Pe.lineWidth=Le||1,Ve===1&&We===1){Pe.stroke();return}let Xe,Ne,je;xe&&(Xe=(0,ie.getCurrentTransform)(Pe),Ne=Pe.getLineDash().slice(),je=Pe.lineDashOffset),Pe.scale(Ve,We);const Ue=Math.max(Ve,We);Pe.setLineDash(Pe.getLineDash().map(pe=>pe/Ue)),Pe.lineDashOffset/=Ue,Pe.stroke(),xe&&(Pe.setTransform(...Xe),Pe.setLineDash(Ne),Pe.lineDashOffset=je)}isContentVisible(){for(let xe=this.markedContentStack.length-1;xe>=0;xe--)if(!this.markedContentStack[xe].visible)return!1;return!0}};ct=new WeakSet,Bn=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},vt=new WeakSet,Un=function(){if(this.pageColors){const xe=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(xe!=="none"){const Pe=this.ctx.filter;this.ctx.filter=xe,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=Pe}}};let st=yt;te.CanvasGraphics=st;for(const ze in re.OPS)st.prototype[ze]!==void 0&&(st.prototype[re.OPS[ze]]=st.prototype[ze])},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TilingPattern=te.PathType=void 0,te.getShadingPattern=ve;var re=ne(1),ie=ne(6);const se={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};te.PathType=se;function oe(Te,$e){if(!$e)return;const ke=$e[2]-$e[0],Ce=$e[3]-$e[1],ce=new Path2D;ce.rect($e[0],$e[1],ke,Ce),Te.clip(ce)}class me{constructor(){this.constructor===me&&(0,re.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,re.unreachable)("Abstract method `getPattern` called.")}}class he extends me{constructor($e){super(),this._type=$e[1],this._bbox=$e[2],this._colorStops=$e[3],this._p0=$e[4],this._p1=$e[5],this._r0=$e[6],this._r1=$e[7],this.matrix=null}_createGradient($e){let ke;this._type==="axial"?ke=$e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(ke=$e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const Ce of this._colorStops)ke.addColorStop(Ce[0],Ce[1]);return ke}getPattern($e,ke,Ce,ce){let be;if(ce===se.STROKE||ce===se.FILL){const we=ke.current.getClippedPathBoundingBox(ce,(0,ie.getCurrentTransform)($e))||[0,0,0,0],_e=Math.ceil(we[2]-we[0])||1,Ee=Math.ceil(we[3]-we[1])||1,De=ke.cachedCanvases.getCanvas("pattern",_e,Ee,!0),Se=De.context;Se.clearRect(0,0,Se.canvas.width,Se.canvas.height),Se.beginPath(),Se.rect(0,0,Se.canvas.width,Se.canvas.height),Se.translate(-we[0],-we[1]),Ce=re.Util.transform(Ce,[1,0,0,1,we[0],we[1]]),Se.transform(...ke.baseTransform),this.matrix&&Se.transform(...this.matrix),oe(Se,this._bbox),Se.fillStyle=this._createGradient(Se),Se.fill(),be=$e.createPattern(De.canvas,"no-repeat");const He=new DOMMatrix(Ce);be.setTransform(He)}else oe($e,this._bbox),be=this._createGradient($e);return be}}function fe(Te,$e,ke,Ce,ce,be,we,_e){const Ee=$e.coords,De=$e.colors,Se=Te.data,He=Te.width*4;let qe;Ee[ke+1]>Ee[Ce+1]&&(qe=ke,ke=Ce,Ce=qe,qe=be,be=we,we=qe),Ee[Ce+1]>Ee[ce+1]&&(qe=Ce,Ce=ce,ce=qe,qe=we,we=_e,_e=qe),Ee[ke+1]>Ee[Ce+1]&&(qe=ke,ke=Ce,Ce=qe,qe=be,be=we,we=qe);const Ke=(Ee[ke]+$e.offsetX)*$e.scaleX,Je=(Ee[ke+1]+$e.offsetY)*$e.scaleY,et=(Ee[Ce]+$e.offsetX)*$e.scaleX,ut=(Ee[Ce+1]+$e.offsetY)*$e.scaleY,st=(Ee[ce]+$e.offsetX)*$e.scaleX,ct=(Ee[ce+1]+$e.offsetY)*$e.scaleY;if(Je>=ct)return;const gt=De[be],vt=De[be+1],At=De[be+2],yt=De[we],ze=De[we+1],xe=De[we+2],Pe=De[_e],Le=De[_e+1],Ve=De[_e+2],We=Math.round(Je),Xe=Math.round(ct);let Ne,je,Ue,pe,Ae,Re,Me,Oe;for(let Ge=We;Ge<=Xe;Ge++){if(Ge<ut){let nt;Ge<Je?nt=0:nt=(Je-Ge)/(Je-ut),Ne=Ke-(Ke-et)*nt,je=gt-(gt-yt)*nt,Ue=vt-(vt-ze)*nt,pe=At-(At-xe)*nt}else{let nt;Ge>ct?nt=1:ut===ct?nt=0:nt=(ut-Ge)/(ut-ct),Ne=et-(et-st)*nt,je=yt-(yt-Pe)*nt,Ue=ze-(ze-Le)*nt,pe=xe-(xe-Ve)*nt}let rt;Ge<Je?rt=0:Ge>ct?rt=1:rt=(Je-Ge)/(Je-ct),Ae=Ke-(Ke-st)*rt,Re=gt-(gt-Pe)*rt,Me=vt-(vt-Le)*rt,Oe=At-(At-Ve)*rt;const Ze=Math.round(Math.min(Ne,Ae)),ot=Math.round(Math.max(Ne,Ae));let at=He*Ge+Ze*4;for(let nt=Ze;nt<=ot;nt++)rt=(Ne-nt)/(Ne-Ae),rt<0?rt=0:rt>1&&(rt=1),Se[at++]=je-(je-Re)*rt|0,Se[at++]=Ue-(Ue-Me)*rt|0,Se[at++]=pe-(pe-Oe)*rt|0,Se[at++]=255}}function ae(Te,$e,ke){const Ce=$e.coords,ce=$e.colors;let be,we;switch($e.type){case"lattice":const _e=$e.verticesPerRow,Ee=Math.floor(Ce.length/_e)-1,De=_e-1;for(be=0;be<Ee;be++){let Se=be*_e;for(let He=0;He<De;He++,Se++)fe(Te,ke,Ce[Se],Ce[Se+1],Ce[Se+_e],ce[Se],ce[Se+1],ce[Se+_e]),fe(Te,ke,Ce[Se+_e+1],Ce[Se+1],Ce[Se+_e],ce[Se+_e+1],ce[Se+1],ce[Se+_e])}break;case"triangles":for(be=0,we=Ce.length;be<we;be+=3)fe(Te,ke,Ce[be],Ce[be+1],Ce[be+2],ce[be],ce[be+1],ce[be+2]);break;default:throw new Error("illegal figure")}}class le extends me{constructor($e){super(),this._coords=$e[2],this._colors=$e[3],this._figures=$e[4],this._bounds=$e[5],this._bbox=$e[7],this._background=$e[8],this.matrix=null}_createMeshCanvas($e,ke,Ce){const _e=Math.floor(this._bounds[0]),Ee=Math.floor(this._bounds[1]),De=Math.ceil(this._bounds[2])-_e,Se=Math.ceil(this._bounds[3])-Ee,He=Math.min(Math.ceil(Math.abs(De*$e[0]*1.1)),3e3),qe=Math.min(Math.ceil(Math.abs(Se*$e[1]*1.1)),3e3),Ke=De/He,Je=Se/qe,et={coords:this._coords,colors:this._colors,offsetX:-_e,offsetY:-Ee,scaleX:1/Ke,scaleY:1/Je},ut=He+2*2,st=qe+2*2,ct=Ce.getCanvas("mesh",ut,st,!1),gt=ct.context,vt=gt.createImageData(He,qe);if(ke){const yt=vt.data;for(let ze=0,xe=yt.length;ze<xe;ze+=4)yt[ze]=ke[0],yt[ze+1]=ke[1],yt[ze+2]=ke[2],yt[ze+3]=255}for(const yt of this._figures)ae(vt,yt,et);return gt.putImageData(vt,2,2),{canvas:ct.canvas,offsetX:_e-2*Ke,offsetY:Ee-2*Je,scaleX:Ke,scaleY:Je}}getPattern($e,ke,Ce,ce){oe($e,this._bbox);let be;if(ce===se.SHADING)be=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)($e));else if(be=re.Util.singularValueDecompose2dScale(ke.baseTransform),this.matrix){const _e=re.Util.singularValueDecompose2dScale(this.matrix);be=[be[0]*_e[0],be[1]*_e[1]]}const we=this._createMeshCanvas(be,ce===se.SHADING?null:this._background,ke.cachedCanvases);return ce!==se.SHADING&&($e.setTransform(...ke.baseTransform),this.matrix&&$e.transform(...this.matrix)),$e.translate(we.offsetX,we.offsetY),$e.scale(we.scaleX,we.scaleY),$e.createPattern(we.canvas,"no-repeat")}}class ye extends me{getPattern(){return"hotpink"}}function ve(Te){switch(Te[0]){case"RadialAxial":return new he(Te);case"Mesh":return new le(Te);case"Dummy":return new ye}throw new Error("Unknown IR type: ".concat(Te[0]))}const de={COLORED:1,UNCOLORED:2},ue=class ue{constructor($e,ke,Ce,ce,be){this.operatorList=$e[2],this.matrix=$e[3]||[1,0,0,1,0,0],this.bbox=$e[4],this.xstep=$e[5],this.ystep=$e[6],this.paintType=$e[7],this.tilingType=$e[8],this.color=ke,this.ctx=Ce,this.canvasGraphicsFactory=ce,this.baseTransform=be}createPatternCanvas($e){const ke=this.operatorList,Ce=this.bbox,ce=this.xstep,be=this.ystep,we=this.paintType,_e=this.tilingType,Ee=this.color,De=this.canvasGraphicsFactory;(0,re.info)("TilingType: "+_e);const Se=Ce[0],He=Ce[1],qe=Ce[2],Ke=Ce[3],Je=re.Util.singularValueDecompose2dScale(this.matrix),et=re.Util.singularValueDecompose2dScale(this.baseTransform),ut=[Je[0]*et[0],Je[1]*et[1]],st=this.getSizeAndScale(ce,this.ctx.canvas.width,ut[0]),ct=this.getSizeAndScale(be,this.ctx.canvas.height,ut[1]),gt=$e.cachedCanvases.getCanvas("pattern",st.size,ct.size,!0),vt=gt.context,At=De.createCanvasGraphics(vt);At.groupLevel=$e.groupLevel,this.setFillAndStrokeStyleToContext(At,we,Ee);let yt=Se,ze=He,xe=qe,Pe=Ke;return Se<0&&(yt=0,xe+=Math.abs(Se)),He<0&&(ze=0,Pe+=Math.abs(He)),vt.translate(-(st.scale*yt),-(ct.scale*ze)),At.transform(st.scale,0,0,ct.scale,0,0),vt.save(),this.clipBbox(At,yt,ze,xe,Pe),At.baseTransform=(0,ie.getCurrentTransform)(At.ctx),At.executeOperatorList(ke),At.endDrawing(),{canvas:gt.canvas,scaleX:st.scale,scaleY:ct.scale,offsetX:yt,offsetY:ze}}getSizeAndScale($e,ke,Ce){$e=Math.abs($e);const ce=Math.max(ue.MAX_PATTERN_SIZE,ke);let be=Math.ceil($e*Ce);return be>=ce?be=ce:Ce=be/$e,{scale:Ce,size:be}}clipBbox($e,ke,Ce,ce,be){const we=ce-ke,_e=be-Ce;$e.ctx.rect(ke,Ce,we,_e),$e.current.updateRectMinMax((0,ie.getCurrentTransform)($e.ctx),[ke,Ce,ce,be]),$e.clip(),$e.endPath()}setFillAndStrokeStyleToContext($e,ke,Ce){const ce=$e.ctx,be=$e.current;switch(ke){case de.COLORED:const we=this.ctx;ce.fillStyle=we.fillStyle,ce.strokeStyle=we.strokeStyle,be.fillColor=we.fillStyle,be.strokeColor=we.strokeStyle;break;case de.UNCOLORED:const _e=re.Util.makeHexColor(Ce[0],Ce[1],Ce[2]);ce.fillStyle=_e,ce.strokeStyle=_e,be.fillColor=_e,be.strokeColor=_e;break;default:throw new re.FormatError("Unsupported paint type: ".concat(ke))}}getPattern($e,ke,Ce,ce){let be=Ce;ce!==se.SHADING&&(be=re.Util.transform(be,ke.baseTransform),this.matrix&&(be=re.Util.transform(be,this.matrix)));const we=this.createPatternCanvas(ke);let _e=new DOMMatrix(be);_e=_e.translate(we.offsetX,we.offsetY),_e=_e.scale(1/we.scaleX,1/we.scaleY);const Ee=$e.createPattern(we.canvas,"repeat");return Ee.setTransform(_e),Ee}};Lt(ue,"MAX_PATTERN_SIZE",3e3);let ge=ue;te.TilingPattern=ge},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.convertBlackAndWhiteToRGBA=se,te.convertToRGBA=ie,te.grayToRGBA=me;var re=ne(1);function ie(he){switch(he.kind){case re.ImageKind.GRAYSCALE_1BPP:return se(he);case re.ImageKind.RGB_24BPP:return oe(he)}return null}function se({src:he,srcPos:fe=0,dest:ae,width:le,height:ye,nonBlackColor:ve=4294967295,inverseDecode:de=!1}){const ge=re.FeatureTest.isLittleEndian?4278190080:255,[ue,Te]=de?[ve,ge]:[ge,ve],$e=le>>3,ke=le&7,Ce=he.length;ae=new Uint32Array(ae.buffer);let ce=0;for(let be=0;be<ye;be++){for(const _e=fe+$e;fe<_e;fe++){const Ee=fe<Ce?he[fe]:255;ae[ce++]=Ee&128?Te:ue,ae[ce++]=Ee&64?Te:ue,ae[ce++]=Ee&32?Te:ue,ae[ce++]=Ee&16?Te:ue,ae[ce++]=Ee&8?Te:ue,ae[ce++]=Ee&4?Te:ue,ae[ce++]=Ee&2?Te:ue,ae[ce++]=Ee&1?Te:ue}if(ke===0)continue;const we=fe<Ce?he[fe++]:255;for(let _e=0;_e<ke;_e++)ae[ce++]=we&1<<7-_e?Te:ue}return{srcPos:fe,destPos:ce}}function oe({src:he,srcPos:fe=0,dest:ae,destPos:le=0,width:ye,height:ve}){let de=0;const ge=he.length>>2,ue=new Uint32Array(he.buffer,fe,ge);if(re.FeatureTest.isLittleEndian){for(;de<ge-2;de+=3,le+=4){const Te=ue[de],$e=ue[de+1],ke=ue[de+2];ae[le]=Te|4278190080,ae[le+1]=Te>>>24|$e<<8|4278190080,ae[le+2]=$e>>>16|ke<<16|4278190080,ae[le+3]=ke>>>8|4278190080}for(let Te=de*4,$e=he.length;Te<$e;Te+=3)ae[le++]=he[Te]|he[Te+1]<<8|he[Te+2]<<16|4278190080}else{for(;de<ge-2;de+=3,le+=4){const Te=ue[de],$e=ue[de+1],ke=ue[de+2];ae[le]=Te|255,ae[le+1]=Te<<24|$e>>>8|255,ae[le+2]=$e<<16|ke>>>16|255,ae[le+3]=ke<<8|255}for(let Te=de*4,$e=he.length;Te<$e;Te+=3)ae[le++]=he[Te]<<24|he[Te+1]<<16|he[Te+2]<<8|255}return{srcPos:fe,destPos:le}}function me(he,fe){if(re.FeatureTest.isLittleEndian)for(let ae=0,le=he.length;ae<le;ae++)fe[ae]=he[ae]*65793|4278190080;else for(let ae=0,le=he.length;ae<le;ae++)fe[ae]=he[ae]*16843008|255}},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.GlobalWorkerOptions=void 0;const ne=Object.create(null);te.GlobalWorkerOptions=ne,ne.workerPort=null,ne.workerSrc=""},(ee,te,ne)=>{var he,ur,ae,dr,ye,Rn;Object.defineProperty(te,"__esModule",{value:!0}),te.MessageHandler=void 0;var re=ne(1);const ie={UNKNOWN:0,DATA:1,ERROR:2},se={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function oe(de){switch(de instanceof Error||typeof de=="object"&&de!==null||(0,re.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),de.name){case"AbortException":return new re.AbortException(de.message);case"MissingPDFException":return new re.MissingPDFException(de.message);case"PasswordException":return new re.PasswordException(de.message,de.code);case"UnexpectedResponseException":return new re.UnexpectedResponseException(de.message,de.status);case"UnknownErrorException":return new re.UnknownErrorException(de.message,de.details);default:return new re.UnknownErrorException(de.message,de.toString())}}class me{constructor(ge,ue,Te){Qe(this,he);Qe(this,ae);Qe(this,ye);this.sourceName=ge,this.targetName=ue,this.comObj=Te,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=$e=>{const ke=$e.data;if(ke.targetName!==this.sourceName)return;if(ke.stream){it(this,ae,dr).call(this,ke);return}if(ke.callback){const ce=ke.callbackId,be=this.callbackCapabilities[ce];if(!be)throw new Error("Cannot resolve callback ".concat(ce));if(delete this.callbackCapabilities[ce],ke.callback===ie.DATA)be.resolve(ke.data);else if(ke.callback===ie.ERROR)be.reject(oe(ke.reason));else throw new Error("Unexpected callback case");return}const Ce=this.actionHandler[ke.action];if(!Ce)throw new Error("Unknown action from worker: ".concat(ke.action));if(ke.callbackId){const ce=this.sourceName,be=ke.sourceName;new Promise(function(we){we(Ce(ke.data))}).then(function(we){Te.postMessage({sourceName:ce,targetName:be,callback:ie.DATA,callbackId:ke.callbackId,data:we})},function(we){Te.postMessage({sourceName:ce,targetName:be,callback:ie.ERROR,callbackId:ke.callbackId,reason:oe(we)})});return}if(ke.streamId){it(this,he,ur).call(this,ke);return}Ce(ke.data)},Te.addEventListener("message",this._onComObjOnMessage)}on(ge,ue){const Te=this.actionHandler;if(Te[ge])throw new Error('There is already an actionName called "'.concat(ge,'"'));Te[ge]=ue}send(ge,ue,Te){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ge,data:ue},Te)}sendWithPromise(ge,ue,Te){const $e=this.callbackId++,ke=new re.PromiseCapability;this.callbackCapabilities[$e]=ke;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ge,callbackId:$e,data:ue},Te)}catch(Ce){ke.reject(Ce)}return ke.promise}sendWithStream(ge,ue,Te,$e){const ke=this.streamId++,Ce=this.sourceName,ce=this.targetName,be=this.comObj;return new ReadableStream({start:we=>{const _e=new re.PromiseCapability;return this.streamControllers[ke]={controller:we,startCall:_e,pullCall:null,cancelCall:null,isClosed:!1},be.postMessage({sourceName:Ce,targetName:ce,action:ge,streamId:ke,data:ue,desiredSize:we.desiredSize},$e),_e.promise},pull:we=>{const _e=new re.PromiseCapability;return this.streamControllers[ke].pullCall=_e,be.postMessage({sourceName:Ce,targetName:ce,stream:se.PULL,streamId:ke,desiredSize:we.desiredSize}),_e.promise},cancel:we=>{(0,re.assert)(we instanceof Error,"cancel must have a valid reason");const _e=new re.PromiseCapability;return this.streamControllers[ke].cancelCall=_e,this.streamControllers[ke].isClosed=!0,be.postMessage({sourceName:Ce,targetName:ce,stream:se.CANCEL,streamId:ke,reason:oe(we)}),_e.promise}},Te)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}he=new WeakSet,ur=function(ge){const ue=ge.streamId,Te=this.sourceName,$e=ge.sourceName,ke=this.comObj,Ce=this,ce=this.actionHandler[ge.action],be={enqueue(we,_e=1,Ee){if(this.isCancelled)return;const De=this.desiredSize;this.desiredSize-=_e,De>0&&this.desiredSize<=0&&(this.sinkCapability=new re.PromiseCapability,this.ready=this.sinkCapability.promise),ke.postMessage({sourceName:Te,targetName:$e,stream:se.ENQUEUE,streamId:ue,chunk:we},Ee)},close(){this.isCancelled||(this.isCancelled=!0,ke.postMessage({sourceName:Te,targetName:$e,stream:se.CLOSE,streamId:ue}),delete Ce.streamSinks[ue])},error(we){(0,re.assert)(we instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,ke.postMessage({sourceName:Te,targetName:$e,stream:se.ERROR,streamId:ue,reason:oe(we)}))},sinkCapability:new re.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:ge.desiredSize,ready:null};be.sinkCapability.resolve(),be.ready=be.sinkCapability.promise,this.streamSinks[ue]=be,new Promise(function(we){we(ce(ge.data,be))}).then(function(){ke.postMessage({sourceName:Te,targetName:$e,stream:se.START_COMPLETE,streamId:ue,success:!0})},function(we){ke.postMessage({sourceName:Te,targetName:$e,stream:se.START_COMPLETE,streamId:ue,reason:oe(we)})})},ae=new WeakSet,dr=function(ge){const ue=ge.streamId,Te=this.sourceName,$e=ge.sourceName,ke=this.comObj,Ce=this.streamControllers[ue],ce=this.streamSinks[ue];switch(ge.stream){case se.START_COMPLETE:ge.success?Ce.startCall.resolve():Ce.startCall.reject(oe(ge.reason));break;case se.PULL_COMPLETE:ge.success?Ce.pullCall.resolve():Ce.pullCall.reject(oe(ge.reason));break;case se.PULL:if(!ce){ke.postMessage({sourceName:Te,targetName:$e,stream:se.PULL_COMPLETE,streamId:ue,success:!0});break}ce.desiredSize<=0&&ge.desiredSize>0&&ce.sinkCapability.resolve(),ce.desiredSize=ge.desiredSize,new Promise(function(be){var we;be((we=ce.onPull)==null?void 0:we.call(ce))}).then(function(){ke.postMessage({sourceName:Te,targetName:$e,stream:se.PULL_COMPLETE,streamId:ue,success:!0})},function(be){ke.postMessage({sourceName:Te,targetName:$e,stream:se.PULL_COMPLETE,streamId:ue,reason:oe(be)})});break;case se.ENQUEUE:if((0,re.assert)(Ce,"enqueue should have stream controller"),Ce.isClosed)break;Ce.controller.enqueue(ge.chunk);break;case se.CLOSE:if((0,re.assert)(Ce,"close should have stream controller"),Ce.isClosed)break;Ce.isClosed=!0,Ce.controller.close(),it(this,ye,Rn).call(this,Ce,ue);break;case se.ERROR:(0,re.assert)(Ce,"error should have stream controller"),Ce.controller.error(oe(ge.reason)),it(this,ye,Rn).call(this,Ce,ue);break;case se.CANCEL_COMPLETE:ge.success?Ce.cancelCall.resolve():Ce.cancelCall.reject(oe(ge.reason)),it(this,ye,Rn).call(this,Ce,ue);break;case se.CANCEL:if(!ce)break;new Promise(function(be){var we;be((we=ce.onCancel)==null?void 0:we.call(ce,oe(ge.reason)))}).then(function(){ke.postMessage({sourceName:Te,targetName:$e,stream:se.CANCEL_COMPLETE,streamId:ue,success:!0})},function(be){ke.postMessage({sourceName:Te,targetName:$e,stream:se.CANCEL_COMPLETE,streamId:ue,reason:oe(be)})}),ce.sinkCapability.reject(oe(ge.reason)),ce.isCancelled=!0,delete this.streamSinks[ue];break;default:throw new Error("Unexpected stream case")}},ye=new WeakSet,Rn=async function(ge,ue){var Te,$e,ke;await Promise.allSettled([(Te=ge.startCall)==null?void 0:Te.promise,($e=ge.pullCall)==null?void 0:$e.promise,(ke=ge.cancelCall)==null?void 0:ke.promise]),delete this.streamControllers[ue]},te.MessageHandler=me},(ee,te,ne)=>{var se,oe;Object.defineProperty(te,"__esModule",{value:!0}),te.Metadata=void 0;var re=ne(1);class ie{constructor({parsedData:he,rawData:fe}){Qe(this,se,void 0);Qe(this,oe,void 0);pt(this,se,he),pt(this,oe,fe)}getRaw(){return Fe(this,oe)}get(he){var fe;return(fe=Fe(this,se).get(he))!=null?fe:null}getAll(){return(0,re.objectFromMap)(Fe(this,se))}has(he){return Fe(this,se).has(he)}}se=new WeakMap,oe=new WeakMap,te.Metadata=ie},(ee,te,ne)=>{var he,fe,ae,le,ye,ve,Hn;Object.defineProperty(te,"__esModule",{value:!0}),te.OptionalContentConfig=void 0;var re=ne(1),ie=ne(8);const se=Symbol("INTERNAL");class oe{constructor(ue,Te){Qe(this,he,!0);this.name=ue,this.intent=Te}get visible(){return Fe(this,he)}_setVisible(ue,Te){ue!==se&&(0,re.unreachable)("Internal method `_setVisible` called."),pt(this,he,Te)}}he=new WeakMap;class me{constructor(ue){Qe(this,ve);Qe(this,fe,null);Qe(this,ae,new Map);Qe(this,le,null);Qe(this,ye,null);if(this.name=null,this.creator=null,ue!==null){this.name=ue.name,this.creator=ue.creator,pt(this,ye,ue.order);for(const Te of ue.groups)Fe(this,ae).set(Te.id,new oe(Te.name,Te.intent));if(ue.baseState==="OFF")for(const Te of Fe(this,ae).values())Te._setVisible(se,!1);for(const Te of ue.on)Fe(this,ae).get(Te)._setVisible(se,!0);for(const Te of ue.off)Fe(this,ae).get(Te)._setVisible(se,!1);pt(this,le,this.getHash())}}isVisible(ue){if(Fe(this,ae).size===0)return!0;if(!ue)return(0,re.warn)("Optional content group not defined."),!0;if(ue.type==="OCG")return Fe(this,ae).has(ue.id)?Fe(this,ae).get(ue.id).visible:((0,re.warn)("Optional content group not found: ".concat(ue.id)),!0);if(ue.type==="OCMD"){if(ue.expression)return it(this,ve,Hn).call(this,ue.expression);if(!ue.policy||ue.policy==="AnyOn"){for(const Te of ue.ids){if(!Fe(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(Fe(this,ae).get(Te).visible)return!0}return!1}else if(ue.policy==="AllOn"){for(const Te of ue.ids){if(!Fe(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!Fe(this,ae).get(Te).visible)return!1}return!0}else if(ue.policy==="AnyOff"){for(const Te of ue.ids){if(!Fe(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!Fe(this,ae).get(Te).visible)return!0}return!1}else if(ue.policy==="AllOff"){for(const Te of ue.ids){if(!Fe(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(Fe(this,ae).get(Te).visible)return!1}return!0}return(0,re.warn)("Unknown optional content policy ".concat(ue.policy,".")),!0}return(0,re.warn)("Unknown group type ".concat(ue.type,".")),!0}setVisibility(ue,Te=!0){if(!Fe(this,ae).has(ue)){(0,re.warn)("Optional content group not found: ".concat(ue));return}Fe(this,ae).get(ue)._setVisible(se,!!Te),pt(this,fe,null)}get hasInitialVisibility(){return this.getHash()===Fe(this,le)}getOrder(){return Fe(this,ae).size?Fe(this,ye)?Fe(this,ye).slice():[...Fe(this,ae).keys()]:null}getGroups(){return Fe(this,ae).size>0?(0,re.objectFromMap)(Fe(this,ae)):null}getGroup(ue){return Fe(this,ae).get(ue)||null}getHash(){if(Fe(this,fe)!==null)return Fe(this,fe);const ue=new ie.MurmurHash3_64;for(const[Te,$e]of Fe(this,ae))ue.update("".concat(Te,":").concat($e.visible));return pt(this,fe,ue.hexdigest())}}fe=new WeakMap,ae=new WeakMap,le=new WeakMap,ye=new WeakMap,ve=new WeakSet,Hn=function(ue){const Te=ue.length;if(Te<2)return!0;const $e=ue[0];for(let ke=1;ke<Te;ke++){const Ce=ue[ke];let ce;if(Array.isArray(Ce))ce=it(this,ve,Hn).call(this,Ce);else if(Fe(this,ae).has(Ce))ce=Fe(this,ae).get(Ce).visible;else return(0,re.warn)("Optional content group not found: ".concat(Ce)),!0;switch($e){case"And":if(!ce)return!1;break;case"Or":if(ce)return!0;break;case"Not":return!ce;default:return!0}}return $e==="And"},te.OptionalContentConfig=me},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFDataTransportStream=void 0;var re=ne(1),ie=ne(6);class se{constructor({length:fe,initialData:ae,progressiveDone:le=!1,contentDispositionFilename:ye=null,disableRange:ve=!1,disableStream:de=!1},ge){if((0,re.assert)(ge,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=le,this._contentDispositionFilename=ye,(ae==null?void 0:ae.length)>0){const ue=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;this._queuedChunks.push(ue)}this._pdfDataRangeTransport=ge,this._isStreamingSupported=!de,this._isRangeSupported=!ve,this._contentLength=fe,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((ue,Te)=>{this._onReceiveData({begin:ue,chunk:Te})}),this._pdfDataRangeTransport.addProgressListener((ue,Te)=>{this._onProgress({loaded:ue,total:Te})}),this._pdfDataRangeTransport.addProgressiveReadListener(ue=>{this._onReceiveData({chunk:ue})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:fe,chunk:ae}){const le=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;if(fe===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(le):this._queuedChunks.push(le);else{const ye=this._rangeReaders.some(function(ve){return ve._begin!==fe?!1:(ve._enqueue(le),!0)});(0,re.assert)(ye,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var fe,ae;return(ae=(fe=this._fullRequestReader)==null?void 0:fe._loaded)!=null?ae:0}_onProgress(fe){var ae,le,ye,ve;fe.total===void 0?(le=(ae=this._rangeReaders[0])==null?void 0:ae.onProgress)==null||le.call(ae,{loaded:fe.loaded}):(ve=(ye=this._fullRequestReader)==null?void 0:ye.onProgress)==null||ve.call(ye,{loaded:fe.loaded,total:fe.total})}_onProgressiveDone(){var fe;(fe=this._fullRequestReader)==null||fe.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(fe){const ae=this._rangeReaders.indexOf(fe);ae>=0&&this._rangeReaders.splice(ae,1)}getFullReader(){(0,re.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const fe=this._queuedChunks;return this._queuedChunks=null,new oe(this,fe,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(fe,ae){if(ae<=this._progressiveDataLength)return null;const le=new me(this,fe,ae);return this._pdfDataRangeTransport.requestDataRange(fe,ae),this._rangeReaders.push(le),le}cancelAllRequests(fe){var ae;(ae=this._fullRequestReader)==null||ae.cancel(fe);for(const le of this._rangeReaders.slice(0))le.cancel(fe);this._pdfDataRangeTransport.abort()}}te.PDFDataTransportStream=se;class oe{constructor(fe,ae,le=!1,ye=null){this._stream=fe,this._done=le||!1,this._filename=(0,ie.isPdfFile)(ye)?ye:null,this._queuedChunks=ae||[],this._loaded=0;for(const ve of this._queuedChunks)this._loaded+=ve.byteLength;this._requests=[],this._headersReady=Promise.resolve(),fe._fullRequestReader=this,this.onProgress=null}_enqueue(fe){this._done||(this._requests.length>0?this._requests.shift().resolve({value:fe,done:!1}):this._queuedChunks.push(fe),this._loaded+=fe.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const fe=new re.PromiseCapability;return this._requests.push(fe),fe.promise}cancel(fe){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class me{constructor(fe,ae,le){this._stream=fe,this._begin=ae,this._end=le,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(fe){if(!this._done){if(this._requests.length===0)this._queuedChunk=fe;else{this._requests.shift().resolve({value:fe,done:!1});for(const le of this._requests)le.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const ae=this._queuedChunk;return this._queuedChunk=null,{value:ae,done:!1}}if(this._done)return{value:void 0,done:!0};const fe=new re.PromiseCapability;return this._requests.push(fe),fe.promise}cancel(fe){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaText=void 0;class ne{static textContent(ie){const se=[],oe={items:se,styles:Object.create(null)};function me(he){var le;if(!he)return;let fe=null;const ae=he.name;if(ae==="#text")fe=he.value;else if(ne.shouldBuildText(ae))(le=he==null?void 0:he.attributes)!=null&&le.textContent?fe=he.attributes.textContent:he.value&&(fe=he.value);else return;if(fe!==null&&se.push({str:fe}),!!he.children)for(const ye of he.children)me(ye)}return me(ie),oe}static shouldBuildText(ie){return!(ie==="textarea"||ie==="input"||ie==="option"||ie==="select")}}te.XfaText=ne},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NodeStandardFontDataFactory=te.NodeFilterFactory=te.NodeCanvasFactory=te.NodeCMapReaderFactory=void 0;var re=ne(7);const ie=function(fe){return new Promise((ae,le)=>{require$$5.readFile(fe,(ve,de)=>{if(ve||!de){le(new Error(ve));return}ae(new Uint8Array(de))})})};class se extends re.BaseFilterFactory{}te.NodeFilterFactory=se;class oe extends re.BaseCanvasFactory{_createCanvas(ae,le){return require$$5.createCanvas(ae,le)}}te.NodeCanvasFactory=oe;class me extends re.BaseCMapReaderFactory{_fetchData(ae,le){return ie(ae).then(ye=>({cMapData:ye,compressionType:le}))}}te.NodeCMapReaderFactory=me;class he extends re.BaseStandardFontDataFactory{_fetchData(ae){return ie(ae)}}te.NodeStandardFontDataFactory=he},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNodeStream=void 0;var re=ne(1),ie=ne(22);const se=require$$5,oe=require$$5,me=require$$5,he=require$$5,fe=/^file:\/\/\/[a-zA-Z]:\//;function ae(ke){const Ce=he.parse(ke);return Ce.protocol==="file:"||Ce.host?Ce:/^[a-z]:[/\\]/i.test(ke)?he.parse("file:///".concat(ke)):(Ce.host||(Ce.protocol="file:"),Ce)}class le{constructor(Ce){this.source=Ce,this.url=ae(Ce.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Ce.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ce,ce;return(ce=(Ce=this._fullRequestReader)==null?void 0:Ce._loaded)!=null?ce:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Te(this):new ge(this),this._fullRequestReader}getRangeReader(Ce,ce){if(ce<=this._progressiveDataLength)return null;const be=this.isFsUrl?new $e(this,Ce,ce):new ue(this,Ce,ce);return this._rangeRequestReaders.push(be),be}cancelAllRequests(Ce){var ce;(ce=this._fullRequestReader)==null||ce.cancel(Ce);for(const be of this._rangeRequestReaders.slice(0))be.cancel(Ce)}}te.PDFNodeStream=le;class ye{constructor(Ce){this._url=Ce.url,this._done=!1,this._storedError=null,this.onProgress=null;const ce=Ce.source;this._contentLength=ce.length,this._loaded=0,this._filename=null,this._disableRange=ce.disableRange||!1,this._rangeChunkSize=ce.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!ce.disableStream,this._isRangeSupported=!ce.disableRange,this._readableStream=null,this._readCapability=new re.PromiseCapability,this._headersCapability=new re.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var be;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Ce=this._readableStream.read();return Ce===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Ce.length,(be=this.onProgress)==null||be.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Ce).buffer,done:!1})}cancel(Ce){if(!this._readableStream){this._error(Ce);return}this._readableStream.destroy(Ce)}_error(Ce){this._storedError=Ce,this._readCapability.resolve()}_setReadableStream(Ce){this._readableStream=Ce,Ce.on("readable",()=>{this._readCapability.resolve()}),Ce.on("end",()=>{Ce.destroy(),this._done=!0,this._readCapability.resolve()}),Ce.on("error",ce=>{this._error(ce)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new re.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class ve{constructor(Ce){this._url=Ce.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new re.PromiseCapability;const ce=Ce.source;this._isStreamingSupported=!ce.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var be;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Ce=this._readableStream.read();return Ce===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Ce.length,(be=this.onProgress)==null||be.call(this,{loaded:this._loaded}),{value:new Uint8Array(Ce).buffer,done:!1})}cancel(Ce){if(!this._readableStream){this._error(Ce);return}this._readableStream.destroy(Ce)}_error(Ce){this._storedError=Ce,this._readCapability.resolve()}_setReadableStream(Ce){this._readableStream=Ce,Ce.on("readable",()=>{this._readCapability.resolve()}),Ce.on("end",()=>{Ce.destroy(),this._done=!0,this._readCapability.resolve()}),Ce.on("error",ce=>{this._error(ce)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function de(ke,Ce){return{protocol:ke.protocol,auth:ke.auth,host:ke.hostname,port:ke.port,path:ke.path,method:"GET",headers:Ce}}class ge extends ye{constructor(Ce){super(Ce);const ce=be=>{if(be.statusCode===404){const De=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=De,this._headersCapability.reject(De);return}this._headersCapability.resolve(),this._setReadableStream(be);const we=De=>this._readableStream.headers[De.toLowerCase()],{allowRangeRequests:_e,suggestedLength:Ee}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:we,isHttp:Ce.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=_e,this._contentLength=Ee||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(we)};this._request=null,this._url.protocol==="http:"?this._request=oe.request(de(this._url,Ce.httpHeaders),ce):this._request=me.request(de(this._url,Ce.httpHeaders),ce),this._request.on("error",be=>{this._storedError=be,this._headersCapability.reject(be)}),this._request.end()}}class ue extends ve{constructor(Ce,ce,be){super(Ce),this._httpHeaders={};for(const _e in Ce.httpHeaders){const Ee=Ce.httpHeaders[_e];Ee!==void 0&&(this._httpHeaders[_e]=Ee)}this._httpHeaders.Range="bytes=".concat(ce,"-").concat(be-1);const we=_e=>{if(_e.statusCode===404){const Ee=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=Ee;return}this._setReadableStream(_e)};this._request=null,this._url.protocol==="http:"?this._request=oe.request(de(this._url,this._httpHeaders),we):this._request=me.request(de(this._url,this._httpHeaders),we),this._request.on("error",_e=>{this._storedError=_e}),this._request.end()}}class Te extends ye{constructor(Ce){super(Ce);let ce=decodeURIComponent(this._url.path);fe.test(this._url.href)&&(ce=ce.replace(/^\//,"")),se.lstat(ce,(be,we)=>{if(be){be.code==="ENOENT"&&(be=new re.MissingPDFException('Missing PDF "'.concat(ce,'".'))),this._storedError=be,this._headersCapability.reject(be);return}this._contentLength=we.size,this._setReadableStream(se.createReadStream(ce)),this._headersCapability.resolve()})}}class $e extends ve{constructor(Ce,ce,be){super(Ce);let we=decodeURIComponent(this._url.path);fe.test(this._url.href)&&(we=we.replace(/^\//,"")),this._setReadableStream(se.createReadStream(we,{start:ce,end:be-1}))}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.createResponseStatusError=he,te.extractFilenameFromHeader=me,te.validateRangeRequestCapabilities=oe,te.validateResponseStatus=fe;var re=ne(1),ie=ne(23),se=ne(6);function oe({getResponseHeader:ae,isHttp:le,rangeChunkSize:ye,disableRange:ve}){const de={allowRangeRequests:!1,suggestedLength:void 0},ge=parseInt(ae("Content-Length"),10);return!Number.isInteger(ge)||(de.suggestedLength=ge,ge<=2*ye)||ve||!le||ae("Accept-Ranges")!=="bytes"||(ae("Content-Encoding")||"identity")!=="identity"||(de.allowRangeRequests=!0),de}function me(ae){const le=ae("Content-Disposition");if(le){let ye=(0,ie.getFilenameFromContentDispositionHeader)(le);if(ye.includes("%"))try{ye=decodeURIComponent(ye)}catch{}if((0,se.isPdfFile)(ye))return ye}return null}function he(ae,le){return ae===404||ae===0&&le.startsWith("file:")?new re.MissingPDFException('Missing PDF "'+le+'".'):new re.UnexpectedResponseException("Unexpected server response (".concat(ae,') while retrieving PDF "').concat(le,'".'),ae)}function fe(ae){return ae===200||ae===206}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.getFilenameFromContentDispositionHeader=ie;var re=ne(1);function ie(se){let oe=!0,me=he("filename\\*","i").exec(se);if(me){me=me[1];let ge=ye(me);return ge=unescape(ge),ge=ve(ge),ge=de(ge),ae(ge)}if(me=le(se),me){const ge=de(me);return ae(ge)}if(me=he("filename","i").exec(se),me){me=me[1];let ge=ye(me);return ge=de(ge),ae(ge)}function he(ge,ue){return new RegExp("(?:^|;)\\s*"+ge+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',ue)}function fe(ge,ue){if(ge){if(!/^[\x00-\xFF]+$/.test(ue))return ue;try{const Te=new TextDecoder(ge,{fatal:!0}),$e=(0,re.stringToBytes)(ue);ue=Te.decode($e),oe=!1}catch{}}return ue}function ae(ge){return oe&&/[\x80-\xff]/.test(ge)&&(ge=fe("utf-8",ge),oe&&(ge=fe("iso-8859-1",ge))),ge}function le(ge){const ue=[];let Te;const $e=he("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(Te=$e.exec(ge))!==null;){let[,Ce,ce,be]=Te;if(Ce=parseInt(Ce,10),Ce in ue){if(Ce===0)break;continue}ue[Ce]=[ce,be]}const ke=[];for(let Ce=0;Ce<ue.length&&Ce in ue;++Ce){let[ce,be]=ue[Ce];be=ye(be),ce&&(be=unescape(be),Ce===0&&(be=ve(be))),ke.push(be)}return ke.join("")}function ye(ge){if(ge.startsWith('"')){const ue=ge.slice(1).split('\\"');for(let Te=0;Te<ue.length;++Te){const $e=ue[Te].indexOf('"');$e!==-1&&(ue[Te]=ue[Te].slice(0,$e),ue.length=Te+1),ue[Te]=ue[Te].replaceAll(/\\(.)/g,"$1")}ge=ue.join('"')}return ge}function ve(ge){const ue=ge.indexOf("'");if(ue===-1)return ge;const Te=ge.slice(0,ue),ke=ge.slice(ue+1).replace(/^[^']*'/,"");return fe(Te,ke)}function de(ge){return!ge.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(ge)?ge:ge.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(ue,Te,$e,ke){if($e==="q"||$e==="Q")return ke=ke.replaceAll("_"," "),ke=ke.replaceAll(/=([0-9a-fA-F]{2})/g,function(Ce,ce){return String.fromCharCode(parseInt(ce,16))}),fe(Te,ke);try{ke=atob(ke)}catch{}return fe(Te,ke)})}return""}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNetworkStream=void 0;var re=ne(1),ie=ne(22);const se=200,oe=206;function me(ye){const ve=ye.response;return typeof ve!="string"?ve:(0,re.stringToBytes)(ve).buffer}class he{constructor(ve,de={}){this.url=ve,this.isHttp=/^https?:/i.test(ve),this.httpHeaders=this.isHttp&&de.httpHeaders||Object.create(null),this.withCredentials=de.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(ve,de,ge){const ue={begin:ve,end:de};for(const Te in ge)ue[Te]=ge[Te];return this.request(ue)}requestFull(ve){return this.request(ve)}request(ve){const de=new XMLHttpRequest,ge=this.currXhrId++,ue=this.pendingRequests[ge]={xhr:de};de.open("GET",this.url),de.withCredentials=this.withCredentials;for(const Te in this.httpHeaders){const $e=this.httpHeaders[Te];$e!==void 0&&de.setRequestHeader(Te,$e)}return this.isHttp&&"begin"in ve&&"end"in ve?(de.setRequestHeader("Range","bytes=".concat(ve.begin,"-").concat(ve.end-1)),ue.expectedStatus=oe):ue.expectedStatus=se,de.responseType="arraybuffer",ve.onError&&(de.onerror=function(Te){ve.onError(de.status)}),de.onreadystatechange=this.onStateChange.bind(this,ge),de.onprogress=this.onProgress.bind(this,ge),ue.onHeadersReceived=ve.onHeadersReceived,ue.onDone=ve.onDone,ue.onError=ve.onError,ue.onProgress=ve.onProgress,de.send(null),ge}onProgress(ve,de){var ue;const ge=this.pendingRequests[ve];ge&&((ue=ge.onProgress)==null||ue.call(ge,de))}onStateChange(ve,de){var Ce,ce,be;const ge=this.pendingRequests[ve];if(!ge)return;const ue=ge.xhr;if(ue.readyState>=2&&ge.onHeadersReceived&&(ge.onHeadersReceived(),delete ge.onHeadersReceived),ue.readyState!==4||!(ve in this.pendingRequests))return;if(delete this.pendingRequests[ve],ue.status===0&&this.isHttp){(Ce=ge.onError)==null||Ce.call(ge,ue.status);return}const Te=ue.status||se;if(!(Te===se&&ge.expectedStatus===oe)&&Te!==ge.expectedStatus){(ce=ge.onError)==null||ce.call(ge,ue.status);return}const ke=me(ue);if(Te===oe){const we=ue.getResponseHeader("Content-Range"),_e=/bytes (\d+)-(\d+)\/(\d+)/.exec(we);ge.onDone({begin:parseInt(_e[1],10),chunk:ke})}else ke?ge.onDone({begin:0,chunk:ke}):(be=ge.onError)==null||be.call(ge,ue.status)}getRequestXhr(ve){return this.pendingRequests[ve].xhr}isPendingRequest(ve){return ve in this.pendingRequests}abortRequest(ve){const de=this.pendingRequests[ve].xhr;delete this.pendingRequests[ve],de.abort()}}class fe{constructor(ve){this._source=ve,this._manager=new he(ve.url,{httpHeaders:ve.httpHeaders,withCredentials:ve.withCredentials}),this._rangeChunkSize=ve.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(ve){const de=this._rangeRequestReaders.indexOf(ve);de>=0&&this._rangeRequestReaders.splice(de,1)}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ae(this._manager,this._source),this._fullRequestReader}getRangeReader(ve,de){const ge=new le(this._manager,ve,de);return ge.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(ge),ge}cancelAllRequests(ve){var de;(de=this._fullRequestReader)==null||de.cancel(ve);for(const ge of this._rangeRequestReaders.slice(0))ge.cancel(ve)}}te.PDFNetworkStream=fe;class ae{constructor(ve,de){this._manager=ve;const ge={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=de.url,this._fullRequestId=ve.requestFull(ge),this._headersReceivedCapability=new re.PromiseCapability,this._disableRange=de.disableRange||!1,this._contentLength=de.length,this._rangeChunkSize=de.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const ve=this._fullRequestId,de=this._manager.getRequestXhr(ve),ge=$e=>de.getResponseHeader($e),{allowRangeRequests:ue,suggestedLength:Te}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:ge,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});ue&&(this._isRangeSupported=!0),this._contentLength=Te||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(ge),this._isRangeSupported&&this._manager.abortRequest(ve),this._headersReceivedCapability.resolve()}_onDone(ve){if(ve&&(this._requests.length>0?this._requests.shift().resolve({value:ve.chunk,done:!1}):this._cachedChunks.push(ve.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const de of this._requests)de.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(ve){this._storedError=(0,ie.createResponseStatusError)(ve,this._url),this._headersReceivedCapability.reject(this._storedError);for(const de of this._requests)de.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(ve){var de;(de=this.onProgress)==null||de.call(this,{loaded:ve.loaded,total:ve.lengthComputable?ve.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const ve=new re.PromiseCapability;return this._requests.push(ve),ve.promise}cancel(ve){this._done=!0,this._headersReceivedCapability.reject(ve);for(const de of this._requests)de.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class le{constructor(ve,de,ge){this._manager=ve;const ue={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=ve.url,this._requestId=ve.requestRange(de,ge,ue),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var ve;(ve=this.onClosed)==null||ve.call(this,this)}_onDone(ve){const de=ve.chunk;this._requests.length>0?this._requests.shift().resolve({value:de,done:!1}):this._queuedChunk=de,this._done=!0;for(const ge of this._requests)ge.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(ve){this._storedError=(0,ie.createResponseStatusError)(ve,this._url);for(const de of this._requests)de.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(ve){var de;this.isStreamingSupported||(de=this.onProgress)==null||de.call(this,{loaded:ve.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const de=this._queuedChunk;return this._queuedChunk=null,{value:de,done:!1}}if(this._done)return{value:void 0,done:!0};const ve=new re.PromiseCapability;return this._requests.push(ve),ve.promise}cancel(ve){this._done=!0;for(const de of this._requests)de.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFFetchStream=void 0;var re=ne(1),ie=ne(22);function se(le,ye,ve){return{method:"GET",headers:le,signal:ve.signal,mode:"cors",credentials:ye?"include":"same-origin",redirect:"follow"}}function oe(le){const ye=new Headers;for(const ve in le){const de=le[ve];de!==void 0&&ye.append(ve,de)}return ye}function me(le){return le instanceof Uint8Array?le.buffer:le instanceof ArrayBuffer?le:((0,re.warn)("getArrayBuffer - unexpected data format: ".concat(le)),new Uint8Array(le).buffer)}class he{constructor(ye){this.source=ye,this.isHttp=/^https?:/i.test(ye.url),this.httpHeaders=this.isHttp&&ye.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var ye,ve;return(ve=(ye=this._fullRequestReader)==null?void 0:ye._loaded)!=null?ve:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new fe(this),this._fullRequestReader}getRangeReader(ye,ve){if(ve<=this._progressiveDataLength)return null;const de=new ae(this,ye,ve);return this._rangeRequestReaders.push(de),de}cancelAllRequests(ye){var ve;(ve=this._fullRequestReader)==null||ve.cancel(ye);for(const de of this._rangeRequestReaders.slice(0))de.cancel(ye)}}te.PDFFetchStream=he;class fe{constructor(ye){this._stream=ye,this._reader=null,this._loaded=0,this._filename=null;const ve=ye.source;this._withCredentials=ve.withCredentials||!1,this._contentLength=ve.length,this._headersCapability=new re.PromiseCapability,this._disableRange=ve.disableRange||!1,this._rangeChunkSize=ve.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!ve.disableStream,this._isRangeSupported=!ve.disableRange,this._headers=oe(this._stream.httpHeaders);const de=ve.url;fetch(de,se(this._headers,this._withCredentials,this._abortController)).then(ge=>{if(!(0,ie.validateResponseStatus)(ge.status))throw(0,ie.createResponseStatusError)(ge.status,de);this._reader=ge.body.getReader(),this._headersCapability.resolve();const ue=ke=>ge.headers.get(ke),{allowRangeRequests:Te,suggestedLength:$e}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:ue,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Te,this._contentLength=$e||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(ue),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new re.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var de;await this._headersCapability.promise;const{value:ye,done:ve}=await this._reader.read();return ve?{value:ye,done:ve}:(this._loaded+=ye.byteLength,(de=this.onProgress)==null||de.call(this,{loaded:this._loaded,total:this._contentLength}),{value:me(ye),done:!1})}cancel(ye){var ve;(ve=this._reader)==null||ve.cancel(ye),this._abortController.abort()}}class ae{constructor(ye,ve,de){this._stream=ye,this._reader=null,this._loaded=0;const ge=ye.source;this._withCredentials=ge.withCredentials||!1,this._readCapability=new re.PromiseCapability,this._isStreamingSupported=!ge.disableStream,this._abortController=new AbortController,this._headers=oe(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(ve,"-").concat(de-1));const ue=ge.url;fetch(ue,se(this._headers,this._withCredentials,this._abortController)).then(Te=>{if(!(0,ie.validateResponseStatus)(Te.status))throw(0,ie.createResponseStatusError)(Te.status,ue);this._readCapability.resolve(),this._reader=Te.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var de;await this._readCapability.promise;const{value:ye,done:ve}=await this._reader.read();return ve?{value:ye,done:ve}:(this._loaded+=ye.byteLength,(de=this.onProgress)==null||de.call(this,{loaded:this._loaded}),{value:me(ye),done:!1})}cancel(ye){var ve;(ve=this._reader)==null||ve.cancel(ye),this._abortController.abort()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TextLayerRenderTask=void 0,te.renderTextLayer=ge,te.updateTextLayer=ue;var re=ne(1),ie=ne(6);const se=1e5,oe=30,me=.8,he=new Map;function fe(Te,$e){let ke;if($e&&re.FeatureTest.isOffscreenCanvasSupported)ke=new OffscreenCanvas(Te,Te).getContext("2d",{alpha:!1});else{const Ce=document.createElement("canvas");Ce.width=Ce.height=Te,ke=Ce.getContext("2d",{alpha:!1})}return ke}function ae(Te,$e){const ke=he.get(Te);if(ke)return ke;const Ce=fe(oe,$e);Ce.font="".concat(oe,"px ").concat(Te);const ce=Ce.measureText("");let be=ce.fontBoundingBoxAscent,we=Math.abs(ce.fontBoundingBoxDescent);if(be){const Ee=be/(be+we);return he.set(Te,Ee),Ce.canvas.width=Ce.canvas.height=0,Ee}Ce.strokeStyle="red",Ce.clearRect(0,0,oe,oe),Ce.strokeText("g",0,0);let _e=Ce.getImageData(0,0,oe,oe).data;we=0;for(let Ee=_e.length-1-3;Ee>=0;Ee-=4)if(_e[Ee]>0){we=Math.ceil(Ee/4/oe);break}Ce.clearRect(0,0,oe,oe),Ce.strokeText("A",0,oe),_e=Ce.getImageData(0,0,oe,oe).data,be=0;for(let Ee=0,De=_e.length;Ee<De;Ee+=4)if(_e[Ee]>0){be=oe-Math.floor(Ee/4/oe);break}if(Ce.canvas.width=Ce.canvas.height=0,be){const Ee=be/(be+we);return he.set(Te,Ee),Ee}return he.set(Te,me),me}function le(Te,$e,ke){const Ce=document.createElement("span"),ce={angle:0,canvasWidth:0,hasText:$e.str!=="",hasEOL:$e.hasEOL,fontSize:0};Te._textDivs.push(Ce);const be=re.Util.transform(Te._transform,$e.transform);let we=Math.atan2(be[1],be[0]);const _e=ke[$e.fontName];_e.vertical&&(we+=Math.PI/2);const Ee=Math.hypot(be[2],be[3]),De=Ee*ae(_e.fontFamily,Te._isOffscreenCanvasSupported);let Se,He;we===0?(Se=be[4],He=be[5]-De):(Se=be[4]+De*Math.sin(we),He=be[5]-De*Math.cos(we));const qe="calc(var(--scale-factor)*",Ke=Ce.style;Te._container===Te._rootContainer?(Ke.left="".concat((100*Se/Te._pageWidth).toFixed(2),"%"),Ke.top="".concat((100*He/Te._pageHeight).toFixed(2),"%")):(Ke.left="".concat(qe).concat(Se.toFixed(2),"px)"),Ke.top="".concat(qe).concat(He.toFixed(2),"px)")),Ke.fontSize="".concat(qe).concat(Ee.toFixed(2),"px)"),Ke.fontFamily=_e.fontFamily,ce.fontSize=Ee,Ce.setAttribute("role","presentation"),Ce.textContent=$e.str,Ce.dir=$e.dir,Te._fontInspectorEnabled&&(Ce.dataset.fontName=$e.fontName),we!==0&&(ce.angle=we*(180/Math.PI));let Je=!1;if($e.str.length>1)Je=!0;else if($e.str!==" "&&$e.transform[0]!==$e.transform[3]){const et=Math.abs($e.transform[0]),ut=Math.abs($e.transform[3]);et!==ut&&Math.max(et,ut)/Math.min(et,ut)>1.5&&(Je=!0)}Je&&(ce.canvasWidth=_e.vertical?$e.height:$e.width),Te._textDivProperties.set(Ce,ce),Te._isReadableStream&&Te._layoutText(Ce)}function ye(Te){const{div:$e,scale:ke,properties:Ce,ctx:ce,prevFontSize:be,prevFontFamily:we}=Te,{style:_e}=$e;let Ee="";if(Ce.canvasWidth!==0&&Ce.hasText){const{fontFamily:De}=_e,{canvasWidth:Se,fontSize:He}=Ce;(be!==He||we!==De)&&(ce.font="".concat(He*ke,"px ").concat(De),Te.prevFontSize=He,Te.prevFontFamily=De);const{width:qe}=ce.measureText($e.textContent);qe>0&&(Ee="scaleX(".concat(Se*ke/qe,")"))}Ce.angle!==0&&(Ee="rotate(".concat(Ce.angle,"deg) ").concat(Ee)),Ee.length>0&&(_e.transform=Ee)}function ve(Te){if(Te._canceled)return;const $e=Te._textDivs,ke=Te._capability;if($e.length>se){ke.resolve();return}if(!Te._isReadableStream)for(const ce of $e)Te._layoutText(ce);ke.resolve()}class de{constructor({textContentSource:$e,container:ke,viewport:Ce,textDivs:ce,textDivProperties:be,textContentItemsStr:we,isOffscreenCanvasSupported:_e}){var qe;this._textContentSource=$e,this._isReadableStream=$e instanceof ReadableStream,this._container=this._rootContainer=ke,this._textDivs=ce||[],this._textContentItemsStr=we||[],this._isOffscreenCanvasSupported=_e,this._fontInspectorEnabled=!!((qe=globalThis.FontInspector)!=null&&qe.enabled),this._reader=null,this._textDivProperties=be||new WeakMap,this._canceled=!1,this._capability=new re.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:Ce.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:fe(0,_e)};const{pageWidth:Ee,pageHeight:De,pageX:Se,pageY:He}=Ce.rawDims;this._transform=[1,0,0,-1,-Se,He+De],this._pageWidth=Ee,this._pageHeight=De,(0,ie.setLayerDimensions)(ke,Ce),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new re.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new re.AbortException("TextLayer task cancelled."))}_processItems($e,ke){for(const Ce of $e){if(Ce.str===void 0){if(Ce.type==="beginMarkedContentProps"||Ce.type==="beginMarkedContent"){const ce=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),Ce.id!==null&&this._container.setAttribute("id","".concat(Ce.id)),ce.append(this._container)}else Ce.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(Ce.str),le(this,Ce,ke)}}_layoutText($e){const ke=this._layoutTextParams.properties=this._textDivProperties.get($e);if(this._layoutTextParams.div=$e,ye(this._layoutTextParams),ke.hasText&&this._container.append($e),ke.hasEOL){const Ce=document.createElement("br");Ce.setAttribute("role","presentation"),this._container.append(Ce)}}_render(){const $e=new re.PromiseCapability;let ke=Object.create(null);if(this._isReadableStream){const Ce=()=>{this._reader.read().then(({value:ce,done:be})=>{if(be){$e.resolve();return}Object.assign(ke,ce.styles),this._processItems(ce.items,ke),Ce()},$e.reject)};this._reader=this._textContentSource.getReader(),Ce()}else if(this._textContentSource){const{items:Ce,styles:ce}=this._textContentSource;this._processItems(Ce,ce),$e.resolve()}else throw new Error('No "textContentSource" parameter specified.');$e.promise.then(()=>{ke=null,ve(this)},this._capability.reject)}}te.TextLayerRenderTask=de;function ge(Te){!Te.textContentSource&&(Te.textContent||Te.textContentStream)&&((0,ie.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),Te.textContentSource=Te.textContent||Te.textContentStream);const{container:$e,viewport:ke}=Te,Ce=getComputedStyle($e),ce=Ce.getPropertyValue("visibility"),be=parseFloat(Ce.getPropertyValue("--scale-factor"));ce==="visible"&&(!be||Math.abs(be-ke.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const we=new de(Te);return we._render(),we}function ue({container:Te,viewport:$e,textDivs:ke,textDivProperties:Ce,isOffscreenCanvasSupported:ce,mustRotate:be=!0,mustRescale:we=!0}){if(be&&(0,ie.setLayerDimensions)(Te,{rotation:$e.rotation}),we){const _e=fe(0,ce),De={prevFontSize:null,prevFontFamily:null,div:null,scale:$e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:_e};for(const Se of ke)De.properties=Ce.get(Se),De.div=Se,ye(De)}}},(ee,te,ne)=>{var fe,ae,le,ye,ve,de,ge,ue,Te,Wn,ke,hr,ce,Vn,we,Gn;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditorLayer=void 0;var re=ne(1),ie=ne(5),se=ne(28),oe=ne(29),me=ne(6);const Ee=class Ee{constructor(Se){Qe(this,Te);Qe(this,ke);Qe(this,ce);Qe(this,we);Qe(this,fe,void 0);Qe(this,ae,!1);Qe(this,le,this.pointerup.bind(this));Qe(this,ye,this.pointerdown.bind(this));Qe(this,ve,new Map);Qe(this,de,!1);Qe(this,ge,!1);Qe(this,ue,void 0);Ee._initialized||(Ee._initialized=!0,se.FreeTextEditor.initialize(Se.l10n),oe.InkEditor.initialize(Se.l10n)),Se.uiManager.registerEditorTypes([se.FreeTextEditor,oe.InkEditor]),pt(this,ue,Se.uiManager),this.pageIndex=Se.pageIndex,this.div=Se.div,pt(this,fe,Se.accessibilityManager),Fe(this,ue).addLayer(this)}get isEmpty(){return Fe(this,ve).size===0}updateToolbar(Se){Fe(this,ue).updateToolbar(Se)}updateMode(Se=Fe(this,ue).getMode()){it(this,we,Gn).call(this),Se===re.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),Fe(this,ue).unselectAll(),Se!==re.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",Se===re.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",Se===re.AnnotationEditorType.INK),this.div.hidden=!1)}addInkEditorIfNeeded(Se){if(!Se&&Fe(this,ue).getMode()!==re.AnnotationEditorType.INK)return;if(!Se){for(const qe of Fe(this,ve).values())if(qe.isEmpty()){qe.setInBackground();return}}it(this,ce,Vn).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(Se){Fe(this,ue).setEditingState(Se)}addCommands(Se){Fe(this,ue).addCommands(Se)}enable(){this.div.style.pointerEvents="auto";for(const Se of Fe(this,ve).values())Se.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const Se of Fe(this,ve).values())Se.disableEditing();it(this,we,Gn).call(this),this.isEmpty&&(this.div.hidden=!0)}setActiveEditor(Se){Fe(this,ue).getActive()!==Se&&Fe(this,ue).setActiveEditor(Se)}enableClick(){this.div.addEventListener("pointerdown",Fe(this,ye)),this.div.addEventListener("pointerup",Fe(this,le))}disableClick(){this.div.removeEventListener("pointerdown",Fe(this,ye)),this.div.removeEventListener("pointerup",Fe(this,le))}attach(Se){Fe(this,ve).set(Se.id,Se)}detach(Se){var He;Fe(this,ve).delete(Se.id),(He=Fe(this,fe))==null||He.removePointerInTextLayer(Se.contentDiv)}remove(Se){Fe(this,ue).removeEditor(Se),this.detach(Se),Se.div.style.display="none",setTimeout(()=>{Se.div.style.display="",Se.div.remove(),Se.isAttachedToDOM=!1,document.activeElement===document.body&&Fe(this,ue).focusMainContainer()},0),Fe(this,ge)||this.addInkEditorIfNeeded(!1)}add(Se){if(it(this,Te,Wn).call(this,Se),Fe(this,ue).addEditor(Se),this.attach(Se),!Se.isAttachedToDOM){const He=Se.render();this.div.append(He),Se.isAttachedToDOM=!0}this.moveEditorInDOM(Se),Se.onceAdded(),Fe(this,ue).addToAnnotationStorage(Se)}moveEditorInDOM(Se){var He;(He=Fe(this,fe))==null||He.moveElementInDOM(this.div,Se.div,Se.contentDiv,!0)}addOrRebuild(Se){Se.needsToBeRebuilt()?Se.rebuild():this.add(Se)}addANewEditor(Se){const He=()=>{this.addOrRebuild(Se)},qe=()=>{Se.remove()};this.addCommands({cmd:He,undo:qe,mustExec:!0})}addUndoableEditor(Se){const He=()=>{this.addOrRebuild(Se)},qe=()=>{Se.remove()};this.addCommands({cmd:He,undo:qe,mustExec:!1})}getNextId(){return Fe(this,ue).getId()}deserialize(Se){switch(Se.annotationType){case re.AnnotationEditorType.FREETEXT:return se.FreeTextEditor.deserialize(Se,this,Fe(this,ue));case re.AnnotationEditorType.INK:return oe.InkEditor.deserialize(Se,this,Fe(this,ue))}return null}setSelected(Se){Fe(this,ue).setSelected(Se)}toggleSelected(Se){Fe(this,ue).toggleSelected(Se)}isSelected(Se){return Fe(this,ue).isSelected(Se)}unselect(Se){Fe(this,ue).unselect(Se)}pointerup(Se){const{isMac:He}=re.FeatureTest.platform;if(!(Se.button!==0||Se.ctrlKey&&He)&&Se.target===this.div&&Fe(this,de)){if(pt(this,de,!1),!Fe(this,ae)){pt(this,ae,!0);return}it(this,ce,Vn).call(this,Se)}}pointerdown(Se){const{isMac:He}=re.FeatureTest.platform;if(Se.button!==0||Se.ctrlKey&&He||Se.target!==this.div)return;pt(this,de,!0);const qe=Fe(this,ue).getActive();pt(this,ae,!qe||qe.isEmpty())}drop(Se){const He=Se.dataTransfer.getData("text/plain"),qe=Fe(this,ue).getEditor(He);if(!qe)return;Se.preventDefault(),Se.dataTransfer.dropEffect="move",it(this,Te,Wn).call(this,qe);const Ke=this.div.getBoundingClientRect(),Je=Se.clientX-Ke.x,et=Se.clientY-Ke.y;qe.translate(Je-qe.startX,et-qe.startY),this.moveEditorInDOM(qe),qe.div.focus()}dragover(Se){Se.preventDefault()}destroy(){var Se,He;((Se=Fe(this,ue).getActive())==null?void 0:Se.parent)===this&&Fe(this,ue).setActiveEditor(null);for(const qe of Fe(this,ve).values())(He=Fe(this,fe))==null||He.removePointerInTextLayer(qe.contentDiv),qe.setParent(null),qe.isAttachedToDOM=!1,qe.div.remove();this.div=null,Fe(this,ve).clear(),Fe(this,ue).removeLayer(this)}render({viewport:Se}){this.viewport=Se,(0,me.setLayerDimensions)(this.div,Se),(0,ie.bindEvents)(this,this.div,["dragover","drop"]);for(const He of Fe(this,ue).getEditors(this.pageIndex))this.add(He);this.updateMode()}update({viewport:Se}){Fe(this,ue).commitOrRemove(),this.viewport=Se,(0,me.setLayerDimensions)(this.div,{rotation:Se.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:Se,pageHeight:He}=this.viewport.rawDims;return[Se,He]}};fe=new WeakMap,ae=new WeakMap,le=new WeakMap,ye=new WeakMap,ve=new WeakMap,de=new WeakMap,ge=new WeakMap,ue=new WeakMap,Te=new WeakSet,Wn=function(Se){var He;Se.parent!==this&&(this.attach(Se),(He=Se.parent)==null||He.detach(Se),Se.setParent(this),Se.div&&Se.isAttachedToDOM&&(Se.div.remove(),this.div.append(Se.div)))},ke=new WeakSet,hr=function(Se){switch(Fe(this,ue).getMode()){case re.AnnotationEditorType.FREETEXT:return new se.FreeTextEditor(Se);case re.AnnotationEditorType.INK:return new oe.InkEditor(Se)}return null},ce=new WeakSet,Vn=function(Se){const He=this.getNextId(),qe=it(this,ke,hr).call(this,{parent:this,id:He,x:Se.offsetX,y:Se.offsetY,uiManager:Fe(this,ue)});return qe&&this.add(qe),qe},we=new WeakSet,Gn=function(){pt(this,ge,!0);for(const Se of Fe(this,ve).values())Se.isEmpty()&&Se.remove();pt(this,ge,!1)},Lt(Ee,"_initialized",!1);let he=Ee;te.AnnotationEditorLayer=he},(ee,te,ne)=>{var me,he,fe,ae,le,ye,ve,de,ge,ue,fr,$e,pr,Ce,gr,be,qn;Object.defineProperty(te,"__esModule",{value:!0}),te.FreeTextEditor=void 0;var re=ne(1),ie=ne(5),se=ne(4);const _e=class _e extends se.AnnotationEditor{constructor(Se){super({...Se,name:"freeTextEditor"});Qe(this,ue);Qe(this,$e);Qe(this,Ce);Qe(this,be);Qe(this,me,this.editorDivBlur.bind(this));Qe(this,he,this.editorDivFocus.bind(this));Qe(this,fe,this.editorDivInput.bind(this));Qe(this,ae,this.editorDivKeydown.bind(this));Qe(this,le,void 0);Qe(this,ye,"");Qe(this,ve,"".concat(this.id,"-editor"));Qe(this,de,!1);Qe(this,ge,void 0);pt(this,le,Se.color||_e._defaultColor||se.AnnotationEditor._defaultLineColor),pt(this,ge,Se.fontSize||_e._defaultFontSize)}static initialize(Se){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(qe=>[qe,Se.get(qe)]));const He=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(He.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Se,He){switch(Se){case re.AnnotationEditorParamsType.FREETEXT_SIZE:_e._defaultFontSize=He;break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:_e._defaultColor=He;break}}updateParams(Se,He){switch(Se){case re.AnnotationEditorParamsType.FREETEXT_SIZE:it(this,ue,fr).call(this,He);break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:it(this,$e,pr).call(this,He);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,_e._defaultFontSize],[re.AnnotationEditorParamsType.FREETEXT_COLOR,_e._defaultColor||se.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,Fe(this,ge)],[re.AnnotationEditorParamsType.FREETEXT_COLOR,Fe(this,le)]]}getInitialTranslation(){const Se=this.parentScale;return[-_e._internalPadding*Se,-(_e._internalPadding+Fe(this,ge))*Se]}rebuild(){super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(re.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",Fe(this,ae)),this.editorDiv.addEventListener("focus",Fe(this,he)),this.editorDiv.addEventListener("blur",Fe(this,me)),this.editorDiv.addEventListener("input",Fe(this,fe)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",Fe(this,ve)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",Fe(this,ae)),this.editorDiv.removeEventListener("focus",Fe(this,he)),this.editorDiv.removeEventListener("blur",Fe(this,me)),this.editorDiv.removeEventListener("input",Fe(this,fe)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Se){super.focusin(Se),Se.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){this.isInEditMode()&&(super.commit(),Fe(this,de)||(pt(this,de,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),pt(this,ye,it(this,Ce,gr).call(this).trimEnd()),it(this,be,qn).call(this))}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(Se){this.enableEditMode(),this.editorDiv.focus()}keydown(Se){Se.target===this.div&&Se.key==="Enter"&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(Se){_e._keyboardManager.exec(this,Se)}editorDivFocus(Se){this.isEditing=!0}editorDivBlur(Se){this.isEditing=!1}editorDivInput(Se){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Se,He;this.width&&(Se=this.x,He=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",Fe(this,ve)),this.enableEditing(),_e._l10nPromise.get("editor_free_text2_aria_label").then(Ke=>{var Je;return(Je=this.editorDiv)==null?void 0:Je.setAttribute("aria-label",Ke)}),_e._l10nPromise.get("free_text2_default_content").then(Ke=>{var Je;return(Je=this.editorDiv)==null?void 0:Je.setAttribute("default-content",Ke)}),this.editorDiv.contentEditable=!0;const{style:qe}=this.editorDiv;if(qe.fontSize="calc(".concat(Fe(this,ge),"px * var(--scale-factor))"),qe.color=Fe(this,le),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,ie.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[Ke,Je]=this.parentDimensions;this.setAt(Se*Ke,He*Je,this.width*Ke,this.height*Je);for(const et of Fe(this,ye).split("\n")){const ut=document.createElement("div");ut.append(et?document.createTextNode(et):document.createElement("br")),this.editorDiv.append(ut)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Se,He,qe){const Ke=super.deserialize(Se,He,qe);return pt(Ke,ge,Se.fontSize),pt(Ke,le,re.Util.makeHexColor(...Se.color)),pt(Ke,ye,Se.value),Ke}serialize(){if(this.isEmpty())return null;const Se=_e._internalPadding*this.parentScale,He=this.getRect(Se,Se),qe=se.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:Fe(this,le));return{annotationType:re.AnnotationEditorType.FREETEXT,color:qe,fontSize:Fe(this,ge),value:Fe(this,ye),pageIndex:this.pageIndex,rect:He,rotation:this.rotation}}};me=new WeakMap,he=new WeakMap,fe=new WeakMap,ae=new WeakMap,le=new WeakMap,ye=new WeakMap,ve=new WeakMap,de=new WeakMap,ge=new WeakMap,ue=new WeakSet,fr=function(Se){const He=Ke=>{this.editorDiv.style.fontSize="calc(".concat(Ke,"px * var(--scale-factor))"),this.translate(0,-(Ke-Fe(this,ge))*this.parentScale),pt(this,ge,Ke),it(this,be,qn).call(this)},qe=Fe(this,ge);this.addCommands({cmd:()=>{He(Se)},undo:()=>{He(qe)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},$e=new WeakSet,pr=function(Se){const He=Fe(this,le);this.addCommands({cmd:()=>{pt(this,le,this.editorDiv.style.color=Se)},undo:()=>{pt(this,le,this.editorDiv.style.color=He)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Ce=new WeakSet,gr=function(){const Se=this.editorDiv.getElementsByTagName("div");if(Se.length===0)return this.editorDiv.innerText;const He=[];for(const qe of Se)He.push(qe.innerText.replace(/\r\n?|\n/,""));return He.join("\n")},be=new WeakSet,qn=function(){const[Se,He]=this.parentDimensions;let qe;if(this.isAttachedToDOM)qe=this.div.getBoundingClientRect();else{const{currentLayer:Ke,div:Je}=this,et=Je.style.display;Je.style.display="hidden",Ke.div.append(this.div),qe=Je.getBoundingClientRect(),Je.remove(),Je.style.display=et}this.width=qe.width/Se,this.height=qe.height/He},Lt(_e,"_freeTextDefaultContent",""),Lt(_e,"_l10nPromise"),Lt(_e,"_internalPadding",0),Lt(_e,"_defaultColor",null),Lt(_e,"_defaultFontSize",10),Lt(_e,"_keyboardManager",new ie.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],_e.prototype.commitOrRemove]])),Lt(_e,"_type","freetext");let oe=_e;te.FreeTextEditor=oe},(ee,te,ne)=>{var fe,ae,le,ye,ve,de,ge,ue,Te,$e,ke,Ce,ce,be,we,mr,Ee,_r,Se,yr,qe,br,Je,zn,ut,Sr,ct,vr,vt,Ar,yt,qt,xe,Xn,Le,$n,We,Fn,Ne,Jt,Ue,Kn,Ae,kn,Me,Yn,Ge,wr,Ze,Tr,at,Er,tt,Zn,ft,Mn,St,Qt,Ye,Jn;Object.defineProperty(te,"__esModule",{value:!0}),te.InkEditor=void 0,Object.defineProperty(te,"fitCurve",{enumerable:!0,get:function(){return se.fitCurve}});var re=ne(1),ie=ne(4),se=ne(30),oe=ne(5);const me=16,bt=class bt extends ie.AnnotationEditor{constructor(Ie){super({...Ie,name:"inkEditor"});Qe(this,we);Qe(this,Ee);Qe(this,Se);Qe(this,qe);Qe(this,Je);Qe(this,ut);Qe(this,ct);Qe(this,vt);Qe(this,yt);Qe(this,xe);Qe(this,Le);Qe(this,We);Qe(this,Ne);Qe(this,Ue);Qe(this,Ae);Qe(this,Ge);Qe(this,Ze);Qe(this,at);Qe(this,tt);Qe(this,ft);Qe(this,St);Qe(this,Ye);Qe(this,fe,0);Qe(this,ae,0);Qe(this,le,0);Qe(this,ye,this.canvasPointermove.bind(this));Qe(this,ve,this.canvasPointerleave.bind(this));Qe(this,de,this.canvasPointerup.bind(this));Qe(this,ge,this.canvasPointerdown.bind(this));Qe(this,ue,!1);Qe(this,Te,!1);Qe(this,$e,null);Qe(this,ke,null);Qe(this,Ce,0);Qe(this,ce,0);Qe(this,be,null);this.color=Ie.color||null,this.thickness=Ie.thickness||null,this.opacity=Ie.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(Ie){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(Be=>[Be,Ie.get(Be)]))}static updateDefaultParams(Ie,Be){switch(Ie){case re.AnnotationEditorParamsType.INK_THICKNESS:bt._defaultThickness=Be;break;case re.AnnotationEditorParamsType.INK_COLOR:bt._defaultColor=Be;break;case re.AnnotationEditorParamsType.INK_OPACITY:bt._defaultOpacity=Be/100;break}}updateParams(Ie,Be){switch(Ie){case re.AnnotationEditorParamsType.INK_THICKNESS:it(this,we,mr).call(this,Be);break;case re.AnnotationEditorParamsType.INK_COLOR:it(this,Ee,_r).call(this,Be);break;case re.AnnotationEditorParamsType.INK_OPACITY:it(this,Se,yr).call(this,Be);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.INK_THICKNESS,bt._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,bt._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(bt._defaultOpacity*100)]]}get propertiesToUpdate(){var Ie;return[[re.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||bt._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,this.color||bt._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*((Ie=this.opacity)!=null?Ie:bt._defaultOpacity))]]}rebuild(){super.rebuild(),this.div!==null&&(this.canvas||(it(this,Le,$n).call(this),it(this,We,Fn).call(this)),this.isAttachedToDOM||(this.parent.add(this),it(this,Ne,Jt).call(this)),it(this,St,Qt).call(this))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,Fe(this,ke).disconnect(),pt(this,ke,null),super.remove())}setParent(Ie){!this.parent&&Ie?this._uiManager.removeShouldRescale(this):this.parent&&Ie===null&&this._uiManager.addShouldRescale(this),super.setParent(Ie)}onScaleChanging(){const[Ie,Be]=this.parentDimensions,lt=this.width*Ie,mt=this.height*Be;this.setDimensions(lt,mt)}enableEditMode(){Fe(this,ue)||this.canvas===null||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",Fe(this,ge)),this.canvas.addEventListener("pointerup",Fe(this,de)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",Fe(this,ge)),this.canvas.removeEventListener("pointerup",Fe(this,de)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){Fe(this,ue)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),pt(this,ue,!0),this.div.classList.add("disabled"),it(this,St,Qt).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus({preventScroll:!0}))}focusin(Ie){super.focusin(Ie),this.enableEditMode()}canvasPointerdown(Ie){Ie.button!==0||!this.isInEditMode()||Fe(this,ue)||(this.setInForeground(),Ie.type!=="mouse"&&this.div.focus(),Ie.stopPropagation(),this.canvas.addEventListener("pointerleave",Fe(this,ve)),this.canvas.addEventListener("pointermove",Fe(this,ye)),it(this,ut,Sr).call(this,Ie.offsetX,Ie.offsetY))}canvasPointermove(Ie){Ie.stopPropagation(),it(this,ct,vr).call(this,Ie.offsetX,Ie.offsetY)}canvasPointerup(Ie){Ie.button===0&&this.isInEditMode()&&this.currentPath.length!==0&&(Ie.stopPropagation(),it(this,xe,Xn).call(this,Ie),this.setInBackground())}canvasPointerleave(Ie){it(this,xe,Xn).call(this,Ie),this.setInBackground()}render(){if(this.div)return this.div;let Ie,Be;this.width&&(Ie=this.x,Be=this.y),super.render(),bt._l10nPromise.get("editor_ink2_aria_label").then($t=>{var Pt;return(Pt=this.div)==null?void 0:Pt.setAttribute("aria-label",$t)});const[lt,mt,Et,xt]=it(this,qe,br).call(this);if(this.setAt(lt,mt,0,0),this.setDims(Et,xt),it(this,Le,$n).call(this),this.width){const[$t,Pt]=this.parentDimensions;this.setAt(Ie*$t,Be*Pt,this.width*$t,this.height*Pt),pt(this,Te,!0),it(this,Ne,Jt).call(this),this.setDims(this.width*$t,this.height*Pt),it(this,yt,qt).call(this),it(this,Ye,Jn).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return it(this,We,Fn).call(this),this.div}setDimensions(Ie,Be){const lt=Math.round(Ie),mt=Math.round(Be);if(Fe(this,Ce)===lt&&Fe(this,ce)===mt)return;pt(this,Ce,lt),pt(this,ce,mt),this.canvas.style.visibility="hidden",Fe(this,fe)&&Math.abs(Fe(this,fe)-Ie/Be)>.01&&(Be=Math.ceil(Ie/Fe(this,fe)),this.setDims(Ie,Be));const[Et,xt]=this.parentDimensions;this.width=Ie/Et,this.height=Be/xt,Fe(this,ue)&&it(this,Ue,Kn).call(this,Ie,Be),it(this,Ne,Jt).call(this),it(this,yt,qt).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(Ie,Be,lt){var Mt,Ot;const mt=super.deserialize(Ie,Be,lt);mt.thickness=Ie.thickness,mt.color=re.Util.makeHexColor(...Ie.color),mt.opacity=Ie.opacity;const[Et,xt]=mt.pageDimensions,$t=mt.width*Et,Pt=mt.height*xt,kt=mt.parentScale,Ct=Ie.thickness/2;pt(mt,fe,$t/Pt),pt(mt,ue,!0),pt(mt,Ce,Math.round($t)),pt(mt,ce,Math.round(Pt));for(const{bezier:Ft}of Ie.paths){const jt=[];mt.paths.push(jt);let Bt=kt*(Ft[0]-Ct),Ut=kt*(Pt-Ft[1]-Ct);for(let Dt=2,Nt=Ft.length;Dt<Nt;Dt+=6){const Vt=kt*(Ft[Dt]-Ct),zt=kt*(Pt-Ft[Dt+1]-Ct),Tn=kt*(Ft[Dt+2]-Ct),En=kt*(Pt-Ft[Dt+3]-Ct),tr=kt*(Ft[Dt+4]-Ct),nr=kt*(Pt-Ft[Dt+5]-Ct);jt.push([[Bt,Ut],[Vt,zt],[Tn,En],[tr,nr]]),Bt=tr,Ut=nr}const Wt=it(this,Me,Yn).call(this,jt);mt.bezierPath2D.push(Wt)}const It=it(Mt=mt,tt,Zn).call(Mt);return pt(mt,le,Math.max(me,It[2]-It[0])),pt(mt,ae,Math.max(me,It[3]-It[1])),it(Ot=mt,Ue,Kn).call(Ot,$t,Pt),mt}serialize(){if(this.isEmpty())return null;const Ie=this.getRect(0,0),Be=this.rotation%180===0?Ie[3]-Ie[1]:Ie[2]-Ie[0],lt=ie.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:re.AnnotationEditorType.INK,color:lt,thickness:this.thickness,opacity:this.opacity,paths:it(this,Ge,wr).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,Be),pageIndex:this.pageIndex,rect:Ie,rotation:this.rotation}}};fe=new WeakMap,ae=new WeakMap,le=new WeakMap,ye=new WeakMap,ve=new WeakMap,de=new WeakMap,ge=new WeakMap,ue=new WeakMap,Te=new WeakMap,$e=new WeakMap,ke=new WeakMap,Ce=new WeakMap,ce=new WeakMap,be=new WeakMap,we=new WeakSet,mr=function(Ie){const Be=this.thickness;this.addCommands({cmd:()=>{this.thickness=Ie,it(this,St,Qt).call(this)},undo:()=>{this.thickness=Be,it(this,St,Qt).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},Ee=new WeakSet,_r=function(Ie){const Be=this.color;this.addCommands({cmd:()=>{this.color=Ie,it(this,yt,qt).call(this)},undo:()=>{this.color=Be,it(this,yt,qt).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Se=new WeakSet,yr=function(Ie){Ie/=100;const Be=this.opacity;this.addCommands({cmd:()=>{this.opacity=Ie,it(this,yt,qt).call(this)},undo:()=>{this.opacity=Be,it(this,yt,qt).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},qe=new WeakSet,br=function(){const{parentRotation:Ie,parentDimensions:[Be,lt]}=this;switch(Ie){case 90:return[0,lt,lt,Be];case 180:return[Be,lt,Be,lt];case 270:return[Be,0,lt,Be];default:return[0,0,Be,lt]}},Je=new WeakSet,zn=function(){const{ctx:Ie,color:Be,opacity:lt,thickness:mt,parentScale:Et,scaleFactor:xt}=this;Ie.lineWidth=mt*Et/xt,Ie.lineCap="round",Ie.lineJoin="round",Ie.miterLimit=10,Ie.strokeStyle="".concat(Be).concat((0,oe.opacityToHex)(lt))},ut=new WeakSet,Sr=function(Ie,Be){var lt;this.isEditing=!0,Fe(this,Te)||(pt(this,Te,!0),it(this,Ne,Jt).call(this),this.thickness||(this.thickness=bt._defaultThickness),this.color||(this.color=bt._defaultColor||ie.AnnotationEditor._defaultLineColor),(lt=this.opacity)!=null||(this.opacity=bt._defaultOpacity)),this.currentPath.push([Ie,Be]),pt(this,$e,null),it(this,Je,zn).call(this),this.ctx.beginPath(),this.ctx.moveTo(Ie,Be),pt(this,be,()=>{Fe(this,be)&&(Fe(this,$e)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):it(this,yt,qt).call(this),this.ctx.lineTo(...Fe(this,$e)),pt(this,$e,null),this.ctx.stroke()),window.requestAnimationFrame(Fe(this,be)))}),window.requestAnimationFrame(Fe(this,be))},ct=new WeakSet,vr=function(Ie,Be){const[lt,mt]=this.currentPath.at(-1);Ie===lt&&Be===mt||(this.currentPath.push([Ie,Be]),pt(this,$e,[Ie,Be]))},vt=new WeakSet,Ar=function(Ie,Be){var kt;this.ctx.closePath(),pt(this,be,null),Ie=Math.min(Math.max(Ie,0),this.canvas.width),Be=Math.min(Math.max(Be,0),this.canvas.height);const[lt,mt]=this.currentPath.at(-1);(Ie!==lt||Be!==mt)&&this.currentPath.push([Ie,Be]);let Et;if(this.currentPath.length!==1)Et=(0,se.fitCurve)(this.currentPath,30,null);else{const Ct=[Ie,Be];Et=[[Ct,Ct.slice(),Ct.slice(),Ct]]}const xt=it(kt=bt,Me,Yn).call(kt,Et);this.currentPath.length=0;const $t=()=>{this.paths.push(Et),this.bezierPath2D.push(xt),this.rebuild()},Pt=()=>{this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(it(this,Le,$n).call(this),it(this,We,Fn).call(this)),it(this,St,Qt).call(this))};this.addCommands({cmd:$t,undo:Pt,mustExec:!0})},yt=new WeakSet,qt=function(){if(this.isEmpty()){it(this,Ae,kn).call(this);return}it(this,Je,zn).call(this);const{canvas:Ie,ctx:Be}=this;Be.setTransform(1,0,0,1,0,0),Be.clearRect(0,0,Ie.width,Ie.height),it(this,Ae,kn).call(this);for(const lt of this.bezierPath2D)Be.stroke(lt)},xe=new WeakSet,Xn=function(Ie){it(this,vt,Ar).call(this,Ie.offsetX,Ie.offsetY),this.canvas.removeEventListener("pointerleave",Fe(this,ve)),this.canvas.removeEventListener("pointermove",Fe(this,ye)),this.addToAnnotationStorage()},Le=new WeakSet,$n=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",bt._l10nPromise.get("editor_ink_canvas_aria_label").then(Ie=>{var Be;return(Be=this.canvas)==null?void 0:Be.setAttribute("aria-label",Ie)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},We=new WeakSet,Fn=function(){pt(this,ke,new ResizeObserver(Ie=>{const Be=Ie[0].contentRect;Be.width&&Be.height&&this.setDimensions(Be.width,Be.height)})),Fe(this,ke).observe(this.div)},Ne=new WeakSet,Jt=function(){if(!Fe(this,Te))return;const[Ie,Be]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*Ie),this.canvas.height=Math.ceil(this.height*Be),it(this,Ae,kn).call(this)},Ue=new WeakSet,Kn=function(Ie,Be){const lt=it(this,ft,Mn).call(this),mt=(Ie-lt)/Fe(this,le),Et=(Be-lt)/Fe(this,ae);this.scaleFactor=Math.min(mt,Et)},Ae=new WeakSet,kn=function(){const Ie=it(this,ft,Mn).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+Ie,this.translationY*this.scaleFactor+Ie)},Me=new WeakSet,Yn=function(Ie){const Be=new Path2D;for(let lt=0,mt=Ie.length;lt<mt;lt++){const[Et,xt,$t,Pt]=Ie[lt];lt===0&&Be.moveTo(...Et),Be.bezierCurveTo(xt[0],xt[1],$t[0],$t[1],Pt[0],Pt[1])}return Be},Ge=new WeakSet,wr=function(Ie,Be,lt,mt){const xt=[],$t=this.thickness/2;let Pt,kt;for(const Ct of this.paths){Pt=[],kt=[];for(let It=0,Mt=Ct.length;It<Mt;It++){const[Ot,Ft,jt,Bt]=Ct[It],Ut=Ie*(Ot[0]+Be)+$t,Wt=mt-Ie*(Ot[1]+lt)-$t,Dt=Ie*(Ft[0]+Be)+$t,Nt=mt-Ie*(Ft[1]+lt)-$t,Vt=Ie*(jt[0]+Be)+$t,zt=mt-Ie*(jt[1]+lt)-$t,Tn=Ie*(Bt[0]+Be)+$t,En=mt-Ie*(Bt[1]+lt)-$t;It===0&&(Pt.push(Ut,Wt),kt.push(Ut,Wt)),Pt.push(Dt,Nt,Vt,zt,Tn,En),it(this,Ze,Tr).call(this,Ut,Wt,Dt,Nt,Vt,zt,Tn,En,4,kt)}xt.push({bezier:Pt,points:kt})}return xt},Ze=new WeakSet,Tr=function(Ie,Be,lt,mt,Et,xt,$t,Pt,kt,Ct){if(it(this,at,Er).call(this,Ie,Be,lt,mt,Et,xt,$t,Pt)){Ct.push($t,Pt);return}for(let It=1;It<kt-1;It++){const Mt=It/kt,Ot=1-Mt;let Ft=Mt*Ie+Ot*lt,jt=Mt*Be+Ot*mt,Bt=Mt*lt+Ot*Et,Ut=Mt*mt+Ot*xt;const Wt=Mt*Et+Ot*$t,Dt=Mt*xt+Ot*Pt;Ft=Mt*Ft+Ot*Bt,jt=Mt*jt+Ot*Ut,Bt=Mt*Bt+Ot*Wt,Ut=Mt*Ut+Ot*Dt,Ft=Mt*Ft+Ot*Bt,jt=Mt*jt+Ot*Ut,Ct.push(Ft,jt)}Ct.push($t,Pt)},at=new WeakSet,Er=function(Ie,Be,lt,mt,Et,xt,$t,Pt){const Ct=(3*lt-2*Ie-$t)**2,It=(3*mt-2*Be-Pt)**2,Mt=(3*Et-Ie-2*$t)**2,Ot=(3*xt-Be-2*Pt)**2;return Math.max(Ct,Mt)+Math.max(It,Ot)<=10},tt=new WeakSet,Zn=function(){let Ie=1/0,Be=-1/0,lt=1/0,mt=-1/0;for(const Et of this.paths)for(const[xt,$t,Pt,kt]of Et){const Ct=re.Util.bezierBoundingBox(...xt,...$t,...Pt,...kt);Ie=Math.min(Ie,Ct[0]),lt=Math.min(lt,Ct[1]),Be=Math.max(Be,Ct[2]),mt=Math.max(mt,Ct[3])}return[Ie,lt,Be,mt]},ft=new WeakSet,Mn=function(){return Fe(this,ue)?Math.ceil(this.thickness*this.parentScale):0},St=new WeakSet,Qt=function(Ie=!1){if(this.isEmpty())return;if(!Fe(this,ue)){it(this,yt,qt).call(this);return}const Be=it(this,tt,Zn).call(this),lt=it(this,ft,Mn).call(this);pt(this,le,Math.max(me,Be[2]-Be[0])),pt(this,ae,Math.max(me,Be[3]-Be[1]));const mt=Math.ceil(lt+Fe(this,le)*this.scaleFactor),Et=Math.ceil(lt+Fe(this,ae)*this.scaleFactor),[xt,$t]=this.parentDimensions;this.width=mt/xt,this.height=Et/$t,pt(this,fe,mt/Et),it(this,Ye,Jn).call(this);const Pt=this.translationX,kt=this.translationY;this.translationX=-Be[0],this.translationY=-Be[1],it(this,Ne,Jt).call(this),it(this,yt,qt).call(this),pt(this,Ce,mt),pt(this,ce,Et),this.setDims(mt,Et);const Ct=Ie?lt/this.scaleFactor/2:0;this.translate(Pt-this.translationX-Ct,kt-this.translationY-Ct)},Ye=new WeakSet,Jn=function(){const{style:Ie}=this.div;Fe(this,fe)>=1?(Ie.minHeight="".concat(me,"px"),Ie.minWidth="".concat(Math.round(Fe(this,fe)*me),"px")):(Ie.minWidth="".concat(me,"px"),Ie.minHeight="".concat(Math.round(me/Fe(this,fe)),"px"))},Qe(bt,Me),Lt(bt,"_defaultColor",null),Lt(bt,"_defaultOpacity",1),Lt(bt,"_defaultThickness",1),Lt(bt,"_l10nPromise"),Lt(bt,"_type","ink");let he=bt;te.InkEditor=he},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.fitCurve=void 0;const re=ne(31);te.fitCurve=re},ee=>{function te(de,ge,ue){if(!Array.isArray(de))throw new TypeError("First argument should be an array");if(de.forEach(Ce=>{if(!Array.isArray(Ce)||Ce.some(ce=>typeof ce!="number")||Ce.length!==de[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),de=de.filter((Ce,ce)=>ce===0||!Ce.every((be,we)=>be===de[ce-1][we])),de.length<2)return[];const Te=de.length,$e=le(de[1],de[0]),ke=le(de[Te-2],de[Te-1]);return ne(de,$e,ke,ge,ue)}function ne(de,ge,ue,Te,$e){var Ce,ce,be,we,_e,Ee,De,Se,He,qe,Ke,Je,et;if(de.length===2)return Je=ye.vectorLen(ye.subtract(de[0],de[1]))/3,Ce=[de[0],ye.addArrays(de[0],ye.mulItems(ge,Je)),ye.addArrays(de[1],ye.mulItems(ue,Je)),de[1]],[Ce];if(ce=me(de),[Ce,we,Ee]=re(de,ce,ce,ge,ue,$e),we===0||we<Te)return[Ce];if(we<Te*Te)for(be=ce,_e=we,De=Ee,et=0;et<20;et++){if(be=se(Ce,de,be),[Ce,we,Ee]=re(de,ce,be,ge,ue,$e),we<Te)return[Ce];if(Ee===De){let ut=we/_e;if(ut>.9999&&ut<1.0001)break}_e=we,De=Ee}return Ke=[],Se=ye.subtract(de[Ee-1],de[Ee+1]),Se.every(ut=>ut===0)&&(Se=ye.subtract(de[Ee-1],de[Ee]),[Se[0],Se[1]]=[-Se[1],Se[0]]),He=ye.normalize(Se),qe=ye.mulItems(He,-1),Ke=Ke.concat(ne(de.slice(0,Ee+1),ge,He,Te,$e)),Ke=Ke.concat(ne(de.slice(Ee),qe,ue,Te,$e)),Ke}function re(de,ge,ue,Te,$e,ke){var Ce,ce,be;return Ce=ie(de,ue,Te,$e),[ce,be]=he(de,Ce,ge),ke&&ke({bez:Ce,points:de,params:ge,maxErr:ce,maxPoint:be}),[Ce,ce,be]}function ie(de,ge,ue,Te){var $e,ke,Ce,ce,be,we,_e,Ee,De,Se,He,qe,Ke,Je,et,ut,st,ct=de[0],gt=de[de.length-1];for($e=[ct,null,null,gt],ke=ye.zeros_Xx2x2(ge.length),Ke=0,Je=ge.length;Ke<Je;Ke++)ut=ge[Ke],st=1-ut,Ce=ke[Ke],Ce[0]=ye.mulItems(ue,3*ut*(st*st)),Ce[1]=ye.mulItems(Te,3*st*(ut*ut));for(ce=[[0,0],[0,0]],be=[0,0],Ke=0,Je=de.length;Ke<Je;Ke++)ut=ge[Ke],Ce=ke[Ke],ce[0][0]+=ye.dot(Ce[0],Ce[0]),ce[0][1]+=ye.dot(Ce[0],Ce[1]),ce[1][0]+=ye.dot(Ce[0],Ce[1]),ce[1][1]+=ye.dot(Ce[1],Ce[1]),et=ye.subtract(de[Ke],ve.q([ct,ct,gt,gt],ut)),be[0]+=ye.dot(Ce[0],et),be[1]+=ye.dot(Ce[1],et);return we=ce[0][0]*ce[1][1]-ce[1][0]*ce[0][1],_e=ce[0][0]*be[1]-ce[1][0]*be[0],Ee=be[0]*ce[1][1]-be[1]*ce[0][1],De=we===0?0:Ee/we,Se=we===0?0:_e/we,qe=ye.vectorLen(ye.subtract(ct,gt)),He=1e-6*qe,De<He||Se<He?($e[1]=ye.addArrays(ct,ye.mulItems(ue,qe/3)),$e[2]=ye.addArrays(gt,ye.mulItems(Te,qe/3))):($e[1]=ye.addArrays(ct,ye.mulItems(ue,De)),$e[2]=ye.addArrays(gt,ye.mulItems(Te,Se))),$e}function se(de,ge,ue){return ue.map((Te,$e)=>oe(de,ge[$e],Te))}function oe(de,ge,ue){var Te=ye.subtract(ve.q(de,ue),ge),$e=ve.qprime(de,ue),ke=ye.mulMatrix(Te,$e),Ce=ye.sum(ye.squareItems($e))+2*ye.mulMatrix(Te,ve.qprimeprime(de,ue));return Ce===0?ue:ue-ke/Ce}function me(de){var ge=[],ue,Te,$e;return de.forEach((ke,Ce)=>{ue=Ce?Te+ye.vectorLen(ye.subtract(ke,$e)):0,ge.push(ue),Te=ue,$e=ke}),ge=ge.map(ke=>ke/Te),ge}function he(de,ge,ue){var Te,$e,ke,Ce,ce,be,we,_e;$e=0,ke=Math.floor(de.length/2);const Ee=fe(ge,10);for(ce=0,be=de.length;ce<be;ce++)we=de[ce],_e=ae(ge,ue[ce],Ee,10),Ce=ye.subtract(ve.q(ge,_e),we),Te=Ce[0]*Ce[0]+Ce[1]*Ce[1],Te>$e&&($e=Te,ke=ce);return[$e,ke]}var fe=function(de,ge){for(var ue,Te=[0],$e=de[0],ke=0,Ce=1;Ce<=ge;Ce++)ue=ve.q(de,Ce/ge),ke+=ye.vectorLen(ye.subtract(ue,$e)),Te.push(ke),$e=ue;return Te=Te.map(ce=>ce/ke),Te};function ae(de,ge,ue,Te){if(ge<0)return 0;if(ge>1)return 1;for(var $e,ke,Ce,ce,be,we=1;we<=Te;we++)if(ge<=ue[we]){ce=(we-1)/Te,Ce=we/Te,ke=ue[we-1],$e=ue[we],be=(ge-ke)/($e-ke)*(Ce-ce)+ce;break}return be}function le(de,ge){return ye.normalize(ye.subtract(de,ge))}class ye{static zeros_Xx2x2(ge){for(var ue=[];ge--;)ue.push([0,0]);return ue}static mulItems(ge,ue){return ge.map(Te=>Te*ue)}static mulMatrix(ge,ue){return ge.reduce((Te,$e,ke)=>Te+$e*ue[ke],0)}static subtract(ge,ue){return ge.map((Te,$e)=>Te-ue[$e])}static addArrays(ge,ue){return ge.map((Te,$e)=>Te+ue[$e])}static addItems(ge,ue){return ge.map(Te=>Te+ue)}static sum(ge){return ge.reduce((ue,Te)=>ue+Te)}static dot(ge,ue){return ye.mulMatrix(ge,ue)}static vectorLen(ge){return Math.hypot(...ge)}static divItems(ge,ue){return ge.map(Te=>Te/ue)}static squareItems(ge){return ge.map(ue=>ue*ue)}static normalize(ge){return this.divItems(ge,this.vectorLen(ge))}}class ve{static q(ge,ue){var Te=1-ue,$e=ye.mulItems(ge[0],Te*Te*Te),ke=ye.mulItems(ge[1],3*Te*Te*ue),Ce=ye.mulItems(ge[2],3*Te*ue*ue),ce=ye.mulItems(ge[3],ue*ue*ue);return ye.addArrays(ye.addArrays($e,ke),ye.addArrays(Ce,ce))}static qprime(ge,ue){var Te=1-ue,$e=ye.mulItems(ye.subtract(ge[1],ge[0]),3*Te*Te),ke=ye.mulItems(ye.subtract(ge[2],ge[1]),6*Te*ue),Ce=ye.mulItems(ye.subtract(ge[3],ge[2]),3*ue*ue);return ye.addArrays(ye.addArrays($e,ke),Ce)}static qprimeprime(ge,ue){return ye.addArrays(ye.mulItems(ye.addArrays(ye.subtract(ge[2],ye.mulItems(ge[1],2)),ge[0]),6*(1-ue)),ye.mulItems(ye.addArrays(ye.subtract(ge[3],ye.mulItems(ge[2],2)),ge[1]),6*ue))}}ee.exports=te,ee.exports.fitCubic=ne,ee.exports.createTangent=le},(ee,te,ne)=>{var yt,Kt,xe,Cr,Ve,Qn,Xe,er;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationLayer=void 0;var re=ne(1),ie=ne(6),se=ne(3),oe=ne(33),me=ne(34);const he=1e3,fe=9,ae=new WeakSet;function le(Ue){return{width:Ue[2]-Ue[0],height:Ue[3]-Ue[1]}}class ye{static create(pe){switch(pe.data.annotationType){case re.AnnotationType.LINK:return new de(pe);case re.AnnotationType.TEXT:return new ge(pe);case re.AnnotationType.WIDGET:switch(pe.data.fieldType){case"Tx":return new Te(pe);case"Btn":return pe.data.radioButton?new ke(pe):pe.data.checkBox?new $e(pe):new Ce(pe);case"Ch":return new ce(pe)}return new ue(pe);case re.AnnotationType.POPUP:return new be(pe);case re.AnnotationType.FREETEXT:return new _e(pe);case re.AnnotationType.LINE:return new Ee(pe);case re.AnnotationType.SQUARE:return new De(pe);case re.AnnotationType.CIRCLE:return new Se(pe);case re.AnnotationType.POLYLINE:return new He(pe);case re.AnnotationType.CARET:return new Ke(pe);case re.AnnotationType.INK:return new Je(pe);case re.AnnotationType.POLYGON:return new qe(pe);case re.AnnotationType.HIGHLIGHT:return new et(pe);case re.AnnotationType.UNDERLINE:return new ut(pe);case re.AnnotationType.SQUIGGLY:return new st(pe);case re.AnnotationType.STRIKEOUT:return new ct(pe);case re.AnnotationType.STAMP:return new gt(pe);case re.AnnotationType.FILEATTACHMENT:return new vt(pe);default:return new ve(pe)}}}class ve{constructor(pe,{isRenderable:Ae=!1,ignoreBorder:Re=!1,createQuadrilaterals:Me=!1}={}){this.isRenderable=Ae,this.data=pe.data,this.layer=pe.layer,this.page=pe.page,this.viewport=pe.viewport,this.linkService=pe.linkService,this.downloadManager=pe.downloadManager,this.imageResourcesPath=pe.imageResourcesPath,this.renderForms=pe.renderForms,this.svgFactory=pe.svgFactory,this.annotationStorage=pe.annotationStorage,this.enableScripting=pe.enableScripting,this.hasJSActions=pe.hasJSActions,this._fieldObjects=pe.fieldObjects,Ae&&(this.container=this._createContainer(Re)),Me&&(this.quadrilaterals=this._createQuadrilaterals(Re))}_createContainer(pe=!1){const{data:Ae,page:Re,viewport:Me}=this,Oe=document.createElement("section");Oe.setAttribute("data-annotation-id",Ae.id),Ae.noRotate&&Oe.classList.add("norotate");const{pageWidth:Ge,pageHeight:rt,pageX:Ze,pageY:ot}=Me.rawDims,{width:at,height:nt}=le(Ae.rect),tt=re.Util.normalizeRect([Ae.rect[0],Re.view[3]-Ae.rect[1]+Re.view[1],Ae.rect[2],Re.view[3]-Ae.rect[3]+Re.view[1]]);if(!pe&&Ae.borderStyle.width>0){Oe.style.borderWidth="".concat(Ae.borderStyle.width,"px");const ft=Ae.borderStyle.horizontalCornerRadius,wt=Ae.borderStyle.verticalCornerRadius;if(ft>0||wt>0){const Tt="calc(".concat(ft,"px * var(--scale-factor)) / calc(").concat(wt,"px * var(--scale-factor))");Oe.style.borderRadius=Tt}else if(this instanceof ke){const Tt="calc(".concat(at,"px * var(--scale-factor)) / calc(").concat(nt,"px * var(--scale-factor))");Oe.style.borderRadius=Tt}switch(Ae.borderStyle.style){case re.AnnotationBorderStyleType.SOLID:Oe.style.borderStyle="solid";break;case re.AnnotationBorderStyleType.DASHED:Oe.style.borderStyle="dashed";break;case re.AnnotationBorderStyleType.BEVELED:(0,re.warn)("Unimplemented border style: beveled");break;case re.AnnotationBorderStyleType.INSET:(0,re.warn)("Unimplemented border style: inset");break;case re.AnnotationBorderStyleType.UNDERLINE:Oe.style.borderBottomStyle="solid";break}const St=Ae.borderColor||null;St?Oe.style.borderColor=re.Util.makeHexColor(St[0]|0,St[1]|0,St[2]|0):Oe.style.borderWidth=0}Oe.style.left="".concat(100*(tt[0]-Ze)/Ge,"%"),Oe.style.top="".concat(100*(tt[1]-ot)/rt,"%");const{rotation:ht}=Ae;return Ae.hasOwnCanvas||ht===0?(Oe.style.width="".concat(100*at/Ge,"%"),Oe.style.height="".concat(100*nt/rt,"%")):this.setRotation(ht,Oe),Oe}setRotation(pe,Ae=this.container){const{pageWidth:Re,pageHeight:Me}=this.viewport.rawDims,{width:Oe,height:Ge}=le(this.data.rect);let rt,Ze;pe%180===0?(rt=100*Oe/Re,Ze=100*Ge/Me):(rt=100*Ge/Re,Ze=100*Oe/Me),Ae.style.width="".concat(rt,"%"),Ae.style.height="".concat(Ze,"%"),Ae.setAttribute("data-main-rotation",(360-pe)%360)}get _commonActions(){const pe=(Ae,Re,Me)=>{const Oe=Me.detail[Ae];Me.target.style[Re]=oe.ColorConverters["".concat(Oe[0],"_HTML")](Oe.slice(1))};return(0,re.shadow)(this,"_commonActions",{display:Ae=>{const Re=Ae.detail.display%2===1;this.container.style.visibility=Re?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:Re,print:Ae.detail.display===0||Ae.detail.display===3})},print:Ae=>{this.annotationStorage.setValue(this.data.id,{print:Ae.detail.print})},hidden:Ae=>{this.container.style.visibility=Ae.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:Ae.detail.hidden})},focus:Ae=>{setTimeout(()=>Ae.target.focus({preventScroll:!1}),0)},userName:Ae=>{Ae.target.title=Ae.detail.userName},readonly:Ae=>{Ae.detail.readonly?Ae.target.setAttribute("readonly",""):Ae.target.removeAttribute("readonly")},required:Ae=>{this._setRequired(Ae.target,Ae.detail.required)},bgColor:Ae=>{pe("bgColor","backgroundColor",Ae)},fillColor:Ae=>{pe("fillColor","backgroundColor",Ae)},fgColor:Ae=>{pe("fgColor","color",Ae)},textColor:Ae=>{pe("textColor","color",Ae)},borderColor:Ae=>{pe("borderColor","borderColor",Ae)},strokeColor:Ae=>{pe("strokeColor","borderColor",Ae)},rotation:Ae=>{const Re=Ae.detail.rotation;this.setRotation(Re),this.annotationStorage.setValue(this.data.id,{rotation:Re})}})}_dispatchEventFromSandbox(pe,Ae){const Re=this._commonActions;for(const Me of Object.keys(Ae.detail)){const Oe=pe[Me]||Re[Me];Oe==null||Oe(Ae)}}_setDefaultPropertiesFromJS(pe){if(!this.enableScripting)return;const Ae=this.annotationStorage.getRawValue(this.data.id);if(!Ae)return;const Re=this._commonActions;for(const[Me,Oe]of Object.entries(Ae)){const Ge=Re[Me];if(Ge){const rt={detail:{[Me]:Oe},target:pe};Ge(rt),delete Ae[Me]}}}_createQuadrilaterals(pe=!1){if(!this.data.quadPoints)return null;const Ae=[],Re=this.data.rect;for(const Me of this.data.quadPoints)this.data.rect=[Me[2].x,Me[2].y,Me[1].x,Me[1].y],Ae.push(this._createContainer(pe));return this.data.rect=Re,Ae}_createPopup(pe,Ae){let Re=this.container;this.quadrilaterals&&(pe||(pe=this.quadrilaterals),Re=this.quadrilaterals[0]),pe||(pe=document.createElement("div"),pe.classList.add("popupTriggerArea"),Re.append(pe));const Oe=new we({container:Re,trigger:pe,color:Ae.color,titleObj:Ae.titleObj,modificationDate:Ae.modificationDate,contentsObj:Ae.contentsObj,richText:Ae.richText,hideWrapper:!0}).render();Oe.style.left="100%",Re.append(Oe)}_renderQuadrilaterals(pe){for(const Ae of this.quadrilaterals)Ae.classList.add(pe);return this.quadrilaterals}render(){(0,re.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(pe,Ae=null){const Re=[];if(this._fieldObjects){const Me=this._fieldObjects[pe];if(Me)for(const{page:Oe,id:Ge,exportValues:rt}of Me){if(Oe===-1||Ge===Ae)continue;const Ze=typeof rt=="string"?rt:null,ot=document.querySelector('[data-element-id="'.concat(Ge,'"]'));if(ot&&!ae.has(ot)){(0,re.warn)("_getElementsByName - element not allowed: ".concat(Ge));continue}Re.push({id:Ge,exportValue:Ze,domElement:ot})}return Re}for(const Me of document.getElementsByName(pe)){const{exportValue:Oe}=Me,Ge=Me.getAttribute("data-element-id");Ge!==Ae&&ae.has(Me)&&Re.push({id:Ge,exportValue:Oe,domElement:Me})}return Re}}class de extends ve{constructor(Ae,Re=null){super(Ae,{isRenderable:!0,ignoreBorder:!!(Re!=null&&Re.ignoreBorder),createQuadrilaterals:!0});Qe(this,yt);Qe(this,xe);this.isTooltipOnly=Ae.data.isTooltipOnly}render(){const{data:Ae,linkService:Re}=this,Me=document.createElement("a");Me.setAttribute("data-element-id",Ae.id);let Oe=!1;return Ae.url?(Re.addLinkAttributes(Me,Ae.url,Ae.newWindow),Oe=!0):Ae.action?(this._bindNamedAction(Me,Ae.action),Oe=!0):Ae.attachment?(this._bindAttachment(Me,Ae.attachment),Oe=!0):Ae.setOCGState?(it(this,xe,Cr).call(this,Me,Ae.setOCGState),Oe=!0):Ae.dest?(this._bindLink(Me,Ae.dest),Oe=!0):(Ae.actions&&(Ae.actions.Action||Ae.actions["Mouse Up"]||Ae.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(Me,Ae),Oe=!0),Ae.resetForm?(this._bindResetFormAction(Me,Ae.resetForm),Oe=!0):this.isTooltipOnly&&!Oe&&(this._bindLink(Me,""),Oe=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((Ge,rt)=>{const Ze=rt===0?Me:Me.cloneNode();return Ge.append(Ze),Ge}):(this.container.classList.add("linkAnnotation"),Oe&&this.container.append(Me),this.container)}_bindLink(Ae,Re){Ae.href=this.linkService.getDestinationHash(Re),Ae.onclick=()=>(Re&&this.linkService.goToDestination(Re),!1),(Re||Re==="")&&it(this,yt,Kt).call(this)}_bindNamedAction(Ae,Re){Ae.href=this.linkService.getAnchorUrl(""),Ae.onclick=()=>(this.linkService.executeNamedAction(Re),!1),it(this,yt,Kt).call(this)}_bindAttachment(Ae,Re){Ae.href=this.linkService.getAnchorUrl(""),Ae.onclick=()=>{var Me;return(Me=this.downloadManager)==null||Me.openOrDownloadData(this.container,Re.content,Re.filename),!1},it(this,yt,Kt).call(this)}_bindJSAction(Ae,Re){Ae.href=this.linkService.getAnchorUrl("");const Me=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Oe of Object.keys(Re.actions)){const Ge=Me.get(Oe);Ge&&(Ae[Ge]=()=>{var rt;return(rt=this.linkService.eventBus)==null||rt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Re.id,name:Oe}}),!1})}Ae.onclick||(Ae.onclick=()=>!1),it(this,yt,Kt).call(this)}_bindResetFormAction(Ae,Re){const Me=Ae.onclick;if(Me||(Ae.href=this.linkService.getAnchorUrl("")),it(this,yt,Kt).call(this),!this._fieldObjects){(0,re.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),Me||(Ae.onclick=()=>!1);return}Ae.onclick=()=>{var nt;Me==null||Me();const{fields:Oe,refs:Ge,include:rt}=Re,Ze=[];if(Oe.length!==0||Ge.length!==0){const tt=new Set(Ge);for(const ht of Oe){const ft=this._fieldObjects[ht]||[];for(const{id:wt}of ft)tt.add(wt)}for(const ht of Object.values(this._fieldObjects))for(const ft of ht)tt.has(ft.id)===rt&&Ze.push(ft)}else for(const tt of Object.values(this._fieldObjects))Ze.push(...tt);const ot=this.annotationStorage,at=[];for(const tt of Ze){const{id:ht}=tt;switch(at.push(ht),tt.type){case"text":{const wt=tt.defaultValue||"";ot.setValue(ht,{value:wt});break}case"checkbox":case"radiobutton":{const wt=tt.defaultValue===tt.exportValues;ot.setValue(ht,{value:wt});break}case"combobox":case"listbox":{const wt=tt.defaultValue||"";ot.setValue(ht,{value:wt});break}default:continue}const ft=document.querySelector('[data-element-id="'.concat(ht,'"]'));if(ft){if(!ae.has(ft)){(0,re.warn)("_bindResetFormAction - element not allowed: ".concat(ht));continue}}else continue;ft.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((nt=this.linkService.eventBus)==null||nt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:at,name:"ResetForm"}})),!1}}}yt=new WeakSet,Kt=function(){this.container.setAttribute("data-internal-link","")},xe=new WeakSet,Cr=function(Ae,Re){Ae.href=this.linkService.getAnchorUrl(""),Ae.onclick=()=>(this.linkService.executeSetOCGState(Re),!1),it(this,yt,Kt).call(this)};class ge extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae})}render(){this.container.classList.add("textAnnotation");const pe=document.createElement("img");return pe.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",pe.alt="[{{type}} Annotation]",pe.dataset.l10nId="text_annotation_type",pe.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(pe,this.data),this.container.append(pe),this.container}}class ue extends ve{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(pe){var Ae;this.data.hasOwnCanvas&&(((Ae=pe.previousSibling)==null?void 0:Ae.nodeName)==="CANVAS"&&(pe.previousSibling.hidden=!0),pe.hidden=!1)}_getKeyModifier(pe){const{isWin:Ae,isMac:Re}=re.FeatureTest.platform;return Ae&&pe.ctrlKey||Re&&pe.metaKey}_setEventListener(pe,Ae,Re,Me){Ae.includes("mouse")?pe.addEventListener(Ae,Oe=>{var Ge;(Ge=this.linkService.eventBus)==null||Ge.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:Re,value:Me(Oe),shift:Oe.shiftKey,modifier:this._getKeyModifier(Oe)}})}):pe.addEventListener(Ae,Oe=>{var Ge;(Ge=this.linkService.eventBus)==null||Ge.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:Re,value:Me(Oe)}})})}_setEventListeners(pe,Ae,Re){var Me;for(const[Oe,Ge]of Ae)(Ge==="Action"||(Me=this.data.actions)!=null&&Me[Ge])&&this._setEventListener(pe,Oe,Ge,Re)}_setBackgroundColor(pe){const Ae=this.data.backgroundColor||null;pe.style.backgroundColor=Ae===null?"transparent":re.Util.makeHexColor(Ae[0],Ae[1],Ae[2])}_setTextStyle(pe){const Ae=["left","center","right"],{fontColor:Re}=this.data.defaultAppearanceData,Me=this.data.defaultAppearanceData.fontSize||fe,Oe=pe.style;let Ge;const rt=2,Ze=ot=>Math.round(10*ot)/10;if(this.data.multiLine){const ot=Math.abs(this.data.rect[3]-this.data.rect[1]-rt),at=Math.round(ot/(re.LINE_FACTOR*Me))||1,nt=ot/at;Ge=Math.min(Me,Ze(nt/re.LINE_FACTOR))}else{const ot=Math.abs(this.data.rect[3]-this.data.rect[1]-rt);Ge=Math.min(Me,Ze(ot/re.LINE_FACTOR))}Oe.fontSize="calc(".concat(Ge,"px * var(--scale-factor))"),Oe.color=re.Util.makeHexColor(Re[0],Re[1],Re[2]),this.data.textAlignment!==null&&(Oe.textAlign=Ae[this.data.textAlignment])}_setRequired(pe,Ae){Ae?pe.setAttribute("required",!0):pe.removeAttribute("required"),pe.setAttribute("aria-required",Ae)}}class Te extends ue{constructor(pe){const Ae=pe.renderForms||!pe.data.hasAppearance&&!!pe.data.fieldValue;super(pe,{isRenderable:Ae})}setPropertyOnSiblings(pe,Ae,Re,Me){const Oe=this.annotationStorage;for(const Ge of this._getElementsByName(pe.name,pe.id))Ge.domElement&&(Ge.domElement[Ae]=Re),Oe.setValue(Ge.id,{[Me]:Re})}render(){var Me;const pe=this.annotationStorage,Ae=this.data.id;this.container.classList.add("textWidgetAnnotation");let Re=null;if(this.renderForms){const Oe=pe.getValue(Ae,{value:this.data.fieldValue});let Ge=Oe.formattedValue||Oe.value||"";const rt=pe.getValue(Ae,{charLimit:this.data.maxLen}).charLimit;rt&&Ge.length>rt&&(Ge=Ge.slice(0,rt));const Ze={userValue:Ge,formattedValue:null,lastCommittedValue:null,commitKey:1};this.data.multiLine?(Re=document.createElement("textarea"),Re.textContent=Ge,this.data.doNotScroll&&(Re.style.overflowY="hidden")):(Re=document.createElement("input"),Re.type="text",Re.setAttribute("value",Ge),this.data.doNotScroll&&(Re.style.overflowX="hidden")),this.data.hasOwnCanvas&&(Re.hidden=!0),ae.add(Re),Re.setAttribute("data-element-id",Ae),Re.disabled=this.data.readOnly,Re.name=this.data.fieldName,Re.tabIndex=he,this._setRequired(Re,this.data.required),rt&&(Re.maxLength=rt),Re.addEventListener("input",at=>{pe.setValue(Ae,{value:at.target.value}),this.setPropertyOnSiblings(Re,"value",at.target.value,"value")}),Re.addEventListener("resetform",at=>{var tt;const nt=(tt=this.data.defaultFieldValue)!=null?tt:"";Re.value=Ze.userValue=nt,Ze.formattedValue=null});let ot=at=>{const{formattedValue:nt}=Ze;nt!=null&&(at.target.value=nt),at.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){Re.addEventListener("focus",nt=>{const{target:tt}=nt;Ze.userValue&&(tt.value=Ze.userValue),Ze.lastCommittedValue=tt.value,Ze.commitKey=1}),Re.addEventListener("updatefromsandbox",nt=>{this.showElementAndHideCanvas(nt.target);const tt={value(ht){var ft;Ze.userValue=(ft=ht.detail.value)!=null?ft:"",pe.setValue(Ae,{value:Ze.userValue.toString()}),ht.target.value=Ze.userValue},formattedValue(ht){const{formattedValue:ft}=ht.detail;Ze.formattedValue=ft,ft!=null&&ht.target!==document.activeElement&&(ht.target.value=ft),pe.setValue(Ae,{formattedValue:ft})},selRange(ht){ht.target.setSelectionRange(...ht.detail.selRange)},charLimit:ht=>{var Tt;const{charLimit:ft}=ht.detail,{target:wt}=ht;if(ft===0){wt.removeAttribute("maxLength");return}wt.setAttribute("maxLength",ft);let St=Ze.userValue;!St||St.length<=ft||(St=St.slice(0,ft),wt.value=Ze.userValue=St,pe.setValue(Ae,{value:St}),(Tt=this.linkService.eventBus)==null||Tt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Ae,name:"Keystroke",value:St,willCommit:!0,commitKey:1,selStart:wt.selectionStart,selEnd:wt.selectionEnd}}))}};this._dispatchEventFromSandbox(tt,nt)}),Re.addEventListener("keydown",nt=>{var ft;Ze.commitKey=1;let tt=-1;if(nt.key==="Escape"?tt=0:nt.key==="Enter"&&!this.data.multiLine?tt=2:nt.key==="Tab"&&(Ze.commitKey=3),tt===-1)return;const{value:ht}=nt.target;Ze.lastCommittedValue!==ht&&(Ze.lastCommittedValue=ht,Ze.userValue=ht,(ft=this.linkService.eventBus)==null||ft.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Ae,name:"Keystroke",value:ht,willCommit:!0,commitKey:tt,selStart:nt.target.selectionStart,selEnd:nt.target.selectionEnd}}))});const at=ot;ot=null,Re.addEventListener("blur",nt=>{var ht;if(!nt.relatedTarget)return;const{value:tt}=nt.target;Ze.userValue=tt,Ze.lastCommittedValue!==tt&&((ht=this.linkService.eventBus)==null||ht.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Ae,name:"Keystroke",value:tt,willCommit:!0,commitKey:Ze.commitKey,selStart:nt.target.selectionStart,selEnd:nt.target.selectionEnd}})),at(nt)}),(Me=this.data.actions)!=null&&Me.Keystroke&&Re.addEventListener("beforeinput",nt=>{var _t;Ze.lastCommittedValue=null;const{data:tt,target:ht}=nt,{value:ft,selectionStart:wt,selectionEnd:St}=ht;let Tt=wt,Ye=St;switch(nt.inputType){case"deleteWordBackward":{const bt=ft.substring(0,wt).match(/\w*[^\w]*$/);bt&&(Tt-=bt[0].length);break}case"deleteWordForward":{const bt=ft.substring(wt).match(/^[^\w]*\w*/);bt&&(Ye+=bt[0].length);break}case"deleteContentBackward":wt===St&&(Tt-=1);break;case"deleteContentForward":wt===St&&(Ye+=1);break}nt.preventDefault(),(_t=this.linkService.eventBus)==null||_t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Ae,name:"Keystroke",value:ft,change:tt||"",willCommit:!1,selStart:Tt,selEnd:Ye}})}),this._setEventListeners(Re,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],nt=>nt.target.value)}if(ot&&Re.addEventListener("blur",ot),this.data.comb){const nt=(this.data.rect[2]-this.data.rect[0])/rt;Re.classList.add("comb"),Re.style.letterSpacing="calc(".concat(nt,"px * var(--scale-factor) - 1ch)")}}else Re=document.createElement("div"),Re.textContent=this.data.fieldValue,Re.style.verticalAlign="middle",Re.style.display="table-cell";return this._setTextStyle(Re),this._setBackgroundColor(Re),this._setDefaultPropertiesFromJS(Re),this.container.append(Re),this.container}}class $e extends ue{constructor(pe){super(pe,{isRenderable:pe.renderForms})}render(){const pe=this.annotationStorage,Ae=this.data,Re=Ae.id;let Me=pe.getValue(Re,{value:Ae.exportValue===Ae.fieldValue}).value;typeof Me=="string"&&(Me=Me!=="Off",pe.setValue(Re,{value:Me})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Oe=document.createElement("input");return ae.add(Oe),Oe.setAttribute("data-element-id",Re),Oe.disabled=Ae.readOnly,this._setRequired(Oe,this.data.required),Oe.type="checkbox",Oe.name=Ae.fieldName,Me&&Oe.setAttribute("checked",!0),Oe.setAttribute("exportValue",Ae.exportValue),Oe.tabIndex=he,Oe.addEventListener("change",Ge=>{const{name:rt,checked:Ze}=Ge.target;for(const ot of this._getElementsByName(rt,Re)){const at=Ze&&ot.exportValue===Ae.exportValue;ot.domElement&&(ot.domElement.checked=at),pe.setValue(ot.id,{value:at})}pe.setValue(Re,{value:Ze})}),Oe.addEventListener("resetform",Ge=>{const rt=Ae.defaultFieldValue||"Off";Ge.target.checked=rt===Ae.exportValue}),this.enableScripting&&this.hasJSActions&&(Oe.addEventListener("updatefromsandbox",Ge=>{const rt={value(Ze){Ze.target.checked=Ze.detail.value!=="Off",pe.setValue(Re,{value:Ze.target.checked})}};this._dispatchEventFromSandbox(rt,Ge)}),this._setEventListeners(Oe,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Ge=>Ge.target.checked)),this._setBackgroundColor(Oe),this._setDefaultPropertiesFromJS(Oe),this.container.append(Oe),this.container}}class ke extends ue{constructor(pe){super(pe,{isRenderable:pe.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const pe=this.annotationStorage,Ae=this.data,Re=Ae.id;let Me=pe.getValue(Re,{value:Ae.fieldValue===Ae.buttonValue}).value;typeof Me=="string"&&(Me=Me!==Ae.buttonValue,pe.setValue(Re,{value:Me}));const Oe=document.createElement("input");if(ae.add(Oe),Oe.setAttribute("data-element-id",Re),Oe.disabled=Ae.readOnly,this._setRequired(Oe,this.data.required),Oe.type="radio",Oe.name=Ae.fieldName,Me&&Oe.setAttribute("checked",!0),Oe.tabIndex=he,Oe.addEventListener("change",Ge=>{const{name:rt,checked:Ze}=Ge.target;for(const ot of this._getElementsByName(rt,Re))pe.setValue(ot.id,{value:!1});pe.setValue(Re,{value:Ze})}),Oe.addEventListener("resetform",Ge=>{const rt=Ae.defaultFieldValue;Ge.target.checked=rt!=null&&rt===Ae.buttonValue}),this.enableScripting&&this.hasJSActions){const Ge=Ae.buttonValue;Oe.addEventListener("updatefromsandbox",rt=>{const Ze={value:ot=>{const at=Ge===ot.detail.value;for(const nt of this._getElementsByName(ot.target.name)){const tt=at&&nt.id===Re;nt.domElement&&(nt.domElement.checked=tt),pe.setValue(nt.id,{value:tt})}}};this._dispatchEventFromSandbox(Ze,rt)}),this._setEventListeners(Oe,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],rt=>rt.target.checked)}return this._setBackgroundColor(Oe),this._setDefaultPropertiesFromJS(Oe),this.container.append(Oe),this.container}}class Ce extends de{constructor(pe){super(pe,{ignoreBorder:pe.data.hasAppearance})}render(){const pe=super.render();pe.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(pe.title=this.data.alternativeText);const Ae=pe.lastChild;return this.enableScripting&&this.hasJSActions&&Ae&&(this._setDefaultPropertiesFromJS(Ae),Ae.addEventListener("updatefromsandbox",Re=>{this._dispatchEventFromSandbox({},Re)})),pe}}class ce extends ue{constructor(pe){super(pe,{isRenderable:pe.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const pe=this.annotationStorage,Ae=this.data.id,Re=pe.getValue(Ae,{value:this.data.fieldValue}),Me=document.createElement("select");ae.add(Me),Me.setAttribute("data-element-id",Ae),Me.disabled=this.data.readOnly,this._setRequired(Me,this.data.required),Me.name=this.data.fieldName,Me.tabIndex=he;let Oe=this.data.combo&&this.data.options.length>0;this.data.combo||(Me.size=this.data.options.length,this.data.multiSelect&&(Me.multiple=!0)),Me.addEventListener("resetform",at=>{const nt=this.data.defaultFieldValue;for(const tt of Me.options)tt.selected=tt.value===nt});for(const at of this.data.options){const nt=document.createElement("option");nt.textContent=at.displayValue,nt.value=at.exportValue,Re.value.includes(at.exportValue)&&(nt.setAttribute("selected",!0),Oe=!1),Me.append(nt)}let Ge=null;if(Oe){const at=document.createElement("option");at.value=" ",at.setAttribute("hidden",!0),at.setAttribute("selected",!0),Me.prepend(at),Ge=()=>{at.remove(),Me.removeEventListener("input",Ge),Ge=null},Me.addEventListener("input",Ge)}const rt=at=>{const nt=at?"value":"textContent",{options:tt,multiple:ht}=Me;return ht?Array.prototype.filter.call(tt,ft=>ft.selected).map(ft=>ft[nt]):tt.selectedIndex===-1?null:tt[tt.selectedIndex][nt]};let Ze=rt(!1);const ot=at=>{const nt=at.target.options;return Array.prototype.map.call(nt,tt=>({displayValue:tt.textContent,exportValue:tt.value}))};return this.enableScripting&&this.hasJSActions?(Me.addEventListener("updatefromsandbox",at=>{const nt={value(tt){Ge==null||Ge();const ht=tt.detail.value,ft=new Set(Array.isArray(ht)?ht:[ht]);for(const wt of Me.options)wt.selected=ft.has(wt.value);pe.setValue(Ae,{value:rt(!0)}),Ze=rt(!1)},multipleSelection(tt){Me.multiple=!0},remove(tt){const ht=Me.options,ft=tt.detail.remove;ht[ft].selected=!1,Me.remove(ft),ht.length>0&&Array.prototype.findIndex.call(ht,St=>St.selected)===-1&&(ht[0].selected=!0),pe.setValue(Ae,{value:rt(!0),items:ot(tt)}),Ze=rt(!1)},clear(tt){for(;Me.length!==0;)Me.remove(0);pe.setValue(Ae,{value:null,items:[]}),Ze=rt(!1)},insert(tt){const{index:ht,displayValue:ft,exportValue:wt}=tt.detail.insert,St=Me.children[ht],Tt=document.createElement("option");Tt.textContent=ft,Tt.value=wt,St?St.before(Tt):Me.append(Tt),pe.setValue(Ae,{value:rt(!0),items:ot(tt)}),Ze=rt(!1)},items(tt){const{items:ht}=tt.detail;for(;Me.length!==0;)Me.remove(0);for(const ft of ht){const{displayValue:wt,exportValue:St}=ft,Tt=document.createElement("option");Tt.textContent=wt,Tt.value=St,Me.append(Tt)}Me.options.length>0&&(Me.options[0].selected=!0),pe.setValue(Ae,{value:rt(!0),items:ot(tt)}),Ze=rt(!1)},indices(tt){const ht=new Set(tt.detail.indices);for(const ft of tt.target.options)ft.selected=ht.has(ft.index);pe.setValue(Ae,{value:rt(!0)}),Ze=rt(!1)},editable(tt){tt.target.disabled=!tt.detail.editable}};this._dispatchEventFromSandbox(nt,at)}),Me.addEventListener("input",at=>{var tt;const nt=rt(!0);pe.setValue(Ae,{value:nt}),at.preventDefault(),(tt=this.linkService.eventBus)==null||tt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Ae,name:"Keystroke",value:Ze,changeEx:nt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(Me,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],at=>at.target.value)):Me.addEventListener("input",function(at){pe.setValue(Ae,{value:rt(!0)})}),this.data.combo&&this._setTextStyle(Me),this._setBackgroundColor(Me),this._setDefaultPropertiesFromJS(Me),this.container.append(Me),this.container}}const Le=class Le extends ve{constructor(pe){var Me,Oe,Ge;const{data:Ae}=pe,Re=!Le.IGNORE_TYPES.has(Ae.parentType)&&!!((Me=Ae.titleObj)!=null&&Me.str||(Oe=Ae.contentsObj)!=null&&Oe.str||(Ge=Ae.richText)!=null&&Ge.str);super(pe,{isRenderable:Re})}render(){this.container.classList.add("popupAnnotation");const pe=this.layer.querySelectorAll('[data-annotation-id="'.concat(this.data.parentId,'"]'));if(pe.length===0)return this.container;const Ae=new we({container:this.container,trigger:Array.from(pe),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),Re=this.page,Me=re.Util.normalizeRect([this.data.parentRect[0],Re.view[3]-this.data.parentRect[1]+Re.view[1],this.data.parentRect[2],Re.view[3]-this.data.parentRect[3]+Re.view[1]]),Oe=Me[0]+this.data.parentRect[2]-this.data.parentRect[0],Ge=Me[1],{pageWidth:rt,pageHeight:Ze,pageX:ot,pageY:at}=this.viewport.rawDims;return this.container.style.left="".concat(100*(Oe-ot)/rt,"%"),this.container.style.top="".concat(100*(Ge-at)/Ze,"%"),this.container.append(Ae.render()),this.container}};Lt(Le,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));let be=Le;class we{constructor(pe){this.container=pe.container,this.trigger=pe.trigger,this.color=pe.color,this.titleObj=pe.titleObj,this.modificationDate=pe.modificationDate,this.contentsObj=pe.contentsObj,this.richText=pe.richText,this.hideWrapper=pe.hideWrapper||!1,this.pinned=!1}render(){var rt,Ze;const Ae=document.createElement("div");Ae.classList.add("popupWrapper"),this.hideElement=this.hideWrapper?Ae:this.container,this.hideElement.hidden=!0;const Re=document.createElement("div");Re.classList.add("popup");const Me=this.color;if(Me){const ot=.7*(255-Me[0])+Me[0],at=.7*(255-Me[1])+Me[1],nt=.7*(255-Me[2])+Me[2];Re.style.backgroundColor=re.Util.makeHexColor(ot|0,at|0,nt|0)}const Oe=document.createElement("h1");Oe.dir=this.titleObj.dir,Oe.textContent=this.titleObj.str,Re.append(Oe);const Ge=ie.PDFDateString.toDateObject(this.modificationDate);if(Ge){const ot=document.createElement("span");ot.classList.add("popupDate"),ot.textContent="{{date}}, {{time}}",ot.dataset.l10nId="annotation_date_string",ot.dataset.l10nArgs=JSON.stringify({date:Ge.toLocaleDateString(),time:Ge.toLocaleTimeString()}),Re.append(ot)}if((rt=this.richText)!=null&&rt.str&&(!((Ze=this.contentsObj)!=null&&Ze.str)||this.contentsObj.str===this.richText.str))me.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:Re}),Re.lastChild.classList.add("richText","popupContent");else{const ot=this._formatContents(this.contentsObj);Re.append(ot)}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const ot of this.trigger)ot.addEventListener("click",this._toggle.bind(this)),ot.addEventListener("mouseover",this._show.bind(this,!1)),ot.addEventListener("mouseout",this._hide.bind(this,!1));return Re.addEventListener("click",this._hide.bind(this,!0)),Ae.append(Re),Ae}_formatContents({str:pe,dir:Ae}){const Re=document.createElement("p");Re.classList.add("popupContent"),Re.dir=Ae;const Me=pe.split(/(?:\r\n?|\n)/);for(let Oe=0,Ge=Me.length;Oe<Ge;++Oe){const rt=Me[Oe];Re.append(document.createTextNode(rt)),Oe<Ge-1&&Re.append(document.createElement("br"))}return Re}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(pe=!1){pe&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(pe=!0){pe&&(this.pinned=!1),!this.hideElement.hidden&&!this.pinned&&(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class _e extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0}),this.textContent=pe.data.textContent}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const pe=document.createElement("div");pe.classList.add("annotationTextContent"),pe.setAttribute("role","comment");for(const Ae of this.textContent){const Re=document.createElement("span");Re.textContent=Ae,pe.append(Re)}this.container.append(pe)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class Ee extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const pe=this.data,{width:Ae,height:Re}=le(pe.rect),Me=this.svgFactory.create(Ae,Re,!0),Oe=this.svgFactory.createElement("svg:line");return Oe.setAttribute("x1",pe.rect[2]-pe.lineCoordinates[0]),Oe.setAttribute("y1",pe.rect[3]-pe.lineCoordinates[1]),Oe.setAttribute("x2",pe.rect[2]-pe.lineCoordinates[2]),Oe.setAttribute("y2",pe.rect[3]-pe.lineCoordinates[3]),Oe.setAttribute("stroke-width",pe.borderStyle.width||1),Oe.setAttribute("stroke","transparent"),Oe.setAttribute("fill","transparent"),Me.append(Oe),this.container.append(Me),this._createPopup(Oe,pe),this.container}}class De extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const pe=this.data,{width:Ae,height:Re}=le(pe.rect),Me=this.svgFactory.create(Ae,Re,!0),Oe=pe.borderStyle.width,Ge=this.svgFactory.createElement("svg:rect");return Ge.setAttribute("x",Oe/2),Ge.setAttribute("y",Oe/2),Ge.setAttribute("width",Ae-Oe),Ge.setAttribute("height",Re-Oe),Ge.setAttribute("stroke-width",Oe||1),Ge.setAttribute("stroke","transparent"),Ge.setAttribute("fill","transparent"),Me.append(Ge),this.container.append(Me),this._createPopup(Ge,pe),this.container}}class Se extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const pe=this.data,{width:Ae,height:Re}=le(pe.rect),Me=this.svgFactory.create(Ae,Re,!0),Oe=pe.borderStyle.width,Ge=this.svgFactory.createElement("svg:ellipse");return Ge.setAttribute("cx",Ae/2),Ge.setAttribute("cy",Re/2),Ge.setAttribute("rx",Ae/2-Oe/2),Ge.setAttribute("ry",Re/2-Oe/2),Ge.setAttribute("stroke-width",Oe||1),Ge.setAttribute("stroke","transparent"),Ge.setAttribute("fill","transparent"),Me.append(Ge),this.container.append(Me),this._createPopup(Ge,pe),this.container}}class He extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const pe=this.data,{width:Ae,height:Re}=le(pe.rect),Me=this.svgFactory.create(Ae,Re,!0);let Oe=[];for(const rt of pe.vertices){const Ze=rt.x-pe.rect[0],ot=pe.rect[3]-rt.y;Oe.push(Ze+","+ot)}Oe=Oe.join(" ");const Ge=this.svgFactory.createElement(this.svgElementName);return Ge.setAttribute("points",Oe),Ge.setAttribute("stroke-width",pe.borderStyle.width||1),Ge.setAttribute("stroke","transparent"),Ge.setAttribute("fill","transparent"),Me.append(Ge),this.container.append(Me),this._createPopup(Ge,pe),this.container}}class qe extends He{constructor(pe){super(pe),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Ke extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class Je extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const pe=this.data,{width:Ae,height:Re}=le(pe.rect),Me=this.svgFactory.create(Ae,Re,!0);for(const Oe of pe.inkLists){let Ge=[];for(const Ze of Oe){const ot=Ze.x-pe.rect[0],at=pe.rect[3]-Ze.y;Ge.push("".concat(ot,",").concat(at))}Ge=Ge.join(" ");const rt=this.svgFactory.createElement(this.svgElementName);rt.setAttribute("points",Ge),rt.setAttribute("stroke-width",pe.borderStyle.width||1),rt.setAttribute("stroke","transparent"),rt.setAttribute("fill","transparent"),this._createPopup(rt,pe),Me.append(rt)}return this.container.append(Me),this.container}}class et extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.classList.add("highlightAnnotation"),this.container)}}class ut extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.classList.add("underlineAnnotation"),this.container)}}class st extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.classList.add("squigglyAnnotation"),this.container)}}class ct extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.classList.add("strikeoutAnnotation"),this.container)}}class gt extends ve{constructor(pe){var Re,Me,Oe;const Ae=!!(pe.data.hasPopup||(Re=pe.data.titleObj)!=null&&Re.str||(Me=pe.data.contentsObj)!=null&&Me.str||(Oe=pe.data.richText)!=null&&Oe.str);super(pe,{isRenderable:Ae,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),this.data.hasPopup||this._createPopup(null,this.data),this.container}}class vt extends ve{constructor(pe){var Me;super(pe,{isRenderable:!0});const{filename:Ae,content:Re}=this.data.file;this.filename=(0,ie.getFilenameFromUrl)(Ae,!0),this.content=Re,(Me=this.linkService.eventBus)==null||Me.dispatch("fileattachmentannotation",{source:this,filename:Ae,content:Re})}render(){var Ae,Re;this.container.classList.add("fileAttachmentAnnotation");let pe;return this.data.hasAppearance?pe=document.createElement("div"):(pe=document.createElement("img"),pe.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(this.data.name)?"paperclip":"pushpin",".svg")),pe.classList.add("popupTriggerArea"),pe.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&((Ae=this.data.titleObj)!=null&&Ae.str||(Re=this.data.contentsObj)!=null&&Re.str||this.data.richText)&&this._createPopup(pe,this.data),this.container.append(pe),this.container}_download(){var pe;(pe=this.downloadManager)==null||pe.openOrDownloadData(this.container,this.content,this.filename)}}const je=class je{static render(pe){var Ze,ot;const{annotations:Ae,div:Re,viewport:Me,accessibilityManager:Oe}=pe;(0,ie.setLayerDimensions)(Re,Me);const Ge={data:null,layer:Re,page:pe.page,viewport:Me,linkService:pe.linkService,downloadManager:pe.downloadManager,imageResourcesPath:pe.imageResourcesPath||"",renderForms:pe.renderForms!==!1,svgFactory:new ie.DOMSVGFactory,annotationStorage:pe.annotationStorage||new se.AnnotationStorage,enableScripting:pe.enableScripting===!0,hasJSActions:pe.hasJSActions,fieldObjects:pe.fieldObjects};let rt=0;for(const at of Ae){if(at.noHTML)continue;if(at.annotationType!==re.AnnotationType.POPUP){const{width:ht,height:ft}=le(at.rect);if(ht<=0||ft<=0)continue}Ge.data=at;const nt=ye.create(Ge);if(!nt.isRenderable)continue;const tt=nt.render();if(at.hidden&&(tt.style.visibility="hidden"),Array.isArray(tt))for(const ht of tt)ht.style.zIndex=rt++,it(Ze=je,Ve,Qn).call(Ze,ht,at.id,Re,Oe);else tt.style.zIndex=rt++,nt instanceof be?Re.prepend(tt):it(ot=je,Ve,Qn).call(ot,tt,at.id,Re,Oe)}it(this,Xe,er).call(this,Re,pe.annotationCanvasMap)}static update(pe){const{annotationCanvasMap:Ae,div:Re,viewport:Me}=pe;(0,ie.setLayerDimensions)(Re,{rotation:Me.rotation}),it(this,Xe,er).call(this,Re,Ae),Re.hidden=!1}};Ve=new WeakSet,Qn=function(pe,Ae,Re,Me){const Oe=pe.firstChild||pe;Oe.id="".concat(ie.AnnotationPrefix).concat(Ae),Re.append(pe),Me==null||Me.moveElementInDOM(Re,pe,Oe,!1)},Xe=new WeakSet,er=function(pe,Ae){if(Ae){for(const[Re,Me]of Ae){const Oe=pe.querySelector('[data-annotation-id="'.concat(Re,'"]'));if(!Oe)continue;const{firstChild:Ge}=Oe;Ge?Ge.nodeName==="CANVAS"?Ge.replaceWith(Me):Ge.before(Me):Oe.append(Me)}Ae.clear()}},Qe(je,Ve),Qe(je,Xe);let At=je;te.AnnotationLayer=At},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.ColorConverters=void 0;function ne(ie){return Math.floor(Math.max(0,Math.min(1,ie))*255).toString(16).padStart(2,"0")}class re{static CMYK_G([se,oe,me,he]){return["G",1-Math.min(1,.3*se+.59*me+.11*oe+he)]}static G_CMYK([se]){return["CMYK",0,0,0,1-se]}static G_RGB([se]){return["RGB",se,se,se]}static G_HTML([se]){const oe=ne(se);return"#".concat(oe).concat(oe).concat(oe)}static RGB_G([se,oe,me]){return["G",.3*se+.59*oe+.11*me]}static RGB_HTML([se,oe,me]){const he=ne(se),fe=ne(oe),ae=ne(me);return"#".concat(he).concat(fe).concat(ae)}static T_HTML(){return"#00000000"}static CMYK_RGB([se,oe,me,he]){return["RGB",1-Math.min(1,se+he),1-Math.min(1,me+he),1-Math.min(1,oe+he)]}static CMYK_HTML(se){const oe=this.CMYK_RGB(se).slice(1);return this.RGB_HTML(oe)}static RGB_CMYK([se,oe,me]){const he=1-se,fe=1-oe,ae=1-me,le=Math.min(he,fe,ae);return["CMYK",he,fe,ae,le]}}te.ColorConverters=re},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaLayer=void 0;var re=ne(19);class ie{static setupStorage(oe,me,he,fe,ae){const le=fe.getValue(me,{value:null});switch(he.name){case"textarea":if(le.value!==null&&(oe.textContent=le.value),ae==="print")break;oe.addEventListener("input",ye=>{fe.setValue(me,{value:ye.target.value})});break;case"input":if(he.attributes.type==="radio"||he.attributes.type==="checkbox"){if(le.value===he.attributes.xfaOn?oe.setAttribute("checked",!0):le.value===he.attributes.xfaOff&&oe.removeAttribute("checked"),ae==="print")break;oe.addEventListener("change",ye=>{fe.setValue(me,{value:ye.target.checked?ye.target.getAttribute("xfaOn"):ye.target.getAttribute("xfaOff")})})}else{if(le.value!==null&&oe.setAttribute("value",le.value),ae==="print")break;oe.addEventListener("input",ye=>{fe.setValue(me,{value:ye.target.value})})}break;case"select":if(le.value!==null)for(const ye of he.children)ye.attributes.value===le.value&&(ye.attributes.selected=!0);oe.addEventListener("input",ye=>{const ve=ye.target.options,de=ve.selectedIndex===-1?"":ve[ve.selectedIndex].value;fe.setValue(me,{value:de})});break}}static setAttributes({html:oe,element:me,storage:he=null,intent:fe,linkService:ae}){const{attributes:le}=me,ye=oe instanceof HTMLAnchorElement;le.type==="radio"&&(le.name="".concat(le.name,"-").concat(fe));for(const[ve,de]of Object.entries(le))if(de!=null)switch(ve){case"class":de.length&&oe.setAttribute(ve,de.join(" "));break;case"dataId":break;case"id":oe.setAttribute("data-element-id",de);break;case"style":Object.assign(oe.style,de);break;case"textContent":oe.textContent=de;break;default:(!ye||ve!=="href"&&ve!=="newWindow")&&oe.setAttribute(ve,de)}ye&&ae.addLinkAttributes(oe,le.href,le.newWindow),he&&le.dataId&&this.setupStorage(oe,le.dataId,me,he)}static render(oe){var ge;const me=oe.annotationStorage,he=oe.linkService,fe=oe.xfaHtml,ae=oe.intent||"display",le=document.createElement(fe.name);fe.attributes&&this.setAttributes({html:le,element:fe,intent:ae,linkService:he});const ye=[[fe,-1,le]],ve=oe.div;if(ve.append(le),oe.viewport){const ue="matrix(".concat(oe.viewport.transform.join(","),")");ve.style.transform=ue}ae!=="richText"&&ve.setAttribute("class","xfaLayer xfaFont");const de=[];for(;ye.length>0;){const[ue,Te,$e]=ye.at(-1);if(Te+1===ue.children.length){ye.pop();continue}const ke=ue.children[++ye.at(-1)[1]];if(ke===null)continue;const{name:Ce}=ke;if(Ce==="#text"){const be=document.createTextNode(ke.value);de.push(be),$e.append(be);continue}let ce;if((ge=ke==null?void 0:ke.attributes)!=null&&ge.xmlns?ce=document.createElementNS(ke.attributes.xmlns,Ce):ce=document.createElement(Ce),$e.append(ce),ke.attributes&&this.setAttributes({html:ce,element:ke,storage:me,intent:ae,linkService:he}),ke.children&&ke.children.length>0)ye.push([ke,-1,ce]);else if(ke.value){const be=document.createTextNode(ke.value);re.XfaText.shouldBuildText(Ce)&&de.push(be),ce.append(be)}}for(const ue of ve.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))ue.setAttribute("readOnly",!0);return{textDivs:de}}static update(oe){const me="matrix(".concat(oe.viewport.transform.join(","),")");oe.div.style.transform=me,oe.div.hidden=!1}}te.XfaLayer=ie},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.SVGGraphics=void 0;var re=ne(6),ie=ne(1),se=ne(10);let oe=class{constructor(){(0,ie.unreachable)("Not implemented: SVGGraphics")}};te.SVGGraphics=oe;{let ge=function(ce){let be=[];const we=[];for(const _e of ce){if(_e.fn==="save"){be.push({fnId:92,fn:"group",items:[]}),we.push(be),be=be.at(-1).items;continue}_e.fn==="restore"?be=we.pop():be.push(_e)}return be},ue=function(ce){if(Number.isInteger(ce))return ce.toString();const be=ce.toFixed(10);let we=be.length-1;if(be[we]!=="0")return be;do we--;while(be[we]==="0");return be.substring(0,be[we]==="."?we:we+1)},Te=function(ce){if(ce[4]===0&&ce[5]===0){if(ce[1]===0&&ce[2]===0)return ce[0]===1&&ce[3]===1?"":"scale(".concat(ue(ce[0])," ").concat(ue(ce[3]),")");if(ce[0]===ce[3]&&ce[1]===-ce[2]){const be=Math.acos(ce[0])*180/Math.PI;return"rotate(".concat(ue(be),")")}}else if(ce[0]===1&&ce[1]===0&&ce[2]===0&&ce[3]===1)return"translate(".concat(ue(ce[4])," ").concat(ue(ce[5]),")");return"matrix(".concat(ue(ce[0])," ").concat(ue(ce[1])," ").concat(ue(ce[2])," ").concat(ue(ce[3])," ").concat(ue(ce[4])," ")+"".concat(ue(ce[5]),")")};const me={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},he="http://www.w3.org/XML/1998/namespace",fe="http://www.w3.org/1999/xlink",ae=["butt","round","square"],le=["miter","round","bevel"],ye=function(ce,be="",we=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!we)return URL.createObjectURL(new Blob([ce],{type:be}));const _e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let Ee="data:".concat(be,";base64,");for(let De=0,Se=ce.length;De<Se;De+=3){const He=ce[De]&255,qe=ce[De+1]&255,Ke=ce[De+2]&255,Je=He>>2,et=(He&3)<<4|qe>>4,ut=De+1<Se?(qe&15)<<2|Ke>>6:64,st=De+2<Se?Ke&63:64;Ee+=_e[Je]+_e[et]+_e[ut]+_e[st]}return Ee},ve=function(){const ce=new Uint8Array([137,80,78,71,13,10,26,10]),be=12,we=new Int32Array(256);for(let Ke=0;Ke<256;Ke++){let Je=Ke;for(let et=0;et<8;et++)Je&1?Je=3988292384^Je>>1&2147483647:Je=Je>>1&2147483647;we[Ke]=Je}function _e(Ke,Je,et){let ut=-1;for(let st=Je;st<et;st++){const ct=(ut^Ke[st])&255,gt=we[ct];ut=ut>>>8^gt}return ut^-1}function Ee(Ke,Je,et,ut){let st=ut;const ct=Je.length;et[st]=ct>>24&255,et[st+1]=ct>>16&255,et[st+2]=ct>>8&255,et[st+3]=ct&255,st+=4,et[st]=Ke.charCodeAt(0)&255,et[st+1]=Ke.charCodeAt(1)&255,et[st+2]=Ke.charCodeAt(2)&255,et[st+3]=Ke.charCodeAt(3)&255,st+=4,et.set(Je,st),st+=Je.length;const gt=_e(et,ut+4,st);et[st]=gt>>24&255,et[st+1]=gt>>16&255,et[st+2]=gt>>8&255,et[st+3]=gt&255}function De(Ke,Je,et){let ut=1,st=0;for(let ct=Je;ct<et;++ct)ut=(ut+(Ke[ct]&255))%65521,st=(st+ut)%65521;return st<<16|ut}function Se(Ke){if(!se.isNodeJS)return He(Ke);try{let Je;parseInt(process.versions.node)>=8?Je=Ke:Je=Buffer.from(Ke);const et=require$$5.deflateSync(Je,{level:9});return et instanceof Uint8Array?et:new Uint8Array(et)}catch(Je){(0,ie.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+Je)}return He(Ke)}function He(Ke){let Je=Ke.length;const et=65535,ut=Math.ceil(Je/et),st=new Uint8Array(2+Je+ut*5+4);let ct=0;st[ct++]=120,st[ct++]=156;let gt=0;for(;Je>et;)st[ct++]=0,st[ct++]=255,st[ct++]=255,st[ct++]=0,st[ct++]=0,st.set(Ke.subarray(gt,gt+et),ct),ct+=et,gt+=et,Je-=et;st[ct++]=1,st[ct++]=Je&255,st[ct++]=Je>>8&255,st[ct++]=~Je&65535&255,st[ct++]=(~Je&65535)>>8&255,st.set(Ke.subarray(gt),ct),ct+=Ke.length-gt;const vt=De(Ke,0,Ke.length);return st[ct++]=vt>>24&255,st[ct++]=vt>>16&255,st[ct++]=vt>>8&255,st[ct++]=vt&255,st}function qe(Ke,Je,et,ut){const st=Ke.width,ct=Ke.height;let gt,vt,At;const yt=Ke.data;switch(Je){case ie.ImageKind.GRAYSCALE_1BPP:vt=0,gt=1,At=st+7>>3;break;case ie.ImageKind.RGB_24BPP:vt=2,gt=8,At=st*3;break;case ie.ImageKind.RGBA_32BPP:vt=6,gt=8,At=st*4;break;default:throw new Error("invalid format")}const ze=new Uint8Array((1+At)*ct);let xe=0,Pe=0;for(let je=0;je<ct;++je)ze[xe++]=0,ze.set(yt.subarray(Pe,Pe+At),xe),Pe+=At,xe+=At;if(Je===ie.ImageKind.GRAYSCALE_1BPP&&ut){xe=0;for(let je=0;je<ct;je++){xe++;for(let Ue=0;Ue<At;Ue++)ze[xe++]^=255}}const Le=new Uint8Array([st>>24&255,st>>16&255,st>>8&255,st&255,ct>>24&255,ct>>16&255,ct>>8&255,ct&255,gt,vt,0,0,0]),Ve=Se(ze),We=ce.length+be*3+Le.length+Ve.length,Xe=new Uint8Array(We);let Ne=0;return Xe.set(ce,Ne),Ne+=ce.length,Ee("IHDR",Le,Xe,Ne),Ne+=be+Le.length,Ee("IDATA",Ve,Xe,Ne),Ne+=be+Ve.length,Ee("IEND",new Uint8Array(0),Xe,Ne),ye(Xe,"image/png",et)}return function(Je,et,ut){const st=Je.kind===void 0?ie.ImageKind.GRAYSCALE_1BPP:Je.kind;return qe(Je,st,et,ut)}}();class de{constructor(){this.fontSizeScale=1,this.fontWeight=me.fontWeight,this.fontSize=0,this.textMatrix=ie.IDENTITY_MATRIX,this.fontMatrix=ie.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=ie.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=me.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(be,we){this.x=be,this.y=we}}let $e=0,ke=0,Ce=0;te.SVGGraphics=oe=class{constructor(ce,be,we=!1){(0,re.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new re.DOMSVGFactory,this.current=new de,this.transformMatrix=ie.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=ce,this.objs=be,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!we,this._operatorIdMapping=[];for(const _e in ie.OPS)this._operatorIdMapping[ie.OPS[_e]]=_e}getObject(ce,be=null){return typeof ce=="string"?ce.startsWith("g_")?this.commonObjs.get(ce):this.objs.get(ce):be}save(){this.transformStack.push(this.transformMatrix);const ce=this.current;this.extraStack.push(ce),this.current=ce.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(ce){this.save(),this.executeOpTree(ce),this.restore()}loadDependencies(ce){const be=ce.fnArray,we=ce.argsArray;for(let _e=0,Ee=be.length;_e<Ee;_e++)if(be[_e]===ie.OPS.dependency)for(const De of we[_e]){const Se=De.startsWith("g_")?this.commonObjs:this.objs,He=new Promise(qe=>{Se.get(De,qe)});this.current.dependencies.push(He)}return Promise.all(this.current.dependencies)}transform(ce,be,we,_e,Ee,De){const Se=[ce,be,we,_e,Ee,De];this.transformMatrix=ie.Util.transform(this.transformMatrix,Se),this.tgrp=null}getSVG(ce,be){this.viewport=be;const we=this._initialize(be);return this.loadDependencies(ce).then(()=>(this.transformMatrix=ie.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(ce)),we))}convertOpList(ce){const be=this._operatorIdMapping,we=ce.argsArray,_e=ce.fnArray,Ee=[];for(let De=0,Se=_e.length;De<Se;De++){const He=_e[De];Ee.push({fnId:He,fn:be[He],args:we[De]})}return ge(Ee)}executeOpTree(ce){for(const be of ce){const we=be.fn,_e=be.fnId,Ee=be.args;switch(_e|0){case ie.OPS.beginText:this.beginText();break;case ie.OPS.dependency:break;case ie.OPS.setLeading:this.setLeading(Ee);break;case ie.OPS.setLeadingMoveText:this.setLeadingMoveText(Ee[0],Ee[1]);break;case ie.OPS.setFont:this.setFont(Ee);break;case ie.OPS.showText:this.showText(Ee[0]);break;case ie.OPS.showSpacedText:this.showText(Ee[0]);break;case ie.OPS.endText:this.endText();break;case ie.OPS.moveText:this.moveText(Ee[0],Ee[1]);break;case ie.OPS.setCharSpacing:this.setCharSpacing(Ee[0]);break;case ie.OPS.setWordSpacing:this.setWordSpacing(Ee[0]);break;case ie.OPS.setHScale:this.setHScale(Ee[0]);break;case ie.OPS.setTextMatrix:this.setTextMatrix(Ee[0],Ee[1],Ee[2],Ee[3],Ee[4],Ee[5]);break;case ie.OPS.setTextRise:this.setTextRise(Ee[0]);break;case ie.OPS.setTextRenderingMode:this.setTextRenderingMode(Ee[0]);break;case ie.OPS.setLineWidth:this.setLineWidth(Ee[0]);break;case ie.OPS.setLineJoin:this.setLineJoin(Ee[0]);break;case ie.OPS.setLineCap:this.setLineCap(Ee[0]);break;case ie.OPS.setMiterLimit:this.setMiterLimit(Ee[0]);break;case ie.OPS.setFillRGBColor:this.setFillRGBColor(Ee[0],Ee[1],Ee[2]);break;case ie.OPS.setStrokeRGBColor:this.setStrokeRGBColor(Ee[0],Ee[1],Ee[2]);break;case ie.OPS.setStrokeColorN:this.setStrokeColorN(Ee);break;case ie.OPS.setFillColorN:this.setFillColorN(Ee);break;case ie.OPS.shadingFill:this.shadingFill(Ee[0]);break;case ie.OPS.setDash:this.setDash(Ee[0],Ee[1]);break;case ie.OPS.setRenderingIntent:this.setRenderingIntent(Ee[0]);break;case ie.OPS.setFlatness:this.setFlatness(Ee[0]);break;case ie.OPS.setGState:this.setGState(Ee[0]);break;case ie.OPS.fill:this.fill();break;case ie.OPS.eoFill:this.eoFill();break;case ie.OPS.stroke:this.stroke();break;case ie.OPS.fillStroke:this.fillStroke();break;case ie.OPS.eoFillStroke:this.eoFillStroke();break;case ie.OPS.clip:this.clip("nonzero");break;case ie.OPS.eoClip:this.clip("evenodd");break;case ie.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case ie.OPS.paintImageXObject:this.paintImageXObject(Ee[0]);break;case ie.OPS.paintInlineImageXObject:this.paintInlineImageXObject(Ee[0]);break;case ie.OPS.paintImageMaskXObject:this.paintImageMaskXObject(Ee[0]);break;case ie.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(Ee[0],Ee[1]);break;case ie.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case ie.OPS.closePath:this.closePath();break;case ie.OPS.closeStroke:this.closeStroke();break;case ie.OPS.closeFillStroke:this.closeFillStroke();break;case ie.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case ie.OPS.nextLine:this.nextLine();break;case ie.OPS.transform:this.transform(Ee[0],Ee[1],Ee[2],Ee[3],Ee[4],Ee[5]);break;case ie.OPS.constructPath:this.constructPath(Ee[0],Ee[1]);break;case ie.OPS.endPath:this.endPath();break;case 92:this.group(be.items);break;default:(0,ie.warn)("Unimplemented operator ".concat(we));break}}}setWordSpacing(ce){this.current.wordSpacing=ce}setCharSpacing(ce){this.current.charSpacing=ce}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(ce,be,we,_e,Ee,De){const Se=this.current;Se.textMatrix=Se.lineMatrix=[ce,be,we,_e,Ee,De],Se.textMatrixScale=Math.hypot(ce,be),Se.x=Se.lineX=0,Se.y=Se.lineY=0,Se.xcoords=[],Se.ycoords=[],Se.tspan=this.svgFactory.createElement("svg:tspan"),Se.tspan.setAttributeNS(null,"font-family",Se.fontFamily),Se.tspan.setAttributeNS(null,"font-size","".concat(ue(Se.fontSize),"px")),Se.tspan.setAttributeNS(null,"y",ue(-Se.y)),Se.txtElement=this.svgFactory.createElement("svg:text"),Se.txtElement.append(Se.tspan)}beginText(){const ce=this.current;ce.x=ce.lineX=0,ce.y=ce.lineY=0,ce.textMatrix=ie.IDENTITY_MATRIX,ce.lineMatrix=ie.IDENTITY_MATRIX,ce.textMatrixScale=1,ce.tspan=this.svgFactory.createElement("svg:tspan"),ce.txtElement=this.svgFactory.createElement("svg:text"),ce.txtgrp=this.svgFactory.createElement("svg:g"),ce.xcoords=[],ce.ycoords=[]}moveText(ce,be){const we=this.current;we.x=we.lineX+=ce,we.y=we.lineY+=be,we.xcoords=[],we.ycoords=[],we.tspan=this.svgFactory.createElement("svg:tspan"),we.tspan.setAttributeNS(null,"font-family",we.fontFamily),we.tspan.setAttributeNS(null,"font-size","".concat(ue(we.fontSize),"px")),we.tspan.setAttributeNS(null,"y",ue(-we.y))}showText(ce){const be=this.current,we=be.font,_e=be.fontSize;if(_e===0)return;const Ee=be.fontSizeScale,De=be.charSpacing,Se=be.wordSpacing,He=be.fontDirection,qe=be.textHScale*He,Ke=we.vertical,Je=Ke?1:-1,et=we.defaultVMetrics,ut=_e*be.fontMatrix[0];let st=0;for(const vt of ce){if(vt===null){st+=He*Se;continue}else if(typeof vt=="number"){st+=Je*vt*_e/1e3;continue}const At=(vt.isSpace?Se:0)+De,yt=vt.fontChar;let ze,xe,Pe=vt.width;if(Ke){let Ve;const We=vt.vmetric||et;Ve=vt.vmetric?We[1]:Pe*.5,Ve=-Ve*ut;const Xe=We[2]*ut;Pe=We?-We[0]:Pe,ze=Ve/Ee,xe=(st+Xe)/Ee}else ze=st/Ee,xe=0;(vt.isInFont||we.missingFile)&&(be.xcoords.push(be.x+ze),Ke&&be.ycoords.push(-be.y+xe),be.tspan.textContent+=yt);let Le;Ke?Le=Pe*ut-At*He:Le=Pe*ut+At*He,st+=Le}be.tspan.setAttributeNS(null,"x",be.xcoords.map(ue).join(" ")),Ke?be.tspan.setAttributeNS(null,"y",be.ycoords.map(ue).join(" ")):be.tspan.setAttributeNS(null,"y",ue(-be.y)),Ke?be.y-=st:be.x+=st*qe,be.tspan.setAttributeNS(null,"font-family",be.fontFamily),be.tspan.setAttributeNS(null,"font-size","".concat(ue(be.fontSize),"px")),be.fontStyle!==me.fontStyle&&be.tspan.setAttributeNS(null,"font-style",be.fontStyle),be.fontWeight!==me.fontWeight&&be.tspan.setAttributeNS(null,"font-weight",be.fontWeight);const ct=be.textRenderingMode&ie.TextRenderingMode.FILL_STROKE_MASK;if(ct===ie.TextRenderingMode.FILL||ct===ie.TextRenderingMode.FILL_STROKE?(be.fillColor!==me.fillColor&&be.tspan.setAttributeNS(null,"fill",be.fillColor),be.fillAlpha<1&&be.tspan.setAttributeNS(null,"fill-opacity",be.fillAlpha)):be.textRenderingMode===ie.TextRenderingMode.ADD_TO_PATH?be.tspan.setAttributeNS(null,"fill","transparent"):be.tspan.setAttributeNS(null,"fill","none"),ct===ie.TextRenderingMode.STROKE||ct===ie.TextRenderingMode.FILL_STROKE){const vt=1/(be.textMatrixScale||1);this._setStrokeAttributes(be.tspan,vt)}let gt=be.textMatrix;be.textRise!==0&&(gt=gt.slice(),gt[5]+=be.textRise),be.txtElement.setAttributeNS(null,"transform","".concat(Te(gt)," scale(").concat(ue(qe),", -1)")),be.txtElement.setAttributeNS(he,"xml:space","preserve"),be.txtElement.append(be.tspan),be.txtgrp.append(be.txtElement),this._ensureTransformGroup().append(be.txtElement)}setLeadingMoveText(ce,be){this.setLeading(-be),this.moveText(ce,be)}addFontStyle(ce){if(!ce.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const be=ye(ce.data,ce.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(ce.loadedName,'";')+" src: url(".concat(be,"); }\n")}setFont(ce){const be=this.current,we=this.commonObjs.get(ce[0]);let _e=ce[1];be.font=we,this.embedFonts&&!we.missingFile&&!this.embeddedFonts[we.loadedName]&&(this.addFontStyle(we),this.embeddedFonts[we.loadedName]=we),be.fontMatrix=we.fontMatrix||ie.FONT_IDENTITY_MATRIX;let Ee="normal";we.black?Ee="900":we.bold&&(Ee="bold");const De=we.italic?"italic":"normal";_e<0?(_e=-_e,be.fontDirection=-1):be.fontDirection=1,be.fontSize=_e,be.fontFamily=we.loadedName,be.fontWeight=Ee,be.fontStyle=De,be.tspan=this.svgFactory.createElement("svg:tspan"),be.tspan.setAttributeNS(null,"y",ue(-be.y)),be.xcoords=[],be.ycoords=[]}endText(){var be;const ce=this.current;ce.textRenderingMode&ie.TextRenderingMode.ADD_TO_PATH_FLAG&&((be=ce.txtElement)!=null&&be.hasChildNodes())&&(ce.element=ce.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(ce){ce>0&&(this.current.lineWidth=ce)}setLineCap(ce){this.current.lineCap=ae[ce]}setLineJoin(ce){this.current.lineJoin=le[ce]}setMiterLimit(ce){this.current.miterLimit=ce}setStrokeAlpha(ce){this.current.strokeAlpha=ce}setStrokeRGBColor(ce,be,we){this.current.strokeColor=ie.Util.makeHexColor(ce,be,we)}setFillAlpha(ce){this.current.fillAlpha=ce}setFillRGBColor(ce,be,we){this.current.fillColor=ie.Util.makeHexColor(ce,be,we),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(ce){this.current.strokeColor=this._makeColorN_Pattern(ce)}setFillColorN(ce){this.current.fillColor=this._makeColorN_Pattern(ce)}shadingFill(ce){const be=this.viewport.width,we=this.viewport.height,_e=ie.Util.inverseTransform(this.transformMatrix),Ee=ie.Util.applyTransform([0,0],_e),De=ie.Util.applyTransform([0,we],_e),Se=ie.Util.applyTransform([be,0],_e),He=ie.Util.applyTransform([be,we],_e),qe=Math.min(Ee[0],De[0],Se[0],He[0]),Ke=Math.min(Ee[1],De[1],Se[1],He[1]),Je=Math.max(Ee[0],De[0],Se[0],He[0]),et=Math.max(Ee[1],De[1],Se[1],He[1]),ut=this.svgFactory.createElement("svg:rect");ut.setAttributeNS(null,"x",qe),ut.setAttributeNS(null,"y",Ke),ut.setAttributeNS(null,"width",Je-qe),ut.setAttributeNS(null,"height",et-Ke),ut.setAttributeNS(null,"fill",this._makeShadingPattern(ce)),this.current.fillAlpha<1&&ut.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(ut)}_makeColorN_Pattern(ce){return ce[0]==="TilingPattern"?this._makeTilingPattern(ce):this._makeShadingPattern(ce)}_makeTilingPattern(ce){const be=ce[1],we=ce[2],_e=ce[3]||ie.IDENTITY_MATRIX,[Ee,De,Se,He]=ce[4],qe=ce[5],Ke=ce[6],Je=ce[7],et="shading".concat(Ce++),[ut,st,ct,gt]=ie.Util.normalizeRect([...ie.Util.applyTransform([Ee,De],_e),...ie.Util.applyTransform([Se,He],_e)]),[vt,At]=ie.Util.singularValueDecompose2dScale(_e),yt=qe*vt,ze=Ke*At,xe=this.svgFactory.createElement("svg:pattern");xe.setAttributeNS(null,"id",et),xe.setAttributeNS(null,"patternUnits","userSpaceOnUse"),xe.setAttributeNS(null,"width",yt),xe.setAttributeNS(null,"height",ze),xe.setAttributeNS(null,"x","".concat(ut)),xe.setAttributeNS(null,"y","".concat(st));const Pe=this.svg,Le=this.transformMatrix,Ve=this.current.fillColor,We=this.current.strokeColor,Xe=this.svgFactory.create(ct-ut,gt-st);if(this.svg=Xe,this.transformMatrix=_e,Je===2){const Ne=ie.Util.makeHexColor(...be);this.current.fillColor=Ne,this.current.strokeColor=Ne}return this.executeOpTree(this.convertOpList(we)),this.svg=Pe,this.transformMatrix=Le,this.current.fillColor=Ve,this.current.strokeColor=We,xe.append(Xe.childNodes[0]),this.defs.append(xe),"url(#".concat(et,")")}_makeShadingPattern(ce){switch(typeof ce=="string"&&(ce=this.objs.get(ce)),ce[0]){case"RadialAxial":const be="shading".concat(Ce++),we=ce[3];let _e;switch(ce[1]){case"axial":const Ee=ce[4],De=ce[5];_e=this.svgFactory.createElement("svg:linearGradient"),_e.setAttributeNS(null,"id",be),_e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),_e.setAttributeNS(null,"x1",Ee[0]),_e.setAttributeNS(null,"y1",Ee[1]),_e.setAttributeNS(null,"x2",De[0]),_e.setAttributeNS(null,"y2",De[1]);break;case"radial":const Se=ce[4],He=ce[5],qe=ce[6],Ke=ce[7];_e=this.svgFactory.createElement("svg:radialGradient"),_e.setAttributeNS(null,"id",be),_e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),_e.setAttributeNS(null,"cx",He[0]),_e.setAttributeNS(null,"cy",He[1]),_e.setAttributeNS(null,"r",Ke),_e.setAttributeNS(null,"fx",Se[0]),_e.setAttributeNS(null,"fy",Se[1]),_e.setAttributeNS(null,"fr",qe);break;default:throw new Error("Unknown RadialAxial type: ".concat(ce[1]))}for(const Ee of we){const De=this.svgFactory.createElement("svg:stop");De.setAttributeNS(null,"offset",Ee[0]),De.setAttributeNS(null,"stop-color",Ee[1]),_e.append(De)}return this.defs.append(_e),"url(#".concat(be,")");case"Mesh":return(0,ie.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(ce[0]))}}setDash(ce,be){this.current.dashArray=ce,this.current.dashPhase=be}constructPath(ce,be){const we=this.current;let _e=we.x,Ee=we.y,De=[],Se=0;for(const He of ce)switch(He|0){case ie.OPS.rectangle:_e=be[Se++],Ee=be[Se++];const qe=be[Se++],Ke=be[Se++],Je=_e+qe,et=Ee+Ke;De.push("M",ue(_e),ue(Ee),"L",ue(Je),ue(Ee),"L",ue(Je),ue(et),"L",ue(_e),ue(et),"Z");break;case ie.OPS.moveTo:_e=be[Se++],Ee=be[Se++],De.push("M",ue(_e),ue(Ee));break;case ie.OPS.lineTo:_e=be[Se++],Ee=be[Se++],De.push("L",ue(_e),ue(Ee));break;case ie.OPS.curveTo:_e=be[Se+4],Ee=be[Se+5],De.push("C",ue(be[Se]),ue(be[Se+1]),ue(be[Se+2]),ue(be[Se+3]),ue(_e),ue(Ee)),Se+=6;break;case ie.OPS.curveTo2:De.push("C",ue(_e),ue(Ee),ue(be[Se]),ue(be[Se+1]),ue(be[Se+2]),ue(be[Se+3])),_e=be[Se+2],Ee=be[Se+3],Se+=4;break;case ie.OPS.curveTo3:_e=be[Se+2],Ee=be[Se+3],De.push("C",ue(be[Se]),ue(be[Se+1]),ue(_e),ue(Ee),ue(_e),ue(Ee)),Se+=4;break;case ie.OPS.closePath:De.push("Z");break}De=De.join(" "),we.path&&ce.length>0&&ce[0]!==ie.OPS.rectangle&&ce[0]!==ie.OPS.moveTo?De=we.path.getAttributeNS(null,"d")+De:(we.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(we.path)),we.path.setAttributeNS(null,"d",De),we.path.setAttributeNS(null,"fill","none"),we.element=we.path,we.setCurrentPoint(_e,Ee)}endPath(){const ce=this.current;if(ce.path=null,!this.pendingClip)return;if(!ce.element){this.pendingClip=null;return}const be="clippath".concat($e++),we=this.svgFactory.createElement("svg:clipPath");we.setAttributeNS(null,"id",be),we.setAttributeNS(null,"transform",Te(this.transformMatrix));const _e=ce.element.cloneNode(!0);if(this.pendingClip==="evenodd"?_e.setAttributeNS(null,"clip-rule","evenodd"):_e.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,we.append(_e),this.defs.append(we),ce.activeClipUrl){ce.clipGroup=null;for(const Ee of this.extraStack)Ee.clipGroup=null;we.setAttributeNS(null,"clip-path",ce.activeClipUrl)}ce.activeClipUrl="url(#".concat(be,")"),this.tgrp=null}clip(ce){this.pendingClip=ce}closePath(){const ce=this.current;if(ce.path){const be="".concat(ce.path.getAttributeNS(null,"d"),"Z");ce.path.setAttributeNS(null,"d",be)}}setLeading(ce){this.current.leading=-ce}setTextRise(ce){this.current.textRise=ce}setTextRenderingMode(ce){this.current.textRenderingMode=ce}setHScale(ce){this.current.textHScale=ce/100}setRenderingIntent(ce){}setFlatness(ce){}setGState(ce){for(const[be,we]of ce)switch(be){case"LW":this.setLineWidth(we);break;case"LC":this.setLineCap(we);break;case"LJ":this.setLineJoin(we);break;case"ML":this.setMiterLimit(we);break;case"D":this.setDash(we[0],we[1]);break;case"RI":this.setRenderingIntent(we);break;case"FL":this.setFlatness(we);break;case"Font":this.setFont(we);break;case"CA":this.setStrokeAlpha(we);break;case"ca":this.setFillAlpha(we);break;default:(0,ie.warn)("Unimplemented graphic state operator ".concat(be));break}}fill(){const ce=this.current;ce.element&&(ce.element.setAttributeNS(null,"fill",ce.fillColor),ce.element.setAttributeNS(null,"fill-opacity",ce.fillAlpha),this.endPath())}stroke(){const ce=this.current;ce.element&&(this._setStrokeAttributes(ce.element),ce.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(ce,be=1){const we=this.current;let _e=we.dashArray;be!==1&&_e.length>0&&(_e=_e.map(function(Ee){return be*Ee})),ce.setAttributeNS(null,"stroke",we.strokeColor),ce.setAttributeNS(null,"stroke-opacity",we.strokeAlpha),ce.setAttributeNS(null,"stroke-miterlimit",ue(we.miterLimit)),ce.setAttributeNS(null,"stroke-linecap",we.lineCap),ce.setAttributeNS(null,"stroke-linejoin",we.lineJoin),ce.setAttributeNS(null,"stroke-width",ue(be*we.lineWidth)+"px"),ce.setAttributeNS(null,"stroke-dasharray",_e.map(ue).join(" ")),ce.setAttributeNS(null,"stroke-dashoffset",ue(be*we.dashPhase)+"px")}eoFill(){var ce;(ce=this.current.element)==null||ce.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var ce;(ce=this.current.element)==null||ce.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const ce=this.svgFactory.createElement("svg:rect");ce.setAttributeNS(null,"x","0"),ce.setAttributeNS(null,"y","0"),ce.setAttributeNS(null,"width","1px"),ce.setAttributeNS(null,"height","1px"),ce.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(ce)}paintImageXObject(ce){const be=this.getObject(ce);if(!be){(0,ie.warn)("Dependent image with object ID ".concat(ce," is not ready yet"));return}this.paintInlineImageXObject(be)}paintInlineImageXObject(ce,be){const we=ce.width,_e=ce.height,Ee=ve(ce,this.forceDataSchema,!!be),De=this.svgFactory.createElement("svg:rect");De.setAttributeNS(null,"x","0"),De.setAttributeNS(null,"y","0"),De.setAttributeNS(null,"width",ue(we)),De.setAttributeNS(null,"height",ue(_e)),this.current.element=De,this.clip("nonzero");const Se=this.svgFactory.createElement("svg:image");Se.setAttributeNS(fe,"xlink:href",Ee),Se.setAttributeNS(null,"x","0"),Se.setAttributeNS(null,"y",ue(-_e)),Se.setAttributeNS(null,"width",ue(we)+"px"),Se.setAttributeNS(null,"height",ue(_e)+"px"),Se.setAttributeNS(null,"transform","scale(".concat(ue(1/we)," ").concat(ue(-1/_e),")")),be?be.append(Se):this._ensureTransformGroup().append(Se)}paintImageMaskXObject(ce){const be=this.getObject(ce.data,ce);if(be.bitmap){(0,ie.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const we=this.current,_e=be.width,Ee=be.height,De=we.fillColor;we.maskId="mask".concat(ke++);const Se=this.svgFactory.createElement("svg:mask");Se.setAttributeNS(null,"id",we.maskId);const He=this.svgFactory.createElement("svg:rect");He.setAttributeNS(null,"x","0"),He.setAttributeNS(null,"y","0"),He.setAttributeNS(null,"width",ue(_e)),He.setAttributeNS(null,"height",ue(Ee)),He.setAttributeNS(null,"fill",De),He.setAttributeNS(null,"mask","url(#".concat(we.maskId,")")),this.defs.append(Se),this._ensureTransformGroup().append(He),this.paintInlineImageXObject(be,Se)}paintFormXObjectBegin(ce,be){if(Array.isArray(ce)&&ce.length===6&&this.transform(ce[0],ce[1],ce[2],ce[3],ce[4],ce[5]),be){const we=be[2]-be[0],_e=be[3]-be[1],Ee=this.svgFactory.createElement("svg:rect");Ee.setAttributeNS(null,"x",be[0]),Ee.setAttributeNS(null,"y",be[1]),Ee.setAttributeNS(null,"width",ue(we)),Ee.setAttributeNS(null,"height",ue(_e)),this.current.element=Ee,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(ce){const be=this.svgFactory.create(ce.width,ce.height),we=this.svgFactory.createElement("svg:defs");be.append(we),this.defs=we;const _e=this.svgFactory.createElement("svg:g");return _e.setAttributeNS(null,"transform",Te(ce.transform)),be.append(_e),this.svg=_e,be}_ensureClipGroup(){if(!this.current.clipGroup){const ce=this.svgFactory.createElement("svg:g");ce.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(ce),this.current.clipGroup=ce}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",Te(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}}],__webpack_module_cache__={};function __w_pdfjs_require__(ee){var te=__webpack_module_cache__[ee];if(te!==void 0)return te.exports;var ne=__webpack_module_cache__[ee]={exports:{}};return __webpack_modules__[ee](ne,ne.exports,__w_pdfjs_require__),ne.exports}var __webpack_exports__={};return(()=>{var ee=__webpack_exports__;Object.defineProperty(ee,"__esModule",{value:!0}),Object.defineProperty(ee,"AbortException",{enumerable:!0,get:function(){return te.AbortException}}),Object.defineProperty(ee,"AnnotationEditorLayer",{enumerable:!0,get:function(){return se.AnnotationEditorLayer}}),Object.defineProperty(ee,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return te.AnnotationEditorParamsType}}),Object.defineProperty(ee,"AnnotationEditorType",{enumerable:!0,get:function(){return te.AnnotationEditorType}}),Object.defineProperty(ee,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return oe.AnnotationEditorUIManager}}),Object.defineProperty(ee,"AnnotationLayer",{enumerable:!0,get:function(){return me.AnnotationLayer}}),Object.defineProperty(ee,"AnnotationMode",{enumerable:!0,get:function(){return te.AnnotationMode}}),Object.defineProperty(ee,"CMapCompressionType",{enumerable:!0,get:function(){return te.CMapCompressionType}}),Object.defineProperty(ee,"FeatureTest",{enumerable:!0,get:function(){return te.FeatureTest}}),Object.defineProperty(ee,"GlobalWorkerOptions",{enumerable:!0,get:function(){return he.GlobalWorkerOptions}}),Object.defineProperty(ee,"InvalidPDFException",{enumerable:!0,get:function(){return te.InvalidPDFException}}),Object.defineProperty(ee,"MissingPDFException",{enumerable:!0,get:function(){return te.MissingPDFException}}),Object.defineProperty(ee,"OPS",{enumerable:!0,get:function(){return te.OPS}}),Object.defineProperty(ee,"PDFDataRangeTransport",{enumerable:!0,get:function(){return ne.PDFDataRangeTransport}}),Object.defineProperty(ee,"PDFDateString",{enumerable:!0,get:function(){return re.PDFDateString}}),Object.defineProperty(ee,"PDFWorker",{enumerable:!0,get:function(){return ne.PDFWorker}}),Object.defineProperty(ee,"PasswordResponses",{enumerable:!0,get:function(){return te.PasswordResponses}}),Object.defineProperty(ee,"PermissionFlag",{enumerable:!0,get:function(){return te.PermissionFlag}}),Object.defineProperty(ee,"PixelsPerInch",{enumerable:!0,get:function(){return re.PixelsPerInch}}),Object.defineProperty(ee,"PromiseCapability",{enumerable:!0,get:function(){return te.PromiseCapability}}),Object.defineProperty(ee,"RenderingCancelledException",{enumerable:!0,get:function(){return re.RenderingCancelledException}}),Object.defineProperty(ee,"SVGGraphics",{enumerable:!0,get:function(){return fe.SVGGraphics}}),Object.defineProperty(ee,"UnexpectedResponseException",{enumerable:!0,get:function(){return te.UnexpectedResponseException}}),Object.defineProperty(ee,"Util",{enumerable:!0,get:function(){return te.Util}}),Object.defineProperty(ee,"VerbosityLevel",{enumerable:!0,get:function(){return te.VerbosityLevel}}),Object.defineProperty(ee,"XfaLayer",{enumerable:!0,get:function(){return ae.XfaLayer}}),Object.defineProperty(ee,"build",{enumerable:!0,get:function(){return ne.build}}),Object.defineProperty(ee,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return te.createValidAbsoluteUrl}}),Object.defineProperty(ee,"getDocument",{enumerable:!0,get:function(){return ne.getDocument}}),Object.defineProperty(ee,"getFilenameFromUrl",{enumerable:!0,get:function(){return re.getFilenameFromUrl}}),Object.defineProperty(ee,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return re.getPdfFilenameFromUrl}}),Object.defineProperty(ee,"getXfaPageViewport",{enumerable:!0,get:function(){return re.getXfaPageViewport}}),Object.defineProperty(ee,"isDataScheme",{enumerable:!0,get:function(){return re.isDataScheme}}),Object.defineProperty(ee,"isPdfFile",{enumerable:!0,get:function(){return re.isPdfFile}}),Object.defineProperty(ee,"loadScript",{enumerable:!0,get:function(){return re.loadScript}}),Object.defineProperty(ee,"normalizeUnicode",{enumerable:!0,get:function(){return te.normalizeUnicode}}),Object.defineProperty(ee,"renderTextLayer",{enumerable:!0,get:function(){return ie.renderTextLayer}}),Object.defineProperty(ee,"setLayerDimensions",{enumerable:!0,get:function(){return re.setLayerDimensions}}),Object.defineProperty(ee,"shadow",{enumerable:!0,get:function(){return te.shadow}}),Object.defineProperty(ee,"updateTextLayer",{enumerable:!0,get:function(){return ie.updateTextLayer}}),Object.defineProperty(ee,"version",{enumerable:!0,get:function(){return ne.version}});var te=__w_pdfjs_require__(1),ne=__w_pdfjs_require__(2),re=__w_pdfjs_require__(6),ie=__w_pdfjs_require__(26),se=__w_pdfjs_require__(27),oe=__w_pdfjs_require__(5),me=__w_pdfjs_require__(32),he=__w_pdfjs_require__(14),fe=__w_pdfjs_require__(35),ae=__w_pdfjs_require__(34)})(),__webpack_exports__})())})(pdf$1);var pdfExports=pdf$1.exports;const pdf=getDefaultExportFromCjs(pdfExports),pdfjsModule=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]),pdfjs="default"in pdfjsModule?pdf:pdfjsModule,pdfjs$1=pdfjs;var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function ee(re,ie,se,oe,me,he){if(he!==ReactPropTypesSecret){var fe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw fe.name="Invariant Violation",fe}}ee.isRequired=ee;function te(){return ee}var ne={array:ee,bigint:ee,bool:ee,func:ee,number:ee,object:ee,string:ee,symbol:ee,any:ee,arrayOf:te,element:ee,elementType:ee,instanceOf:te,node:ee,objectOf:te,oneOf:te,oneOfType:te,shape:te,exact:te,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ne.PropTypes=ne,ne};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);var __spreadArray=globalThis&&globalThis.__spreadArray||function(ee,te,ne){if(ne||arguments.length===2)for(var re=0,ie=te.length,se;re<ie;re++)(se||!(re in te))&&(se||(se=Array.prototype.slice.call(te,0,re)),se[re]=te[re]);return ee.concat(se||Array.prototype.slice.call(te))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(ee,te){var ne={};return allEvents.forEach(function(re){var ie=ee[re];ie&&(te?ne[re]=function(se){return ie(se,te(re))}:ne[re]=ie)}),ne}function makeCancellablePromise(ee){var te=!1,ne=new Promise(function(re,ie){ee.then(function(se){return!te&&re(se)}).catch(function(se){return!te&&ie(se)})});return{promise:ne,cancel:function(){te=!0}}}function r(ee){var te,ne,re="";if(typeof ee=="string"||typeof ee=="number")re+=ee;else if(typeof ee=="object")if(Array.isArray(ee))for(te=0;te<ee.length;te++)ee[te]&&(ne=r(ee[te]))&&(re&&(re+=" "),re+=ne);else for(te in ee)ee[te]&&(re&&(re+=" "),re+=te);return re}function clsx(){for(var ee,te,ne=0,re="";ne<arguments.length;)(ee=arguments[ne++])&&(te=r(ee))&&(re&&(re+=" "),re+=te);return re}var isProduction=!0,prefix="Invariant failed";function invariant(ee,te){if(!ee){if(isProduction)throw new Error(prefix);var ne=typeof te=="function"?te():te,re=ne?"".concat(prefix,": ").concat(ne):prefix;throw new Error(re)}}function warning(ee,te){}const DocumentContext=G$1(null);function Message({children:ee,type:te}){return Cn.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(te)},ee)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(te){this.pdfDocument=te}setViewer(te){this.pdfViewer=te}setExternalLinkRel(te){this.externalLinkRel=te}setExternalLinkTarget(te){this.externalLinkTarget=te}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(te){invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=te}get rotation(){return 0}set rotation(te){}goToDestination(te){return new Promise(ne=>{invariant(this.pdfDocument,"PDF document not loaded."),invariant(te,"Destination is not specified."),typeof te=="string"?this.pdfDocument.getDestination(te).then(ne):Array.isArray(te)?ne(te):te.then(ne)}).then(ne=>{invariant(Array.isArray(ne),'"'.concat(ne,'" is not a valid destination array.'));const re=ne[0];new Promise(ie=>{invariant(this.pdfDocument,"PDF document not loaded."),re instanceof Object?this.pdfDocument.getPageIndex(re).then(se=>{ie(se)}).catch(()=>{invariant(!1,'"'.concat(re,'" is not a valid page reference.'))}):typeof re=="number"?ie(re):invariant(!1,'"'.concat(re,'" is not a valid destination reference.'))}).then(ie=>{const se=ie+1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(se>=1&&se<=this.pagesCount,'"'.concat(se,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:ne,pageIndex:ie,pageNumber:se})})})}navigateTo(te){this.goToDestination(te)}goToPage(te){const ne=te-1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(te>=1&&te<=this.pagesCount,'"'.concat(te,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:ne,pageNumber:te})}addLinkAttributes(te,ne,re){te.href=ne,te.rel=this.externalLinkRel||DEFAULT_LINK_REL,te.target=re?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordResponses$1=PasswordResponses,isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(ee){return typeof ee<"u"}function isProvided(ee){return isDefined(ee)&&ee!==null}function isString(ee){return typeof ee=="string"}function isArrayBuffer(ee){return ee instanceof ArrayBuffer}function isBlob(ee){return invariant(isBrowser,"isBlob can only be used in a browser environment"),ee instanceof Blob}function isDataURI(ee){return isString(ee)&&/^data:/.test(ee)}function dataURItoByteString(ee){invariant(isDataURI(ee),"Invalid data URI.");const[te="",ne=""]=ee.split(",");return te.split(";").indexOf("base64")!==-1?atob(ne):unescape(ne)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}function displayWorkerWarning(){}function cancelRunningTask(ee){ee&&ee.cancel&&ee.cancel()}function makePageCallback(ee,te){return Object.defineProperty(ee,"width",{get(){return this.view[2]*te},configurable:!0}),Object.defineProperty(ee,"height",{get(){return this.view[3]*te},configurable:!0}),Object.defineProperty(ee,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(ee,"originalHeight",{get(){return this.view[3]},configurable:!0}),ee}function isCancelException(ee){return ee.name==="RenderingCancelledException"}function loadFromFile(ee){return new Promise((te,ne)=>{const re=new FileReader;re.onload=()=>{if(!re.result)return ne(new Error("Error while reading a file."));te(re.result)},re.onerror=ie=>{if(!ie.target)return ne(new Error("Error while reading a file."));const{error:se}=ie.target;if(!se)return ne(new Error("Error while reading a file."));switch(se.code){case se.NOT_FOUND_ERR:return ne(new Error("Error while reading a file: File not found."));case se.SECURITY_ERR:return ne(new Error("Error while reading a file: Security error."));case se.ABORT_ERR:return ne(new Error("Error while reading a file: Aborted."));default:return ne(new Error("Error while reading a file."))}},re.readAsArrayBuffer(ee)})}function reducer(ee,te){switch(te.type){case"RESOLVE":return{value:te.value,error:void 0};case"REJECT":return{value:!1,error:te.error};case"RESET":return{value:void 0,error:void 0};default:return ee}}function useResolver(){return s$1(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs$1,eventProps=(()=>{const ee={};return allEvents.forEach(te=>{ee[te]=PropTypes.func}),ee})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService),PropTypes.oneOf(["_self","_blank","_parent","_top"]),PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function ee(te,ne,re){const{[ne]:ie,pageNumber:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<0)return new Error("Expected `".concat(ne,"` to be greater or equal to 0."));const{numPages:me}=oe;if(ie+1>me)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(me-1,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPageNumber=function ee(te,ne,re){const{[ne]:ie,pageIndex:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<1)return new Error("Expected `".concat(ne,"` to be greater or equal to 1."));const{numPages:me}=oe;if(ie>me)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(me,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter$1=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function me(ae){try{fe(re.next(ae))}catch(le){oe(le)}}function he(ae){try{fe(re.throw(ae))}catch(le){oe(le)}}function fe(ae){ae.done?se(ae.value):ie(ae.value).then(me,he)}fe((re=re.apply(ee,te||[])).next())})},__rest$4=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const{PDFDataRangeTransport}=pdfjs$1,defaultOnPassword=(ee,te)=>{switch(te){case PasswordResponses$1.NEED_PASSWORD:{const ne=prompt("Enter the password to open this PDF file.");ee(ne);break}case PasswordResponses$1.INCORRECT_PASSWORD:{const ne=prompt("Invalid password. Please try again.");ee(ne);break}}},Document=k$1(function ee(te,ne){var{children:re,className:ie,error:se="Failed to load PDF file.",externalLinkRel:oe,externalLinkTarget:me,file:he,inputRef:fe,imageResourcesPath:ae,loading:le="Loading PDF…",noData:ye="No PDF file specified.",onItemClick:ve,onLoadError:de,onLoadProgress:ge,onLoadSuccess:ue,onPassword:Te=defaultOnPassword,onSourceError:$e,onSourceSuccess:ke,options:Ce,renderMode:ce,rotate:be}=te,we=__rest$4(te,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[_e,Ee]=useResolver(),{value:De,error:Se}=_e,[He,qe]=useResolver(),{value:Ke,error:Je}=He,et=_(new LinkService),ut=_([]),st=_({scrollPageIntoView:pe=>{const{dest:Ae,pageNumber:Re,pageIndex:Me=Re-1}=pe;if(ve){ve({dest:Ae,pageIndex:Me,pageNumber:Re});return}const Oe=ut.current[Me];if(Oe){Oe.scrollIntoView();return}}});A$1(ne,()=>({linkService:et,pages:ut,viewer:st}),[]);function ct(){ke&&ke()}function gt(){Se&&(Se.toString(),$e&&$e(Se))}function vt(){Ee({type:"RESET"})}p$1(vt,[he,Ee]);const At=T$1(()=>__awaiter$1(this,void 0,void 0,function*(){if(!he)return null;if(typeof he=="string")return isDataURI(he)?{data:dataURItoByteString(he)}:{url:he};if(he instanceof PDFDataRangeTransport)return{range:he};if(isArrayBuffer(he))return{data:he};if(isBrowser&&isBlob(he))return{data:yield loadFromFile(he)};if(invariant(typeof he=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant("data"in he||"range"in he||"url"in he,"Invalid parameter object: need either .data, .range or .url"),"url"in he&&typeof he.url=="string"&&isDataURI(he.url)){const{url:pe}=he,Ae=__rest$4(he,["url"]),Re=dataURItoByteString(pe);return Object.assign({data:Re},Ae)}return he}),[he]);p$1(()=>{const pe=makeCancellablePromise(At());return pe.promise.then(Ae=>{Ee({type:"RESOLVE",value:Ae})}).catch(Ae=>{Ee({type:"REJECT",error:Ae})}),()=>{cancelRunningTask(pe)}},[At,Ee]),p$1(()=>{if(!(typeof De>"u")){if(De===!1){gt();return}ct()}},[De]);function yt(){Ke&&(ue&&ue(Ke),ut.current=new Array(Ke.numPages),et.current.setDocument(Ke))}function ze(){Je&&(Je.toString(),de&&de(Je))}function xe(){qe({type:"RESET"})}p$1(xe,[qe,De]);function Pe(){if(!De)return;const pe=Ce?Object.assign(Object.assign({},De),Ce):De,Ae=pdfjs$1.getDocument(pe);ge&&(Ae.onProgress=ge),Te&&(Ae.onPassword=Te);const Re=Ae;return Re.promise.then(Me=>{qe({type:"RESOLVE",value:Me})}).catch(Me=>{Re.destroyed||qe({type:"REJECT",error:Me})}),()=>{Re.destroy()}}p$1(Pe,[Ce,qe,De]),p$1(()=>{if(!(typeof Ke>"u")){if(Ke===!1){ze();return}yt()}},[Ke]);function Le(){et.current.setViewer(st.current),et.current.setExternalLinkRel(oe),et.current.setExternalLinkTarget(me)}p$1(Le,[oe,me]);function Ve(pe,Ae){ut.current[pe]=Ae}function We(pe){delete ut.current[pe]}const Xe=F$1(()=>({imageResourcesPath:ae,linkService:et.current,onItemClick:ve,pdf:Ke,registerPage:Ve,renderMode:ce,rotate:be,unregisterPage:We}),[ae,ve,Ke,ce,be]),Ne=F$1(()=>makeEventProps(we,()=>Ke),[we,Ke]);function je(){return Cn.createElement(DocumentContext.Provider,{value:Xe},re)}function Ue(){return he?Ke==null?Cn.createElement(Message,{type:"loading"},typeof le=="function"?le():le):Ke===!1?Cn.createElement(Message,{type:"error"},typeof se=="function"?se():se):je():Cn.createElement(Message,{type:"no-data"},typeof ye=="function"?ye():ye)}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Document",ie),ref:fe,style:{"--scale-factor":"1"}},Ne),Ue())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});const Document$1=Document,OutlineContext=G$1(null);class Ref{constructor({num:te,gen:ne}){this.num=te,this.gen=ne}toString(){let te="".concat(this.num,"R");return this.gen!==0&&(te+=this.gen),te}}function useCachedValue(ee){const te=_(),ne=te.current;return isDefined(ne)?()=>ne:()=>{const re=ee();return te.current=re,re}}function useDocumentContext(){return q$2(DocumentContext)}function useOutlineContext(){return q$2(OutlineContext)}var __awaiter=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function me(ae){try{fe(re.next(ae))}catch(le){oe(le)}}function he(ae){try{fe(re.throw(ae))}catch(le){oe(le)}}function fe(ae){ae.done?se(ae.value):ie(ae.value).then(me,he)}fe((re=re.apply(ee,te||[])).next())})},__rest$3=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};function OutlineItem(ee){const te=useDocumentContext();invariant(te,"Unable to find Document context. Did you wrap <Outline /> in <Document />?");const ne=useOutlineContext();invariant(ne,"Unable to find Outline context.");const re=Object.assign(Object.assign(Object.assign({},te),ne),ee),{item:ie,linkService:se,onItemClick:oe,pdf:me}=re,he=__rest$3(re,["item","linkService","onItemClick","pdf"]);invariant(me,"Attempted to load an outline, but no document was specified.");const fe=useCachedValue(()=>typeof ie.dest=="string"?me.getDestination(ie.dest):ie.dest),ae=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){const de=yield fe();if(!de)throw new Error("Destination not found.");const[ge]=de;return me.getPageIndex(new Ref(ge))})),le=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){return(yield ae())+1}));function ye(de){de.preventDefault(),oe?Promise.all([fe(),ae(),le()]).then(([ge,ue,Te])=>{oe({dest:ge,pageIndex:ue,pageNumber:Te})}):se.goToDestination(ie.dest)}function ve(){if(!ie.items||!ie.items.length)return null;const{items:de}=ie;return Cn.createElement("ul",null,de.map((ge,ue)=>Cn.createElement(OutlineItem,Object.assign({key:typeof ge.dest=="string"?ge.dest:ue,item:ge},he))))}return Cn.createElement("li",null,Cn.createElement("a",{href:"#",onClick:ye},ie.title),ve())}var __rest$2=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Outline=function ee(te){const ne=useDocumentContext();invariant(ne,"Unable to find Document context. Did you wrap <Outline /> in <Document />?");const re=Object.assign(Object.assign({},ne),te),{className:ie,inputRef:se,onItemClick:oe,onLoadError:me,onLoadSuccess:he,pdf:fe}=re,ae=__rest$2(re,["className","inputRef","onItemClick","onLoadError","onLoadSuccess","pdf"]);invariant(fe,"Attempted to load an outline, but no document was specified.");const[le,ye]=useResolver(),{value:ve,error:de}=le;function ge(){typeof ve>"u"||ve===!1||he&&he(ve)}function ue(){de&&(de.toString(),me&&me(de))}function Te(){ye({type:"RESET"})}p$1(Te,[ye,fe]);function $e(){if(!fe)return;const be=makeCancellablePromise(fe.getOutline()),we=be;return be.promise.then(_e=>{ye({type:"RESOLVE",value:_e})}).catch(_e=>{ye({type:"REJECT",error:_e})}),()=>cancelRunningTask(we)}p$1($e,[ye,fe]),p$1(()=>{if(ve!==void 0){if(ve===!1){ue();return}ge()}},[ve]);const ke=F$1(()=>({onItemClick:oe}),[oe]),Ce=F$1(()=>makeEventProps(ae,()=>ve),[ae,ve]);if(!ve)return null;function ce(){return ve?Cn.createElement("ul",null,ve.map((be,we)=>Cn.createElement(OutlineItem,{key:typeof be.dest=="string"?be.dest:we,item:be}))):null}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Outline",ie),ref:se},Ce),Cn.createElement(OutlineContext.Provider,{value:ke},ce()))};Outline.propTypes=Object.assign(Object.assign({},eventProps),{className:isClassName,inputRef:isRef,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,pdf:isPdf});const Outline$1=Outline;function mergeRefs(){for(var ee=[],te=0;te<arguments.length;te++)ee[te]=arguments[te];var ne=ee.filter(Boolean);if(ne.length<=1){var re=ne[0];return re||null}return function(se){ne.forEach(function(oe){typeof oe=="function"?oe(se):oe&&(oe.current=se)})}}const PageContext=G$1(null),PDF_ROLE_TO_HTML_ROLE={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(ee){return ee in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(ee){return"children"in ee}function isStructTreeNodeWithOnlyContentChild(ee){return isStructTreeNode(ee)?ee.children.length===1&&0 in ee.children&&"id"in ee.children[0]:!1}function getRoleAttributes(ee){const te={};if(isStructTreeNode(ee)){const{role:ne}=ee,re=ne.match(HEADING_PATTERN);if(re)te.role="heading",te["aria-level"]=Number(re[1]);else if(isPdfRole(ne)){const ie=PDF_ROLE_TO_HTML_ROLE[ne];ie&&(te.role=ie)}}return te}function getBaseAttributes(ee){const te={};if(isStructTreeNode(ee)){if(ee.alt!==void 0&&(te["aria-label"]=ee.alt),ee.lang!==void 0&&(te.lang=ee.lang),isStructTreeNodeWithOnlyContentChild(ee)){const[ne]=ee.children;if(ne){const re=getBaseAttributes(ne);return Object.assign(Object.assign({},te),re)}}}else"id"in ee&&(te["aria-owns"]=ee.id);return te}function getAttributes(ee){return ee?Object.assign(Object.assign({},getRoleAttributes(ee)),getBaseAttributes(ee)):null}function StructTreeItem({className:ee,node:te}){const ne=F$1(()=>getAttributes(te),[te]),re=F$1(()=>!isStructTreeNode(te)||isStructTreeNodeWithOnlyContentChild(te)?null:te.children.map((ie,se)=>Cn.createElement(StructTreeItem,{key:se,node:ie})),[te]);return Cn.createElement("span",Object.assign({className:ee},ne),re)}function usePageContext(){return q$2(PageContext)}function StructTree(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{onGetStructTreeError:te,onGetStructTreeSuccess:ne}=ee,[re,ie]=useResolver(),{value:se,error:oe}=re,{customTextRenderer:me,page:he}=ee;function fe(){se&&ne&&ne(se)}function ae(){oe&&(oe.toString(),te&&te(oe))}function le(){ie({type:"RESET"})}p$1(le,[ie,he]);function ye(){if(me||!he)return;const ve=makeCancellablePromise(he.getStructTree()),de=ve;return ve.promise.then(ge=>{ie({type:"RESOLVE",value:ge})}).catch(ge=>{ie({type:"REJECT",error:ge})}),()=>cancelRunningTask(de)}return p$1(ye,[me,he,ie]),p$1(()=>{if(se!==void 0){if(se===!1){ae();return}fe()}},[se]),se?Cn.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:se}):null}const ANNOTATION_MODE=pdfjs$1.AnnotationMode;function PageCanvas(ee){const te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},te),ee),{_className:re,canvasBackground:ie,devicePixelRatio:se=getDevicePixelRatio(),onRenderError:oe,onRenderSuccess:me,page:he,renderForms:fe,renderTextLayer:ae,rotate:le,scale:ye}=ne,{canvasRef:ve}=ee;invariant(he,"Attempted to render page canvas, but no page was specified.");const de=_(null);function ge(){he&&me&&me(makePageCallback(he,ye))}function ue(ce){isCancelException(ce)||(ce.toString(),oe&&oe(ce))}const Te=F$1(()=>he.getViewport({scale:ye*se,rotation:le}),[se,he,le,ye]),$e=F$1(()=>he.getViewport({scale:ye,rotation:le}),[he,le,ye]);function ke(){if(!he)return;he.cleanup();const{current:ce}=de;if(!ce)return;ce.width=Te.width,ce.height=Te.height,ce.style.width="".concat(Math.floor($e.width),"px"),ce.style.height="".concat(Math.floor($e.height),"px"),ce.style.visibility="hidden";const be={annotationMode:fe?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:ce.getContext("2d",{alpha:!1}),viewport:Te};ie&&(be.background=ie);const we=he.render(be),_e=we;return we.promise.then(()=>{ce.style.visibility="",ge()}).catch(ue),()=>cancelRunningTask(_e)}p$1(ke,[ie,de,se,he,fe,Te,$e]);const Ce=T$1(()=>{const{current:ce}=de;ce&&(ce.width=0,ce.height=0)},[de]);return p$1(()=>Ce,[Ce]),Cn.createElement("canvas",{className:"".concat(re,"__canvas"),dir:"ltr",ref:mergeRefs(ve,de),style:{display:"block",userSelect:"none"}},ae?Cn.createElement(StructTree,null):null)}function PageSVG(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{_className:te,onRenderSuccess:ne,onRenderError:re,page:ie,rotate:se,scale:oe}=ee;invariant(ie,"Attempted to render page SVG, but no page was specified.");const[me,he]=useResolver(),{value:fe,error:ae}=me;function le(){ie&&ne&&ne(makePageCallback(ie,oe))}function ye(){ae&&(isCancelException(ae)||(ae.toString(),re&&re(ae)))}const ve=F$1(()=>ie.getViewport({scale:oe,rotation:se}),[ie,se,oe]);function de(){he({type:"RESET"})}p$1(de,[ie,he,ve]);function ge(){if(!ie)return;const ke=makeCancellablePromise(ie.getOperatorList());return ke.promise.then(Ce=>{new pdfjs$1.SVGGraphics(ie.commonObjs,ie.objs).getSVG(Ce,ve).then(be=>{he({type:"RESOLVE",value:be})}).catch(be=>{he({type:"REJECT",error:be})})}).catch(Ce=>{he({type:"REJECT",error:Ce})}),()=>cancelRunningTask(ke)}p$1(ge,[ie,he,ve]),p$1(()=>{if(fe!==void 0){if(fe===!1){ye();return}le()}},[fe]);function ue(ke){if(!ke||!fe)return;ke.firstElementChild||ke.appendChild(fe);const{width:Ce,height:ce}=ve;fe.setAttribute("width","".concat(Ce)),fe.setAttribute("height","".concat(ce))}const{width:Te,height:$e}=ve;return Cn.createElement("div",{className:"".concat(te,"__svg"),ref:ke=>ue(ke),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:Te,height:$e,userSelect:"none"}})}function isTextItem(ee){return"str"in ee}function TextLayer(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{customTextRenderer:te,onGetTextError:ne,onGetTextSuccess:re,onRenderTextLayerError:ie,onRenderTextLayerSuccess:se,page:oe,pageIndex:me,pageNumber:he,rotate:fe,scale:ae}=ee;invariant(oe,"Attempted to load page text content, but no page was specified.");const[le,ye]=useResolver(),{value:ve,error:de}=le,ge=_(null),ue=_();parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10);function Te(){ve&&re&&re(ve)}function $e(){de&&(de.toString(),ne&&ne(de))}function ke(){ye({type:"RESET"})}p$1(ke,[oe,ye]);function Ce(){if(!oe)return;const Se=makeCancellablePromise(oe.getTextContent()),He=Se;return Se.promise.then(qe=>{ye({type:"RESOLVE",value:qe})}).catch(qe=>{ye({type:"REJECT",error:qe})}),()=>cancelRunningTask(He)}p$1(Ce,[oe,ye]),p$1(()=>{if(ve!==void 0){if(ve===!1){$e();return}Te()}},[ve]);const ce=T$1(()=>{se&&se()},[se]),be=T$1(Se=>{Se.toString(),ie&&ie(Se)},[ie]);function we(){const Se=ue.current;Se&&Se.classList.add("active")}function _e(){const Se=ue.current;Se&&Se.classList.remove("active")}const Ee=F$1(()=>oe.getViewport({scale:ae,rotation:fe}),[oe,fe,ae]);function De(){if(!oe||!ve)return;const{current:Se}=ge;if(!Se)return;Se.innerHTML="";const He=oe.streamTextContent({includeMarkedContent:!0}),qe={container:Se,textContentSource:He,viewport:Ee},Ke=pdfjs$1.renderTextLayer(qe),Je=Ke;return Ke.promise.then(()=>{const et=document.createElement("div");et.className="endOfContent",Se.append(et),ue.current=et;const st=!!Se.querySelector(".markedContent")?Se.querySelectorAll(".markedContent > *:not(.markedContent"):Se.children;if(te){let ct=0;ve.items.forEach((gt,vt)=>{if(!isTextItem(gt))return;const At=st[ct];if(!At)return;const yt=te(Object.assign({pageIndex:me,pageNumber:he,itemIndex:vt},gt));At.innerHTML=yt,ct+=gt.str&>.hasEOL?2:1})}ce()}).catch(be),()=>cancelRunningTask(Je)}return y(De,[te,be,ce,oe,me,he,ve,Ee]),Cn.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:_e,onMouseDown:we,ref:ge})}function AnnotationLayer(){const ee=useDocumentContext();invariant(ee,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},ee),te),{imageResourcesPath:re,linkService:ie,onGetAnnotationsError:se,onGetAnnotationsSuccess:oe,onRenderAnnotationLayerError:me,onRenderAnnotationLayerSuccess:he,page:fe,pdf:ae,renderForms:le,rotate:ye,scale:ve=1}=ne;invariant(fe,"Attempted to load page annotations, but no page was specified.");const[de,ge]=useResolver(),{value:ue,error:Te}=de,$e=_(null);parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10);function ke(){ue&&oe&&oe(ue)}function Ce(){Te&&(Te.toString(),se&&se(Te))}function ce(){ge({type:"RESET"})}p$1(ce,[ge,fe]);function be(){if(!fe)return;const Se=makeCancellablePromise(fe.getAnnotations()),He=Se;return Se.promise.then(qe=>{ge({type:"RESOLVE",value:qe})}).catch(qe=>{ge({type:"REJECT",error:qe})}),()=>{cancelRunningTask(He)}}p$1(be,[ge,fe,le]),p$1(()=>{if(ue!==void 0){if(ue===!1){Ce();return}ke()}},[ue]);function we(){he&&he()}function _e(Se){me&&me(Se)}const Ee=F$1(()=>fe.getViewport({scale:ve,rotation:ye}),[fe,ye,ve]);function De(){if(!ae||!fe||!ue)return;const{current:Se}=$e;if(!Se)return;const He=Ee.clone({dontFlip:!0}),qe={annotations:ue,annotationStorage:ae.annotationStorage,div:Se,downloadManager:null,imageResourcesPath:re,linkService:ie,page:fe,renderForms:le,viewport:He};Se.innerHTML="";try{pdfjs$1.AnnotationLayer.render(qe),we()}catch(Ke){_e(Ke)}return()=>{}}return p$1(De,[ue,re,ie,fe,le,Ee]),Cn.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:$e})}var __rest$1=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const defaultScale=1,Page=function ee(te){const ne=useDocumentContext();invariant(ne,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const re=Object.assign(Object.assign({},ne),te),{_className:ie="react-pdf__Page",_enableRegisterUnregisterPage:se=!0,canvasBackground:oe,canvasRef:me,children:he,className:fe,customRenderer:ae,customTextRenderer:le,devicePixelRatio:ye,error:ve="Failed to load the page.",height:de,inputRef:ge,loading:ue="Loading page…",noData:Te="No page specified.",onGetAnnotationsError:$e,onGetAnnotationsSuccess:ke,onGetStructTreeError:Ce,onGetStructTreeSuccess:ce,onGetTextError:be,onGetTextSuccess:we,onLoadError:_e,onLoadSuccess:Ee,onRenderAnnotationLayerError:De,onRenderAnnotationLayerSuccess:Se,onRenderError:He,onRenderSuccess:qe,onRenderTextLayerError:Ke,onRenderTextLayerSuccess:Je,pageIndex:et,pageNumber:ut,pdf:st,registerPage:ct,renderAnnotationLayer:gt=!0,renderForms:vt=!1,renderMode:At="canvas",renderTextLayer:yt=!0,rotate:ze,scale:xe=defaultScale,unregisterPage:Pe,width:Le}=re,Ve=__rest$1(re,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[We,Xe]=useResolver(),{value:Ne,error:je}=We,Ue=_(null);invariant(st,"Attempted to load a page, but no document was specified.");const pe=isProvided(ut)?ut-1:et!=null?et:null,Ae=ut!=null?ut:isProvided(et)?et+1:null,Re=ze!=null?ze:Ne?Ne.rotate:null,Me=F$1(()=>{if(!Ne)return null;let _t=1;const bt=xe!=null?xe:defaultScale;if(Le||de){const Rt=Ne.getViewport({scale:1,rotation:Re});Le?_t=Le/Rt.width:de&&(_t=de/Rt.height)}return bt*_t},[de,Ne,Re,xe,Le]);function Oe(){return()=>{isProvided(pe)&&se&&Pe&&Pe(pe)}}p$1(Oe,[se,st,pe,Pe]);function Ge(){if(Ee){if(!Ne||!Me)return;Ee(makePageCallback(Ne,Me))}if(se&&ct){if(!isProvided(pe)||!Ue.current)return;ct(pe,Ue.current)}}function rt(){je&&(je.toString(),_e&&_e(je))}function Ze(){Xe({type:"RESET"})}p$1(Ze,[Xe,st,pe]);function ot(){if(!st||!Ae)return;const _t=makeCancellablePromise(st.getPage(Ae)),bt=_t;return _t.promise.then(Rt=>{Xe({type:"RESOLVE",value:Rt})}).catch(Rt=>{Xe({type:"REJECT",error:Rt})}),()=>cancelRunningTask(bt)}p$1(ot,[Xe,st,pe,Ae,ct]),p$1(()=>{if(Ne!==void 0){if(Ne===!1){rt();return}Ge()}},[Ne,Me]);const at=F$1(()=>Ne&&isProvided(pe)&&Ae&&isProvided(Re)&&isProvided(Me)?{_className:ie,canvasBackground:oe,customTextRenderer:le,devicePixelRatio:ye,onGetAnnotationsError:$e,onGetAnnotationsSuccess:ke,onGetStructTreeError:Ce,onGetStructTreeSuccess:ce,onGetTextError:be,onGetTextSuccess:we,onRenderAnnotationLayerError:De,onRenderAnnotationLayerSuccess:Se,onRenderError:He,onRenderSuccess:qe,onRenderTextLayerError:Ke,onRenderTextLayerSuccess:Je,page:Ne,pageIndex:pe,pageNumber:Ae,renderForms:vt,renderTextLayer:yt,rotate:Re,scale:Me}:null,[ie,oe,le,ye,$e,ke,Ce,ce,be,we,De,Se,He,qe,Ke,Je,Ne,pe,Ae,vt,yt,Re,Me]),nt=F$1(()=>makeEventProps(Ve,()=>Ne&&(Me?makePageCallback(Ne,Me):void 0)),[Ve,Ne,Me]),tt="".concat(pe,"@").concat(Me,"/").concat(Re),ht="".concat(pe,"/").concat(Re);function ft(){switch(At){case"custom":return invariant(ae,'renderMode was set to "custom", but no customRenderer was passed.'),Cn.createElement(ae,{key:"".concat(tt,"_custom")});case"none":return null;case"svg":return Cn.createElement(PageSVG,{key:"".concat(ht,"_svg")});case"canvas":default:return Cn.createElement(PageCanvas,{key:"".concat(tt,"_canvas"),canvasRef:me})}}function wt(){return yt?Cn.createElement(TextLayer,{key:"".concat(tt,"_text")}):null}function St(){return gt?Cn.createElement(AnnotationLayer,{key:"".concat(tt,"_annotations")}):null}function Tt(){return Cn.createElement(PageContext.Provider,{value:at},ft(),wt(),St(),he)}function Ye(){return Ae?st===null||Ne===void 0||Ne===null?Cn.createElement(Message,{type:"loading"},typeof ue=="function"?ue():ue):st===!1||Ne===!1?Cn.createElement(Message,{type:"error"},typeof ve=="function"?ve():ve):Tt():Cn.createElement(Message,{type:"no-data"},typeof Te=="function"?Te():Te)}return Cn.createElement("div",Object.assign({className:clsx(ie,fe),"data-page-number":Ae,ref:mergeRefs(ge,Ue),style:{"--scale-factor":"".concat(Me),backgroundColor:oe||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},nt),Ye())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});const Page$1=Page;var __rest=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Thumbnail=function ee(te){const ne=useDocumentContext();invariant(ne,"Unable to find Document context. Did you wrap <Page /> in <Document />?");const re=Object.assign(Object.assign({},ne),te),{className:ie,linkService:se,onItemClick:oe,pageIndex:me,pageNumber:he}=re,fe=isProvided(he)?he-1:me!=null?me:null,ae=he!=null?he:isProvided(me)?me+1:null;function le(ve){ve.preventDefault(),!(!isProvided(fe)||!ae)&&(oe?oe({pageIndex:fe,pageNumber:ae}):se.goToPage(ae))}const ye=__rest(te,["className","onItemClick"]);return Cn.createElement("a",{className:clsx("react-pdf__Thumbnail",ie),href:ae?"#":void 0,onClick:le},Cn.createElement(Page$1,Object.assign({},ye,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))},Thumbnail$1=Thumbnail;displayWorkerWarning(),pdfjs$1.GlobalWorkerOptions.workerSrc="pdf.worker.js";const index=Object.freeze(Object.defineProperty({__proto__:null,Document:Document$1,Outline:Outline$1,Page:Page$1,Thumbnail:Thumbnail$1,pdfjs:pdfjs$1,useDocumentContext,useOutlineContext,usePageContext},Symbol.toStringTag,{value:"Module"}))})();
|
|
9
|
+
*/var e=require$$0;function h(ee,te){return ee===te&&(ee!==0||1/ee===1/te)||ee!==ee&&te!==te}var k=typeof Object.is=="function"?Object.is:h,l$1=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(ee,te){var ne=te(),re=l$1({inst:{value:ne,getSnapshot:te}}),ie=re[0].inst,se=re[1];return n(function(){ie.value=ne,ie.getSnapshot=te,r$2(ie)&&se({inst:ie})},[ee,ne,te]),m(function(){return r$2(ie)&&se({inst:ie}),ee(function(){r$2(ie)&&se({inst:ie})})},[ee]),p(ne),ne}function r$2(ee){var te=ee.getSnapshot;ee=ee.value;try{var ne=te();return!k(ee,ne)}catch{return!0}}function t(ee,te){return te()}var u$1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t:q;useSyncExternalStoreShim_production_min.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u$1,shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;class Util_ElmishState$3{constructor(te,ne,re){this.arg=ne,this.dependencies=re;const ie=te(),se=[];let oe;const he=ProgramModule_init(ie)(this.arg);let ue=he[0],de=he[1];oe=[[ue,ae=>{se.push(ae)},!1,se],de],this.state=oe[0],this.cmd=oe[1],this.subscribe=ae=>{let le=!1;const Ae=isDisposable(this.state[0]);return ProgramModule_runWith(this.arg,ProgramModule_withSetState((_e,me)=>{const ve=this.state;this.state=[_e,me,!0,se],_e!==ve[0]&&ae()},ProgramModule_map((_e,me)=>{const ve=this.cmd;return this.cmd=Cmd_none(),[this.state[0],ve]},(_e,me,ve)=>_e(me)(this.state[0]),uncurry3(_e=>_e),uncurry3(_e=>_e),uncurry2(_e=>_e),_e=>[me=>_e[0](me)?!0:Ae&&le,me=>{const ve=me;isDisposable(ve)?disposeSafe(ve):_e[1](me)}],ie))),()=>{le=!0}}}}function Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne){return new Util_ElmishState$3(ee,te,ne)}function Util_ElmishState$3__get_State(ee){return ee.state}function Util_ElmishState$3__get_Subscribe(ee){return ee.subscribe}function Util_ElmishState$3__IsOutdated_1954DBC6(ee,te,ne){return equals$2(ee.arg,te)?!equals$2(ee.dependencies,ne):!0}function React_useElmish_Z6C327F2E(ee,te,ne){const re=h$1(()=>Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne)),ie=re[0];Util_ElmishState$3__IsOutdated_1954DBC6(ie,te,ne)&&re[1](Util_ElmishState$3_$ctor_Z29FF63CF(ee,te,ne));const se=shimExports.useSyncExternalStore(Util_ElmishState$3__get_Subscribe(ie),()=>Util_ElmishState$3__get_State(ie)),oe=se[2],he=se[3],ue=se[1];return p$1(()=>{if(oe&&he.length>0){let de=getEnumerator(he);try{for(;de["System.Collections.IEnumerator.MoveNext"]();){const ae=de["System.Collections.Generic.IEnumerator`1.get_Current"]();setTimeout(()=>{ue(ae)})}}finally{disposeSafe(de)}clear(he)}},[oe,he]),[se[0],ue]}const useEffectWithDeps=(ee,te)=>{p$1(()=>{const ne=ee();return()=>{ne.Dispose()}},te)},Interop_reactApi=Cn,ReactInterop_useEffectWithDeps=useEffectWithDeps;function React_createDisposable_3A5B6456(ee){return{Dispose(){ee()}}}function useReact_useEffectOnce_3A5B6456(ee){const te=Interop_reactApi.useRef(!1);useReact_useEffect_311B4086(()=>{te.current||(te.current=!0,ee())},[])}function useReact_useEffect_311B4086(ee,te){ReactInterop_useEffectWithDeps(ne=>(ee(),React_createDisposable_3A5B6456(()=>{})),te)}function useReact_useRef_1505(ee){return Interop_reactApi.useRef(ee)}function useFeliz_React__React_useState_Static_1505(ee){return Interop_reactApi.useState(ee)}class Deferred$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function Deferred_inProgress(ee){return ee.tag===1}function notifyCompletion(ee){let te;te=new CustomEvent("step-completion",{bubbles:!0}),ee.dispatchEvent(te)}class AsyncOperationStatus$1 extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Requested","Finished"]}}let Page$2=class extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Main","ReviewPolicy"]}};class State extends Record{constructor(te,ne,re,ie,se,oe,he){super(),this.Page=te,this.ReviewItemList=ne,this.GetInitStateStatus=re,this.PresentPoliciesStatus=ie,this.OpenPolicyStatus=se,this.AcceptPolicyStatus=oe,this.ContinueStatus=he}}class Msg extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["FetchReviewItemList","NavigatePage","PresentPolicies","OpenPolicy","AcceptPolicy","Continue","NotifyCompletion"]}}function StateModule_init(){return[new State(new Page$2(0,[]),empty$3(),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[]),new Deferred$1(0,[])),singleton$2(ee=>{ee(new Msg(0,[new AsyncOperationStatus$1(0,[])]))})]}function StateModule_update(ee,te,ne){let re,ie;if(te.tag===1)return[new State(te.fields[0],ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(0,[]),ne.ContinueStatus),te.fields[0].tag===1?singleton$2(se=>{se(new Msg(3,[te.fields[0].fields[0],new AsyncOperationStatus$1(0,[])]))}):Cmd_none()];if(te.tag===2)return te.fields[1].tag===1?[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,new Deferred$1(1,[]),ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(0,[{PolicyIdentifierList:map$3(se=>se.Policy.Identifier,te.fields[0])}]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(2,[oe[0],oe[1]])})];if(te.tag===3)return te.fields[1].tag===1?[new State(ne.Page,map$3(se=>equals$2(te.fields[0].Policy.Identifier,se.Policy.Identifier)?new PolicyReviewItemDto(se.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(se.Status,new PolicyReviewItemStatusDto(1,[]))):se,ne.ReviewItemList),ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_none()]:[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,new Deferred$1(1,[]),ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(1,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(3,[oe[0],oe[1]])})];if(te.tag===4)if(te.fields[1].tag===1){const se=map$3(oe=>equals$2(te.fields[0].Policy.Identifier,oe.Policy.Identifier)?new PolicyReviewItemDto(oe.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(oe.Status,new PolicyReviewItemStatusDto(2,[]))):oe,ne.ReviewItemList);return[new State((re=ne.Page,re.tag===1?(ie=re.fields[0],new Page$2(1,[new PolicyReviewItemDto(ie.Policy,PolicyReviewItemStatusDto__ToNextStatus_468E0CC(ie.Status,new PolicyReviewItemStatusDto(2,[])))])):new Page$2(0,[])),se,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]]),ne.ContinueStatus),te.fields[1].fields[0].tag===0?Cmd_ofEffect(oe=>{startImmediate(singleton.Delay(()=>singleton.Bind(sleep(1e3),()=>(oe(new Msg(1,[new Page$2(0,[])])),singleton.Zero()))))}):Cmd_none()]}else return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,new Deferred$1(1,[]),ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},se=>BackendService__SendCommand_Z3B2D738(ee,se),new CommandTypeDto(2,[te.fields[0].Policy.Identifier]),se=>{const oe=[te.fields[0],new AsyncOperationStatus$1(1,[se])];return new Msg(4,[oe[0],oe[1]])})];else if(te.tag===5){if(te.fields[1].tag===1)return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(2,[te.fields[1].fields[0]])),singleton$2(se=>{se(new Msg(6,[]))})];switch(ne.ContinueStatus.tag){case 0:case 2:case 3:return[new State(ne.Page,ne.ReviewItemList,ne.GetInitStateStatus,ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,new Deferred$1(1,[])),Cmd_OfAsyncWith_perform(oe=>{Cmd_OfAsync_start(oe)},oe=>BackendService__SendCommand_Z3B2D738(ee,oe),new CommandTypeDto(3,[{PolicyIdentifierList:map$3(oe=>oe.Policy.Identifier,te.fields[0])}]),oe=>{const he=[te.fields[0],new AsyncOperationStatus$1(1,[oe])];return new Msg(5,[he[0],he[1]])})];default:return[ne,Cmd_none()]}}else{if(te.tag===6)return notifyCompletion(document.querySelector("apollo-workplace-policies-app")),[ne,Cmd_none()];if(te.fields[0].tag===1){let se,oe;switch(te.fields[0].fields[0].tag===1||te.fields[0].fields[0].fields[0].tag===1?oe=1:oe=0,oe){case 0:{const ue=te.fields[0].fields[0].fields[0].fields[0];se=[ue.PolicyReviewList,singleton$2(de=>{de(new Msg(2,[ue.PolicyReviewList,new AsyncOperationStatus$1(0,[])]))})];break}case 1:{se=[void 0,Cmd_none()];break}}const he=se[0];return[new State(ne.Page,he==null?ne.ReviewItemList:he,new Deferred$1(2,[te.fields[0].fields[0]]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),se[1]]}else return[new State(ne.Page,ne.ReviewItemList,new Deferred$1(1,[]),ne.PresentPoliciesStatus,ne.OpenPolicyStatus,ne.AcceptPolicyStatus,ne.ContinueStatus),Cmd_OfAsyncWith_perform(se=>{Cmd_OfAsync_start(se)},()=>BackendService__GetInitState(ee),void 0,se=>new Msg(0,[new AsyncOperationStatus$1(1,[se])]))]}}const scriptRel="modulepreload",assetsURL=function(ee){return"https://npm-cdn.flarehr.com/@flarehr/apollo-workplace-policies/dist/"+ee},seen={},__vitePreload=function(te,ne,re){return te()},TextLayer$1=':root{--react-pdf-text-layer: 1;--highlight-bg-color: rgba(180, 0, 170, 1);--highlight-selected-bg-color: rgba(0, 100, 0, 1)}@media screen and (forced-colors: active){:root{--highlight-bg-color: Highlight;--highlight-selected-bg-color: ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}.textLayer{position:absolute;text-align:initial;top:0;right:0;bottom:0;left:0;overflow:hidden;line-height:1;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2}.textLayer :is(span,br){color:transparent;position:absolute;white-space:pre;cursor:text;margin:0;transform-origin:0 0}.textLayer span.markedContent{top:0;height:0}.textLayer .highlight{margin:-1px;padding:1px;background-color:var(--highlight-bg-color);border-radius:4px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::-moz-selection{background:transparent}.textLayer br::selection{background:transparent}.textLayer .endOfContent{display:block;position:absolute;top:100%;right:0;bottom:0;left:0;z-index:-1;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.textLayer .endOfContent.active{top:0}\n',AnnotationLayer$1=":root{--react-pdf-annotation-layer: 1;--annotation-unfocused-field-background: url(\"data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>\");--input-focus-border-color: Highlight;--input-focus-outline: 1px solid Canvas;--input-unfocused-border-color: transparent;--input-disabled-border-color: transparent;--input-hover-border-color: black;--link-outline: none}@media screen and (forced-colors: active){:root{--input-focus-border-color: CanvasText;--input-unfocused-border-color: ActiveText;--input-disabled-border-color: GrayText;--input-hover-border-color: Highlight;--link-outline: 1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selectedItem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert(100%);backdrop-filter:invert(100%)}}.annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0;z-index:3}.annotationLayer[data-main-rotation=\"90\"] .norotate{transform:rotate(270deg) translate(-100%)}.annotationLayer[data-main-rotation=\"180\"] .norotate{transform:rotate(180deg) translate(-100%,-100%)}.annotationLayer[data-main-rotation=\"270\"] .norotate{transform:rotate(90deg) translateY(-100%)}.annotationLayer canvas{position:absolute;width:100%;height:100%}.annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;margin:0;transform-origin:0 0}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:rgba(255,255,0,1);box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{background:none;border:2px solid var(--input-disabled-border-color);cursor:not-allowed}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-image:none;background-color:transparent}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);border-radius:2px;outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:\"\";display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}.annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{-webkit-appearance:none;-moz-appearance:none;appearance:none}.annotationLayer .popupTriggerArea{height:100%;width:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}.annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}.annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}.annotationLayer .popupContent{border-top:1px solid rgba(51,51,51,1);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{position:absolute;width:100%;height:100%;top:0;left:0}.annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}\n",reactPdf=__vitePreload(()=>Promise.resolve().then(()=>index),void 0);function startImport(ee,te){startImmediate(singleton.Delay(()=>singleton.TryWith(singleton.Delay(()=>singleton.Bind(awaitPromise(reactPdf),ne=>{const re=ne;return re.pdfjs.GlobalWorkerOptions.workerSrc=new URL("https://npm-cdn.flarehr.com/@flarehr/apollo-workplace-policies/dist/assets/pdf.worker.min-feabdf30.js",self.location).toString(),ee(re),singleton.Zero()})),ne=>(te(),singleton.Zero()))))}const PdfCss_textLayer=(()=>toString$4(TextLayer$1))(),PdfCss_annotationLayer=(()=>toString$4(AnnotationLayer$1))(),PdfCss_all=PdfCss_textLayer+PdfCss_annotationLayer;class Document_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["File","OnLoadSuccess","ClassName","OnItemClick","Children"]}}function Document_Component(ee,te){return Interop_reactApi.createElement(ee.Document,keyValueList(te,1))}class Page_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["PageNumber","Width"]}}function Page_Component(ee,te){return Interop_reactApi.createElement(ee.Page,keyValueList(te,1))}class Thumbnail_Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Key","PageNumber","Width"]}}function Thumbnail_Component(ee,te){return Interop_reactApi.createElement(ee.Thumbnail,keyValueList(te,1))}const index$1='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.invisible{visibility:hidden}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.top-0{top:0}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.inline{display:inline}.flex{display:flex}.h-10{height:2.5rem}.h-20{height:5rem}.h-full{height:100%}.w-20{width:5rem}.w-\\[4\\.75rem\\]{width:4.75rem}.w-full{width:100%}.max-w-\\[560px\\]{max-width:560px}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-progress{cursor:progress}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.border{border-width:1px}.border-4{border-width:4px}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-primary-base{border-color:var(--fl-color-primary)}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-primary-base{background-color:var(--fl-color-primary)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-1{padding:.25rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-bottom{vertical-align:bottom}.font-inter{font-family:Inter,sans-serif}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-7{line-height:1.75rem}.leading-8{line-height:2rem}.leading-tight{line-height:1.25}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-primary-base{color:var(--fl-color-primary)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline-offset-2{text-underline-offset:2px}.opacity-\\[0\\.07\\]{opacity:.07}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity))}.ring-gray-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity))}.ring-primary-base{--tw-ring-color: var(--fl-color-primary)}.ring-opacity-5{--tw-ring-opacity: .05}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\\:text-primary-base:hover{color:var(--fl-color-primary)}.hover\\:underline:hover{-webkit-text-decoration-line:underline;text-decoration-line:underline}.hover\\:ring-2:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\\:ring-primary-base:hover{--tw-ring-color: var(--fl-color-primary)}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-2:focus-visible{outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-primary-base:focus-visible{outline-color:var(--fl-color-primary)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:cursor-progress:disabled{cursor:progress}.disabled\\:border:disabled{border-width:1px}.disabled\\:border-gray-300:disabled{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\\:mr-2{margin-right:.5rem}.sm\\:mr-2\\.5{margin-right:.625rem}.sm\\:mt-0{margin-top:0}.sm\\:mt-10{margin-top:2.5rem}.sm\\:mt-6{margin-top:1.5rem}.sm\\:mt-\\[1px\\]{margin-top:1px}.sm\\:w-\\[12\\.5rem\\]{width:12.5rem}.sm\\:w-\\[35rem\\]{width:35rem}.sm\\:max-w-\\[57rem\\]{max-width:57rem}.sm\\:flex-row{flex-direction:row}.sm\\:p-5{padding:1.25rem}.sm\\:p-6{padding:1.5rem}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:py-16{padding-top:4rem;padding-bottom:4rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\\:py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.sm\\:py-20{padding-top:5rem;padding-bottom:5rem}.sm\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\\:text-base{font-size:1rem;line-height:1.5rem}.sm\\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\\:leading-6{line-height:1.5rem}.sm\\:leading-7{line-height:1.75rem}.sm\\:leading-8{line-height:2rem}.sm\\:leading-9{line-height:2.25rem}}@media (min-width: 768px){.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:py-4{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.lg\\:visible{visibility:visible}}\n',css=(()=>toString$4(index$1))(),SvgCheck=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{clipPath:"url(#clip0_3040_23717)"},y$1("path",{d:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24Z",fill:"currentColor"}),y$1("path",{d:"M6 12L10 16L18 8",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),y$1("defs",null,y$1("clipPath",{id:"clip0_3040_23717"},y$1("rect",{width:24,height:24,fill:"white"})))),SvgChevronLeft=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgChevronRight=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M9 6L15 12L9 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgDownload=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 16L4 17C4 18.6569 5.34315 20 7 20L17 20C18.6569 20 20 18.6569 20 17L20 16M16 12L12 16M12 16L8 12M12 16L12 4",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgFileNoAccess=ee=>y$1("svg",{width:33,height:32,viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"file-no-access 1"},y$1("g",{id:"Group"},y$1("path",{id:"Vector",d:"M29.5 1H3.5V31H29.5V1Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_2",d:"M11.5566 20.944L21.4406 11.06",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y$1("path",{id:"Vector_3",d:"M16.5 23C20.366 23 23.5 19.866 23.5 16C23.5 12.134 20.366 9 16.5 9C12.634 9 9.5 12.134 9.5 16C9.5 19.866 12.634 23 16.5 23Z",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))),SvgFolderXmark=ee=>y$1("svg",{width:32,height:28,viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M28 4C30.1875 4 32 5.8125 32 8V24C32 26.25 30.1875 28 28 28H4C1.75 28 0 26.25 0 24V4C0 1.8125 1.75 0 4 0H11.3125C12.375 0 13.375 0.4375 14.125 1.1875L17 4H28ZM30 24V8C30 6.9375 29.0625 6 28 6H16.125L12.75 2.625C12.375 2.25 11.875 2 11.3125 2H4C2.875 2 2 2.9375 2 4V24C2 25.125 2.875 26 4 26H28C29.0625 26 30 25.125 30 24ZM20.6875 11.3125C21.0625 11.6875 21.0625 12.375 20.6875 12.75L17.375 16L20.6875 19.3125C21.0625 19.6875 21.0625 20.375 20.6875 20.75C20.3125 21.125 19.625 21.125 19.25 20.75L16 17.4375L12.6875 20.75C12.3125 21.125 11.625 21.125 11.25 20.75C10.875 20.375 10.875 19.6875 11.25 19.3125L14.5625 16L11.25 12.75C10.875 12.375 10.875 11.6875 11.25 11.3125C11.625 10.9375 12.3125 10.9375 12.6875 11.3125L16 14.625L19.25 11.3125C19.625 10.9375 20.3125 10.9375 20.6875 11.3125Z",fill:"currentColor"})),SvgLaunch=ee=>y$1("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5 4H15.5C15.6326 4 15.7597 4.05268 15.8535 4.14645C15.9473 4.24022 16 4.36739 16 4.5V9.5C15.9999 9.59894 15.9706 9.69565 15.9156 9.77789C15.8606 9.86013 15.7824 9.92421 15.691 9.962C15.6303 9.98677 15.5655 9.99967 15.5 10C15.4343 10.0001 15.3692 9.98729 15.3084 9.96223C15.2477 9.93718 15.1925 9.9004 15.146 9.854L13.354 8.061L10.707 10.707C10.6147 10.8025 10.5044 10.8787 10.3824 10.9311C10.2604 10.9835 10.1291 11.0111 9.99636 11.0123C9.86358 11.0134 9.7319 10.9881 9.609 10.9378C9.48611 10.8875 9.37446 10.8133 9.28056 10.7194C9.18667 10.6255 9.11242 10.5139 9.06214 10.391C9.01186 10.2681 8.98655 10.1364 8.98771 10.0036C8.98886 9.87082 9.01645 9.7396 9.06886 9.6176C9.12127 9.49559 9.19745 9.38525 9.29296 9.293L11.939 6.646L10.146 4.854C10.0759 4.78407 10.0281 4.6949 10.0087 4.59779C9.98935 4.50068 9.99926 4.40001 10.0372 4.30854C10.0751 4.21706 10.1393 4.13891 10.2217 4.08398C10.3041 4.02905 10.4009 3.99982 10.5 4ZM12 16H6C5.46957 16 4.96086 15.7893 4.58579 15.4142C4.21071 15.0391 4 14.5304 4 14V8C4 7.46957 4.21071 6.96086 4.58579 6.58579C4.96086 6.21071 5.46957 6 6 6H7C7.26522 6 7.51957 6.10536 7.70711 6.29289C7.89464 6.48043 8 6.73478 8 7C8 7.26522 7.89464 7.51957 7.70711 7.70711C7.51957 7.89464 7.26522 8 7 8H6V14H12V13C12 12.7348 12.1054 12.4804 12.2929 12.2929C12.4804 12.1054 12.7348 12 13 12C13.2652 12 13.5196 12.1054 13.7071 12.2929C13.8946 12.4804 14 12.7348 14 13V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16Z",fill:"currentColor"})),SvgLoader=ee=>y$1("svg",{width:21,height:20,viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("g",{id:"Loader Mini"},y$1("path",{id:"Ellipse 2",d:"M18.5 10C18.5 14.4183 14.9183 18 10.5 18C6.08172 18 2.5 14.4183 2.5 10C2.5 5.58172 6.08172 2 10.5 2C14.9183 2 18.5 5.58172 18.5 10ZM4.49743 10C4.49743 13.3151 7.18487 16.0026 10.5 16.0026C13.8151 16.0026 16.5026 13.3151 16.5026 10C16.5026 6.68487 13.8151 3.99743 10.5 3.99743C7.18487 3.99743 4.49743 6.68487 4.49743 10Z",fill:"white",fillOpacity:.3}),y$1("path",{id:"Ellipse 2_2",d:"M10.5 3C10.5 2.44772 10.9494 1.99356 11.4974 2.06242C12.2053 2.15137 12.8996 2.3348 13.5615 2.60896C14.5321 3.011 15.414 3.60028 16.1569 4.34315C16.8997 5.08602 17.489 5.96793 17.891 6.93853C18.1652 7.60043 18.3486 8.29473 18.4376 9.0026C18.5064 9.55057 18.0523 10 17.5 10C16.9477 10 16.5085 9.54925 16.4169 9.00462C16.342 8.55939 16.2169 8.12298 16.0433 7.7039C15.7417 6.97595 15.2998 6.31451 14.7426 5.75736C14.1855 5.20021 13.5241 4.75825 12.7961 4.45672C12.377 4.28313 11.9406 4.15804 11.4954 4.08314C10.9508 3.99152 10.5 3.55228 10.5 3Z",fill:"white"}))),SvgMenu=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M4 6H20M4 12H20M4 18H20",stroke:"#9CA3AF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgMinus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M18 12H6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),SvgPlus=ee=>y$1("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...ee},y$1("path",{d:"M12 6V12M12 12V18M12 12H18M12 12L6 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));class Prop extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Height","Width","ClassName"]}}function importSvg(ee,te){return Interop_reactApi.createElement(ee,keyValueList(te,1))}function check(ee){return importSvg(SvgCheck,ee)}function chevronLeft(ee){return importSvg(SvgChevronLeft,ee)}function chevronRight(ee){return importSvg(SvgChevronRight,ee)}function download(ee){return importSvg(SvgDownload,ee)}function fileNoAccess(ee){return importSvg(SvgFileNoAccess,ee)}function folderXmark(ee){return importSvg(SvgFolderXmark,ee)}function launch(ee){return importSvg(SvgLaunch,ee)}function loader(ee){return importSvg(SvgLoader,ee)}function menu(ee){return importSvg(SvgMenu,ee)}function minus(ee){return importSvg(SvgMinus,ee)}function plus(ee){return importSvg(SvgPlus,ee)}function getKey(ee){return ee.PolicyType.tag===1?"".concat(ee.PolicyId,"-C"):"".concat(ee.PolicyId,"-I")}function Component$5(ee){let te,ne,re;const ie=ee.item,se=ee.dispatch,oe=useFeliz_React__React_useState_Static_1505(!1),he=oe[1],ue=equals$2(ie.Status,new PolicyReviewItemStatusDto(2,[]));return y$1("div",createObj(ofArray$2([["key",getKey(ie.Policy.Identifier)],["onMouseEnter",de=>{he(!0)}],["onMouseLeave",de=>{he(!1)}],["onClick",de=>{se(new Msg(1,[new Page$2(1,[ie])]))}],["className",join(" ",toList(delay(()=>append(singleton$1("py-6 px-4 sm:px-6 shadow-sm rounded-lg text-left cursor-pointer"),delay(()=>singleton$1(ue?"ring-2 ring-primary-base":"ring-1 ring-gray-300 hover:ring-2 hover:ring-primary-base"))))))],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between"],(ne=[y$1("div",{className:"text-base leading-6 font-semibold text-gray-900 mr-4",children:ie.Policy.Title}),y$1("div",createObj(ofArray$2([["className",join(" ",toList(delay(()=>append(singleton$1("ml-2"),delay(()=>singleton$1(ue?"text-primary-base":"text-gray-400"))))))],(re=toList(delay(()=>singleton$1(ue?check(empty$3()):chevronRight(singleton$2(new Prop(2,[oe[0]?"text-primary-base":""])))))),["children",Interop_reactApi.Children.toArray(Array.from(re))])])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",{className:"text-sm leading-5 font-normal text-gray-500 mt-2",children:ie.Policy.Description}),y$1("div",{className:"text-sm leading-5 font-medium mt-3 text-primary-base hover:underline underline-offset-2",children:"View document (PDF)"})],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function canContinue(ee){return forAll(te=>equals$2(te.Status,new PolicyReviewItemStatusDto(2,[])),ee)}function title(ee){return y$1("div",{className:"text-gray-900 text-2xl sm:text-3xl leading-8 sm:leading-9 font-bold",children:ee})}function container(ee){let te;return y$1("div",createObj(ofArray$2([["className","w-full sm:w-[35rem] text-center bg-white mx-auto px-1 py-5 sm:py-16"],(te=toList(delay(()=>ee)),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function noPoliciesConfigured(ee){let te,ne;return container([y$1("div",createObj(ofArray$2([["className","mb-4 mx-auto w-20 h-20 p-6 relative"],(te=[y$1("div",{className:"absolute top-0 left-0 w-full h-full bg-primary-base opacity-[0.07] rounded-full"}),folderXmark(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])]))),title("No statements available"),y$1("div",{className:"text-center text-gray-600 text-lg font-normal leading-7 sm:leading-8 mt-4",children:"It looks like there are no statements for you to review from your employer at this time."}),y$1("button",createObj(ofArray$2([["type","button"],(ne="mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base",["className",ne]),["onClick",re=>{ee(new Msg(6,[]))}],["children","Continue"]])))])}function Component$4(ee,te,ne){let re,ie,se;return container([title("Employment information statements"),y$1("div",createObj(ofArray$2([["className","text-gray-600 text-base sm:text-lg font-normal leading-7 sm:leading-8 mt-4"],(re="Please review and accept the below information statement. They outline your entitlements and protections as an employee in Australia.",["children",re])]))),y$1("div",createObj(ofArray$2([["className","space-y-4 mt-8 sm:mt-10"],(ie=toList(delay(()=>map$3(oe=>y$1(Component$5,{dispatch:ne,item:oe}),ee))),["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","text-gray-900 text-sm font-normal leading-5 mt-4 sm:mt-6 text-left"],(se="As a new employee, your employer is required to give you a copy of the Fair Work Information Statements provided by the Fair Work Ombudsman, before, or as soon as possible after, you start your new job.",["children",se])]))),y$1("button",createObj(toList(delay(()=>{const oe=te.tag===1?!0:!canContinue(ee);return append(singleton$1(["disabled",oe]),delay(()=>append(singleton$1(["type","button"]),delay(()=>append(singleton$1(["className",join(" ",toList(delay(()=>append(singleton$1("mt-8 sm:mt-10 mx-auto shadow-sm w-full sm:w-[12.5rem] h-10 px-4 py-2\n rounded-md flex justify-center items-center text-white text-base\n font-semibold leading-6 cursor-pointer bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base"),delay(()=>append(Deferred_inProgress(te)?singleton$1("cursor-progress"):empty$2(),delay(()=>!Deferred_inProgress(te)&&oe?singleton$1("disabled:text-gray-400 disabled:cursor-not-allowed\n disabled:border disabled:border-gray-300 disabled:bg-gray-100"):empty$2())))))))]),delay(()=>append(singleton$1(["onClick",he=>{ne(new Msg(5,[ee,new AsyncOperationStatus$1(0,[])]))}]),delay(()=>{let he;return singleton$1((he=toList(delay(()=>te.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Continue"))),["children",Interop_reactApi.Children.toArray(Array.from(he))]))}))))))))}))))])}function Component$3(ee){let te,ne,re,ie;return y$1("div",createObj(ofArray$2([(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100 py-10 px-4 sm:py-20",["className",te]),(ne=[fileNoAccess(empty$3()),y$1("h1",{className:"mt-4 text-gray-900 text-base leading-6 font-semibold",children:"Unable to load PDF"}),y$1("p",createObj(ofArray$2([["className","mt-2 text-gray-700 text-sm leading-5 font-normal max-w-[560px] text-center"],(re="It looks like we’re unable to load the PDF at this time. Download the document below to view the statement.",["children",re])]))),y$1("a",createObj(ofArray$2([(ie="mt-4 text-primary-base text-sm leading-5 font-medium cursor-pointer hover:underline underline-offset-2",["className",ie]),["href",PathDto__get_Value(ee.Path)],["download",ee.Name],["target","_blank"],["children","Download document (PDF)"]])))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$2(ee){let te,ne,re,ie,se,oe,he,ue;const de=ee.file,ae=ee.reactPdf,le=useFeliz_React__React_useState_Static_1505(!1),Ae=useFeliz_React__React_useState_Static_1505(!1),_e=Ae[0],me=Ae[1],ve=useFeliz_React__React_useState_Static_1505(1),Se=ve[0]|0,Te=useFeliz_React__React_useState_Static_1505(1),Pe=Te[1],Re=Te[0]|0,$e=useReact_useRef_1505(void 0);return y$1("div",createObj(ofArray$2([["ref",$e],(te="flex flex-col justify-center items-center w-full shadow rounded-lg ring-1 ring-black ring-opacity-5 bg-gray-100",["className",te]),(ne=[y$1("style",{children:[PdfCss_all]}),y$1("div",createObj(ofArray$2([["className","flex justify-between items-center py-4 px-4 md:py-3 w-full shadow-sm bg-white rounded-t-lg"],(re=[y$1("button",createObj(ofArray$2([["className","invisible lg:visible p-1 rounded-full hover:bg-gray-100"],["type","button"],["onClick",ye=>{me(!_e)}],["title","Menu"],(ie=[menu(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ie))])]))),y$1("div",createObj(ofArray$2([["className","flex items-center"],(se=[y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",Re<=1],["onClick",ye=>{Pe(Re-1)}],["title","Previous page"],(oe=[chevronLeft(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(oe))])]))),y$1("div",{className:"text-gray-900 text-sm font-normal leading-tight mx-4",children:"Page ".concat(Re," / ").concat(Se)}),y$1("button",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["type","button"],["disabled",Re>=Se],["onClick",ye=>{Pe(Re+1)}],["title","Next page"],(he=[chevronRight(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(he))])])))],["children",Interop_reactApi.Children.toArray(Array.from(se))])]))),y$1("a",createObj(ofArray$2([["className","p-1 rounded-full hover:bg-gray-100"],["href",PathDto__get_Value(de.Path)],["download",de.Name],["title","Download"],["target","_blank"],(ue=[download(singleton$2(new Prop(2,["text-gray-400"])))],["children",Interop_reactApi.Children.toArray(Array.from(ue))])])))],["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),Document_Component(ae,ofArray$2([new Document_Prop(0,[PathDto__get_Value(de.Path)]),new Document_Prop(1,[ye=>{le[0]||(le[1](!0),ve[1](ye.numPages),me(value($e.current).clientWidth>=1024))}]),new Document_Prop(3,[ye=>{Pe(ye.pageNumber)}]),new Document_Prop(2,["flex py-2 md:py-4"]),new Document_Prop(4,[[y$1("div",createObj(toList(delay(()=>_e?append(singleton$1(["className","flex flex-col space-y-4 p-4"]),delay(()=>{let ye;return singleton$1((ye=toList(delay(()=>map$2(Ee=>{const Ne=ofArray$2([y$1("div",createObj(toList(delay(()=>append(Re===Ee?singleton$1(["className","border-4 border-primary-base rounded"]):empty$2(),delay(()=>{let Me;return singleton$1((Me=[Thumbnail_Component(ae,ofArray$2([new Thumbnail_Prop(0,["thumbnail-".concat(Ee)]),new Thumbnail_Prop(1,[Ee]),new Thumbnail_Prop(2,[100])]))],["children",Interop_reactApi.Children.toArray(Array.from(Me))]))})))))),y$1("div",{className:"mt-1 text-center text-xs text-gray-600",children:Ee})]);return y$1("div",{children:Interop_reactApi.Children.toArray(Array.from(Ne))})},rangeDouble(1,1,Se)))),["children",Interop_reactApi.Children.toArray(Array.from(ye))]))})):empty$2())))),Page_Component(ae,toList(delay(()=>append(singleton$1(new Page_Prop(0,[Re])),delay(()=>$e.current!=null?singleton$1(new Page_Prop(1,[min(comparePrimitives,value($e.current).clientWidth-32,768)])):empty$2())))))]])]))],["children",Interop_reactApi.Children.toArray(Array.from(ne))])])))}function Component$1(ee){let te,ne,re,ie;const se=ee.dispatch,oe=ee.reactPdf,he=ee.acceptPolicyStatus,ue=ee.policyReviewItem,de=useFeliz_React__React_useState_Static_1505(!1),ae=de[0],le=de[1];return y$1("div",createObj(ofArray$2([["className","w-full p-1 sm:p-5"],(te=[y$1("div",createObj(ofArray$2([["className","flex justify-between items-center"],(ne=toList(delay(()=>{let Ae;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-start cursor-pointer text-gray-900 hover:text-primary-base"],["disabled",Deferred_inProgress(he)],["onClick",_e=>{se(new Msg(1,[new Page$2(0,[])]))}],(Ae=[chevronLeft(singleton$2(new Prop(2,["sm:mt-[1px]"]))),y$1("div",{className:"ml-1 mr-4 text-base sm:text-lg leading-6 sm:leading-7 font-semibold text-gray-900",children:ue.Policy.Title})],["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))),delay(()=>{let _e,me,ve;return ue.Status.tag===2?singleton$1(y$1("div",createObj(ofArray$2([["className","flex items-center flex-col-reverse sm:flex-row"],(_e=[y$1("span",{className:"mt-1 sm:mt-0 sm:mr-2.5 sm:py-2.5 text-sm leading-5 font-medium text-gray-500",children:"Accepted"}),check(singleton$2(new Prop(2,["text-primary-base"])))],["children",Interop_reactApi.Children.toArray(Array.from(_e))])])))):singleton$1(y$1("button",createObj(ofArray$2([["type","button"],["disabled",Deferred_inProgress(he)],(me="\n shadow-sm w-[4.75rem] h-10 px-3 py-2 rounded-md flex justify-center items-center text-white\n text-sm font-semibold leading-5 cursor-pointer disabled:cursor-progress bg-primary-base\n focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-base\n ",["className",me]),["onClick",Se=>{se(new Msg(4,[ue,new AsyncOperationStatus$1(0,[])]))}],(ve=toList(delay(()=>he.tag===1?singleton$1(loader(singleton$2(new Prop(2,["animate-spin"])))):singleton$1("Accept"))),["children",Interop_reactApi.Children.toArray(Array.from(ve))])]))))}))})),["children",Interop_reactApi.Children.toArray(Array.from(ne))])]))),y$1("div",createObj(ofArray$2([["className","mt-4 sm:mt-6 mb-6"],(re=toList(delay(()=>oe==null?singleton$1(y$1(Component$3,ue.Policy.File)):singleton$1(y$1(Component$2,{reactPdf:oe,file:ue.Policy.File})))),["children",Interop_reactApi.Children.toArray(Array.from(re))])]))),y$1("div",createObj(ofArray$2([["className","p-4 sm:p-6 rounded-lg shadow-sm border border-gray-300"],(ie=toList(delay(()=>{let Ae;return append(singleton$1(y$1("div",createObj(ofArray$2([["className","flex justify-between cursor-pointer text-gray-400 hover:text-primary-base"],["onClick",_e=>{le(!ae)}],(Ae=toList(delay(()=>append(singleton$1(y$1("div",{className:"text-sm mr-4 sm:text-base leading-5 sm:leading-6 font-semibold text-gray-900",children:"About the ".concat(ue.Policy.Title)})),delay(()=>singleton$1(ae?minus(empty$3()):plus(empty$3())))))),["children",Interop_reactApi.Children.toArray(Array.from(Ae))])])))),delay(()=>{let _e,me,ve;return ae?singleton$1(y$1("div",createObj(ofArray$2([["className","mt-2 space-y-3 sm:max-w-[57rem]"],["onClick",Se=>{le(!ae)}],(_e=[y$1("div",{className:"text-sm font-normal leading-6 text-gray-900",children:ue.Policy.About.Copy}),y$1("a",createObj(ofArray$2([(me="text-sm font-medium leading-5 text-primary-base cursor-pointer hover:underline underline-offset-2 break-all",["className",me]),["target","_blank"],["rel","noopener"],["href",ue.Policy.About.Link],(ve=[ue.Policy.About.Link,launch(singleton$2(new Prop(2,["inline align-bottom"])))],["children",Interop_reactApi.Children.toArray(Array.from(ve))])])))],["children",Interop_reactApi.Children.toArray(Array.from(_e))])])))):empty$2()}))})),["children",Interop_reactApi.Children.toArray(Array.from(ie))])])))],["children",Interop_reactApi.Children.toArray(Array.from(te))])])))}function r$1(){return(r$1=Object.assign||function(ee){for(var te=1;te<arguments.length;te++){var ne=arguments[te];for(var re in ne)Object.prototype.hasOwnProperty.call(ne,re)&&(ee[re]=ne[re])}return ee}).apply(this,arguments)}function i(ee){this.getChildContext=function(){return ee.context};var te=ee.children,ne=function(re,ie){if(re==null)return{};var se,oe,he={},ue=Object.keys(re);for(oe=0;oe<ue.length;oe++)ie.indexOf(se=ue[oe])>=0||(he[se]=re[se]);return he}(ee,["context","children"]);return F$2(te,ne)}function a(){var ee=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(ee),this._vdom=y$1(i,r$1({},this._props,{context:ee.detail.context}),function te(ne,re){if(ne.nodeType===3)return ne.data;if(ne.nodeType!==1)return null;var ie=[],se={},oe=0,he=ne.attributes,ue=ne.childNodes;for(oe=he.length;oe--;)he[oe].name!=="slot"&&(se[he[oe].name]=he[oe].value,se[s(he[oe].name)]=he[oe].value);for(oe=ue.length;oe--;){var de=te(ue[oe],null),ae=ue[oe].slot;ae?se[ae]=y$1(u,{name:ae},de):ie[oe]=de}var le=re?y$1(u,null,ie):ie;return y$1(re||ne.nodeName.toLowerCase(),se,le)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?E$1:D$1)(this._vdom,this._root)}function s(ee){return ee.replace(/-(\w)/g,function(te,ne){return ne?ne.toUpperCase():""})}function c(ee,te,ne){if(this._vdom){var re={};re[ee]=ne=ne==null?void 0:ne,re[s(ee)]=ne,this._vdom=F$2(this._vdom,re),D$1(this._vdom,this._root)}}function l(){D$1(this._vdom=null,this._root)}function u(ee,te){var ne=this;return y$1("slot",r$1({},ee,{ref:function(re){re?(ne.ref=re,ne._listener||(ne._listener=function(ie){ie.stopPropagation(),ie.detail.context=te},re.addEventListener("_preact",ne._listener))):ne.ref.removeEventListener("_preact",ne._listener)}}))}function preact_custom_element(ee,te,ne,re){function ie(){var se=Reflect.construct(HTMLElement,[],ie);return se._vdomComponent=ee,se._root=re&&re.shadow?se.attachShadow({mode:"open"}):se,se}return(ie.prototype=Object.create(HTMLElement.prototype)).constructor=ie,ie.prototype.connectedCallback=a,ie.prototype.attributeChangedCallback=c,ie.prototype.disconnectedCallback=l,ne=ne||ee.observedAttributes||Object.keys(ee.propTypes||{}),ie.observedAttributes=ne,ne.forEach(function(se){Object.defineProperty(ie.prototype,se,{get:function(){return this._vdom.props[se]},set:function(oe){this._vdom?this.attributeChangedCallback(se,null,oe):(this._props||(this._props={}),this._props[se]=oe,this.connectedCallback());var he=typeof oe;oe!=null&&he!=="string"&&he!=="boolean"&&he!=="number"||this.setAttribute(se,oe)}})}),customElements.define(te||ee.tagName||ee.displayName||ee.name,ie)}function register(ee,te){preact_custom_element(ee,te,void 0,{shadow:!0})}class PdfModuleStatus extends Union{constructor(te,ne){super(),this.tag=te,this.fields=ne}cases(){return["Loading","Loaded"]}}function Component(ee){let te,ne;const re=BackendService_$ctor_Z384F8060(ee.backendUrl,ee.accessToken);ne=React_useElmish_Z6C327F2E(()=>ProgramModule_mkProgram(StateModule_init,(ae,le)=>StateModule_update(re,ae,le),(ae,le)=>{}),void 0,void 0);const ie=ne[0],se=ne[1],oe=useFeliz_React__React_useState_Static_1505(new PdfModuleStatus(0,[])),he=oe[1],ue=oe[0];useReact_useEffectOnce_3A5B6456(()=>{startImport(ae=>{he(new PdfModuleStatus(1,[ae]))},()=>{he(new PdfModuleStatus(1,[void 0]))})});const de=[y$1("style",{children:[css]}),y$1("div",createObj(ofArray$2([["className","font-inter"],(te=toList(delay(()=>{const ae=ie.GetInitStateStatus,le=ie.PresentPoliciesStatus;let Ae,_e;switch(ae.tag===3?(le.tag===3||le.tag===0||le.tag===1||le.fields[0].tag,Ae=0):ae.tag===0||ae.tag===1?le.tag===3?Ae=0:le.tag===0||le.tag===1?Ae=3:le.fields[0].tag===1?Ae=0:Ae=3:ae.fields[0].tag===0?le.tag===3?Ae=0:le.tag===0||le.tag===1?ae.fields[0].fields[0].tag===1?Ae=1:Ae=3:le.fields[0].tag===0?ae.fields[0].fields[0].tag===0?ue.tag===0?Ae=3:(Ae=2,_e=ue.fields[0]):Ae=1:Ae=0:Ae=0,Ae){case 0:return singleton$1(y$1("div",{children:["Oops, we've encountered an error"]}));case 1:return singleton$1(noPoliciesConfigured(se));case 2:{const me=ie.Page;return me.tag===1?singleton$1(y$1(Component$1,{policyReviewItem:me.fields[0],acceptPolicyStatus:ie.AcceptPolicyStatus,reactPdf:_e,dispatch:se})):singleton$1(Component$4(ie.ReviewItemList,ie.ContinueStatus,se))}case 3:return singleton$1(y$1("div",{children:["Please wait..."]}))}})),["children",Interop_reactApi.Children.toArray(Array.from(te))])])))];return y$1(k$3,{},...de)}register(ee=>y$1(Component,ee),"apollo-workplace-policies-app");function commonjsRequire(ee){throw new Error('Could not dynamically require "'+ee+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(te,ne){module.exports=te.pdfjsLib=ne()})(globalThis,()=>(()=>{var __webpack_modules__=[,(ee,te)=>{var Gt;Object.defineProperty(te,"__esModule",{value:!0}),te.VerbosityLevel=te.Util=te.UnknownErrorException=te.UnexpectedResponseException=te.TextRenderingMode=te.RenderingIntentFlag=te.PromiseCapability=te.PermissionFlag=te.PasswordResponses=te.PasswordException=te.PageActionEventType=te.OPS=te.MissingPDFException=te.MAX_IMAGE_SIZE_TO_CACHE=te.LINE_FACTOR=te.LINE_DESCENT_FACTOR=te.InvalidPDFException=te.ImageKind=te.IDENTITY_MATRIX=te.FormatError=te.FeatureTest=te.FONT_IDENTITY_MATRIX=te.DocumentActionEventType=te.CMapCompressionType=te.BaseException=te.BASELINE_FACTOR=te.AnnotationType=te.AnnotationReplyType=te.AnnotationPrefix=te.AnnotationMode=te.AnnotationFlag=te.AnnotationFieldFlag=te.AnnotationEditorType=te.AnnotationEditorPrefix=te.AnnotationEditorParamsType=te.AnnotationBorderStyleType=te.AnnotationActionEventType=te.AbortException=void 0,te.assert=ut,te.bytesToString=He,te.createValidAbsoluteUrl=wt,te.getModificationDate=Ct,te.getUuid=Vt,te.getVerbosityLevel=Xe,te.info=rt,te.isArrayBuffer=ft,te.isArrayEqual=Tt,te.isNodeJS=void 0,te.normalizeUnicode=zt,te.objectFromMap=ht,te.objectSize=ot,te.setVerbosityLevel=Ie,te.shadow=Et,te.string32=et,te.stringToBytes=it,te.stringToPDFString=gt,te.stringToUTF8String=tt,te.unreachable=Ge,te.utf8StringToString=nt,te.warn=lt;const ne=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");te.isNodeJS=ne;const re=[1,0,0,1,0,0];te.IDENTITY_MATRIX=re;const ie=[.001,0,0,.001,0,0];te.FONT_IDENTITY_MATRIX=ie;const se=1e7;te.MAX_IMAGE_SIZE_TO_CACHE=se;const oe=1.35;te.LINE_FACTOR=oe;const he=.35;te.LINE_DESCENT_FACTOR=he;const ue=he/oe;te.BASELINE_FACTOR=ue;const de={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};te.RenderingIntentFlag=de;const ae={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};te.AnnotationMode=ae;const le="pdfjs_internal_editor_";te.AnnotationEditorPrefix=le;const Ae={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};te.AnnotationEditorType=Ae;const _e={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};te.AnnotationEditorParamsType=_e;const me={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};te.PermissionFlag=me;const ve={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};te.TextRenderingMode=ve;const Se={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};te.ImageKind=Se;const Te={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};te.AnnotationType=Te;const Pe={GROUP:"Group",REPLY:"R"};te.AnnotationReplyType=Pe;const Re={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};te.AnnotationFlag=Re;const $e={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};te.AnnotationFieldFlag=$e;const ye={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};te.AnnotationBorderStyleType=ye;const Ee={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};te.AnnotationActionEventType=Ee;const Ne={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};te.DocumentActionEventType=Ne;const Me={O:"PageOpen",C:"PageClose"};te.PageActionEventType=Me;const we={ERRORS:0,WARNINGS:1,INFOS:5};te.VerbosityLevel=we;const Oe={NONE:0,BINARY:1};te.CMapCompressionType=Oe;const Fe={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};te.OPS=Fe;const Ve={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};te.PasswordResponses=Ve;let qe=we.WARNINGS;function Ie(dt){Number.isInteger(dt)&&(qe=dt)}function Xe(){return qe}function rt(dt){qe>=we.INFOS&&console.log("Info: ".concat(dt))}function lt(dt){qe>=we.WARNINGS&&console.log("Warning: ".concat(dt))}function Ge(dt){throw new Error(dt)}function ut(dt,Qe){dt||Ge(Qe)}function mt(dt){switch(dt==null?void 0:dt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function wt(dt,Qe=null,Ye=null){if(!dt)return null;try{if(Ye&&typeof dt=="string"){if(Ye.addDefaultProtocol&&dt.startsWith("www.")){const St=dt.match(/\./g);(St==null?void 0:St.length)>=2&&(dt="http://".concat(dt))}if(Ye.tryConvertEncoding)try{dt=tt(dt)}catch{}}const yt=Qe?new URL(dt,Qe):new URL(dt);if(mt(yt))return yt}catch{}return null}function Et(dt,Qe,Ye,yt=!1){return Object.defineProperty(dt,Qe,{value:Ye,enumerable:!yt,configurable:!0,writable:!1}),Ye}const De=function(){function Qe(Ye,yt){this.constructor===Qe&&Ge("Cannot initialize BaseException."),this.message=Ye,this.name=yt}return Qe.prototype=new Error,Qe.constructor=Qe,Qe}();te.BaseException=De;class pe extends De{constructor(Qe,Ye){super(Qe,"PasswordException"),this.code=Ye}}te.PasswordException=pe;class be extends De{constructor(Qe,Ye){super(Qe,"UnknownErrorException"),this.details=Ye}}te.UnknownErrorException=be;class ge extends De{constructor(Qe){super(Qe,"InvalidPDFException")}}te.InvalidPDFException=ge;class Ce extends De{constructor(Qe){super(Qe,"MissingPDFException")}}te.MissingPDFException=Ce;class xe extends De{constructor(Qe,Ye){super(Qe,"UnexpectedResponseException"),this.status=Ye}}te.UnexpectedResponseException=xe;class Le extends De{constructor(Qe){super(Qe,"FormatError")}}te.FormatError=Le;class Be extends De{constructor(Qe){super(Qe,"AbortException")}}te.AbortException=Be;function He(dt){(typeof dt!="object"||(dt==null?void 0:dt.length)===void 0)&&Ge("Invalid argument for bytesToString");const Qe=dt.length,Ye=8192;if(Qe<Ye)return String.fromCharCode.apply(null,dt);const yt=[];for(let St=0;St<Qe;St+=Ye){const wn=Math.min(St+Ye,Qe),Qt=dt.subarray(St,wn);yt.push(String.fromCharCode.apply(null,Qt))}return yt.join("")}function it(dt){typeof dt!="string"&&Ge("Invalid argument for stringToBytes");const Qe=dt.length,Ye=new Uint8Array(Qe);for(let yt=0;yt<Qe;++yt)Ye[yt]=dt.charCodeAt(yt)&255;return Ye}function et(dt){return String.fromCharCode(dt>>24&255,dt>>16&255,dt>>8&255,dt&255)}function ot(dt){return Object.keys(dt).length}function ht(dt){const Qe=Object.create(null);for(const[Ye,yt]of dt)Qe[Ye]=yt;return Qe}function pt(){const dt=new Uint8Array(4);return dt[0]=1,new Uint32Array(dt.buffer,0,1)[0]===1}function ct(){try{return new Function(""),!0}catch{return!1}}class Pt{static get isLittleEndian(){return Et(this,"isLittleEndian",pt())}static get isEvalSupported(){return Et(this,"isEvalSupported",ct())}static get isOffscreenCanvasSupported(){return Et(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?Et(this,"platform",{isWin:!1,isMac:!1}):Et(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Qe,Ye;return Et(this,"isCSSRoundSupported",(Ye=(Qe=globalThis.CSS)==null?void 0:Qe.supports)==null?void 0:Ye.call(Qe,"width: round(1.5px, 1px)"))}}te.FeatureTest=Pt;const It=[...Array(256).keys()].map(dt=>dt.toString(16).padStart(2,"0"));class vt{static makeHexColor(Qe,Ye,yt){return"#".concat(It[Qe]).concat(It[Ye]).concat(It[yt])}static scaleMinMax(Qe,Ye){let yt;Qe[0]?(Qe[0]<0&&(yt=Ye[0],Ye[0]=Ye[1],Ye[1]=yt),Ye[0]*=Qe[0],Ye[1]*=Qe[0],Qe[3]<0&&(yt=Ye[2],Ye[2]=Ye[3],Ye[3]=yt),Ye[2]*=Qe[3],Ye[3]*=Qe[3]):(yt=Ye[0],Ye[0]=Ye[2],Ye[2]=yt,yt=Ye[1],Ye[1]=Ye[3],Ye[3]=yt,Qe[1]<0&&(yt=Ye[2],Ye[2]=Ye[3],Ye[3]=yt),Ye[2]*=Qe[1],Ye[3]*=Qe[1],Qe[2]<0&&(yt=Ye[0],Ye[0]=Ye[1],Ye[1]=yt),Ye[0]*=Qe[2],Ye[1]*=Qe[2]),Ye[0]+=Qe[4],Ye[1]+=Qe[4],Ye[2]+=Qe[5],Ye[3]+=Qe[5]}static transform(Qe,Ye){return[Qe[0]*Ye[0]+Qe[2]*Ye[1],Qe[1]*Ye[0]+Qe[3]*Ye[1],Qe[0]*Ye[2]+Qe[2]*Ye[3],Qe[1]*Ye[2]+Qe[3]*Ye[3],Qe[0]*Ye[4]+Qe[2]*Ye[5]+Qe[4],Qe[1]*Ye[4]+Qe[3]*Ye[5]+Qe[5]]}static applyTransform(Qe,Ye){const yt=Qe[0]*Ye[0]+Qe[1]*Ye[2]+Ye[4],St=Qe[0]*Ye[1]+Qe[1]*Ye[3]+Ye[5];return[yt,St]}static applyInverseTransform(Qe,Ye){const yt=Ye[0]*Ye[3]-Ye[1]*Ye[2],St=(Qe[0]*Ye[3]-Qe[1]*Ye[2]+Ye[2]*Ye[5]-Ye[4]*Ye[3])/yt,wn=(-Qe[0]*Ye[1]+Qe[1]*Ye[0]+Ye[4]*Ye[1]-Ye[5]*Ye[0])/yt;return[St,wn]}static getAxialAlignedBoundingBox(Qe,Ye){const yt=this.applyTransform(Qe,Ye),St=this.applyTransform(Qe.slice(2,4),Ye),wn=this.applyTransform([Qe[0],Qe[3]],Ye),Qt=this.applyTransform([Qe[2],Qe[1]],Ye);return[Math.min(yt[0],St[0],wn[0],Qt[0]),Math.min(yt[1],St[1],wn[1],Qt[1]),Math.max(yt[0],St[0],wn[0],Qt[0]),Math.max(yt[1],St[1],wn[1],Qt[1])]}static inverseTransform(Qe){const Ye=Qe[0]*Qe[3]-Qe[1]*Qe[2];return[Qe[3]/Ye,-Qe[1]/Ye,-Qe[2]/Ye,Qe[0]/Ye,(Qe[2]*Qe[5]-Qe[4]*Qe[3])/Ye,(Qe[4]*Qe[1]-Qe[5]*Qe[0])/Ye]}static singularValueDecompose2dScale(Qe){const Ye=[Qe[0],Qe[2],Qe[1],Qe[3]],yt=Qe[0]*Ye[0]+Qe[1]*Ye[2],St=Qe[0]*Ye[1]+Qe[1]*Ye[3],wn=Qe[2]*Ye[0]+Qe[3]*Ye[2],Qt=Qe[2]*Ye[1]+Qe[3]*Ye[3],Je=(yt+Qt)/2,At=Math.sqrt((yt+Qt)**2-4*(yt*Qt-wn*St))/2,Lt=Je+At||1,Rt=Je-At||1;return[Math.sqrt(Lt),Math.sqrt(Rt)]}static normalizeRect(Qe){const Ye=Qe.slice(0);return Qe[0]>Qe[2]&&(Ye[0]=Qe[2],Ye[2]=Qe[0]),Qe[1]>Qe[3]&&(Ye[1]=Qe[3],Ye[3]=Qe[1]),Ye}static intersect(Qe,Ye){const yt=Math.max(Math.min(Qe[0],Qe[2]),Math.min(Ye[0],Ye[2])),St=Math.min(Math.max(Qe[0],Qe[2]),Math.max(Ye[0],Ye[2]));if(yt>St)return null;const wn=Math.max(Math.min(Qe[1],Qe[3]),Math.min(Ye[1],Ye[3])),Qt=Math.min(Math.max(Qe[1],Qe[3]),Math.max(Ye[1],Ye[3]));return wn>Qt?null:[yt,wn,St,Qt]}static bezierBoundingBox(Qe,Ye,yt,St,wn,Qt,Je,At){const Lt=[],Rt=[[],[]];let Dt,Nt,Zt,bt,Kt,Ot,Ue,fe;for(let Ze=0;Ze<2;++Ze){if(Ze===0?(Nt=6*Qe-12*yt+6*wn,Dt=-3*Qe+9*yt-9*wn+3*Je,Zt=3*yt-3*Qe):(Nt=6*Ye-12*St+6*Qt,Dt=-3*Ye+9*St-9*Qt+3*At,Zt=3*St-3*Ye),Math.abs(Dt)<1e-12){if(Math.abs(Nt)<1e-12)continue;bt=-Zt/Nt,0<bt&&bt<1&&Lt.push(bt);continue}Ue=Nt*Nt-4*Zt*Dt,fe=Math.sqrt(Ue),!(Ue<0)&&(Kt=(-Nt+fe)/(2*Dt),0<Kt&&Kt<1&&Lt.push(Kt),Ot=(-Nt-fe)/(2*Dt),0<Ot&&Ot<1&&Lt.push(Ot))}let ke=Lt.length,je;const ze=ke;for(;ke--;)bt=Lt[ke],je=1-bt,Rt[0][ke]=je*je*je*Qe+3*je*je*bt*yt+3*je*bt*bt*wn+bt*bt*bt*Je,Rt[1][ke]=je*je*je*Ye+3*je*je*bt*St+3*je*bt*bt*Qt+bt*bt*bt*At;return Rt[0][ze]=Qe,Rt[1][ze]=Ye,Rt[0][ze+1]=Je,Rt[1][ze+1]=At,Rt[0].length=Rt[1].length=ze+2,[Math.min(...Rt[0]),Math.min(...Rt[1]),Math.max(...Rt[0]),Math.max(...Rt[1])]}}te.Util=vt;const kt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function gt(dt){if(dt[0]>="ï"){let Ye;if(dt[0]==="þ"&&dt[1]==="ÿ"?Ye="utf-16be":dt[0]==="ÿ"&&dt[1]==="þ"?Ye="utf-16le":dt[0]==="ï"&&dt[1]==="»"&&dt[2]==="¿"&&(Ye="utf-8"),Ye)try{const yt=new TextDecoder(Ye,{fatal:!0}),St=it(dt);return yt.decode(St)}catch(yt){lt('stringToPDFString: "'.concat(yt,'".'))}}const Qe=[];for(let Ye=0,yt=dt.length;Ye<yt;Ye++){const St=kt[dt.charCodeAt(Ye)];Qe.push(St?String.fromCharCode(St):dt.charAt(Ye))}return Qe.join("")}function tt(dt){return decodeURIComponent(escape(dt))}function nt(dt){return unescape(encodeURIComponent(dt))}function ft(dt){return typeof dt=="object"&&(dt==null?void 0:dt.byteLength)!==void 0}function Tt(dt,Qe){if(dt.length!==Qe.length)return!1;for(let Ye=0,yt=dt.length;Ye<yt;Ye++)if(dt[Ye]!==Qe[Ye])return!1;return!0}function Ct(dt=new Date){return[dt.getUTCFullYear().toString(),(dt.getUTCMonth()+1).toString().padStart(2,"0"),dt.getUTCDate().toString().padStart(2,"0"),dt.getUTCHours().toString().padStart(2,"0"),dt.getUTCMinutes().toString().padStart(2,"0"),dt.getUTCSeconds().toString().padStart(2,"0")].join("")}class Ht{constructor(){We(this,Gt,!1);this.promise=new Promise((Qe,Ye)=>{this.resolve=yt=>{st(this,Gt,!0),Qe(yt)},this.reject=yt=>{st(this,Gt,!0),Ye(yt)}})}get settled(){return ce(this,Gt)}}Gt=new WeakMap,te.PromiseCapability=Ht;let Wt=null,Ut=null;function zt(dt){return Wt||(Wt=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Ut=new Map([["ſt","ſt"]])),dt.replaceAll(Wt,(Qe,Ye,yt)=>Ye?Ye.normalize("NFKC"):Ut.get(yt))}function Vt(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const dt=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(dt);else for(let Qe=0;Qe<32;Qe++)dt[Qe]=Math.floor(Math.random()*255);return He(dt)}const jt="pdfjs_internal_id_";te.AnnotationPrefix=jt},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var ee,ne,re,ie,kn,oe,qn,ue,de,ae,le,Ae,_e,me,ve,Se,zn,Pe,Re,ar,ye,Ee;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(Me){var Ht,Wt;if(typeof Me=="string"||Me instanceof URL?Me={url:Me}:(0,_util.isArrayBuffer)(Me)&&(Me={data:Me}),typeof Me!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!Me.url&&!Me.data&&!Me.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const we=new PDFDocumentLoadingTask,{docId:Oe}=we,Fe=Me.url?getUrlProp(Me.url):null,Ve=Me.data?getDataProp(Me.data):null,qe=Me.httpHeaders||null,Ie=Me.withCredentials===!0,Xe=(Ht=Me.password)!=null?Ht:null,rt=Me.range instanceof PDFDataRangeTransport?Me.range:null,lt=Number.isInteger(Me.rangeChunkSize)&&Me.rangeChunkSize>0?Me.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let Ge=Me.worker instanceof PDFWorker?Me.worker:null;const ut=Me.verbosity,mt=typeof Me.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(Me.docBaseUrl)?Me.docBaseUrl:null,wt=typeof Me.cMapUrl=="string"?Me.cMapUrl:null,Et=Me.cMapPacked!==!1,De=Me.CMapReaderFactory||DefaultCMapReaderFactory,pe=typeof Me.standardFontDataUrl=="string"?Me.standardFontDataUrl:null,be=Me.StandardFontDataFactory||DefaultStandardFontDataFactory,ge=Me.stopAtErrors!==!0,Ce=Number.isInteger(Me.maxImageSize)&&Me.maxImageSize>-1?Me.maxImageSize:-1,xe=Me.isEvalSupported!==!1,Le=typeof Me.isOffscreenCanvasSupported=="boolean"?Me.isOffscreenCanvasSupported:!_util.isNodeJS,Be=Number.isInteger(Me.canvasMaxAreaInBytes)?Me.canvasMaxAreaInBytes:-1,He=typeof Me.disableFontFace=="boolean"?Me.disableFontFace:_util.isNodeJS,it=Me.fontExtraProperties===!0,et=Me.enableXfa===!0,ot=Me.ownerDocument||globalThis.document,ht=Me.disableRange===!0,pt=Me.disableStream===!0,ct=Me.disableAutoFetch===!0,Pt=Me.pdfBug===!0,It=rt?rt.length:(Wt=Me.length)!=null?Wt:NaN,vt=typeof Me.useSystemFonts=="boolean"?Me.useSystemFonts:!_util.isNodeJS&&!He,kt=typeof Me.useWorkerFetch=="boolean"?Me.useWorkerFetch:De===_display_utils.DOMCMapReaderFactory&&be===_display_utils.DOMStandardFontDataFactory&&wt&&pe&&(0,_display_utils.isValidFetchUrl)(wt,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(pe,document.baseURI),gt=Me.canvasFactory||new DefaultCanvasFactory({ownerDocument:ot}),tt=Me.filterFactory||new DefaultFilterFactory({docId:Oe,ownerDocument:ot}),nt=null;(0,_util.setVerbosityLevel)(ut);const ft={canvasFactory:gt,filterFactory:tt};if(kt||(ft.cMapReaderFactory=new De({baseUrl:wt,isCompressed:Et}),ft.standardFontDataFactory=new be({baseUrl:pe})),!Ge){const Ut={verbosity:ut,port:_worker_options.GlobalWorkerOptions.workerPort};Ge=Ut.port?PDFWorker.fromPort(Ut):new PDFWorker(Ut),we._worker=Ge}const Tt={docId:Oe,apiVersion:"3.11.174",data:Ve,password:Xe,disableAutoFetch:ct,rangeChunkSize:lt,length:It,docBaseUrl:mt,enableXfa:et,evaluatorOptions:{maxImageSize:Ce,disableFontFace:He,ignoreErrors:ge,isEvalSupported:xe,isOffscreenCanvasSupported:Le,canvasMaxAreaInBytes:Be,fontExtraProperties:it,useSystemFonts:vt,cMapUrl:kt?wt:null,standardFontDataUrl:kt?pe:null}},Ct={ignoreErrors:ge,isEvalSupported:xe,disableFontFace:He,fontExtraProperties:it,enableXfa:et,ownerDocument:ot,disableAutoFetch:ct,pdfBug:Pt,styleElement:nt};return Ge.promise.then(function(){if(we.destroyed)throw new Error("Loading aborted");const Ut=_fetchDocument(Ge,Tt),zt=new Promise(function(Vt){let jt;rt?jt=new _transport_stream.PDFDataTransportStream({length:It,initialData:rt.initialData,progressiveDone:rt.progressiveDone,contentDispositionFilename:rt.contentDispositionFilename,disableRange:ht,disableStream:pt},rt):Ve||(jt=(dt=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(dt):(0,_display_utils.isValidFetchUrl)(dt.url)?new _displayFetch_stream.PDFFetchStream(dt):new _displayNetwork.PDFNetworkStream(dt))({url:Fe,length:It,httpHeaders:qe,withCredentials:Ie,rangeChunkSize:lt,disableRange:ht,disableStream:pt})),Vt(jt)});return Promise.all([Ut,zt]).then(function([Vt,jt]){if(we.destroyed)throw new Error("Loading aborted");const Gt=new _message_handler.MessageHandler(Oe,Vt,Ge.port),dt=new WorkerTransport(Gt,we,jt,Ct,ft);we._transport=dt,Gt.send("Ready",null)})}).catch(we._capability.reject),we}async function _fetchDocument(Me,we){if(Me.destroyed)throw new Error("Worker was destroyed");const Oe=await Me.messageHandler.sendWithPromise("GetDocRequest",we,we.data?[we.data.buffer]:null);if(Me.destroyed)throw new Error("Worker was destroyed");return Oe}function getUrlProp(Me){if(Me instanceof URL)return Me.href;try{return new URL(Me,window.location).href}catch{if(_util.isNodeJS&&typeof Me=="string")return Me}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(Me){if(_util.isNodeJS&&typeof Buffer<"u"&&Me instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(Me instanceof Uint8Array&&Me.byteLength===Me.buffer.byteLength)return Me;if(typeof Me=="string")return(0,_util.stringToBytes)(Me);if(typeof Me=="object"&&!isNaN(Me==null?void 0:Me.length)||(0,_util.isArrayBuffer)(Me))return new Uint8Array(Me);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const te=class te{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId="d".concat(Nn(te,ee)._++),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var we,Oe,Fe;this.destroyed=!0;try{(we=this._worker)!=null&&we.port&&(this._worker._pendingDestroy=!0),await((Oe=this._transport)==null?void 0:Oe.destroy())}catch(Ve){throw(Fe=this._worker)!=null&&Fe.port&&delete this._worker._pendingDestroy,Ve}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};ee=new WeakMap,We(te,ee,0);let PDFDocumentLoadingTask=te;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(we,Oe,Fe=!1,Ve=null){this.length=we,this.initialData=Oe,this.progressiveDone=Fe,this.contentDispositionFilename=Ve,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(we){this._rangeListeners.push(we)}addProgressListener(we){this._progressListeners.push(we)}addProgressiveReadListener(we){this._progressiveReadListeners.push(we)}addProgressiveDoneListener(we){this._progressiveDoneListeners.push(we)}onDataRange(we,Oe){for(const Fe of this._rangeListeners)Fe(we,Oe)}onDataProgress(we,Oe){this._readyCapability.promise.then(()=>{for(const Fe of this._progressListeners)Fe(we,Oe)})}onDataProgressiveRead(we){this._readyCapability.promise.then(()=>{for(const Oe of this._progressiveReadListeners)Oe(we)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const we of this._progressiveDoneListeners)we()})}transportReady(){this._readyCapability.resolve()}requestDataRange(we,Oe){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(we,Oe){this._pdfInfo=we,this._transport=Oe,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(Fe=>{if(!Fe)return Fe;const Ve=[];for(const qe in Fe)Ve.push(...Fe[qe]);return Ve}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(we){return this._transport.getPage(we)}getPageIndex(we){return this._transport.getPageIndex(we)}getDestinations(){return this._transport.getDestinations()}getDestination(we){return this._transport.getDestination(we)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(we=!1){return this._transport.startCleanup(we||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(we,Oe,Fe,Ve=!1){We(this,ie);We(this,oe);We(this,ne,null);We(this,re,!1);this._pageIndex=we,this._pageInfo=Oe,this._transport=Fe,this._stats=Ve?new _display_utils.StatTimer:null,this._pdfBug=Ve,this.commonObjs=Fe.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:we,rotation:Oe=this.rotate,offsetX:Fe=0,offsetY:Ve=0,dontFlip:qe=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:we,rotation:Oe,offsetX:Fe,offsetY:Ve,dontFlip:qe})}getAnnotations({intent:we="display"}={}){const Oe=this._transport.getRenderingIntent(we);return this._transport.getAnnotations(this._pageIndex,Oe.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var we;return((we=this._transport._htmlForXfa)==null?void 0:we.children[this._pageIndex])||null}render({canvasContext:we,viewport:Oe,intent:Fe="display",annotationMode:Ve=_util.AnnotationMode.ENABLE,transform:qe=null,background:Ie=null,optionalContentConfigPromise:Xe=null,annotationCanvasMap:rt=null,pageColors:lt=null,printAnnotationStorage:Ge=null}){var be,ge;(be=this._stats)==null||be.time("Overall");const ut=this._transport.getRenderingIntent(Fe,Ve,Ge);st(this,re,!1),Ke(this,oe,qn).call(this),Xe||(Xe=this._transport.getOptionalContentConfig());let mt=this._intentStates.get(ut.cacheKey);mt||(mt=Object.create(null),this._intentStates.set(ut.cacheKey,mt)),mt.streamReaderCancelTimeout&&(clearTimeout(mt.streamReaderCancelTimeout),mt.streamReaderCancelTimeout=null);const wt=!!(ut.renderingIntent&_util.RenderingIntentFlag.PRINT);mt.displayReadyCapability||(mt.displayReadyCapability=new _util.PromiseCapability,mt.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(ge=this._stats)==null||ge.time("Page Request"),this._pumpOperatorList(ut));const Et=Ce=>{var xe,Le;mt.renderTasks.delete(De),(this._maybeCleanupAfterRender||wt)&&st(this,re,!0),Ke(this,ie,kn).call(this,!wt),Ce?(De.capability.reject(Ce),this._abortOperatorList({intentState:mt,reason:Ce instanceof Error?Ce:new Error(Ce)})):De.capability.resolve(),(xe=this._stats)==null||xe.timeEnd("Rendering"),(Le=this._stats)==null||Le.timeEnd("Overall")},De=new InternalRenderTask({callback:Et,params:{canvasContext:we,viewport:Oe,transform:qe,background:Ie},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:rt,operatorList:mt.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!wt,pdfBug:this._pdfBug,pageColors:lt});(mt.renderTasks||(mt.renderTasks=new Set)).add(De);const pe=De.task;return Promise.all([mt.displayReadyCapability.promise,Xe]).then(([Ce,xe])=>{var Le;if(this.destroyed){Et();return}(Le=this._stats)==null||Le.time("Rendering"),De.initializeGraphics({transparency:Ce,optionalContentConfig:xe}),De.operatorListChanged()}).catch(Et),pe}getOperatorList({intent:we="display",annotationMode:Oe=_util.AnnotationMode.ENABLE,printAnnotationStorage:Fe=null}={}){var rt;function Ve(){Ie.operatorList.lastChunk&&(Ie.opListReadCapability.resolve(Ie.operatorList),Ie.renderTasks.delete(Xe))}const qe=this._transport.getRenderingIntent(we,Oe,Fe,!0);let Ie=this._intentStates.get(qe.cacheKey);Ie||(Ie=Object.create(null),this._intentStates.set(qe.cacheKey,Ie));let Xe;return Ie.opListReadCapability||(Xe=Object.create(null),Xe.operatorListChanged=Ve,Ie.opListReadCapability=new _util.PromiseCapability,(Ie.renderTasks||(Ie.renderTasks=new Set)).add(Xe),Ie.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(rt=this._stats)==null||rt.time("Page Request"),this._pumpOperatorList(qe)),Ie.opListReadCapability.promise}streamTextContent({includeMarkedContent:we=!1,disableNormalization:Oe=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:we===!0,disableNormalization:Oe===!0},{highWaterMark:100,size(Ve){return Ve.items.length}})}getTextContent(we={}){if(this._transport._htmlForXfa)return this.getXfa().then(Fe=>_xfa_text.XfaText.textContent(Fe));const Oe=this.streamTextContent(we);return new Promise(function(Fe,Ve){function qe(){Ie.read().then(function({value:rt,done:lt}){if(lt){Fe(Xe);return}Object.assign(Xe.styles,rt.styles),Xe.items.push(...rt.items),qe()},Ve)}const Ie=Oe.getReader(),Xe={items:[],styles:Object.create(null)};qe()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const we=[];for(const Oe of this._intentStates.values())if(this._abortOperatorList({intentState:Oe,reason:new Error("Page was destroyed."),force:!0}),!Oe.opListReadCapability)for(const Fe of Oe.renderTasks)we.push(Fe.completed),Fe.cancel();return this.objs.clear(),st(this,re,!1),Ke(this,oe,qn).call(this),Promise.all(we)}cleanup(we=!1){st(this,re,!0);const Oe=Ke(this,ie,kn).call(this,!1);return we&&Oe&&this._stats&&(this._stats=new _display_utils.StatTimer),Oe}_startRenderPage(we,Oe){var Ve,qe;const Fe=this._intentStates.get(Oe);Fe&&((Ve=this._stats)==null||Ve.timeEnd("Page Request"),(qe=Fe.displayReadyCapability)==null||qe.resolve(we))}_renderPageChunk(we,Oe){for(let Fe=0,Ve=we.length;Fe<Ve;Fe++)Oe.operatorList.fnArray.push(we.fnArray[Fe]),Oe.operatorList.argsArray.push(we.argsArray[Fe]);Oe.operatorList.lastChunk=we.lastChunk,Oe.operatorList.separateAnnots=we.separateAnnots;for(const Fe of Oe.renderTasks)Fe.operatorListChanged();we.lastChunk&&Ke(this,ie,kn).call(this,!0)}_pumpOperatorList({renderingIntent:we,cacheKey:Oe,annotationStorageSerializable:Fe}){const{map:Ve,transfers:qe}=Fe,Xe=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:we,cacheKey:Oe,annotationStorage:Ve},qe).getReader(),rt=this._intentStates.get(Oe);rt.streamReader=Xe;const lt=()=>{Xe.read().then(({value:Ge,done:ut})=>{if(ut){rt.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(Ge,rt),lt())},Ge=>{if(rt.streamReader=null,!this._transport.destroyed){if(rt.operatorList){rt.operatorList.lastChunk=!0;for(const ut of rt.renderTasks)ut.operatorListChanged();Ke(this,ie,kn).call(this,!0)}if(rt.displayReadyCapability)rt.displayReadyCapability.reject(Ge);else if(rt.opListReadCapability)rt.opListReadCapability.reject(Ge);else throw Ge}})};lt()}_abortOperatorList({intentState:we,reason:Oe,force:Fe=!1}){if(we.streamReader){if(we.streamReaderCancelTimeout&&(clearTimeout(we.streamReaderCancelTimeout),we.streamReaderCancelTimeout=null),!Fe){if(we.renderTasks.size>0)return;if(Oe instanceof _display_utils.RenderingCancelledException){let Ve=RENDERING_CANCELLED_TIMEOUT;Oe.extraDelay>0&&Oe.extraDelay<1e3&&(Ve+=Oe.extraDelay),we.streamReaderCancelTimeout=setTimeout(()=>{we.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:we,reason:Oe,force:!0})},Ve);return}}if(we.streamReader.cancel(new _util.AbortException(Oe.message)).catch(()=>{}),we.streamReader=null,!this._transport.destroyed){for(const[Ve,qe]of this._intentStates)if(qe===we){this._intentStates.delete(Ve);break}this.cleanup()}}}get stats(){return this._stats}}ne=new WeakMap,re=new WeakMap,ie=new WeakSet,kn=function(we=!1){if(Ke(this,oe,qn).call(this),!ce(this,re)||this.destroyed)return!1;if(we)return st(this,ne,setTimeout(()=>{st(this,ne,null),Ke(this,ie,kn).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Oe,operatorList:Fe}of this._intentStates.values())if(Oe.size>0||!Fe.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),st(this,re,!1),!0},oe=new WeakSet,qn=function(){ce(this,ne)&&(clearTimeout(ce(this,ne)),st(this,ne,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){We(this,ue,new Set);We(this,de,Promise.resolve())}postMessage(we,Oe){const Fe={data:structuredClone(we,Oe?{transfer:Oe}:null)};ce(this,de).then(()=>{for(const Ve of ce(this,ue))Ve.call(this,Fe)})}addEventListener(we,Oe){ce(this,ue).add(Oe)}removeEventListener(we,Oe){ce(this,ue).delete(Oe)}terminate(){ce(this,ue).clear()}}ue=new WeakMap,de=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const Me=(ae=document==null?void 0:document.currentScript)==null?void 0:ae.src;Me&&(PDFWorkerUtil.fallbackWorkerSrc=Me.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(Me,we){let Oe;try{if(Oe=new URL(Me),!Oe.origin||Oe.origin==="null")return!1}catch{return!1}const Fe=new URL(we,Oe);return Oe.origin===Fe.origin},PDFWorkerUtil.createCDNWrapper=function(Me){const we='importScripts("'.concat(Me,'");');return URL.createObjectURL(new Blob([we]))}}const _PDFWorker=class _PDFWorker{constructor({name:Me=null,port:we=null,verbosity:Oe=(0,_util.getVerbosityLevel)()}={}){var Fe;if(this.name=Me,this.destroyed=!1,this.verbosity=Oe,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,we){if((Fe=ce(_PDFWorker,le))!=null&&Fe.has(we))throw new Error("Cannot use more than one PDFWorker per port.");(ce(_PDFWorker,le)||st(_PDFWorker,le,new WeakMap)).set(we,this),this._initializeFromPort(we);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(Me){this._port=Me,this._messageHandler=new _message_handler.MessageHandler("main","worker",Me),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:Me}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,Me)||(Me=PDFWorkerUtil.createCDNWrapper(new URL(Me,window.location).href));const we=new Worker(Me),Oe=new _message_handler.MessageHandler("main","worker",we),Fe=()=>{we.removeEventListener("error",Ve),Oe.destroy(),we.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},Ve=()=>{this._webWorker||Fe()};we.addEventListener("error",Ve),Oe.on("test",Ie=>{if(we.removeEventListener("error",Ve),this.destroyed){Fe();return}Ie?(this._messageHandler=Oe,this._port=we,this._webWorker=we,this._readyCapability.resolve(),Oe.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Oe.destroy(),we.terminate())}),Oe.on("ready",Ie=>{if(we.removeEventListener("error",Ve),this.destroyed){Fe();return}try{qe()}catch{this._setupFakeWorker()}});const qe=()=>{const Ie=new Uint8Array;Oe.send("test",Ie,[Ie.buffer])};qe();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(Me=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const we=new LoopbackPort;this._port=we;const Oe="fake".concat(PDFWorkerUtil.fakeWorkerId++),Fe=new _message_handler.MessageHandler(Oe+"_worker",Oe,we);Me.setup(Fe,we);const Ve=new _message_handler.MessageHandler(Oe,Oe+"_worker",we);this._messageHandler=Ve,this._readyCapability.resolve(),Ve.send("configure",{verbosity:this.verbosity})}).catch(Me=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(Me.message,'".')))})}destroy(){var Me;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(Me=ce(_PDFWorker,le))==null||Me.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(Me){var Oe;if(!(Me!=null&&Me.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const we=(Oe=ce(this,le))==null?void 0:Oe.get(Me.port);if(we){if(we._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return we}return new _PDFWorker(Me)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var Me;try{return((Me=globalThis.pdfjsWorker)==null?void 0:Me.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};le=new WeakMap,We(_PDFWorker,le,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(we,Oe,Fe,Ve,qe){We(this,Se);We(this,Ae,new Map);We(this,_e,new Map);We(this,me,new Map);We(this,ve,null);this.messageHandler=we,this.loadingTask=Oe,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:Ve.ownerDocument,styleElement:Ve.styleElement}),this._params=Ve,this.canvasFactory=qe.canvasFactory,this.filterFactory=qe.filterFactory,this.cMapReaderFactory=qe.cMapReaderFactory,this.standardFontDataFactory=qe.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=Fe,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(we,Oe=_util.AnnotationMode.ENABLE,Fe=null,Ve=!1){let qe=_util.RenderingIntentFlag.DISPLAY,Ie=_annotation_storage.SerializableEmpty;switch(we){case"any":qe=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":qe=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(we))}switch(Oe){case _util.AnnotationMode.DISABLE:qe+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:qe+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:qe+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Ie=(qe&_util.RenderingIntentFlag.PRINT&&Fe instanceof _annotation_storage.PrintAnnotationStorage?Fe:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(Oe))}return Ve&&(qe+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:qe,cacheKey:"".concat(qe,"_").concat(Ie.hash),annotationStorageSerializable:Ie}}destroy(){var Fe;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(Fe=ce(this,ve))==null||Fe.reject(new Error("Worker was destroyed during onPassword callback"));const we=[];for(const Ve of ce(this,_e).values())we.push(Ve._destroy());ce(this,_e).clear(),ce(this,me).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Oe=this.messageHandler.sendWithPromise("Terminate",null);return we.push(Oe),Promise.all(we).then(()=>{var Ve;this.commonObjs.clear(),this.fontLoader.clear(),ce(this,Ae).clear(),this.filterFactory.destroy(),(Ve=this._networkStream)==null||Ve.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:we,loadingTask:Oe}=this;we.on("GetReader",(Fe,Ve)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=qe=>{this._lastProgress={loaded:qe.loaded,total:qe.total}},Ve.onPull=()=>{this._fullReader.read().then(function({value:qe,done:Ie}){if(Ie){Ve.close();return}(0,_util.assert)(qe instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),Ve.enqueue(new Uint8Array(qe),1,[qe])}).catch(qe=>{Ve.error(qe)})},Ve.onCancel=qe=>{this._fullReader.cancel(qe),Ve.ready.catch(Ie=>{if(!this.destroyed)throw Ie})}}),we.on("ReaderHeadersReady",Fe=>{const Ve=new _util.PromiseCapability,qe=this._fullReader;return qe.headersReady.then(()=>{var Ie;(!qe.isStreamingSupported||!qe.isRangeSupported)&&(this._lastProgress&&((Ie=Oe.onProgress)==null||Ie.call(Oe,this._lastProgress)),qe.onProgress=Xe=>{var rt;(rt=Oe.onProgress)==null||rt.call(Oe,{loaded:Xe.loaded,total:Xe.total})}),Ve.resolve({isStreamingSupported:qe.isStreamingSupported,isRangeSupported:qe.isRangeSupported,contentLength:qe.contentLength})},Ve.reject),Ve.promise}),we.on("GetRangeReader",(Fe,Ve)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const qe=this._networkStream.getRangeReader(Fe.begin,Fe.end);if(!qe){Ve.close();return}Ve.onPull=()=>{qe.read().then(function({value:Ie,done:Xe}){if(Xe){Ve.close();return}(0,_util.assert)(Ie instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),Ve.enqueue(new Uint8Array(Ie),1,[Ie])}).catch(Ie=>{Ve.error(Ie)})},Ve.onCancel=Ie=>{qe.cancel(Ie),Ve.ready.catch(Xe=>{if(!this.destroyed)throw Xe})}}),we.on("GetDoc",({pdfInfo:Fe})=>{this._numPages=Fe.numPages,this._htmlForXfa=Fe.htmlForXfa,delete Fe.htmlForXfa,Oe._capability.resolve(new PDFDocumentProxy(Fe,this))}),we.on("DocException",function(Fe){let Ve;switch(Fe.name){case"PasswordException":Ve=new _util.PasswordException(Fe.message,Fe.code);break;case"InvalidPDFException":Ve=new _util.InvalidPDFException(Fe.message);break;case"MissingPDFException":Ve=new _util.MissingPDFException(Fe.message);break;case"UnexpectedResponseException":Ve=new _util.UnexpectedResponseException(Fe.message,Fe.status);break;case"UnknownErrorException":Ve=new _util.UnknownErrorException(Fe.message,Fe.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Oe._capability.reject(Ve)}),we.on("PasswordRequest",Fe=>{if(st(this,ve,new _util.PromiseCapability),Oe.onPassword){const Ve=qe=>{qe instanceof Error?ce(this,ve).reject(qe):ce(this,ve).resolve({password:qe})};try{Oe.onPassword(Ve,Fe.code)}catch(qe){ce(this,ve).reject(qe)}}else ce(this,ve).reject(new _util.PasswordException(Fe.message,Fe.code));return ce(this,ve).promise}),we.on("DataLoaded",Fe=>{var Ve;(Ve=Oe.onProgress)==null||Ve.call(Oe,{loaded:Fe.length,total:Fe.length}),this.downloadInfoCapability.resolve(Fe)}),we.on("StartRenderPage",Fe=>{if(this.destroyed)return;ce(this,_e).get(Fe.pageIndex)._startRenderPage(Fe.transparency,Fe.cacheKey)}),we.on("commonobj",([Fe,Ve,qe])=>{var Ie;if(!this.destroyed&&!this.commonObjs.has(Fe))switch(Ve){case"Font":const Xe=this._params;if("error"in qe){const Ge=qe.error;(0,_util.warn)("Error during font loading: ".concat(Ge)),this.commonObjs.resolve(Fe,Ge);break}const rt=Xe.pdfBug&&((Ie=globalThis.FontInspector)!=null&&Ie.enabled)?(Ge,ut)=>globalThis.FontInspector.fontAdded(Ge,ut):null,lt=new _font_loader.FontFaceObject(qe,{isEvalSupported:Xe.isEvalSupported,disableFontFace:Xe.disableFontFace,ignoreErrors:Xe.ignoreErrors,inspectFont:rt});this.fontLoader.bind(lt).catch(Ge=>we.sendWithPromise("FontFallback",{id:Fe})).finally(()=>{!Xe.fontExtraProperties&<.data&&(lt.data=null),this.commonObjs.resolve(Fe,lt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(Fe,qe);break;default:throw new Error("Got unknown common object type ".concat(Ve))}}),we.on("obj",([Fe,Ve,qe,Ie])=>{var rt;if(this.destroyed)return;const Xe=ce(this,_e).get(Ve);if(!Xe.objs.has(Fe))switch(qe){case"Image":if(Xe.objs.resolve(Fe,Ie),Ie){let lt;if(Ie.bitmap){const{width:Ge,height:ut}=Ie;lt=Ge*ut*4}else lt=((rt=Ie.data)==null?void 0:rt.length)||0;lt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Xe._maybeCleanupAfterRender=!0)}break;case"Pattern":Xe.objs.resolve(Fe,Ie);break;default:throw new Error("Got unknown object type ".concat(qe))}}),we.on("DocProgress",Fe=>{var Ve;this.destroyed||(Ve=Oe.onProgress)==null||Ve.call(Oe,{loaded:Fe.loaded,total:Fe.total})}),we.on("FetchBuiltInCMap",Fe=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(Fe):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),we.on("FetchStandardFontData",Fe=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(Fe):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var Fe,Ve;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:we,transfers:Oe}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:we,filename:(Ve=(Fe=this._fullReader)==null?void 0:Fe.filename)!=null?Ve:null},Oe).finally(()=>{this.annotationStorage.resetModified()})}getPage(we){if(!Number.isInteger(we)||we<=0||we>this._numPages)return Promise.reject(new Error("Invalid page request."));const Oe=we-1,Fe=ce(this,me).get(Oe);if(Fe)return Fe;const Ve=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Oe}).then(qe=>{if(this.destroyed)throw new Error("Transport destroyed");const Ie=new PDFPageProxy(Oe,qe,this,this._params.pdfBug);return ce(this,_e).set(Oe,Ie),Ie});return ce(this,me).set(Oe,Ve),Ve}getPageIndex(we){return typeof we!="object"||we===null||!Number.isInteger(we.num)||we.num<0||!Number.isInteger(we.gen)||we.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:we.num,gen:we.gen})}getAnnotations(we,Oe){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:we,intent:Oe})}getFieldObjects(){return Ke(this,Se,zn).call(this,"GetFieldObjects")}hasJSActions(){return Ke(this,Se,zn).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(we){return typeof we!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:we})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return Ke(this,Se,zn).call(this,"GetDocJSActions")}getPageJSActions(we){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:we})}getStructTree(we){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:we})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(we=>new _optional_content_config.OptionalContentConfig(we))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const we="GetMetadata",Oe=ce(this,Ae).get(we);if(Oe)return Oe;const Fe=this.messageHandler.sendWithPromise(we,null).then(Ve=>{var qe,Ie,Xe,rt;return{info:Ve[0],metadata:Ve[1]?new _metadata.Metadata(Ve[1]):null,contentDispositionFilename:(Ie=(qe=this._fullReader)==null?void 0:qe.filename)!=null?Ie:null,contentLength:(rt=(Xe=this._fullReader)==null?void 0:Xe.contentLength)!=null?rt:null}});return ce(this,Ae).set(we,Fe),Fe}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(we=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Oe of ce(this,_e).values())if(!Oe.cleanup())throw new Error("startCleanup: Page ".concat(Oe.pageNumber," is currently rendering."));this.commonObjs.clear(),we||this.fontLoader.clear(),ce(this,Ae).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:we,enableXfa:Oe}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:we,enableXfa:Oe})}}Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakSet,zn=function(we,Oe=null){const Fe=ce(this,Ae).get(we);if(Fe)return Fe;const Ve=this.messageHandler.sendWithPromise(we,Oe);return ce(this,Ae).set(we,Ve),Ve};class PDFObjects{constructor(){We(this,Re);We(this,Pe,Object.create(null))}get(we,Oe=null){if(Oe){const Ve=Ke(this,Re,ar).call(this,we);return Ve.capability.promise.then(()=>Oe(Ve.data)),null}const Fe=ce(this,Pe)[we];if(!(Fe!=null&&Fe.capability.settled))throw new Error("Requesting object that isn't resolved yet ".concat(we,"."));return Fe.data}has(we){const Oe=ce(this,Pe)[we];return(Oe==null?void 0:Oe.capability.settled)||!1}resolve(we,Oe=null){const Fe=Ke(this,Re,ar).call(this,we);Fe.data=Oe,Fe.capability.resolve()}clear(){var we;for(const Oe in ce(this,Pe)){const{data:Fe}=ce(this,Pe)[Oe];(we=Fe==null?void 0:Fe.bitmap)==null||we.close()}st(this,Pe,Object.create(null))}}Pe=new WeakMap,Re=new WeakSet,ar=function(we){var Oe;return(Oe=ce(this,Pe))[we]||(Oe[we]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(we){We(this,ye,null);st(this,ye,we),this.onContinue=null}get promise(){return ce(this,ye).capability.promise}cancel(we=0){ce(this,ye).cancel(null,we)}get separateAnnots(){const{separateAnnots:we}=ce(this,ye).operatorList;if(!we)return!1;const{annotationCanvasMap:Oe}=ce(this,ye);return we.form||we.canvas&&(Oe==null?void 0:Oe.size)>0}}ye=new WeakMap,exports.RenderTask=RenderTask;const Ne=class Ne{constructor({callback:we,params:Oe,objs:Fe,commonObjs:Ve,annotationCanvasMap:qe,operatorList:Ie,pageIndex:Xe,canvasFactory:rt,filterFactory:lt,useRequestAnimationFrame:Ge=!1,pdfBug:ut=!1,pageColors:mt=null}){this.callback=we,this.params=Oe,this.objs=Fe,this.commonObjs=Ve,this.annotationCanvasMap=qe,this.operatorListIdx=null,this.operatorList=Ie,this._pageIndex=Xe,this.canvasFactory=rt,this.filterFactory=lt,this._pdfBug=ut,this.pageColors=mt,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=Ge===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Oe.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:we=!1,optionalContentConfig:Oe}){var Xe,rt;if(this.cancelled)return;if(this._canvas){if(ce(Ne,Ee).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");ce(Ne,Ee).add(this._canvas)}this._pdfBug&&((Xe=globalThis.StepperManager)!=null&&Xe.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:Fe,viewport:Ve,transform:qe,background:Ie}=this.params;this.gfx=new _canvas.CanvasGraphics(Fe,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Oe},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:qe,viewport:Ve,transparency:we,background:Ie}),this.operatorListIdx=0,this.graphicsReady=!0,(rt=this.graphicsReadyCallback)==null||rt.call(this)}cancel(we=null,Oe=0){var Fe;this.running=!1,this.cancelled=!0,(Fe=this.gfx)==null||Fe.endDrawing(),ce(Ne,Ee).delete(this._canvas),this.callback(we||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),Oe))}operatorListChanged(){var we;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(we=this.stepper)==null||we.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),ce(Ne,Ee).delete(this._canvas),this.callback())))}};Ee=new WeakMap,We(Ne,Ee,new WeakSet);let InternalRenderTask=Ne;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(ee,te,ne)=>{var de,ae,le,Hr,_e;Object.defineProperty(te,"__esModule",{value:!0}),te.SerializableEmpty=te.PrintAnnotationStorage=te.AnnotationStorage=void 0;var re=ne(1),ie=ne(4),se=ne(8);const oe=Object.freeze({map:null,hash:"",transfers:void 0});te.SerializableEmpty=oe;class he{constructor(){We(this,le);We(this,de,!1);We(this,ae,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(ve,Se){const Te=ce(this,ae).get(ve);return Te===void 0?Se:Object.assign(Se,Te)}getRawValue(ve){return ce(this,ae).get(ve)}remove(ve){if(ce(this,ae).delete(ve),ce(this,ae).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const Se of ce(this,ae).values())if(Se instanceof ie.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(ve,Se){const Te=ce(this,ae).get(ve);let Pe=!1;if(Te!==void 0)for(const[Re,$e]of Object.entries(Se))Te[Re]!==$e&&(Pe=!0,Te[Re]=$e);else Pe=!0,ce(this,ae).set(ve,Se);Pe&&Ke(this,le,Hr).call(this),Se instanceof ie.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(Se.constructor._type)}has(ve){return ce(this,ae).has(ve)}getAll(){return ce(this,ae).size>0?(0,re.objectFromMap)(ce(this,ae)):null}setAll(ve){for(const[Se,Te]of Object.entries(ve))this.setValue(Se,Te)}get size(){return ce(this,ae).size}resetModified(){ce(this,de)&&(st(this,de,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ue(this)}get serializable(){if(ce(this,ae).size===0)return oe;const ve=new Map,Se=new se.MurmurHash3_64,Te=[],Pe=Object.create(null);let Re=!1;for(const[$e,ye]of ce(this,ae)){const Ee=ye instanceof ie.AnnotationEditor?ye.serialize(!1,Pe):ye;Ee&&(ve.set($e,Ee),Se.update("".concat($e,":").concat(JSON.stringify(Ee))),Re||(Re=!!Ee.bitmap))}if(Re)for(const $e of ve.values())$e.bitmap&&Te.push($e.bitmap);return ve.size>0?{map:ve,hash:Se.hexdigest(),transfers:Te}:oe}}de=new WeakMap,ae=new WeakMap,le=new WeakSet,Hr=function(){ce(this,de)||(st(this,de,!0),typeof this.onSetModified=="function"&&this.onSetModified())},te.AnnotationStorage=he;class ue extends he{constructor(Se){super();We(this,_e,void 0);const{map:Te,hash:Pe,transfers:Re}=Se.serializable,$e=structuredClone(Te,Re?{transfer:Re}:null);st(this,_e,{map:$e,hash:Pe,transfers:Re})}get print(){(0,re.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return ce(this,_e)}}_e=new WeakMap,te.PrintAnnotationStorage=ue},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,lr,Me,cr,Oe,ur,Ve,dr,Ie,Wr,rt,Vr,Ge,Gr,mt,hr,Et,qr;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditor=void 0;var re=ne(5),ie=ne(1),se=ne(6);const pe=class pe{constructor(ge){We(this,Ee);We(this,Me);We(this,Ve);We(this,Ie);We(this,rt);We(this,Ge);We(this,mt);We(this,Et);We(this,ue,"");We(this,de,!1);We(this,ae,null);We(this,le,null);We(this,Ae,null);We(this,_e,!1);We(this,me,null);We(this,ve,this.focusin.bind(this));We(this,Se,this.focusout.bind(this));We(this,Te,!1);We(this,Pe,!1);We(this,Re,!1);An(this,"_initialOptions",Object.create(null));An(this,"_uiManager",null);An(this,"_focusEventsAllowed",!0);An(this,"_l10nPromise",null);We(this,$e,!1);We(this,ye,pe._zIndex++);this.constructor===pe&&(0,ie.unreachable)("Cannot initialize AnnotationEditor."),this.parent=ge.parent,this.id=ge.id,this.width=this.height=null,this.pageIndex=ge.parent.pageIndex,this.name=ge.name,this.div=null,this._uiManager=ge.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=ge.isCentered,this._structTreeParentId=null;const{rotation:Ce,rawDims:{pageWidth:xe,pageHeight:Le,pageX:Be,pageY:He}}=this.parent.viewport;this.rotation=Ce,this.pageRotation=(360+Ce-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[xe,Le],this.pageTranslation=[Be,He];const[it,et]=this.parentDimensions;this.x=ge.x/it,this.y=ge.y/et,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,ie.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(ge){const Ce=new he({id:ge.parent.getNextId(),parent:ge.parent,uiManager:ge._uiManager});Ce.annotationElementId=ge.annotationElementId,Ce.deleted=!0,Ce._uiManager.addToAnnotationStorage(Ce)}static initialize(ge,Ce=null){if(pe._l10nPromise||(pe._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(Le=>[Le,ge.get(Le)]))),Ce!=null&&Ce.strings)for(const Le of Ce.strings)pe._l10nPromise.set(Le,ge.get(Le));if(pe._borderLineWidth!==-1)return;const xe=getComputedStyle(document.documentElement);pe._borderLineWidth=parseFloat(xe.getPropertyValue("--outline-width"))||0}static updateDefaultParams(ge,Ce){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(ge){return!1}static paste(ge,Ce){(0,ie.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return ce(this,$e)}set _isDraggable(ge){var Ce;st(this,$e,ge),(Ce=this.div)==null||Ce.classList.toggle("draggable",ge)}center(){const[ge,Ce]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*Ce/(ge*2),this.y+=this.width*ge/(Ce*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*Ce/(ge*2),this.y-=this.width*ge/(Ce*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(ge){this._uiManager.addCommands(ge)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=ce(this,ye)}setParent(ge){ge!==null&&(this.pageIndex=ge.pageIndex,this.pageDimensions=ge.pageDimensions),this.parent=ge}focusin(ge){this._focusEventsAllowed&&(ce(this,Te)?st(this,Te,!1):this.parent.setSelected(this))}focusout(ge){var xe;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const Ce=ge.relatedTarget;Ce!=null&&Ce.closest("#".concat(this.id))||(ge.preventDefault(),(xe=this.parent)!=null&&xe.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(ge,Ce,xe,Le){const[Be,He]=this.parentDimensions;[xe,Le]=this.screenToPageTranslation(xe,Le),this.x=(ge+xe)/Be,this.y=(Ce+Le)/He,this.fixAndSetPosition()}translate(ge,Ce){Ke(this,Ee,lr).call(this,this.parentDimensions,ge,Ce)}translateInPage(ge,Ce){Ke(this,Ee,lr).call(this,this.pageDimensions,ge,Ce),this.div.scrollIntoView({block:"nearest"})}drag(ge,Ce){const[xe,Le]=this.parentDimensions;if(this.x+=ge/xe,this.y+=Ce/Le,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:ot,y:ht}=this.div.getBoundingClientRect();this.parent.findNewParent(this,ot,ht)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:Be,y:He}=this;const[it,et]=Ke(this,Me,cr).call(this);Be+=it,He+=et,this.div.style.left="".concat((100*Be).toFixed(2),"%"),this.div.style.top="".concat((100*He).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[ge,Ce]=this.pageDimensions;let{x:xe,y:Le,width:Be,height:He}=this;switch(Be*=ge,He*=Ce,xe*=ge,Le*=Ce,this.rotation){case 0:xe=Math.max(0,Math.min(ge-Be,xe)),Le=Math.max(0,Math.min(Ce-He,Le));break;case 90:xe=Math.max(0,Math.min(ge-He,xe)),Le=Math.min(Ce,Math.max(Be,Le));break;case 180:xe=Math.min(ge,Math.max(Be,xe)),Le=Math.min(Ce,Math.max(He,Le));break;case 270:xe=Math.min(ge,Math.max(He,xe)),Le=Math.max(0,Math.min(Ce-Be,Le));break}this.x=xe/=ge,this.y=Le/=Ce;const[it,et]=Ke(this,Me,cr).call(this);xe+=it,Le+=et;const{style:ot}=this.div;ot.left="".concat((100*xe).toFixed(2),"%"),ot.top="".concat((100*Le).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(ge,Ce){var xe;return Ke(xe=pe,Oe,ur).call(xe,ge,Ce,this.parentRotation)}pageTranslationToScreen(ge,Ce){var xe;return Ke(xe=pe,Oe,ur).call(xe,ge,Ce,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:ge,pageDimensions:[Ce,xe]}=this,Le=Ce*ge,Be=xe*ge;return ie.FeatureTest.isCSSRoundSupported?[Math.round(Le),Math.round(Be)]:[Le,Be]}setDims(ge,Ce){var Be;const[xe,Le]=this.parentDimensions;this.div.style.width="".concat((100*ge/xe).toFixed(2),"%"),ce(this,_e)||(this.div.style.height="".concat((100*Ce/Le).toFixed(2),"%")),(Be=ce(this,ae))==null||Be.classList.toggle("small",ge<pe.SMALL_EDITOR_SIZE||Ce<pe.SMALL_EDITOR_SIZE)}fixDims(){const{style:ge}=this.div,{height:Ce,width:xe}=ge,Le=xe.endsWith("%"),Be=!ce(this,_e)&&Ce.endsWith("%");if(Le&&Be)return;const[He,it]=this.parentDimensions;Le||(ge.width="".concat((100*parseFloat(xe)/He).toFixed(2),"%")),!ce(this,_e)&&!Be&&(ge.height="".concat((100*parseFloat(Ce)/it).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(ce(this,ae))return;const ge=st(this,ae,document.createElement("button"));ge.className="altText";const Ce=await pe._l10nPromise.get("editor_alt_text_button_label");ge.textContent=Ce,ge.setAttribute("aria-label",Ce),ge.tabIndex="0",ge.addEventListener("contextmenu",se.noContextMenu),ge.addEventListener("pointerdown",xe=>xe.stopPropagation()),ge.addEventListener("click",xe=>{xe.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),ge.addEventListener("keydown",xe=>{xe.target===ge&&xe.key==="Enter"&&(xe.preventDefault(),this._uiManager.editAltText(this))}),Ke(this,mt,hr).call(this),this.div.append(ge),pe.SMALL_EDITOR_SIZE||(pe.SMALL_EDITOR_SIZE=Math.min(128,Math.round(ge.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:ce(this,ue),decorative:ce(this,de)}}set altTextData({altText:ge,decorative:Ce}){ce(this,ue)===ge&&ce(this,de)===Ce||(st(this,ue,ge),st(this,de,Ce),Ke(this,mt,hr).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",ce(this,ve)),this.div.addEventListener("focusout",ce(this,Se));const[ge,Ce]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*Ce/ge).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*ge/Ce).toFixed(2),"%"));const[xe,Le]=this.getInitialTranslation();return this.translate(xe,Le),(0,re.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(ge){const{isMac:Ce}=ie.FeatureTest.platform;if(ge.button!==0||ge.ctrlKey&&Ce){ge.preventDefault();return}st(this,Te,!0),Ke(this,Et,qr).call(this,ge)}moveInDOM(){var ge;(ge=this.parent)==null||ge.moveEditorInDOM(this)}_setParentAndPosition(ge,Ce,xe){ge.changeParent(this),this.x=Ce,this.y=xe,this.fixAndSetPosition()}getRect(ge,Ce){const xe=this.parentScale,[Le,Be]=this.pageDimensions,[He,it]=this.pageTranslation,et=ge/xe,ot=Ce/xe,ht=this.x*Le,pt=this.y*Be,ct=this.width*Le,Pt=this.height*Be;switch(this.rotation){case 0:return[ht+et+He,Be-pt-ot-Pt+it,ht+et+ct+He,Be-pt-ot+it];case 90:return[ht+ot+He,Be-pt+et+it,ht+ot+Pt+He,Be-pt+et+ct+it];case 180:return[ht-et-ct+He,Be-pt+ot+it,ht-et+He,Be-pt+ot+Pt+it];case 270:return[ht-ot-Pt+He,Be-pt-et-ct+it,ht-ot+He,Be-pt-et+it];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(ge,Ce){const[xe,Le,Be,He]=ge,it=Be-xe,et=He-Le;switch(this.rotation){case 0:return[xe,Ce-He,it,et];case 90:return[xe,Ce-Le,et,it];case 180:return[Be,Ce-Le,it,et];case 270:return[Be,Ce-He,et,it];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){st(this,Re,!0)}disableEditMode(){st(this,Re,!1)}isInEditMode(){return ce(this,Re)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var ge,Ce;(ge=this.div)==null||ge.addEventListener("focusin",ce(this,ve)),(Ce=this.div)==null||Ce.addEventListener("focusout",ce(this,Se))}serialize(ge=!1,Ce=null){(0,ie.unreachable)("An editor must be serializable")}static deserialize(ge,Ce,xe){const Le=new this.prototype.constructor({parent:Ce,id:Ce.getNextId(),uiManager:xe});Le.rotation=ge.rotation;const[Be,He]=Le.pageDimensions,[it,et,ot,ht]=Le.getRectInCurrentCoords(ge.rect,He);return Le.x=it/Be,Le.y=et/He,Le.width=ot/Be,Le.height=ht/He,Le}remove(){var ge;this.div.removeEventListener("focusin",ce(this,ve)),this.div.removeEventListener("focusout",ce(this,Se)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(ge=ce(this,ae))==null||ge.remove(),st(this,ae,null),st(this,le,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(Ke(this,Ie,Wr).call(this),ce(this,me).classList.remove("hidden"))}select(){var ge;this.makeResizable(),(ge=this.div)==null||ge.classList.add("selectedEditor")}unselect(){var ge,Ce,xe;(ge=ce(this,me))==null||ge.classList.add("hidden"),(Ce=this.div)==null||Ce.classList.remove("selectedEditor"),(xe=this.div)!=null&&xe.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(ge,Ce){}disableEditing(){ce(this,ae)&&(ce(this,ae).hidden=!0)}enableEditing(){ce(this,ae)&&(ce(this,ae).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return ce(this,Pe)}set isEditing(ge){st(this,Pe,ge),this.parent&&(ge?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(ge,Ce){st(this,_e,!0);const xe=ge/Ce,{style:Le}=this.div;Le.aspectRatio=xe,Le.height="auto"}static get MIN_SIZE(){return 16}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakMap,ye=new WeakMap,Ee=new WeakSet,lr=function([ge,Ce],xe,Le){[xe,Le]=this.screenToPageTranslation(xe,Le),this.x+=xe/ge,this.y+=Le/Ce,this.fixAndSetPosition()},Me=new WeakSet,cr=function(){const[ge,Ce]=this.parentDimensions,{_borderLineWidth:xe}=pe,Le=xe/ge,Be=xe/Ce;switch(this.rotation){case 90:return[-Le,Be];case 180:return[Le,Be];case 270:return[Le,-Be];default:return[-Le,-Be]}},Oe=new WeakSet,ur=function(ge,Ce,xe){switch(xe){case 90:return[Ce,-ge];case 180:return[-ge,-Ce];case 270:return[-Ce,ge];default:return[ge,Ce]}},Ve=new WeakSet,dr=function(ge){switch(ge){case 90:{const[Ce,xe]=this.pageDimensions;return[0,-Ce/xe,xe/Ce,0]}case 180:return[-1,0,0,-1];case 270:{const[Ce,xe]=this.pageDimensions;return[0,Ce/xe,-xe/Ce,0]}default:return[1,0,0,1]}},Ie=new WeakSet,Wr=function(){if(ce(this,me))return;st(this,me,document.createElement("div")),ce(this,me).classList.add("resizers");const ge=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||ge.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const Ce of ge){const xe=document.createElement("div");ce(this,me).append(xe),xe.classList.add("resizer",Ce),xe.addEventListener("pointerdown",Ke(this,rt,Vr).bind(this,Ce)),xe.addEventListener("contextmenu",se.noContextMenu)}this.div.prepend(ce(this,me))},rt=new WeakSet,Vr=function(ge,Ce){Ce.preventDefault();const{isMac:xe}=ie.FeatureTest.platform;if(Ce.button!==0||Ce.ctrlKey&&xe)return;const Le=Ke(this,Ge,Gr).bind(this,ge),Be=this._isDraggable;this._isDraggable=!1;const He={passive:!0,capture:!0};window.addEventListener("pointermove",Le,He);const it=this.x,et=this.y,ot=this.width,ht=this.height,pt=this.parent.div.style.cursor,ct=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(Ce.target).cursor;const Pt=()=>{this._isDraggable=Be,window.removeEventListener("pointerup",Pt),window.removeEventListener("blur",Pt),window.removeEventListener("pointermove",Le,He),this.parent.div.style.cursor=pt,this.div.style.cursor=ct;const It=this.x,vt=this.y,kt=this.width,gt=this.height;It===it&&vt===et&&kt===ot&>===ht||this.addCommands({cmd:()=>{this.width=kt,this.height=gt,this.x=It,this.y=vt;const[tt,nt]=this.parentDimensions;this.setDims(tt*kt,nt*gt),this.fixAndSetPosition()},undo:()=>{this.width=ot,this.height=ht,this.x=it,this.y=et;const[tt,nt]=this.parentDimensions;this.setDims(tt*ot,nt*ht),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Pt),window.addEventListener("blur",Pt)},Ge=new WeakSet,Gr=function(ge,Ce){const[xe,Le]=this.parentDimensions,Be=this.x,He=this.y,it=this.width,et=this.height,ot=pe.MIN_SIZE/xe,ht=pe.MIN_SIZE/Le,pt=yt=>Math.round(yt*1e4)/1e4,ct=Ke(this,Ve,dr).call(this,this.rotation),Pt=(yt,St)=>[ct[0]*yt+ct[2]*St,ct[1]*yt+ct[3]*St],It=Ke(this,Ve,dr).call(this,360-this.rotation),vt=(yt,St)=>[It[0]*yt+It[2]*St,It[1]*yt+It[3]*St];let kt,gt,tt=!1,nt=!1;switch(ge){case"topLeft":tt=!0,kt=(yt,St)=>[0,0],gt=(yt,St)=>[yt,St];break;case"topMiddle":kt=(yt,St)=>[yt/2,0],gt=(yt,St)=>[yt/2,St];break;case"topRight":tt=!0,kt=(yt,St)=>[yt,0],gt=(yt,St)=>[0,St];break;case"middleRight":nt=!0,kt=(yt,St)=>[yt,St/2],gt=(yt,St)=>[0,St/2];break;case"bottomRight":tt=!0,kt=(yt,St)=>[yt,St],gt=(yt,St)=>[0,0];break;case"bottomMiddle":kt=(yt,St)=>[yt/2,St],gt=(yt,St)=>[yt/2,0];break;case"bottomLeft":tt=!0,kt=(yt,St)=>[0,St],gt=(yt,St)=>[yt,0];break;case"middleLeft":nt=!0,kt=(yt,St)=>[0,St/2],gt=(yt,St)=>[yt,St/2];break}const ft=kt(it,et),Tt=gt(it,et);let Ct=Pt(...Tt);const Ht=pt(Be+Ct[0]),Wt=pt(He+Ct[1]);let Ut=1,zt=1,[Vt,jt]=this.screenToPageTranslation(Ce.movementX,Ce.movementY);if([Vt,jt]=vt(Vt/xe,jt/Le),tt){const yt=Math.hypot(it,et);Ut=zt=Math.max(Math.min(Math.hypot(Tt[0]-ft[0]-Vt,Tt[1]-ft[1]-jt)/yt,1/it,1/et),ot/it,ht/et)}else nt?Ut=Math.max(ot,Math.min(1,Math.abs(Tt[0]-ft[0]-Vt)))/it:zt=Math.max(ht,Math.min(1,Math.abs(Tt[1]-ft[1]-jt)))/et;const Gt=pt(it*Ut),dt=pt(et*zt);Ct=Pt(...gt(Gt,dt));const Qe=Ht-Ct[0],Ye=Wt-Ct[1];this.width=Gt,this.height=dt,this.x=Qe,this.y=Ye,this.setDims(xe*Gt,Le*dt),this.fixAndSetPosition()},mt=new WeakSet,hr=async function(){var xe;const ge=ce(this,ae);if(!ge)return;if(!ce(this,ue)&&!ce(this,de)){ge.classList.remove("done"),(xe=ce(this,le))==null||xe.remove();return}pe._l10nPromise.get("editor_alt_text_edit_button_label").then(Le=>{ge.setAttribute("aria-label",Le)});let Ce=ce(this,le);if(!Ce){st(this,le,Ce=document.createElement("span")),Ce.className="tooltip",Ce.setAttribute("role","tooltip");const Le=Ce.id="alt-text-tooltip-".concat(this.id);ge.setAttribute("aria-describedby",Le);const Be=100;ge.addEventListener("mouseenter",()=>{st(this,Ae,setTimeout(()=>{st(this,Ae,null),ce(this,le).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},Be))}),ge.addEventListener("mouseleave",()=>{var He;clearTimeout(ce(this,Ae)),st(this,Ae,null),(He=ce(this,le))==null||He.classList.remove("show")})}ge.classList.add("done"),Ce.innerText=ce(this,de)?await pe._l10nPromise.get("editor_alt_text_decorative_tooltip"):ce(this,ue),Ce.parentNode||ge.append(Ce)},Et=new WeakSet,qr=function(ge){if(!this._isDraggable)return;const Ce=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let xe,Le;Ce&&(xe={passive:!0,capture:!0},Le=He=>{const[it,et]=this.screenToPageTranslation(He.movementX,He.movementY);this._uiManager.dragSelectedEditors(it,et)},window.addEventListener("pointermove",Le,xe));const Be=()=>{if(window.removeEventListener("pointerup",Be),window.removeEventListener("blur",Be),Ce&&window.removeEventListener("pointermove",Le,xe),st(this,Te,!1),!this._uiManager.endDragSession()){const{isMac:He}=ie.FeatureTest.platform;ge.ctrlKey&&!He||ge.shiftKey||ge.metaKey&&He?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",Be),window.addEventListener("blur",Be)},We(pe,Oe),An(pe,"_borderLineWidth",-1),An(pe,"_colorManager",new re.ColorManager),An(pe,"_zIndex",1),An(pe,"SMALL_EDITOR_SIZE",0);let oe=pe;te.AnnotationEditor=oe;class he extends oe{constructor(ge){super(ge),this.annotationElementId=ge.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(ee,te,ne)=>{var _e,me,ve,Se,Te,fr,$e,ye,Ee,Ne,Me,zr,Fe,Ve,qe,Ie,Xe,rt,lt,Ge,ut,mt,wt,Et,De,pe,be,ge,Ce,xe,Le,Be,He,it,et,ot,ht,pt,ct,Pt,It,vt,kt,gt,tt,nt,ft,Xr,Ct,pr,Wt,gr,zt,Xn,jt,mr,dt,_r,Ye,Pn,St,Bn,Qt,Kr,At,Yr,Rt,yr,Nt,Un,bt,br;Object.defineProperty(te,"__esModule",{value:!0}),te.KeyboardManager=te.CommandManager=te.ColorManager=te.AnnotationEditorUIManager=void 0,te.bindEvents=se,te.opacityToHex=oe;var re=ne(1),ie=ne(6);function se(Ue,fe,ke){for(const je of ke)fe.addEventListener(je,Ue[je].bind(Ue))}function oe(Ue){return Math.round(Math.min(255,Math.max(1,255*Ue))).toString(16).padStart(2,"0")}class he{constructor(){We(this,_e,0)}getId(){return"".concat(re.AnnotationEditorPrefix).concat(Nn(this,_e)._++)}}_e=new WeakMap;const Re=class Re{constructor(){We(this,Te);We(this,me,(0,re.getUuid)());We(this,ve,0);We(this,Se,null)}static get _isSVGFittingCanvas(){const fe='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',je=new OffscreenCanvas(1,3).getContext("2d"),ze=new Image;ze.src=fe;const Ze=ze.decode().then(()=>(je.drawImage(ze,0,0,1,1,0,0,1,3),new Uint32Array(je.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,re.shadow)(this,"_isSVGFittingCanvas",Ze)}async getFromFile(fe){const{lastModified:ke,name:je,size:ze,type:Ze}=fe;return Ke(this,Te,fr).call(this,"".concat(ke,"_").concat(je,"_").concat(ze,"_").concat(Ze),fe)}async getFromUrl(fe){return Ke(this,Te,fr).call(this,fe,fe)}async getFromId(fe){ce(this,Se)||st(this,Se,new Map);const ke=ce(this,Se).get(fe);return ke?ke.bitmap?(ke.refCounter+=1,ke):ke.file?this.getFromFile(ke.file):this.getFromUrl(ke.url):null}getSvgUrl(fe){const ke=ce(this,Se).get(fe);return ke!=null&&ke.isSvg?ke.svgUrl:null}deleteId(fe){ce(this,Se)||st(this,Se,new Map);const ke=ce(this,Se).get(fe);ke&&(ke.refCounter-=1,ke.refCounter===0&&(ke.bitmap=null))}isValidId(fe){return fe.startsWith("image_".concat(ce(this,me),"_"))}};me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakSet,fr=async function(fe,ke){ce(this,Se)||st(this,Se,new Map);let je=ce(this,Se).get(fe);if(je===null)return null;if(je!=null&&je.bitmap)return je.refCounter+=1,je;try{je||(je={bitmap:null,id:"image_".concat(ce(this,me),"_").concat(Nn(this,ve)._++),refCounter:0,isSvg:!1});let ze;if(typeof ke=="string"){je.url=ke;const Ze=await fetch(ke);if(!Ze.ok)throw new Error(Ze.statusText);ze=await Ze.blob()}else ze=je.file=ke;if(ze.type==="image/svg+xml"){const Ze=Re._isSVGFittingCanvas,at=new FileReader,_t=new Image,xt=new Promise((Ft,qt)=>{_t.onload=()=>{je.bitmap=_t,je.isSvg=!0,Ft()},at.onload=async()=>{const Mt=je.svgUrl=at.result;_t.src=await Ze?"".concat(Mt,"#svgView(preserveAspectRatio(none))"):Mt},_t.onerror=at.onerror=qt});at.readAsDataURL(ze),await xt}else je.bitmap=await createImageBitmap(ze);je.refCounter=1}catch(ze){console.error(ze),je=null}return ce(this,Se).set(fe,je),je&&ce(this,Se).set(je.id,je),je};let ue=Re;class de{constructor(fe=128){We(this,$e,[]);We(this,ye,!1);We(this,Ee,void 0);We(this,Ne,-1);st(this,Ee,fe)}add({cmd:fe,undo:ke,mustExec:je,type:ze=NaN,overwriteIfSameType:Ze=!1,keepUndo:at=!1}){if(je&&fe(),ce(this,ye))return;const _t={cmd:fe,undo:ke,type:ze};if(ce(this,Ne)===-1){ce(this,$e).length>0&&(ce(this,$e).length=0),st(this,Ne,0),ce(this,$e).push(_t);return}if(Ze&&ce(this,$e)[ce(this,Ne)].type===ze){at&&(_t.undo=ce(this,$e)[ce(this,Ne)].undo),ce(this,$e)[ce(this,Ne)]=_t;return}const xt=ce(this,Ne)+1;xt===ce(this,Ee)?ce(this,$e).splice(0,1):(st(this,Ne,xt),xt<ce(this,$e).length&&ce(this,$e).splice(xt)),ce(this,$e).push(_t)}undo(){ce(this,Ne)!==-1&&(st(this,ye,!0),ce(this,$e)[ce(this,Ne)].undo(),st(this,ye,!1),st(this,Ne,ce(this,Ne)-1))}redo(){ce(this,Ne)<ce(this,$e).length-1&&(st(this,Ne,ce(this,Ne)+1),st(this,ye,!0),ce(this,$e)[ce(this,Ne)].cmd(),st(this,ye,!1))}hasSomethingToUndo(){return ce(this,Ne)!==-1}hasSomethingToRedo(){return ce(this,Ne)<ce(this,$e).length-1}destroy(){st(this,$e,null)}}$e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,Ne=new WeakMap,te.CommandManager=de;class ae{constructor(fe){We(this,Me);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:ke}=re.FeatureTest.platform;for(const[je,ze,Ze={}]of fe)for(const at of je){const _t=at.startsWith("mac+");ke&&_t?(this.callbacks.set(at.slice(4),{callback:ze,options:Ze}),this.allKeys.add(at.split("+").at(-1))):!ke&&!_t&&(this.callbacks.set(at,{callback:ze,options:Ze}),this.allKeys.add(at.split("+").at(-1)))}}exec(fe,ke){if(!this.allKeys.has(ke.key))return;const je=this.callbacks.get(Ke(this,Me,zr).call(this,ke));if(!je)return;const{callback:ze,options:{bubbles:Ze=!1,args:at=[],checker:_t=null}}=je;_t&&!_t(fe,ke)||(ze.bind(fe,...at)(),Ze||(ke.stopPropagation(),ke.preventDefault()))}}Me=new WeakSet,zr=function(fe){fe.altKey&&this.buffer.push("alt"),fe.ctrlKey&&this.buffer.push("ctrl"),fe.metaKey&&this.buffer.push("meta"),fe.shiftKey&&this.buffer.push("shift"),this.buffer.push(fe.key);const ke=this.buffer.join("+");return this.buffer.length=0,ke},te.KeyboardManager=ae;const Oe=class Oe{get _colors(){const fe=new Map([["CanvasText",null],["Canvas",null]]);return(0,ie.getColorValues)(fe),(0,re.shadow)(this,"_colors",fe)}convert(fe){const ke=(0,ie.getRGB)(fe);if(!window.matchMedia("(forced-colors: active)").matches)return ke;for(const[je,ze]of this._colors)if(ze.every((Ze,at)=>Ze===ke[at]))return Oe._colorsMapping.get(je);return ke}getHexCode(fe){const ke=this._colors.get(fe);return ke?re.Util.makeHexColor(...ke):fe}};An(Oe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let le=Oe;te.ColorManager=le;const Ot=class Ot{constructor(fe,ke,je,ze,Ze,at){We(this,ft);We(this,Ct);We(this,Wt);We(this,zt);We(this,jt);We(this,dt);We(this,Ye);We(this,St);We(this,Qt);We(this,At);We(this,Rt);We(this,Nt);We(this,bt);We(this,Fe,null);We(this,Ve,new Map);We(this,qe,new Map);We(this,Ie,null);We(this,Xe,null);We(this,rt,new de);We(this,lt,0);We(this,Ge,new Set);We(this,ut,null);We(this,mt,null);We(this,wt,new Set);We(this,Et,null);We(this,De,new he);We(this,pe,!1);We(this,be,!1);We(this,ge,null);We(this,Ce,re.AnnotationEditorType.NONE);We(this,xe,new Set);We(this,Le,null);We(this,Be,this.blur.bind(this));We(this,He,this.focus.bind(this));We(this,it,this.copy.bind(this));We(this,et,this.cut.bind(this));We(this,ot,this.paste.bind(this));We(this,ht,this.keydown.bind(this));We(this,pt,this.onEditingAction.bind(this));We(this,ct,this.onPageChanging.bind(this));We(this,Pt,this.onScaleChanging.bind(this));We(this,It,this.onRotationChanging.bind(this));We(this,vt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});We(this,kt,[0,0]);We(this,gt,null);We(this,tt,null);We(this,nt,null);st(this,tt,fe),st(this,nt,ke),st(this,Ie,je),this._eventBus=ze,this._eventBus._on("editingaction",ce(this,pt)),this._eventBus._on("pagechanging",ce(this,ct)),this._eventBus._on("scalechanging",ce(this,Pt)),this._eventBus._on("rotationchanging",ce(this,It)),st(this,Xe,Ze.annotationStorage),st(this,Et,Ze.filterFactory),st(this,Le,at),this.viewParameters={realScale:ie.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const fe=Ot.prototype,ke=Ze=>{const{activeElement:at}=document;return at&&ce(Ze,tt).contains(at)&&Ze.hasSomethingToControl()},je=this.TRANSLATE_SMALL,ze=this.TRANSLATE_BIG;return(0,re.shadow)(this,"_keyboardManager",new ae([[["ctrl+a","mac+meta+a"],fe.selectAll],[["ctrl+z","mac+meta+z"],fe.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],fe.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],fe.delete],[["Escape","mac+Escape"],fe.unselectAll],[["ArrowLeft","mac+ArrowLeft"],fe.translateSelectedEditors,{args:[-je,0],checker:ke}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],fe.translateSelectedEditors,{args:[-ze,0],checker:ke}],[["ArrowRight","mac+ArrowRight"],fe.translateSelectedEditors,{args:[je,0],checker:ke}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],fe.translateSelectedEditors,{args:[ze,0],checker:ke}],[["ArrowUp","mac+ArrowUp"],fe.translateSelectedEditors,{args:[0,-je],checker:ke}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],fe.translateSelectedEditors,{args:[0,-ze],checker:ke}],[["ArrowDown","mac+ArrowDown"],fe.translateSelectedEditors,{args:[0,je],checker:ke}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],fe.translateSelectedEditors,{args:[0,ze],checker:ke}]]))}destroy(){Ke(this,zt,Xn).call(this),Ke(this,Ct,pr).call(this),this._eventBus._off("editingaction",ce(this,pt)),this._eventBus._off("pagechanging",ce(this,ct)),this._eventBus._off("scalechanging",ce(this,Pt)),this._eventBus._off("rotationchanging",ce(this,It));for(const fe of ce(this,qe).values())fe.destroy();ce(this,qe).clear(),ce(this,Ve).clear(),ce(this,wt).clear(),st(this,Fe,null),ce(this,xe).clear(),ce(this,rt).destroy(),ce(this,Ie).destroy()}get hcmFilter(){return(0,re.shadow)(this,"hcmFilter",ce(this,Le)?ce(this,Et).addHCMFilter(ce(this,Le).foreground,ce(this,Le).background):"none")}get direction(){return(0,re.shadow)(this,"direction",getComputedStyle(ce(this,tt)).direction)}editAltText(fe){var ke;(ke=ce(this,Ie))==null||ke.editAltText(this,fe)}onPageChanging({pageNumber:fe}){st(this,lt,fe-1)}focusMainContainer(){ce(this,tt).focus()}findParent(fe,ke){for(const je of ce(this,qe).values()){const{x:ze,y:Ze,width:at,height:_t}=je.div.getBoundingClientRect();if(fe>=ze&&fe<=ze+at&&ke>=Ze&&ke<=Ze+_t)return je}return null}disableUserSelect(fe=!1){ce(this,nt).classList.toggle("noUserSelect",fe)}addShouldRescale(fe){ce(this,wt).add(fe)}removeShouldRescale(fe){ce(this,wt).delete(fe)}onScaleChanging({scale:fe}){this.commitOrRemove(),this.viewParameters.realScale=fe*ie.PixelsPerInch.PDF_TO_CSS_UNITS;for(const ke of ce(this,wt))ke.onScaleChanging()}onRotationChanging({pagesRotation:fe}){this.commitOrRemove(),this.viewParameters.rotation=fe}addToAnnotationStorage(fe){!fe.isEmpty()&&ce(this,Xe)&&!ce(this,Xe).has(fe.id)&&ce(this,Xe).setValue(fe.id,fe)}blur(){if(!this.hasSelection)return;const{activeElement:fe}=document;for(const ke of ce(this,xe))if(ke.div.contains(fe)){st(this,ge,[ke,fe]),ke._focusEventsAllowed=!1;break}}focus(){if(!ce(this,ge))return;const[fe,ke]=ce(this,ge);st(this,ge,null),ke.addEventListener("focusin",()=>{fe._focusEventsAllowed=!0},{once:!0}),ke.focus()}addEditListeners(){Ke(this,Wt,gr).call(this),Ke(this,jt,mr).call(this)}removeEditListeners(){Ke(this,zt,Xn).call(this),Ke(this,dt,_r).call(this)}copy(fe){var je;if(fe.preventDefault(),(je=ce(this,Fe))==null||je.commitOrRemove(),!this.hasSelection)return;const ke=[];for(const ze of ce(this,xe)){const Ze=ze.serialize(!0);Ze&&ke.push(Ze)}ke.length!==0&&fe.clipboardData.setData("application/pdfjs",JSON.stringify(ke))}cut(fe){this.copy(fe),this.delete()}paste(fe){fe.preventDefault();const{clipboardData:ke}=fe;for(const Ze of ke.items)for(const at of ce(this,mt))if(at.isHandlingMimeForPasting(Ze.type)){at.paste(Ze,this.currentLayer);return}let je=ke.getData("application/pdfjs");if(!je)return;try{je=JSON.parse(je)}catch(Ze){(0,re.warn)('paste: "'.concat(Ze.message,'".'));return}if(!Array.isArray(je))return;this.unselectAll();const ze=this.currentLayer;try{const Ze=[];for(const xt of je){const Ft=ze.deserialize(xt);if(!Ft)return;Ze.push(Ft)}const at=()=>{for(const xt of Ze)Ke(this,Rt,yr).call(this,xt);Ke(this,bt,br).call(this,Ze)},_t=()=>{for(const xt of Ze)xt.remove()};this.addCommands({cmd:at,undo:_t,mustExec:!0})}catch(Ze){(0,re.warn)('paste: "'.concat(Ze.message,'".'))}}keydown(fe){var ke;(ke=this.getActive())!=null&&ke.shouldGetKeyboardEvents()||Ot._keyboardManager.exec(this,fe)}onEditingAction(fe){["undo","redo","delete","selectAll"].includes(fe.name)&&this[fe.name]()}setEditingState(fe){fe?(Ke(this,ft,Xr).call(this),Ke(this,Wt,gr).call(this),Ke(this,jt,mr).call(this),Ke(this,Ye,Pn).call(this,{isEditing:ce(this,Ce)!==re.AnnotationEditorType.NONE,isEmpty:Ke(this,Nt,Un).call(this),hasSomethingToUndo:ce(this,rt).hasSomethingToUndo(),hasSomethingToRedo:ce(this,rt).hasSomethingToRedo(),hasSelectedEditor:!1})):(Ke(this,Ct,pr).call(this),Ke(this,zt,Xn).call(this),Ke(this,dt,_r).call(this),Ke(this,Ye,Pn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(fe){if(!ce(this,mt)){st(this,mt,fe);for(const ke of ce(this,mt))Ke(this,St,Bn).call(this,ke.defaultPropertiesToUpdate)}}getId(){return ce(this,De).getId()}get currentLayer(){return ce(this,qe).get(ce(this,lt))}getLayer(fe){return ce(this,qe).get(fe)}get currentPageIndex(){return ce(this,lt)}addLayer(fe){ce(this,qe).set(fe.pageIndex,fe),ce(this,pe)?fe.enable():fe.disable()}removeLayer(fe){ce(this,qe).delete(fe.pageIndex)}updateMode(fe,ke=null){if(ce(this,Ce)!==fe){if(st(this,Ce,fe),fe===re.AnnotationEditorType.NONE){this.setEditingState(!1),Ke(this,At,Yr).call(this);return}this.setEditingState(!0),Ke(this,Qt,Kr).call(this),this.unselectAll();for(const je of ce(this,qe).values())je.updateMode(fe);if(ke){for(const je of ce(this,Ve).values())if(je.annotationElementId===ke){this.setSelected(je),je.enterInEditMode();break}}}}updateToolbar(fe){fe!==ce(this,Ce)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:fe})}updateParams(fe,ke){if(ce(this,mt)){if(fe===re.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(fe);return}for(const je of ce(this,xe))je.updateParams(fe,ke);for(const je of ce(this,mt))je.updateDefaultParams(fe,ke)}}enableWaiting(fe=!1){if(ce(this,be)!==fe){st(this,be,fe);for(const ke of ce(this,qe).values())fe?ke.disableClick():ke.enableClick(),ke.div.classList.toggle("waiting",fe)}}getEditors(fe){const ke=[];for(const je of ce(this,Ve).values())je.pageIndex===fe&&ke.push(je);return ke}getEditor(fe){return ce(this,Ve).get(fe)}addEditor(fe){ce(this,Ve).set(fe.id,fe)}removeEditor(fe){var ke;ce(this,Ve).delete(fe.id),this.unselect(fe),(!fe.annotationElementId||!ce(this,Ge).has(fe.annotationElementId))&&((ke=ce(this,Xe))==null||ke.remove(fe.id))}addDeletedAnnotationElement(fe){ce(this,Ge).add(fe.annotationElementId),fe.deleted=!0}isDeletedAnnotationElement(fe){return ce(this,Ge).has(fe)}removeDeletedAnnotationElement(fe){ce(this,Ge).delete(fe.annotationElementId),fe.deleted=!1}setActiveEditor(fe){ce(this,Fe)!==fe&&(st(this,Fe,fe),fe&&Ke(this,St,Bn).call(this,fe.propertiesToUpdate))}toggleSelected(fe){if(ce(this,xe).has(fe)){ce(this,xe).delete(fe),fe.unselect(),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:this.hasSelection});return}ce(this,xe).add(fe),fe.select(),Ke(this,St,Bn).call(this,fe.propertiesToUpdate),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})}setSelected(fe){for(const ke of ce(this,xe))ke!==fe&&ke.unselect();ce(this,xe).clear(),ce(this,xe).add(fe),fe.select(),Ke(this,St,Bn).call(this,fe.propertiesToUpdate),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})}isSelected(fe){return ce(this,xe).has(fe)}unselect(fe){fe.unselect(),ce(this,xe).delete(fe),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return ce(this,xe).size!==0}undo(){ce(this,rt).undo(),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:ce(this,rt).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:Ke(this,Nt,Un).call(this)})}redo(){ce(this,rt).redo(),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:ce(this,rt).hasSomethingToRedo(),isEmpty:Ke(this,Nt,Un).call(this)})}addCommands(fe){ce(this,rt).add(fe),Ke(this,Ye,Pn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:Ke(this,Nt,Un).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const fe=[...ce(this,xe)],ke=()=>{for(const ze of fe)ze.remove()},je=()=>{for(const ze of fe)Ke(this,Rt,yr).call(this,ze)};this.addCommands({cmd:ke,undo:je,mustExec:!0})}commitOrRemove(){var fe;(fe=ce(this,Fe))==null||fe.commitOrRemove()}hasSomethingToControl(){return ce(this,Fe)||this.hasSelection}selectAll(){for(const fe of ce(this,xe))fe.commit();Ke(this,bt,br).call(this,ce(this,Ve).values())}unselectAll(){if(ce(this,Fe)){ce(this,Fe).commitOrRemove();return}if(this.hasSelection){for(const fe of ce(this,xe))fe.unselect();ce(this,xe).clear(),Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(fe,ke,je=!1){if(je||this.commitOrRemove(),!this.hasSelection)return;ce(this,kt)[0]+=fe,ce(this,kt)[1]+=ke;const[ze,Ze]=ce(this,kt),at=[...ce(this,xe)],_t=1e3;ce(this,gt)&&clearTimeout(ce(this,gt)),st(this,gt,setTimeout(()=>{st(this,gt,null),ce(this,kt)[0]=ce(this,kt)[1]=0,this.addCommands({cmd:()=>{for(const xt of at)ce(this,Ve).has(xt.id)&&xt.translateInPage(ze,Ze)},undo:()=>{for(const xt of at)ce(this,Ve).has(xt.id)&&xt.translateInPage(-ze,-Ze)},mustExec:!1})},_t));for(const xt of at)xt.translateInPage(fe,ke)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),st(this,ut,new Map);for(const fe of ce(this,xe))ce(this,ut).set(fe,{savedX:fe.x,savedY:fe.y,savedPageIndex:fe.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!ce(this,ut))return!1;this.disableUserSelect(!1);const fe=ce(this,ut);st(this,ut,null);let ke=!1;for(const[{x:ze,y:Ze,pageIndex:at},_t]of fe)_t.newX=ze,_t.newY=Ze,_t.newPageIndex=at,ke||(ke=ze!==_t.savedX||Ze!==_t.savedY||at!==_t.savedPageIndex);if(!ke)return!1;const je=(ze,Ze,at,_t)=>{if(ce(this,Ve).has(ze.id)){const xt=ce(this,qe).get(_t);xt?ze._setParentAndPosition(xt,Ze,at):(ze.pageIndex=_t,ze.x=Ze,ze.y=at)}};return this.addCommands({cmd:()=>{for(const[ze,{newX:Ze,newY:at,newPageIndex:_t}]of fe)je(ze,Ze,at,_t)},undo:()=>{for(const[ze,{savedX:Ze,savedY:at,savedPageIndex:_t}]of fe)je(ze,Ze,at,_t)},mustExec:!0}),!0}dragSelectedEditors(fe,ke){if(ce(this,ut))for(const je of ce(this,ut).keys())je.drag(fe,ke)}rebuild(fe){if(fe.parent===null){const ke=this.getLayer(fe.pageIndex);ke?(ke.changeParent(fe),ke.addOrRebuild(fe)):(this.addEditor(fe),this.addToAnnotationStorage(fe),fe.rebuild())}else fe.parent.addOrRebuild(fe)}isActive(fe){return ce(this,Fe)===fe}getActive(){return ce(this,Fe)}getMode(){return ce(this,Ce)}get imageManager(){return(0,re.shadow)(this,"imageManager",new ue)}};Fe=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ie=new WeakMap,Xe=new WeakMap,rt=new WeakMap,lt=new WeakMap,Ge=new WeakMap,ut=new WeakMap,mt=new WeakMap,wt=new WeakMap,Et=new WeakMap,De=new WeakMap,pe=new WeakMap,be=new WeakMap,ge=new WeakMap,Ce=new WeakMap,xe=new WeakMap,Le=new WeakMap,Be=new WeakMap,He=new WeakMap,it=new WeakMap,et=new WeakMap,ot=new WeakMap,ht=new WeakMap,pt=new WeakMap,ct=new WeakMap,Pt=new WeakMap,It=new WeakMap,vt=new WeakMap,kt=new WeakMap,gt=new WeakMap,tt=new WeakMap,nt=new WeakMap,ft=new WeakSet,Xr=function(){window.addEventListener("focus",ce(this,He)),window.addEventListener("blur",ce(this,Be))},Ct=new WeakSet,pr=function(){window.removeEventListener("focus",ce(this,He)),window.removeEventListener("blur",ce(this,Be))},Wt=new WeakSet,gr=function(){window.addEventListener("keydown",ce(this,ht),{capture:!0})},zt=new WeakSet,Xn=function(){window.removeEventListener("keydown",ce(this,ht),{capture:!0})},jt=new WeakSet,mr=function(){document.addEventListener("copy",ce(this,it)),document.addEventListener("cut",ce(this,et)),document.addEventListener("paste",ce(this,ot))},dt=new WeakSet,_r=function(){document.removeEventListener("copy",ce(this,it)),document.removeEventListener("cut",ce(this,et)),document.removeEventListener("paste",ce(this,ot))},Ye=new WeakSet,Pn=function(fe){Object.entries(fe).some(([je,ze])=>ce(this,vt)[je]!==ze)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(ce(this,vt),fe)})},St=new WeakSet,Bn=function(fe){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:fe})},Qt=new WeakSet,Kr=function(){if(!ce(this,pe)){st(this,pe,!0);for(const fe of ce(this,qe).values())fe.enable()}},At=new WeakSet,Yr=function(){if(this.unselectAll(),ce(this,pe)){st(this,pe,!1);for(const fe of ce(this,qe).values())fe.disable()}},Rt=new WeakSet,yr=function(fe){const ke=ce(this,qe).get(fe.pageIndex);ke?ke.addOrRebuild(fe):this.addEditor(fe)},Nt=new WeakSet,Un=function(){if(ce(this,Ve).size===0)return!0;if(ce(this,Ve).size===1)for(const fe of ce(this,Ve).values())return fe.isEmpty();return!1},bt=new WeakSet,br=function(fe){ce(this,xe).clear();for(const ke of fe)ke.isEmpty()||(ce(this,xe).add(ke),ke.select());Ke(this,Ye,Pn).call(this,{hasSelectedEditor:!0})},An(Ot,"TRANSLATE_SMALL",1),An(Ot,"TRANSLATE_BIG",10);let Ae=Ot;te.AnnotationEditorUIManager=Ae},(ee,te,ne)=>{var lt,Ge,ut,mt,wt,Et,De,pe,be,ge,Ce,xe,Ln,Be,In,it,Sr,ot,Kn,pt,Yn,Pt,jn,vt,Hn;Object.defineProperty(te,"__esModule",{value:!0}),te.StatTimer=te.RenderingCancelledException=te.PixelsPerInch=te.PageViewport=te.PDFDateString=te.DOMStandardFontDataFactory=te.DOMSVGFactory=te.DOMFilterFactory=te.DOMCanvasFactory=te.DOMCMapReaderFactory=void 0,te.deprecated=Ne,te.getColorValues=Ve,te.getCurrentTransform=qe,te.getCurrentTransformInverse=Ie,te.getFilenameFromUrl=Te,te.getPdfFilenameFromUrl=Pe,te.getRGB=Fe,te.getXfaPageViewport=Oe,te.isDataScheme=ve,te.isPdfFile=Se,te.isValidFetchUrl=$e,te.loadScript=Ee,te.noContextMenu=ye,te.setLayerDimensions=Xe;var re=ne(7),ie=ne(1);const se="http://www.w3.org/2000/svg",rt=class rt{};An(rt,"CSS",96),An(rt,"PDF",72),An(rt,"PDF_TO_CSS_UNITS",rt.CSS/rt.PDF);let oe=rt;te.PixelsPerInch=oe;class he extends re.BaseFilterFactory{constructor({docId:nt,ownerDocument:ft=globalThis.document}={}){super();We(this,xe);We(this,Be);We(this,it);We(this,ot);We(this,pt);We(this,Pt);We(this,vt);We(this,lt,void 0);We(this,Ge,void 0);We(this,ut,void 0);We(this,mt,void 0);We(this,wt,void 0);We(this,Et,void 0);We(this,De,void 0);We(this,pe,void 0);We(this,be,void 0);We(this,ge,void 0);We(this,Ce,0);st(this,ut,nt),st(this,mt,ft)}addFilter(nt){if(!nt)return"none";let ft=ce(this,xe,Ln).get(nt);if(ft)return ft;let Tt,Ct,Ht,Wt;if(nt.length===1){const jt=nt[0],Gt=new Array(256);for(let dt=0;dt<256;dt++)Gt[dt]=jt[dt]/255;Wt=Tt=Ct=Ht=Gt.join(",")}else{const[jt,Gt,dt]=nt,Qe=new Array(256),Ye=new Array(256),yt=new Array(256);for(let St=0;St<256;St++)Qe[St]=jt[St]/255,Ye[St]=Gt[St]/255,yt[St]=dt[St]/255;Tt=Qe.join(","),Ct=Ye.join(","),Ht=yt.join(","),Wt="".concat(Tt).concat(Ct).concat(Ht)}if(ft=ce(this,xe,Ln).get(Wt),ft)return ce(this,xe,Ln).set(nt,ft),ft;const Ut="g_".concat(ce(this,ut),"_transfer_map_").concat(Nn(this,Ce)._++),zt="url(#".concat(Ut,")");ce(this,xe,Ln).set(nt,zt),ce(this,xe,Ln).set(Wt,zt);const Vt=Ke(this,ot,Kn).call(this,Ut);return Ke(this,Pt,jn).call(this,Tt,Ct,Ht,Vt),zt}addHCMFilter(nt,ft){var Gt;const Tt="".concat(nt,"-").concat(ft);if(ce(this,Et)===Tt)return ce(this,De);if(st(this,Et,Tt),st(this,De,"none"),(Gt=ce(this,wt))==null||Gt.remove(),!nt||!ft)return ce(this,De);const Ct=Ke(this,vt,Hn).call(this,nt);nt=ie.Util.makeHexColor(...Ct);const Ht=Ke(this,vt,Hn).call(this,ft);if(ft=ie.Util.makeHexColor(...Ht),ce(this,Be,In).style.color="",nt==="#000000"&&ft==="#ffffff"||nt===ft)return ce(this,De);const Wt=new Array(256);for(let dt=0;dt<=255;dt++){const Qe=dt/255;Wt[dt]=Qe<=.03928?Qe/12.92:((Qe+.055)/1.055)**2.4}const Ut=Wt.join(","),zt="g_".concat(ce(this,ut),"_hcm_filter"),Vt=st(this,pe,Ke(this,ot,Kn).call(this,zt));Ke(this,Pt,jn).call(this,Ut,Ut,Ut,Vt),Ke(this,it,Sr).call(this,Vt);const jt=(dt,Qe)=>{const Ye=Ct[dt]/255,yt=Ht[dt]/255,St=new Array(Qe+1);for(let wn=0;wn<=Qe;wn++)St[wn]=Ye+wn/Qe*(yt-Ye);return St.join(",")};return Ke(this,Pt,jn).call(this,jt(0,5),jt(1,5),jt(2,5),Vt),st(this,De,"url(#".concat(zt,")")),ce(this,De)}addHighlightHCMFilter(nt,ft,Tt,Ct){var yt;const Ht="".concat(nt,"-").concat(ft,"-").concat(Tt,"-").concat(Ct);if(ce(this,be)===Ht)return ce(this,ge);if(st(this,be,Ht),st(this,ge,"none"),(yt=ce(this,pe))==null||yt.remove(),!nt||!ft)return ce(this,ge);const[Wt,Ut]=[nt,ft].map(Ke(this,vt,Hn).bind(this));let zt=Math.round(.2126*Wt[0]+.7152*Wt[1]+.0722*Wt[2]),Vt=Math.round(.2126*Ut[0]+.7152*Ut[1]+.0722*Ut[2]),[jt,Gt]=[Tt,Ct].map(Ke(this,vt,Hn).bind(this));Vt<zt&&([zt,Vt,jt,Gt]=[Vt,zt,Gt,jt]),ce(this,Be,In).style.color="";const dt=(St,wn,Qt)=>{const Je=new Array(256),At=(Vt-zt)/Qt,Lt=St/255,Rt=(wn-St)/(255*Qt);let Dt=0;for(let Nt=0;Nt<=Qt;Nt++){const Zt=Math.round(zt+Nt*At),bt=Lt+Nt*Rt;for(let Kt=Dt;Kt<=Zt;Kt++)Je[Kt]=bt;Dt=Zt+1}for(let Nt=Dt;Nt<256;Nt++)Je[Nt]=Je[Dt-1];return Je.join(",")},Qe="g_".concat(ce(this,ut),"_hcm_highlight_filter"),Ye=st(this,pe,Ke(this,ot,Kn).call(this,Qe));return Ke(this,it,Sr).call(this,Ye),Ke(this,Pt,jn).call(this,dt(jt[0],Gt[0],5),dt(jt[1],Gt[1],5),dt(jt[2],Gt[2],5),Ye),st(this,ge,"url(#".concat(Qe,")")),ce(this,ge)}destroy(nt=!1){nt&&(ce(this,De)||ce(this,ge))||(ce(this,Ge)&&(ce(this,Ge).parentNode.parentNode.remove(),st(this,Ge,null)),ce(this,lt)&&(ce(this,lt).clear(),st(this,lt,null)),st(this,Ce,0))}}lt=new WeakMap,Ge=new WeakMap,ut=new WeakMap,mt=new WeakMap,wt=new WeakMap,Et=new WeakMap,De=new WeakMap,pe=new WeakMap,be=new WeakMap,ge=new WeakMap,Ce=new WeakMap,xe=new WeakSet,Ln=function(){return ce(this,lt)||st(this,lt,new Map)},Be=new WeakSet,In=function(){if(!ce(this,Ge)){const nt=ce(this,mt).createElement("div"),{style:ft}=nt;ft.visibility="hidden",ft.contain="strict",ft.width=ft.height=0,ft.position="absolute",ft.top=ft.left=0,ft.zIndex=-1;const Tt=ce(this,mt).createElementNS(se,"svg");Tt.setAttribute("width",0),Tt.setAttribute("height",0),st(this,Ge,ce(this,mt).createElementNS(se,"defs")),nt.append(Tt),Tt.append(ce(this,Ge)),ce(this,mt).body.append(nt)}return ce(this,Ge)},it=new WeakSet,Sr=function(nt){const ft=ce(this,mt).createElementNS(se,"feColorMatrix");ft.setAttribute("type","matrix"),ft.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),nt.append(ft)},ot=new WeakSet,Kn=function(nt){const ft=ce(this,mt).createElementNS(se,"filter");return ft.setAttribute("color-interpolation-filters","sRGB"),ft.setAttribute("id",nt),ce(this,Be,In).append(ft),ft},pt=new WeakSet,Yn=function(nt,ft,Tt){const Ct=ce(this,mt).createElementNS(se,ft);Ct.setAttribute("type","discrete"),Ct.setAttribute("tableValues",Tt),nt.append(Ct)},Pt=new WeakSet,jn=function(nt,ft,Tt,Ct){const Ht=ce(this,mt).createElementNS(se,"feComponentTransfer");Ct.append(Ht),Ke(this,pt,Yn).call(this,Ht,"feFuncR",nt),Ke(this,pt,Yn).call(this,Ht,"feFuncG",ft),Ke(this,pt,Yn).call(this,Ht,"feFuncB",Tt)},vt=new WeakSet,Hn=function(nt){return ce(this,Be,In).style.color=nt,Fe(getComputedStyle(ce(this,Be,In)).getPropertyValue("color"))},te.DOMFilterFactory=he;class ue extends re.BaseCanvasFactory{constructor({ownerDocument:tt=globalThis.document}={}){super(),this._document=tt}_createCanvas(tt,nt){const ft=this._document.createElement("canvas");return ft.width=tt,ft.height=nt,ft}}te.DOMCanvasFactory=ue;async function de(gt,tt=!1){if($e(gt,document.baseURI)){const nt=await fetch(gt);if(!nt.ok)throw new Error(nt.statusText);return tt?new Uint8Array(await nt.arrayBuffer()):(0,ie.stringToBytes)(await nt.text())}return new Promise((nt,ft)=>{const Tt=new XMLHttpRequest;Tt.open("GET",gt,!0),tt&&(Tt.responseType="arraybuffer"),Tt.onreadystatechange=()=>{if(Tt.readyState===XMLHttpRequest.DONE){if(Tt.status===200||Tt.status===0){let Ct;if(tt&&Tt.response?Ct=new Uint8Array(Tt.response):!tt&&Tt.responseText&&(Ct=(0,ie.stringToBytes)(Tt.responseText)),Ct){nt(Ct);return}}ft(new Error(Tt.statusText))}},Tt.send(null)})}class ae extends re.BaseCMapReaderFactory{_fetchData(tt,nt){return de(tt,this.isCompressed).then(ft=>({cMapData:ft,compressionType:nt}))}}te.DOMCMapReaderFactory=ae;class le extends re.BaseStandardFontDataFactory{_fetchData(tt){return de(tt,!0)}}te.DOMStandardFontDataFactory=le;class Ae extends re.BaseSVGFactory{_createSVG(tt){return document.createElementNS(se,tt)}}te.DOMSVGFactory=Ae;class _e{constructor({viewBox:tt,scale:nt,rotation:ft,offsetX:Tt=0,offsetY:Ct=0,dontFlip:Ht=!1}){this.viewBox=tt,this.scale=nt,this.rotation=ft,this.offsetX=Tt,this.offsetY=Ct;const Wt=(tt[2]+tt[0])/2,Ut=(tt[3]+tt[1])/2;let zt,Vt,jt,Gt;switch(ft%=360,ft<0&&(ft+=360),ft){case 180:zt=-1,Vt=0,jt=0,Gt=1;break;case 90:zt=0,Vt=1,jt=1,Gt=0;break;case 270:zt=0,Vt=-1,jt=-1,Gt=0;break;case 0:zt=1,Vt=0,jt=0,Gt=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Ht&&(jt=-jt,Gt=-Gt);let dt,Qe,Ye,yt;zt===0?(dt=Math.abs(Ut-tt[1])*nt+Tt,Qe=Math.abs(Wt-tt[0])*nt+Ct,Ye=(tt[3]-tt[1])*nt,yt=(tt[2]-tt[0])*nt):(dt=Math.abs(Wt-tt[0])*nt+Tt,Qe=Math.abs(Ut-tt[1])*nt+Ct,Ye=(tt[2]-tt[0])*nt,yt=(tt[3]-tt[1])*nt),this.transform=[zt*nt,Vt*nt,jt*nt,Gt*nt,dt-zt*nt*Wt-jt*nt*Ut,Qe-Vt*nt*Wt-Gt*nt*Ut],this.width=Ye,this.height=yt}get rawDims(){const{viewBox:tt}=this;return(0,ie.shadow)(this,"rawDims",{pageWidth:tt[2]-tt[0],pageHeight:tt[3]-tt[1],pageX:tt[0],pageY:tt[1]})}clone({scale:tt=this.scale,rotation:nt=this.rotation,offsetX:ft=this.offsetX,offsetY:Tt=this.offsetY,dontFlip:Ct=!1}={}){return new _e({viewBox:this.viewBox.slice(),scale:tt,rotation:nt,offsetX:ft,offsetY:Tt,dontFlip:Ct})}convertToViewportPoint(tt,nt){return ie.Util.applyTransform([tt,nt],this.transform)}convertToViewportRectangle(tt){const nt=ie.Util.applyTransform([tt[0],tt[1]],this.transform),ft=ie.Util.applyTransform([tt[2],tt[3]],this.transform);return[nt[0],nt[1],ft[0],ft[1]]}convertToPdfPoint(tt,nt){return ie.Util.applyInverseTransform([tt,nt],this.transform)}}te.PageViewport=_e;class me extends ie.BaseException{constructor(tt,nt=0){super(tt,"RenderingCancelledException"),this.extraDelay=nt}}te.RenderingCancelledException=me;function ve(gt){const tt=gt.length;let nt=0;for(;nt<tt&>[nt].trim()==="";)nt++;return gt.substring(nt,nt+5).toLowerCase()==="data:"}function Se(gt){return typeof gt=="string"&&/\.pdf$/i.test(gt)}function Te(gt,tt=!1){return tt||([gt]=gt.split(/[#?]/,1)),gt.substring(gt.lastIndexOf("/")+1)}function Pe(gt,tt="document.pdf"){if(typeof gt!="string")return tt;if(ve(gt))return(0,ie.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),tt;const nt=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,ft=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Tt=nt.exec(gt);let Ct=ft.exec(Tt[1])||ft.exec(Tt[2])||ft.exec(Tt[3]);if(Ct&&(Ct=Ct[0],Ct.includes("%")))try{Ct=ft.exec(decodeURIComponent(Ct))[0]}catch{}return Ct||tt}class Re{constructor(){An(this,"started",Object.create(null));An(this,"times",[])}time(tt){tt in this.started&&(0,ie.warn)("Timer is already running for ".concat(tt)),this.started[tt]=Date.now()}timeEnd(tt){tt in this.started||(0,ie.warn)("Timer has not been started for ".concat(tt)),this.times.push({name:tt,start:this.started[tt],end:Date.now()}),delete this.started[tt]}toString(){const tt=[];let nt=0;for(const{name:ft}of this.times)nt=Math.max(ft.length,nt);for(const{name:ft,start:Tt,end:Ct}of this.times)tt.push("".concat(ft.padEnd(nt)," ").concat(Ct-Tt,"ms\n"));return tt.join("")}}te.StatTimer=Re;function $e(gt,tt){try{const{protocol:nt}=tt?new URL(gt,tt):new URL(gt);return nt==="http:"||nt==="https:"}catch{return!1}}function ye(gt){gt.preventDefault()}function Ee(gt,tt=!1){return new Promise((nt,ft)=>{const Tt=document.createElement("script");Tt.src=gt,Tt.onload=function(Ct){tt&&Tt.remove(),nt(Ct)},Tt.onerror=function(){ft(new Error("Cannot load script at: ".concat(Tt.src)))},(document.head||document.documentElement).append(Tt)})}function Ne(gt){console.log("Deprecated API usage: "+gt)}let Me;class we{static toDateObject(tt){if(!tt||typeof tt!="string")return null;Me||(Me=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const nt=Me.exec(tt);if(!nt)return null;const ft=parseInt(nt[1],10);let Tt=parseInt(nt[2],10);Tt=Tt>=1&&Tt<=12?Tt-1:0;let Ct=parseInt(nt[3],10);Ct=Ct>=1&&Ct<=31?Ct:1;let Ht=parseInt(nt[4],10);Ht=Ht>=0&&Ht<=23?Ht:0;let Wt=parseInt(nt[5],10);Wt=Wt>=0&&Wt<=59?Wt:0;let Ut=parseInt(nt[6],10);Ut=Ut>=0&&Ut<=59?Ut:0;const zt=nt[7]||"Z";let Vt=parseInt(nt[8],10);Vt=Vt>=0&&Vt<=23?Vt:0;let jt=parseInt(nt[9],10)||0;return jt=jt>=0&&jt<=59?jt:0,zt==="-"?(Ht+=Vt,Wt+=jt):zt==="+"&&(Ht-=Vt,Wt-=jt),new Date(Date.UTC(ft,Tt,Ct,Ht,Wt,Ut))}}te.PDFDateString=we;function Oe(gt,{scale:tt=1,rotation:nt=0}){const{width:ft,height:Tt}=gt.attributes.style,Ct=[0,0,parseInt(ft),parseInt(Tt)];return new _e({viewBox:Ct,scale:tt,rotation:nt})}function Fe(gt){if(gt.startsWith("#")){const tt=parseInt(gt.slice(1),16);return[(tt&16711680)>>16,(tt&65280)>>8,tt&255]}return gt.startsWith("rgb(")?gt.slice(4,-1).split(",").map(tt=>parseInt(tt)):gt.startsWith("rgba(")?gt.slice(5,-1).split(",").map(tt=>parseInt(tt)).slice(0,3):((0,ie.warn)('Not a valid color format: "'.concat(gt,'"')),[0,0,0])}function Ve(gt){const tt=document.createElement("span");tt.style.visibility="hidden",document.body.append(tt);for(const nt of gt.keys()){tt.style.color=nt;const ft=window.getComputedStyle(tt).color;gt.set(nt,Fe(ft))}tt.remove()}function qe(gt){const{a:tt,b:nt,c:ft,d:Tt,e:Ct,f:Ht}=gt.getTransform();return[tt,nt,ft,Tt,Ct,Ht]}function Ie(gt){const{a:tt,b:nt,c:ft,d:Tt,e:Ct,f:Ht}=gt.getTransform().invertSelf();return[tt,nt,ft,Tt,Ct,Ht]}function Xe(gt,tt,nt=!1,ft=!0){if(tt instanceof _e){const{pageWidth:Tt,pageHeight:Ct}=tt.rawDims,{style:Ht}=gt,Wt=ie.FeatureTest.isCSSRoundSupported,Ut="var(--scale-factor) * ".concat(Tt,"px"),zt="var(--scale-factor) * ".concat(Ct,"px"),Vt=Wt?"round(".concat(Ut,", 1px)"):"calc(".concat(Ut,")"),jt=Wt?"round(".concat(zt,", 1px)"):"calc(".concat(zt,")");!nt||tt.rotation%180===0?(Ht.width=Vt,Ht.height=jt):(Ht.width=jt,Ht.height=Vt)}ft&>.setAttribute("data-main-rotation",tt.rotation)}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.BaseStandardFontDataFactory=te.BaseSVGFactory=te.BaseFilterFactory=te.BaseCanvasFactory=te.BaseCMapReaderFactory=void 0;var re=ne(1);class ie{constructor(){this.constructor===ie&&(0,re.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(ae){return"none"}addHCMFilter(ae,le){return"none"}addHighlightHCMFilter(ae,le,Ae,_e){return"none"}destroy(ae=!1){}}te.BaseFilterFactory=ie;class se{constructor(){this.constructor===se&&(0,re.unreachable)("Cannot initialize BaseCanvasFactory.")}create(ae,le){if(ae<=0||le<=0)throw new Error("Invalid canvas size");const Ae=this._createCanvas(ae,le);return{canvas:Ae,context:Ae.getContext("2d")}}reset(ae,le,Ae){if(!ae.canvas)throw new Error("Canvas is not specified");if(le<=0||Ae<=0)throw new Error("Invalid canvas size");ae.canvas.width=le,ae.canvas.height=Ae}destroy(ae){if(!ae.canvas)throw new Error("Canvas is not specified");ae.canvas.width=0,ae.canvas.height=0,ae.canvas=null,ae.context=null}_createCanvas(ae,le){(0,re.unreachable)("Abstract method `_createCanvas` called.")}}te.BaseCanvasFactory=se;class oe{constructor({baseUrl:ae=null,isCompressed:le=!0}){this.constructor===oe&&(0,re.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=ae,this.isCompressed=le}async fetch({name:ae}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!ae)throw new Error("CMap name must be specified.");const le=this.baseUrl+ae+(this.isCompressed?".bcmap":""),Ae=this.isCompressed?re.CMapCompressionType.BINARY:re.CMapCompressionType.NONE;return this._fetchData(le,Ae).catch(_e=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(le))})}_fetchData(ae,le){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseCMapReaderFactory=oe;class he{constructor({baseUrl:ae=null}){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=ae}async fetch({filename:ae}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!ae)throw new Error("Font filename must be specified.");const le="".concat(this.baseUrl).concat(ae);return this._fetchData(le).catch(Ae=>{throw new Error("Unable to load font data at: ".concat(le))})}_fetchData(ae){(0,re.unreachable)("Abstract method `_fetchData` called.")}}te.BaseStandardFontDataFactory=he;class ue{constructor(){this.constructor===ue&&(0,re.unreachable)("Cannot initialize BaseSVGFactory.")}create(ae,le,Ae=!1){if(ae<=0||le<=0)throw new Error("Invalid SVG dimensions");const _e=this._createSVG("svg:svg");return _e.setAttribute("version","1.1"),Ae||(_e.setAttribute("width","".concat(ae,"px")),_e.setAttribute("height","".concat(le,"px"))),_e.setAttribute("preserveAspectRatio","none"),_e.setAttribute("viewBox","0 0 ".concat(ae," ").concat(le)),_e}createElement(ae){if(typeof ae!="string")throw new Error("Invalid SVG element type");return this._createSVG(ae)}_createSVG(ae){(0,re.unreachable)("Abstract method `_createSVG` called.")}}te.BaseSVGFactory=ue},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.MurmurHash3_64=void 0;var re=ne(1);const ie=3285377520,se=4294901760,oe=65535;class he{constructor(de){this.h1=de?de&4294967295:ie,this.h2=de?de&4294967295:ie}update(de){let ae,le;if(typeof de=="string"){ae=new Uint8Array(de.length*2),le=0;for(let Ne=0,Me=de.length;Ne<Me;Ne++){const we=de.charCodeAt(Ne);we<=255?ae[le++]=we:(ae[le++]=we>>>8,ae[le++]=we&255)}}else if((0,re.isArrayBuffer)(de))ae=de.slice(),le=ae.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const Ae=le>>2,_e=le-Ae*4,me=new Uint32Array(ae.buffer,0,Ae);let ve=0,Se=0,Te=this.h1,Pe=this.h2;const Re=3432918353,$e=461845907,ye=Re&oe,Ee=$e&oe;for(let Ne=0;Ne<Ae;Ne++)Ne&1?(ve=me[Ne],ve=ve*Re&se|ve*ye&oe,ve=ve<<15|ve>>>17,ve=ve*$e&se|ve*Ee&oe,Te^=ve,Te=Te<<13|Te>>>19,Te=Te*5+3864292196):(Se=me[Ne],Se=Se*Re&se|Se*ye&oe,Se=Se<<15|Se>>>17,Se=Se*$e&se|Se*Ee&oe,Pe^=Se,Pe=Pe<<13|Pe>>>19,Pe=Pe*5+3864292196);switch(ve=0,_e){case 3:ve^=ae[Ae*4+2]<<16;case 2:ve^=ae[Ae*4+1]<<8;case 1:ve^=ae[Ae*4],ve=ve*Re&se|ve*ye&oe,ve=ve<<15|ve>>>17,ve=ve*$e&se|ve*Ee&oe,Ae&1?Te^=ve:Pe^=ve}this.h1=Te,this.h2=Pe}hexdigest(){let de=this.h1,ae=this.h2;return de^=ae>>>1,de=de*3981806797&se|de*36045&oe,ae=ae*4283543511&se|((ae<<16|de>>>16)*2950163797&se)>>>16,de^=ae>>>1,de=de*444984403&se|de*60499&oe,ae=ae*3301882366&se|((ae<<16|de>>>16)*3120437893&se)>>>16,de^=ae>>>1,(de>>>0).toString(16).padStart(8,"0")+(ae>>>0).toString(16).padStart(8,"0")}}te.MurmurHash3_64=he},(ee,te,ne)=>{var oe;Object.defineProperty(te,"__esModule",{value:!0}),te.FontLoader=te.FontFaceObject=void 0;var re=ne(1);class ie{constructor({ownerDocument:ue=globalThis.document,styleElement:de=null}){We(this,oe,new Set);this._document=ue,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(ue){this.nativeFontFaces.add(ue),this._document.fonts.add(ue)}removeNativeFontFace(ue){this.nativeFontFaces.delete(ue),this._document.fonts.delete(ue)}insertRule(ue){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const de=this.styleElement.sheet;de.insertRule(ue,de.cssRules.length)}clear(){for(const ue of this.nativeFontFaces)this._document.fonts.delete(ue);this.nativeFontFaces.clear(),ce(this,oe).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(ue){if(!(!ue||ce(this,oe).has(ue.loadedName))){if((0,re.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:de,src:ae,style:le}=ue,Ae=new FontFace(de,ae,le);this.addNativeFontFace(Ae);try{await Ae.load(),ce(this,oe).add(de)}catch{(0,re.warn)("Cannot load system font: ".concat(ue.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(Ae)}return}(0,re.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(ue){if(ue.attached||ue.missingFile&&!ue.systemFontInfo)return;if(ue.attached=!0,ue.systemFontInfo){await this.loadSystemFont(ue.systemFontInfo);return}if(this.isFontLoadingAPISupported){const ae=ue.createNativeFontFace();if(ae){this.addNativeFontFace(ae);try{await ae.loaded}catch(le){throw(0,re.warn)("Failed to load font '".concat(ae.family,"': '").concat(le,"'.")),ue.disableFontFace=!0,le}}return}const de=ue.createFontFaceRule();if(de){if(this.insertRule(de),this.isSyncFontLoadingSupported)return;await new Promise(ae=>{const le=this._queueLoadingCallback(ae);this._prepareFontLoadEvent(ue,le)})}}get isFontLoadingAPISupported(){var de;const ue=!!((de=this._document)!=null&&de.fonts);return(0,re.shadow)(this,"isFontLoadingAPISupported",ue)}get isSyncFontLoadingSupported(){let ue=!1;return(re.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(ue=!0),(0,re.shadow)(this,"isSyncFontLoadingSupported",ue)}_queueLoadingCallback(ue){function de(){for((0,re.assert)(!le.done,"completeRequest() cannot be called twice."),le.done=!0;ae.length>0&&ae[0].done;){const Ae=ae.shift();setTimeout(Ae.callback,0)}}const{loadingRequests:ae}=this,le={done:!1,complete:de,callback:ue};return ae.push(le),le}get _loadTestFont(){const ue=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,re.shadow)(this,"_loadTestFont",ue)}_prepareFontLoadEvent(ue,de){function ae(Fe,Ve){return Fe.charCodeAt(Ve)<<24|Fe.charCodeAt(Ve+1)<<16|Fe.charCodeAt(Ve+2)<<8|Fe.charCodeAt(Ve+3)&255}function le(Fe,Ve,qe,Ie){const Xe=Fe.substring(0,Ve),rt=Fe.substring(Ve+qe);return Xe+Ie+rt}let Ae,_e;const me=this._document.createElement("canvas");me.width=1,me.height=1;const ve=me.getContext("2d");let Se=0;function Te(Fe,Ve){if(++Se>30){(0,re.warn)("Load test font never loaded."),Ve();return}if(ve.font="30px "+Fe,ve.fillText(".",0,20),ve.getImageData(0,0,1,1).data[3]>0){Ve();return}setTimeout(Te.bind(null,Fe,Ve))}const Pe="lt".concat(Date.now()).concat(this.loadTestFontId++);let Re=this._loadTestFont;Re=le(Re,976,Pe.length,Pe);const ye=16,Ee=1482184792;let Ne=ae(Re,ye);for(Ae=0,_e=Pe.length-3;Ae<_e;Ae+=4)Ne=Ne-Ee+ae(Pe,Ae)|0;Ae<Pe.length&&(Ne=Ne-Ee+ae(Pe+"XXX",Ae)|0),Re=le(Re,ye,4,(0,re.string32)(Ne));const Me="url(data:font/opentype;base64,".concat(btoa(Re),");"),we='@font-face {font-family:"'.concat(Pe,'";src:').concat(Me,"}");this.insertRule(we);const Oe=this._document.createElement("div");Oe.style.visibility="hidden",Oe.style.width=Oe.style.height="10px",Oe.style.position="absolute",Oe.style.top=Oe.style.left="0px";for(const Fe of[ue.loadedName,Pe]){const Ve=this._document.createElement("span");Ve.textContent="Hi",Ve.style.fontFamily=Fe,Oe.append(Ve)}this._document.body.append(Oe),Te(Pe,()=>{Oe.remove(),de.complete()})}}oe=new WeakMap,te.FontLoader=ie;class se{constructor(ue,{isEvalSupported:de=!0,disableFontFace:ae=!1,ignoreErrors:le=!1,inspectFont:Ae=null}){this.compiledGlyphs=Object.create(null);for(const _e in ue)this[_e]=ue[_e];this.isEvalSupported=de!==!1,this.disableFontFace=ae===!0,this.ignoreErrors=le===!0,this._inspectFont=Ae}createNativeFontFace(){var de;if(!this.data||this.disableFontFace)return null;let ue;if(!this.cssFontInfo)ue=new FontFace(this.loadedName,this.data,{});else{const ae={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(ae.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),ue=new FontFace(this.cssFontInfo.fontFamily,this.data,ae)}return(de=this._inspectFont)==null||de.call(this,this),ue}createFontFaceRule(){var le;if(!this.data||this.disableFontFace)return null;const ue=(0,re.bytesToString)(this.data),de="url(data:".concat(this.mimetype,";base64,").concat(btoa(ue),");");let ae;if(!this.cssFontInfo)ae='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(de,"}");else{let Ae="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(Ae+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),ae='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(Ae,"src:").concat(de,"}")}return(le=this._inspectFont)==null||le.call(this,this,de),ae}getPathGenerator(ue,de){if(this.compiledGlyphs[de]!==void 0)return this.compiledGlyphs[de];let ae;try{ae=ue.get(this.loadedName+"_path_"+de)}catch(le){if(!this.ignoreErrors)throw le;return(0,re.warn)('getPathGenerator - ignoring character: "'.concat(le,'".')),this.compiledGlyphs[de]=function(Ae,_e){}}if(this.isEvalSupported&&re.FeatureTest.isEvalSupported){const le=[];for(const Ae of ae){const _e=Ae.args!==void 0?Ae.args.join(","):"";le.push("c.",Ae.cmd,"(",_e,");\n")}return this.compiledGlyphs[de]=new Function("c","size",le.join(""))}return this.compiledGlyphs[de]=function(le,Ae){for(const _e of ae)_e.cmd==="scale"&&(_e.args=[Ae,-Ae]),le[_e.cmd].apply(le,_e.args)}}}te.FontFaceObject=se},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NodeStandardFontDataFactory=te.NodeFilterFactory=te.NodeCanvasFactory=te.NodeCMapReaderFactory=void 0;var re=ne(7);ne(1);const ie=function(de){return new Promise((ae,le)=>{require$$5.readFile(de,(_e,me)=>{if(_e||!me){le(new Error(_e));return}ae(new Uint8Array(me))})})};class se extends re.BaseFilterFactory{}te.NodeFilterFactory=se;class oe extends re.BaseCanvasFactory{_createCanvas(ae,le){return require$$5.createCanvas(ae,le)}}te.NodeCanvasFactory=oe;class he extends re.BaseCMapReaderFactory{_fetchData(ae,le){return ie(ae).then(Ae=>({cMapData:Ae,compressionType:le}))}}te.NodeCMapReaderFactory=he;class ue extends re.BaseStandardFontDataFactory{_fetchData(ae){return ie(ae)}}te.NodeStandardFontDataFactory=ue},(ee,te,ne)=>{var Ge,vr,mt,wr;Object.defineProperty(te,"__esModule",{value:!0}),te.CanvasGraphics=void 0;var re=ne(1),ie=ne(6),se=ne(12),oe=ne(13);const he=16,ue=100,de=4096,ae=15,le=10,Ae=1e3,_e=16;function me(De,pe){if(De._removeMirroring)throw new Error("Context is already forwarding operations.");De.__originalSave=De.save,De.__originalRestore=De.restore,De.__originalRotate=De.rotate,De.__originalScale=De.scale,De.__originalTranslate=De.translate,De.__originalTransform=De.transform,De.__originalSetTransform=De.setTransform,De.__originalResetTransform=De.resetTransform,De.__originalClip=De.clip,De.__originalMoveTo=De.moveTo,De.__originalLineTo=De.lineTo,De.__originalBezierCurveTo=De.bezierCurveTo,De.__originalRect=De.rect,De.__originalClosePath=De.closePath,De.__originalBeginPath=De.beginPath,De._removeMirroring=()=>{De.save=De.__originalSave,De.restore=De.__originalRestore,De.rotate=De.__originalRotate,De.scale=De.__originalScale,De.translate=De.__originalTranslate,De.transform=De.__originalTransform,De.setTransform=De.__originalSetTransform,De.resetTransform=De.__originalResetTransform,De.clip=De.__originalClip,De.moveTo=De.__originalMoveTo,De.lineTo=De.__originalLineTo,De.bezierCurveTo=De.__originalBezierCurveTo,De.rect=De.__originalRect,De.closePath=De.__originalClosePath,De.beginPath=De.__originalBeginPath,delete De._removeMirroring},De.save=function(){pe.save(),this.__originalSave()},De.restore=function(){pe.restore(),this.__originalRestore()},De.translate=function(ge,Ce){pe.translate(ge,Ce),this.__originalTranslate(ge,Ce)},De.scale=function(ge,Ce){pe.scale(ge,Ce),this.__originalScale(ge,Ce)},De.transform=function(ge,Ce,xe,Le,Be,He){pe.transform(ge,Ce,xe,Le,Be,He),this.__originalTransform(ge,Ce,xe,Le,Be,He)},De.setTransform=function(ge,Ce,xe,Le,Be,He){pe.setTransform(ge,Ce,xe,Le,Be,He),this.__originalSetTransform(ge,Ce,xe,Le,Be,He)},De.resetTransform=function(){pe.resetTransform(),this.__originalResetTransform()},De.rotate=function(ge){pe.rotate(ge),this.__originalRotate(ge)},De.clip=function(ge){pe.clip(ge),this.__originalClip(ge)},De.moveTo=function(be,ge){pe.moveTo(be,ge),this.__originalMoveTo(be,ge)},De.lineTo=function(be,ge){pe.lineTo(be,ge),this.__originalLineTo(be,ge)},De.bezierCurveTo=function(be,ge,Ce,xe,Le,Be){pe.bezierCurveTo(be,ge,Ce,xe,Le,Be),this.__originalBezierCurveTo(be,ge,Ce,xe,Le,Be)},De.rect=function(be,ge,Ce,xe){pe.rect(be,ge,Ce,xe),this.__originalRect(be,ge,Ce,xe)},De.closePath=function(){pe.closePath(),this.__originalClosePath()},De.beginPath=function(){pe.beginPath(),this.__originalBeginPath()}}class ve{constructor(pe){this.canvasFactory=pe,this.cache=Object.create(null)}getCanvas(pe,be,ge){let Ce;return this.cache[pe]!==void 0?(Ce=this.cache[pe],this.canvasFactory.reset(Ce,be,ge)):(Ce=this.canvasFactory.create(be,ge),this.cache[pe]=Ce),Ce}delete(pe){delete this.cache[pe]}clear(){for(const pe in this.cache){const be=this.cache[pe];this.canvasFactory.destroy(be),delete this.cache[pe]}}}function Se(De,pe,be,ge,Ce,xe,Le,Be,He,it){const[et,ot,ht,pt,ct,Pt]=(0,ie.getCurrentTransform)(De);if(ot===0&&ht===0){const kt=Le*et+ct,gt=Math.round(kt),tt=Be*pt+Pt,nt=Math.round(tt),ft=(Le+He)*et+ct,Tt=Math.abs(Math.round(ft)-gt)||1,Ct=(Be+it)*pt+Pt,Ht=Math.abs(Math.round(Ct)-nt)||1;return De.setTransform(Math.sign(et),0,0,Math.sign(pt),gt,nt),De.drawImage(pe,be,ge,Ce,xe,0,0,Tt,Ht),De.setTransform(et,ot,ht,pt,ct,Pt),[Tt,Ht]}if(et===0&&pt===0){const kt=Be*ht+ct,gt=Math.round(kt),tt=Le*ot+Pt,nt=Math.round(tt),ft=(Be+it)*ht+ct,Tt=Math.abs(Math.round(ft)-gt)||1,Ct=(Le+He)*ot+Pt,Ht=Math.abs(Math.round(Ct)-nt)||1;return De.setTransform(0,Math.sign(ot),Math.sign(ht),0,gt,nt),De.drawImage(pe,be,ge,Ce,xe,0,0,Ht,Tt),De.setTransform(et,ot,ht,pt,ct,Pt),[Ht,Tt]}De.drawImage(pe,be,ge,Ce,xe,Le,Be,He,it);const It=Math.hypot(et,ot),vt=Math.hypot(ht,pt);return[It*He,vt*it]}function Te(De){const{width:pe,height:be}=De;if(pe>Ae||be>Ae)return null;const ge=1e3,Ce=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),xe=pe+1;let Le=new Uint8Array(xe*(be+1)),Be,He,it;const et=pe+7&-8;let ot=new Uint8Array(et*be),ht=0;for(const vt of De.data){let kt=128;for(;kt>0;)ot[ht++]=vt&kt?0:255,kt>>=1}let pt=0;for(ht=0,ot[ht]!==0&&(Le[0]=1,++pt),He=1;He<pe;He++)ot[ht]!==ot[ht+1]&&(Le[He]=ot[ht]?2:1,++pt),ht++;for(ot[ht]!==0&&(Le[He]=2,++pt),Be=1;Be<be;Be++){ht=Be*et,it=Be*xe,ot[ht-et]!==ot[ht]&&(Le[it]=ot[ht]?1:8,++pt);let vt=(ot[ht]?4:0)+(ot[ht-et]?8:0);for(He=1;He<pe;He++)vt=(vt>>2)+(ot[ht+1]?4:0)+(ot[ht-et+1]?8:0),Ce[vt]&&(Le[it+He]=Ce[vt],++pt),ht++;if(ot[ht-et]!==ot[ht]&&(Le[it+He]=ot[ht]?2:4,++pt),pt>ge)return null}for(ht=et*(be-1),it=Be*xe,ot[ht]!==0&&(Le[it]=8,++pt),He=1;He<pe;He++)ot[ht]!==ot[ht+1]&&(Le[it+He]=ot[ht]?4:8,++pt),ht++;if(ot[ht]!==0&&(Le[it+He]=4,++pt),pt>ge)return null;const ct=new Int32Array([0,xe,-1,0,-xe,0,0,0,1]),Pt=new Path2D;for(Be=0;pt&&Be<=be;Be++){let vt=Be*xe;const kt=vt+pe;for(;vt<kt&&!Le[vt];)vt++;if(vt===kt)continue;Pt.moveTo(vt%xe,Be);const gt=vt;let tt=Le[vt];do{const nt=ct[tt];do vt+=nt;while(!Le[vt]);const ft=Le[vt];ft!==5&&ft!==10?(tt=ft,Le[vt]=0):(tt=ft&51*tt>>4,Le[vt]&=tt>>2|tt<<2),Pt.lineTo(vt%xe,vt/xe|0),Le[vt]||--pt}while(gt!==vt);--Be}return ot=null,Le=null,function(vt){vt.save(),vt.scale(1/pe,-1/be),vt.translate(0,-be),vt.fill(Pt),vt.beginPath(),vt.restore()}}class Pe{constructor(pe,be){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=re.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=re.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=re.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,pe,be])}clone(){const pe=Object.create(this);return pe.clipBox=this.clipBox.slice(),pe}setCurrentPoint(pe,be){this.x=pe,this.y=be}updatePathMinMax(pe,be,ge){[be,ge]=re.Util.applyTransform([be,ge],pe),this.minX=Math.min(this.minX,be),this.minY=Math.min(this.minY,ge),this.maxX=Math.max(this.maxX,be),this.maxY=Math.max(this.maxY,ge)}updateRectMinMax(pe,be){const ge=re.Util.applyTransform(be,pe),Ce=re.Util.applyTransform(be.slice(2),pe);this.minX=Math.min(this.minX,ge[0],Ce[0]),this.minY=Math.min(this.minY,ge[1],Ce[1]),this.maxX=Math.max(this.maxX,ge[0],Ce[0]),this.maxY=Math.max(this.maxY,ge[1],Ce[1])}updateScalingPathMinMax(pe,be){re.Util.scaleMinMax(pe,be),this.minX=Math.min(this.minX,be[0]),this.maxX=Math.max(this.maxX,be[1]),this.minY=Math.min(this.minY,be[2]),this.maxY=Math.max(this.maxY,be[3])}updateCurvePathMinMax(pe,be,ge,Ce,xe,Le,Be,He,it,et){const ot=re.Util.bezierBoundingBox(be,ge,Ce,xe,Le,Be,He,it);if(et){et[0]=Math.min(et[0],ot[0],ot[2]),et[1]=Math.max(et[1],ot[0],ot[2]),et[2]=Math.min(et[2],ot[1],ot[3]),et[3]=Math.max(et[3],ot[1],ot[3]);return}this.updateRectMinMax(pe,ot)}getPathBoundingBox(pe=se.PathType.FILL,be=null){const ge=[this.minX,this.minY,this.maxX,this.maxY];if(pe===se.PathType.STROKE){be||(0,re.unreachable)("Stroke bounding box must include transform.");const Ce=re.Util.singularValueDecompose2dScale(be),xe=Ce[0]*this.lineWidth/2,Le=Ce[1]*this.lineWidth/2;ge[0]-=xe,ge[1]-=Le,ge[2]+=xe,ge[3]+=Le}return ge}updateClipFromPath(){const pe=re.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(pe||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(pe){this.clipBox=pe,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(pe=se.PathType.FILL,be=null){return re.Util.intersect(this.clipBox,this.getPathBoundingBox(pe,be))}}function Re(De,pe){if(typeof ImageData<"u"&&pe instanceof ImageData){De.putImageData(pe,0,0);return}const be=pe.height,ge=pe.width,Ce=be%_e,xe=(be-Ce)/_e,Le=Ce===0?xe:xe+1,Be=De.createImageData(ge,_e);let He=0,it;const et=pe.data,ot=Be.data;let ht,pt,ct,Pt;if(pe.kind===re.ImageKind.GRAYSCALE_1BPP){const It=et.byteLength,vt=new Uint32Array(ot.buffer,0,ot.byteLength>>2),kt=vt.length,gt=ge+7>>3,tt=4294967295,nt=re.FeatureTest.isLittleEndian?4278190080:255;for(ht=0;ht<Le;ht++){for(ct=ht<xe?_e:Ce,it=0,pt=0;pt<ct;pt++){const ft=It-He;let Tt=0;const Ct=ft>gt?ge:ft*8-7,Ht=Ct&-8;let Wt=0,Ut=0;for(;Tt<Ht;Tt+=8)Ut=et[He++],vt[it++]=Ut&128?tt:nt,vt[it++]=Ut&64?tt:nt,vt[it++]=Ut&32?tt:nt,vt[it++]=Ut&16?tt:nt,vt[it++]=Ut&8?tt:nt,vt[it++]=Ut&4?tt:nt,vt[it++]=Ut&2?tt:nt,vt[it++]=Ut&1?tt:nt;for(;Tt<Ct;Tt++)Wt===0&&(Ut=et[He++],Wt=128),vt[it++]=Ut&Wt?tt:nt,Wt>>=1}for(;it<kt;)vt[it++]=0;De.putImageData(Be,0,ht*_e)}}else if(pe.kind===re.ImageKind.RGBA_32BPP){for(pt=0,Pt=ge*_e*4,ht=0;ht<xe;ht++)ot.set(et.subarray(He,He+Pt)),He+=Pt,De.putImageData(Be,0,pt),pt+=_e;ht<Le&&(Pt=ge*Ce*4,ot.set(et.subarray(He,He+Pt)),De.putImageData(Be,0,pt))}else if(pe.kind===re.ImageKind.RGB_24BPP)for(ct=_e,Pt=ge*ct,ht=0;ht<Le;ht++){for(ht>=xe&&(ct=Ce,Pt=ge*ct),it=0,pt=Pt;pt--;)ot[it++]=et[He++],ot[it++]=et[He++],ot[it++]=et[He++],ot[it++]=255;De.putImageData(Be,0,ht*_e)}else throw new Error("bad image kind: ".concat(pe.kind))}function $e(De,pe){if(pe.bitmap){De.drawImage(pe.bitmap,0,0);return}const be=pe.height,ge=pe.width,Ce=be%_e,xe=(be-Ce)/_e,Le=Ce===0?xe:xe+1,Be=De.createImageData(ge,_e);let He=0;const it=pe.data,et=Be.data;for(let ot=0;ot<Le;ot++){const ht=ot<xe?_e:Ce;({srcPos:He}=(0,oe.convertBlackAndWhiteToRGBA)({src:it,srcPos:He,dest:et,width:ge,height:ht,nonBlackColor:0})),De.putImageData(Be,0,ot*_e)}}function ye(De,pe){const be=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const ge of be)De[ge]!==void 0&&(pe[ge]=De[ge]);De.setLineDash!==void 0&&(pe.setLineDash(De.getLineDash()),pe.lineDashOffset=De.lineDashOffset)}function Ee(De){if(De.strokeStyle=De.fillStyle="#000000",De.fillRule="nonzero",De.globalAlpha=1,De.lineWidth=1,De.lineCap="butt",De.lineJoin="miter",De.miterLimit=10,De.globalCompositeOperation="source-over",De.font="10px sans-serif",De.setLineDash!==void 0&&(De.setLineDash([]),De.lineDashOffset=0),!re.isNodeJS){const{filter:pe}=De;pe!=="none"&&pe!==""&&(De.filter="none")}}function Ne(De,pe,be,ge){const Ce=De.length;for(let xe=3;xe<Ce;xe+=4){const Le=De[xe];if(Le===0)De[xe-3]=pe,De[xe-2]=be,De[xe-1]=ge;else if(Le<255){const Be=255-Le;De[xe-3]=De[xe-3]*Le+pe*Be>>8,De[xe-2]=De[xe-2]*Le+be*Be>>8,De[xe-1]=De[xe-1]*Le+ge*Be>>8}}}function Me(De,pe,be){const ge=De.length,Ce=1/255;for(let xe=3;xe<ge;xe+=4){const Le=be?be[De[xe]]:De[xe];pe[xe]=pe[xe]*Le*Ce|0}}function we(De,pe,be){const ge=De.length;for(let Ce=3;Ce<ge;Ce+=4){const xe=De[Ce-3]*77+De[Ce-2]*152+De[Ce-1]*28;pe[Ce]=be?pe[Ce]*be[xe>>8]>>8:pe[Ce]*xe>>16}}function Oe(De,pe,be,ge,Ce,xe,Le,Be,He,it,et){const ot=!!xe,ht=ot?xe[0]:0,pt=ot?xe[1]:0,ct=ot?xe[2]:0,Pt=Ce==="Luminosity"?we:Me,vt=Math.min(ge,Math.ceil(1048576/be));for(let kt=0;kt<ge;kt+=vt){const gt=Math.min(vt,ge-kt),tt=De.getImageData(Be-it,kt+(He-et),be,gt),nt=pe.getImageData(Be,kt+He,be,gt);ot&&Ne(tt.data,ht,pt,ct),Pt(tt.data,nt.data,Le),pe.putImageData(nt,Be,kt+He)}}function Fe(De,pe,be,ge){const Ce=ge[0],xe=ge[1],Le=ge[2]-Ce,Be=ge[3]-xe;Le===0||Be===0||(Oe(pe.context,be,Le,Be,pe.subtype,pe.backdrop,pe.transferMap,Ce,xe,pe.offsetX,pe.offsetY),De.save(),De.globalAlpha=1,De.globalCompositeOperation="source-over",De.setTransform(1,0,0,1,0,0),De.drawImage(be.canvas,0,0),De.restore())}function Ve(De,pe){const be=re.Util.singularValueDecompose2dScale(De);be[0]=Math.fround(be[0]),be[1]=Math.fround(be[1]);const ge=Math.fround((globalThis.devicePixelRatio||1)*ie.PixelsPerInch.PDF_TO_CSS_UNITS);return pe!==void 0?pe:be[0]<=ge||be[1]<=ge}const qe=["butt","round","square"],Ie=["miter","round","bevel"],Xe={},rt={},Et=class Et{constructor(pe,be,ge,Ce,xe,{optionalContentConfig:Le,markedContentStack:Be=null},He,it){We(this,Ge);We(this,mt);this.ctx=pe,this.current=new Pe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=be,this.objs=ge,this.canvasFactory=Ce,this.filterFactory=xe,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=Be||[],this.optionalContentConfig=Le,this.cachedCanvases=new ve(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=He,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=it,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(pe,be=null){return typeof pe=="string"?pe.startsWith("g_")?this.commonObjs.get(pe):this.objs.get(pe):be}beginDrawing({transform:pe,viewport:be,transparency:ge=!1,background:Ce=null}){const xe=this.ctx.canvas.width,Le=this.ctx.canvas.height,Be=this.ctx.fillStyle;if(this.ctx.fillStyle=Ce||"#ffffff",this.ctx.fillRect(0,0,xe,Le),this.ctx.fillStyle=Be,ge){const He=this.cachedCanvases.getCanvas("transparent",xe,Le);this.compositeCtx=this.ctx,this.transparentCanvas=He.canvas,this.ctx=He.context,this.ctx.save(),this.ctx.transform(...(0,ie.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),Ee(this.ctx),pe&&(this.ctx.transform(...pe),this.outputScaleX=pe[0],this.outputScaleY=pe[0]),this.ctx.transform(...be.transform),this.viewportScale=be.scale,this.baseTransform=(0,ie.getCurrentTransform)(this.ctx)}executeOperatorList(pe,be,ge,Ce){const xe=pe.argsArray,Le=pe.fnArray;let Be=be||0;const He=xe.length;if(He===Be)return Be;const it=He-Be>le&&typeof ge=="function",et=it?Date.now()+ae:0;let ot=0;const ht=this.commonObjs,pt=this.objs;let ct;for(;;){if(Ce!==void 0&&Be===Ce.nextBreakPoint)return Ce.breakIt(Be,ge),Be;if(ct=Le[Be],ct!==re.OPS.dependency)this[ct].apply(this,xe[Be]);else for(const Pt of xe[Be]){const It=Pt.startsWith("g_")?ht:pt;if(!It.has(Pt))return It.get(Pt,ge),Be}if(Be++,Be===He)return Be;if(it&&++ot>le){if(Date.now()>et)return ge(),Be;ot=0}}}endDrawing(){Ke(this,Ge,vr).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const pe of this._cachedBitmapsMap.values()){for(const be of pe.values())typeof HTMLCanvasElement<"u"&&be instanceof HTMLCanvasElement&&(be.width=be.height=0);pe.clear()}this._cachedBitmapsMap.clear(),Ke(this,mt,wr).call(this)}_scaleImage(pe,be){const ge=pe.width,Ce=pe.height;let xe=Math.max(Math.hypot(be[0],be[1]),1),Le=Math.max(Math.hypot(be[2],be[3]),1),Be=ge,He=Ce,it="prescale1",et,ot;for(;xe>2&&Be>1||Le>2&&He>1;){let ht=Be,pt=He;xe>2&&Be>1&&(ht=Be>=16384?Math.floor(Be/2)-1||1:Math.ceil(Be/2),xe/=Be/ht),Le>2&&He>1&&(pt=He>=16384?Math.floor(He/2)-1||1:Math.ceil(He)/2,Le/=He/pt),et=this.cachedCanvases.getCanvas(it,ht,pt),ot=et.context,ot.clearRect(0,0,ht,pt),ot.drawImage(pe,0,0,Be,He,0,0,ht,pt),pe=et.canvas,Be=ht,He=pt,it=it==="prescale1"?"prescale2":"prescale1"}return{img:pe,paintWidth:Be,paintHeight:He}}_createMaskCanvas(pe){const be=this.ctx,{width:ge,height:Ce}=pe,xe=this.current.fillColor,Le=this.current.patternFill,Be=(0,ie.getCurrentTransform)(be);let He,it,et,ot;if((pe.bitmap||pe.data)&&pe.count>1){const Tt=pe.bitmap||pe.data.buffer;it=JSON.stringify(Le?Be:[Be.slice(0,4),xe]),He=this._cachedBitmapsMap.get(Tt),He||(He=new Map,this._cachedBitmapsMap.set(Tt,He));const Ct=He.get(it);if(Ct&&!Le){const Ht=Math.round(Math.min(Be[0],Be[2])+Be[4]),Wt=Math.round(Math.min(Be[1],Be[3])+Be[5]);return{canvas:Ct,offsetX:Ht,offsetY:Wt}}et=Ct}et||(ot=this.cachedCanvases.getCanvas("maskCanvas",ge,Ce),$e(ot.context,pe));let ht=re.Util.transform(Be,[1/ge,0,0,-1/Ce,0,0]);ht=re.Util.transform(ht,[1,0,0,1,0,-Ce]);const pt=re.Util.applyTransform([0,0],ht),ct=re.Util.applyTransform([ge,Ce],ht),Pt=re.Util.normalizeRect([pt[0],pt[1],ct[0],ct[1]]),It=Math.round(Pt[2]-Pt[0])||1,vt=Math.round(Pt[3]-Pt[1])||1,kt=this.cachedCanvases.getCanvas("fillCanvas",It,vt),gt=kt.context,tt=Math.min(pt[0],ct[0]),nt=Math.min(pt[1],ct[1]);gt.translate(-tt,-nt),gt.transform(...ht),et||(et=this._scaleImage(ot.canvas,(0,ie.getCurrentTransformInverse)(gt)),et=et.img,He&&Le&&He.set(it,et)),gt.imageSmoothingEnabled=Ve((0,ie.getCurrentTransform)(gt),pe.interpolate),Se(gt,et,0,0,et.width,et.height,0,0,ge,Ce),gt.globalCompositeOperation="source-in";const ft=re.Util.transform((0,ie.getCurrentTransformInverse)(gt),[1,0,0,1,-tt,-nt]);return gt.fillStyle=Le?xe.getPattern(be,this,ft,se.PathType.FILL):xe,gt.fillRect(0,0,ge,Ce),He&&!Le&&(this.cachedCanvases.delete("fillCanvas"),He.set(it,kt.canvas)),{canvas:kt.canvas,offsetX:Math.round(tt),offsetY:Math.round(nt)}}setLineWidth(pe){pe!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=pe,this.ctx.lineWidth=pe}setLineCap(pe){this.ctx.lineCap=qe[pe]}setLineJoin(pe){this.ctx.lineJoin=Ie[pe]}setMiterLimit(pe){this.ctx.miterLimit=pe}setDash(pe,be){const ge=this.ctx;ge.setLineDash!==void 0&&(ge.setLineDash(pe),ge.lineDashOffset=be)}setRenderingIntent(pe){}setFlatness(pe){}setGState(pe){for(const[be,ge]of pe)switch(be){case"LW":this.setLineWidth(ge);break;case"LC":this.setLineCap(ge);break;case"LJ":this.setLineJoin(ge);break;case"ML":this.setMiterLimit(ge);break;case"D":this.setDash(ge[0],ge[1]);break;case"RI":this.setRenderingIntent(ge);break;case"FL":this.setFlatness(ge);break;case"Font":this.setFont(ge[0],ge[1]);break;case"CA":this.current.strokeAlpha=ge;break;case"ca":this.current.fillAlpha=ge,this.ctx.globalAlpha=ge;break;case"BM":this.ctx.globalCompositeOperation=ge;break;case"SMask":this.current.activeSMask=ge?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(ge);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const pe=this.inSMaskMode;this.current.activeSMask&&!pe?this.beginSMaskMode():!this.current.activeSMask&&pe&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const pe=this.ctx.canvas.width,be=this.ctx.canvas.height,ge="smaskGroupAt"+this.groupLevel,Ce=this.cachedCanvases.getCanvas(ge,pe,be);this.suspendedCtx=this.ctx,this.ctx=Ce.context;const xe=this.ctx;xe.setTransform(...(0,ie.getCurrentTransform)(this.suspendedCtx)),ye(this.suspendedCtx,xe),me(xe,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),ye(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(pe){if(!this.current.activeSMask)return;pe?(pe[0]=Math.floor(pe[0]),pe[1]=Math.floor(pe[1]),pe[2]=Math.ceil(pe[2]),pe[3]=Math.ceil(pe[3])):pe=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const be=this.current.activeSMask,ge=this.suspendedCtx;Fe(ge,be,this.ctx,pe),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}save(){this.inSMaskMode?(ye(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const pe=this.current;this.stateStack.push(pe),this.current=pe.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),ye(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(pe,be,ge,Ce,xe,Le){this.ctx.transform(pe,be,ge,Ce,xe,Le),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(pe,be,ge){const Ce=this.ctx,xe=this.current;let Le=xe.x,Be=xe.y,He,it;const et=(0,ie.getCurrentTransform)(Ce),ot=et[0]===0&&et[3]===0||et[1]===0&&et[2]===0,ht=ot?ge.slice(0):null;for(let pt=0,ct=0,Pt=pe.length;pt<Pt;pt++)switch(pe[pt]|0){case re.OPS.rectangle:Le=be[ct++],Be=be[ct++];const It=be[ct++],vt=be[ct++],kt=Le+It,gt=Be+vt;Ce.moveTo(Le,Be),It===0||vt===0?Ce.lineTo(kt,gt):(Ce.lineTo(kt,Be),Ce.lineTo(kt,gt),Ce.lineTo(Le,gt)),ot||xe.updateRectMinMax(et,[Le,Be,kt,gt]),Ce.closePath();break;case re.OPS.moveTo:Le=be[ct++],Be=be[ct++],Ce.moveTo(Le,Be),ot||xe.updatePathMinMax(et,Le,Be);break;case re.OPS.lineTo:Le=be[ct++],Be=be[ct++],Ce.lineTo(Le,Be),ot||xe.updatePathMinMax(et,Le,Be);break;case re.OPS.curveTo:He=Le,it=Be,Le=be[ct+4],Be=be[ct+5],Ce.bezierCurveTo(be[ct],be[ct+1],be[ct+2],be[ct+3],Le,Be),xe.updateCurvePathMinMax(et,He,it,be[ct],be[ct+1],be[ct+2],be[ct+3],Le,Be,ht),ct+=6;break;case re.OPS.curveTo2:He=Le,it=Be,Ce.bezierCurveTo(Le,Be,be[ct],be[ct+1],be[ct+2],be[ct+3]),xe.updateCurvePathMinMax(et,He,it,Le,Be,be[ct],be[ct+1],be[ct+2],be[ct+3],ht),Le=be[ct+2],Be=be[ct+3],ct+=4;break;case re.OPS.curveTo3:He=Le,it=Be,Le=be[ct+2],Be=be[ct+3],Ce.bezierCurveTo(be[ct],be[ct+1],Le,Be,Le,Be),xe.updateCurvePathMinMax(et,He,it,be[ct],be[ct+1],Le,Be,Le,Be,ht),ct+=4;break;case re.OPS.closePath:Ce.closePath();break}ot&&xe.updateScalingPathMinMax(et,ht),xe.setCurrentPoint(Le,Be)}closePath(){this.ctx.closePath()}stroke(pe=!0){const be=this.ctx,ge=this.current.strokeColor;be.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof ge=="object"&&(ge!=null&&ge.getPattern)?(be.save(),be.strokeStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.STROKE),this.rescaleAndStroke(!1),be.restore()):this.rescaleAndStroke(!0)),pe&&this.consumePath(this.current.getClippedPathBoundingBox()),be.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(pe=!0){const be=this.ctx,ge=this.current.fillColor,Ce=this.current.patternFill;let xe=!1;Ce&&(be.save(),be.fillStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.FILL),xe=!0);const Le=this.current.getClippedPathBoundingBox();this.contentVisible&&Le!==null&&(this.pendingEOFill?(be.fill("evenodd"),this.pendingEOFill=!1):be.fill()),xe&&be.restore(),pe&&this.consumePath(Le)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=Xe}eoClip(){this.pendingClip=rt}beginText(){this.current.textMatrix=re.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const pe=this.pendingTextPaths,be=this.ctx;if(pe===void 0){be.beginPath();return}be.save(),be.beginPath();for(const ge of pe)be.setTransform(...ge.transform),be.translate(ge.x,ge.y),ge.addToPath(be,ge.fontSize);be.restore(),be.clip(),be.beginPath(),delete this.pendingTextPaths}setCharSpacing(pe){this.current.charSpacing=pe}setWordSpacing(pe){this.current.wordSpacing=pe}setHScale(pe){this.current.textHScale=pe/100}setLeading(pe){this.current.leading=-pe}setFont(pe,be){var et;const ge=this.commonObjs.get(pe),Ce=this.current;if(!ge)throw new Error("Can't find font for ".concat(pe));if(Ce.fontMatrix=ge.fontMatrix||re.FONT_IDENTITY_MATRIX,(Ce.fontMatrix[0]===0||Ce.fontMatrix[3]===0)&&(0,re.warn)("Invalid font matrix for font "+pe),be<0?(be=-be,Ce.fontDirection=-1):Ce.fontDirection=1,this.current.font=ge,this.current.fontSize=be,ge.isType3Font)return;const xe=ge.loadedName||"sans-serif",Le=((et=ge.systemFontInfo)==null?void 0:et.css)||'"'.concat(xe,'", ').concat(ge.fallbackName);let Be="normal";ge.black?Be="900":ge.bold&&(Be="bold");const He=ge.italic?"italic":"normal";let it=be;be<he?it=he:be>ue&&(it=ue),this.current.fontSizeScale=be/it,this.ctx.font="".concat(He," ").concat(Be," ").concat(it,"px ").concat(Le)}setTextRenderingMode(pe){this.current.textRenderingMode=pe}setTextRise(pe){this.current.textRise=pe}moveText(pe,be){this.current.x=this.current.lineX+=pe,this.current.y=this.current.lineY+=be}setLeadingMoveText(pe,be){this.setLeading(-be),this.moveText(pe,be)}setTextMatrix(pe,be,ge,Ce,xe,Le){this.current.textMatrix=[pe,be,ge,Ce,xe,Le],this.current.textMatrixScale=Math.hypot(pe,be),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(pe,be,ge,Ce){const xe=this.ctx,Le=this.current,Be=Le.font,He=Le.textRenderingMode,it=Le.fontSize/Le.fontSizeScale,et=He&re.TextRenderingMode.FILL_STROKE_MASK,ot=!!(He&re.TextRenderingMode.ADD_TO_PATH_FLAG),ht=Le.patternFill&&!Be.missingFile;let pt;(Be.disableFontFace||ot||ht)&&(pt=Be.getPathGenerator(this.commonObjs,pe)),Be.disableFontFace||ht?(xe.save(),xe.translate(be,ge),xe.beginPath(),pt(xe,it),Ce&&xe.setTransform(...Ce),(et===re.TextRenderingMode.FILL||et===re.TextRenderingMode.FILL_STROKE)&&xe.fill(),(et===re.TextRenderingMode.STROKE||et===re.TextRenderingMode.FILL_STROKE)&&xe.stroke(),xe.restore()):((et===re.TextRenderingMode.FILL||et===re.TextRenderingMode.FILL_STROKE)&&xe.fillText(pe,be,ge),(et===re.TextRenderingMode.STROKE||et===re.TextRenderingMode.FILL_STROKE)&&xe.strokeText(pe,be,ge)),ot&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,ie.getCurrentTransform)(xe),x:be,y:ge,fontSize:it,addToPath:pt})}get isFontSubpixelAAEnabled(){const{context:pe}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);pe.scale(1.5,1),pe.fillText("I",0,10);const be=pe.getImageData(0,0,10,10).data;let ge=!1;for(let Ce=3;Ce<be.length;Ce+=4)if(be[Ce]>0&&be[Ce]<255){ge=!0;break}return(0,re.shadow)(this,"isFontSubpixelAAEnabled",ge)}showText(pe){const be=this.current,ge=be.font;if(ge.isType3Font)return this.showType3Text(pe);const Ce=be.fontSize;if(Ce===0)return;const xe=this.ctx,Le=be.fontSizeScale,Be=be.charSpacing,He=be.wordSpacing,it=be.fontDirection,et=be.textHScale*it,ot=pe.length,ht=ge.vertical,pt=ht?1:-1,ct=ge.defaultVMetrics,Pt=Ce*be.fontMatrix[0],It=be.textRenderingMode===re.TextRenderingMode.FILL&&!ge.disableFontFace&&!be.patternFill;xe.save(),xe.transform(...be.textMatrix),xe.translate(be.x,be.y+be.textRise),it>0?xe.scale(et,-1):xe.scale(et,1);let vt;if(be.patternFill){xe.save();const ft=be.fillColor.getPattern(xe,this,(0,ie.getCurrentTransformInverse)(xe),se.PathType.FILL);vt=(0,ie.getCurrentTransform)(xe),xe.restore(),xe.fillStyle=ft}let kt=be.lineWidth;const gt=be.textMatrixScale;if(gt===0||kt===0){const ft=be.textRenderingMode&re.TextRenderingMode.FILL_STROKE_MASK;(ft===re.TextRenderingMode.STROKE||ft===re.TextRenderingMode.FILL_STROKE)&&(kt=this.getSinglePixelWidth())}else kt/=gt;if(Le!==1&&(xe.scale(Le,Le),kt/=Le),xe.lineWidth=kt,ge.isInvalidPDFjsFont){const ft=[];let Tt=0;for(const Ct of pe)ft.push(Ct.unicode),Tt+=Ct.width;xe.fillText(ft.join(""),0,0),be.x+=Tt*Pt*et,xe.restore(),this.compose();return}let tt=0,nt;for(nt=0;nt<ot;++nt){const ft=pe[nt];if(typeof ft=="number"){tt+=pt*ft*Ce/1e3;continue}let Tt=!1;const Ct=(ft.isSpace?He:0)+Be,Ht=ft.fontChar,Wt=ft.accent;let Ut,zt,Vt=ft.width;if(ht){const Gt=ft.vmetric||ct,dt=-(ft.vmetric?Gt[1]:Vt*.5)*Pt,Qe=Gt[2]*Pt;Vt=Gt?-Gt[0]:Vt,Ut=dt/Le,zt=(tt+Qe)/Le}else Ut=tt/Le,zt=0;if(ge.remeasure&&Vt>0){const Gt=xe.measureText(Ht).width*1e3/Ce*Le;if(Vt<Gt&&this.isFontSubpixelAAEnabled){const dt=Vt/Gt;Tt=!0,xe.save(),xe.scale(dt,1),Ut/=dt}else Vt!==Gt&&(Ut+=(Vt-Gt)/2e3*Ce/Le)}if(this.contentVisible&&(ft.isInFont||ge.missingFile)){if(It&&!Wt)xe.fillText(Ht,Ut,zt);else if(this.paintChar(Ht,Ut,zt,vt),Wt){const Gt=Ut+Ce*Wt.offset.x/Le,dt=zt-Ce*Wt.offset.y/Le;this.paintChar(Wt.fontChar,Gt,dt,vt)}}const jt=ht?Vt*Pt-Ct*it:Vt*Pt+Ct*it;tt+=jt,Tt&&xe.restore()}ht?be.y-=tt:be.x+=tt*et,xe.restore(),this.compose()}showType3Text(pe){const be=this.ctx,ge=this.current,Ce=ge.font,xe=ge.fontSize,Le=ge.fontDirection,Be=Ce.vertical?1:-1,He=ge.charSpacing,it=ge.wordSpacing,et=ge.textHScale*Le,ot=ge.fontMatrix||re.FONT_IDENTITY_MATRIX,ht=pe.length,pt=ge.textRenderingMode===re.TextRenderingMode.INVISIBLE;let ct,Pt,It,vt;if(!(pt||xe===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,be.save(),be.transform(...ge.textMatrix),be.translate(ge.x,ge.y),be.scale(et,Le),ct=0;ct<ht;++ct){if(Pt=pe[ct],typeof Pt=="number"){vt=Be*Pt*xe/1e3,this.ctx.translate(vt,0),ge.x+=vt*et;continue}const kt=(Pt.isSpace?it:0)+He,gt=Ce.charProcOperatorList[Pt.operatorListId];if(!gt){(0,re.warn)('Type3 character "'.concat(Pt.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=Pt,this.save(),be.scale(xe,xe),be.transform(...ot),this.executeOperatorList(gt),this.restore()),It=re.Util.applyTransform([Pt.width,0],ot)[0]*xe+kt,be.translate(It,0),ge.x+=It*et}be.restore(),this.processingType3=null}}setCharWidth(pe,be){}setCharWidthAndBounds(pe,be,ge,Ce,xe,Le){this.ctx.rect(ge,Ce,xe-ge,Le-Ce),this.ctx.clip(),this.endPath()}getColorN_Pattern(pe){let be;if(pe[0]==="TilingPattern"){const ge=pe[1],Ce=this.baseTransform||(0,ie.getCurrentTransform)(this.ctx),xe={createCanvasGraphics:Le=>new Et(Le,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};be=new se.TilingPattern(pe,ge,this.ctx,xe,Ce)}else be=this._getPattern(pe[1],pe[2]);return be}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(pe,be,ge){const Ce=re.Util.makeHexColor(pe,be,ge);this.ctx.strokeStyle=Ce,this.current.strokeColor=Ce}setFillRGBColor(pe,be,ge){const Ce=re.Util.makeHexColor(pe,be,ge);this.ctx.fillStyle=Ce,this.current.fillColor=Ce,this.current.patternFill=!1}_getPattern(pe,be=null){let ge;return this.cachedPatterns.has(pe)?ge=this.cachedPatterns.get(pe):(ge=(0,se.getShadingPattern)(this.getObject(pe)),this.cachedPatterns.set(pe,ge)),be&&(ge.matrix=be),ge}shadingFill(pe){if(!this.contentVisible)return;const be=this.ctx;this.save();const ge=this._getPattern(pe);be.fillStyle=ge.getPattern(be,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.SHADING);const Ce=(0,ie.getCurrentTransformInverse)(be);if(Ce){const{width:xe,height:Le}=be.canvas,[Be,He,it,et]=re.Util.getAxialAlignedBoundingBox([0,0,xe,Le],Ce);this.ctx.fillRect(Be,He,it-Be,et-He)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,re.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,re.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(pe,be){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(pe)&&pe.length===6&&this.transform(...pe),this.baseTransform=(0,ie.getCurrentTransform)(this.ctx),be)){const ge=be[2]-be[0],Ce=be[3]-be[1];this.ctx.rect(be[0],be[1],ge,Ce),this.current.updateRectMinMax((0,ie.getCurrentTransform)(this.ctx),be),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(pe){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const be=this.ctx;pe.isolated||(0,re.info)("TODO: Support non-isolated groups."),pe.knockout&&(0,re.warn)("Knockout groups not supported.");const ge=(0,ie.getCurrentTransform)(be);if(pe.matrix&&be.transform(...pe.matrix),!pe.bbox)throw new Error("Bounding box is required.");let Ce=re.Util.getAxialAlignedBoundingBox(pe.bbox,(0,ie.getCurrentTransform)(be));const xe=[0,0,be.canvas.width,be.canvas.height];Ce=re.Util.intersect(Ce,xe)||[0,0,0,0];const Le=Math.floor(Ce[0]),Be=Math.floor(Ce[1]);let He=Math.max(Math.ceil(Ce[2])-Le,1),it=Math.max(Math.ceil(Ce[3])-Be,1),et=1,ot=1;He>de&&(et=He/de,He=de),it>de&&(ot=it/de,it=de),this.current.startNewPathAndClipBox([0,0,He,it]);let ht="groupAt"+this.groupLevel;pe.smask&&(ht+="_smask_"+this.smaskCounter++%2);const pt=this.cachedCanvases.getCanvas(ht,He,it),ct=pt.context;ct.scale(1/et,1/ot),ct.translate(-Le,-Be),ct.transform(...ge),pe.smask?this.smaskStack.push({canvas:pt.canvas,context:ct,offsetX:Le,offsetY:Be,scaleX:et,scaleY:ot,subtype:pe.smask.subtype,backdrop:pe.smask.backdrop,transferMap:pe.smask.transferMap||null,startTransformInverse:null}):(be.setTransform(1,0,0,1,0,0),be.translate(Le,Be),be.scale(et,ot),be.save()),ye(be,ct),this.ctx=ct,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(be),this.groupLevel++}endGroup(pe){if(!this.contentVisible)return;this.groupLevel--;const be=this.ctx,ge=this.groupStack.pop();if(this.ctx=ge,this.ctx.imageSmoothingEnabled=!1,pe.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const Ce=(0,ie.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...Ce);const xe=re.Util.getAxialAlignedBoundingBox([0,0,be.canvas.width,be.canvas.height],Ce);this.ctx.drawImage(be.canvas,0,0),this.ctx.restore(),this.compose(xe)}}beginAnnotation(pe,be,ge,Ce,xe){if(Ke(this,Ge,vr).call(this),Ee(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(be)&&be.length===4){const Le=be[2]-be[0],Be=be[3]-be[1];if(xe&&this.annotationCanvasMap){ge=ge.slice(),ge[4]-=be[0],ge[5]-=be[1],be=be.slice(),be[0]=be[1]=0,be[2]=Le,be[3]=Be;const[He,it]=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(this.ctx)),{viewportScale:et}=this,ot=Math.ceil(Le*this.outputScaleX*et),ht=Math.ceil(Be*this.outputScaleY*et);this.annotationCanvas=this.canvasFactory.create(ot,ht);const{canvas:pt,context:ct}=this.annotationCanvas;this.annotationCanvasMap.set(pe,pt),this.annotationCanvas.savedCtx=this.ctx,this.ctx=ct,this.ctx.save(),this.ctx.setTransform(He,0,0,-it,0,Be*it),Ee(this.ctx)}else Ee(this.ctx),this.ctx.rect(be[0],be[1],Le,Be),this.ctx.clip(),this.endPath()}this.current=new Pe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...ge),this.transform(...Ce)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),Ke(this,mt,wr).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(pe){if(!this.contentVisible)return;const be=pe.count;pe=this.getObject(pe.data,pe),pe.count=be;const ge=this.ctx,Ce=this.processingType3;if(Ce&&(Ce.compiled===void 0&&(Ce.compiled=Te(pe)),Ce.compiled)){Ce.compiled(ge);return}const xe=this._createMaskCanvas(pe),Le=xe.canvas;ge.save(),ge.setTransform(1,0,0,1,0,0),ge.drawImage(Le,xe.offsetX,xe.offsetY),ge.restore(),this.compose()}paintImageMaskXObjectRepeat(pe,be,ge=0,Ce=0,xe,Le){if(!this.contentVisible)return;pe=this.getObject(pe.data,pe);const Be=this.ctx;Be.save();const He=(0,ie.getCurrentTransform)(Be);Be.transform(be,ge,Ce,xe,0,0);const it=this._createMaskCanvas(pe);Be.setTransform(1,0,0,1,it.offsetX-He[4],it.offsetY-He[5]);for(let et=0,ot=Le.length;et<ot;et+=2){const ht=re.Util.transform(He,[be,ge,Ce,xe,Le[et],Le[et+1]]),[pt,ct]=re.Util.applyTransform([0,0],ht);Be.drawImage(it.canvas,pt,ct)}Be.restore(),this.compose()}paintImageMaskXObjectGroup(pe){if(!this.contentVisible)return;const be=this.ctx,ge=this.current.fillColor,Ce=this.current.patternFill;for(const xe of pe){const{data:Le,width:Be,height:He,transform:it}=xe,et=this.cachedCanvases.getCanvas("maskCanvas",Be,He),ot=et.context;ot.save();const ht=this.getObject(Le,xe);$e(ot,ht),ot.globalCompositeOperation="source-in",ot.fillStyle=Ce?ge.getPattern(ot,this,(0,ie.getCurrentTransformInverse)(be),se.PathType.FILL):ge,ot.fillRect(0,0,Be,He),ot.restore(),be.save(),be.transform(...it),be.scale(1,-1),Se(be,et.canvas,0,0,Be,He,0,-1,1,1),be.restore()}this.compose()}paintImageXObject(pe){if(!this.contentVisible)return;const be=this.getObject(pe);if(!be){(0,re.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(be)}paintImageXObjectRepeat(pe,be,ge,Ce){if(!this.contentVisible)return;const xe=this.getObject(pe);if(!xe){(0,re.warn)("Dependent image isn't ready yet");return}const Le=xe.width,Be=xe.height,He=[];for(let it=0,et=Ce.length;it<et;it+=2)He.push({transform:[be,0,0,ge,Ce[it],Ce[it+1]],x:0,y:0,w:Le,h:Be});this.paintInlineImageXObjectGroup(xe,He)}applyTransferMapsToCanvas(pe){return this.current.transferMaps!=="none"&&(pe.filter=this.current.transferMaps,pe.drawImage(pe.canvas,0,0),pe.filter="none"),pe.canvas}applyTransferMapsToBitmap(pe){if(this.current.transferMaps==="none")return pe.bitmap;const{bitmap:be,width:ge,height:Ce}=pe,xe=this.cachedCanvases.getCanvas("inlineImage",ge,Ce),Le=xe.context;return Le.filter=this.current.transferMaps,Le.drawImage(be,0,0),Le.filter="none",xe.canvas}paintInlineImageXObject(pe){if(!this.contentVisible)return;const be=pe.width,ge=pe.height,Ce=this.ctx;if(this.save(),!re.isNodeJS){const{filter:Be}=Ce;Be!=="none"&&Be!==""&&(Ce.filter="none")}Ce.scale(1/be,-1/ge);let xe;if(pe.bitmap)xe=this.applyTransferMapsToBitmap(pe);else if(typeof HTMLElement=="function"&&pe instanceof HTMLElement||!pe.data)xe=pe;else{const He=this.cachedCanvases.getCanvas("inlineImage",be,ge).context;Re(He,pe),xe=this.applyTransferMapsToCanvas(He)}const Le=this._scaleImage(xe,(0,ie.getCurrentTransformInverse)(Ce));Ce.imageSmoothingEnabled=Ve((0,ie.getCurrentTransform)(Ce),pe.interpolate),Se(Ce,Le.img,0,0,Le.paintWidth,Le.paintHeight,0,-ge,be,ge),this.compose(),this.restore()}paintInlineImageXObjectGroup(pe,be){if(!this.contentVisible)return;const ge=this.ctx;let Ce;if(pe.bitmap)Ce=pe.bitmap;else{const xe=pe.width,Le=pe.height,He=this.cachedCanvases.getCanvas("inlineImage",xe,Le).context;Re(He,pe),Ce=this.applyTransferMapsToCanvas(He)}for(const xe of be)ge.save(),ge.transform(...xe.transform),ge.scale(1,-1),Se(ge,Ce,xe.x,xe.y,xe.w,xe.h,0,-1,1,1),ge.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(pe){}markPointProps(pe,be){}beginMarkedContent(pe){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(pe,be){pe==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(be)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(pe){const be=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(pe);const ge=this.ctx;this.pendingClip&&(be||(this.pendingClip===rt?ge.clip("evenodd"):ge.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),ge.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const pe=(0,ie.getCurrentTransform)(this.ctx);if(pe[1]===0&&pe[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(pe[0]),Math.abs(pe[3]));else{const be=Math.abs(pe[0]*pe[3]-pe[2]*pe[1]),ge=Math.hypot(pe[0],pe[2]),Ce=Math.hypot(pe[1],pe[3]);this._cachedGetSinglePixelWidth=Math.max(ge,Ce)/be}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:pe}=this.current,{a:be,b:ge,c:Ce,d:xe}=this.ctx.getTransform();let Le,Be;if(ge===0&&Ce===0){const He=Math.abs(be),it=Math.abs(xe);if(He===it)if(pe===0)Le=Be=1/He;else{const et=He*pe;Le=Be=et<1?1/et:1}else if(pe===0)Le=1/He,Be=1/it;else{const et=He*pe,ot=it*pe;Le=et<1?1/et:1,Be=ot<1?1/ot:1}}else{const He=Math.abs(be*xe-ge*Ce),it=Math.hypot(be,ge),et=Math.hypot(Ce,xe);if(pe===0)Le=et/He,Be=it/He;else{const ot=pe*He;Le=et>ot?et/ot:1,Be=it>ot?it/ot:1}}this._cachedScaleForStroking[0]=Le,this._cachedScaleForStroking[1]=Be}return this._cachedScaleForStroking}rescaleAndStroke(pe){const{ctx:be}=this,{lineWidth:ge}=this.current,[Ce,xe]=this.getScaleForStroking();if(be.lineWidth=ge||1,Ce===1&&xe===1){be.stroke();return}const Le=be.getLineDash();if(pe&&be.save(),be.scale(Ce,xe),Le.length>0){const Be=Math.max(Ce,xe);be.setLineDash(Le.map(He=>He/Be)),be.lineDashOffset/=Be}be.stroke(),pe&&be.restore()}isContentVisible(){for(let pe=this.markedContentStack.length-1;pe>=0;pe--)if(!this.markedContentStack[pe].visible)return!1;return!0}};Ge=new WeakSet,vr=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},mt=new WeakSet,wr=function(){if(this.pageColors){const pe=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(pe!=="none"){const be=this.ctx.filter;this.ctx.filter=pe,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=be}}};let lt=Et;te.CanvasGraphics=lt;for(const De in re.OPS)lt.prototype[De]!==void 0&&(lt.prototype[re.OPS[De]]=lt.prototype[De])},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TilingPattern=te.PathType=void 0,te.getShadingPattern=_e;var re=ne(1),ie=ne(6);const se={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};te.PathType=se;function oe(Te,Pe){if(!Pe)return;const Re=Pe[2]-Pe[0],$e=Pe[3]-Pe[1],ye=new Path2D;ye.rect(Pe[0],Pe[1],Re,$e),Te.clip(ye)}class he{constructor(){this.constructor===he&&(0,re.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,re.unreachable)("Abstract method `getPattern` called.")}}class ue extends he{constructor(Pe){super(),this._type=Pe[1],this._bbox=Pe[2],this._colorStops=Pe[3],this._p0=Pe[4],this._p1=Pe[5],this._r0=Pe[6],this._r1=Pe[7],this.matrix=null}_createGradient(Pe){let Re;this._type==="axial"?Re=Pe.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(Re=Pe.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const $e of this._colorStops)Re.addColorStop($e[0],$e[1]);return Re}getPattern(Pe,Re,$e,ye){let Ee;if(ye===se.STROKE||ye===se.FILL){const Ne=Re.current.getClippedPathBoundingBox(ye,(0,ie.getCurrentTransform)(Pe))||[0,0,0,0],Me=Math.ceil(Ne[2]-Ne[0])||1,we=Math.ceil(Ne[3]-Ne[1])||1,Oe=Re.cachedCanvases.getCanvas("pattern",Me,we,!0),Fe=Oe.context;Fe.clearRect(0,0,Fe.canvas.width,Fe.canvas.height),Fe.beginPath(),Fe.rect(0,0,Fe.canvas.width,Fe.canvas.height),Fe.translate(-Ne[0],-Ne[1]),$e=re.Util.transform($e,[1,0,0,1,Ne[0],Ne[1]]),Fe.transform(...Re.baseTransform),this.matrix&&Fe.transform(...this.matrix),oe(Fe,this._bbox),Fe.fillStyle=this._createGradient(Fe),Fe.fill(),Ee=Pe.createPattern(Oe.canvas,"no-repeat");const Ve=new DOMMatrix($e);Ee.setTransform(Ve)}else oe(Pe,this._bbox),Ee=this._createGradient(Pe);return Ee}}function de(Te,Pe,Re,$e,ye,Ee,Ne,Me){const we=Pe.coords,Oe=Pe.colors,Fe=Te.data,Ve=Te.width*4;let qe;we[Re+1]>we[$e+1]&&(qe=Re,Re=$e,$e=qe,qe=Ee,Ee=Ne,Ne=qe),we[$e+1]>we[ye+1]&&(qe=$e,$e=ye,ye=qe,qe=Ne,Ne=Me,Me=qe),we[Re+1]>we[$e+1]&&(qe=Re,Re=$e,$e=qe,qe=Ee,Ee=Ne,Ne=qe);const Ie=(we[Re]+Pe.offsetX)*Pe.scaleX,Xe=(we[Re+1]+Pe.offsetY)*Pe.scaleY,rt=(we[$e]+Pe.offsetX)*Pe.scaleX,lt=(we[$e+1]+Pe.offsetY)*Pe.scaleY,Ge=(we[ye]+Pe.offsetX)*Pe.scaleX,ut=(we[ye+1]+Pe.offsetY)*Pe.scaleY;if(Xe>=ut)return;const mt=Oe[Ee],wt=Oe[Ee+1],Et=Oe[Ee+2],De=Oe[Ne],pe=Oe[Ne+1],be=Oe[Ne+2],ge=Oe[Me],Ce=Oe[Me+1],xe=Oe[Me+2],Le=Math.round(Xe),Be=Math.round(ut);let He,it,et,ot,ht,pt,ct,Pt;for(let It=Le;It<=Be;It++){if(It<lt){const nt=It<Xe?0:(Xe-It)/(Xe-lt);He=Ie-(Ie-rt)*nt,it=mt-(mt-De)*nt,et=wt-(wt-pe)*nt,ot=Et-(Et-be)*nt}else{let nt;It>ut?nt=1:lt===ut?nt=0:nt=(lt-It)/(lt-ut),He=rt-(rt-Ge)*nt,it=De-(De-ge)*nt,et=pe-(pe-Ce)*nt,ot=be-(be-xe)*nt}let vt;It<Xe?vt=0:It>ut?vt=1:vt=(Xe-It)/(Xe-ut),ht=Ie-(Ie-Ge)*vt,pt=mt-(mt-ge)*vt,ct=wt-(wt-Ce)*vt,Pt=Et-(Et-xe)*vt;const kt=Math.round(Math.min(He,ht)),gt=Math.round(Math.max(He,ht));let tt=Ve*It+kt*4;for(let nt=kt;nt<=gt;nt++)vt=(He-nt)/(He-ht),vt<0?vt=0:vt>1&&(vt=1),Fe[tt++]=it-(it-pt)*vt|0,Fe[tt++]=et-(et-ct)*vt|0,Fe[tt++]=ot-(ot-Pt)*vt|0,Fe[tt++]=255}}function ae(Te,Pe,Re){const $e=Pe.coords,ye=Pe.colors;let Ee,Ne;switch(Pe.type){case"lattice":const Me=Pe.verticesPerRow,we=Math.floor($e.length/Me)-1,Oe=Me-1;for(Ee=0;Ee<we;Ee++){let Fe=Ee*Me;for(let Ve=0;Ve<Oe;Ve++,Fe++)de(Te,Re,$e[Fe],$e[Fe+1],$e[Fe+Me],ye[Fe],ye[Fe+1],ye[Fe+Me]),de(Te,Re,$e[Fe+Me+1],$e[Fe+1],$e[Fe+Me],ye[Fe+Me+1],ye[Fe+1],ye[Fe+Me])}break;case"triangles":for(Ee=0,Ne=$e.length;Ee<Ne;Ee+=3)de(Te,Re,$e[Ee],$e[Ee+1],$e[Ee+2],ye[Ee],ye[Ee+1],ye[Ee+2]);break;default:throw new Error("illegal figure")}}class le extends he{constructor(Pe){super(),this._coords=Pe[2],this._colors=Pe[3],this._figures=Pe[4],this._bounds=Pe[5],this._bbox=Pe[7],this._background=Pe[8],this.matrix=null}_createMeshCanvas(Pe,Re,$e){const Me=Math.floor(this._bounds[0]),we=Math.floor(this._bounds[1]),Oe=Math.ceil(this._bounds[2])-Me,Fe=Math.ceil(this._bounds[3])-we,Ve=Math.min(Math.ceil(Math.abs(Oe*Pe[0]*1.1)),3e3),qe=Math.min(Math.ceil(Math.abs(Fe*Pe[1]*1.1)),3e3),Ie=Oe/Ve,Xe=Fe/qe,rt={coords:this._coords,colors:this._colors,offsetX:-Me,offsetY:-we,scaleX:1/Ie,scaleY:1/Xe},lt=Ve+2*2,Ge=qe+2*2,ut=$e.getCanvas("mesh",lt,Ge,!1),mt=ut.context,wt=mt.createImageData(Ve,qe);if(Re){const De=wt.data;for(let pe=0,be=De.length;pe<be;pe+=4)De[pe]=Re[0],De[pe+1]=Re[1],De[pe+2]=Re[2],De[pe+3]=255}for(const De of this._figures)ae(wt,De,rt);return mt.putImageData(wt,2,2),{canvas:ut.canvas,offsetX:Me-2*Ie,offsetY:we-2*Xe,scaleX:Ie,scaleY:Xe}}getPattern(Pe,Re,$e,ye){oe(Pe,this._bbox);let Ee;if(ye===se.SHADING)Ee=re.Util.singularValueDecompose2dScale((0,ie.getCurrentTransform)(Pe));else if(Ee=re.Util.singularValueDecompose2dScale(Re.baseTransform),this.matrix){const Me=re.Util.singularValueDecompose2dScale(this.matrix);Ee=[Ee[0]*Me[0],Ee[1]*Me[1]]}const Ne=this._createMeshCanvas(Ee,ye===se.SHADING?null:this._background,Re.cachedCanvases);return ye!==se.SHADING&&(Pe.setTransform(...Re.baseTransform),this.matrix&&Pe.transform(...this.matrix)),Pe.translate(Ne.offsetX,Ne.offsetY),Pe.scale(Ne.scaleX,Ne.scaleY),Pe.createPattern(Ne.canvas,"no-repeat")}}class Ae extends he{getPattern(){return"hotpink"}}function _e(Te){switch(Te[0]){case"RadialAxial":return new ue(Te);case"Mesh":return new le(Te);case"Dummy":return new Ae}throw new Error("Unknown IR type: ".concat(Te[0]))}const me={COLORED:1,UNCOLORED:2},Se=class Se{constructor(Pe,Re,$e,ye,Ee){this.operatorList=Pe[2],this.matrix=Pe[3]||[1,0,0,1,0,0],this.bbox=Pe[4],this.xstep=Pe[5],this.ystep=Pe[6],this.paintType=Pe[7],this.tilingType=Pe[8],this.color=Re,this.ctx=$e,this.canvasGraphicsFactory=ye,this.baseTransform=Ee}createPatternCanvas(Pe){const Re=this.operatorList,$e=this.bbox,ye=this.xstep,Ee=this.ystep,Ne=this.paintType,Me=this.tilingType,we=this.color,Oe=this.canvasGraphicsFactory;(0,re.info)("TilingType: "+Me);const Fe=$e[0],Ve=$e[1],qe=$e[2],Ie=$e[3],Xe=re.Util.singularValueDecompose2dScale(this.matrix),rt=re.Util.singularValueDecompose2dScale(this.baseTransform),lt=[Xe[0]*rt[0],Xe[1]*rt[1]],Ge=this.getSizeAndScale(ye,this.ctx.canvas.width,lt[0]),ut=this.getSizeAndScale(Ee,this.ctx.canvas.height,lt[1]),mt=Pe.cachedCanvases.getCanvas("pattern",Ge.size,ut.size,!0),wt=mt.context,Et=Oe.createCanvasGraphics(wt);Et.groupLevel=Pe.groupLevel,this.setFillAndStrokeStyleToContext(Et,Ne,we);let De=Fe,pe=Ve,be=qe,ge=Ie;return Fe<0&&(De=0,be+=Math.abs(Fe)),Ve<0&&(pe=0,ge+=Math.abs(Ve)),wt.translate(-(Ge.scale*De),-(ut.scale*pe)),Et.transform(Ge.scale,0,0,ut.scale,0,0),wt.save(),this.clipBbox(Et,De,pe,be,ge),Et.baseTransform=(0,ie.getCurrentTransform)(Et.ctx),Et.executeOperatorList(Re),Et.endDrawing(),{canvas:mt.canvas,scaleX:Ge.scale,scaleY:ut.scale,offsetX:De,offsetY:pe}}getSizeAndScale(Pe,Re,$e){Pe=Math.abs(Pe);const ye=Math.max(Se.MAX_PATTERN_SIZE,Re);let Ee=Math.ceil(Pe*$e);return Ee>=ye?Ee=ye:$e=Ee/Pe,{scale:$e,size:Ee}}clipBbox(Pe,Re,$e,ye,Ee){const Ne=ye-Re,Me=Ee-$e;Pe.ctx.rect(Re,$e,Ne,Me),Pe.current.updateRectMinMax((0,ie.getCurrentTransform)(Pe.ctx),[Re,$e,ye,Ee]),Pe.clip(),Pe.endPath()}setFillAndStrokeStyleToContext(Pe,Re,$e){const ye=Pe.ctx,Ee=Pe.current;switch(Re){case me.COLORED:const Ne=this.ctx;ye.fillStyle=Ne.fillStyle,ye.strokeStyle=Ne.strokeStyle,Ee.fillColor=Ne.fillStyle,Ee.strokeColor=Ne.strokeStyle;break;case me.UNCOLORED:const Me=re.Util.makeHexColor($e[0],$e[1],$e[2]);ye.fillStyle=Me,ye.strokeStyle=Me,Ee.fillColor=Me,Ee.strokeColor=Me;break;default:throw new re.FormatError("Unsupported paint type: ".concat(Re))}}getPattern(Pe,Re,$e,ye){let Ee=$e;ye!==se.SHADING&&(Ee=re.Util.transform(Ee,Re.baseTransform),this.matrix&&(Ee=re.Util.transform(Ee,this.matrix)));const Ne=this.createPatternCanvas(Re);let Me=new DOMMatrix(Ee);Me=Me.translate(Ne.offsetX,Ne.offsetY),Me=Me.scale(1/Ne.scaleX,1/Ne.scaleY);const we=Pe.createPattern(Ne.canvas,"repeat");return we.setTransform(Me),we}};An(Se,"MAX_PATTERN_SIZE",3e3);let ve=Se;te.TilingPattern=ve},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.convertBlackAndWhiteToRGBA=se,te.convertToRGBA=ie,te.grayToRGBA=he;var re=ne(1);function ie(ue){switch(ue.kind){case re.ImageKind.GRAYSCALE_1BPP:return se(ue);case re.ImageKind.RGB_24BPP:return oe(ue)}return null}function se({src:ue,srcPos:de=0,dest:ae,width:le,height:Ae,nonBlackColor:_e=4294967295,inverseDecode:me=!1}){const ve=re.FeatureTest.isLittleEndian?4278190080:255,[Se,Te]=me?[_e,ve]:[ve,_e],Pe=le>>3,Re=le&7,$e=ue.length;ae=new Uint32Array(ae.buffer);let ye=0;for(let Ee=0;Ee<Ae;Ee++){for(const Me=de+Pe;de<Me;de++){const we=de<$e?ue[de]:255;ae[ye++]=we&128?Te:Se,ae[ye++]=we&64?Te:Se,ae[ye++]=we&32?Te:Se,ae[ye++]=we&16?Te:Se,ae[ye++]=we&8?Te:Se,ae[ye++]=we&4?Te:Se,ae[ye++]=we&2?Te:Se,ae[ye++]=we&1?Te:Se}if(Re===0)continue;const Ne=de<$e?ue[de++]:255;for(let Me=0;Me<Re;Me++)ae[ye++]=Ne&1<<7-Me?Te:Se}return{srcPos:de,destPos:ye}}function oe({src:ue,srcPos:de=0,dest:ae,destPos:le=0,width:Ae,height:_e}){let me=0;const ve=ue.length>>2,Se=new Uint32Array(ue.buffer,de,ve);if(re.FeatureTest.isLittleEndian){for(;me<ve-2;me+=3,le+=4){const Te=Se[me],Pe=Se[me+1],Re=Se[me+2];ae[le]=Te|4278190080,ae[le+1]=Te>>>24|Pe<<8|4278190080,ae[le+2]=Pe>>>16|Re<<16|4278190080,ae[le+3]=Re>>>8|4278190080}for(let Te=me*4,Pe=ue.length;Te<Pe;Te+=3)ae[le++]=ue[Te]|ue[Te+1]<<8|ue[Te+2]<<16|4278190080}else{for(;me<ve-2;me+=3,le+=4){const Te=Se[me],Pe=Se[me+1],Re=Se[me+2];ae[le]=Te|255,ae[le+1]=Te<<24|Pe>>>8|255,ae[le+2]=Pe<<16|Re>>>16|255,ae[le+3]=Re<<8|255}for(let Te=me*4,Pe=ue.length;Te<Pe;Te+=3)ae[le++]=ue[Te]<<24|ue[Te+1]<<16|ue[Te+2]<<8|255}return{srcPos:de,destPos:le}}function he(ue,de){if(re.FeatureTest.isLittleEndian)for(let ae=0,le=ue.length;ae<le;ae++)de[ae]=ue[ae]*65793|4278190080;else for(let ae=0,le=ue.length;ae<le;ae++)de[ae]=ue[ae]*16843008|255}},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.GlobalWorkerOptions=void 0;const ne=Object.create(null);te.GlobalWorkerOptions=ne,ne.workerPort=null,ne.workerSrc=""},(ee,te,ne)=>{var ue,Zr,ae,Jr,Ae,Zn;Object.defineProperty(te,"__esModule",{value:!0}),te.MessageHandler=void 0;var re=ne(1);const ie={UNKNOWN:0,DATA:1,ERROR:2},se={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function oe(me){switch(me instanceof Error||typeof me=="object"&&me!==null||(0,re.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),me.name){case"AbortException":return new re.AbortException(me.message);case"MissingPDFException":return new re.MissingPDFException(me.message);case"PasswordException":return new re.PasswordException(me.message,me.code);case"UnexpectedResponseException":return new re.UnexpectedResponseException(me.message,me.status);case"UnknownErrorException":return new re.UnknownErrorException(me.message,me.details);default:return new re.UnknownErrorException(me.message,me.toString())}}class he{constructor(ve,Se,Te){We(this,ue);We(this,ae);We(this,Ae);this.sourceName=ve,this.targetName=Se,this.comObj=Te,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=Pe=>{const Re=Pe.data;if(Re.targetName!==this.sourceName)return;if(Re.stream){Ke(this,ae,Jr).call(this,Re);return}if(Re.callback){const ye=Re.callbackId,Ee=this.callbackCapabilities[ye];if(!Ee)throw new Error("Cannot resolve callback ".concat(ye));if(delete this.callbackCapabilities[ye],Re.callback===ie.DATA)Ee.resolve(Re.data);else if(Re.callback===ie.ERROR)Ee.reject(oe(Re.reason));else throw new Error("Unexpected callback case");return}const $e=this.actionHandler[Re.action];if(!$e)throw new Error("Unknown action from worker: ".concat(Re.action));if(Re.callbackId){const ye=this.sourceName,Ee=Re.sourceName;new Promise(function(Ne){Ne($e(Re.data))}).then(function(Ne){Te.postMessage({sourceName:ye,targetName:Ee,callback:ie.DATA,callbackId:Re.callbackId,data:Ne})},function(Ne){Te.postMessage({sourceName:ye,targetName:Ee,callback:ie.ERROR,callbackId:Re.callbackId,reason:oe(Ne)})});return}if(Re.streamId){Ke(this,ue,Zr).call(this,Re);return}$e(Re.data)},Te.addEventListener("message",this._onComObjOnMessage)}on(ve,Se){const Te=this.actionHandler;if(Te[ve])throw new Error('There is already an actionName called "'.concat(ve,'"'));Te[ve]=Se}send(ve,Se,Te){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ve,data:Se},Te)}sendWithPromise(ve,Se,Te){const Pe=this.callbackId++,Re=new re.PromiseCapability;this.callbackCapabilities[Pe]=Re;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:ve,callbackId:Pe,data:Se},Te)}catch($e){Re.reject($e)}return Re.promise}sendWithStream(ve,Se,Te,Pe){const Re=this.streamId++,$e=this.sourceName,ye=this.targetName,Ee=this.comObj;return new ReadableStream({start:Ne=>{const Me=new re.PromiseCapability;return this.streamControllers[Re]={controller:Ne,startCall:Me,pullCall:null,cancelCall:null,isClosed:!1},Ee.postMessage({sourceName:$e,targetName:ye,action:ve,streamId:Re,data:Se,desiredSize:Ne.desiredSize},Pe),Me.promise},pull:Ne=>{const Me=new re.PromiseCapability;return this.streamControllers[Re].pullCall=Me,Ee.postMessage({sourceName:$e,targetName:ye,stream:se.PULL,streamId:Re,desiredSize:Ne.desiredSize}),Me.promise},cancel:Ne=>{(0,re.assert)(Ne instanceof Error,"cancel must have a valid reason");const Me=new re.PromiseCapability;return this.streamControllers[Re].cancelCall=Me,this.streamControllers[Re].isClosed=!0,Ee.postMessage({sourceName:$e,targetName:ye,stream:se.CANCEL,streamId:Re,reason:oe(Ne)}),Me.promise}},Te)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}ue=new WeakSet,Zr=function(ve){const Se=ve.streamId,Te=this.sourceName,Pe=ve.sourceName,Re=this.comObj,$e=this,ye=this.actionHandler[ve.action],Ee={enqueue(Ne,Me=1,we){if(this.isCancelled)return;const Oe=this.desiredSize;this.desiredSize-=Me,Oe>0&&this.desiredSize<=0&&(this.sinkCapability=new re.PromiseCapability,this.ready=this.sinkCapability.promise),Re.postMessage({sourceName:Te,targetName:Pe,stream:se.ENQUEUE,streamId:Se,chunk:Ne},we)},close(){this.isCancelled||(this.isCancelled=!0,Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CLOSE,streamId:Se}),delete $e.streamSinks[Se])},error(Ne){(0,re.assert)(Ne instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,Re.postMessage({sourceName:Te,targetName:Pe,stream:se.ERROR,streamId:Se,reason:oe(Ne)}))},sinkCapability:new re.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:ve.desiredSize,ready:null};Ee.sinkCapability.resolve(),Ee.ready=Ee.sinkCapability.promise,this.streamSinks[Se]=Ee,new Promise(function(Ne){Ne(ye(ve.data,Ee))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.START_COMPLETE,streamId:Se,success:!0})},function(Ne){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.START_COMPLETE,streamId:Se,reason:oe(Ne)})})},ae=new WeakSet,Jr=function(ve){const Se=ve.streamId,Te=this.sourceName,Pe=ve.sourceName,Re=this.comObj,$e=this.streamControllers[Se],ye=this.streamSinks[Se];switch(ve.stream){case se.START_COMPLETE:ve.success?$e.startCall.resolve():$e.startCall.reject(oe(ve.reason));break;case se.PULL_COMPLETE:ve.success?$e.pullCall.resolve():$e.pullCall.reject(oe(ve.reason));break;case se.PULL:if(!ye){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,success:!0});break}ye.desiredSize<=0&&ve.desiredSize>0&&ye.sinkCapability.resolve(),ye.desiredSize=ve.desiredSize,new Promise(function(Ee){var Ne;Ee((Ne=ye.onPull)==null?void 0:Ne.call(ye))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,success:!0})},function(Ee){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.PULL_COMPLETE,streamId:Se,reason:oe(Ee)})});break;case se.ENQUEUE:if((0,re.assert)($e,"enqueue should have stream controller"),$e.isClosed)break;$e.controller.enqueue(ve.chunk);break;case se.CLOSE:if((0,re.assert)($e,"close should have stream controller"),$e.isClosed)break;$e.isClosed=!0,$e.controller.close(),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.ERROR:(0,re.assert)($e,"error should have stream controller"),$e.controller.error(oe(ve.reason)),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.CANCEL_COMPLETE:ve.success?$e.cancelCall.resolve():$e.cancelCall.reject(oe(ve.reason)),Ke(this,Ae,Zn).call(this,$e,Se);break;case se.CANCEL:if(!ye)break;new Promise(function(Ee){var Ne;Ee((Ne=ye.onCancel)==null?void 0:Ne.call(ye,oe(ve.reason)))}).then(function(){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CANCEL_COMPLETE,streamId:Se,success:!0})},function(Ee){Re.postMessage({sourceName:Te,targetName:Pe,stream:se.CANCEL_COMPLETE,streamId:Se,reason:oe(Ee)})}),ye.sinkCapability.reject(oe(ve.reason)),ye.isCancelled=!0,delete this.streamSinks[Se];break;default:throw new Error("Unexpected stream case")}},Ae=new WeakSet,Zn=async function(ve,Se){var Te,Pe,Re;await Promise.allSettled([(Te=ve.startCall)==null?void 0:Te.promise,(Pe=ve.pullCall)==null?void 0:Pe.promise,(Re=ve.cancelCall)==null?void 0:Re.promise]),delete this.streamControllers[Se]},te.MessageHandler=he},(ee,te,ne)=>{var se,oe;Object.defineProperty(te,"__esModule",{value:!0}),te.Metadata=void 0;var re=ne(1);class ie{constructor({parsedData:ue,rawData:de}){We(this,se,void 0);We(this,oe,void 0);st(this,se,ue),st(this,oe,de)}getRaw(){return ce(this,oe)}get(ue){var de;return(de=ce(this,se).get(ue))!=null?de:null}getAll(){return(0,re.objectFromMap)(ce(this,se))}has(ue){return ce(this,se).has(ue)}}se=new WeakMap,oe=new WeakMap,te.Metadata=ie},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,Ar;Object.defineProperty(te,"__esModule",{value:!0}),te.OptionalContentConfig=void 0;var re=ne(1),ie=ne(8);const se=Symbol("INTERNAL");class oe{constructor(Se,Te){We(this,ue,!0);this.name=Se,this.intent=Te}get visible(){return ce(this,ue)}_setVisible(Se,Te){Se!==se&&(0,re.unreachable)("Internal method `_setVisible` called."),st(this,ue,Te)}}ue=new WeakMap;class he{constructor(Se){We(this,_e);We(this,de,null);We(this,ae,new Map);We(this,le,null);We(this,Ae,null);if(this.name=null,this.creator=null,Se!==null){this.name=Se.name,this.creator=Se.creator,st(this,Ae,Se.order);for(const Te of Se.groups)ce(this,ae).set(Te.id,new oe(Te.name,Te.intent));if(Se.baseState==="OFF")for(const Te of ce(this,ae).values())Te._setVisible(se,!1);for(const Te of Se.on)ce(this,ae).get(Te)._setVisible(se,!0);for(const Te of Se.off)ce(this,ae).get(Te)._setVisible(se,!1);st(this,le,this.getHash())}}isVisible(Se){if(ce(this,ae).size===0)return!0;if(!Se)return(0,re.warn)("Optional content group not defined."),!0;if(Se.type==="OCG")return ce(this,ae).has(Se.id)?ce(this,ae).get(Se.id).visible:((0,re.warn)("Optional content group not found: ".concat(Se.id)),!0);if(Se.type==="OCMD"){if(Se.expression)return Ke(this,_e,Ar).call(this,Se.expression);if(!Se.policy||Se.policy==="AnyOn"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(ce(this,ae).get(Te).visible)return!0}return!1}else if(Se.policy==="AllOn"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!ce(this,ae).get(Te).visible)return!1}return!0}else if(Se.policy==="AnyOff"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(!ce(this,ae).get(Te).visible)return!0}return!1}else if(Se.policy==="AllOff"){for(const Te of Se.ids){if(!ce(this,ae).has(Te))return(0,re.warn)("Optional content group not found: ".concat(Te)),!0;if(ce(this,ae).get(Te).visible)return!1}return!0}return(0,re.warn)("Unknown optional content policy ".concat(Se.policy,".")),!0}return(0,re.warn)("Unknown group type ".concat(Se.type,".")),!0}setVisibility(Se,Te=!0){if(!ce(this,ae).has(Se)){(0,re.warn)("Optional content group not found: ".concat(Se));return}ce(this,ae).get(Se)._setVisible(se,!!Te),st(this,de,null)}get hasInitialVisibility(){return ce(this,le)===null||this.getHash()===ce(this,le)}getOrder(){return ce(this,ae).size?ce(this,Ae)?ce(this,Ae).slice():[...ce(this,ae).keys()]:null}getGroups(){return ce(this,ae).size>0?(0,re.objectFromMap)(ce(this,ae)):null}getGroup(Se){return ce(this,ae).get(Se)||null}getHash(){if(ce(this,de)!==null)return ce(this,de);const Se=new ie.MurmurHash3_64;for(const[Te,Pe]of ce(this,ae))Se.update("".concat(Te,":").concat(Pe.visible));return st(this,de,Se.hexdigest())}}de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakSet,Ar=function(Se){const Te=Se.length;if(Te<2)return!0;const Pe=Se[0];for(let Re=1;Re<Te;Re++){const $e=Se[Re];let ye;if(Array.isArray($e))ye=Ke(this,_e,Ar).call(this,$e);else if(ce(this,ae).has($e))ye=ce(this,ae).get($e).visible;else return(0,re.warn)("Optional content group not found: ".concat($e)),!0;switch(Pe){case"And":if(!ye)return!1;break;case"Or":if(ye)return!0;break;case"Not":return!ye;default:return!0}}return Pe==="And"},te.OptionalContentConfig=he},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFDataTransportStream=void 0;var re=ne(1),ie=ne(6);class se{constructor({length:de,initialData:ae,progressiveDone:le=!1,contentDispositionFilename:Ae=null,disableRange:_e=!1,disableStream:me=!1},ve){if((0,re.assert)(ve,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=le,this._contentDispositionFilename=Ae,(ae==null?void 0:ae.length)>0){const Se=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;this._queuedChunks.push(Se)}this._pdfDataRangeTransport=ve,this._isStreamingSupported=!me,this._isRangeSupported=!_e,this._contentLength=de,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((Se,Te)=>{this._onReceiveData({begin:Se,chunk:Te})}),this._pdfDataRangeTransport.addProgressListener((Se,Te)=>{this._onProgress({loaded:Se,total:Te})}),this._pdfDataRangeTransport.addProgressiveReadListener(Se=>{this._onReceiveData({chunk:Se})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:de,chunk:ae}){const le=ae instanceof Uint8Array&&ae.byteLength===ae.buffer.byteLength?ae.buffer:new Uint8Array(ae).buffer;if(de===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(le):this._queuedChunks.push(le);else{const Ae=this._rangeReaders.some(function(_e){return _e._begin!==de?!1:(_e._enqueue(le),!0)});(0,re.assert)(Ae,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var de,ae;return(ae=(de=this._fullRequestReader)==null?void 0:de._loaded)!=null?ae:0}_onProgress(de){var ae,le,Ae,_e;de.total===void 0?(le=(ae=this._rangeReaders[0])==null?void 0:ae.onProgress)==null||le.call(ae,{loaded:de.loaded}):(_e=(Ae=this._fullRequestReader)==null?void 0:Ae.onProgress)==null||_e.call(Ae,{loaded:de.loaded,total:de.total})}_onProgressiveDone(){var de;(de=this._fullRequestReader)==null||de.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(de){const ae=this._rangeReaders.indexOf(de);ae>=0&&this._rangeReaders.splice(ae,1)}getFullReader(){(0,re.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const de=this._queuedChunks;return this._queuedChunks=null,new oe(this,de,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(de,ae){if(ae<=this._progressiveDataLength)return null;const le=new he(this,de,ae);return this._pdfDataRangeTransport.requestDataRange(de,ae),this._rangeReaders.push(le),le}cancelAllRequests(de){var ae;(ae=this._fullRequestReader)==null||ae.cancel(de);for(const le of this._rangeReaders.slice(0))le.cancel(de);this._pdfDataRangeTransport.abort()}}te.PDFDataTransportStream=se;class oe{constructor(de,ae,le=!1,Ae=null){this._stream=de,this._done=le||!1,this._filename=(0,ie.isPdfFile)(Ae)?Ae:null,this._queuedChunks=ae||[],this._loaded=0;for(const _e of this._queuedChunks)this._loaded+=_e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),de._fullRequestReader=this,this.onProgress=null}_enqueue(de){this._done||(this._requests.length>0?this._requests.shift().resolve({value:de,done:!1}):this._queuedChunks.push(de),this._loaded+=de.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const de=new re.PromiseCapability;return this._requests.push(de),de.promise}cancel(de){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class he{constructor(de,ae,le){this._stream=de,this._begin=ae,this._end=le,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(de){if(!this._done){if(this._requests.length===0)this._queuedChunk=de;else{this._requests.shift().resolve({value:de,done:!1});for(const le of this._requests)le.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const ae=this._queuedChunk;return this._queuedChunk=null,{value:ae,done:!1}}if(this._done)return{value:void 0,done:!0};const de=new re.PromiseCapability;return this._requests.push(de),de.promise}cancel(de){this._done=!0;for(const ae of this._requests)ae.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFFetchStream=void 0;var re=ne(1),ie=ne(20);function se(le,Ae,_e){return{method:"GET",headers:le,signal:_e.signal,mode:"cors",credentials:Ae?"include":"same-origin",redirect:"follow"}}function oe(le){const Ae=new Headers;for(const _e in le){const me=le[_e];me!==void 0&&Ae.append(_e,me)}return Ae}function he(le){return le instanceof Uint8Array?le.buffer:le instanceof ArrayBuffer?le:((0,re.warn)("getArrayBuffer - unexpected data format: ".concat(le)),new Uint8Array(le).buffer)}class ue{constructor(Ae){this.source=Ae,this.isHttp=/^https?:/i.test(Ae.url),this.httpHeaders=this.isHttp&&Ae.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ae,_e;return(_e=(Ae=this._fullRequestReader)==null?void 0:Ae._loaded)!=null?_e:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new de(this),this._fullRequestReader}getRangeReader(Ae,_e){if(_e<=this._progressiveDataLength)return null;const me=new ae(this,Ae,_e);return this._rangeRequestReaders.push(me),me}cancelAllRequests(Ae){var _e;(_e=this._fullRequestReader)==null||_e.cancel(Ae);for(const me of this._rangeRequestReaders.slice(0))me.cancel(Ae)}}te.PDFFetchStream=ue;class de{constructor(Ae){this._stream=Ae,this._reader=null,this._loaded=0,this._filename=null;const _e=Ae.source;this._withCredentials=_e.withCredentials||!1,this._contentLength=_e.length,this._headersCapability=new re.PromiseCapability,this._disableRange=_e.disableRange||!1,this._rangeChunkSize=_e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!_e.disableStream,this._isRangeSupported=!_e.disableRange,this._headers=oe(this._stream.httpHeaders);const me=_e.url;fetch(me,se(this._headers,this._withCredentials,this._abortController)).then(ve=>{if(!(0,ie.validateResponseStatus)(ve.status))throw(0,ie.createResponseStatusError)(ve.status,me);this._reader=ve.body.getReader(),this._headersCapability.resolve();const Se=Re=>ve.headers.get(Re),{allowRangeRequests:Te,suggestedLength:Pe}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:Se,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Te,this._contentLength=Pe||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(Se),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new re.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var me;await this._headersCapability.promise;const{value:Ae,done:_e}=await this._reader.read();return _e?{value:Ae,done:_e}:(this._loaded+=Ae.byteLength,(me=this.onProgress)==null||me.call(this,{loaded:this._loaded,total:this._contentLength}),{value:he(Ae),done:!1})}cancel(Ae){var _e;(_e=this._reader)==null||_e.cancel(Ae),this._abortController.abort()}}class ae{constructor(Ae,_e,me){this._stream=Ae,this._reader=null,this._loaded=0;const ve=Ae.source;this._withCredentials=ve.withCredentials||!1,this._readCapability=new re.PromiseCapability,this._isStreamingSupported=!ve.disableStream,this._abortController=new AbortController,this._headers=oe(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(_e,"-").concat(me-1));const Se=ve.url;fetch(Se,se(this._headers,this._withCredentials,this._abortController)).then(Te=>{if(!(0,ie.validateResponseStatus)(Te.status))throw(0,ie.createResponseStatusError)(Te.status,Se);this._readCapability.resolve(),this._reader=Te.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var me;await this._readCapability.promise;const{value:Ae,done:_e}=await this._reader.read();return _e?{value:Ae,done:_e}:(this._loaded+=Ae.byteLength,(me=this.onProgress)==null||me.call(this,{loaded:this._loaded}),{value:he(Ae),done:!1})}cancel(Ae){var _e;(_e=this._reader)==null||_e.cancel(Ae),this._abortController.abort()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.createResponseStatusError=ue,te.extractFilenameFromHeader=he,te.validateRangeRequestCapabilities=oe,te.validateResponseStatus=de;var re=ne(1),ie=ne(21),se=ne(6);function oe({getResponseHeader:ae,isHttp:le,rangeChunkSize:Ae,disableRange:_e}){const me={allowRangeRequests:!1,suggestedLength:void 0},ve=parseInt(ae("Content-Length"),10);return!Number.isInteger(ve)||(me.suggestedLength=ve,ve<=2*Ae)||_e||!le||ae("Accept-Ranges")!=="bytes"||(ae("Content-Encoding")||"identity")!=="identity"||(me.allowRangeRequests=!0),me}function he(ae){const le=ae("Content-Disposition");if(le){let Ae=(0,ie.getFilenameFromContentDispositionHeader)(le);if(Ae.includes("%"))try{Ae=decodeURIComponent(Ae)}catch{}if((0,se.isPdfFile)(Ae))return Ae}return null}function ue(ae,le){return ae===404||ae===0&&le.startsWith("file:")?new re.MissingPDFException('Missing PDF "'+le+'".'):new re.UnexpectedResponseException("Unexpected server response (".concat(ae,') while retrieving PDF "').concat(le,'".'),ae)}function de(ae){return ae===200||ae===206}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.getFilenameFromContentDispositionHeader=ie;var re=ne(1);function ie(se){let oe=!0,he=ue("filename\\*","i").exec(se);if(he){he=he[1];let ve=Ae(he);return ve=unescape(ve),ve=_e(ve),ve=me(ve),ae(ve)}if(he=le(se),he){const ve=me(he);return ae(ve)}if(he=ue("filename","i").exec(se),he){he=he[1];let ve=Ae(he);return ve=me(ve),ae(ve)}function ue(ve,Se){return new RegExp("(?:^|;)\\s*"+ve+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',Se)}function de(ve,Se){if(ve){if(!/^[\x00-\xFF]+$/.test(Se))return Se;try{const Te=new TextDecoder(ve,{fatal:!0}),Pe=(0,re.stringToBytes)(Se);Se=Te.decode(Pe),oe=!1}catch{}}return Se}function ae(ve){return oe&&/[\x80-\xff]/.test(ve)&&(ve=de("utf-8",ve),oe&&(ve=de("iso-8859-1",ve))),ve}function le(ve){const Se=[];let Te;const Pe=ue("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(Te=Pe.exec(ve))!==null;){let[,$e,ye,Ee]=Te;if($e=parseInt($e,10),$e in Se){if($e===0)break;continue}Se[$e]=[ye,Ee]}const Re=[];for(let $e=0;$e<Se.length&&$e in Se;++$e){let[ye,Ee]=Se[$e];Ee=Ae(Ee),ye&&(Ee=unescape(Ee),$e===0&&(Ee=_e(Ee))),Re.push(Ee)}return Re.join("")}function Ae(ve){if(ve.startsWith('"')){const Se=ve.slice(1).split('\\"');for(let Te=0;Te<Se.length;++Te){const Pe=Se[Te].indexOf('"');Pe!==-1&&(Se[Te]=Se[Te].slice(0,Pe),Se.length=Te+1),Se[Te]=Se[Te].replaceAll(/\\(.)/g,"$1")}ve=Se.join('"')}return ve}function _e(ve){const Se=ve.indexOf("'");if(Se===-1)return ve;const Te=ve.slice(0,Se),Re=ve.slice(Se+1).replace(/^[^']*'/,"");return de(Te,Re)}function me(ve){return!ve.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(ve)?ve:ve.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(Se,Te,Pe,Re){if(Pe==="q"||Pe==="Q")return Re=Re.replaceAll("_"," "),Re=Re.replaceAll(/=([0-9a-fA-F]{2})/g,function($e,ye){return String.fromCharCode(parseInt(ye,16))}),de(Te,Re);try{Re=atob(Re)}catch{}return de(Te,Re)})}return""}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNetworkStream=void 0;var re=ne(1),ie=ne(20);const se=200,oe=206;function he(Ae){const _e=Ae.response;return typeof _e!="string"?_e:(0,re.stringToBytes)(_e).buffer}class ue{constructor(_e,me={}){this.url=_e,this.isHttp=/^https?:/i.test(_e),this.httpHeaders=this.isHttp&&me.httpHeaders||Object.create(null),this.withCredentials=me.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(_e,me,ve){const Se={begin:_e,end:me};for(const Te in ve)Se[Te]=ve[Te];return this.request(Se)}requestFull(_e){return this.request(_e)}request(_e){const me=new XMLHttpRequest,ve=this.currXhrId++,Se=this.pendingRequests[ve]={xhr:me};me.open("GET",this.url),me.withCredentials=this.withCredentials;for(const Te in this.httpHeaders){const Pe=this.httpHeaders[Te];Pe!==void 0&&me.setRequestHeader(Te,Pe)}return this.isHttp&&"begin"in _e&&"end"in _e?(me.setRequestHeader("Range","bytes=".concat(_e.begin,"-").concat(_e.end-1)),Se.expectedStatus=oe):Se.expectedStatus=se,me.responseType="arraybuffer",_e.onError&&(me.onerror=function(Te){_e.onError(me.status)}),me.onreadystatechange=this.onStateChange.bind(this,ve),me.onprogress=this.onProgress.bind(this,ve),Se.onHeadersReceived=_e.onHeadersReceived,Se.onDone=_e.onDone,Se.onError=_e.onError,Se.onProgress=_e.onProgress,me.send(null),ve}onProgress(_e,me){var Se;const ve=this.pendingRequests[_e];ve&&((Se=ve.onProgress)==null||Se.call(ve,me))}onStateChange(_e,me){var $e,ye,Ee;const ve=this.pendingRequests[_e];if(!ve)return;const Se=ve.xhr;if(Se.readyState>=2&&ve.onHeadersReceived&&(ve.onHeadersReceived(),delete ve.onHeadersReceived),Se.readyState!==4||!(_e in this.pendingRequests))return;if(delete this.pendingRequests[_e],Se.status===0&&this.isHttp){($e=ve.onError)==null||$e.call(ve,Se.status);return}const Te=Se.status||se;if(!(Te===se&&ve.expectedStatus===oe)&&Te!==ve.expectedStatus){(ye=ve.onError)==null||ye.call(ve,Se.status);return}const Re=he(Se);if(Te===oe){const Ne=Se.getResponseHeader("Content-Range"),Me=/bytes (\d+)-(\d+)\/(\d+)/.exec(Ne);ve.onDone({begin:parseInt(Me[1],10),chunk:Re})}else Re?ve.onDone({begin:0,chunk:Re}):(Ee=ve.onError)==null||Ee.call(ve,Se.status)}getRequestXhr(_e){return this.pendingRequests[_e].xhr}isPendingRequest(_e){return _e in this.pendingRequests}abortRequest(_e){const me=this.pendingRequests[_e].xhr;delete this.pendingRequests[_e],me.abort()}}class de{constructor(_e){this._source=_e,this._manager=new ue(_e.url,{httpHeaders:_e.httpHeaders,withCredentials:_e.withCredentials}),this._rangeChunkSize=_e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(_e){const me=this._rangeRequestReaders.indexOf(_e);me>=0&&this._rangeRequestReaders.splice(me,1)}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ae(this._manager,this._source),this._fullRequestReader}getRangeReader(_e,me){const ve=new le(this._manager,_e,me);return ve.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(ve),ve}cancelAllRequests(_e){var me;(me=this._fullRequestReader)==null||me.cancel(_e);for(const ve of this._rangeRequestReaders.slice(0))ve.cancel(_e)}}te.PDFNetworkStream=de;class ae{constructor(_e,me){this._manager=_e;const ve={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=me.url,this._fullRequestId=_e.requestFull(ve),this._headersReceivedCapability=new re.PromiseCapability,this._disableRange=me.disableRange||!1,this._contentLength=me.length,this._rangeChunkSize=me.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const _e=this._fullRequestId,me=this._manager.getRequestXhr(_e),ve=Pe=>me.getResponseHeader(Pe),{allowRangeRequests:Se,suggestedLength:Te}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:ve,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});Se&&(this._isRangeSupported=!0),this._contentLength=Te||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(ve),this._isRangeSupported&&this._manager.abortRequest(_e),this._headersReceivedCapability.resolve()}_onDone(_e){if(_e&&(this._requests.length>0?this._requests.shift().resolve({value:_e.chunk,done:!1}):this._cachedChunks.push(_e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(_e){this._storedError=(0,ie.createResponseStatusError)(_e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const me of this._requests)me.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(_e){var me;(me=this.onProgress)==null||me.call(this,{loaded:_e.loaded,total:_e.lengthComputable?_e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const _e=new re.PromiseCapability;return this._requests.push(_e),_e.promise}cancel(_e){this._done=!0,this._headersReceivedCapability.reject(_e);for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class le{constructor(_e,me,ve){this._manager=_e;const Se={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=_e.url,this._requestId=_e.requestRange(me,ve,Se),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var _e;(_e=this.onClosed)==null||_e.call(this,this)}_onDone(_e){const me=_e.chunk;this._requests.length>0?this._requests.shift().resolve({value:me,done:!1}):this._queuedChunk=me,this._done=!0;for(const ve of this._requests)ve.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(_e){this._storedError=(0,ie.createResponseStatusError)(_e,this._url);for(const me of this._requests)me.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(_e){var me;this.isStreamingSupported||(me=this.onProgress)==null||me.call(this,{loaded:_e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const me=this._queuedChunk;return this._queuedChunk=null,{value:me,done:!1}}if(this._done)return{value:void 0,done:!0};const _e=new re.PromiseCapability;return this._requests.push(_e),_e.promise}cancel(_e){this._done=!0;for(const me of this._requests)me.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.PDFNodeStream=void 0;var re=ne(1),ie=ne(20);const se=/^file:\/\/\/[a-zA-Z]:\//;function oe(ve){const Se=require$$5,Te=Se.parse(ve);return Te.protocol==="file:"||Te.host?Te:/^[a-z]:[/\\]/i.test(ve)?Se.parse("file:///".concat(ve)):(Te.host||(Te.protocol="file:"),Te)}class he{constructor(Se){this.source=Se,this.url=oe(Se.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Se.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Se,Te;return(Te=(Se=this._fullRequestReader)==null?void 0:Se._loaded)!=null?Te:0}getFullReader(){return(0,re.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new _e(this):new le(this),this._fullRequestReader}getRangeReader(Se,Te){if(Te<=this._progressiveDataLength)return null;const Pe=this.isFsUrl?new me(this,Se,Te):new Ae(this,Se,Te);return this._rangeRequestReaders.push(Pe),Pe}cancelAllRequests(Se){var Te;(Te=this._fullRequestReader)==null||Te.cancel(Se);for(const Pe of this._rangeRequestReaders.slice(0))Pe.cancel(Se)}}te.PDFNodeStream=he;class ue{constructor(Se){this._url=Se.url,this._done=!1,this._storedError=null,this.onProgress=null;const Te=Se.source;this._contentLength=Te.length,this._loaded=0,this._filename=null,this._disableRange=Te.disableRange||!1,this._rangeChunkSize=Te.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!Te.disableStream,this._isRangeSupported=!Te.disableRange,this._readableStream=null,this._readCapability=new re.PromiseCapability,this._headersCapability=new re.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Pe;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Se=this._readableStream.read();return Se===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Se.length,(Pe=this.onProgress)==null||Pe.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Se).buffer,done:!1})}cancel(Se){if(!this._readableStream){this._error(Se);return}this._readableStream.destroy(Se)}_error(Se){this._storedError=Se,this._readCapability.resolve()}_setReadableStream(Se){this._readableStream=Se,Se.on("readable",()=>{this._readCapability.resolve()}),Se.on("end",()=>{Se.destroy(),this._done=!0,this._readCapability.resolve()}),Se.on("error",Te=>{this._error(Te)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new re.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class de{constructor(Se){this._url=Se.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new re.PromiseCapability;const Te=Se.source;this._isStreamingSupported=!Te.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Pe;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Se=this._readableStream.read();return Se===null?(this._readCapability=new re.PromiseCapability,this.read()):(this._loaded+=Se.length,(Pe=this.onProgress)==null||Pe.call(this,{loaded:this._loaded}),{value:new Uint8Array(Se).buffer,done:!1})}cancel(Se){if(!this._readableStream){this._error(Se);return}this._readableStream.destroy(Se)}_error(Se){this._storedError=Se,this._readCapability.resolve()}_setReadableStream(Se){this._readableStream=Se,Se.on("readable",()=>{this._readCapability.resolve()}),Se.on("end",()=>{Se.destroy(),this._done=!0,this._readCapability.resolve()}),Se.on("error",Te=>{this._error(Te)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ae(ve,Se){return{protocol:ve.protocol,auth:ve.auth,host:ve.hostname,port:ve.port,path:ve.path,method:"GET",headers:Se}}class le extends ue{constructor(Se){super(Se);const Te=Pe=>{if(Pe.statusCode===404){const Ee=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=Ee,this._headersCapability.reject(Ee);return}this._headersCapability.resolve(),this._setReadableStream(Pe);const Re=Ee=>this._readableStream.headers[Ee.toLowerCase()],{allowRangeRequests:$e,suggestedLength:ye}=(0,ie.validateRangeRequestCapabilities)({getResponseHeader:Re,isHttp:Se.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=$e,this._contentLength=ye||this._contentLength,this._filename=(0,ie.extractFilenameFromHeader)(Re)};if(this._request=null,this._url.protocol==="http:"){const Pe=require$$5;this._request=Pe.request(ae(this._url,Se.httpHeaders),Te)}else{const Pe=require$$5;this._request=Pe.request(ae(this._url,Se.httpHeaders),Te)}this._request.on("error",Pe=>{this._storedError=Pe,this._headersCapability.reject(Pe)}),this._request.end()}}class Ae extends de{constructor(Se,Te,Pe){super(Se),this._httpHeaders={};for(const $e in Se.httpHeaders){const ye=Se.httpHeaders[$e];ye!==void 0&&(this._httpHeaders[$e]=ye)}this._httpHeaders.Range="bytes=".concat(Te,"-").concat(Pe-1);const Re=$e=>{if($e.statusCode===404){const ye=new re.MissingPDFException('Missing PDF "'.concat(this._url,'".'));this._storedError=ye;return}this._setReadableStream($e)};if(this._request=null,this._url.protocol==="http:"){const $e=require$$5;this._request=$e.request(ae(this._url,this._httpHeaders),Re)}else{const $e=require$$5;this._request=$e.request(ae(this._url,this._httpHeaders),Re)}this._request.on("error",$e=>{this._storedError=$e}),this._request.end()}}class _e extends ue{constructor(Se){super(Se);let Te=decodeURIComponent(this._url.path);se.test(this._url.href)&&(Te=Te.replace(/^\//,""));const Pe=require$$5;Pe.lstat(Te,(Re,$e)=>{if(Re){Re.code==="ENOENT"&&(Re=new re.MissingPDFException('Missing PDF "'.concat(Te,'".'))),this._storedError=Re,this._headersCapability.reject(Re);return}this._contentLength=$e.size,this._setReadableStream(Pe.createReadStream(Te)),this._headersCapability.resolve()})}}class me extends de{constructor(Se,Te,Pe){super(Se);let Re=decodeURIComponent(this._url.path);se.test(this._url.href)&&(Re=Re.replace(/^\//,""));const $e=require$$5;this._setReadableStream($e.createReadStream(Re,{start:Te,end:Pe-1}))}}},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.SVGGraphics=void 0;var re=ne(6),ie=ne(1);const se={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},oe="http://www.w3.org/XML/1998/namespace",he="http://www.w3.org/1999/xlink",ue=["butt","round","square"],de=["miter","round","bevel"],ae=function($e,ye="",Ee=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!Ee)return URL.createObjectURL(new Blob([$e],{type:ye}));const Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let Me="data:".concat(ye,";base64,");for(let we=0,Oe=$e.length;we<Oe;we+=3){const Fe=$e[we]&255,Ve=$e[we+1]&255,qe=$e[we+2]&255,Ie=Fe>>2,Xe=(Fe&3)<<4|Ve>>4,rt=we+1<Oe?(Ve&15)<<2|qe>>6:64,lt=we+2<Oe?qe&63:64;Me+=Ne[Ie]+Ne[Xe]+Ne[rt]+Ne[lt]}return Me},le=function(){const $e=new Uint8Array([137,80,78,71,13,10,26,10]),ye=12,Ee=new Int32Array(256);for(let qe=0;qe<256;qe++){let Ie=qe;for(let Xe=0;Xe<8;Xe++)Ie=Ie&1?3988292384^Ie>>1&2147483647:Ie>>1&2147483647;Ee[qe]=Ie}function Ne(qe,Ie,Xe){let rt=-1;for(let lt=Ie;lt<Xe;lt++){const Ge=(rt^qe[lt])&255,ut=Ee[Ge];rt=rt>>>8^ut}return rt^-1}function Me(qe,Ie,Xe,rt){let lt=rt;const Ge=Ie.length;Xe[lt]=Ge>>24&255,Xe[lt+1]=Ge>>16&255,Xe[lt+2]=Ge>>8&255,Xe[lt+3]=Ge&255,lt+=4,Xe[lt]=qe.charCodeAt(0)&255,Xe[lt+1]=qe.charCodeAt(1)&255,Xe[lt+2]=qe.charCodeAt(2)&255,Xe[lt+3]=qe.charCodeAt(3)&255,lt+=4,Xe.set(Ie,lt),lt+=Ie.length;const ut=Ne(Xe,rt+4,lt);Xe[lt]=ut>>24&255,Xe[lt+1]=ut>>16&255,Xe[lt+2]=ut>>8&255,Xe[lt+3]=ut&255}function we(qe,Ie,Xe){let rt=1,lt=0;for(let Ge=Ie;Ge<Xe;++Ge)rt=(rt+(qe[Ge]&255))%65521,lt=(lt+rt)%65521;return lt<<16|rt}function Oe(qe){if(!ie.isNodeJS)return Fe(qe);try{const Ie=parseInt(process.versions.node)>=8?qe:Buffer.from(qe),Xe=require$$5.deflateSync(Ie,{level:9});return Xe instanceof Uint8Array?Xe:new Uint8Array(Xe)}catch(Ie){(0,ie.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+Ie)}return Fe(qe)}function Fe(qe){let Ie=qe.length;const Xe=65535,rt=Math.ceil(Ie/Xe),lt=new Uint8Array(2+Ie+rt*5+4);let Ge=0;lt[Ge++]=120,lt[Ge++]=156;let ut=0;for(;Ie>Xe;)lt[Ge++]=0,lt[Ge++]=255,lt[Ge++]=255,lt[Ge++]=0,lt[Ge++]=0,lt.set(qe.subarray(ut,ut+Xe),Ge),Ge+=Xe,ut+=Xe,Ie-=Xe;lt[Ge++]=1,lt[Ge++]=Ie&255,lt[Ge++]=Ie>>8&255,lt[Ge++]=~Ie&65535&255,lt[Ge++]=(~Ie&65535)>>8&255,lt.set(qe.subarray(ut),Ge),Ge+=qe.length-ut;const mt=we(qe,0,qe.length);return lt[Ge++]=mt>>24&255,lt[Ge++]=mt>>16&255,lt[Ge++]=mt>>8&255,lt[Ge++]=mt&255,lt}function Ve(qe,Ie,Xe,rt){const lt=qe.width,Ge=qe.height;let ut,mt,wt;const Et=qe.data;switch(Ie){case ie.ImageKind.GRAYSCALE_1BPP:mt=0,ut=1,wt=lt+7>>3;break;case ie.ImageKind.RGB_24BPP:mt=2,ut=8,wt=lt*3;break;case ie.ImageKind.RGBA_32BPP:mt=6,ut=8,wt=lt*4;break;default:throw new Error("invalid format")}const De=new Uint8Array((1+wt)*Ge);let pe=0,be=0;for(let He=0;He<Ge;++He)De[pe++]=0,De.set(Et.subarray(be,be+wt),pe),be+=wt,pe+=wt;if(Ie===ie.ImageKind.GRAYSCALE_1BPP&&rt){pe=0;for(let He=0;He<Ge;He++){pe++;for(let it=0;it<wt;it++)De[pe++]^=255}}const ge=new Uint8Array([lt>>24&255,lt>>16&255,lt>>8&255,lt&255,Ge>>24&255,Ge>>16&255,Ge>>8&255,Ge&255,ut,mt,0,0,0]),Ce=Oe(De),xe=$e.length+ye*3+ge.length+Ce.length,Le=new Uint8Array(xe);let Be=0;return Le.set($e,Be),Be+=$e.length,Me("IHDR",ge,Le,Be),Be+=ye+ge.length,Me("IDATA",Ce,Le,Be),Be+=ye+Ce.length,Me("IEND",new Uint8Array(0),Le,Be),ae(Le,"image/png",Xe)}return function(Ie,Xe,rt){const lt=Ie.kind===void 0?ie.ImageKind.GRAYSCALE_1BPP:Ie.kind;return Ve(Ie,lt,Xe,rt)}}();class Ae{constructor(){this.fontSizeScale=1,this.fontWeight=se.fontWeight,this.fontSize=0,this.textMatrix=ie.IDENTITY_MATRIX,this.fontMatrix=ie.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=ie.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=se.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(ye,Ee){this.x=ye,this.y=Ee}}function _e($e){let ye=[];const Ee=[];for(const Ne of $e){if(Ne.fn==="save"){ye.push({fnId:92,fn:"group",items:[]}),Ee.push(ye),ye=ye.at(-1).items;continue}Ne.fn==="restore"?ye=Ee.pop():ye.push(Ne)}return ye}function me($e){if(Number.isInteger($e))return $e.toString();const ye=$e.toFixed(10);let Ee=ye.length-1;if(ye[Ee]!=="0")return ye;do Ee--;while(ye[Ee]==="0");return ye.substring(0,ye[Ee]==="."?Ee:Ee+1)}function ve($e){if($e[4]===0&&$e[5]===0){if($e[1]===0&&$e[2]===0)return $e[0]===1&&$e[3]===1?"":"scale(".concat(me($e[0])," ").concat(me($e[3]),")");if($e[0]===$e[3]&&$e[1]===-$e[2]){const ye=Math.acos($e[0])*180/Math.PI;return"rotate(".concat(me(ye),")")}}else if($e[0]===1&&$e[1]===0&&$e[2]===0&&$e[3]===1)return"translate(".concat(me($e[4])," ").concat(me($e[5]),")");return"matrix(".concat(me($e[0])," ").concat(me($e[1])," ").concat(me($e[2])," ").concat(me($e[3])," ").concat(me($e[4])," ")+"".concat(me($e[5]),")")}let Se=0,Te=0,Pe=0;class Re{constructor(ye,Ee,Ne=!1){(0,re.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new re.DOMSVGFactory,this.current=new Ae,this.transformMatrix=ie.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=ye,this.objs=Ee,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!Ne,this._operatorIdMapping=[];for(const Me in ie.OPS)this._operatorIdMapping[ie.OPS[Me]]=Me}getObject(ye,Ee=null){return typeof ye=="string"?ye.startsWith("g_")?this.commonObjs.get(ye):this.objs.get(ye):Ee}save(){this.transformStack.push(this.transformMatrix);const ye=this.current;this.extraStack.push(ye),this.current=ye.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(ye){this.save(),this.executeOpTree(ye),this.restore()}loadDependencies(ye){const Ee=ye.fnArray,Ne=ye.argsArray;for(let Me=0,we=Ee.length;Me<we;Me++)if(Ee[Me]===ie.OPS.dependency)for(const Oe of Ne[Me]){const Fe=Oe.startsWith("g_")?this.commonObjs:this.objs,Ve=new Promise(qe=>{Fe.get(Oe,qe)});this.current.dependencies.push(Ve)}return Promise.all(this.current.dependencies)}transform(ye,Ee,Ne,Me,we,Oe){const Fe=[ye,Ee,Ne,Me,we,Oe];this.transformMatrix=ie.Util.transform(this.transformMatrix,Fe),this.tgrp=null}getSVG(ye,Ee){this.viewport=Ee;const Ne=this._initialize(Ee);return this.loadDependencies(ye).then(()=>(this.transformMatrix=ie.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(ye)),Ne))}convertOpList(ye){const Ee=this._operatorIdMapping,Ne=ye.argsArray,Me=ye.fnArray,we=[];for(let Oe=0,Fe=Me.length;Oe<Fe;Oe++){const Ve=Me[Oe];we.push({fnId:Ve,fn:Ee[Ve],args:Ne[Oe]})}return _e(we)}executeOpTree(ye){for(const Ee of ye){const Ne=Ee.fn,Me=Ee.fnId,we=Ee.args;switch(Me|0){case ie.OPS.beginText:this.beginText();break;case ie.OPS.dependency:break;case ie.OPS.setLeading:this.setLeading(we);break;case ie.OPS.setLeadingMoveText:this.setLeadingMoveText(we[0],we[1]);break;case ie.OPS.setFont:this.setFont(we);break;case ie.OPS.showText:this.showText(we[0]);break;case ie.OPS.showSpacedText:this.showText(we[0]);break;case ie.OPS.endText:this.endText();break;case ie.OPS.moveText:this.moveText(we[0],we[1]);break;case ie.OPS.setCharSpacing:this.setCharSpacing(we[0]);break;case ie.OPS.setWordSpacing:this.setWordSpacing(we[0]);break;case ie.OPS.setHScale:this.setHScale(we[0]);break;case ie.OPS.setTextMatrix:this.setTextMatrix(we[0],we[1],we[2],we[3],we[4],we[5]);break;case ie.OPS.setTextRise:this.setTextRise(we[0]);break;case ie.OPS.setTextRenderingMode:this.setTextRenderingMode(we[0]);break;case ie.OPS.setLineWidth:this.setLineWidth(we[0]);break;case ie.OPS.setLineJoin:this.setLineJoin(we[0]);break;case ie.OPS.setLineCap:this.setLineCap(we[0]);break;case ie.OPS.setMiterLimit:this.setMiterLimit(we[0]);break;case ie.OPS.setFillRGBColor:this.setFillRGBColor(we[0],we[1],we[2]);break;case ie.OPS.setStrokeRGBColor:this.setStrokeRGBColor(we[0],we[1],we[2]);break;case ie.OPS.setStrokeColorN:this.setStrokeColorN(we);break;case ie.OPS.setFillColorN:this.setFillColorN(we);break;case ie.OPS.shadingFill:this.shadingFill(we[0]);break;case ie.OPS.setDash:this.setDash(we[0],we[1]);break;case ie.OPS.setRenderingIntent:this.setRenderingIntent(we[0]);break;case ie.OPS.setFlatness:this.setFlatness(we[0]);break;case ie.OPS.setGState:this.setGState(we[0]);break;case ie.OPS.fill:this.fill();break;case ie.OPS.eoFill:this.eoFill();break;case ie.OPS.stroke:this.stroke();break;case ie.OPS.fillStroke:this.fillStroke();break;case ie.OPS.eoFillStroke:this.eoFillStroke();break;case ie.OPS.clip:this.clip("nonzero");break;case ie.OPS.eoClip:this.clip("evenodd");break;case ie.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case ie.OPS.paintImageXObject:this.paintImageXObject(we[0]);break;case ie.OPS.paintInlineImageXObject:this.paintInlineImageXObject(we[0]);break;case ie.OPS.paintImageMaskXObject:this.paintImageMaskXObject(we[0]);break;case ie.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(we[0],we[1]);break;case ie.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case ie.OPS.closePath:this.closePath();break;case ie.OPS.closeStroke:this.closeStroke();break;case ie.OPS.closeFillStroke:this.closeFillStroke();break;case ie.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case ie.OPS.nextLine:this.nextLine();break;case ie.OPS.transform:this.transform(we[0],we[1],we[2],we[3],we[4],we[5]);break;case ie.OPS.constructPath:this.constructPath(we[0],we[1]);break;case ie.OPS.endPath:this.endPath();break;case 92:this.group(Ee.items);break;default:(0,ie.warn)("Unimplemented operator ".concat(Ne));break}}}setWordSpacing(ye){this.current.wordSpacing=ye}setCharSpacing(ye){this.current.charSpacing=ye}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(ye,Ee,Ne,Me,we,Oe){const Fe=this.current;Fe.textMatrix=Fe.lineMatrix=[ye,Ee,Ne,Me,we,Oe],Fe.textMatrixScale=Math.hypot(ye,Ee),Fe.x=Fe.lineX=0,Fe.y=Fe.lineY=0,Fe.xcoords=[],Fe.ycoords=[],Fe.tspan=this.svgFactory.createElement("svg:tspan"),Fe.tspan.setAttributeNS(null,"font-family",Fe.fontFamily),Fe.tspan.setAttributeNS(null,"font-size","".concat(me(Fe.fontSize),"px")),Fe.tspan.setAttributeNS(null,"y",me(-Fe.y)),Fe.txtElement=this.svgFactory.createElement("svg:text"),Fe.txtElement.append(Fe.tspan)}beginText(){const ye=this.current;ye.x=ye.lineX=0,ye.y=ye.lineY=0,ye.textMatrix=ie.IDENTITY_MATRIX,ye.lineMatrix=ie.IDENTITY_MATRIX,ye.textMatrixScale=1,ye.tspan=this.svgFactory.createElement("svg:tspan"),ye.txtElement=this.svgFactory.createElement("svg:text"),ye.txtgrp=this.svgFactory.createElement("svg:g"),ye.xcoords=[],ye.ycoords=[]}moveText(ye,Ee){const Ne=this.current;Ne.x=Ne.lineX+=ye,Ne.y=Ne.lineY+=Ee,Ne.xcoords=[],Ne.ycoords=[],Ne.tspan=this.svgFactory.createElement("svg:tspan"),Ne.tspan.setAttributeNS(null,"font-family",Ne.fontFamily),Ne.tspan.setAttributeNS(null,"font-size","".concat(me(Ne.fontSize),"px")),Ne.tspan.setAttributeNS(null,"y",me(-Ne.y))}showText(ye){const Ee=this.current,Ne=Ee.font,Me=Ee.fontSize;if(Me===0)return;const we=Ee.fontSizeScale,Oe=Ee.charSpacing,Fe=Ee.wordSpacing,Ve=Ee.fontDirection,qe=Ee.textHScale*Ve,Ie=Ne.vertical,Xe=Ie?1:-1,rt=Ne.defaultVMetrics,lt=Me*Ee.fontMatrix[0];let Ge=0;for(const wt of ye){if(wt===null){Ge+=Ve*Fe;continue}else if(typeof wt=="number"){Ge+=Xe*wt*Me/1e3;continue}const Et=(wt.isSpace?Fe:0)+Oe,De=wt.fontChar;let pe,be,ge=wt.width;if(Ie){let xe;const Le=wt.vmetric||rt;xe=wt.vmetric?Le[1]:ge*.5,xe=-xe*lt;const Be=Le[2]*lt;ge=Le?-Le[0]:ge,pe=xe/we,be=(Ge+Be)/we}else pe=Ge/we,be=0;(wt.isInFont||Ne.missingFile)&&(Ee.xcoords.push(Ee.x+pe),Ie&&Ee.ycoords.push(-Ee.y+be),Ee.tspan.textContent+=De);const Ce=Ie?ge*lt-Et*Ve:ge*lt+Et*Ve;Ge+=Ce}Ee.tspan.setAttributeNS(null,"x",Ee.xcoords.map(me).join(" ")),Ie?Ee.tspan.setAttributeNS(null,"y",Ee.ycoords.map(me).join(" ")):Ee.tspan.setAttributeNS(null,"y",me(-Ee.y)),Ie?Ee.y-=Ge:Ee.x+=Ge*qe,Ee.tspan.setAttributeNS(null,"font-family",Ee.fontFamily),Ee.tspan.setAttributeNS(null,"font-size","".concat(me(Ee.fontSize),"px")),Ee.fontStyle!==se.fontStyle&&Ee.tspan.setAttributeNS(null,"font-style",Ee.fontStyle),Ee.fontWeight!==se.fontWeight&&Ee.tspan.setAttributeNS(null,"font-weight",Ee.fontWeight);const ut=Ee.textRenderingMode&ie.TextRenderingMode.FILL_STROKE_MASK;if(ut===ie.TextRenderingMode.FILL||ut===ie.TextRenderingMode.FILL_STROKE?(Ee.fillColor!==se.fillColor&&Ee.tspan.setAttributeNS(null,"fill",Ee.fillColor),Ee.fillAlpha<1&&Ee.tspan.setAttributeNS(null,"fill-opacity",Ee.fillAlpha)):Ee.textRenderingMode===ie.TextRenderingMode.ADD_TO_PATH?Ee.tspan.setAttributeNS(null,"fill","transparent"):Ee.tspan.setAttributeNS(null,"fill","none"),ut===ie.TextRenderingMode.STROKE||ut===ie.TextRenderingMode.FILL_STROKE){const wt=1/(Ee.textMatrixScale||1);this._setStrokeAttributes(Ee.tspan,wt)}let mt=Ee.textMatrix;Ee.textRise!==0&&(mt=mt.slice(),mt[5]+=Ee.textRise),Ee.txtElement.setAttributeNS(null,"transform","".concat(ve(mt)," scale(").concat(me(qe),", -1)")),Ee.txtElement.setAttributeNS(oe,"xml:space","preserve"),Ee.txtElement.append(Ee.tspan),Ee.txtgrp.append(Ee.txtElement),this._ensureTransformGroup().append(Ee.txtElement)}setLeadingMoveText(ye,Ee){this.setLeading(-Ee),this.moveText(ye,Ee)}addFontStyle(ye){if(!ye.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const Ee=ae(ye.data,ye.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(ye.loadedName,'";')+" src: url(".concat(Ee,"); }\n")}setFont(ye){const Ee=this.current,Ne=this.commonObjs.get(ye[0]);let Me=ye[1];Ee.font=Ne,this.embedFonts&&!Ne.missingFile&&!this.embeddedFonts[Ne.loadedName]&&(this.addFontStyle(Ne),this.embeddedFonts[Ne.loadedName]=Ne),Ee.fontMatrix=Ne.fontMatrix||ie.FONT_IDENTITY_MATRIX;let we="normal";Ne.black?we="900":Ne.bold&&(we="bold");const Oe=Ne.italic?"italic":"normal";Me<0?(Me=-Me,Ee.fontDirection=-1):Ee.fontDirection=1,Ee.fontSize=Me,Ee.fontFamily=Ne.loadedName,Ee.fontWeight=we,Ee.fontStyle=Oe,Ee.tspan=this.svgFactory.createElement("svg:tspan"),Ee.tspan.setAttributeNS(null,"y",me(-Ee.y)),Ee.xcoords=[],Ee.ycoords=[]}endText(){var Ee;const ye=this.current;ye.textRenderingMode&ie.TextRenderingMode.ADD_TO_PATH_FLAG&&((Ee=ye.txtElement)!=null&&Ee.hasChildNodes())&&(ye.element=ye.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(ye){ye>0&&(this.current.lineWidth=ye)}setLineCap(ye){this.current.lineCap=ue[ye]}setLineJoin(ye){this.current.lineJoin=de[ye]}setMiterLimit(ye){this.current.miterLimit=ye}setStrokeAlpha(ye){this.current.strokeAlpha=ye}setStrokeRGBColor(ye,Ee,Ne){this.current.strokeColor=ie.Util.makeHexColor(ye,Ee,Ne)}setFillAlpha(ye){this.current.fillAlpha=ye}setFillRGBColor(ye,Ee,Ne){this.current.fillColor=ie.Util.makeHexColor(ye,Ee,Ne),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(ye){this.current.strokeColor=this._makeColorN_Pattern(ye)}setFillColorN(ye){this.current.fillColor=this._makeColorN_Pattern(ye)}shadingFill(ye){const{width:Ee,height:Ne}=this.viewport,Me=ie.Util.inverseTransform(this.transformMatrix),[we,Oe,Fe,Ve]=ie.Util.getAxialAlignedBoundingBox([0,0,Ee,Ne],Me),qe=this.svgFactory.createElement("svg:rect");qe.setAttributeNS(null,"x",we),qe.setAttributeNS(null,"y",Oe),qe.setAttributeNS(null,"width",Fe-we),qe.setAttributeNS(null,"height",Ve-Oe),qe.setAttributeNS(null,"fill",this._makeShadingPattern(ye)),this.current.fillAlpha<1&&qe.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(qe)}_makeColorN_Pattern(ye){return ye[0]==="TilingPattern"?this._makeTilingPattern(ye):this._makeShadingPattern(ye)}_makeTilingPattern(ye){const Ee=ye[1],Ne=ye[2],Me=ye[3]||ie.IDENTITY_MATRIX,[we,Oe,Fe,Ve]=ye[4],qe=ye[5],Ie=ye[6],Xe=ye[7],rt="shading".concat(Pe++),[lt,Ge,ut,mt]=ie.Util.normalizeRect([...ie.Util.applyTransform([we,Oe],Me),...ie.Util.applyTransform([Fe,Ve],Me)]),[wt,Et]=ie.Util.singularValueDecompose2dScale(Me),De=qe*wt,pe=Ie*Et,be=this.svgFactory.createElement("svg:pattern");be.setAttributeNS(null,"id",rt),be.setAttributeNS(null,"patternUnits","userSpaceOnUse"),be.setAttributeNS(null,"width",De),be.setAttributeNS(null,"height",pe),be.setAttributeNS(null,"x","".concat(lt)),be.setAttributeNS(null,"y","".concat(Ge));const ge=this.svg,Ce=this.transformMatrix,xe=this.current.fillColor,Le=this.current.strokeColor,Be=this.svgFactory.create(ut-lt,mt-Ge);if(this.svg=Be,this.transformMatrix=Me,Xe===2){const He=ie.Util.makeHexColor(...Ee);this.current.fillColor=He,this.current.strokeColor=He}return this.executeOpTree(this.convertOpList(Ne)),this.svg=ge,this.transformMatrix=Ce,this.current.fillColor=xe,this.current.strokeColor=Le,be.append(Be.childNodes[0]),this.defs.append(be),"url(#".concat(rt,")")}_makeShadingPattern(ye){switch(typeof ye=="string"&&(ye=this.objs.get(ye)),ye[0]){case"RadialAxial":const Ee="shading".concat(Pe++),Ne=ye[3];let Me;switch(ye[1]){case"axial":const we=ye[4],Oe=ye[5];Me=this.svgFactory.createElement("svg:linearGradient"),Me.setAttributeNS(null,"id",Ee),Me.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Me.setAttributeNS(null,"x1",we[0]),Me.setAttributeNS(null,"y1",we[1]),Me.setAttributeNS(null,"x2",Oe[0]),Me.setAttributeNS(null,"y2",Oe[1]);break;case"radial":const Fe=ye[4],Ve=ye[5],qe=ye[6],Ie=ye[7];Me=this.svgFactory.createElement("svg:radialGradient"),Me.setAttributeNS(null,"id",Ee),Me.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),Me.setAttributeNS(null,"cx",Ve[0]),Me.setAttributeNS(null,"cy",Ve[1]),Me.setAttributeNS(null,"r",Ie),Me.setAttributeNS(null,"fx",Fe[0]),Me.setAttributeNS(null,"fy",Fe[1]),Me.setAttributeNS(null,"fr",qe);break;default:throw new Error("Unknown RadialAxial type: ".concat(ye[1]))}for(const we of Ne){const Oe=this.svgFactory.createElement("svg:stop");Oe.setAttributeNS(null,"offset",we[0]),Oe.setAttributeNS(null,"stop-color",we[1]),Me.append(Oe)}return this.defs.append(Me),"url(#".concat(Ee,")");case"Mesh":return(0,ie.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(ye[0]))}}setDash(ye,Ee){this.current.dashArray=ye,this.current.dashPhase=Ee}constructPath(ye,Ee){const Ne=this.current;let Me=Ne.x,we=Ne.y,Oe=[],Fe=0;for(const Ve of ye)switch(Ve|0){case ie.OPS.rectangle:Me=Ee[Fe++],we=Ee[Fe++];const qe=Ee[Fe++],Ie=Ee[Fe++],Xe=Me+qe,rt=we+Ie;Oe.push("M",me(Me),me(we),"L",me(Xe),me(we),"L",me(Xe),me(rt),"L",me(Me),me(rt),"Z");break;case ie.OPS.moveTo:Me=Ee[Fe++],we=Ee[Fe++],Oe.push("M",me(Me),me(we));break;case ie.OPS.lineTo:Me=Ee[Fe++],we=Ee[Fe++],Oe.push("L",me(Me),me(we));break;case ie.OPS.curveTo:Me=Ee[Fe+4],we=Ee[Fe+5],Oe.push("C",me(Ee[Fe]),me(Ee[Fe+1]),me(Ee[Fe+2]),me(Ee[Fe+3]),me(Me),me(we)),Fe+=6;break;case ie.OPS.curveTo2:Oe.push("C",me(Me),me(we),me(Ee[Fe]),me(Ee[Fe+1]),me(Ee[Fe+2]),me(Ee[Fe+3])),Me=Ee[Fe+2],we=Ee[Fe+3],Fe+=4;break;case ie.OPS.curveTo3:Me=Ee[Fe+2],we=Ee[Fe+3],Oe.push("C",me(Ee[Fe]),me(Ee[Fe+1]),me(Me),me(we),me(Me),me(we)),Fe+=4;break;case ie.OPS.closePath:Oe.push("Z");break}Oe=Oe.join(" "),Ne.path&&ye.length>0&&ye[0]!==ie.OPS.rectangle&&ye[0]!==ie.OPS.moveTo?Oe=Ne.path.getAttributeNS(null,"d")+Oe:(Ne.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(Ne.path)),Ne.path.setAttributeNS(null,"d",Oe),Ne.path.setAttributeNS(null,"fill","none"),Ne.element=Ne.path,Ne.setCurrentPoint(Me,we)}endPath(){const ye=this.current;if(ye.path=null,!this.pendingClip)return;if(!ye.element){this.pendingClip=null;return}const Ee="clippath".concat(Se++),Ne=this.svgFactory.createElement("svg:clipPath");Ne.setAttributeNS(null,"id",Ee),Ne.setAttributeNS(null,"transform",ve(this.transformMatrix));const Me=ye.element.cloneNode(!0);if(this.pendingClip==="evenodd"?Me.setAttributeNS(null,"clip-rule","evenodd"):Me.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,Ne.append(Me),this.defs.append(Ne),ye.activeClipUrl){ye.clipGroup=null;for(const we of this.extraStack)we.clipGroup=null;Ne.setAttributeNS(null,"clip-path",ye.activeClipUrl)}ye.activeClipUrl="url(#".concat(Ee,")"),this.tgrp=null}clip(ye){this.pendingClip=ye}closePath(){const ye=this.current;if(ye.path){const Ee="".concat(ye.path.getAttributeNS(null,"d"),"Z");ye.path.setAttributeNS(null,"d",Ee)}}setLeading(ye){this.current.leading=-ye}setTextRise(ye){this.current.textRise=ye}setTextRenderingMode(ye){this.current.textRenderingMode=ye}setHScale(ye){this.current.textHScale=ye/100}setRenderingIntent(ye){}setFlatness(ye){}setGState(ye){for(const[Ee,Ne]of ye)switch(Ee){case"LW":this.setLineWidth(Ne);break;case"LC":this.setLineCap(Ne);break;case"LJ":this.setLineJoin(Ne);break;case"ML":this.setMiterLimit(Ne);break;case"D":this.setDash(Ne[0],Ne[1]);break;case"RI":this.setRenderingIntent(Ne);break;case"FL":this.setFlatness(Ne);break;case"Font":this.setFont(Ne);break;case"CA":this.setStrokeAlpha(Ne);break;case"ca":this.setFillAlpha(Ne);break;default:(0,ie.warn)("Unimplemented graphic state operator ".concat(Ee));break}}fill(){const ye=this.current;ye.element&&(ye.element.setAttributeNS(null,"fill",ye.fillColor),ye.element.setAttributeNS(null,"fill-opacity",ye.fillAlpha),this.endPath())}stroke(){const ye=this.current;ye.element&&(this._setStrokeAttributes(ye.element),ye.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(ye,Ee=1){const Ne=this.current;let Me=Ne.dashArray;Ee!==1&&Me.length>0&&(Me=Me.map(function(we){return Ee*we})),ye.setAttributeNS(null,"stroke",Ne.strokeColor),ye.setAttributeNS(null,"stroke-opacity",Ne.strokeAlpha),ye.setAttributeNS(null,"stroke-miterlimit",me(Ne.miterLimit)),ye.setAttributeNS(null,"stroke-linecap",Ne.lineCap),ye.setAttributeNS(null,"stroke-linejoin",Ne.lineJoin),ye.setAttributeNS(null,"stroke-width",me(Ee*Ne.lineWidth)+"px"),ye.setAttributeNS(null,"stroke-dasharray",Me.map(me).join(" ")),ye.setAttributeNS(null,"stroke-dashoffset",me(Ee*Ne.dashPhase)+"px")}eoFill(){var ye;(ye=this.current.element)==null||ye.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var ye;(ye=this.current.element)==null||ye.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const ye=this.svgFactory.createElement("svg:rect");ye.setAttributeNS(null,"x","0"),ye.setAttributeNS(null,"y","0"),ye.setAttributeNS(null,"width","1px"),ye.setAttributeNS(null,"height","1px"),ye.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(ye)}paintImageXObject(ye){const Ee=this.getObject(ye);if(!Ee){(0,ie.warn)("Dependent image with object ID ".concat(ye," is not ready yet"));return}this.paintInlineImageXObject(Ee)}paintInlineImageXObject(ye,Ee){const Ne=ye.width,Me=ye.height,we=le(ye,this.forceDataSchema,!!Ee),Oe=this.svgFactory.createElement("svg:rect");Oe.setAttributeNS(null,"x","0"),Oe.setAttributeNS(null,"y","0"),Oe.setAttributeNS(null,"width",me(Ne)),Oe.setAttributeNS(null,"height",me(Me)),this.current.element=Oe,this.clip("nonzero");const Fe=this.svgFactory.createElement("svg:image");Fe.setAttributeNS(he,"xlink:href",we),Fe.setAttributeNS(null,"x","0"),Fe.setAttributeNS(null,"y",me(-Me)),Fe.setAttributeNS(null,"width",me(Ne)+"px"),Fe.setAttributeNS(null,"height",me(Me)+"px"),Fe.setAttributeNS(null,"transform","scale(".concat(me(1/Ne)," ").concat(me(-1/Me),")")),Ee?Ee.append(Fe):this._ensureTransformGroup().append(Fe)}paintImageMaskXObject(ye){const Ee=this.getObject(ye.data,ye);if(Ee.bitmap){(0,ie.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const Ne=this.current,Me=Ee.width,we=Ee.height,Oe=Ne.fillColor;Ne.maskId="mask".concat(Te++);const Fe=this.svgFactory.createElement("svg:mask");Fe.setAttributeNS(null,"id",Ne.maskId);const Ve=this.svgFactory.createElement("svg:rect");Ve.setAttributeNS(null,"x","0"),Ve.setAttributeNS(null,"y","0"),Ve.setAttributeNS(null,"width",me(Me)),Ve.setAttributeNS(null,"height",me(we)),Ve.setAttributeNS(null,"fill",Oe),Ve.setAttributeNS(null,"mask","url(#".concat(Ne.maskId,")")),this.defs.append(Fe),this._ensureTransformGroup().append(Ve),this.paintInlineImageXObject(Ee,Fe)}paintFormXObjectBegin(ye,Ee){if(Array.isArray(ye)&&ye.length===6&&this.transform(ye[0],ye[1],ye[2],ye[3],ye[4],ye[5]),Ee){const Ne=Ee[2]-Ee[0],Me=Ee[3]-Ee[1],we=this.svgFactory.createElement("svg:rect");we.setAttributeNS(null,"x",Ee[0]),we.setAttributeNS(null,"y",Ee[1]),we.setAttributeNS(null,"width",me(Ne)),we.setAttributeNS(null,"height",me(Me)),this.current.element=we,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(ye){const Ee=this.svgFactory.create(ye.width,ye.height),Ne=this.svgFactory.createElement("svg:defs");Ee.append(Ne),this.defs=Ne;const Me=this.svgFactory.createElement("svg:g");return Me.setAttributeNS(null,"transform",ve(ye.transform)),Ee.append(Me),this.svg=Me,Ee}_ensureClipGroup(){if(!this.current.clipGroup){const ye=this.svgFactory.createElement("svg:g");ye.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(ye),this.current.clipGroup=ye}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",ve(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}te.SVGGraphics=Re},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaText=void 0;class ne{static textContent(ie){const se=[],oe={items:se,styles:Object.create(null)};function he(ue){var le;if(!ue)return;let de=null;const ae=ue.name;if(ae==="#text")de=ue.value;else if(ne.shouldBuildText(ae))(le=ue==null?void 0:ue.attributes)!=null&&le.textContent?de=ue.attributes.textContent:ue.value&&(de=ue.value);else return;if(de!==null&&se.push({str:de}),!!ue.children)for(const Ae of ue.children)he(Ae)}return he(ie),oe}static shouldBuildText(ie){return!(ie==="textarea"||ie==="input"||ie==="option"||ie==="select")}}te.XfaText=ne},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.TextLayerRenderTask=void 0,te.renderTextLayer=ve,te.updateTextLayer=Se;var re=ne(1),ie=ne(6);const se=1e5,oe=30,he=.8,ue=new Map;function de(Te,Pe){let Re;if(Pe&&re.FeatureTest.isOffscreenCanvasSupported)Re=new OffscreenCanvas(Te,Te).getContext("2d",{alpha:!1});else{const $e=document.createElement("canvas");$e.width=$e.height=Te,Re=$e.getContext("2d",{alpha:!1})}return Re}function ae(Te,Pe){const Re=ue.get(Te);if(Re)return Re;const $e=de(oe,Pe);$e.font="".concat(oe,"px ").concat(Te);const ye=$e.measureText("");let Ee=ye.fontBoundingBoxAscent,Ne=Math.abs(ye.fontBoundingBoxDescent);if(Ee){const we=Ee/(Ee+Ne);return ue.set(Te,we),$e.canvas.width=$e.canvas.height=0,we}$e.strokeStyle="red",$e.clearRect(0,0,oe,oe),$e.strokeText("g",0,0);let Me=$e.getImageData(0,0,oe,oe).data;Ne=0;for(let we=Me.length-1-3;we>=0;we-=4)if(Me[we]>0){Ne=Math.ceil(we/4/oe);break}$e.clearRect(0,0,oe,oe),$e.strokeText("A",0,oe),Me=$e.getImageData(0,0,oe,oe).data,Ee=0;for(let we=0,Oe=Me.length;we<Oe;we+=4)if(Me[we]>0){Ee=oe-Math.floor(we/4/oe);break}if($e.canvas.width=$e.canvas.height=0,Ee){const we=Ee/(Ee+Ne);return ue.set(Te,we),we}return ue.set(Te,he),he}function le(Te,Pe,Re){const $e=document.createElement("span"),ye={angle:0,canvasWidth:0,hasText:Pe.str!=="",hasEOL:Pe.hasEOL,fontSize:0};Te._textDivs.push($e);const Ee=re.Util.transform(Te._transform,Pe.transform);let Ne=Math.atan2(Ee[1],Ee[0]);const Me=Re[Pe.fontName];Me.vertical&&(Ne+=Math.PI/2);const we=Math.hypot(Ee[2],Ee[3]),Oe=we*ae(Me.fontFamily,Te._isOffscreenCanvasSupported);let Fe,Ve;Ne===0?(Fe=Ee[4],Ve=Ee[5]-Oe):(Fe=Ee[4]+Oe*Math.sin(Ne),Ve=Ee[5]-Oe*Math.cos(Ne));const qe="calc(var(--scale-factor)*",Ie=$e.style;Te._container===Te._rootContainer?(Ie.left="".concat((100*Fe/Te._pageWidth).toFixed(2),"%"),Ie.top="".concat((100*Ve/Te._pageHeight).toFixed(2),"%")):(Ie.left="".concat(qe).concat(Fe.toFixed(2),"px)"),Ie.top="".concat(qe).concat(Ve.toFixed(2),"px)")),Ie.fontSize="".concat(qe).concat(we.toFixed(2),"px)"),Ie.fontFamily=Me.fontFamily,ye.fontSize=we,$e.setAttribute("role","presentation"),$e.textContent=Pe.str,$e.dir=Pe.dir,Te._fontInspectorEnabled&&($e.dataset.fontName=Pe.fontName),Ne!==0&&(ye.angle=Ne*(180/Math.PI));let Xe=!1;if(Pe.str.length>1)Xe=!0;else if(Pe.str!==" "&&Pe.transform[0]!==Pe.transform[3]){const rt=Math.abs(Pe.transform[0]),lt=Math.abs(Pe.transform[3]);rt!==lt&&Math.max(rt,lt)/Math.min(rt,lt)>1.5&&(Xe=!0)}Xe&&(ye.canvasWidth=Me.vertical?Pe.height:Pe.width),Te._textDivProperties.set($e,ye),Te._isReadableStream&&Te._layoutText($e)}function Ae(Te){const{div:Pe,scale:Re,properties:$e,ctx:ye,prevFontSize:Ee,prevFontFamily:Ne}=Te,{style:Me}=Pe;let we="";if($e.canvasWidth!==0&&$e.hasText){const{fontFamily:Oe}=Me,{canvasWidth:Fe,fontSize:Ve}=$e;(Ee!==Ve||Ne!==Oe)&&(ye.font="".concat(Ve*Re,"px ").concat(Oe),Te.prevFontSize=Ve,Te.prevFontFamily=Oe);const{width:qe}=ye.measureText(Pe.textContent);qe>0&&(we="scaleX(".concat(Fe*Re/qe,")"))}$e.angle!==0&&(we="rotate(".concat($e.angle,"deg) ").concat(we)),we.length>0&&(Me.transform=we)}function _e(Te){if(Te._canceled)return;const Pe=Te._textDivs,Re=Te._capability;if(Pe.length>se){Re.resolve();return}if(!Te._isReadableStream)for(const ye of Pe)Te._layoutText(ye);Re.resolve()}class me{constructor({textContentSource:Pe,container:Re,viewport:$e,textDivs:ye,textDivProperties:Ee,textContentItemsStr:Ne,isOffscreenCanvasSupported:Me}){var qe;this._textContentSource=Pe,this._isReadableStream=Pe instanceof ReadableStream,this._container=this._rootContainer=Re,this._textDivs=ye||[],this._textContentItemsStr=Ne||[],this._isOffscreenCanvasSupported=Me,this._fontInspectorEnabled=!!((qe=globalThis.FontInspector)!=null&&qe.enabled),this._reader=null,this._textDivProperties=Ee||new WeakMap,this._canceled=!1,this._capability=new re.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:$e.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:de(0,Me)};const{pageWidth:we,pageHeight:Oe,pageX:Fe,pageY:Ve}=$e.rawDims;this._transform=[1,0,0,-1,-Fe,Ve+Oe],this._pageWidth=we,this._pageHeight=Oe,(0,ie.setLayerDimensions)(Re,$e),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new re.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new re.AbortException("TextLayer task cancelled."))}_processItems(Pe,Re){for(const $e of Pe){if($e.str===void 0){if($e.type==="beginMarkedContentProps"||$e.type==="beginMarkedContent"){const ye=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),$e.id!==null&&this._container.setAttribute("id","".concat($e.id)),ye.append(this._container)}else $e.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push($e.str),le(this,$e,Re)}}_layoutText(Pe){const Re=this._layoutTextParams.properties=this._textDivProperties.get(Pe);if(this._layoutTextParams.div=Pe,Ae(this._layoutTextParams),Re.hasText&&this._container.append(Pe),Re.hasEOL){const $e=document.createElement("br");$e.setAttribute("role","presentation"),this._container.append($e)}}_render(){const Pe=new re.PromiseCapability;let Re=Object.create(null);if(this._isReadableStream){const $e=()=>{this._reader.read().then(({value:ye,done:Ee})=>{if(Ee){Pe.resolve();return}Object.assign(Re,ye.styles),this._processItems(ye.items,Re),$e()},Pe.reject)};this._reader=this._textContentSource.getReader(),$e()}else if(this._textContentSource){const{items:$e,styles:ye}=this._textContentSource;this._processItems($e,ye),Pe.resolve()}else throw new Error('No "textContentSource" parameter specified.');Pe.promise.then(()=>{Re=null,_e(this)},this._capability.reject)}}te.TextLayerRenderTask=me;function ve(Te){!Te.textContentSource&&(Te.textContent||Te.textContentStream)&&((0,ie.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),Te.textContentSource=Te.textContent||Te.textContentStream);const{container:Pe,viewport:Re}=Te,$e=getComputedStyle(Pe),ye=$e.getPropertyValue("visibility"),Ee=parseFloat($e.getPropertyValue("--scale-factor"));ye==="visible"&&(!Ee||Math.abs(Ee-Re.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const Ne=new me(Te);return Ne._render(),Ne}function Se({container:Te,viewport:Pe,textDivs:Re,textDivProperties:$e,isOffscreenCanvasSupported:ye,mustRotate:Ee=!0,mustRescale:Ne=!0}){if(Ee&&(0,ie.setLayerDimensions)(Te,{rotation:Pe.rotation}),Ne){const Me=de(0,ye),Oe={prevFontSize:null,prevFontFamily:null,div:null,scale:Pe.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:Me};for(const Fe of Re)Oe.properties=$e.get(Fe),Oe.div=Fe,Ae(Oe)}}},(ee,te,ne)=>{var ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,Er,Ee,Jn,Me,Tr,Oe,Cr;Object.defineProperty(te,"__esModule",{value:!0}),te.AnnotationEditorLayer=void 0;var re=ne(1),ie=ne(4),se=ne(28),oe=ne(33),he=ne(6),ue=ne(34);const Ve=class Ve{constructor({uiManager:Ie,pageIndex:Xe,div:rt,accessibilityManager:lt,annotationLayer:Ge,viewport:ut,l10n:mt}){We(this,$e);We(this,Ee);We(this,Me);We(this,Oe);We(this,ae,void 0);We(this,le,!1);We(this,Ae,null);We(this,_e,this.pointerup.bind(this));We(this,me,this.pointerdown.bind(this));We(this,ve,new Map);We(this,Se,!1);We(this,Te,!1);We(this,Pe,!1);We(this,Re,void 0);const wt=[se.FreeTextEditor,oe.InkEditor,ue.StampEditor];if(!Ve._initialized){Ve._initialized=!0;for(const Et of wt)Et.initialize(mt)}Ie.registerEditorTypes(wt),st(this,Re,Ie),this.pageIndex=Xe,this.div=rt,st(this,ae,lt),st(this,Ae,Ge),this.viewport=ut,ce(this,Re).addLayer(this)}get isEmpty(){return ce(this,ve).size===0}updateToolbar(Ie){ce(this,Re).updateToolbar(Ie)}updateMode(Ie=ce(this,Re).getMode()){Ke(this,Oe,Cr).call(this),Ie===re.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),Ie!==re.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",Ie===re.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",Ie===re.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",Ie===re.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(Ie){if(!Ie&&ce(this,Re).getMode()!==re.AnnotationEditorType.INK)return;if(!Ie){for(const rt of ce(this,ve).values())if(rt.isEmpty()){rt.setInBackground();return}}Ke(this,Ee,Jn).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(Ie){ce(this,Re).setEditingState(Ie)}addCommands(Ie){ce(this,Re).addCommands(Ie)}enable(){this.div.style.pointerEvents="auto";const Ie=new Set;for(const rt of ce(this,ve).values())rt.enableEditing(),rt.annotationElementId&&Ie.add(rt.annotationElementId);if(!ce(this,Ae))return;const Xe=ce(this,Ae).getEditableAnnotations();for(const rt of Xe){if(rt.hide(),ce(this,Re).isDeletedAnnotationElement(rt.data.id)||Ie.has(rt.data.id))continue;const lt=this.deserialize(rt);lt&&(this.addOrRebuild(lt),lt.enableEditing())}}disable(){var Xe;st(this,Pe,!0),this.div.style.pointerEvents="none";const Ie=new Set;for(const rt of ce(this,ve).values()){if(rt.disableEditing(),!rt.annotationElementId||rt.serialize()!==null){Ie.add(rt.annotationElementId);continue}(Xe=this.getEditableAnnotation(rt.annotationElementId))==null||Xe.show(),rt.remove()}if(ce(this,Ae)){const rt=ce(this,Ae).getEditableAnnotations();for(const lt of rt){const{id:Ge}=lt.data;Ie.has(Ge)||ce(this,Re).isDeletedAnnotationElement(Ge)||lt.show()}}Ke(this,Oe,Cr).call(this),this.isEmpty&&(this.div.hidden=!0),st(this,Pe,!1)}getEditableAnnotation(Ie){var Xe;return((Xe=ce(this,Ae))==null?void 0:Xe.getEditableAnnotation(Ie))||null}setActiveEditor(Ie){ce(this,Re).getActive()!==Ie&&ce(this,Re).setActiveEditor(Ie)}enableClick(){this.div.addEventListener("pointerdown",ce(this,me)),this.div.addEventListener("pointerup",ce(this,_e))}disableClick(){this.div.removeEventListener("pointerdown",ce(this,me)),this.div.removeEventListener("pointerup",ce(this,_e))}attach(Ie){ce(this,ve).set(Ie.id,Ie);const{annotationElementId:Xe}=Ie;Xe&&ce(this,Re).isDeletedAnnotationElement(Xe)&&ce(this,Re).removeDeletedAnnotationElement(Ie)}detach(Ie){var Xe;ce(this,ve).delete(Ie.id),(Xe=ce(this,ae))==null||Xe.removePointerInTextLayer(Ie.contentDiv),!ce(this,Pe)&&Ie.annotationElementId&&ce(this,Re).addDeletedAnnotationElement(Ie)}remove(Ie){this.detach(Ie),ce(this,Re).removeEditor(Ie),Ie.div.contains(document.activeElement)&&setTimeout(()=>{ce(this,Re).focusMainContainer()},0),Ie.div.remove(),Ie.isAttachedToDOM=!1,ce(this,Te)||this.addInkEditorIfNeeded(!1)}changeParent(Ie){var Xe;Ie.parent!==this&&(Ie.annotationElementId&&(ce(this,Re).addDeletedAnnotationElement(Ie.annotationElementId),ie.AnnotationEditor.deleteAnnotationElement(Ie),Ie.annotationElementId=null),this.attach(Ie),(Xe=Ie.parent)==null||Xe.detach(Ie),Ie.setParent(this),Ie.div&&Ie.isAttachedToDOM&&(Ie.div.remove(),this.div.append(Ie.div)))}add(Ie){if(this.changeParent(Ie),ce(this,Re).addEditor(Ie),this.attach(Ie),!Ie.isAttachedToDOM){const Xe=Ie.render();this.div.append(Xe),Ie.isAttachedToDOM=!0}Ie.fixAndSetPosition(),Ie.onceAdded(),ce(this,Re).addToAnnotationStorage(Ie)}moveEditorInDOM(Ie){var rt;if(!Ie.isAttachedToDOM)return;const{activeElement:Xe}=document;Ie.div.contains(Xe)&&(Ie._focusEventsAllowed=!1,setTimeout(()=>{Ie.div.contains(document.activeElement)?Ie._focusEventsAllowed=!0:(Ie.div.addEventListener("focusin",()=>{Ie._focusEventsAllowed=!0},{once:!0}),Xe.focus())},0)),Ie._structTreeParentId=(rt=ce(this,ae))==null?void 0:rt.moveElementInDOM(this.div,Ie.div,Ie.contentDiv,!0)}addOrRebuild(Ie){Ie.needsToBeRebuilt()?Ie.rebuild():this.add(Ie)}addUndoableEditor(Ie){const Xe=()=>Ie._uiManager.rebuild(Ie),rt=()=>{Ie.remove()};this.addCommands({cmd:Xe,undo:rt,mustExec:!1})}getNextId(){return ce(this,Re).getId()}pasteEditor(Ie,Xe){ce(this,Re).updateToolbar(Ie),ce(this,Re).updateMode(Ie);const{offsetX:rt,offsetY:lt}=Ke(this,Me,Tr).call(this),Ge=this.getNextId(),ut=Ke(this,$e,Er).call(this,{parent:this,id:Ge,x:rt,y:lt,uiManager:ce(this,Re),isCentered:!0,...Xe});ut&&this.add(ut)}deserialize(Ie){var Xe;switch((Xe=Ie.annotationType)!=null?Xe:Ie.annotationEditorType){case re.AnnotationEditorType.FREETEXT:return se.FreeTextEditor.deserialize(Ie,this,ce(this,Re));case re.AnnotationEditorType.INK:return oe.InkEditor.deserialize(Ie,this,ce(this,Re));case re.AnnotationEditorType.STAMP:return ue.StampEditor.deserialize(Ie,this,ce(this,Re))}return null}addNewEditor(){Ke(this,Ee,Jn).call(this,Ke(this,Me,Tr).call(this),!0)}setSelected(Ie){ce(this,Re).setSelected(Ie)}toggleSelected(Ie){ce(this,Re).toggleSelected(Ie)}isSelected(Ie){return ce(this,Re).isSelected(Ie)}unselect(Ie){ce(this,Re).unselect(Ie)}pointerup(Ie){const{isMac:Xe}=re.FeatureTest.platform;if(!(Ie.button!==0||Ie.ctrlKey&&Xe)&&Ie.target===this.div&&ce(this,Se)){if(st(this,Se,!1),!ce(this,le)){st(this,le,!0);return}if(ce(this,Re).getMode()===re.AnnotationEditorType.STAMP){ce(this,Re).unselectAll();return}Ke(this,Ee,Jn).call(this,Ie,!1)}}pointerdown(Ie){if(ce(this,Se)){st(this,Se,!1);return}const{isMac:Xe}=re.FeatureTest.platform;if(Ie.button!==0||Ie.ctrlKey&&Xe||Ie.target!==this.div)return;st(this,Se,!0);const rt=ce(this,Re).getActive();st(this,le,!rt||rt.isEmpty())}findNewParent(Ie,Xe,rt){const lt=ce(this,Re).findParent(Xe,rt);return lt===null||lt===this?!1:(lt.changeParent(Ie),!0)}destroy(){var Ie,Xe;((Ie=ce(this,Re).getActive())==null?void 0:Ie.parent)===this&&(ce(this,Re).commitOrRemove(),ce(this,Re).setActiveEditor(null));for(const rt of ce(this,ve).values())(Xe=ce(this,ae))==null||Xe.removePointerInTextLayer(rt.contentDiv),rt.setParent(null),rt.isAttachedToDOM=!1,rt.div.remove();this.div=null,ce(this,ve).clear(),ce(this,Re).removeLayer(this)}render({viewport:Ie}){this.viewport=Ie,(0,he.setLayerDimensions)(this.div,Ie);for(const Xe of ce(this,Re).getEditors(this.pageIndex))this.add(Xe);this.updateMode()}update({viewport:Ie}){ce(this,Re).commitOrRemove(),this.viewport=Ie,(0,he.setLayerDimensions)(this.div,{rotation:Ie.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:Ie,pageHeight:Xe}=this.viewport.rawDims;return[Ie,Xe]}};ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakSet,Er=function(Ie){switch(ce(this,Re).getMode()){case re.AnnotationEditorType.FREETEXT:return new se.FreeTextEditor(Ie);case re.AnnotationEditorType.INK:return new oe.InkEditor(Ie);case re.AnnotationEditorType.STAMP:return new ue.StampEditor(Ie)}return null},Ee=new WeakSet,Jn=function(Ie,Xe){const rt=this.getNextId(),lt=Ke(this,$e,Er).call(this,{parent:this,id:rt,x:Ie.offsetX,y:Ie.offsetY,uiManager:ce(this,Re),isCentered:Xe});return lt&&this.add(lt),lt},Me=new WeakSet,Tr=function(){const{x:Ie,y:Xe,width:rt,height:lt}=this.div.getBoundingClientRect(),Ge=Math.max(0,Ie),ut=Math.max(0,Xe),mt=Math.min(window.innerWidth,Ie+rt),wt=Math.min(window.innerHeight,Xe+lt),Et=(Ge+mt)/2-Ie,De=(ut+wt)/2-Xe,[pe,be]=this.viewport.rotation%180===0?[Et,De]:[De,Et];return{offsetX:pe,offsetY:be}},Oe=new WeakSet,Cr=function(){st(this,Te,!0);for(const Ie of ce(this,ve).values())Ie.isEmpty()&&Ie.remove();st(this,Te,!1)},An(Ve,"_initialized",!1);let de=Ve;te.AnnotationEditorLayer=de},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Qr,Re,ei,ye,ti,Ne,Wn,we,xr,Fe,ni,qe,Pr;Object.defineProperty(te,"__esModule",{value:!0}),te.FreeTextEditor=void 0;var re=ne(1),ie=ne(5),se=ne(4),oe=ne(29);const Xe=class Xe extends se.AnnotationEditor{constructor(Ge){super({...Ge,name:"freeTextEditor"});We(this,Te);We(this,Re);We(this,ye);We(this,Ne);We(this,we);We(this,Fe);We(this,qe);We(this,ue,this.editorDivBlur.bind(this));We(this,de,this.editorDivFocus.bind(this));We(this,ae,this.editorDivInput.bind(this));We(this,le,this.editorDivKeydown.bind(this));We(this,Ae,void 0);We(this,_e,"");We(this,me,"".concat(this.id,"-editor"));We(this,ve,void 0);We(this,Se,null);st(this,Ae,Ge.color||Xe._defaultColor||se.AnnotationEditor._defaultLineColor),st(this,ve,Ge.fontSize||Xe._defaultFontSize)}static get _keyboardManager(){const Ge=Xe.prototype,ut=Et=>Et.isEmpty(),mt=ie.AnnotationEditorUIManager.TRANSLATE_SMALL,wt=ie.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,re.shadow)(this,"_keyboardManager",new ie.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],Ge.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],Ge.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],Ge._translateEmpty,{args:[-mt,0],checker:ut}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Ge._translateEmpty,{args:[-wt,0],checker:ut}],[["ArrowRight","mac+ArrowRight"],Ge._translateEmpty,{args:[mt,0],checker:ut}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Ge._translateEmpty,{args:[wt,0],checker:ut}],[["ArrowUp","mac+ArrowUp"],Ge._translateEmpty,{args:[0,-mt],checker:ut}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Ge._translateEmpty,{args:[0,-wt],checker:ut}],[["ArrowDown","mac+ArrowDown"],Ge._translateEmpty,{args:[0,mt],checker:ut}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Ge._translateEmpty,{args:[0,wt],checker:ut}]]))}static initialize(Ge){se.AnnotationEditor.initialize(Ge,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const ut=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(ut.getPropertyValue("--freetext-padding"))}static updateDefaultParams(Ge,ut){switch(Ge){case re.AnnotationEditorParamsType.FREETEXT_SIZE:Xe._defaultFontSize=ut;break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:Xe._defaultColor=ut;break}}updateParams(Ge,ut){switch(Ge){case re.AnnotationEditorParamsType.FREETEXT_SIZE:Ke(this,Te,Qr).call(this,ut);break;case re.AnnotationEditorParamsType.FREETEXT_COLOR:Ke(this,Re,ei).call(this,ut);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,Xe._defaultFontSize],[re.AnnotationEditorParamsType.FREETEXT_COLOR,Xe._defaultColor||se.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[re.AnnotationEditorParamsType.FREETEXT_SIZE,ce(this,ve)],[re.AnnotationEditorParamsType.FREETEXT_COLOR,ce(this,Ae)]]}_translateEmpty(Ge,ut){this._uiManager.translateSelectedEditors(Ge,ut,!0)}getInitialTranslation(){const Ge=this.parentScale;return[-Xe._internalPadding*Ge,-(Xe._internalPadding+ce(this,ve))*Ge]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(re.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",ce(this,le)),this.editorDiv.addEventListener("focus",ce(this,de)),this.editorDiv.addEventListener("blur",ce(this,ue)),this.editorDiv.addEventListener("input",ce(this,ae)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",ce(this,me)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",ce(this,le)),this.editorDiv.removeEventListener("focus",ce(this,de)),this.editorDiv.removeEventListener("blur",ce(this,ue)),this.editorDiv.removeEventListener("input",ce(this,ae)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(Ge){this._focusEventsAllowed&&(super.focusin(Ge),Ge.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var Ge;if(this.width){Ke(this,qe,Pr).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(Ge=this._initialOptions)!=null&&Ge.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const Ge=ce(this,_e),ut=st(this,_e,Ke(this,ye,ti).call(this).trimEnd());if(Ge===ut)return;const mt=wt=>{if(st(this,_e,wt),!wt){this.remove();return}Ke(this,we,xr).call(this),this._uiManager.rebuild(this),Ke(this,Ne,Wn).call(this)};this.addCommands({cmd:()=>{mt(ut)},undo:()=>{mt(Ge)},mustExec:!1}),Ke(this,Ne,Wn).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(Ge){this.enterInEditMode()}keydown(Ge){Ge.target===this.div&&Ge.key==="Enter"&&(this.enterInEditMode(),Ge.preventDefault())}editorDivKeydown(Ge){Xe._keyboardManager.exec(this,Ge)}editorDivFocus(Ge){this.isEditing=!0}editorDivBlur(Ge){this.isEditing=!1}editorDivInput(Ge){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let Ge,ut;this.width&&(Ge=this.x,ut=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",ce(this,me)),this.enableEditing(),se.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(wt=>{var Et;return(Et=this.editorDiv)==null?void 0:Et.setAttribute("aria-label",wt)}),se.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(wt=>{var Et;return(Et=this.editorDiv)==null?void 0:Et.setAttribute("default-content",wt)}),this.editorDiv.contentEditable=!0;const{style:mt}=this.editorDiv;if(mt.fontSize="calc(".concat(ce(this,ve),"px * var(--scale-factor))"),mt.color=ce(this,Ae),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,ie.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[wt,Et]=this.parentDimensions;if(this.annotationElementId){const{position:De}=ce(this,Se);let[pe,be]=this.getInitialTranslation();[pe,be]=this.pageTranslationToScreen(pe,be);const[ge,Ce]=this.pageDimensions,[xe,Le]=this.pageTranslation;let Be,He;switch(this.rotation){case 0:Be=Ge+(De[0]-xe)/ge,He=ut+this.height-(De[1]-Le)/Ce;break;case 90:Be=Ge+(De[0]-xe)/ge,He=ut-(De[1]-Le)/Ce,[pe,be]=[be,-pe];break;case 180:Be=Ge-this.width+(De[0]-xe)/ge,He=ut-(De[1]-Le)/Ce,[pe,be]=[-pe,-be];break;case 270:Be=Ge+(De[0]-xe-this.height*Ce)/ge,He=ut+(De[1]-Le-this.width*ge)/Ce,[pe,be]=[-be,pe];break}this.setAt(Be*wt,He*Et,pe,be)}else this.setAt(Ge*wt,ut*Et,this.width*wt,this.height*Et);Ke(this,we,xr).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(Ge,ut,mt){let wt=null;if(Ge instanceof oe.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:De,fontColor:pe},rect:be,rotation:ge,id:Ce},textContent:xe,textPosition:Le,parent:{page:{pageNumber:Be}}}=Ge;if(!xe||xe.length===0)return null;wt=Ge={annotationType:re.AnnotationEditorType.FREETEXT,color:Array.from(pe),fontSize:De,value:xe.join("\n"),position:Le,pageIndex:Be-1,rect:be,rotation:ge,id:Ce,deleted:!1}}const Et=super.deserialize(Ge,ut,mt);return st(Et,ve,Ge.fontSize),st(Et,Ae,re.Util.makeHexColor(...Ge.color)),st(Et,_e,Ge.value),Et.annotationElementId=Ge.id||null,st(Et,Se,wt),Et}serialize(Ge=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const ut=Xe._internalPadding*this.parentScale,mt=this.getRect(ut,ut),wt=se.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:ce(this,Ae)),Et={annotationType:re.AnnotationEditorType.FREETEXT,color:wt,fontSize:ce(this,ve),value:ce(this,_e),pageIndex:this.pageIndex,rect:mt,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return Ge?Et:this.annotationElementId&&!Ke(this,Fe,ni).call(this,Et)?null:(Et.id=this.annotationElementId,Et)}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakSet,Qr=function(Ge){const ut=wt=>{this.editorDiv.style.fontSize="calc(".concat(wt,"px * var(--scale-factor))"),this.translate(0,-(wt-ce(this,ve))*this.parentScale),st(this,ve,wt),Ke(this,Ne,Wn).call(this)},mt=ce(this,ve);this.addCommands({cmd:()=>{ut(Ge)},undo:()=>{ut(mt)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Re=new WeakSet,ei=function(Ge){const ut=ce(this,Ae);this.addCommands({cmd:()=>{st(this,Ae,this.editorDiv.style.color=Ge)},undo:()=>{st(this,Ae,this.editorDiv.style.color=ut)},mustExec:!0,type:re.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},ye=new WeakSet,ti=function(){const Ge=this.editorDiv.getElementsByTagName("div");if(Ge.length===0)return this.editorDiv.innerText;const ut=[];for(const mt of Ge)ut.push(mt.innerText.replace(/\r\n?|\n/,""));return ut.join("\n")},Ne=new WeakSet,Wn=function(){const[Ge,ut]=this.parentDimensions;let mt;if(this.isAttachedToDOM)mt=this.div.getBoundingClientRect();else{const{currentLayer:wt,div:Et}=this,De=Et.style.display;Et.style.display="hidden",wt.div.append(this.div),mt=Et.getBoundingClientRect(),Et.remove(),Et.style.display=De}this.rotation%180===this.parentRotation%180?(this.width=mt.width/Ge,this.height=mt.height/ut):(this.width=mt.height/Ge,this.height=mt.width/ut),this.fixAndSetPosition()},we=new WeakSet,xr=function(){if(this.editorDiv.replaceChildren(),!!ce(this,_e))for(const Ge of ce(this,_e).split("\n")){const ut=document.createElement("div");ut.append(Ge?document.createTextNode(Ge):document.createElement("br")),this.editorDiv.append(ut)}},Fe=new WeakSet,ni=function(Ge){const{value:ut,fontSize:mt,color:wt,rect:Et,pageIndex:De}=ce(this,Se);return Ge.value!==ut||Ge.fontSize!==mt||Ge.rect.some((pe,be)=>Math.abs(pe-Et[be])>=1)||Ge.color.some((pe,be)=>pe!==wt[be])||Ge.pageIndex!==De},qe=new WeakSet,Pr=function(Ge=!1){if(!this.annotationElementId)return;if(Ke(this,Ne,Wn).call(this),!Ge&&(this.width===0||this.height===0)){setTimeout(()=>Ke(this,qe,Pr).call(this,!0),0);return}const ut=Xe._internalPadding*this.parentScale;ce(this,Se).rect=this.getRect(ut,ut)},An(Xe,"_freeTextDefaultContent",""),An(Xe,"_internalPadding",0),An(Xe,"_defaultColor",null),An(Xe,"_defaultFontSize",10),An(Xe,"_type","freetext");let he=Xe;te.FreeTextEditor=he},(ee,te,ne)=>{var be,Ce,$n,Le,ri,He,it,et,ot,ht,pt,ct,Pt,It,vt,kt,gt,tt,nt,ft,Tt,Ct,Ht,ii,Ut,Qn,Vt,Rr,Gt,Fr,Qe,Ye,yt,St,wn,Qt,Je,Mr,Lt,Rt,Dt,Nt,si,bt,$r;Object.defineProperty(te,"__esModule",{value:!0}),te.StampAnnotationElement=te.InkAnnotationElement=te.FreeTextAnnotationElement=te.AnnotationLayer=void 0;var re=ne(1),ie=ne(6),se=ne(3),oe=ne(30),he=ne(31),ue=ne(32);const de=1e3,ae=9,le=new WeakSet;function Ae(Ot){return{width:Ot[2]-Ot[0],height:Ot[3]-Ot[1]}}class _e{static create(Ue){switch(Ue.data.annotationType){case re.AnnotationType.LINK:return new ve(Ue);case re.AnnotationType.TEXT:return new Se(Ue);case re.AnnotationType.WIDGET:switch(Ue.data.fieldType){case"Tx":return new Pe(Ue);case"Btn":return Ue.data.radioButton?new ye(Ue):Ue.data.checkBox?new $e(Ue):new Ee(Ue);case"Ch":return new Ne(Ue);case"Sig":return new Re(Ue)}return new Te(Ue);case re.AnnotationType.POPUP:return new Me(Ue);case re.AnnotationType.FREETEXT:return new Oe(Ue);case re.AnnotationType.LINE:return new Fe(Ue);case re.AnnotationType.SQUARE:return new Ve(Ue);case re.AnnotationType.CIRCLE:return new qe(Ue);case re.AnnotationType.POLYLINE:return new Ie(Ue);case re.AnnotationType.CARET:return new rt(Ue);case re.AnnotationType.INK:return new lt(Ue);case re.AnnotationType.POLYGON:return new Xe(Ue);case re.AnnotationType.HIGHLIGHT:return new Ge(Ue);case re.AnnotationType.UNDERLINE:return new ut(Ue);case re.AnnotationType.SQUIGGLY:return new mt(Ue);case re.AnnotationType.STRIKEOUT:return new wt(Ue);case re.AnnotationType.STAMP:return new Et(Ue);case re.AnnotationType.FILEATTACHMENT:return new De(Ue);default:return new me(Ue)}}}const ge=class ge{constructor(Ue,{isRenderable:fe=!1,ignoreBorder:ke=!1,createQuadrilaterals:je=!1}={}){We(this,be,!1);this.isRenderable=fe,this.data=Ue.data,this.layer=Ue.layer,this.linkService=Ue.linkService,this.downloadManager=Ue.downloadManager,this.imageResourcesPath=Ue.imageResourcesPath,this.renderForms=Ue.renderForms,this.svgFactory=Ue.svgFactory,this.annotationStorage=Ue.annotationStorage,this.enableScripting=Ue.enableScripting,this.hasJSActions=Ue.hasJSActions,this._fieldObjects=Ue.fieldObjects,this.parent=Ue.parent,fe&&(this.container=this._createContainer(ke)),je&&this._createQuadrilaterals()}static _hasPopupData({titleObj:Ue,contentsObj:fe,richText:ke}){return!!(Ue!=null&&Ue.str||fe!=null&&fe.str||ke!=null&&ke.str)}get hasPopupData(){return ge._hasPopupData(this.data)}_createContainer(Ue){const{data:fe,parent:{page:ke,viewport:je}}=this,ze=document.createElement("section");ze.setAttribute("data-annotation-id",fe.id),this instanceof Te||(ze.tabIndex=de),ze.style.zIndex=this.parent.zIndex++,this.data.popupRef&&ze.setAttribute("aria-haspopup","dialog"),fe.noRotate&&ze.classList.add("norotate");const{pageWidth:Ze,pageHeight:at,pageX:_t,pageY:xt}=je.rawDims;if(!fe.rect||this instanceof Me){const{rotation:Bt}=fe;return!fe.hasOwnCanvas&&Bt!==0&&this.setRotation(Bt,ze),ze}const{width:Ft,height:qt}=Ae(fe.rect),Mt=re.Util.normalizeRect([fe.rect[0],ke.view[3]-fe.rect[1]+ke.view[1],fe.rect[2],ke.view[3]-fe.rect[3]+ke.view[1]]);if(!Ue&&fe.borderStyle.width>0){ze.style.borderWidth="".concat(fe.borderStyle.width,"px");const Bt=fe.borderStyle.horizontalCornerRadius,Xt=fe.borderStyle.verticalCornerRadius;if(Bt>0||Xt>0){const Jt="calc(".concat(Bt,"px * var(--scale-factor)) / calc(").concat(Xt,"px * var(--scale-factor))");ze.style.borderRadius=Jt}else if(this instanceof ye){const Jt="calc(".concat(Ft,"px * var(--scale-factor)) / calc(").concat(qt,"px * var(--scale-factor))");ze.style.borderRadius=Jt}switch(fe.borderStyle.style){case re.AnnotationBorderStyleType.SOLID:ze.style.borderStyle="solid";break;case re.AnnotationBorderStyleType.DASHED:ze.style.borderStyle="dashed";break;case re.AnnotationBorderStyleType.BEVELED:(0,re.warn)("Unimplemented border style: beveled");break;case re.AnnotationBorderStyleType.INSET:(0,re.warn)("Unimplemented border style: inset");break;case re.AnnotationBorderStyleType.UNDERLINE:ze.style.borderBottomStyle="solid";break}const Yt=fe.borderColor||null;Yt?(st(this,be,!0),ze.style.borderColor=re.Util.makeHexColor(Yt[0]|0,Yt[1]|0,Yt[2]|0)):ze.style.borderWidth=0}ze.style.left="".concat(100*(Mt[0]-_t)/Ze,"%"),ze.style.top="".concat(100*(Mt[1]-xt)/at,"%");const{rotation:$t}=fe;return fe.hasOwnCanvas||$t===0?(ze.style.width="".concat(100*Ft/Ze,"%"),ze.style.height="".concat(100*qt/at,"%")):this.setRotation($t,ze),ze}setRotation(Ue,fe=this.container){if(!this.data.rect)return;const{pageWidth:ke,pageHeight:je}=this.parent.viewport.rawDims,{width:ze,height:Ze}=Ae(this.data.rect);let at,_t;Ue%180===0?(at=100*ze/ke,_t=100*Ze/je):(at=100*Ze/ke,_t=100*ze/je),fe.style.width="".concat(at,"%"),fe.style.height="".concat(_t,"%"),fe.setAttribute("data-main-rotation",(360-Ue)%360)}get _commonActions(){const Ue=(fe,ke,je)=>{const ze=je.detail[fe],Ze=ze[0],at=ze.slice(1);je.target.style[ke]=oe.ColorConverters["".concat(Ze,"_HTML")](at),this.annotationStorage.setValue(this.data.id,{[ke]:oe.ColorConverters["".concat(Ze,"_rgb")](at)})};return(0,re.shadow)(this,"_commonActions",{display:fe=>{const{display:ke}=fe.detail,je=ke%2===1;this.container.style.visibility=je?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:je,noPrint:ke===1||ke===2})},print:fe=>{this.annotationStorage.setValue(this.data.id,{noPrint:!fe.detail.print})},hidden:fe=>{const{hidden:ke}=fe.detail;this.container.style.visibility=ke?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:ke,noView:ke})},focus:fe=>{setTimeout(()=>fe.target.focus({preventScroll:!1}),0)},userName:fe=>{fe.target.title=fe.detail.userName},readonly:fe=>{fe.target.disabled=fe.detail.readonly},required:fe=>{this._setRequired(fe.target,fe.detail.required)},bgColor:fe=>{Ue("bgColor","backgroundColor",fe)},fillColor:fe=>{Ue("fillColor","backgroundColor",fe)},fgColor:fe=>{Ue("fgColor","color",fe)},textColor:fe=>{Ue("textColor","color",fe)},borderColor:fe=>{Ue("borderColor","borderColor",fe)},strokeColor:fe=>{Ue("strokeColor","borderColor",fe)},rotation:fe=>{const ke=fe.detail.rotation;this.setRotation(ke),this.annotationStorage.setValue(this.data.id,{rotation:ke})}})}_dispatchEventFromSandbox(Ue,fe){const ke=this._commonActions;for(const je of Object.keys(fe.detail)){const ze=Ue[je]||ke[je];ze==null||ze(fe)}}_setDefaultPropertiesFromJS(Ue){if(!this.enableScripting)return;const fe=this.annotationStorage.getRawValue(this.data.id);if(!fe)return;const ke=this._commonActions;for(const[je,ze]of Object.entries(fe)){const Ze=ke[je];if(Ze){const at={detail:{[je]:ze},target:Ue};Ze(at),delete fe[je]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:Ue}=this.data;if(!Ue)return;const[fe,ke,je,ze]=this.data.rect;if(Ue.length===1){const[,{x:Xt,y:Yt},{x:Jt,y:Tn}]=Ue[0];if(je===Xt&&ze===Yt&&fe===Jt&&ke===Tn)return}const{style:Ze}=this.container;let at;if(ce(this,be)){const{borderColor:Xt,borderWidth:Yt}=Ze;Ze.borderWidth=0,at=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">','<g fill="transparent" stroke="'.concat(Xt,'" stroke-width="').concat(Yt,'">')],this.container.classList.add("hasBorder")}const _t=je-fe,xt=ze-ke,{svgFactory:Ft}=this,qt=Ft.createElement("svg");qt.classList.add("quadrilateralsContainer"),qt.setAttribute("width",0),qt.setAttribute("height",0);const Mt=Ft.createElement("defs");qt.append(Mt);const $t=Ft.createElement("clipPath"),Bt="clippath_".concat(this.data.id);$t.setAttribute("id",Bt),$t.setAttribute("clipPathUnits","objectBoundingBox"),Mt.append($t);for(const[,{x:Xt,y:Yt},{x:Jt,y:Tn}]of Ue){const En=Ft.createElement("rect"),xn=(Jt-fe)/_t,Fn=(ze-Yt)/xt,Mn=(Xt-Jt)/_t,jr=(Yt-Tn)/xt;En.setAttribute("x",xn),En.setAttribute("y",Fn),En.setAttribute("width",Mn),En.setAttribute("height",jr),$t.append(En),at==null||at.push('<rect vector-effect="non-scaling-stroke" x="'.concat(xn,'" y="').concat(Fn,'" width="').concat(Mn,'" height="').concat(jr,'"/>'))}ce(this,be)&&(at.push("</g></svg>')"),Ze.backgroundImage=at.join("")),this.container.append(qt),this.container.style.clipPath="url(#".concat(Bt,")")}_createPopup(){const{container:Ue,data:fe}=this;Ue.setAttribute("aria-haspopup","dialog");const ke=new Me({data:{color:fe.color,titleObj:fe.titleObj,modificationDate:fe.modificationDate,contentsObj:fe.contentsObj,richText:fe.richText,parentRect:fe.rect,borderStyle:0,id:"popup_".concat(fe.id),rotation:fe.rotation},parent:this.parent,elements:[this]});this.parent.div.append(ke.render())}render(){(0,re.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(Ue,fe=null){const ke=[];if(this._fieldObjects){const je=this._fieldObjects[Ue];if(je)for(const{page:ze,id:Ze,exportValues:at}of je){if(ze===-1||Ze===fe)continue;const _t=typeof at=="string"?at:null,xt=document.querySelector('[data-element-id="'.concat(Ze,'"]'));if(xt&&!le.has(xt)){(0,re.warn)("_getElementsByName - element not allowed: ".concat(Ze));continue}ke.push({id:Ze,exportValue:_t,domElement:xt})}return ke}for(const je of document.getElementsByName(Ue)){const{exportValue:ze}=je,Ze=je.getAttribute("data-element-id");Ze!==fe&&le.has(je)&&ke.push({id:Ze,exportValue:ze,domElement:je})}return ke}show(){var Ue;this.container&&(this.container.hidden=!1),(Ue=this.popup)==null||Ue.maybeShow()}hide(){var Ue;this.container&&(this.container.hidden=!0),(Ue=this.popup)==null||Ue.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const Ue=this.getElementsToTriggerPopup();if(Array.isArray(Ue))for(const fe of Ue)fe.classList.add("highlightArea");else Ue.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:Ue,data:{id:fe}}=this;this.container.addEventListener("dblclick",()=>{var ke;(ke=this.linkService.eventBus)==null||ke.dispatch("switchannotationeditormode",{source:this,mode:Ue,editId:fe})})}};be=new WeakMap;let me=ge;class ve extends me{constructor(fe,ke=null){super(fe,{isRenderable:!0,ignoreBorder:!!(ke!=null&&ke.ignoreBorder),createQuadrilaterals:!0});We(this,Ce);We(this,Le);this.isTooltipOnly=fe.data.isTooltipOnly}render(){const{data:fe,linkService:ke}=this,je=document.createElement("a");je.setAttribute("data-element-id",fe.id);let ze=!1;return fe.url?(ke.addLinkAttributes(je,fe.url,fe.newWindow),ze=!0):fe.action?(this._bindNamedAction(je,fe.action),ze=!0):fe.attachment?(this._bindAttachment(je,fe.attachment),ze=!0):fe.setOCGState?(Ke(this,Le,ri).call(this,je,fe.setOCGState),ze=!0):fe.dest?(this._bindLink(je,fe.dest),ze=!0):(fe.actions&&(fe.actions.Action||fe.actions["Mouse Up"]||fe.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(je,fe),ze=!0),fe.resetForm?(this._bindResetFormAction(je,fe.resetForm),ze=!0):this.isTooltipOnly&&!ze&&(this._bindLink(je,""),ze=!0)),this.container.classList.add("linkAnnotation"),ze&&this.container.append(je),this.container}_bindLink(fe,ke){fe.href=this.linkService.getDestinationHash(ke),fe.onclick=()=>(ke&&this.linkService.goToDestination(ke),!1),(ke||ke==="")&&Ke(this,Ce,$n).call(this)}_bindNamedAction(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>(this.linkService.executeNamedAction(ke),!1),Ke(this,Ce,$n).call(this)}_bindAttachment(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>{var je;return(je=this.downloadManager)==null||je.openOrDownloadData(this.container,ke.content,ke.filename),!1},Ke(this,Ce,$n).call(this)}_bindJSAction(fe,ke){fe.href=this.linkService.getAnchorUrl("");const je=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const ze of Object.keys(ke.actions)){const Ze=je.get(ze);Ze&&(fe[Ze]=()=>{var at;return(at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:ke.id,name:ze}}),!1})}fe.onclick||(fe.onclick=()=>!1),Ke(this,Ce,$n).call(this)}_bindResetFormAction(fe,ke){const je=fe.onclick;if(je||(fe.href=this.linkService.getAnchorUrl("")),Ke(this,Ce,$n).call(this),!this._fieldObjects){(0,re.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),je||(fe.onclick=()=>!1);return}fe.onclick=()=>{var qt;je==null||je();const{fields:ze,refs:Ze,include:at}=ke,_t=[];if(ze.length!==0||Ze.length!==0){const Mt=new Set(Ze);for(const $t of ze){const Bt=this._fieldObjects[$t]||[];for(const{id:Xt}of Bt)Mt.add(Xt)}for(const $t of Object.values(this._fieldObjects))for(const Bt of $t)Mt.has(Bt.id)===at&&_t.push(Bt)}else for(const Mt of Object.values(this._fieldObjects))_t.push(...Mt);const xt=this.annotationStorage,Ft=[];for(const Mt of _t){const{id:$t}=Mt;switch(Ft.push($t),Mt.type){case"text":{const Xt=Mt.defaultValue||"";xt.setValue($t,{value:Xt});break}case"checkbox":case"radiobutton":{const Xt=Mt.defaultValue===Mt.exportValues;xt.setValue($t,{value:Xt});break}case"combobox":case"listbox":{const Xt=Mt.defaultValue||"";xt.setValue($t,{value:Xt});break}default:continue}const Bt=document.querySelector('[data-element-id="'.concat($t,'"]'));if(Bt){if(!le.has(Bt)){(0,re.warn)("_bindResetFormAction - element not allowed: ".concat($t));continue}}else continue;Bt.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((qt=this.linkService.eventBus)==null||qt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Ft,name:"ResetForm"}})),!1}}}Ce=new WeakSet,$n=function(){this.container.setAttribute("data-internal-link","")},Le=new WeakSet,ri=function(fe,ke){fe.href=this.linkService.getAnchorUrl(""),fe.onclick=()=>(this.linkService.executeSetOCGState(ke),!1),Ke(this,Ce,$n).call(this)};class Se extends me{constructor(Ue){super(Ue,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const Ue=document.createElement("img");return Ue.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",Ue.alt="[{{type}} Annotation]",Ue.dataset.l10nId="text_annotation_type",Ue.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(Ue),this.container}}class Te extends me{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(Ue){var fe;this.data.hasOwnCanvas&&(((fe=Ue.previousSibling)==null?void 0:fe.nodeName)==="CANVAS"&&(Ue.previousSibling.hidden=!0),Ue.hidden=!1)}_getKeyModifier(Ue){const{isWin:fe,isMac:ke}=re.FeatureTest.platform;return fe&&Ue.ctrlKey||ke&&Ue.metaKey}_setEventListener(Ue,fe,ke,je,ze){ke.includes("mouse")?Ue.addEventListener(ke,Ze=>{var at;(at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:je,value:ze(Ze),shift:Ze.shiftKey,modifier:this._getKeyModifier(Ze)}})}):Ue.addEventListener(ke,Ze=>{var at;if(ke==="blur"){if(!fe.focused||!Ze.relatedTarget)return;fe.focused=!1}else if(ke==="focus"){if(fe.focused)return;fe.focused=!0}ze&&((at=this.linkService.eventBus)==null||at.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:je,value:ze(Ze)}}))})}_setEventListeners(Ue,fe,ke,je){var ze,Ze,at;for(const[_t,xt]of ke)(xt==="Action"||(ze=this.data.actions)!=null&&ze[xt])&&((xt==="Focus"||xt==="Blur")&&(fe||(fe={focused:!1})),this._setEventListener(Ue,fe,_t,xt,je),xt==="Focus"&&!((Ze=this.data.actions)!=null&&Ze.Blur)?this._setEventListener(Ue,fe,"blur","Blur",null):xt==="Blur"&&!((at=this.data.actions)!=null&&at.Focus)&&this._setEventListener(Ue,fe,"focus","Focus",null))}_setBackgroundColor(Ue){const fe=this.data.backgroundColor||null;Ue.style.backgroundColor=fe===null?"transparent":re.Util.makeHexColor(fe[0],fe[1],fe[2])}_setTextStyle(Ue){const fe=["left","center","right"],{fontColor:ke}=this.data.defaultAppearanceData,je=this.data.defaultAppearanceData.fontSize||ae,ze=Ue.style;let Ze;const at=2,_t=xt=>Math.round(10*xt)/10;if(this.data.multiLine){const xt=Math.abs(this.data.rect[3]-this.data.rect[1]-at),Ft=Math.round(xt/(re.LINE_FACTOR*je))||1,qt=xt/Ft;Ze=Math.min(je,_t(qt/re.LINE_FACTOR))}else{const xt=Math.abs(this.data.rect[3]-this.data.rect[1]-at);Ze=Math.min(je,_t(xt/re.LINE_FACTOR))}ze.fontSize="calc(".concat(Ze,"px * var(--scale-factor))"),ze.color=re.Util.makeHexColor(ke[0],ke[1],ke[2]),this.data.textAlignment!==null&&(ze.textAlign=fe[this.data.textAlignment])}_setRequired(Ue,fe){fe?Ue.setAttribute("required",!0):Ue.removeAttribute("required"),Ue.setAttribute("aria-required",fe)}}class Pe extends Te{constructor(Ue){const fe=Ue.renderForms||!Ue.data.hasAppearance&&!!Ue.data.fieldValue;super(Ue,{isRenderable:fe})}setPropertyOnSiblings(Ue,fe,ke,je){const ze=this.annotationStorage;for(const Ze of this._getElementsByName(Ue.name,Ue.id))Ze.domElement&&(Ze.domElement[fe]=ke),ze.setValue(Ze.id,{[je]:ke})}render(){var je,ze;const Ue=this.annotationStorage,fe=this.data.id;this.container.classList.add("textWidgetAnnotation");let ke=null;if(this.renderForms){const Ze=Ue.getValue(fe,{value:this.data.fieldValue});let at=Ze.value||"";const _t=Ue.getValue(fe,{charLimit:this.data.maxLen}).charLimit;_t&&at.length>_t&&(at=at.slice(0,_t));let xt=Ze.formattedValue||((je=this.data.textContent)==null?void 0:je.join("\n"))||null;xt&&this.data.comb&&(xt=xt.replaceAll(/\s+/g,""));const Ft={userValue:at,formattedValue:xt,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(ke=document.createElement("textarea"),ke.textContent=xt!=null?xt:at,this.data.doNotScroll&&(ke.style.overflowY="hidden")):(ke=document.createElement("input"),ke.type="text",ke.setAttribute("value",xt!=null?xt:at),this.data.doNotScroll&&(ke.style.overflowX="hidden")),this.data.hasOwnCanvas&&(ke.hidden=!0),le.add(ke),ke.setAttribute("data-element-id",fe),ke.disabled=this.data.readOnly,ke.name=this.data.fieldName,ke.tabIndex=de,this._setRequired(ke,this.data.required),_t&&(ke.maxLength=_t),ke.addEventListener("input",Mt=>{Ue.setValue(fe,{value:Mt.target.value}),this.setPropertyOnSiblings(ke,"value",Mt.target.value,"value"),Ft.formattedValue=null}),ke.addEventListener("resetform",Mt=>{var Bt;const $t=(Bt=this.data.defaultFieldValue)!=null?Bt:"";ke.value=Ft.userValue=$t,Ft.formattedValue=null});let qt=Mt=>{const{formattedValue:$t}=Ft;$t!=null&&(Mt.target.value=$t),Mt.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){ke.addEventListener("focus",$t=>{if(Ft.focused)return;const{target:Bt}=$t;Ft.userValue&&(Bt.value=Ft.userValue),Ft.lastCommittedValue=Bt.value,Ft.commitKey=1,Ft.focused=!0}),ke.addEventListener("updatefromsandbox",$t=>{this.showElementAndHideCanvas($t.target);const Bt={value(Xt){var Yt;Ft.userValue=(Yt=Xt.detail.value)!=null?Yt:"",Ue.setValue(fe,{value:Ft.userValue.toString()}),Xt.target.value=Ft.userValue},formattedValue(Xt){const{formattedValue:Yt}=Xt.detail;Ft.formattedValue=Yt,Yt!=null&&Xt.target!==document.activeElement&&(Xt.target.value=Yt),Ue.setValue(fe,{formattedValue:Yt})},selRange(Xt){Xt.target.setSelectionRange(...Xt.detail.selRange)},charLimit:Xt=>{var En;const{charLimit:Yt}=Xt.detail,{target:Jt}=Xt;if(Yt===0){Jt.removeAttribute("maxLength");return}Jt.setAttribute("maxLength",Yt);let Tn=Ft.userValue;!Tn||Tn.length<=Yt||(Tn=Tn.slice(0,Yt),Jt.value=Ft.userValue=Tn,Ue.setValue(fe,{value:Tn}),(En=this.linkService.eventBus)==null||En.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Tn,willCommit:!0,commitKey:1,selStart:Jt.selectionStart,selEnd:Jt.selectionEnd}}))}};this._dispatchEventFromSandbox(Bt,$t)}),ke.addEventListener("keydown",$t=>{var Yt;Ft.commitKey=1;let Bt=-1;if($t.key==="Escape"?Bt=0:$t.key==="Enter"&&!this.data.multiLine?Bt=2:$t.key==="Tab"&&(Ft.commitKey=3),Bt===-1)return;const{value:Xt}=$t.target;Ft.lastCommittedValue!==Xt&&(Ft.lastCommittedValue=Xt,Ft.userValue=Xt,(Yt=this.linkService.eventBus)==null||Yt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Xt,willCommit:!0,commitKey:Bt,selStart:$t.target.selectionStart,selEnd:$t.target.selectionEnd}}))});const Mt=qt;qt=null,ke.addEventListener("blur",$t=>{var Xt;if(!Ft.focused||!$t.relatedTarget)return;Ft.focused=!1;const{value:Bt}=$t.target;Ft.userValue=Bt,Ft.lastCommittedValue!==Bt&&((Xt=this.linkService.eventBus)==null||Xt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Bt,willCommit:!0,commitKey:Ft.commitKey,selStart:$t.target.selectionStart,selEnd:$t.target.selectionEnd}})),Mt($t)}),(ze=this.data.actions)!=null&&ze.Keystroke&&ke.addEventListener("beforeinput",$t=>{var Fn;Ft.lastCommittedValue=null;const{data:Bt,target:Xt}=$t,{value:Yt,selectionStart:Jt,selectionEnd:Tn}=Xt;let En=Jt,xn=Tn;switch($t.inputType){case"deleteWordBackward":{const Mn=Yt.substring(0,Jt).match(/\w*[^\w]*$/);Mn&&(En-=Mn[0].length);break}case"deleteWordForward":{const Mn=Yt.substring(Jt).match(/^[^\w]*\w*/);Mn&&(xn+=Mn[0].length);break}case"deleteContentBackward":Jt===Tn&&(En-=1);break;case"deleteContentForward":Jt===Tn&&(xn+=1);break}$t.preventDefault(),(Fn=this.linkService.eventBus)==null||Fn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:Yt,change:Bt||"",willCommit:!1,selStart:En,selEnd:xn}})}),this._setEventListeners(ke,Ft,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],$t=>$t.target.value)}if(qt&&ke.addEventListener("blur",qt),this.data.comb){const $t=(this.data.rect[2]-this.data.rect[0])/_t;ke.classList.add("comb"),ke.style.letterSpacing="calc(".concat($t,"px * var(--scale-factor) - 1ch)")}}else ke=document.createElement("div"),ke.textContent=this.data.fieldValue,ke.style.verticalAlign="middle",ke.style.display="table-cell";return this._setTextStyle(ke),this._setBackgroundColor(ke),this._setDefaultPropertiesFromJS(ke),this.container.append(ke),this.container}}class Re extends Te{constructor(Ue){super(Ue,{isRenderable:!!Ue.data.hasOwnCanvas})}}class $e extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){const Ue=this.annotationStorage,fe=this.data,ke=fe.id;let je=Ue.getValue(ke,{value:fe.exportValue===fe.fieldValue}).value;typeof je=="string"&&(je=je!=="Off",Ue.setValue(ke,{value:je})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const ze=document.createElement("input");return le.add(ze),ze.setAttribute("data-element-id",ke),ze.disabled=fe.readOnly,this._setRequired(ze,this.data.required),ze.type="checkbox",ze.name=fe.fieldName,je&&ze.setAttribute("checked",!0),ze.setAttribute("exportValue",fe.exportValue),ze.tabIndex=de,ze.addEventListener("change",Ze=>{const{name:at,checked:_t}=Ze.target;for(const xt of this._getElementsByName(at,ke)){const Ft=_t&&xt.exportValue===fe.exportValue;xt.domElement&&(xt.domElement.checked=Ft),Ue.setValue(xt.id,{value:Ft})}Ue.setValue(ke,{value:_t})}),ze.addEventListener("resetform",Ze=>{const at=fe.defaultFieldValue||"Off";Ze.target.checked=at===fe.exportValue}),this.enableScripting&&this.hasJSActions&&(ze.addEventListener("updatefromsandbox",Ze=>{const at={value(_t){_t.target.checked=_t.detail.value!=="Off",Ue.setValue(ke,{value:_t.target.checked})}};this._dispatchEventFromSandbox(at,Ze)}),this._setEventListeners(ze,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],Ze=>Ze.target.checked)),this._setBackgroundColor(ze),this._setDefaultPropertiesFromJS(ze),this.container.append(ze),this.container}}class ye extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const Ue=this.annotationStorage,fe=this.data,ke=fe.id;let je=Ue.getValue(ke,{value:fe.fieldValue===fe.buttonValue}).value;typeof je=="string"&&(je=je!==fe.buttonValue,Ue.setValue(ke,{value:je}));const ze=document.createElement("input");if(le.add(ze),ze.setAttribute("data-element-id",ke),ze.disabled=fe.readOnly,this._setRequired(ze,this.data.required),ze.type="radio",ze.name=fe.fieldName,je&&ze.setAttribute("checked",!0),ze.tabIndex=de,ze.addEventListener("change",Ze=>{const{name:at,checked:_t}=Ze.target;for(const xt of this._getElementsByName(at,ke))Ue.setValue(xt.id,{value:!1});Ue.setValue(ke,{value:_t})}),ze.addEventListener("resetform",Ze=>{const at=fe.defaultFieldValue;Ze.target.checked=at!=null&&at===fe.buttonValue}),this.enableScripting&&this.hasJSActions){const Ze=fe.buttonValue;ze.addEventListener("updatefromsandbox",at=>{const _t={value:xt=>{const Ft=Ze===xt.detail.value;for(const qt of this._getElementsByName(xt.target.name)){const Mt=Ft&&qt.id===ke;qt.domElement&&(qt.domElement.checked=Mt),Ue.setValue(qt.id,{value:Mt})}}};this._dispatchEventFromSandbox(_t,at)}),this._setEventListeners(ze,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],at=>at.target.checked)}return this._setBackgroundColor(ze),this._setDefaultPropertiesFromJS(ze),this.container.append(ze),this.container}}class Ee extends ve{constructor(Ue){super(Ue,{ignoreBorder:Ue.data.hasAppearance})}render(){const Ue=super.render();Ue.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(Ue.title=this.data.alternativeText);const fe=Ue.lastChild;return this.enableScripting&&this.hasJSActions&&fe&&(this._setDefaultPropertiesFromJS(fe),fe.addEventListener("updatefromsandbox",ke=>{this._dispatchEventFromSandbox({},ke)})),Ue}}class Ne extends Te{constructor(Ue){super(Ue,{isRenderable:Ue.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const Ue=this.annotationStorage,fe=this.data.id,ke=Ue.getValue(fe,{value:this.data.fieldValue}),je=document.createElement("select");le.add(je),je.setAttribute("data-element-id",fe),je.disabled=this.data.readOnly,this._setRequired(je,this.data.required),je.name=this.data.fieldName,je.tabIndex=de;let ze=this.data.combo&&this.data.options.length>0;this.data.combo||(je.size=this.data.options.length,this.data.multiSelect&&(je.multiple=!0)),je.addEventListener("resetform",Ft=>{const qt=this.data.defaultFieldValue;for(const Mt of je.options)Mt.selected=Mt.value===qt});for(const Ft of this.data.options){const qt=document.createElement("option");qt.textContent=Ft.displayValue,qt.value=Ft.exportValue,ke.value.includes(Ft.exportValue)&&(qt.setAttribute("selected",!0),ze=!1),je.append(qt)}let Ze=null;if(ze){const Ft=document.createElement("option");Ft.value=" ",Ft.setAttribute("hidden",!0),Ft.setAttribute("selected",!0),je.prepend(Ft),Ze=()=>{Ft.remove(),je.removeEventListener("input",Ze),Ze=null},je.addEventListener("input",Ze)}const at=Ft=>{const qt=Ft?"value":"textContent",{options:Mt,multiple:$t}=je;return $t?Array.prototype.filter.call(Mt,Bt=>Bt.selected).map(Bt=>Bt[qt]):Mt.selectedIndex===-1?null:Mt[Mt.selectedIndex][qt]};let _t=at(!1);const xt=Ft=>{const qt=Ft.target.options;return Array.prototype.map.call(qt,Mt=>({displayValue:Mt.textContent,exportValue:Mt.value}))};return this.enableScripting&&this.hasJSActions?(je.addEventListener("updatefromsandbox",Ft=>{const qt={value(Mt){Ze==null||Ze();const $t=Mt.detail.value,Bt=new Set(Array.isArray($t)?$t:[$t]);for(const Xt of je.options)Xt.selected=Bt.has(Xt.value);Ue.setValue(fe,{value:at(!0)}),_t=at(!1)},multipleSelection(Mt){je.multiple=!0},remove(Mt){const $t=je.options,Bt=Mt.detail.remove;$t[Bt].selected=!1,je.remove(Bt),$t.length>0&&Array.prototype.findIndex.call($t,Yt=>Yt.selected)===-1&&($t[0].selected=!0),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},clear(Mt){for(;je.length!==0;)je.remove(0);Ue.setValue(fe,{value:null,items:[]}),_t=at(!1)},insert(Mt){const{index:$t,displayValue:Bt,exportValue:Xt}=Mt.detail.insert,Yt=je.children[$t],Jt=document.createElement("option");Jt.textContent=Bt,Jt.value=Xt,Yt?Yt.before(Jt):je.append(Jt),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},items(Mt){const{items:$t}=Mt.detail;for(;je.length!==0;)je.remove(0);for(const Bt of $t){const{displayValue:Xt,exportValue:Yt}=Bt,Jt=document.createElement("option");Jt.textContent=Xt,Jt.value=Yt,je.append(Jt)}je.options.length>0&&(je.options[0].selected=!0),Ue.setValue(fe,{value:at(!0),items:xt(Mt)}),_t=at(!1)},indices(Mt){const $t=new Set(Mt.detail.indices);for(const Bt of Mt.target.options)Bt.selected=$t.has(Bt.index);Ue.setValue(fe,{value:at(!0)}),_t=at(!1)},editable(Mt){Mt.target.disabled=!Mt.detail.editable}};this._dispatchEventFromSandbox(qt,Ft)}),je.addEventListener("input",Ft=>{var Mt;const qt=at(!0);Ue.setValue(fe,{value:qt}),Ft.preventDefault(),(Mt=this.linkService.eventBus)==null||Mt.dispatch("dispatcheventinsandbox",{source:this,detail:{id:fe,name:"Keystroke",value:_t,changeEx:qt,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(je,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],Ft=>Ft.target.value)):je.addEventListener("input",function(Ft){Ue.setValue(fe,{value:at(!0)})}),this.data.combo&&this._setTextStyle(je),this._setBackgroundColor(je),this._setDefaultPropertiesFromJS(je),this.container.append(je),this.container}}class Me extends me{constructor(Ue){const{data:fe,elements:ke}=Ue;super(Ue,{isRenderable:me._hasPopupData(fe)}),this.elements=ke}render(){this.container.classList.add("popupAnnotation");const Ue=new we({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),fe=[];for(const ke of this.elements)ke.popup=Ue,fe.push(ke.data.id),ke.addHighlightArea();return this.container.setAttribute("aria-controls",fe.map(ke=>"".concat(re.AnnotationPrefix).concat(ke)).join(",")),this.container}}class we{constructor({container:Ue,color:fe,elements:ke,titleObj:je,modificationDate:ze,contentsObj:Ze,richText:at,parent:_t,rect:xt,parentRect:Ft,open:qt}){We(this,Ht);We(this,Ut);We(this,Vt);We(this,Gt);We(this,He,null);We(this,it,Ke(this,Ht,ii).bind(this));We(this,et,Ke(this,Gt,Fr).bind(this));We(this,ot,Ke(this,Vt,Rr).bind(this));We(this,ht,Ke(this,Ut,Qn).bind(this));We(this,pt,null);We(this,ct,null);We(this,Pt,null);We(this,It,null);We(this,vt,null);We(this,kt,null);We(this,gt,!1);We(this,tt,null);We(this,nt,null);We(this,ft,null);We(this,Tt,null);We(this,Ct,!1);var $t;st(this,ct,Ue),st(this,Tt,je),st(this,Pt,Ze),st(this,ft,at),st(this,vt,_t),st(this,pt,fe),st(this,nt,xt),st(this,kt,Ft),st(this,It,ke);const Mt=ie.PDFDateString.toDateObject(ze);Mt&&st(this,He,_t.l10n.get("annotation_date_string",{date:Mt.toLocaleDateString(),time:Mt.toLocaleTimeString()})),this.trigger=ke.flatMap(Bt=>Bt.getElementsToTriggerPopup());for(const Bt of this.trigger)Bt.addEventListener("click",ce(this,ht)),Bt.addEventListener("mouseenter",ce(this,ot)),Bt.addEventListener("mouseleave",ce(this,et)),Bt.classList.add("popupTriggerArea");for(const Bt of ke)($t=Bt.container)==null||$t.addEventListener("keydown",ce(this,it));ce(this,ct).hidden=!0,qt&&Ke(this,Ut,Qn).call(this)}render(){if(ce(this,tt))return;const{page:{view:Ue},viewport:{rawDims:{pageWidth:fe,pageHeight:ke,pageX:je,pageY:ze}}}=ce(this,vt),Ze=st(this,tt,document.createElement("div"));if(Ze.className="popup",ce(this,pt)){const En=Ze.style.outlineColor=re.Util.makeHexColor(...ce(this,pt));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?Ze.style.backgroundColor="color-mix(in srgb, ".concat(En," 30%, white)"):Ze.style.backgroundColor=re.Util.makeHexColor(...ce(this,pt).map(Fn=>Math.floor(.7*(255-Fn)+Fn)))}const at=document.createElement("span");at.className="header";const _t=document.createElement("h1");if(at.append(_t),{dir:_t.dir,str:_t.textContent}=ce(this,Tt),Ze.append(at),ce(this,He)){const En=document.createElement("span");En.classList.add("popupDate"),ce(this,He).then(xn=>{En.textContent=xn}),at.append(En)}const xt=ce(this,Pt),Ft=ce(this,ft);if(Ft!=null&&Ft.str&&(!(xt!=null&&xt.str)||xt.str===Ft.str))ue.XfaLayer.render({xfaHtml:Ft.html,intent:"richText",div:Ze}),Ze.lastChild.classList.add("richText","popupContent");else{const En=this._formatContents(xt);Ze.append(En)}let qt=!!ce(this,kt),Mt=qt?ce(this,kt):ce(this,nt);for(const En of ce(this,It))if(!Mt||re.Util.intersect(En.data.rect,Mt)!==null){Mt=En.data.rect,qt=!0;break}const $t=re.Util.normalizeRect([Mt[0],Ue[3]-Mt[1]+Ue[1],Mt[2],Ue[3]-Mt[3]+Ue[1]]),Bt=5,Xt=qt?Mt[2]-Mt[0]+Bt:0,Yt=$t[0]+Xt,Jt=$t[1],{style:Tn}=ce(this,ct);Tn.left="".concat(100*(Yt-je)/fe,"%"),Tn.top="".concat(100*(Jt-ze)/ke,"%"),ce(this,ct).append(Ze)}_formatContents({str:Ue,dir:fe}){const ke=document.createElement("p");ke.classList.add("popupContent"),ke.dir=fe;const je=Ue.split(/(?:\r\n?|\n)/);for(let ze=0,Ze=je.length;ze<Ze;++ze){const at=je[ze];ke.append(document.createTextNode(at)),ze<Ze-1&&ke.append(document.createElement("br"))}return ke}forceHide(){st(this,Ct,this.isVisible),ce(this,Ct)&&(ce(this,ct).hidden=!0)}maybeShow(){ce(this,Ct)&&(st(this,Ct,!1),ce(this,ct).hidden=!1)}get isVisible(){return ce(this,ct).hidden===!1}}He=new WeakMap,it=new WeakMap,et=new WeakMap,ot=new WeakMap,ht=new WeakMap,pt=new WeakMap,ct=new WeakMap,Pt=new WeakMap,It=new WeakMap,vt=new WeakMap,kt=new WeakMap,gt=new WeakMap,tt=new WeakMap,nt=new WeakMap,ft=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,Ht=new WeakSet,ii=function(Ue){Ue.altKey||Ue.shiftKey||Ue.ctrlKey||Ue.metaKey||(Ue.key==="Enter"||Ue.key==="Escape"&&ce(this,gt))&&Ke(this,Ut,Qn).call(this)},Ut=new WeakSet,Qn=function(){st(this,gt,!ce(this,gt)),ce(this,gt)?(Ke(this,Vt,Rr).call(this),ce(this,ct).addEventListener("click",ce(this,ht)),ce(this,ct).addEventListener("keydown",ce(this,it))):(Ke(this,Gt,Fr).call(this),ce(this,ct).removeEventListener("click",ce(this,ht)),ce(this,ct).removeEventListener("keydown",ce(this,it)))},Vt=new WeakSet,Rr=function(){ce(this,tt)||this.render(),this.isVisible?ce(this,gt)&&ce(this,ct).classList.add("focused"):(ce(this,ct).hidden=!1,ce(this,ct).style.zIndex=parseInt(ce(this,ct).style.zIndex)+1e3)},Gt=new WeakSet,Fr=function(){ce(this,ct).classList.remove("focused"),!(ce(this,gt)||!this.isVisible)&&(ce(this,ct).hidden=!0,ce(this,ct).style.zIndex=parseInt(ce(this,ct).style.zIndex)-1e3)};class Oe extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0}),this.textContent=Ue.data.textContent,this.textPosition=Ue.data.textPosition,this.annotationEditorType=re.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const Ue=document.createElement("div");Ue.classList.add("annotationTextContent"),Ue.setAttribute("role","comment");for(const fe of this.textContent){const ke=document.createElement("span");ke.textContent=fe,Ue.append(ke)}this.container.append(Ue)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}te.FreeTextAnnotationElement=Oe;class Fe extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,Qe,null)}render(){this.container.classList.add("lineAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=st(this,Qe,this.svgFactory.createElement("svg:line"));return Ze.setAttribute("x1",fe.rect[2]-fe.lineCoordinates[0]),Ze.setAttribute("y1",fe.rect[3]-fe.lineCoordinates[1]),Ze.setAttribute("x2",fe.rect[2]-fe.lineCoordinates[2]),Ze.setAttribute("y2",fe.rect[3]-fe.lineCoordinates[3]),Ze.setAttribute("stroke-width",fe.borderStyle.width||1),Ze.setAttribute("stroke","transparent"),Ze.setAttribute("fill","transparent"),ze.append(Ze),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,Qe)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qe=new WeakMap;class Ve extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,Ye,null)}render(){this.container.classList.add("squareAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=fe.borderStyle.width,at=st(this,Ye,this.svgFactory.createElement("svg:rect"));return at.setAttribute("x",Ze/2),at.setAttribute("y",Ze/2),at.setAttribute("width",ke-Ze),at.setAttribute("height",je-Ze),at.setAttribute("stroke-width",Ze||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,Ye)}addHighlightArea(){this.container.classList.add("highlightArea")}}Ye=new WeakMap;class qe extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,yt,null)}render(){this.container.classList.add("circleAnnotation");const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0),Ze=fe.borderStyle.width,at=st(this,yt,this.svgFactory.createElement("svg:ellipse"));return at.setAttribute("cx",ke/2),at.setAttribute("cy",je/2),at.setAttribute("rx",ke/2-Ze/2),at.setAttribute("ry",je/2-Ze/2),at.setAttribute("stroke-width",Ze||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,yt)}addHighlightArea(){this.container.classList.add("highlightArea")}}yt=new WeakMap;class Ie extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,St,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0);let Ze=[];for(const _t of fe.vertices){const xt=_t.x-fe.rect[0],Ft=fe.rect[3]-_t.y;Ze.push(xt+","+Ft)}Ze=Ze.join(" ");const at=st(this,St,this.svgFactory.createElement(this.svgElementName));return at.setAttribute("points",Ze),at.setAttribute("stroke-width",fe.borderStyle.width||1),at.setAttribute("stroke","transparent"),at.setAttribute("fill","transparent"),ze.append(at),this.container.append(ze),!fe.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return ce(this,St)}addHighlightArea(){this.container.classList.add("highlightArea")}}St=new WeakMap;class Xe extends Ie{constructor(Ue){super(Ue),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class rt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class lt extends me{constructor(fe){super(fe,{isRenderable:!0,ignoreBorder:!0});We(this,wn,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=re.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const fe=this.data,{width:ke,height:je}=Ae(fe.rect),ze=this.svgFactory.create(ke,je,!0);for(const Ze of fe.inkLists){let at=[];for(const xt of Ze){const Ft=xt.x-fe.rect[0],qt=fe.rect[3]-xt.y;at.push("".concat(Ft,",").concat(qt))}at=at.join(" ");const _t=this.svgFactory.createElement(this.svgElementName);ce(this,wn).push(_t),_t.setAttribute("points",at),_t.setAttribute("stroke-width",fe.borderStyle.width||1),_t.setAttribute("stroke","transparent"),_t.setAttribute("fill","transparent"),!fe.popupRef&&this.hasPopupData&&this._createPopup(),ze.append(_t)}return this.container.append(ze),this.container}getElementsToTriggerPopup(){return ce(this,wn)}addHighlightArea(){this.container.classList.add("highlightArea")}}wn=new WeakMap,te.InkAnnotationElement=lt;class Ge extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class ut extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class mt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class wt extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Et extends me{constructor(Ue){super(Ue,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}te.StampAnnotationElement=Et;class De extends me{constructor(fe){var ze;super(fe,{isRenderable:!0});We(this,Je);We(this,Qt,null);const{filename:ke,content:je}=this.data.file;this.filename=(0,ie.getFilenameFromUrl)(ke,!0),this.content=je,(ze=this.linkService.eventBus)==null||ze.dispatch("fileattachmentannotation",{source:this,filename:ke,content:je})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:fe,data:ke}=this;let je;ke.hasAppearance||ke.fillAlpha===0?je=document.createElement("div"):(je=document.createElement("img"),je.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(ke.name)?"paperclip":"pushpin",".svg"),ke.fillAlpha&&ke.fillAlpha<1&&(je.style="filter: opacity(".concat(Math.round(ke.fillAlpha*100),"%);"))),je.addEventListener("dblclick",Ke(this,Je,Mr).bind(this)),st(this,Qt,je);const{isMac:ze}=re.FeatureTest.platform;return fe.addEventListener("keydown",Ze=>{Ze.key==="Enter"&&(ze?Ze.metaKey:Ze.ctrlKey)&&Ke(this,Je,Mr).call(this)}),!ke.popupRef&&this.hasPopupData?this._createPopup():je.classList.add("popupTriggerArea"),fe.append(je),fe}getElementsToTriggerPopup(){return ce(this,Qt)}addHighlightArea(){this.container.classList.add("highlightArea")}}Qt=new WeakMap,Je=new WeakSet,Mr=function(){var fe;(fe=this.downloadManager)==null||fe.openOrDownloadData(this.container,this.content,this.filename)};class pe{constructor({div:Ue,accessibilityManager:fe,annotationCanvasMap:ke,l10n:je,page:ze,viewport:Ze}){We(this,Nt);We(this,bt);We(this,Lt,null);We(this,Rt,null);We(this,Dt,new Map);this.div=Ue,st(this,Lt,fe),st(this,Rt,ke),this.l10n=je,this.page=ze,this.viewport=Ze,this.zIndex=0,this.l10n||(this.l10n=he.NullL10n)}async render(Ue){const{annotations:fe}=Ue,ke=this.div;(0,ie.setLayerDimensions)(ke,this.viewport);const je=new Map,ze={data:null,layer:ke,linkService:Ue.linkService,downloadManager:Ue.downloadManager,imageResourcesPath:Ue.imageResourcesPath||"",renderForms:Ue.renderForms!==!1,svgFactory:new ie.DOMSVGFactory,annotationStorage:Ue.annotationStorage||new se.AnnotationStorage,enableScripting:Ue.enableScripting===!0,hasJSActions:Ue.hasJSActions,fieldObjects:Ue.fieldObjects,parent:this,elements:null};for(const Ze of fe){if(Ze.noHTML)continue;const at=Ze.annotationType===re.AnnotationType.POPUP;if(at){const Ft=je.get(Ze.id);if(!Ft)continue;ze.elements=Ft}else{const{width:Ft,height:qt}=Ae(Ze.rect);if(Ft<=0||qt<=0)continue}ze.data=Ze;const _t=_e.create(ze);if(!_t.isRenderable)continue;if(!at&&Ze.popupRef){const Ft=je.get(Ze.popupRef);Ft?Ft.push(_t):je.set(Ze.popupRef,[_t])}_t.annotationEditorType>0&&ce(this,Dt).set(_t.data.id,_t);const xt=_t.render();Ze.hidden&&(xt.style.visibility="hidden"),Ke(this,Nt,si).call(this,xt,Ze.id)}Ke(this,bt,$r).call(this),await this.l10n.translate(ke)}update({viewport:Ue}){const fe=this.div;this.viewport=Ue,(0,ie.setLayerDimensions)(fe,{rotation:Ue.rotation}),Ke(this,bt,$r).call(this),fe.hidden=!1}getEditableAnnotations(){return Array.from(ce(this,Dt).values())}getEditableAnnotation(Ue){return ce(this,Dt).get(Ue)}}Lt=new WeakMap,Rt=new WeakMap,Dt=new WeakMap,Nt=new WeakSet,si=function(Ue,fe){var je;const ke=Ue.firstChild||Ue;ke.id="".concat(re.AnnotationPrefix).concat(fe),this.div.append(Ue),(je=ce(this,Lt))==null||je.moveElementInDOM(this.div,Ue,ke,!1)},bt=new WeakSet,$r=function(){if(!ce(this,Rt))return;const Ue=this.div;for(const[fe,ke]of ce(this,Rt)){const je=Ue.querySelector('[data-annotation-id="'.concat(fe,'"]'));if(!je)continue;const{firstChild:ze}=je;ze?ze.nodeName==="CANVAS"?ze.replaceWith(ke):ze.before(ke):je.append(ke)}ce(this,Rt).clear()},te.AnnotationLayer=pe},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.ColorConverters=void 0;function ne(se){return Math.floor(Math.max(0,Math.min(1,se))*255).toString(16).padStart(2,"0")}function re(se){return Math.max(0,Math.min(255,255*se))}class ie{static CMYK_G([oe,he,ue,de]){return["G",1-Math.min(1,.3*oe+.59*ue+.11*he+de)]}static G_CMYK([oe]){return["CMYK",0,0,0,1-oe]}static G_RGB([oe]){return["RGB",oe,oe,oe]}static G_rgb([oe]){return oe=re(oe),[oe,oe,oe]}static G_HTML([oe]){const he=ne(oe);return"#".concat(he).concat(he).concat(he)}static RGB_G([oe,he,ue]){return["G",.3*oe+.59*he+.11*ue]}static RGB_rgb(oe){return oe.map(re)}static RGB_HTML(oe){return"#".concat(oe.map(ne).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([oe,he,ue,de]){return["RGB",1-Math.min(1,oe+de),1-Math.min(1,ue+de),1-Math.min(1,he+de)]}static CMYK_rgb([oe,he,ue,de]){return[re(1-Math.min(1,oe+de)),re(1-Math.min(1,ue+de)),re(1-Math.min(1,he+de))]}static CMYK_HTML(oe){const he=this.CMYK_RGB(oe).slice(1);return this.RGB_HTML(he)}static RGB_CMYK([oe,he,ue]){const de=1-oe,ae=1-he,le=1-ue,Ae=Math.min(de,ae,le);return["CMYK",de,ae,le,Ae]}}te.ColorConverters=ie},(ee,te)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.NullL10n=void 0,te.getL10nFallback=re;const ne={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};ne.print_progress_percent="{{progress}}%";function re(oe,he){switch(oe){case"find_match_count":oe="find_match_count[".concat(he.total===1?"one":"other","]");break;case"find_match_count_limit":oe="find_match_count_limit[".concat(he.limit===1?"one":"other","]");break}return ne[oe]||""}function ie(oe,he){return he?oe.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(ue,de)=>de in he?he[de]:"{{"+de+"}}"):oe}const se={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(oe,he=null,ue=re(oe,he)){return ie(ue,he)},async translate(oe){}};te.NullL10n=se},(ee,te,ne)=>{Object.defineProperty(te,"__esModule",{value:!0}),te.XfaLayer=void 0;var re=ne(25);class ie{static setupStorage(oe,he,ue,de,ae){const le=de.getValue(he,{value:null});switch(ue.name){case"textarea":if(le.value!==null&&(oe.textContent=le.value),ae==="print")break;oe.addEventListener("input",Ae=>{de.setValue(he,{value:Ae.target.value})});break;case"input":if(ue.attributes.type==="radio"||ue.attributes.type==="checkbox"){if(le.value===ue.attributes.xfaOn?oe.setAttribute("checked",!0):le.value===ue.attributes.xfaOff&&oe.removeAttribute("checked"),ae==="print")break;oe.addEventListener("change",Ae=>{de.setValue(he,{value:Ae.target.checked?Ae.target.getAttribute("xfaOn"):Ae.target.getAttribute("xfaOff")})})}else{if(le.value!==null&&oe.setAttribute("value",le.value),ae==="print")break;oe.addEventListener("input",Ae=>{de.setValue(he,{value:Ae.target.value})})}break;case"select":if(le.value!==null){oe.setAttribute("value",le.value);for(const Ae of ue.children)Ae.attributes.value===le.value?Ae.attributes.selected=!0:Ae.attributes.hasOwnProperty("selected")&&delete Ae.attributes.selected}oe.addEventListener("input",Ae=>{const _e=Ae.target.options,me=_e.selectedIndex===-1?"":_e[_e.selectedIndex].value;de.setValue(he,{value:me})});break}}static setAttributes({html:oe,element:he,storage:ue=null,intent:de,linkService:ae}){const{attributes:le}=he,Ae=oe instanceof HTMLAnchorElement;le.type==="radio"&&(le.name="".concat(le.name,"-").concat(de));for(const[_e,me]of Object.entries(le))if(me!=null)switch(_e){case"class":me.length&&oe.setAttribute(_e,me.join(" "));break;case"dataId":break;case"id":oe.setAttribute("data-element-id",me);break;case"style":Object.assign(oe.style,me);break;case"textContent":oe.textContent=me;break;default:(!Ae||_e!=="href"&&_e!=="newWindow")&&oe.setAttribute(_e,me)}Ae&&ae.addLinkAttributes(oe,le.href,le.newWindow),ue&&le.dataId&&this.setupStorage(oe,le.dataId,he,ue)}static render(oe){var ve;const he=oe.annotationStorage,ue=oe.linkService,de=oe.xfaHtml,ae=oe.intent||"display",le=document.createElement(de.name);de.attributes&&this.setAttributes({html:le,element:de,intent:ae,linkService:ue});const Ae=[[de,-1,le]],_e=oe.div;if(_e.append(le),oe.viewport){const Se="matrix(".concat(oe.viewport.transform.join(","),")");_e.style.transform=Se}ae!=="richText"&&_e.setAttribute("class","xfaLayer xfaFont");const me=[];for(;Ae.length>0;){const[Se,Te,Pe]=Ae.at(-1);if(Te+1===Se.children.length){Ae.pop();continue}const Re=Se.children[++Ae.at(-1)[1]];if(Re===null)continue;const{name:$e}=Re;if($e==="#text"){const Ee=document.createTextNode(Re.value);me.push(Ee),Pe.append(Ee);continue}const ye=(ve=Re==null?void 0:Re.attributes)!=null&&ve.xmlns?document.createElementNS(Re.attributes.xmlns,$e):document.createElement($e);if(Pe.append(ye),Re.attributes&&this.setAttributes({html:ye,element:Re,storage:he,intent:ae,linkService:ue}),Re.children&&Re.children.length>0)Ae.push([Re,-1,ye]);else if(Re.value){const Ee=document.createTextNode(Re.value);re.XfaText.shouldBuildText($e)&&me.push(Ee),ye.append(Ee)}}for(const Se of _e.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))Se.setAttribute("readOnly",!0);return{textDivs:me}}static update(oe){const he="matrix(".concat(oe.viewport.transform.join(","),")");oe.div.style.transform=he,oe.div.hidden=!1}}te.XfaLayer=ie},(ee,te,ne)=>{var de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Re,$e,ye,Ee,Ne,oi,we,ai,Fe,li,qe,ci,Xe,kr,lt,ui,ut,Lr,wt,di,De,hi,be,fi,Ce,pi,Le,gi,He,Rn,et,Ir,ht,er,ct,tr,It,On,kt,Or,tt,nr,ft,mi,Ct,Dr,Wt,_i,zt,yi,jt,Nr,dt,rr,Ye,Dn;Object.defineProperty(te,"__esModule",{value:!0}),te.InkEditor=void 0;var re=ne(1),ie=ne(4),se=ne(29),oe=ne(6),he=ne(5);const St=class St extends ie.AnnotationEditor{constructor(Je){super({...Je,name:"inkEditor"});We(this,Ne);We(this,we);We(this,Fe);We(this,qe);We(this,Xe);We(this,lt);We(this,ut);We(this,wt);We(this,De);We(this,be);We(this,Ce);We(this,Le);We(this,He);We(this,et);We(this,ht);We(this,ct);We(this,It);We(this,kt);We(this,tt);We(this,zt);We(this,jt);We(this,dt);We(this,Ye);We(this,de,0);We(this,ae,0);We(this,le,this.canvasPointermove.bind(this));We(this,Ae,this.canvasPointerleave.bind(this));We(this,_e,this.canvasPointerup.bind(this));We(this,me,this.canvasPointerdown.bind(this));We(this,ve,new Path2D);We(this,Se,!1);We(this,Te,!1);We(this,Pe,!1);We(this,Re,null);We(this,$e,0);We(this,ye,0);We(this,Ee,null);this.color=Je.color||null,this.thickness=Je.thickness||null,this.opacity=Je.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(Je){ie.AnnotationEditor.initialize(Je,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(Je,At){switch(Je){case re.AnnotationEditorParamsType.INK_THICKNESS:St._defaultThickness=At;break;case re.AnnotationEditorParamsType.INK_COLOR:St._defaultColor=At;break;case re.AnnotationEditorParamsType.INK_OPACITY:St._defaultOpacity=At/100;break}}updateParams(Je,At){switch(Je){case re.AnnotationEditorParamsType.INK_THICKNESS:Ke(this,Ne,oi).call(this,At);break;case re.AnnotationEditorParamsType.INK_COLOR:Ke(this,we,ai).call(this,At);break;case re.AnnotationEditorParamsType.INK_OPACITY:Ke(this,Fe,li).call(this,At);break}}static get defaultPropertiesToUpdate(){return[[re.AnnotationEditorParamsType.INK_THICKNESS,St._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,St._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(St._defaultOpacity*100)]]}get propertiesToUpdate(){var Je;return[[re.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||St._defaultThickness],[re.AnnotationEditorParamsType.INK_COLOR,this.color||St._defaultColor||ie.AnnotationEditor._defaultLineColor],[re.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*((Je=this.opacity)!=null?Je:St._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(Ke(this,ht,er).call(this),Ke(this,ct,tr).call(this)),this.isAttachedToDOM||(this.parent.add(this),Ke(this,It,On).call(this)),Ke(this,Ye,Dn).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,ce(this,Re).disconnect(),st(this,Re,null),super.remove())}setParent(Je){!this.parent&&Je?this._uiManager.removeShouldRescale(this):this.parent&&Je===null&&this._uiManager.addShouldRescale(this),super.setParent(Je)}onScaleChanging(){const[Je,At]=this.parentDimensions,Lt=this.width*Je,Rt=this.height*At;this.setDimensions(Lt,Rt)}enableEditMode(){ce(this,Se)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",ce(this,me)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",ce(this,me)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){ce(this,Se)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),st(this,Se,!0),this.div.classList.add("disabled"),Ke(this,Ye,Dn).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(Je){this._focusEventsAllowed&&(super.focusin(Je),this.enableEditMode())}canvasPointerdown(Je){Je.button!==0||!this.isInEditMode()||ce(this,Se)||(this.setInForeground(),Je.preventDefault(),Je.type!=="mouse"&&this.div.focus(),Ke(this,lt,ui).call(this,Je.offsetX,Je.offsetY))}canvasPointermove(Je){Je.preventDefault(),Ke(this,ut,Lr).call(this,Je.offsetX,Je.offsetY)}canvasPointerup(Je){Je.preventDefault(),Ke(this,et,Ir).call(this,Je)}canvasPointerleave(Je){Ke(this,et,Ir).call(this,Je)}get isResizable(){return!this.isEmpty()&&ce(this,Se)}render(){if(this.div)return this.div;let Je,At;this.width&&(Je=this.x,At=this.y),super.render(),ie.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(Zt=>{var bt;return(bt=this.div)==null?void 0:bt.setAttribute("aria-label",Zt)});const[Lt,Rt,Dt,Nt]=Ke(this,qe,ci).call(this);if(this.setAt(Lt,Rt,0,0),this.setDims(Dt,Nt),Ke(this,ht,er).call(this),this.width){const[Zt,bt]=this.parentDimensions;this.setAspectRatio(this.width*Zt,this.height*bt),this.setAt(Je*Zt,At*bt,this.width*Zt,this.height*bt),st(this,Pe,!0),Ke(this,It,On).call(this),this.setDims(this.width*Zt,this.height*bt),Ke(this,He,Rn).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return Ke(this,ct,tr).call(this),this.div}setDimensions(Je,At){const Lt=Math.round(Je),Rt=Math.round(At);if(ce(this,$e)===Lt&&ce(this,ye)===Rt)return;st(this,$e,Lt),st(this,ye,Rt),this.canvas.style.visibility="hidden";const[Dt,Nt]=this.parentDimensions;this.width=Je/Dt,this.height=At/Nt,this.fixAndSetPosition(),ce(this,Se)&&Ke(this,kt,Or).call(this,Je,At),Ke(this,It,On).call(this),Ke(this,He,Rn).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(Je,At,Lt){var ze,Ze,at;if(Je instanceof se.InkAnnotationElement)return null;const Rt=super.deserialize(Je,At,Lt);Rt.thickness=Je.thickness,Rt.color=re.Util.makeHexColor(...Je.color),Rt.opacity=Je.opacity;const[Dt,Nt]=Rt.pageDimensions,Zt=Rt.width*Dt,bt=Rt.height*Nt,Kt=Rt.parentScale,Ot=Je.thickness/2;st(Rt,Se,!0),st(Rt,$e,Math.round(Zt)),st(Rt,ye,Math.round(bt));const{paths:Ue,rect:fe,rotation:ke}=Je;for(let{bezier:_t}of Ue){_t=Ke(ze=St,Wt,_i).call(ze,_t,fe,ke);const xt=[];Rt.paths.push(xt);let Ft=Kt*(_t[0]-Ot),qt=Kt*(_t[1]-Ot);for(let $t=2,Bt=_t.length;$t<Bt;$t+=6){const Xt=Kt*(_t[$t]-Ot),Yt=Kt*(_t[$t+1]-Ot),Jt=Kt*(_t[$t+2]-Ot),Tn=Kt*(_t[$t+3]-Ot),En=Kt*(_t[$t+4]-Ot),xn=Kt*(_t[$t+5]-Ot);xt.push([[Ft,qt],[Xt,Yt],[Jt,Tn],[En,xn]]),Ft=En,qt=xn}const Mt=Ke(this,ft,mi).call(this,xt);Rt.bezierPath2D.push(Mt)}const je=Ke(Ze=Rt,jt,Nr).call(Ze);return st(Rt,ae,Math.max(ie.AnnotationEditor.MIN_SIZE,je[2]-je[0])),st(Rt,de,Math.max(ie.AnnotationEditor.MIN_SIZE,je[3]-je[1])),Ke(at=Rt,kt,Or).call(at,Zt,bt),Rt}serialize(){if(this.isEmpty())return null;const Je=this.getRect(0,0),At=ie.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:re.AnnotationEditorType.INK,color:At,thickness:this.thickness,opacity:this.opacity,paths:Ke(this,zt,yi).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,Je),pageIndex:this.pageIndex,rect:Je,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakMap,Re=new WeakMap,$e=new WeakMap,ye=new WeakMap,Ee=new WeakMap,Ne=new WeakSet,oi=function(Je){const At=this.thickness;this.addCommands({cmd:()=>{this.thickness=Je,Ke(this,Ye,Dn).call(this)},undo:()=>{this.thickness=At,Ke(this,Ye,Dn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},we=new WeakSet,ai=function(Je){const At=this.color;this.addCommands({cmd:()=>{this.color=Je,Ke(this,He,Rn).call(this)},undo:()=>{this.color=At,Ke(this,He,Rn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Fe=new WeakSet,li=function(Je){Je/=100;const At=this.opacity;this.addCommands({cmd:()=>{this.opacity=Je,Ke(this,He,Rn).call(this)},undo:()=>{this.opacity=At,Ke(this,He,Rn).call(this)},mustExec:!0,type:re.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},qe=new WeakSet,ci=function(){const{parentRotation:Je,parentDimensions:[At,Lt]}=this;switch(Je){case 90:return[0,Lt,Lt,At];case 180:return[At,Lt,At,Lt];case 270:return[At,0,Lt,At];default:return[0,0,At,Lt]}},Xe=new WeakSet,kr=function(){const{ctx:Je,color:At,opacity:Lt,thickness:Rt,parentScale:Dt,scaleFactor:Nt}=this;Je.lineWidth=Rt*Dt/Nt,Je.lineCap="round",Je.lineJoin="round",Je.miterLimit=10,Je.strokeStyle="".concat(At).concat((0,he.opacityToHex)(Lt))},lt=new WeakSet,ui=function(Je,At){var Lt;this.canvas.addEventListener("contextmenu",oe.noContextMenu),this.canvas.addEventListener("pointerleave",ce(this,Ae)),this.canvas.addEventListener("pointermove",ce(this,le)),this.canvas.addEventListener("pointerup",ce(this,_e)),this.canvas.removeEventListener("pointerdown",ce(this,me)),this.isEditing=!0,ce(this,Pe)||(st(this,Pe,!0),Ke(this,It,On).call(this),this.thickness||(this.thickness=St._defaultThickness),this.color||(this.color=St._defaultColor||ie.AnnotationEditor._defaultLineColor),(Lt=this.opacity)!=null||(this.opacity=St._defaultOpacity)),this.currentPath.push([Je,At]),st(this,Te,!1),Ke(this,Xe,kr).call(this),st(this,Ee,()=>{Ke(this,be,fi).call(this),ce(this,Ee)&&window.requestAnimationFrame(ce(this,Ee))}),window.requestAnimationFrame(ce(this,Ee))},ut=new WeakSet,Lr=function(Je,At){const[Lt,Rt]=this.currentPath.at(-1);if(this.currentPath.length>1&&Je===Lt&&At===Rt)return;const Dt=this.currentPath;let Nt=ce(this,ve);if(Dt.push([Je,At]),st(this,Te,!0),Dt.length<=2){Nt.moveTo(...Dt[0]),Nt.lineTo(Je,At);return}Dt.length===3&&(st(this,ve,Nt=new Path2D),Nt.moveTo(...Dt[0])),Ke(this,Ce,pi).call(this,Nt,...Dt.at(-3),...Dt.at(-2),Je,At)},wt=new WeakSet,di=function(){if(this.currentPath.length===0)return;const Je=this.currentPath.at(-1);ce(this,ve).lineTo(...Je)},De=new WeakSet,hi=function(Je,At){st(this,Ee,null),Je=Math.min(Math.max(Je,0),this.canvas.width),At=Math.min(Math.max(At,0),this.canvas.height),Ke(this,ut,Lr).call(this,Je,At),Ke(this,wt,di).call(this);let Lt;if(this.currentPath.length!==1)Lt=Ke(this,Le,gi).call(this);else{const bt=[Je,At];Lt=[[bt,bt.slice(),bt.slice(),bt]]}const Rt=ce(this,ve),Dt=this.currentPath;this.currentPath=[],st(this,ve,new Path2D);const Nt=()=>{this.allRawPaths.push(Dt),this.paths.push(Lt),this.bezierPath2D.push(Rt),this.rebuild()},Zt=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(Ke(this,ht,er).call(this),Ke(this,ct,tr).call(this)),Ke(this,Ye,Dn).call(this))};this.addCommands({cmd:Nt,undo:Zt,mustExec:!0})},be=new WeakSet,fi=function(){if(!ce(this,Te))return;st(this,Te,!1);const Je=Math.ceil(this.thickness*this.parentScale),At=this.currentPath.slice(-3),Lt=At.map(Nt=>Nt[0]),Rt=At.map(Nt=>Nt[1]);Math.min(...Lt)-Je,Math.max(...Lt)+Je,Math.min(...Rt)-Je,Math.max(...Rt)+Je;const{ctx:Dt}=this;Dt.save(),Dt.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Nt of this.bezierPath2D)Dt.stroke(Nt);Dt.stroke(ce(this,ve)),Dt.restore()},Ce=new WeakSet,pi=function(Je,At,Lt,Rt,Dt,Nt,Zt){const bt=(At+Rt)/2,Kt=(Lt+Dt)/2,Ot=(Rt+Nt)/2,Ue=(Dt+Zt)/2;Je.bezierCurveTo(bt+2*(Rt-bt)/3,Kt+2*(Dt-Kt)/3,Ot+2*(Rt-Ot)/3,Ue+2*(Dt-Ue)/3,Ot,Ue)},Le=new WeakSet,gi=function(){const Je=this.currentPath;if(Je.length<=2)return[[Je[0],Je[0],Je.at(-1),Je.at(-1)]];const At=[];let Lt,[Rt,Dt]=Je[0];for(Lt=1;Lt<Je.length-2;Lt++){const[fe,ke]=Je[Lt],[je,ze]=Je[Lt+1],Ze=(fe+je)/2,at=(ke+ze)/2,_t=[Rt+2*(fe-Rt)/3,Dt+2*(ke-Dt)/3],xt=[Ze+2*(fe-Ze)/3,at+2*(ke-at)/3];At.push([[Rt,Dt],_t,xt,[Ze,at]]),[Rt,Dt]=[Ze,at]}const[Nt,Zt]=Je[Lt],[bt,Kt]=Je[Lt+1],Ot=[Rt+2*(Nt-Rt)/3,Dt+2*(Zt-Dt)/3],Ue=[bt+2*(Nt-bt)/3,Kt+2*(Zt-Kt)/3];return At.push([[Rt,Dt],Ot,Ue,[bt,Kt]]),At},He=new WeakSet,Rn=function(){if(this.isEmpty()){Ke(this,tt,nr).call(this);return}Ke(this,Xe,kr).call(this);const{canvas:Je,ctx:At}=this;At.setTransform(1,0,0,1,0,0),At.clearRect(0,0,Je.width,Je.height),Ke(this,tt,nr).call(this);for(const Lt of this.bezierPath2D)At.stroke(Lt)},et=new WeakSet,Ir=function(Je){this.canvas.removeEventListener("pointerleave",ce(this,Ae)),this.canvas.removeEventListener("pointermove",ce(this,le)),this.canvas.removeEventListener("pointerup",ce(this,_e)),this.canvas.addEventListener("pointerdown",ce(this,me)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",oe.noContextMenu)},10),Ke(this,De,hi).call(this,Je.offsetX,Je.offsetY),this.addToAnnotationStorage(),this.setInBackground()},ht=new WeakSet,er=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",ie.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(Je=>{var At;return(At=this.canvas)==null?void 0:At.setAttribute("aria-label",Je)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},ct=new WeakSet,tr=function(){st(this,Re,new ResizeObserver(Je=>{const At=Je[0].contentRect;At.width&&At.height&&this.setDimensions(At.width,At.height)})),ce(this,Re).observe(this.div)},It=new WeakSet,On=function(){if(!ce(this,Pe))return;const[Je,At]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*Je),this.canvas.height=Math.ceil(this.height*At),Ke(this,tt,nr).call(this)},kt=new WeakSet,Or=function(Je,At){const Lt=Ke(this,dt,rr).call(this),Rt=(Je-Lt)/ce(this,ae),Dt=(At-Lt)/ce(this,de);this.scaleFactor=Math.min(Rt,Dt)},tt=new WeakSet,nr=function(){const Je=Ke(this,dt,rr).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+Je,this.translationY*this.scaleFactor+Je)},ft=new WeakSet,mi=function(Je){const At=new Path2D;for(let Lt=0,Rt=Je.length;Lt<Rt;Lt++){const[Dt,Nt,Zt,bt]=Je[Lt];Lt===0&&At.moveTo(...Dt),At.bezierCurveTo(Nt[0],Nt[1],Zt[0],Zt[1],bt[0],bt[1])}return At},Ct=new WeakSet,Dr=function(Je,At,Lt){const[Rt,Dt,Nt,Zt]=At;switch(Lt){case 0:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]+=Rt,Je[bt+1]=Zt-Je[bt+1];break;case 90:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Je[bt+1]+Rt,Je[bt+1]=Ot+Dt}break;case 180:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]=Nt-Je[bt],Je[bt+1]+=Dt;break;case 270:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Nt-Je[bt+1],Je[bt+1]=Zt-Ot}break;default:throw new Error("Invalid rotation")}return Je},Wt=new WeakSet,_i=function(Je,At,Lt){const[Rt,Dt,Nt,Zt]=At;switch(Lt){case 0:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]-=Rt,Je[bt+1]=Zt-Je[bt+1];break;case 90:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Je[bt+1]-Dt,Je[bt+1]=Ot-Rt}break;case 180:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2)Je[bt]=Nt-Je[bt],Je[bt+1]-=Dt;break;case 270:for(let bt=0,Kt=Je.length;bt<Kt;bt+=2){const Ot=Je[bt];Je[bt]=Zt-Je[bt+1],Je[bt+1]=Nt-Ot}break;default:throw new Error("Invalid rotation")}return Je},zt=new WeakSet,yi=function(Je,At,Lt,Rt){var Kt,Ot;const Dt=[],Nt=this.thickness/2,Zt=Je*At+Nt,bt=Je*Lt+Nt;for(const Ue of this.paths){const fe=[],ke=[];for(let je=0,ze=Ue.length;je<ze;je++){const[Ze,at,_t,xt]=Ue[je],Ft=Je*Ze[0]+Zt,qt=Je*Ze[1]+bt,Mt=Je*at[0]+Zt,$t=Je*at[1]+bt,Bt=Je*_t[0]+Zt,Xt=Je*_t[1]+bt,Yt=Je*xt[0]+Zt,Jt=Je*xt[1]+bt;je===0&&(fe.push(Ft,qt),ke.push(Ft,qt)),fe.push(Mt,$t,Bt,Xt,Yt,Jt),ke.push(Mt,$t),je===ze-1&&ke.push(Yt,Jt)}Dt.push({bezier:Ke(Kt=St,Ct,Dr).call(Kt,fe,Rt,this.rotation),points:Ke(Ot=St,Ct,Dr).call(Ot,ke,Rt,this.rotation)})}return Dt},jt=new WeakSet,Nr=function(){let Je=1/0,At=-1/0,Lt=1/0,Rt=-1/0;for(const Dt of this.paths)for(const[Nt,Zt,bt,Kt]of Dt){const Ot=re.Util.bezierBoundingBox(...Nt,...Zt,...bt,...Kt);Je=Math.min(Je,Ot[0]),Lt=Math.min(Lt,Ot[1]),At=Math.max(At,Ot[2]),Rt=Math.max(Rt,Ot[3])}return[Je,Lt,At,Rt]},dt=new WeakSet,rr=function(){return ce(this,Se)?Math.ceil(this.thickness*this.parentScale):0},Ye=new WeakSet,Dn=function(Je=!1){if(this.isEmpty())return;if(!ce(this,Se)){Ke(this,He,Rn).call(this);return}const At=Ke(this,jt,Nr).call(this),Lt=Ke(this,dt,rr).call(this);st(this,ae,Math.max(ie.AnnotationEditor.MIN_SIZE,At[2]-At[0])),st(this,de,Math.max(ie.AnnotationEditor.MIN_SIZE,At[3]-At[1]));const Rt=Math.ceil(Lt+ce(this,ae)*this.scaleFactor),Dt=Math.ceil(Lt+ce(this,de)*this.scaleFactor),[Nt,Zt]=this.parentDimensions;this.width=Rt/Nt,this.height=Dt/Zt,this.setAspectRatio(Rt,Dt);const bt=this.translationX,Kt=this.translationY;this.translationX=-At[0],this.translationY=-At[1],Ke(this,It,On).call(this),Ke(this,He,Rn).call(this),st(this,$e,Rt),st(this,ye,Dt),this.setDims(Rt,Dt);const Ot=Je?Lt/this.scaleFactor/2:0;this.translate(bt-this.translationX-Ot,Kt-this.translationY-Ot)},We(St,ft),We(St,Ct),We(St,Wt),An(St,"_defaultColor",null),An(St,"_defaultOpacity",1),An(St,"_defaultThickness",1),An(St,"_type","ink");let ue=St;te.InkEditor=ue},(ee,te,ne)=>{var ue,de,ae,le,Ae,_e,me,ve,Se,Te,Pe,Vn,$e,Gn,Ee,ir,Me,Br,Oe,bi,Ve,Si,Ie,Ur,rt,sr,Ge,vi;Object.defineProperty(te,"__esModule",{value:!0}),te.StampEditor=void 0;var re=ne(1),ie=ne(4),se=ne(6),oe=ne(29);const mt=class mt extends ie.AnnotationEditor{constructor(De){super({...De,name:"stampEditor"});We(this,Pe);We(this,$e);We(this,Ee);We(this,Me);We(this,Oe);We(this,Ve);We(this,Ie);We(this,rt);We(this,Ge);We(this,ue,null);We(this,de,null);We(this,ae,null);We(this,le,null);We(this,Ae,null);We(this,_e,null);We(this,me,null);We(this,ve,null);We(this,Se,!1);We(this,Te,!1);st(this,le,De.bitmapUrl),st(this,Ae,De.bitmapFile)}static initialize(De){ie.AnnotationEditor.initialize(De)}static get supportedTypes(){const De=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,re.shadow)(this,"supportedTypes",De.map(pe=>"image/".concat(pe)))}static get supportedTypesStr(){return(0,re.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(De){return this.supportedTypes.includes(De)}static paste(De,pe){pe.pasteEditor(re.AnnotationEditorType.STAMP,{bitmapFile:De.getAsFile()})}remove(){var De,pe;ce(this,de)&&(st(this,ue,null),this._uiManager.imageManager.deleteId(ce(this,de)),(De=ce(this,_e))==null||De.remove(),st(this,_e,null),(pe=ce(this,me))==null||pe.disconnect(),st(this,me,null)),super.remove()}rebuild(){if(!this.parent){ce(this,de)&&Ke(this,Ee,ir).call(this);return}super.rebuild(),this.div!==null&&(ce(this,de)&&Ke(this,Ee,ir).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(ce(this,ae)||ce(this,ue)||ce(this,le)||ce(this,Ae))}get isResizable(){return!0}render(){if(this.div)return this.div;let De,pe;if(this.width&&(De=this.x,pe=this.y),super.render(),this.div.hidden=!0,ce(this,ue)?Ke(this,Me,Br).call(this):Ke(this,Ee,ir).call(this),this.width){const[be,ge]=this.parentDimensions;this.setAt(De*be,pe*ge,this.width*be,this.height*ge)}return this.div}static deserialize(De,pe,be){if(De instanceof oe.StampAnnotationElement)return null;const ge=super.deserialize(De,pe,be),{rect:Ce,bitmapUrl:xe,bitmapId:Le,isSvg:Be,accessibilityData:He}=De;Le&&be.imageManager.isValidId(Le)?st(ge,de,Le):st(ge,le,xe),st(ge,Se,Be);const[it,et]=ge.pageDimensions;return ge.width=(Ce[2]-Ce[0])/it,ge.height=(Ce[3]-Ce[1])/et,He&&(ge.altTextData=He),ge}serialize(De=!1,pe=null){if(this.isEmpty())return null;const be={annotationType:re.AnnotationEditorType.STAMP,bitmapId:ce(this,de),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:ce(this,Se),structTreeParentId:this._structTreeParentId};if(De)return be.bitmapUrl=Ke(this,rt,sr).call(this,!0),be.accessibilityData=this.altTextData,be;const{decorative:ge,altText:Ce}=this.altTextData;if(!ge&&Ce&&(be.accessibilityData={type:"Figure",alt:Ce}),pe===null)return be;pe.stamps||(pe.stamps=new Map);const xe=ce(this,Se)?(be.rect[2]-be.rect[0])*(be.rect[3]-be.rect[1]):null;if(!pe.stamps.has(ce(this,de)))pe.stamps.set(ce(this,de),{area:xe,serialized:be}),be.bitmap=Ke(this,rt,sr).call(this,!1);else if(ce(this,Se)){const Le=pe.stamps.get(ce(this,de));xe>Le.area&&(Le.area=xe,Le.serialized.bitmap.close(),Le.serialized.bitmap=Ke(this,rt,sr).call(this,!1))}return be}};ue=new WeakMap,de=new WeakMap,ae=new WeakMap,le=new WeakMap,Ae=new WeakMap,_e=new WeakMap,me=new WeakMap,ve=new WeakMap,Se=new WeakMap,Te=new WeakMap,Pe=new WeakSet,Vn=function(De,pe=!1){if(!De){this.remove();return}st(this,ue,De.bitmap),pe||(st(this,de,De.id),st(this,Se,De.isSvg)),Ke(this,Me,Br).call(this)},$e=new WeakSet,Gn=function(){st(this,ae,null),this._uiManager.enableWaiting(!1),ce(this,_e)&&this.div.focus()},Ee=new WeakSet,ir=function(){if(ce(this,de)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(ce(this,de)).then(pe=>Ke(this,Pe,Vn).call(this,pe,!0)).finally(()=>Ke(this,$e,Gn).call(this));return}if(ce(this,le)){const pe=ce(this,le);st(this,le,null),this._uiManager.enableWaiting(!0),st(this,ae,this._uiManager.imageManager.getFromUrl(pe).then(be=>Ke(this,Pe,Vn).call(this,be)).finally(()=>Ke(this,$e,Gn).call(this)));return}if(ce(this,Ae)){const pe=ce(this,Ae);st(this,Ae,null),this._uiManager.enableWaiting(!0),st(this,ae,this._uiManager.imageManager.getFromFile(pe).then(be=>Ke(this,Pe,Vn).call(this,be)).finally(()=>Ke(this,$e,Gn).call(this)));return}const De=document.createElement("input");De.type="file",De.accept=mt.supportedTypesStr,st(this,ae,new Promise(pe=>{De.addEventListener("change",async()=>{if(!De.files||De.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const be=await this._uiManager.imageManager.getFromFile(De.files[0]);Ke(this,Pe,Vn).call(this,be)}pe()}),De.addEventListener("cancel",()=>{this.remove(),pe()})}).finally(()=>Ke(this,$e,Gn).call(this))),De.click()},Me=new WeakSet,Br=function(){const{div:De}=this;let{width:pe,height:be}=ce(this,ue);const[ge,Ce]=this.pageDimensions,xe=.75;if(this.width)pe=this.width*ge,be=this.height*Ce;else if(pe>xe*ge||be>xe*Ce){const it=Math.min(xe*ge/pe,xe*Ce/be);pe*=it,be*=it}const[Le,Be]=this.parentDimensions;this.setDims(pe*Le/ge,be*Be/Ce),this._uiManager.enableWaiting(!1);const He=st(this,_e,document.createElement("canvas"));De.append(He),De.hidden=!1,Ke(this,Ie,Ur).call(this,pe,be),Ke(this,Ge,vi).call(this),ce(this,Te)||(this.parent.addUndoableEditor(this),st(this,Te,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},Oe=new WeakSet,bi=function(De,pe){var xe;const[be,ge]=this.parentDimensions;this.width=De/be,this.height=pe/ge,this.setDims(De,pe),(xe=this._initialOptions)!=null&&xe.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,ce(this,ve)!==null&&clearTimeout(ce(this,ve)),st(this,ve,setTimeout(()=>{st(this,ve,null),Ke(this,Ie,Ur).call(this,De,pe)},200))},Ve=new WeakSet,Si=function(De,pe){const{width:be,height:ge}=ce(this,ue);let Ce=be,xe=ge,Le=ce(this,ue);for(;Ce>2*De||xe>2*pe;){const Be=Ce,He=xe;Ce>2*De&&(Ce=Ce>=16384?Math.floor(Ce/2)-1:Math.ceil(Ce/2)),xe>2*pe&&(xe=xe>=16384?Math.floor(xe/2)-1:Math.ceil(xe/2));const it=new OffscreenCanvas(Ce,xe);it.getContext("2d").drawImage(Le,0,0,Be,He,0,0,Ce,xe),Le=it.transferToImageBitmap()}return Le},Ie=new WeakSet,Ur=function(De,pe){De=Math.ceil(De),pe=Math.ceil(pe);const be=ce(this,_e);if(!be||be.width===De&&be.height===pe)return;be.width=De,be.height=pe;const ge=ce(this,Se)?ce(this,ue):Ke(this,Ve,Si).call(this,De,pe),Ce=be.getContext("2d");Ce.filter=this._uiManager.hcmFilter,Ce.drawImage(ge,0,0,ge.width,ge.height,0,0,De,pe)},rt=new WeakSet,sr=function(De){if(De){if(ce(this,Se)){const ge=this._uiManager.imageManager.getSvgUrl(ce(this,de));if(ge)return ge}const pe=document.createElement("canvas");return{width:pe.width,height:pe.height}=ce(this,ue),pe.getContext("2d").drawImage(ce(this,ue),0,0),pe.toDataURL()}if(ce(this,Se)){const[pe,be]=this.pageDimensions,ge=Math.round(this.width*pe*se.PixelsPerInch.PDF_TO_CSS_UNITS),Ce=Math.round(this.height*be*se.PixelsPerInch.PDF_TO_CSS_UNITS),xe=new OffscreenCanvas(ge,Ce);return xe.getContext("2d").drawImage(ce(this,ue),0,0,ce(this,ue).width,ce(this,ue).height,0,0,ge,Ce),xe.transferToImageBitmap()}return structuredClone(ce(this,ue))},Ge=new WeakSet,vi=function(){st(this,me,new ResizeObserver(De=>{const pe=De[0].contentRect;pe.width&&pe.height&&Ke(this,Oe,bi).call(this,pe.width,pe.height)})),ce(this,me).observe(this.div)},An(mt,"_type","stamp");let he=mt;te.StampEditor=he}],__webpack_module_cache__={};function __w_pdfjs_require__(ee){var te=__webpack_module_cache__[ee];if(te!==void 0)return te.exports;var ne=__webpack_module_cache__[ee]={exports:{}};return __webpack_modules__[ee](ne,ne.exports,__w_pdfjs_require__),ne.exports}var __webpack_exports__={};return(()=>{var ee=__webpack_exports__;Object.defineProperty(ee,"__esModule",{value:!0}),Object.defineProperty(ee,"AbortException",{enumerable:!0,get:function(){return te.AbortException}}),Object.defineProperty(ee,"AnnotationEditorLayer",{enumerable:!0,get:function(){return se.AnnotationEditorLayer}}),Object.defineProperty(ee,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return te.AnnotationEditorParamsType}}),Object.defineProperty(ee,"AnnotationEditorType",{enumerable:!0,get:function(){return te.AnnotationEditorType}}),Object.defineProperty(ee,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return oe.AnnotationEditorUIManager}}),Object.defineProperty(ee,"AnnotationLayer",{enumerable:!0,get:function(){return he.AnnotationLayer}}),Object.defineProperty(ee,"AnnotationMode",{enumerable:!0,get:function(){return te.AnnotationMode}}),Object.defineProperty(ee,"CMapCompressionType",{enumerable:!0,get:function(){return te.CMapCompressionType}}),Object.defineProperty(ee,"DOMSVGFactory",{enumerable:!0,get:function(){return re.DOMSVGFactory}}),Object.defineProperty(ee,"FeatureTest",{enumerable:!0,get:function(){return te.FeatureTest}}),Object.defineProperty(ee,"GlobalWorkerOptions",{enumerable:!0,get:function(){return ue.GlobalWorkerOptions}}),Object.defineProperty(ee,"ImageKind",{enumerable:!0,get:function(){return te.ImageKind}}),Object.defineProperty(ee,"InvalidPDFException",{enumerable:!0,get:function(){return te.InvalidPDFException}}),Object.defineProperty(ee,"MissingPDFException",{enumerable:!0,get:function(){return te.MissingPDFException}}),Object.defineProperty(ee,"OPS",{enumerable:!0,get:function(){return te.OPS}}),Object.defineProperty(ee,"PDFDataRangeTransport",{enumerable:!0,get:function(){return ne.PDFDataRangeTransport}}),Object.defineProperty(ee,"PDFDateString",{enumerable:!0,get:function(){return re.PDFDateString}}),Object.defineProperty(ee,"PDFWorker",{enumerable:!0,get:function(){return ne.PDFWorker}}),Object.defineProperty(ee,"PasswordResponses",{enumerable:!0,get:function(){return te.PasswordResponses}}),Object.defineProperty(ee,"PermissionFlag",{enumerable:!0,get:function(){return te.PermissionFlag}}),Object.defineProperty(ee,"PixelsPerInch",{enumerable:!0,get:function(){return re.PixelsPerInch}}),Object.defineProperty(ee,"PromiseCapability",{enumerable:!0,get:function(){return te.PromiseCapability}}),Object.defineProperty(ee,"RenderingCancelledException",{enumerable:!0,get:function(){return re.RenderingCancelledException}}),Object.defineProperty(ee,"SVGGraphics",{enumerable:!0,get:function(){return ne.SVGGraphics}}),Object.defineProperty(ee,"UnexpectedResponseException",{enumerable:!0,get:function(){return te.UnexpectedResponseException}}),Object.defineProperty(ee,"Util",{enumerable:!0,get:function(){return te.Util}}),Object.defineProperty(ee,"VerbosityLevel",{enumerable:!0,get:function(){return te.VerbosityLevel}}),Object.defineProperty(ee,"XfaLayer",{enumerable:!0,get:function(){return de.XfaLayer}}),Object.defineProperty(ee,"build",{enumerable:!0,get:function(){return ne.build}}),Object.defineProperty(ee,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return te.createValidAbsoluteUrl}}),Object.defineProperty(ee,"getDocument",{enumerable:!0,get:function(){return ne.getDocument}}),Object.defineProperty(ee,"getFilenameFromUrl",{enumerable:!0,get:function(){return re.getFilenameFromUrl}}),Object.defineProperty(ee,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return re.getPdfFilenameFromUrl}}),Object.defineProperty(ee,"getXfaPageViewport",{enumerable:!0,get:function(){return re.getXfaPageViewport}}),Object.defineProperty(ee,"isDataScheme",{enumerable:!0,get:function(){return re.isDataScheme}}),Object.defineProperty(ee,"isPdfFile",{enumerable:!0,get:function(){return re.isPdfFile}}),Object.defineProperty(ee,"loadScript",{enumerable:!0,get:function(){return re.loadScript}}),Object.defineProperty(ee,"noContextMenu",{enumerable:!0,get:function(){return re.noContextMenu}}),Object.defineProperty(ee,"normalizeUnicode",{enumerable:!0,get:function(){return te.normalizeUnicode}}),Object.defineProperty(ee,"renderTextLayer",{enumerable:!0,get:function(){return ie.renderTextLayer}}),Object.defineProperty(ee,"setLayerDimensions",{enumerable:!0,get:function(){return re.setLayerDimensions}}),Object.defineProperty(ee,"shadow",{enumerable:!0,get:function(){return te.shadow}}),Object.defineProperty(ee,"updateTextLayer",{enumerable:!0,get:function(){return ie.updateTextLayer}}),Object.defineProperty(ee,"version",{enumerable:!0,get:function(){return ne.version}});var te=__w_pdfjs_require__(1),ne=__w_pdfjs_require__(2),re=__w_pdfjs_require__(6),ie=__w_pdfjs_require__(26),se=__w_pdfjs_require__(27),oe=__w_pdfjs_require__(5),he=__w_pdfjs_require__(29),ue=__w_pdfjs_require__(14),de=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf$1);var pdfExports=pdf$1.exports;const pdf=getDefaultExportFromCjs(pdfExports),pdfjsModule=_mergeNamespaces({__proto__:null,default:pdf},[pdfExports]),pdfjs="default"in pdfjsModule?pdf:pdfjsModule,pdfjs$1=pdfjs;var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function ee(re,ie,se,oe,he,ue){if(ue!==ReactPropTypesSecret){var de=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw de.name="Invariant Violation",de}}ee.isRequired=ee;function te(){return ee}var ne={array:ee,bigint:ee,bool:ee,func:ee,number:ee,object:ee,string:ee,symbol:ee,any:ee,arrayOf:te,element:ee,elementType:ee,instanceOf:te,node:ee,objectOf:te,oneOf:te,oneOfType:te,shape:te,exact:te,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return ne.PropTypes=ne,ne};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);var __spreadArray=globalThis&&globalThis.__spreadArray||function(ee,te,ne){if(ne||arguments.length===2)for(var re=0,ie=te.length,se;re<ie;re++)(se||!(re in te))&&(se||(se=Array.prototype.slice.call(te,0,re)),se[re]=te[re]);return ee.concat(se||Array.prototype.slice.call(te))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mouseEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(ee,te){var ne={};return allEvents.forEach(function(re){var ie=ee[re];ie&&(te?ne[re]=function(se){return ie(se,te(re))}:ne[re]=ie)}),ne}function makeCancellablePromise(ee){var te=!1,ne=new Promise(function(re,ie){ee.then(function(se){return!te&&re(se)}).catch(function(se){return!te&&ie(se)})});return{promise:ne,cancel:function(){te=!0}}}function r(ee){var te,ne,re="";if(typeof ee=="string"||typeof ee=="number")re+=ee;else if(typeof ee=="object")if(Array.isArray(ee))for(te=0;te<ee.length;te++)ee[te]&&(ne=r(ee[te]))&&(re&&(re+=" "),re+=ne);else for(te in ee)ee[te]&&(re&&(re+=" "),re+=te);return re}function clsx(){for(var ee,te,ne=0,re="";ne<arguments.length;)(ee=arguments[ne++])&&(te=r(ee))&&(re&&(re+=" "),re+=te);return re}var isProduction=!0,prefix="Invariant failed";function invariant(ee,te){if(!ee){if(isProduction)throw new Error(prefix);var ne=typeof te=="function"?te():te,re=ne?"".concat(prefix,": ").concat(ne):prefix;throw new Error(re)}}var warning=function(){},warning_1=warning;const warning$1=getDefaultExportFromCjs(warning_1);var has=Object.prototype.hasOwnProperty;function find(ee,te,ne){for(ne of ee.keys())if(dequal(ne,te))return ne}function dequal(ee,te){var ne,re,ie;if(ee===te)return!0;if(ee&&te&&(ne=ee.constructor)===te.constructor){if(ne===Date)return ee.getTime()===te.getTime();if(ne===RegExp)return ee.toString()===te.toString();if(ne===Array){if((re=ee.length)===te.length)for(;re--&&dequal(ee[re],te[re]););return re===-1}if(ne===Set){if(ee.size!==te.size)return!1;for(re of ee)if(ie=re,ie&&typeof ie=="object"&&(ie=find(te,ie),!ie)||!te.has(ie))return!1;return!0}if(ne===Map){if(ee.size!==te.size)return!1;for(re of ee)if(ie=re[0],ie&&typeof ie=="object"&&(ie=find(te,ie),!ie)||!dequal(re[1],te.get(ie)))return!1;return!0}if(ne===ArrayBuffer)ee=new Uint8Array(ee),te=new Uint8Array(te);else if(ne===DataView){if((re=ee.byteLength)===te.byteLength)for(;re--&&ee.getInt8(re)===te.getInt8(re););return re===-1}if(ArrayBuffer.isView(ee)){if((re=ee.byteLength)===te.byteLength)for(;re--&&ee[re]===te[re];);return re===-1}if(!ne||typeof ee=="object"){re=0;for(ne in ee)if(has.call(ee,ne)&&++re&&!has.call(te,ne)||!(ne in te)||!dequal(ee[ne],te[ne]))return!1;return Object.keys(te).length===re}}return ee!==ee&&te!==te}const DocumentContext=G$1(null);function Message({children:ee,type:te}){return Cn.createElement("div",{className:"react-pdf__message react-pdf__message--".concat(te)},ee)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(te){this.pdfDocument=te}setViewer(te){this.pdfViewer=te}setExternalLinkRel(te){this.externalLinkRel=te}setExternalLinkTarget(te){this.externalLinkTarget=te}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(te){invariant(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=te}get rotation(){return 0}set rotation(te){}goToDestination(te){return new Promise(ne=>{invariant(this.pdfDocument,"PDF document not loaded."),invariant(te,"Destination is not specified."),typeof te=="string"?this.pdfDocument.getDestination(te).then(ne):Array.isArray(te)?ne(te):te.then(ne)}).then(ne=>{invariant(Array.isArray(ne),'"'.concat(ne,'" is not a valid destination array.'));const re=ne[0];new Promise(ie=>{invariant(this.pdfDocument,"PDF document not loaded."),re instanceof Object?this.pdfDocument.getPageIndex(re).then(se=>{ie(se)}).catch(()=>{invariant(!1,'"'.concat(re,'" is not a valid page reference.'))}):typeof re=="number"?ie(re):invariant(!1,'"'.concat(re,'" is not a valid destination reference.'))}).then(ie=>{const se=ie+1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(se>=1&&se<=this.pagesCount,'"'.concat(se,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:ne,pageIndex:ie,pageNumber:se})})})}navigateTo(te){this.goToDestination(te)}goToPage(te){const ne=te-1;invariant(this.pdfViewer,"PDF viewer is not initialized."),invariant(te>=1&&te<=this.pagesCount,'"'.concat(te,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:ne,pageNumber:te})}addLinkAttributes(te,ne,re){te.href=ne,te.rel=this.externalLinkRel||DEFAULT_LINK_REL,te.target=re?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordResponses$1=PasswordResponses,isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(ee){return typeof ee<"u"}function isProvided(ee){return isDefined(ee)&&ee!==null}function isString(ee){return typeof ee=="string"}function isArrayBuffer(ee){return ee instanceof ArrayBuffer}function isBlob(ee){return invariant(isBrowser,"isBlob can only be used in a browser environment"),ee instanceof Blob}function isDataURI(ee){return isString(ee)&&/^data:/.test(ee)}function dataURItoByteString(ee){invariant(isDataURI(ee),"Invalid data URI.");const[te="",ne=""]=ee.split(",");return te.split(";").indexOf("base64")!==-1?atob(ne):unescape(ne)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}const allowFileAccessFromFilesTip="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function displayCORSWarning(){warning$1(!isLocalFileSystem,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(allowFileAccessFromFilesTip))}function displayWorkerWarning(){warning$1(!isLocalFileSystem,"Loading PDF.js worker may not work on protocols other than HTTP/HTTPS. ".concat(allowFileAccessFromFilesTip))}function cancelRunningTask(ee){ee&&ee.cancel&&ee.cancel()}function makePageCallback(ee,te){return Object.defineProperty(ee,"width",{get(){return this.view[2]*te},configurable:!0}),Object.defineProperty(ee,"height",{get(){return this.view[3]*te},configurable:!0}),Object.defineProperty(ee,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(ee,"originalHeight",{get(){return this.view[3]},configurable:!0}),ee}function isCancelException(ee){return ee.name==="RenderingCancelledException"}function loadFromFile(ee){return new Promise((te,ne)=>{const re=new FileReader;re.onload=()=>{if(!re.result)return ne(new Error("Error while reading a file."));te(re.result)},re.onerror=ie=>{if(!ie.target)return ne(new Error("Error while reading a file."));const{error:se}=ie.target;if(!se)return ne(new Error("Error while reading a file."));switch(se.code){case se.NOT_FOUND_ERR:return ne(new Error("Error while reading a file: File not found."));case se.SECURITY_ERR:return ne(new Error("Error while reading a file: Security error."));case se.ABORT_ERR:return ne(new Error("Error while reading a file: Aborted."));default:return ne(new Error("Error while reading a file."))}},re.readAsArrayBuffer(ee)})}function reducer(ee,te){switch(te.type){case"RESOLVE":return{value:te.value,error:void 0};case"REJECT":return{value:!1,error:te.error};case"RESET":return{value:void 0,error:void 0};default:return ee}}function useResolver(){return s$1(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs$1,eventProps=(()=>{const ee={};return allEvents.forEach(te=>{ee[te]=PropTypes.func}),ee})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService),PropTypes.oneOf(["_self","_blank","_parent","_top"]),PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function ee(te,ne,re){const{[ne]:ie,pageNumber:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<0)return new Error("Expected `".concat(ne,"` to be greater or equal to 0."));const{numPages:he}=oe;if(ie+1>he)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(he-1,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPageNumber=function ee(te,ne,re){const{[ne]:ie,pageIndex:se,pdf:oe}=te;if(!isDefined(oe))return null;if(isDefined(ie)){if(typeof ie!="number")return new Error("`".concat(ne,"` of type `").concat(typeof ie,"` supplied to `").concat(re,"`, expected `number`."));if(ie<1)return new Error("Expected `".concat(ne,"` to be greater or equal to 1."));const{numPages:he}=oe;if(ie>he)return new Error("Expected `".concat(ne,"` to be less or equal to ").concat(he,"."))}else if(!isDefined(se))return new Error("`".concat(ne,"` not supplied. Either pageIndex or pageNumber must be supplied to `").concat(re,"`."));return null},isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter$1=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function he(ae){try{de(re.next(ae))}catch(le){oe(le)}}function ue(ae){try{de(re.throw(ae))}catch(le){oe(le)}}function de(ae){ae.done?se(ae.value):ie(ae.value).then(he,ue)}de((re=re.apply(ee,te||[])).next())})},__rest$4=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const{PDFDataRangeTransport}=pdfjs$1,defaultOnPassword=(ee,te)=>{switch(te){case PasswordResponses$1.NEED_PASSWORD:{const ne=prompt("Enter the password to open this PDF file.");ee(ne);break}case PasswordResponses$1.INCORRECT_PASSWORD:{const ne=prompt("Invalid password. Please try again.");ee(ne);break}}};function isParameterObject(ee){return typeof ee=="object"&&ee!==null&&("data"in ee||"range"in ee||"url"in ee)}const Document=k$1(function ee(te,ne){var{children:re,className:ie,error:se="Failed to load PDF file.",externalLinkRel:oe,externalLinkTarget:he,file:ue,inputRef:de,imageResourcesPath:ae,loading:le="Loading PDF…",noData:Ae="No PDF file specified.",onItemClick:_e,onLoadError:me,onLoadProgress:ve,onLoadSuccess:Se,onPassword:Te=defaultOnPassword,onSourceError:Pe,onSourceSuccess:Re,options:$e,renderMode:ye,rotate:Ee}=te,Ne=__rest$4(te,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[Me,we]=useResolver(),{value:Oe,error:Fe}=Me,[Ve,qe]=useResolver(),{value:Ie,error:Xe}=Ve,rt=_(new LinkService),lt=_([]),Ge=_(),ut=_();p$1(()=>{ue&&ue!==Ge.current&&isParameterObject(ue)&&(warning$1(!dequal(ue,Ge.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),Ge.current=ue)},[ue]),p$1(()=>{$e&&$e!==ut.current&&(warning$1(!dequal($e,ut.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),ut.current=$e)},[$e]);const mt=_({scrollPageIntoView:pt=>{const{dest:ct,pageNumber:Pt,pageIndex:It=Pt-1}=pt;if(_e){_e({dest:ct,pageIndex:It,pageNumber:Pt});return}const vt=lt.current[It];if(vt){vt.scrollIntoView();return}warning$1(!1,"An internal link leading to page ".concat(Pt," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}});A$1(ne,()=>({linkService:rt,pages:lt,viewer:mt}),[]);function wt(){Re&&Re()}function Et(){Fe&&(warning$1(!1,Fe.toString()),Pe&&Pe(Fe))}function De(){we({type:"RESET"})}p$1(De,[ue,we]);const pe=T$1(()=>__awaiter$1(this,void 0,void 0,function*(){if(!ue)return null;if(typeof ue=="string")return isDataURI(ue)?{data:dataURItoByteString(ue)}:(displayCORSWarning(),{url:ue});if(ue instanceof PDFDataRangeTransport)return{range:ue};if(isArrayBuffer(ue))return{data:ue};if(isBrowser&&isBlob(ue))return{data:yield loadFromFile(ue)};if(invariant(typeof ue=="object","Invalid parameter in file, need either Uint8Array, string or a parameter object"),invariant(isParameterObject(ue),"Invalid parameter object: need either .data, .range or .url"),"url"in ue&&typeof ue.url=="string"){if(isDataURI(ue.url)){const{url:pt}=ue,ct=__rest$4(ue,["url"]),Pt=dataURItoByteString(pt);return Object.assign({data:Pt},ct)}displayCORSWarning()}return ue}),[ue]);p$1(()=>{const pt=makeCancellablePromise(pe());return pt.promise.then(ct=>{we({type:"RESOLVE",value:ct})}).catch(ct=>{we({type:"REJECT",error:ct})}),()=>{cancelRunningTask(pt)}},[pe,we]),p$1(()=>{if(!(typeof Oe>"u")){if(Oe===!1){Et();return}wt()}},[Oe]);function be(){Ie&&(Se&&Se(Ie),lt.current=new Array(Ie.numPages),rt.current.setDocument(Ie))}function ge(){Xe&&(warning$1(!1,Xe.toString()),me&&me(Xe))}function Ce(){qe({type:"RESET"})}p$1(Ce,[qe,Oe]);function xe(){if(!Oe)return;const pt=Object.assign(Object.assign({},$e),{isEvalSupported:!1}),ct=Object.assign(Object.assign({},Oe),pt),Pt=pdfjs$1.getDocument(ct);ve&&(Pt.onProgress=ve),Te&&(Pt.onPassword=Te);const It=Pt;return It.promise.then(vt=>{qe({type:"RESOLVE",value:vt})}).catch(vt=>{It.destroyed||qe({type:"REJECT",error:vt})}),()=>{It.destroy()}}p$1(xe,[$e,qe,Oe]),p$1(()=>{if(!(typeof Ie>"u")){if(Ie===!1){ge();return}be()}},[Ie]);function Le(){rt.current.setViewer(mt.current),rt.current.setExternalLinkRel(oe),rt.current.setExternalLinkTarget(he)}p$1(Le,[oe,he]);function Be(pt,ct){lt.current[pt]=ct}function He(pt){delete lt.current[pt]}const it=F$1(()=>({imageResourcesPath:ae,linkService:rt.current,onItemClick:_e,pdf:Ie,registerPage:Be,renderMode:ye,rotate:Ee,unregisterPage:He}),[ae,_e,Ie,ye,Ee]),et=F$1(()=>makeEventProps(Ne,()=>Ie),[Ne,Ie]);function ot(){return Cn.createElement(DocumentContext.Provider,{value:it},re)}function ht(){return ue?Ie==null?Cn.createElement(Message,{type:"loading"},typeof le=="function"?le():le):Ie===!1?Cn.createElement(Message,{type:"error"},typeof se=="function"?se():se):ot():Cn.createElement(Message,{type:"no-data"},typeof Ae=="function"?Ae():Ae)}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Document",ie),ref:de,style:{"--scale-factor":"1"}},et),ht())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});const Document$1=Document,OutlineContext=G$1(null);class Ref{constructor({num:te,gen:ne}){this.num=te,this.gen=ne}toString(){let te="".concat(this.num,"R");return this.gen!==0&&(te+=this.gen),te}}function useCachedValue(ee){const te=_(),ne=te.current;return isDefined(ne)?()=>ne:()=>{const re=ee();return te.current=re,re}}function useDocumentContext(){return q$2(DocumentContext)}function useOutlineContext(){return q$2(OutlineContext)}var __awaiter=globalThis&&globalThis.__awaiter||function(ee,te,ne,re){function ie(se){return se instanceof ne?se:new ne(function(oe){oe(se)})}return new(ne||(ne=Promise))(function(se,oe){function he(ae){try{de(re.next(ae))}catch(le){oe(le)}}function ue(ae){try{de(re.throw(ae))}catch(le){oe(le)}}function de(ae){ae.done?se(ae.value):ie(ae.value).then(he,ue)}de((re=re.apply(ee,te||[])).next())})},__rest$3=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};function OutlineItem(ee){const te=useDocumentContext(),ne=useOutlineContext();invariant(ne,"Unable to find Outline context.");const re=Object.assign(Object.assign(Object.assign({},te),ne),ee),{item:ie,linkService:se,onItemClick:oe,pdf:he}=re,ue=__rest$3(re,["item","linkService","onItemClick","pdf"]);invariant(he,"Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.");const de=useCachedValue(()=>typeof ie.dest=="string"?he.getDestination(ie.dest):ie.dest),ae=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){const me=yield de();if(!me)throw new Error("Destination not found.");const[ve]=me;return he.getPageIndex(new Ref(ve))})),le=useCachedValue(()=>__awaiter(this,void 0,void 0,function*(){return(yield ae())+1}));function Ae(me){me.preventDefault(),invariant(oe||se,"Either onItemClick callback or linkService must be defined in order to navigate to an outline item."),oe?Promise.all([de(),ae(),le()]).then(([ve,Se,Te])=>{oe({dest:ve,pageIndex:Se,pageNumber:Te})}):se&&se.goToDestination(ie.dest)}function _e(){if(!ie.items||!ie.items.length)return null;const{items:me}=ie;return Cn.createElement("ul",null,me.map((ve,Se)=>Cn.createElement(OutlineItem,Object.assign({key:typeof ve.dest=="string"?ve.dest:Se,item:ve,pdf:he},ue))))}return Cn.createElement("li",null,Cn.createElement("a",{href:"#",onClick:Ae},ie.title),_e())}var __rest$2=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Outline=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{className:ie,inputRef:se,onItemClick:oe,onLoadError:he,onLoadSuccess:ue,pdf:de}=re,ae=__rest$2(re,["className","inputRef","onItemClick","onLoadError","onLoadSuccess","pdf"]);invariant(de,"Attempted to load an outline, but no document was specified. Wrap <Outline /> in a <Document /> or pass explicit `pdf` prop.");const[le,Ae]=useResolver(),{value:_e,error:me}=le;function ve(){typeof _e>"u"||_e===!1||ue&&ue(_e)}function Se(){me&&(warning$1(!1,me.toString()),he&&he(me))}function Te(){Ae({type:"RESET"})}p$1(Te,[Ae,de]);function Pe(){if(!de)return;const Ee=makeCancellablePromise(de.getOutline()),Ne=Ee;return Ee.promise.then(Me=>{Ae({type:"RESOLVE",value:Me})}).catch(Me=>{Ae({type:"REJECT",error:Me})}),()=>cancelRunningTask(Ne)}p$1(Pe,[Ae,de]),p$1(()=>{if(_e!==void 0){if(_e===!1){Se();return}ve()}},[_e]);const Re=F$1(()=>({onItemClick:oe}),[oe]),$e=F$1(()=>makeEventProps(ae,()=>_e),[ae,_e]);if(!_e)return null;function ye(){return _e?Cn.createElement("ul",null,_e.map((Ee,Ne)=>Cn.createElement(OutlineItem,{key:typeof Ee.dest=="string"?Ee.dest:Ne,item:Ee,pdf:de}))):null}return Cn.createElement("div",Object.assign({className:clsx("react-pdf__Outline",ie),ref:se},$e),Cn.createElement(OutlineContext.Provider,{value:Re},ye()))};Outline.propTypes=Object.assign(Object.assign({},eventProps),{className:isClassName,inputRef:isRef,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,pdf:isPdf});const Outline$1=Outline;function mergeRefs(){for(var ee=[],te=0;te<arguments.length;te++)ee[te]=arguments[te];var ne=ee.filter(Boolean);if(ne.length<=1){var re=ne[0];return re||null}return function(se){ne.forEach(function(oe){typeof oe=="function"?oe(se):oe&&(oe.current=se)})}}const PageContext=G$1(null),PDF_ROLE_TO_HTML_ROLE={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(ee){return ee in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(ee){return"children"in ee}function isStructTreeNodeWithOnlyContentChild(ee){return isStructTreeNode(ee)?ee.children.length===1&&0 in ee.children&&"id"in ee.children[0]:!1}function getRoleAttributes(ee){const te={};if(isStructTreeNode(ee)){const{role:ne}=ee,re=ne.match(HEADING_PATTERN);if(re)te.role="heading",te["aria-level"]=Number(re[1]);else if(isPdfRole(ne)){const ie=PDF_ROLE_TO_HTML_ROLE[ne];ie&&(te.role=ie)}}return te}function getBaseAttributes(ee){const te={};if(isStructTreeNode(ee)){if(ee.alt!==void 0&&(te["aria-label"]=ee.alt),ee.lang!==void 0&&(te.lang=ee.lang),isStructTreeNodeWithOnlyContentChild(ee)){const[ne]=ee.children;if(ne){const re=getBaseAttributes(ne);return Object.assign(Object.assign({},te),re)}}}else"id"in ee&&(te["aria-owns"]=ee.id);return te}function getAttributes(ee){return ee?Object.assign(Object.assign({},getRoleAttributes(ee)),getBaseAttributes(ee)):null}function StructTreeItem({className:ee,node:te}){const ne=F$1(()=>getAttributes(te),[te]),re=F$1(()=>!isStructTreeNode(te)||isStructTreeNodeWithOnlyContentChild(te)?null:te.children.map((ie,se)=>Cn.createElement(StructTreeItem,{key:se,node:ie})),[te]);return Cn.createElement("span",Object.assign({className:ee},ne),re)}function usePageContext(){return q$2(PageContext)}function StructTree(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{onGetStructTreeError:te,onGetStructTreeSuccess:ne}=ee,[re,ie]=useResolver(),{value:se,error:oe}=re,{customTextRenderer:he,page:ue}=ee;function de(){se&&ne&&ne(se)}function ae(){oe&&(warning$1(!1,oe.toString()),te&&te(oe))}function le(){ie({type:"RESET"})}p$1(le,[ie,ue]);function Ae(){if(he||!ue)return;const _e=makeCancellablePromise(ue.getStructTree()),me=_e;return _e.promise.then(ve=>{ie({type:"RESOLVE",value:ve})}).catch(ve=>{ie({type:"REJECT",error:ve})}),()=>cancelRunningTask(me)}return p$1(Ae,[he,ue,ie]),p$1(()=>{if(se!==void 0){if(se===!1){ae();return}de()}},[se]),se?Cn.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:se}):null}const ANNOTATION_MODE=pdfjs$1.AnnotationMode;function PageCanvas(ee){const te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},te),ee),{_className:re,canvasBackground:ie,devicePixelRatio:se=getDevicePixelRatio(),onRenderError:oe,onRenderSuccess:he,page:ue,renderForms:de,renderTextLayer:ae,rotate:le,scale:Ae}=ne,{canvasRef:_e}=ee;invariant(ue,"Attempted to render page canvas, but no page was specified.");const me=_(null);function ve(){ue&&he&&he(makePageCallback(ue,Ae))}function Se(ye){isCancelException(ye)||(warning$1(!1,ye.toString()),oe&&oe(ye))}const Te=F$1(()=>ue.getViewport({scale:Ae*se,rotation:le}),[se,ue,le,Ae]),Pe=F$1(()=>ue.getViewport({scale:Ae,rotation:le}),[ue,le,Ae]);function Re(){if(!ue)return;ue.cleanup();const{current:ye}=me;if(!ye)return;ye.width=Te.width,ye.height=Te.height,ye.style.width="".concat(Math.floor(Pe.width),"px"),ye.style.height="".concat(Math.floor(Pe.height),"px"),ye.style.visibility="hidden";const Ee={annotationMode:de?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:ye.getContext("2d",{alpha:!1}),viewport:Te};ie&&(Ee.background=ie);const Ne=ue.render(Ee),Me=Ne;return Ne.promise.then(()=>{ye.style.visibility="",ve()}).catch(Se),()=>cancelRunningTask(Me)}p$1(Re,[ie,me,se,ue,de,Te,Pe]);const $e=T$1(()=>{const{current:ye}=me;ye&&(ye.width=0,ye.height=0)},[me]);return p$1(()=>$e,[$e]),Cn.createElement("canvas",{className:"".concat(re,"__canvas"),dir:"ltr",ref:mergeRefs(_e,me),style:{display:"block",userSelect:"none"}},ae?Cn.createElement(StructTree,null):null)}function PageSVG(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{_className:te,onRenderSuccess:ne,onRenderError:re,page:ie,rotate:se,scale:oe}=ee;invariant(ie,"Attempted to render page SVG, but no page was specified.");const[he,ue]=useResolver(),{value:de,error:ae}=he;function le(){ie&&ne&&ne(makePageCallback(ie,oe))}function Ae(){ae&&(isCancelException(ae)||(warning$1(!1,ae.toString()),re&&re(ae)))}const _e=F$1(()=>ie.getViewport({scale:oe,rotation:se}),[ie,se,oe]);function me(){ue({type:"RESET"})}p$1(me,[ie,ue,_e]);function ve(){if(!ie)return;const Re=makeCancellablePromise(ie.getOperatorList());return Re.promise.then($e=>{new pdfjs$1.SVGGraphics(ie.commonObjs,ie.objs).getSVG($e,_e).then(Ee=>{if(!(Ee instanceof SVGElement))throw new Error("getSVG returned unexpected result.");ue({type:"RESOLVE",value:Ee})}).catch(Ee=>{ue({type:"REJECT",error:Ee})})}).catch($e=>{ue({type:"REJECT",error:$e})}),()=>cancelRunningTask(Re)}p$1(ve,[ie,ue,_e]),p$1(()=>{if(de!==void 0){if(de===!1){Ae();return}le()}},[de]);function Se(Re){if(!Re||!de)return;Re.firstElementChild||Re.appendChild(de);const{width:$e,height:ye}=_e;de.setAttribute("width","".concat($e)),de.setAttribute("height","".concat(ye))}const{width:Te,height:Pe}=_e;return Cn.createElement("div",{className:"".concat(te,"__svg"),ref:Re=>Se(Re),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:Te,height:Pe,userSelect:"none"}})}function isTextItem(ee){return"str"in ee}function TextLayer(){const ee=usePageContext();invariant(ee,"Unable to find Page context.");const{customTextRenderer:te,onGetTextError:ne,onGetTextSuccess:re,onRenderTextLayerError:ie,onRenderTextLayerSuccess:se,page:oe,pageIndex:he,pageNumber:ue,rotate:de,scale:ae}=ee;invariant(oe,"Attempted to load page text content, but no page was specified.");const[le,Ae]=useResolver(),{value:_e,error:me}=le,ve=_(null),Se=_();warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function Te(){_e&&re&&re(_e)}function Pe(){me&&(warning$1(!1,me.toString()),ne&&ne(me))}function Re(){Ae({type:"RESET"})}p$1(Re,[oe,Ae]);function $e(){if(!oe)return;const Fe=makeCancellablePromise(oe.getTextContent()),Ve=Fe;return Fe.promise.then(qe=>{Ae({type:"RESOLVE",value:qe})}).catch(qe=>{Ae({type:"REJECT",error:qe})}),()=>cancelRunningTask(Ve)}p$1($e,[oe,Ae]),p$1(()=>{if(_e!==void 0){if(_e===!1){Pe();return}Te()}},[_e]);const ye=T$1(()=>{se&&se()},[se]),Ee=T$1(Fe=>{warning$1(!1,Fe.toString()),ie&&ie(Fe)},[ie]);function Ne(){const Fe=Se.current;Fe&&Fe.classList.add("active")}function Me(){const Fe=Se.current;Fe&&Fe.classList.remove("active")}const we=F$1(()=>oe.getViewport({scale:ae,rotation:de}),[oe,de,ae]);function Oe(){if(!oe||!_e)return;const{current:Fe}=ve;if(!Fe)return;Fe.innerHTML="";const Ve=oe.streamTextContent({includeMarkedContent:!0}),qe={container:Fe,textContentSource:Ve,viewport:we},Ie=pdfjs$1.renderTextLayer(qe),Xe=Ie;return Ie.promise.then(()=>{const rt=document.createElement("div");rt.className="endOfContent",Fe.append(rt),Se.current=rt;const lt=Fe.querySelectorAll('[role="presentation"]');if(te){let Ge=0;_e.items.forEach((ut,mt)=>{if(!isTextItem(ut))return;const wt=lt[Ge];if(!wt)return;const Et=te(Object.assign({pageIndex:he,pageNumber:ue,itemIndex:mt},ut));wt.innerHTML=Et,Ge+=ut.str&&ut.hasEOL?2:1})}ye()}).catch(Ee),()=>cancelRunningTask(Xe)}return y(Oe,[te,Ee,ye,oe,he,ue,_e,we]),Cn.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:Me,onMouseDown:Ne,ref:ve})}function AnnotationLayer(){const ee=useDocumentContext(),te=usePageContext();invariant(te,"Unable to find Page context.");const ne=Object.assign(Object.assign({},ee),te),{imageResourcesPath:re,linkService:ie,onGetAnnotationsError:se,onGetAnnotationsSuccess:oe,onRenderAnnotationLayerError:he,onRenderAnnotationLayerSuccess:ue,page:de,pdf:ae,renderForms:le,rotate:Ae,scale:_e=1}=ne;invariant(ae,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),invariant(de,"Attempted to load page annotations, but no page was specified."),invariant(ie,"Attempted to load page annotations, but no linkService was specified.");const[me,ve]=useResolver(),{value:Se,error:Te}=me,Pe=_(null);warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function Re(){Se&&oe&&oe(Se)}function $e(){Te&&(warning$1(!1,Te.toString()),se&&se(Te))}function ye(){ve({type:"RESET"})}p$1(ye,[ve,de]);function Ee(){if(!de)return;const Fe=makeCancellablePromise(de.getAnnotations()),Ve=Fe;return Fe.promise.then(qe=>{ve({type:"RESOLVE",value:qe})}).catch(qe=>{ve({type:"REJECT",error:qe})}),()=>{cancelRunningTask(Ve)}}p$1(Ee,[ve,de,le]),p$1(()=>{if(Se!==void 0){if(Se===!1){$e();return}Re()}},[Se]);function Ne(){ue&&ue()}function Me(Fe){warning$1(!1,"".concat(Fe)),he&&he(Fe)}const we=F$1(()=>de.getViewport({scale:_e,rotation:Ae}),[de,Ae,_e]);function Oe(){if(!ae||!de||!ie||!Se)return;const{current:Fe}=Pe;if(!Fe)return;const Ve=we.clone({dontFlip:!0}),qe={accessibilityManager:null,annotationCanvasMap:null,div:Fe,l10n:null,page:de,viewport:Ve},Ie={annotations:Se,annotationStorage:ae.annotationStorage,div:Fe,downloadManager:null,imageResourcesPath:re,linkService:ie,page:de,renderForms:le,viewport:Ve};Fe.innerHTML="";try{new pdfjs$1.AnnotationLayer(qe).render(Ie),Ne()}catch(Xe){Me(Xe)}return()=>{}}return p$1(Oe,[Se,re,ie,de,le,we]),Cn.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:Pe})}var __rest$1=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const defaultScale=1,Page=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{_className:ie="react-pdf__Page",_enableRegisterUnregisterPage:se=!0,canvasBackground:oe,canvasRef:he,children:ue,className:de,customRenderer:ae,customTextRenderer:le,devicePixelRatio:Ae,error:_e="Failed to load the page.",height:me,inputRef:ve,loading:Se="Loading page…",noData:Te="No page specified.",onGetAnnotationsError:Pe,onGetAnnotationsSuccess:Re,onGetStructTreeError:$e,onGetStructTreeSuccess:ye,onGetTextError:Ee,onGetTextSuccess:Ne,onLoadError:Me,onLoadSuccess:we,onRenderAnnotationLayerError:Oe,onRenderAnnotationLayerSuccess:Fe,onRenderError:Ve,onRenderSuccess:qe,onRenderTextLayerError:Ie,onRenderTextLayerSuccess:Xe,pageIndex:rt,pageNumber:lt,pdf:Ge,registerPage:ut,renderAnnotationLayer:mt=!0,renderForms:wt=!1,renderMode:Et="canvas",renderTextLayer:De=!0,rotate:pe,scale:be=defaultScale,unregisterPage:ge,width:Ce}=re,xe=__rest$1(re,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[Le,Be]=useResolver(),{value:He,error:it}=Le,et=_(null);invariant(Ge,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const ot=isProvided(lt)?lt-1:rt!=null?rt:null,ht=lt!=null?lt:isProvided(rt)?rt+1:null,pt=pe!=null?pe:He?He.rotate:null,ct=F$1(()=>{if(!He)return null;let Vt=1;const jt=be!=null?be:defaultScale;if(Ce||me){const Gt=He.getViewport({scale:1,rotation:pt});Ce?Vt=Ce/Gt.width:me&&(Vt=me/Gt.height)}return jt*Vt},[me,He,pt,be,Ce]);function Pt(){return()=>{isProvided(ot)&&se&&ge&&ge(ot)}}p$1(Pt,[se,Ge,ot,ge]);function It(){if(we){if(!He||!ct)return;we(makePageCallback(He,ct))}if(se&&ut){if(!isProvided(ot)||!et.current)return;ut(ot,et.current)}}function vt(){it&&(warning$1(!1,it.toString()),Me&&Me(it))}function kt(){Be({type:"RESET"})}p$1(kt,[Be,Ge,ot]);function gt(){if(!Ge||!ht)return;const Vt=makeCancellablePromise(Ge.getPage(ht)),jt=Vt;return Vt.promise.then(Gt=>{Be({type:"RESOLVE",value:Gt})}).catch(Gt=>{Be({type:"REJECT",error:Gt})}),()=>cancelRunningTask(jt)}p$1(gt,[Be,Ge,ot,ht,ut]),p$1(()=>{if(He!==void 0){if(He===!1){vt();return}It()}},[He,ct]);const tt=F$1(()=>He&&isProvided(ot)&&ht&&isProvided(pt)&&isProvided(ct)?{_className:ie,canvasBackground:oe,customTextRenderer:le,devicePixelRatio:Ae,onGetAnnotationsError:Pe,onGetAnnotationsSuccess:Re,onGetStructTreeError:$e,onGetStructTreeSuccess:ye,onGetTextError:Ee,onGetTextSuccess:Ne,onRenderAnnotationLayerError:Oe,onRenderAnnotationLayerSuccess:Fe,onRenderError:Ve,onRenderSuccess:qe,onRenderTextLayerError:Ie,onRenderTextLayerSuccess:Xe,page:He,pageIndex:ot,pageNumber:ht,renderForms:wt,renderTextLayer:De,rotate:pt,scale:ct}:null,[ie,oe,le,Ae,Pe,Re,$e,ye,Ee,Ne,Oe,Fe,Ve,qe,Ie,Xe,He,ot,ht,wt,De,pt,ct]),nt=F$1(()=>makeEventProps(xe,()=>He&&(ct?makePageCallback(He,ct):void 0)),[xe,He,ct]),ft="".concat(ot,"@").concat(ct,"/").concat(pt),Tt="".concat(ot,"/").concat(pt);function Ct(){switch(Et){case"custom":return invariant(ae,'renderMode was set to "custom", but no customRenderer was passed.'),Cn.createElement(ae,{key:"".concat(ft,"_custom")});case"none":return null;case"svg":return Cn.createElement(PageSVG,{key:"".concat(Tt,"_svg")});case"canvas":default:return Cn.createElement(PageCanvas,{key:"".concat(ft,"_canvas"),canvasRef:he})}}function Ht(){return De?Cn.createElement(TextLayer,{key:"".concat(ft,"_text")}):null}function Wt(){return mt?Cn.createElement(AnnotationLayer,{key:"".concat(ft,"_annotations")}):null}function Ut(){return Cn.createElement(PageContext.Provider,{value:tt},Ct(),Ht(),Wt(),ue)}function zt(){return ht?Ge===null||He===void 0||He===null?Cn.createElement(Message,{type:"loading"},typeof Se=="function"?Se():Se):Ge===!1||He===!1?Cn.createElement(Message,{type:"error"},typeof _e=="function"?_e():_e):Ut():Cn.createElement(Message,{type:"no-data"},typeof Te=="function"?Te():Te)}return Cn.createElement("div",Object.assign({className:clsx(ie,de),"data-page-number":ht,ref:mergeRefs(ve,et),style:{"--scale-factor":"".concat(ct),backgroundColor:oe||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},nt),zt())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});const Page$1=Page;var __rest=globalThis&&globalThis.__rest||function(ee,te){var ne={};for(var re in ee)Object.prototype.hasOwnProperty.call(ee,re)&&te.indexOf(re)<0&&(ne[re]=ee[re]);if(ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ie=0,re=Object.getOwnPropertySymbols(ee);ie<re.length;ie++)te.indexOf(re[ie])<0&&Object.prototype.propertyIsEnumerable.call(ee,re[ie])&&(ne[re[ie]]=ee[re[ie]]);return ne};const Thumbnail=function ee(te){const ne=useDocumentContext(),re=Object.assign(Object.assign({},ne),te),{className:ie,linkService:se,onItemClick:oe,pageIndex:he,pageNumber:ue,pdf:de}=re;invariant(de,"Attempted to load a thumbnail, but no document was specified. Wrap <Thumbnail /> in a <Document /> or pass explicit `pdf` prop.");const ae=isProvided(ue)?ue-1:he!=null?he:null,le=ue!=null?ue:isProvided(he)?he+1:null;function Ae(me){me.preventDefault(),!(!isProvided(ae)||!le)&&(invariant(oe||se,"Either onItemClick callback or linkService must be defined in order to navigate to an outline item."),oe?oe({pageIndex:ae,pageNumber:le}):se&&se.goToPage(le))}const _e=__rest(te,["className","onItemClick"]);return Cn.createElement("a",{className:clsx("react-pdf__Thumbnail",ie),href:le?"#":void 0,onClick:Ae},Cn.createElement(Page$1,Object.assign({},_e,{_className:"react-pdf__Thumbnail__page",_enableRegisterUnregisterPage:!1,renderAnnotationLayer:!1,renderTextLayer:!1})))},Thumbnail$1=Thumbnail;displayWorkerWarning(),pdfjs$1.GlobalWorkerOptions.workerSrc="pdf.worker.js";const index=Object.freeze(Object.defineProperty({__proto__:null,Document:Document$1,Outline:Outline$1,Page:Page$1,PasswordResponses:PasswordResponses$1,Thumbnail:Thumbnail$1,pdfjs:pdfjs$1,useDocumentContext,useOutlineContext,usePageContext},Symbol.toStringTag,{value:"Module"}))})();
|