(()=>{vart={104:function(t){(function(e){"use strict";constr="(0?\\d+|0x[a-f0-9]+)";constn={fourOctet:newRegExp(`^${r}\\.${r}\\.${r}\\.${r}$`,"i"),threeOctet:newRegExp(`^${r}\\.${r}\\.${r}$`,"i"),twoOctet:newRegExp(`^${r}\\.${r}$`,"i"),longValue:newRegExp(`^${r}$`,"i")};consti=newRegExp(`^0[0-7]+$`,"i");consts=newRegExp(`^0x[a-f0-9]+$`,"i");consto="%[0-9a-z]{1,}";consta="(?:[0-9a-f]+::?)+";constp={zoneIndex:newRegExp(o,"i"),native:newRegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${o})?$`,"i"),deprecatedTransitional:newRegExp(`^(?:::)(${r}\\.${r}\\.${r}\\.${r}(${o})?)$`,"i"),transitional:newRegExp(`^((?:${a})|(?:::)(?:${a})?)${r}\\.${r}\\.${r}\\.${r}(${o})?$`,"i")};functionexpandIPv6(t,e){if(t.indexOf("::")!==t.lastIndexOf("::")){returnnull}letr=0;letn=-1;leti=(t.match(p.zoneIndex)||[])[0];lets,o;if(i){i=i.substring(1);t=t.replace(/%.+$/,"")}while((n=t.indexOf(":",n+1))>=0){r++}if(t.substr(0,2)==="::"){r--}if(t.substr(-2,2)==="::"){r--}if(r>e){returnnull}o=e-r;s=":";while(o--){s+="0:"}t=t.replace("::",s);if(t[0]===":"){t=t.slice(1)}if(t[t.length-1]===":"){t=t.slice(0,-1)}e=function(){conste=t.split(":");constr=[];for(lett=0;t<e.length;t++){r.push(parseInt(e[t],16))}returnr}();return{parts:e,zoneId:i}}functionmatchCIDR(t,e,r,n){if(t.length!==e.length){thrownewError("ipaddr: cannot match CIDR for objects with different lengths")}leti=0;lets;while(n>0){s=r-n;if(s<0){s=0}if(t[i]>>s!==e[i]>>s){returnfalse}n-=r;i+=1}returntrue}functionparseIntAuto(t){if(s.test(t)){returnparseInt(t,16)}if(t[0]==="0"&&!isNaN(parseInt(t[1],10))){if(i.test(t)){returnparseInt(t,8)}thrownewError(`ipaddr: cannot parse ${t} as octal`)}returnparseInt(t,10)}functionpadPart(t,e){while(t.length<e){t=`0${t}`}returnt}constu={};u.IPv4=function(){functionIPv4(t){if(t.length!==4){thrownewError("ipaddr: ipv4 octet count should be 4")}lete,r;for(e=0;e<t.length;e++){r=t[e];if(!(0<=r&&r<=255)){thrownewError("ipaddr: ipv4 octet should fit in 8 bits")}}this.octets=t}IPv4.prototype.SpecialRanges={unspecified:[[newIPv4([0,0,0,0]),8]],broadcast:[[newIPv4([255,255,255,255]),32]],multicast:[[newIPv4([224,0,0,0]),4]],linkLocal:[[newIPv4([169,254,0,0]),16]],loopback:[[newIPv4([127,0,0,0]),8]],carrierGradeNat:[[newIPv4([100,64,0,0]),10]],private:[[newIPv4([10,0,0,0]),8],[newIPv4([172,16,0,0]),12],[newIPv4([192,168,0,0]),16]],reserved:[[newIPv4([192,0,0,0]),24],[newIPv4([192,0,2,0]),24],[newIPv4([192,88,99,0]),24],[newIPv4([198,18,0,0]),15],[newIPv4([198,51,100,0]),24],[newIPv4([203,0,113,0]),24],[newIPv4([240,0,0,0]),4]],as112:[[newIPv4([192,175,48,0]),24],[newIPv4([192,31,196,0]),24]],amt:[[newIPv4([192,52,193,0]),24]]};IPv4.prototype.kind=function(){return"ipv4"};IPv4.prototype.match=function(t,e){letr;if(e===undefined){r=t;t=r[0];e=r[1]}if(t.kind()!=="ipv4"){thrownewError("ipaddr: cannot match ipv4 address with non-ipv4 one")}returnmatchCIDR(this.octets,t.octets,8,e)};IPv4.prototype.prefixLengthFromSubnetMask=function(){lett=0;lete=false;constr={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};letn,i,s;for(n=3;n>=0;n-=1){i=this.octets[n];if(iinr){s=r[i];if(e&&s!==0){returnnull}if(s!==8){e=true}t+=s}else{returnnull}}return32-t};IPv4.prototype.range=function(){returnu.subnetMatch(this,this.SpecialRanges)};IPv4.prototype.toByteArray=function(){returnthis.octets.slice(0)};IPv4.prototype.toIPv4MappedAddress=function(){returnu.IPv6.parse(`::ffff:${this.toString()}`)};IPv4.prototype.toNormalizedString=function(){returnthis.toString()};IPv4.prototype.toString=function(){returnthis.octets.join(".")};returnIPv4}();u.IPv4.broadcastAddressFromCIDR=function(t){try{conste=this.parseCIDR(t);constr=e[0].toByteArray();constn=this.subnetMaskFromPrefixLength(e[1]).toByteArray();consti=[];lets=0;while(s<4){i.push(parseInt(r[s],10)|parseInt(n[s],10)^255);s++}returnnewthis(i)}catch(t){thrownewError("ipaddr: the address does not have IPv4 CIDR format")}};u.IPv4.isIPv4=function(t){returnthis.parser(t)!==null};u.IPv4.isValid=function(t){try{newthis(this.parser(t));returntrue}catch(t){returnfalse}};u.IPv4.isValidCIDR=function(t){try{this.parseCIDR(t);returntrue}catch(t){returnfalse}};u.IPv4.isValidFourPartDecimal=function(t){if(u.IPv4.isValid(t)&&t.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)){returntrue}else{returnfalse}};u.IPv4.networkAddressFromCIDR=function(t){lete,r,n,i,s;try{e=this.parseCIDR(t);n=e[0].toByteArray();s=this.subnetMaskFromPrefixLength(e[1]).toByteArray();i=[];r=0;while(r<4){i.push(parseInt(n[r],10)&parseInt(s[r],10));r++}returnnewthis(i)}catch(t){thrownewError("ipaddr: the address does not have IPv4 CIDR format")}};u.IPv4.parse=function(t){conste=this.parser(t);if(e===null){thrownewError("ipaddr: string is not formatted like an IPv4 Address")}returnnewthis(e)};u.IPv4.parseCIDR=function(t){lete;if(e=t.match(/^(.+)\/(\d+)$/)){constt=parseInt(e[2]);if(t>=0&&t<=32){constr=[this.parse(e[1]),t];Object.defineProperty(r,"toString",{value:function(){returnthis.join("/")}});returnr}}thrownewError("ipaddr: string is not formatted like an IPv4 CIDR range")};u.IPv4.parser=function(t){lete,r,i;if(e=t.match(n.fourOctet)){returnfunction(){constt=e.slice(1,6);constn=[];for(lete=0;e<t.length;e++){r=t[e];n.push(parseIntAuto(r))}returnn}()}elseif(e=t.match(n.longValue)){i=parseIntAuto(e[1]);if(i>4294967295||i<0){thrownewError("ipaddr: address outside defined range")}returnfunction(){constt=[];lete;for(e=0;e<=24;e+=8){t.push(i>>e&255)}returnt}().reverse()}elseif(e=t.match(n.twoOctet)){returnfunction(){constt=e.slice(1,4);constr=[];i=parseIntAuto(t[1]);if(i>16777215||i<0){thrownewError("ipaddr: address outside defined range")}r.push(parseIntAuto(t[0]));r.push(i>>16&255);r.push(i>>8&255);r.push(i&255);returnr}()}elseif(e=t.match(n.threeOctet)){returnfunction(){constt=e.slice(1,5);constr=[];i=parseIntAuto(t[2]);if(i>65535||i<0){thrownewError("ipaddr: address outside defined range")}r.push(parseIntAuto(t[0]));r.push(parseIntAuto(t[1]));r.push(i>>8&255);r.push(i&255);returnr}()}else{returnnull}};u.IPv4.subnetMaskFromPrefixLength=function(t){t=parseInt(t);if(t<0||t>32){thrownewError("ipaddr: invalid IPv4 prefix length")}conste=[0,0,0,0];letr=0;constn=Math.floor(t/8);while(r<n){e[r]=255;r++}if(n<4){e[n]=Math.pow(2,t%8)-1<<8-t%8}returnnewthis(e)};u.IPv6=function(){functionIPv6(t,e){letr,n;if(t.length===16){this.parts=[];for(r=0;r<=14;r+=2){this.parts.push(t[r]<<8|t[r+1])}}elseif(t.length===8){this.parts=t}else{thrownewError("ipaddr: ipv6 part count should be 8 or 16")}for(r=0;r<this.parts.length;r++){n=this.parts[r];if(!(0<=n&&n<=65535)){thrownewError("ipaddr: ipv6 part should fit in 16 bits")}}if(e){this.zoneId=e}}IPv6.prototype.SpecialRanges={unspecified:[newIPv6([0,0,0,0,0,0,0,0]),128],linkLocal:[newIPv6([65152,0,0,0,0,0,0,0]),10],multicast:[newIPv6([65280,0,0,0,0,0,0,0]),8],loopback:[newIPv6([0,0,0,0,0,0,0,1]),128],uniqueLocal:[newIPv6([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[newIPv6([0,0,0,0,0,65535,0,0]),96],discard:[newIPv6([256,0,0,0,0,0,0,0]),64],rfc6145:[newIPv6([0,0,0,0,65535,0,0,0]),96],rfc6052:[newIPv6([100,65435,0,0,0,0,0,0]),96],"6to4":[newIPv6([8194,0,0,0,0,0,0,0]),16],teredo:[newIPv6([8193,0,0,0,0,0,0,0]),32],benchmarking:[newIPv6([8193,2,0,0,0,0,0,0]),48],amt:[newIPv6([8193,3,0,0,0,0,0,0]),32],as112v6:[[newIPv6([8193,4,274,0,0,0,0,0]),48],[newIPv6([9760,79,32768,0,0,0,0,0]),48]],deprecated:[newIPv6([8193,16,0,0,0,0,0,0]),28],orchid2:[newIPv6([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[newIPv6([8193,48,0,0,0,0,0,0]),28],reserved:[[newIPv6([8193,0,0,0,0,0,0,0]),23],[newIPv6([8193,3512,0,0,0,0,0,0]),32]]};IPv6.prototype.isIPv4MappedAddress=function(){returnthis.range()==="ipv4Mapped"};IPv6.prototype.kind=function(){return"ipv6"};IPv6.prototype.match=function(t,e){letr;if(e===undefined){r=t;t=r[0];e=r[1]}if(t.kind()!=="ipv6"){thrownewError("ipaddr: cannot match ipv6 address with non-ipv6 one")}returnmatchCIDR(this.parts,t.parts,16,e)};IPv6.prototype.prefixLengthFromSubnetMask=function(){lett=0;lete=false;constr={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};letn,i;for(lets=7;s>=0;s-=1){n=this.parts[s];if(ninr){i=r[n];if(e&&i!==0){returnnull}if(i!==16){e=true}t+=i}else{returnnull}}return128-t};IPv6.prototype.range=function(){returnu.subnetMatch(this,this.SpecialRanges)};IPv6.prototype.toByteArray=function(){lett;conste=[];constr=this.parts;for(letn=0;n<r.length;n++){t=r[n];e.push(t>>8);e.push(t&255)}returne};IPv6.prototype.toFixedLengthString=function(){constt=function(){constt=[];for(lete=0;e<this.parts.length;e++){t.push(padPart(this.parts[e].toString(16),4))}returnt}.call(this).join(":");lete="";if(this.zoneId){e=`%${this.zoneId}`}returnt+e};IPv6.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress()){thrownewError("ipaddr: trying to convert a generic ipv6 address to ipv4")}constt=this.parts.slice(-2);conste=t[0];constr=t[1];returnnewu.IPv4([e>>8,e&255,r>>8,r&255])};IPv6.prototype.toNormalizedString=function(){constt=function(){constt=[];for(lete=0;e<this.parts.length;e++){t.push(this.parts[e].toString(16))}returnt}.call(this).join(":");lete="";if(this.zoneId){e=`%${this.zoneId}`}returnt+e};IPv6.prototype.toRFC5952String=function(){constt=/((^|:)(0(:|$)){2,})/g;conste=this.toNormalizedString();letr=0;letn=-1;leti;while(i=t.exec(e)){if(i[0].length>n){r=i.index;n=i[0].length}}if(n<0){returne}return`${e.substring(0,r)}::${e.substring(r+n)}`};IPv6.prototype.toString=function(){returnthis.toRFC5952String()};returnIPv6}();u.IPv6.broadcastAddressFromCIDR=function(t){try{conste=this.parseCIDR(t);constr=e[0].toByteArray();constn=this.subnetMaskFromPrefixLength(e[1]).toByteArray();consti=[];lets=0;while(s<16){i.push(parseInt(r[s],10)|parseInt(n[s],10)^255);s++}returnnewthis(i)}catch(t){thrownewError(`ipaddr: the address does not have IPv6 CIDR format (${t})`)}};u.IPv6.isIPv6=function(t){returnthis.parser(t)!==null};u.IPv6.isValid=function(t){if(typeoft==="string"&&t.indexOf(":")===-1){returnfalse}try{conste=this.parser(t);newthis(e.parts,e.zoneId);returntrue}catch(t){returnfalse}};u.IPv6.isValidCIDR=function(t){if(typeoft==="string"&&t.indexOf(":")===-1){returnfalse}try{this.parseCIDR(t);returntrue}catch(t){returnfalse}};u.IPv6.networkAddressFromCIDR=function(t){lete,r,n,i,s;try{e=this.parseCIDR(t);n=e[0].toByteArray();s=this.subnetMaskFromPrefixLength(e[1]).toByteArray();i=[];r=0;while(r<16){i.push(parseInt(n[r],10)&parseInt(s[r],10));r++}returnnewthis(i)}catch(t){thrownewError(`ipaddr: the address does not have IPv6 CIDR format (${t})`)}};u.IPv6.parse=function(t){conste=this.parser(t);if(e.parts===null){thrownewError("ipaddr: string is not formatted like an IPv6 Address")}returnnewthis(e.parts,e.zoneId)};u.IPv6.parseCIDR=function(t){lete,r,n;if(r=t.match(/^(.+)\/(\d+)$/)){e=parseInt(r[2]);if(e>=0&&e<=128){n=[this.parse(r[1]),e];Object.defineProperty(n,"toString",{value:function(){returnthis.join("/")}});returnn}}thrownewError("ipaddr: string is not formatted like an IPv6 CIDR range")};u.IPv6.parser=function(t){lete,r,n,i,s,o;if(n=t.match(p.deprecatedTransitional)){returnthis.parser(`::ffff:${n[1]}`)}if(p.native.test(t)){returnexpandIPv6(t,8)}if(n=t.match(p.transitional)){o=n[6]||"";e=n[1];if(!n[1].endsWith("::")){e=e.slice(0,-1)}e=expandIPv6(e+o,6);if(e.parts){s=[parseInt(n[2]),parseInt(n[3]),parseInt(n[4]),parseInt(n[5])];for(r=0;r<s.length;r++){i=s[r];if(!(0<=i&&i<=255)){returnnull}}e.parts.push(s[0]<<8|s[1]);e.parts.push(s[2]<<8|s[3]);return{parts:e.parts,zoneId:e.zoneId}}}returnnull};u.IPv6.subnetMaskFromPrefixLength=function(t){t=parseInt(t);if(t<0||t>128){thrownewError("ipaddr: invalid IPv6 prefix length")}conste=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];letr=0;constn=Math.floor(t/8);while(r<n){e[r]=255;r++}if(n<16){e[n]=Math.pow(2,t%8)-1<<8-t%8}returnnewthis(e)};u.fromByteArray=function(t){conste=t.length;if(e===4){returnnewu.IPv4(t)}elseif(e===16){returnnewu.IPv6(t)}else{thrownewError("ipaddr: the binary input is neither an IPv6 nor IPv4 address")}};u.isValid=function(t){returnu.IPv6.isValid(t)||u.IPv4.isValid(t)};u.isValidCIDR=function(t){returnu.IPv6.isValidCIDR(t)||u.IPv4.isValidCIDR(t)};u.parse=function(t){if(u.IPv6.isValid(t)){returnu.IPv6.parse(t)}elseif(u.IPv4.isValid(t)){returnu.IPv4.parse(t)}else{thrownewError("ipaddr: the address has neither IPv6 nor IPv4 format")}};u.parseCIDR=function(t){try{returnu.IPv6.parseCIDR(t)}catch(e){try{returnu.IPv4.parseCIDR(t)}catch(t){thrownewError("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}};u.process=function(t){conste=this.parse(t);if(e.kind()==="ipv6"&&e.isIPv4MappedAddress()){returne.toIPv4Address()}else{returne}};u.subnetMatch=function(t,e,r){letn,i,s,o;if(r===undefined||r===null){r="unicast"}for(iine){if(Object.prototype.hasOwnProperty.call(e,i)){s=e[i];if(s[0]&&!(s[0]instanceofArray)){s=[s]}for(n=0;n<s.length;n++){o=s[n];if(t.kind()===o[0].kind()&&t.match.apply(t,o)){returni}}}}returnr};if(true&&t.exports){t.exports=u}else{e.ipaddr=u}})(this)}};vare={};function__nccwpck_require__(r){varn=e[r];if(n!==undefined){returnn.exports}vari=e[r]={exports:{}};vars=true;try{t[r].call(i.exports,i,i.exports,__nccwpck_require__);s=false}finally{if(s)deletee[r]}returni.exports}if(typeof__nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";varr=__nccwpck_require__(104);module.exports=r})();
You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)