index.js
169 KB
module.exports=(()=>{"use strict";var e={2542:e=>{e.exports=JSON.parse('{"name":"@hapi/joi","description":"Object schema validation","version":"16.1.8","repository":"git://github.com/hapijs/joi","main":"lib/index.js","browser":"dist/joi-browser.min.js","keywords":["schema","validation"],"dependencies":{"@hapi/address":"^2.1.2","@hapi/formula":"^1.2.0","@hapi/hoek":"^8.2.4","@hapi/pinpoint":"^1.0.2","@hapi/topo":"^3.1.3"},"devDependencies":{"@hapi/bourne":"1.x.x","@hapi/code":"6.x.x","@hapi/lab":"20.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"files":["lib/**/*","dist/*"],"license":"BSD-3-Clause"}')},5541:(e,t,n)=>{const r=n(8835);const s={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:r.URL||URL};t.analyze=function(e,t={}){if(typeof e!=="string"){throw new Error("Invalid input: domain must be a string")}if(!e){return{error:"Domain must be a non-empty string"}}if(e.length>256){return{error:"Domain too long"}}const n=!s.nonAsciiRx.test(e);if(!n){if(t.allowUnicode===false){return{error:"Domain contains forbidden Unicode characters"}}e=e.normalize("NFC")}if(s.domainControlRx.test(e)){return{error:"Domain contains invalid character"}}e=s.punycode(e);const r=t.minDomainSegments||s.minDomainSegments;const i=e.split(".");if(i.length<r){return{error:"Domain lacks the minimum required number of segments"}}const o=t.tlds;if(o){const e=i[i.length-1].toLowerCase();if(o.deny&&o.deny.has(e)||o.allow&&!o.allow.has(e)){return{error:"Domain uses forbidden TLD"}}}for(let e=0;e<i.length;++e){const t=i[e];if(!t.length){return{error:"Domain contains empty dot-separated segment"}}if(t.length>63){return{error:"Domain contains dot-separated segment that is too long"}}if(e<i.length-1){if(!s.domainSegmentRx.test(t)){return{error:"Domain contains invalid character"}}}else{if(!s.tldSegmentRx.test(t)){return{error:"Domain contains invalid tld character"}}}}};t.isValid=function(e,n){return!t.analyze(e,n)};s.punycode=function(e){try{return new s.URL(`http://${e}`).host}catch(t){return e}}},7318:(e,t,n)=>{const r=n(9357);const s=n(5541);const i={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(r.TextEncoder||TextEncoder)};t.analyze=function(e,t){return i.email(e,t)};t.isValid=function(e,t){return!i.email(e,t)};i.email=function(e,t={}){if(typeof e!=="string"){throw new Error("Invalid input: email must be a string")}if(!e){return{error:"Address must be a non-empty string"}}const n=!i.nonAsciiRx.test(e);if(!n){if(t.allowUnicode===false){return{error:"Address contains forbidden Unicode characters"}}e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2){return{error:r.length>2?"Address cannot contain more than one @ character":"Address must contain one @ character"}}const[o,a]=r;if(!o){return{error:"Address local part cannot be empty"}}if(!t.ignoreLength){if(e.length>254){return{error:"Address too long"}}if(i.encoder.encode(o).length>64){return{error:"Address local part too long"}}}return i.local(o,n)||s.analyze(a,t)};i.local=function(e,t){const n=e.split(".");for(const e of n){if(!e.length){return{error:"Address local part contains empty dot-separated segment"}}if(t){if(!i.atextRx.test(e)){return{error:"Address local part contains invalid character"}}continue}for(const t of e){if(i.atextRx.test(t)){continue}const e=i.binary(t);if(!i.atomRx.test(e)){return{error:"Address local part contains invalid character"}}}}};i.binary=function(e){return Array.from(i.encoder.encode(e)).map(e=>String.fromCharCode(e)).join("")};i.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/;i.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},5026:e=>{const t={};t.tlds=["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","AC","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACO","ACTOR","AD","ADAC","ADS","ADULT","AE","AEG","AERO","AETNA","AF","AFAMILYCOMPANY","AFL","AFRICA","AG","AGAKHAN","AGENCY","AI","AIG","AIGO","AIRBUS","AIRFORCE","AIRTEL","AKDN","AL","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLSTATE","ALLY","ALSACE","ALSTOM","AM","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMSTERDAM","ANALYTICS","ANDROID","ANQUAN","ANZ","AO","AOL","APARTMENTS","APP","APPLE","AQ","AQUARELLE","AR","ARAB","ARAMCO","ARCHI","ARMY","ARPA","ART","ARTE","AS","ASDA","ASIA","ASSOCIATES","AT","ATHLETA","ATTORNEY","AU","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOS","AVIANCA","AW","AWS","AX","AXA","AZ","AZURE","BA","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BASKETBALL","BAUHAUS","BAYERN","BB","BBC","BBT","BBVA","BCG","BCN","BD","BE","BEATS","BEAUTY","BEER","BENTLEY","BERLIN","BEST","BESTBUY","BET","BF","BG","BH","BHARTI","BI","BIBLE","BID","BIKE","BING","BINGO","BIO","BIZ","BJ","BLACK","BLACKFRIDAY","BLOCKBUSTER","BLOG","BLOOMBERG","BLUE","BM","BMS","BMW","BN","BNPPARIBAS","BO","BOATS","BOEHRINGER","BOFA","BOM","BOND","BOO","BOOK","BOOKING","BOSCH","BOSTIK","BOSTON","BOT","BOUTIQUE","BOX","BR","BRADESCO","BRIDGESTONE","BROADWAY","BROKER","BROTHER","BRUSSELS","BS","BT","BUDAPEST","BUGATTI","BUILD","BUILDERS","BUSINESS","BUY","BUZZ","BV","BW","BY","BZ","BZH","CA","CAB","CAFE","CAL","CALL","CALVINKLEIN","CAM","CAMERA","CAMP","CANCERRESEARCH","CANON","CAPETOWN","CAPITAL","CAPITALONE","CAR","CARAVAN","CARDS","CARE","CAREER","CAREERS","CARS","CARTIER","CASA","CASE","CASEIH","CASH","CASINO","CAT","CATERING","CATHOLIC","CBA","CBN","CBRE","CBS","CC","CD","CEB","CENTER","CEO","CERN","CF","CFA","CFD","CG","CH","CHANEL","CHANNEL","CHARITY","CHASE","CHAT","CHEAP","CHINTAI","CHRISTMAS","CHROME","CHRYSLER","CHURCH","CI","CIPRIANI","CIRCLE","CISCO","CITADEL","CITI","CITIC","CITY","CITYEATS","CK","CL","CLAIMS","CLEANING","CLICK","CLINIC","CLINIQUE","CLOTHING","CLOUD","CLUB","CLUBMED","CM","CN","CO","COACH","CODES","COFFEE","COLLEGE","COLOGNE","COM","COMCAST","COMMBANK","COMMUNITY","COMPANY","COMPARE","COMPUTER","COMSEC","CONDOS","CONSTRUCTION","CONSULTING","CONTACT","CONTRACTORS","COOKING","COOKINGCHANNEL","COOL","COOP","CORSICA","COUNTRY","COUPON","COUPONS","COURSES","CR","CREDIT","CREDITCARD","CREDITUNION","CRICKET","CROWN","CRS","CRUISE","CRUISES","CSC","CU","CUISINELLA","CV","CW","CX","CY","CYMRU","CYOU","CZ","DABUR","DAD","DANCE","DATA","DATE","DATING","DATSUN","DAY","DCLK","DDS","DE","DEAL","DEALER","DEALS","DEGREE","DELIVERY","DELL","DELOITTE","DELTA","DEMOCRAT","DENTAL","DENTIST","DESI","DESIGN","DEV","DHL","DIAMONDS","DIET","DIGITAL","DIRECT","DIRECTORY","DISCOUNT","DISCOVER","DISH","DIY","DJ","DK","DM","DNP","DO","DOCS","DOCTOR","DODGE","DOG","DOMAINS","DOT","DOWNLOAD","DRIVE","DTV","DUBAI","DUCK","DUNLOP","DUPONT","DURBAN","DVAG","DVR","DZ","EARTH","EAT","EC","ECO","EDEKA","EDU","EDUCATION","EE","EG","EMAIL","EMERCK","ENERGY","ENGINEER","ENGINEERING","ENTERPRISES","EPSON","EQUIPMENT","ER","ERICSSON","ERNI","ES","ESQ","ESTATE","ESURANCE","ET","ETISALAT","EU","EUROVISION","EUS","EVENTS","EVERBANK","EXCHANGE","EXPERT","EXPOSED","EXPRESS","EXTRASPACE","FAGE","FAIL","FAIRWINDS","FAITH","FAMILY","FAN","FANS","FARM","FARMERS","FASHION","FAST","FEDEX","FEEDBACK","FERRARI","FERRERO","FI","FIAT","FIDELITY","FIDO","FILM","FINAL","FINANCE","FINANCIAL","FIRE","FIRESTONE","FIRMDALE","FISH","FISHING","FIT","FITNESS","FJ","FK","FLICKR","FLIGHTS","FLIR","FLORIST","FLOWERS","FLY","FM","FO","FOO","FOOD","FOODNETWORK","FOOTBALL","FORD","FOREX","FORSALE","FORUM","FOUNDATION","FOX","FR","FREE","FRESENIUS","FRL","FROGANS","FRONTDOOR","FRONTIER","FTR","FUJITSU","FUJIXEROX","FUN","FUND","FURNITURE","FUTBOL","FYI","GA","GAL","GALLERY","GALLO","GALLUP","GAME","GAMES","GAP","GARDEN","GAY","GB","GBIZ","GD","GDN","GE","GEA","GENT","GENTING","GEORGE","GF","GG","GGEE","GH","GI","GIFT","GIFTS","GIVES","GIVING","GL","GLADE","GLASS","GLE","GLOBAL","GLOBO","GM","GMAIL","GMBH","GMO","GMX","GN","GODADDY","GOLD","GOLDPOINT","GOLF","GOO","GOODYEAR","GOOG","GOOGLE","GOP","GOT","GOV","GP","GQ","GR","GRAINGER","GRAPHICS","GRATIS","GREEN","GRIPE","GROCERY","GROUP","GS","GT","GU","GUARDIAN","GUCCI","GUGE","GUIDE","GUITARS","GURU","GW","GY","HAIR","HAMBURG","HANGOUT","HAUS","HBO","HDFC","HDFCBANK","HEALTH","HEALTHCARE","HELP","HELSINKI","HERE","HERMES","HGTV","HIPHOP","HISAMITSU","HITACHI","HIV","HK","HKT","HM","HN","HOCKEY","HOLDINGS","HOLIDAY","HOMEDEPOT","HOMEGOODS","HOMES","HOMESENSE","HONDA","HORSE","HOSPITAL","HOST","HOSTING","HOT","HOTELES","HOTELS","HOTMAIL","HOUSE","HOW","HR","HSBC","HT","HU","HUGHES","HYATT","HYUNDAI","IBM","ICBC","ICE","ICU","ID","IE","IEEE","IFM","IKANO","IL","IM","IMAMAT","IMDB","IMMO","IMMOBILIEN","IN","INC","INDUSTRIES","INFINITI","INFO","ING","INK","INSTITUTE","INSURANCE","INSURE","INT","INTEL","INTERNATIONAL","INTUIT","INVESTMENTS","IO","IPIRANGA","IQ","IR","IRISH","IS","ISMAILI","IST","ISTANBUL","IT","ITAU","ITV","IVECO","JAGUAR","JAVA","JCB","JCP","JE","JEEP","JETZT","JEWELRY","JIO","JLL","JM","JMP","JNJ","JO","JOBS","JOBURG","JOT","JOY","JP","JPMORGAN","JPRS","JUEGOS","JUNIPER","KAUFEN","KDDI","KE","KERRYHOTELS","KERRYLOGISTICS","KERRYPROPERTIES","KFH","KG","KH","KI","KIA","KIM","KINDER","KINDLE","KITCHEN","KIWI","KM","KN","KOELN","KOMATSU","KOSHER","KP","KPMG","KPN","KR","KRD","KRED","KUOKGROUP","KW","KY","KYOTO","KZ","LA","LACAIXA","LADBROKES","LAMBORGHINI","LAMER","LANCASTER","LANCIA","LANCOME","LAND","LANDROVER","LANXESS","LASALLE","LAT","LATINO","LATROBE","LAW","LAWYER","LB","LC","LDS","LEASE","LECLERC","LEFRAK","LEGAL","LEGO","LEXUS","LGBT","LI","LIAISON","LIDL","LIFE","LIFEINSURANCE","LIFESTYLE","LIGHTING","LIKE","LILLY","LIMITED","LIMO","LINCOLN","LINDE","LINK","LIPSY","LIVE","LIVING","LIXIL","LK","LLC","LOAN","LOANS","LOCKER","LOCUS","LOFT","LOL","LONDON","LOTTE","LOTTO","LOVE","LPL","LPLFINANCIAL","LR","LS","LT","LTD","LTDA","LU","LUNDBECK","LUPIN","LUXE","LUXURY","LV","LY","MA","MACYS","MADRID","MAIF","MAISON","MAKEUP","MAN","MANAGEMENT","MANGO","MAP","MARKET","MARKETING","MARKETS","MARRIOTT","MARSHALLS","MASERATI","MATTEL","MBA","MC","MCKINSEY","MD","ME","MED","MEDIA","MEET","MELBOURNE","MEME","MEMORIAL","MEN","MENU","MERCKMSD","METLIFE","MG","MH","MIAMI","MICROSOFT","MIL","MINI","MINT","MIT","MITSUBISHI","MK","ML","MLB","MLS","MM","MMA","MN","MO","MOBI","MOBILE","MODA","MOE","MOI","MOM","MONASH","MONEY","MONSTER","MOPAR","MORMON","MORTGAGE","MOSCOW","MOTO","MOTORCYCLES","MOV","MOVIE","MOVISTAR","MP","MQ","MR","MS","MSD","MT","MTN","MTR","MU","MUSEUM","MUTUAL","MV","MW","MX","MY","MZ","NA","NAB","NADEX","NAGOYA","NAME","NATIONWIDE","NATURA","NAVY","NBA","NC","NE","NEC","NET","NETBANK","NETFLIX","NETWORK","NEUSTAR","NEW","NEWHOLLAND","NEWS","NEXT","NEXTDIRECT","NEXUS","NF","NFL","NG","NGO","NHK","NI","NICO","NIKE","NIKON","NINJA","NISSAN","NISSAY","NL","NO","NOKIA","NORTHWESTERNMUTUAL","NORTON","NOW","NOWRUZ","NOWTV","NP","NR","NRA","NRW","NTT","NU","NYC","NZ","OBI","OBSERVER","OFF","OFFICE","OKINAWA","OLAYAN","OLAYANGROUP","OLDNAVY","OLLO","OM","OMEGA","ONE","ONG","ONL","ONLINE","ONYOURSIDE","OOO","OPEN","ORACLE","ORANGE","ORG","ORGANIC","ORIGINS","OSAKA","OTSUKA","OTT","OVH","PA","PAGE","PANASONIC","PARIS","PARS","PARTNERS","PARTS","PARTY","PASSAGENS","PAY","PCCW","PE","PET","PF","PFIZER","PG","PH","PHARMACY","PHD","PHILIPS","PHONE","PHOTO","PHOTOGRAPHY","PHOTOS","PHYSIO","PIAGET","PICS","PICTET","PICTURES","PID","PIN","PING","PINK","PIONEER","PIZZA","PK","PL","PLACE","PLAY","PLAYSTATION","PLUMBING","PLUS","PM","PN","PNC","POHL","POKER","POLITIE","PORN","POST","PR","PRAMERICA","PRAXI","PRESS","PRIME","PRO","PROD","PRODUCTIONS","PROF","PROGRESSIVE","PROMO","PROPERTIES","PROPERTY","PROTECTION","PRU","PRUDENTIAL","PS","PT","PUB","PW","PWC","PY","QA","QPON","QUEBEC","QUEST","QVC","RACING","RADIO","RAID","RE","READ","REALESTATE","REALTOR","REALTY","RECIPES","RED","REDSTONE","REDUMBRELLA","REHAB","REISE","REISEN","REIT","RELIANCE","REN","RENT","RENTALS","REPAIR","REPORT","REPUBLICAN","REST","RESTAURANT","REVIEW","REVIEWS","REXROTH","RICH","RICHARDLI","RICOH","RIGHTATHOME","RIL","RIO","RIP","RMIT","RO","ROCHER","ROCKS","RODEO","ROGERS","ROOM","RS","RSVP","RU","RUGBY","RUHR","RUN","RW","RWE","RYUKYU","SA","SAARLAND","SAFE","SAFETY","SAKURA","SALE","SALON","SAMSCLUB","SAMSUNG","SANDVIK","SANDVIKCOROMANT","SANOFI","SAP","SARL","SAS","SAVE","SAXO","SB","SBI","SBS","SC","SCA","SCB","SCHAEFFLER","SCHMIDT","SCHOLARSHIPS","SCHOOL","SCHULE","SCHWARZ","SCIENCE","SCJOHNSON","SCOR","SCOT","SD","SE","SEARCH","SEAT","SECURE","SECURITY","SEEK","SELECT","SENER","SERVICES","SES","SEVEN","SEW","SEX","SEXY","SFR","SG","SH","SHANGRILA","SHARP","SHAW","SHELL","SHIA","SHIKSHA","SHOES","SHOP","SHOPPING","SHOUJI","SHOW","SHOWTIME","SHRIRAM","SI","SILK","SINA","SINGLES","SITE","SJ","SK","SKI","SKIN","SKY","SKYPE","SL","SLING","SM","SMART","SMILE","SN","SNCF","SO","SOCCER","SOCIAL","SOFTBANK","SOFTWARE","SOHU","SOLAR","SOLUTIONS","SONG","SONY","SOY","SPACE","SPORT","SPOT","SPREADBETTING","SR","SRL","SRT","SS","ST","STADA","STAPLES","STAR","STATEBANK","STATEFARM","STC","STCGROUP","STOCKHOLM","STORAGE","STORE","STREAM","STUDIO","STUDY","STYLE","SU","SUCKS","SUPPLIES","SUPPLY","SUPPORT","SURF","SURGERY","SUZUKI","SV","SWATCH","SWIFTCOVER","SWISS","SX","SY","SYDNEY","SYMANTEC","SYSTEMS","SZ","TAB","TAIPEI","TALK","TAOBAO","TARGET","TATAMOTORS","TATAR","TATTOO","TAX","TAXI","TC","TCI","TD","TDK","TEAM","TECH","TECHNOLOGY","TEL","TELEFONICA","TEMASEK","TENNIS","TEVA","TF","TG","TH","THD","THEATER","THEATRE","TIAA","TICKETS","TIENDA","TIFFANY","TIPS","TIRES","TIROL","TJ","TJMAXX","TJX","TK","TKMAXX","TL","TM","TMALL","TN","TO","TODAY","TOKYO","TOOLS","TOP","TORAY","TOSHIBA","TOTAL","TOURS","TOWN","TOYOTA","TOYS","TR","TRADE","TRADING","TRAINING","TRAVEL","TRAVELCHANNEL","TRAVELERS","TRAVELERSINSURANCE","TRUST","TRV","TT","TUBE","TUI","TUNES","TUSHU","TV","TVS","TW","TZ","UA","UBANK","UBS","UCONNECT","UG","UK","UNICOM","UNIVERSITY","UNO","UOL","UPS","US","UY","UZ","VA","VACATIONS","VANA","VANGUARD","VC","VE","VEGAS","VENTURES","VERISIGN","VERSICHERUNG","VET","VG","VI","VIAJES","VIDEO","VIG","VIKING","VILLAS","VIN","VIP","VIRGIN","VISA","VISION","VISTAPRINT","VIVA","VIVO","VLAANDEREN","VN","VODKA","VOLKSWAGEN","VOLVO","VOTE","VOTING","VOTO","VOYAGE","VU","VUELOS","WALES","WALMART","WALTER","WANG","WANGGOU","WARMAN","WATCH","WATCHES","WEATHER","WEATHERCHANNEL","WEBCAM","WEBER","WEBSITE","WED","WEDDING","WEIBO","WEIR","WF","WHOSWHO","WIEN","WIKI","WILLIAMHILL","WIN","WINDOWS","WINE","WINNERS","WME","WOLTERSKLUWER","WOODSIDE","WORK","WORKS","WORLD","WOW","WS","WTC","WTF","XBOX","XEROX","XFINITY","XIHUAN","XIN","XN--11B4C3D","XN--1CK2E1B","XN--1QQW23A","XN--2SCRJ9C","XN--30RR7Y","XN--3BST00M","XN--3DS443G","XN--3E0B707E","XN--3HCRJ9C","XN--3OQ18VL8PN36A","XN--3PXU8K","XN--42C2D9A","XN--45BR5CYL","XN--45BRJ9C","XN--45Q11C","XN--4GBRIM","XN--54B7FTA0CC","XN--55QW42G","XN--55QX5D","XN--5SU34J936BGSG","XN--5TZM5G","XN--6FRZ82G","XN--6QQ986B3XL","XN--80ADXHKS","XN--80AO21A","XN--80AQECDR1A","XN--80ASEHDB","XN--80ASWG","XN--8Y0A063A","XN--90A3AC","XN--90AE","XN--90AIS","XN--9DBQ2A","XN--9ET52U","XN--9KRT00A","XN--B4W605FERD","XN--BCK1B9A5DRE4C","XN--C1AVG","XN--C2BR7G","XN--CCK2B3B","XN--CG4BKI","XN--CLCHC0EA0B2G2A9GCD","XN--CZR694B","XN--CZRS0T","XN--CZRU2D","XN--D1ACJ3B","XN--D1ALF","XN--E1A4C","XN--ECKVDTC9D","XN--EFVY88H","XN--ESTV75G","XN--FCT429K","XN--FHBEI","XN--FIQ228C5HS","XN--FIQ64B","XN--FIQS8S","XN--FIQZ9S","XN--FJQ720A","XN--FLW351E","XN--FPCRJ9C3D","XN--FZC2C9E2C","XN--FZYS8D69UVGM","XN--G2XX48C","XN--GCKR3F0F","XN--GECRJ9C","XN--GK3AT1E","XN--H2BREG3EVE","XN--H2BRJ9C","XN--H2BRJ9C8C","XN--HXT814E","XN--I1B6B1A6A2E","XN--IMR513N","XN--IO0A7I","XN--J1AEF","XN--J1AMH","XN--J6W193G","XN--JLQ61U9W7B","XN--JVR189M","XN--KCRX77D1X4A","XN--KPRW13D","XN--KPRY57D","XN--KPU716F","XN--KPUT3I","XN--L1ACC","XN--LGBBAT1AD8J","XN--MGB9AWBF","XN--MGBA3A3EJT","XN--MGBA3A4F16A","XN--MGBA7C0BBN0A","XN--MGBAAKC7DVF","XN--MGBAAM7A8H","XN--MGBAB2BD","XN--MGBAH1A3HJKRD","XN--MGBAI9AZGQP6J","XN--MGBAYH7GPA","XN--MGBBH1A","XN--MGBBH1A71E","XN--MGBC0A9AZCG","XN--MGBCA7DZDO","XN--MGBERP4A5D4AR","XN--MGBGU82A","XN--MGBI4ECEXP","XN--MGBPL2FH","XN--MGBT3DHD","XN--MGBTX2B","XN--MGBX4CD0AB","XN--MIX891F","XN--MK1BU44C","XN--MXTQ1M","XN--NGBC5AZD","XN--NGBE9E0A","XN--NGBRX","XN--NODE","XN--NQV7F","XN--NQV7FS00EMA","XN--NYQY26A","XN--O3CW4H","XN--OGBPF8FL","XN--OTU796D","XN--P1ACF","XN--P1AI","XN--PBT977C","XN--PGBS0DH","XN--PSSY2U","XN--Q9JYB4C","XN--QCKA1PMC","XN--QXA6A","XN--QXAM","XN--RHQV96G","XN--ROVU88B","XN--RVC1E0AM3E","XN--S9BRJ9C","XN--SES554G","XN--T60B56A","XN--TCKWE","XN--TIQ49XQYJ","XN--UNUP4Y","XN--VERMGENSBERATER-CTB","XN--VERMGENSBERATUNG-PWB","XN--VHQUV","XN--VUQ861B","XN--W4R85EL8FHU5DNRA","XN--W4RS40L","XN--WGBH1C","XN--WGBL6A","XN--XHQ521B","XN--XKC2AL3HYE2A","XN--XKC2DL3A5EE0H","XN--Y9A3AQ","XN--YFRO4I67O","XN--YGBI2AMMX","XN--ZFR164B","XXX","XYZ","YACHTS","YAHOO","YAMAXUN","YANDEX","YE","YODOBASHI","YOGA","YOKOHAMA","YOU","YOUTUBE","YT","YUN","ZA","ZAPPOS","ZARA","ZERO","ZIP","ZM","ZONE","ZUERICH","ZW"];e.exports=new Set(t.tlds.map(e=>e.toLowerCase()))},1991:(e,t)=>{const n={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*\.?[0-9]*){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t=e.exports=n.Formula=class{constructor(e,t={}){if(!t[n.settings]&&t.constants){for(const e in t.constants){const n=t.constants[e];if(n!==null&&!["boolean","number","string"].includes(typeof n)){throw new Error(`Formula constant ${e} contains invalid ${typeof n} value type`)}}}this.settings=t[n.settings]?t:Object.assign({[n.settings]:true,constants:{},functions:{}},t);this.single=null;this._parts=null;this._parse(e)}_parse(e){let t=[];let r="";let s=0;let i=false;const o=e=>{if(s){throw new Error("Formula missing closing parenthesis")}const o=t.length?t[t.length-1]:null;if(!i&&!r&&!e){return}if(o&&o.type==="reference"&&e===")"){o.type="function";o.value=this._subFormula(r,o.value);r="";return}if(e===")"){const e=new n.Formula(r,this.settings);t.push({type:"segment",value:e})}else if(i){if(i==="]"){t.push({type:"reference",value:r});r="";return}t.push({type:"literal",value:r})}else if(n.operatorCharacters.includes(r)){if(o&&o.type==="operator"&&n.operators.includes(o.value+r)){o.value+=r}else{t.push({type:"operator",value:r})}}else if(r.match(n.numberRx)){t.push({type:"constant",value:parseFloat(r)})}else if(this.settings.constants[r]!==undefined){t.push({type:"constant",value:this.settings.constants[r]})}else{if(!r.match(n.tokenRx)){throw new Error(`Formula contains invalid token: ${r}`)}t.push({type:"reference",value:r})}r=""};for(const t of e){if(i){if(t===i){o();i=false}else{r+=t}}else if(s){if(t==="("){r+=t;++s}else if(t===")"){--s;if(!s){o(t)}else{r+=t}}else{r+=t}}else if(t in n.literals){i=n.literals[t]}else if(t==="("){o();++s}else if(n.operatorCharacters.includes(t)){o();r=t;o()}else if(t!==" "){r+=t}else{o()}}o();t=t.map((e,n)=>{if(e.type!=="operator"||e.value!=="-"||n&&t[n-1].type!=="operator"){return e}return{type:"operator",value:"n"}});let a=false;for(const e of t){if(e.type==="operator"){if(n.operatorsPrefix.includes(e.value)){continue}if(!a){throw new Error("Formula contains an operator in invalid position")}if(!n.operators.includes(e.value)){throw new Error(`Formula contains an unknown operator ${e.value}`)}}else if(a){throw new Error("Formula missing expected operator")}a=!a}if(!a){throw new Error("Formula contains invalid trailing operator")}if(t.length===1&&["reference","literal","constant"].includes(t[0].type)){this.single={type:t[0].type==="reference"?"reference":"value",value:t[0].value}}this._parts=t.map(e=>{if(e.type==="operator"){return n.operatorsPrefix.includes(e.value)?e:e.value}if(e.type!=="reference"){return e.value}if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value)){throw new Error(`Formula contains invalid reference ${e.value}`)}if(this.settings.reference){return this.settings.reference(e.value)}return n.reference(e.value)})}_subFormula(e,t){const r=this.settings.functions[t];if(typeof r!=="function"){throw new Error(`Formula contains unknown function ${t}`)}let s=[];if(e){let r="";let i=0;let o=false;const a=()=>{if(!r){throw new Error(`Formula contains function ${t} with invalid arguments ${e}`)}s.push(r);r=""};for(let t=0;t<e.length;++t){const s=e[t];if(o){r+=s;if(s===o){o=false}}else if(s in n.literals&&!i){r+=s;o=n.literals[s]}else if(s===","&&!i){a()}else{r+=s;if(s==="("){++i}else if(s===")"){--i}}}a()}s=s.map(e=>new n.Formula(e,this.settings));return function(e){const t=[];for(const n of s){t.push(n.evaluate(e))}return r.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let r=t.length-2;r>=0;--r){const s=t[r];if(s&&s.type==="operator"){const i=t[r+1];t.splice(r+1,1);const o=n.evaluate(i,e);t[r]=n.single(s.value,o)}}n.operatorsOrder.forEach(r=>{for(let s=1;s<t.length-1;){if(r.includes(t[s])){const r=t[s];const i=n.evaluate(t[s-1],e);const o=n.evaluate(t[s+1],e);t.splice(s,2);const a=n.calculate(r,i,o);t[s-1]=a===0?0:a}else{s+=2}}});return n.evaluate(t[0],e)}};n.Formula.prototype[n.symbol]=true;n.reference=function(e){return function(t){return t&&t[e]!==undefined?t[e]:null}};n.evaluate=function(e,t){if(e===null){return null}if(typeof e==="function"){return e(t)}if(e[n.symbol]){return e.evaluate(t)}return e};n.single=function(e,t){if(e==="!"){return t?false:true}const n=-t;if(n===0){return 0}return n};n.calculate=function(e,t,r){if(e==="??"){return n.exists(t)?t:r}if(typeof t==="string"||typeof r==="string"){if(e==="+"){t=n.exists(t)?t:"";r=n.exists(r)?r:"";return t+r}}else{switch(e){case"^":return Math.pow(t,r);case"*":return t*r;case"/":return t/r;case"%":return t%r;case"+":return t+r;case"-":return t-r}}switch(e){case"<":return t<r;case"<=":return t<=r;case">":return t>r;case">=":return t>=r;case"==":return t===r;case"!=":return t!==r;case"&&":return t&&r;case"||":return t||r}return null};n.exists=function(e){return e!==null&&e!==undefined}},5545:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(445);const o=n(417);const a={};e.exports=function(e,t,n={}){r(e&&typeof e==="object","Invalid defaults value: must be an object");r(!t||t===true||typeof t==="object","Invalid source value: must be true, falsy or an object");r(typeof n==="object","Invalid options: must be an object");if(!t){return null}if(n.shallow){return a.applyToDefaultsWithShallow(e,t,n)}const o=s(e);if(t===true){return o}const l=n.nullOverride!==undefined?n.nullOverride:false;return i(o,t,{nullOverride:l,mergeArrays:false})};a.applyToDefaultsWithShallow=function(e,t,n){const a=n.shallow;r(Array.isArray(a),"Invalid keys");n=Object.assign({},n);n.shallow=false;const l=s(e,{shallow:a});if(t===true){return l}const c=o.store(t,a);i(l,t,{mergeArrays:false,nullOverride:false});o.restore(l,t,c);return l}},2718:(e,t,n)=>{const r=n(5563);const s={};e.exports=function(e,...t){if(e){return}if(t.length===1&&t[0]instanceof Error){throw t[0]}throw new r(t)}},5578:(e,t,n)=>{const r=n(6657);const s=n(417);const i={needsProtoHack:new Set([r.set,r.map,r.weakSet,r.weakMap])};e.exports=i.clone=function(e,t={},n=null){if(typeof e!=="object"||e===null){return e}let o=i.clone;let a=n;if(t.shallow){if(t.shallow!==true){return i.cloneWithShallow(e,t)}o=(e=>e)}else{a=a||new Map;const t=a.get(e);if(t){return t}}const l=r.getInternalProto(e);if(l===r.buffer){return Buffer&&Buffer.from(e)}if(l===r.date){return new Date(e.getTime())}if(l===r.regex){return new RegExp(e)}const c=i.base(e,l,t);if(c===e){return e}if(a){a.set(e,c)}if(l===r.set){for(const n of e){c.add(o(n,t,a))}}else if(l===r.map){for(const[n,r]of e){c.set(n,o(r,t,a))}}const u=s.keys(e,t);for(const n of u){if(n==="__proto__"){continue}if(l===r.array&&n==="length"){c.length=e.length;continue}const s=Object.getOwnPropertyDescriptor(e,n);if(s){if(s.get||s.set){Object.defineProperty(c,n,s)}else if(s.enumerable){c[n]=o(e[n],t,a)}else{Object.defineProperty(c,n,{enumerable:false,writable:true,configurable:true,value:o(e[n],t,a)})}}else{Object.defineProperty(c,n,{enumerable:true,writable:true,configurable:true,value:o(e[n],t,a)})}}return c};i.cloneWithShallow=function(e,t){const n=t.shallow;t=Object.assign({},t);t.shallow=false;const r=s.store(e,n);const o=i.clone(e,t);s.restore(o,e,r);return o};i.base=function(e,t,n){if(t===r.array){return[]}if(n.prototype===false){if(i.needsProtoHack.has(t)){return new t.constructor}return{}}const s=Object.getPrototypeOf(e);if(s&&s.isImmutable){return e}if(i.needsProtoHack.has(t)){const e=new s.constructor;if(s!==t){Object.setPrototypeOf(e,s)}return e}return Object.create(s)}},5801:(e,t,n)=>{const r=n(6657);const s={mismatched:null};e.exports=function(e,t,n){n=Object.assign({prototype:true},n);return!!s.isDeepEqual(e,t,n,[])};s.isDeepEqual=function(e,t,n,i){if(e===t){return e!==0||1/e===1/t}const o=typeof e;if(o!==typeof t){return false}if(e===null||t===null){return false}if(o==="function"){if(!n.deepFunction||e.toString()!==t.toString()){return false}}else if(o!=="object"){return e!==e&&t!==t}const a=s.getSharedType(e,t,!!n.prototype);switch(a){case r.buffer:return Buffer&&Buffer.prototype.equals.call(e,t);case r.promise:return e===t;case r.regex:return e.toString()===t.toString();case s.mismatched:return false}for(let n=i.length-1;n>=0;--n){if(i[n].isSame(e,t)){return true}}i.push(new s.SeenEntry(e,t));try{return!!s.isDeepEqualObj(a,e,t,n,i)}finally{i.pop()}};s.getSharedType=function(e,t,n){if(n){if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)){return s.mismatched}return r.getInternalProto(e)}const i=r.getInternalProto(e);if(i!==r.getInternalProto(t)){return s.mismatched}return i};s.valueOf=function(e){const t=e.valueOf;if(t===undefined){return e}try{return t.call(e)}catch(e){return e}};s.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)};s.isSetSimpleEqual=function(e,t){for(const n of e){if(!t.has(n)){return false}}return true};s.isDeepEqualObj=function(e,t,n,i,o){const{isDeepEqual:a,valueOf:l,hasOwnEnumerableProperty:c}=s;const{keys:u,getOwnPropertySymbols:f}=Object;if(e===r.array){if(i.part){for(const e of t){for(const t of n){if(a(e,t,i,o)){return true}}}}else{if(t.length!==n.length){return false}for(let e=0;e<t.length;++e){if(!a(t[e],n[e],i,o)){return false}}return true}}else if(e===r.set){if(t.size!==n.size){return false}if(!s.isSetSimpleEqual(t,n)){const e=new Set(n);for(const n of t){if(e.delete(n)){continue}let t=false;for(const r of e){if(a(n,r,i,o)){e.delete(r);t=true;break}}if(!t){return false}}}}else if(e===r.map){if(t.size!==n.size){return false}for(const[e,r]of t){if(r===undefined&&!n.has(e)){return false}if(!a(r,n.get(e),i,o)){return false}}}else if(e===r.error){if(t.name!==n.name||t.message!==n.message){return false}}const d=l(t);const m=l(n);if((t!==d||n!==m)&&!a(d,m,i,o)){return false}const h=u(t);if(!i.part&&h.length!==u(n).length&&!i.skip){return false}let p=0;for(const e of h){if(i.skip&&i.skip.includes(e)){if(n[e]===undefined){++p}continue}if(!c(n,e)){return false}if(!a(t[e],n[e],i,o)){return false}}if(!i.part&&h.length-p!==u(n).length){return false}if(i.symbols!==false){const e=f(t);const r=new Set(f(n));for(const s of e){if(!i.skip||!i.skip.includes(s)){if(c(t,s)){if(!c(n,s)){return false}if(!a(t[s],n[s],i,o)){return false}}else if(c(n,s)){return false}}r.delete(s)}for(const e of r){if(c(n,e)){return false}}}return true};s.SeenEntry=class{constructor(e,t){this.obj=e;this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},5563:(e,t,n)=>{const r=n(7577);const s={};e.exports=class extends Error{constructor(e){const n=e.filter(e=>e!=="").map(e=>{return typeof e==="string"?e:e instanceof Error?e.message:r(e)});super(n.join(" ")||"Unknown error");if(typeof Error.captureStackTrace==="function"){Error.captureStackTrace(this,t.assert)}}}},4752:e=>{const t={};e.exports=function(e){if(!e){return""}let n="";for(let r=0;r<e.length;++r){const s=e.charCodeAt(r);if(t.isSafe(s)){n+=e[r]}else{n+=t.escapeHtmlChar(s)}}return n};t.escapeHtmlChar=function(e){const n=t.namedHtml[e];if(typeof n!=="undefined"){return n}if(e>=256){return"&#"+e+";"}const r=e.toString(16).padStart(2,"0");return`&#x${r};`};t.isSafe=function(e){return typeof t.safeCharCodes[e]!=="undefined"};t.namedHtml={38:"&",60:"<",62:">",34:""",160:" ",162:"¢",163:"£",164:"¤",169:"©",174:"®"};t.safeCharCodes=function(){const e={};for(let t=32;t<123;++t){if(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95){e[t]=null}}return e}()},1965:e=>{const t={};e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},2887:e=>{const t={};e.exports=function(){}},445:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(417);const o={};e.exports=o.merge=function(e,t,n){r(e&&typeof e==="object","Invalid target value: must be an object");r(t===null||t===undefined||typeof t==="object","Invalid source value: must be null, undefined, or an object");if(!t){return e}n=Object.assign({nullOverride:true,mergeArrays:true},n);if(Array.isArray(t)){r(Array.isArray(e),"Cannot merge array onto an object");if(!n.mergeArrays){e.length=0}for(let r=0;r<t.length;++r){e.push(s(t[r],{symbols:n.symbols}))}return e}const a=i.keys(t,n);for(let r=0;r<a.length;++r){const i=a[r];if(i==="__proto__"||!Object.prototype.propertyIsEnumerable.call(t,i)){continue}const l=t[i];if(l&&typeof l==="object"){if(!e[i]||typeof e[i]!=="object"||Array.isArray(e[i])!==Array.isArray(l)||l instanceof Date||Buffer&&Buffer.isBuffer(l)||l instanceof RegExp){e[i]=s(l,{symbols:n.symbols})}else{o.merge(e[i],l,n)}}else{if(l!==null&&l!==undefined){e[i]=l}else if(n.nullOverride){e[i]=l}}}return e}},8891:(e,t,n)=>{const r=n(2718);const s={};e.exports=function(e,t,n){if(t===false||t===null||t===undefined){return e}n=n||{};if(typeof n==="string"){n={separator:n}}const i=Array.isArray(t);r(!i||!n.separator,"Separator option no valid for array-based chain");const o=i?t:t.split(n.separator||".");let a=e;for(let e=0;e<o.length;++e){let i=o[e];const l=n.iterables&&s.iterables(a);if(Array.isArray(a)||l==="set"){const e=Number(i);if(Number.isInteger(e)){i=e<0?a.length+e:e}}if(!a||typeof a==="function"&&n.functions===false||!l&&a[i]===undefined){r(!n.strict||e+1===o.length,"Missing segment",i,"in reach path ",t);r(typeof a==="object"||n.functions===true||typeof a!=="function","Invalid segment",i,"in reach path ",t);a=n.default;break}if(!l){a=a[i]}else if(l==="set"){a=[...a][i]}else{a=a.get(i)}}return a};s.iterables=function(e){if(e instanceof Set){return"set"}if(e instanceof Map){return"map"}}},7577:e=>{const t={};e.exports=function(...e){try{return JSON.stringify.apply(null,e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},6657:(e,t)=>{const n={};t=e.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};n.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]);t.getInternalProto=function(e){if(Array.isArray(e)){return t.array}if(Buffer&&e instanceof Buffer){return t.buffer}if(e instanceof Date){return t.date}if(e instanceof RegExp){return t.regex}if(e instanceof Error){return t.error}const r=Object.prototype.toString.call(e);return n.typeMap.get(r)||t.generic}},417:(e,t,n)=>{const r=n(8891);const s={};t.keys=function(e,t={}){return t.symbols!==false?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)};t.store=function(e,t){const n=new Map;for(let i=0;i<t.length;++i){const o=t[i];const a=r(e,o);if(typeof a==="object"||typeof a==="function"){n.set(o,a);s.reachSet(e,o,undefined)}}return n};t.restore=function(e,t,n){for(const[r,i]of n){s.reachSet(e,r,i);s.reachSet(t,r,i)}};s.reachSet=function(e,t,n){const r=Array.isArray(t)?t:t.split(".");let s=e;for(let e=0;e<r.length;++e){const t=r[e];if(e+1===r.length){s[t]=n}s=s[t]}}},5403:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(5801);const o=n(445);const a=n(6773);const l=n(3221);const c=n(3579);const u=n(2150);const f=n(1669);const d=n(8937);const m=n(676);const h=n(4462);const p=n(1802);const g=n(121);const y=n(9862);const b=n(566);const _={};_.Base=class{constructor(e){this.type=e;this.$_root=null;this._definition={};this._ids=new h.Ids;this._preferences=null;this._refs=new p.Manager;this._cache=null;this._valids=null;this._invalids=null;this._flags={};this._rules=[];this._singleRules=new Map;this.$_terms={};this.$_temp={ruleset:null,whens:{}}}describe(){r(typeof d.describe==="function","Manifest functionality disabled");return d.describe(this)}allow(...e){l.verifyFlat(e,"allow");return this._values(e,"_valids")}alter(e){r(e&&typeof e==="object"&&!Array.isArray(e),"Invalid targets argument");r(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const n in e){const s=e[n];r(typeof s==="function","Alteration adjuster for",n,"must be a function");t.$_terms.alterations.push({target:n,adjuster:s})}t.$_temp.ruleset=false;return t}cast(e){r(e===false||typeof e==="string","Invalid to value");r(e===false||this._definition.cast[e],"Type",this.type,"does not support casting to",e);return this.$_setFlag("cast",e===false?undefined:e)}default(e,t){return this._default("default",e,t)}description(e){r(e&&typeof e==="string","Description must be a non-empty string");return this.$_setFlag("description",e)}empty(e){const t=this.clone();if(e!==undefined){e=t.$_compile(e,{override:false})}return t.$_setFlag("empty",e,{clone:false})}error(e){r(e,"Missing error");r(e instanceof Error||typeof e==="function","Must provide a valid Error object or a function");return this.$_setFlag("error",e)}example(e,t={}){r(e!==undefined,"Missing example");l.assertOptions(t,["override"]);return this._inner("examples",e,{single:true,override:t.override})}external(e,t){if(typeof e==="object"){r(!t,"Cannot combine options with description");t=e.description;e=e.method}r(typeof e==="function","Method must be a function");r(t===undefined||t&&typeof t==="string","Description must be a non-empty string");return this._inner("externals",{method:e,description:t},{single:true})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){if(!e){return this.$_setFlag("id",undefined)}r(typeof e==="string","id must be a non-empty string");r(/^[^\.]+$/.test(e),"id cannot contain period character");return this.$_setFlag("id",e)}invalid(...e){return this._values(e,"_invalids")}label(e){r(e&&typeof e==="string","Label name must be a non-empty string");return this.$_setFlag("label",e)}meta(e){r(e!==undefined,"Meta cannot be undefined");return this._inner("metas",e,{single:true})}note(...e){r(e.length,"Missing notes");for(const t of e){r(t&&typeof t==="string","Notes must be non-empty strings")}return this._inner("notes",e)}only(e=true){r(typeof e==="boolean","Invalid mode:",e);return this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){r(e,"Missing preferences");r(e.context===undefined,"Cannot override context");r(e.externals===undefined,"Cannot override externals");r(e.warnings===undefined,"Cannot override warnings");r(e.debug===undefined,"Cannot override debug");l.checkPreferences(e);const t=this.clone();t._preferences=l.preferences(t._preferences,e);return t}presence(e){r(["optional","required","forbidden"].includes(e),"Unknown presence mode",e);return this.$_setFlag("presence",e)}raw(e=true){return this.$_setFlag("result",e?"raw":undefined)}result(e){r(["raw","strip"].includes(e),"Unknown result mode",e);return this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone();const n=e===undefined?false:!e;t._preferences=l.preferences(t._preferences,{convert:n});return t}strip(e=true){return this.$_setFlag("result",e?"strip":undefined)}tag(...e){r(e.length,"Missing tags");for(const t of e){r(t&&typeof t==="string","Tags must be non-empty strings")}return this._inner("tags",e)}unit(e){r(e&&typeof e==="string","Unit name must be a non-empty string");return this.$_setFlag("unit",e)}valid(...e){const t=this.allow(...e);t.$_setFlag("only",!!t._valids,{clone:false});return t}when(e,t){const n=this.clone();if(!n.$_terms.whens){n.$_terms.whens=[]}const s=c.when(n,e,t);if(!["any","link"].includes(n.type)){const e=s.is?[s]:s.switch;for(const t of e){r(!t.then||t.then.type==="any"||t.then.type===n.type,"Cannot combine",n.type,"with",t.then&&t.then.type);r(!t.otherwise||t.otherwise.type==="any"||t.otherwise.type===n.type,"Cannot combine",n.type,"with",t.otherwise&&t.otherwise.type)}}n.$_terms.whens.push(s);return n.$_mutateRebuild()}cache(e){r(!this._inRuleset(),"Cannot set caching inside a ruleset");r(!this._cache,"Cannot override schema cache");const t=this.clone();t._cache=e||a.provider.provision();t.$_temp.ruleset=false;return t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){r(l.isSchema(e),"Invalid schema object");r(this.type==="any"||e.type==="any"||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type);r(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset");r(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if(this.type==="any"&&e.type!=="any"){const n=e.clone();for(const e of Object.keys(t)){if(e!=="type"){n[e]=t[e]}}t=n}t._ids.concat(e._ids);t._refs.register(e,p.toSibling);t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences;t._valids=b.merge(t._valids,e._valids,e._invalids);t._invalids=b.merge(t._invalids,e._invalids,e._valids);for(const n of e._singleRules.keys()){if(t._singleRules.has(n)){t._rules=t._rules.filter(e=>e.keep||e.name!==n);t._singleRules.delete(n)}}for(const n of e._rules){if(!e._definition.rules[n.method].multi){t._singleRules.set(n.name,n)}t._rules.push(n)}if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const n=Object.assign({},e._flags);delete n.empty;o(t._flags,n)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const n=Object.assign({},e._flags);delete n.empty;o(t._flags,n)}else{o(t._flags,e._flags)}for(const n in e.$_terms){const r=e.$_terms[n];if(!r){if(!t.$_terms[n]){t.$_terms[n]=r}continue}if(!t.$_terms[n]){t.$_terms[n]=r.slice();continue}t.$_terms[n]=t.$_terms[n].concat(r)}if(this.$_root._tracer){this.$_root._tracer._combine(t,[this,e])}return t.$_mutateRebuild()}extend(e){r(!e.base,"Cannot extend type with another base");return f.type(this,e)}extract(e){e=Array.isArray(e)?e:e.split(".");return this._ids.reach(e)}fork(e,t){r(!this._inRuleset(),"Cannot fork inside a ruleset");let n=this;for(let r of[].concat(e)){r=Array.isArray(r)?r:r.split(".");n=n._ids.fork(r,t,n)}n.$_temp.ruleset=false;return n}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers));r(this.$_temp.ruleset!==false,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const n=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;r(n>=0&&n<this._rules.length,"Cannot apply rules to empty ruleset");const i=this.clone();for(let o=n;o<i._rules.length;++o){const n=i._rules[o];const a=s(n);for(const s in e){t.modifiers[s](a,e[s]);r(a.name===n.name,"Cannot change rule name")}i._rules[o]=a;if(i._singleRules.get(a.name)===n){i._singleRules.set(a.name,a)}}i.$_temp.ruleset=false;return i.$_mutateRebuild()}get ruleset(){r(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();e.$_temp.ruleset=e._rules.length;return e}get $(){return this.ruleset}tailor(e){e=[].concat(e);r(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations){for(const{target:n,adjuster:s}of this.$_terms.alterations){if(e.includes(n)){t=s(t);r(l.isSchema(t),"Alteration adjuster for",n,"failed to return a schema object")}}}t=t.$_modify({each:t=>t.tailor(e),ref:false});t.$_temp.ruleset=false;return t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){if(typeof e==="string"){e={name:e}}r(e&&typeof e==="object","Invalid options");r(e.name&&typeof e.name==="string","Invalid rule name");for(const t in e){r(t[0]!=="_","Cannot set private rule properties")}const t=Object.assign({},e);t._resolve=[];t.method=t.method||t.name;const n=this._definition.rules[t.method];const s=t.args;r(n,"Unknown rule",t.method);const i=this.clone();if(s){r(Object.keys(s).length===1||Object.keys(s).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in s){let o=s[e];if(o===undefined){delete s[e];continue}if(n.argsByName){const a=n.argsByName.get(e);if(a.ref&&l.isResolvable(o)){t._resolve.push(e);i.$_mutateRegister(o)}else{if(a.normalize){o=a.normalize(o);s[e]=o}if(a.assert){const t=l.validateArg(o,e,a);r(!t,t,"or reference")}}}s[e]=o}}if(!n.multi){i._ruleRemove(t.name,{clone:false});i._singleRules.set(t.name,t)}if(i.$_temp.ruleset===false){i.$_temp.ruleset=null}if(n.priority){i._rules.unshift(t)}else{i._rules.push(t)}return i}$_compile(e,t){return c.schema(this.$_root,e,t)}$_createError(e,t,n,r,s,i={}){const o=i.flags!==false?this._flags:{};const a=i.messages?m.merge(this._definition.messages,i.messages):this._definition.messages;return new u.Report(e,t,n,o,a,r,s)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){e=Array.isArray(e)?e:e.split(".");return this._ids.labels(e)}$_match(e,t,n,r){n=Object.assign({},n);n.abortEarly=true;n._externals=false;t.snapshot();const s=!y.validate(e,this,t,n,r).errors;t.restore();return s}$_modify(e){l.assertOptions(e,["each","once","ref","schema"]);return h.schema(this,e)||this}$_mutateRebuild(){r(!this._inRuleset(),"Cannot add this rule inside a ruleset");this._refs.reset();this._ids.reset();const e=(e,{source:t,name:n,path:r,key:s})=>{const i=this._definition[t][n]&&this._definition[t][n].register;if(i!==false){this.$_mutateRegister(e,{family:i,key:s})}};this.$_modify({each:e});if(this._definition.rebuild){this._definition.rebuild(this)}this.$_temp.ruleset=false;return this}$_mutateRegister(e,{family:t,key:n}={}){this._refs.register(e,t);this._ids.register(e,{key:n})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t,n={}){r(e[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const s=this._definition.flags[e]||{};if(i(t,s.default)){t=undefined}if(i(t,this._flags[e])){return this}const o=n.clone!==false?this.clone():this;if(t!==undefined){o._flags[e]=t;o.$_mutateRegister(t)}else{delete o._flags[e]}if(e[0]!=="_"){o.$_temp.ruleset=false}return o}$_validate(e,t,n){return y.validate(e,this,t,n)}_assign(e){e.type=this.type;e.$_root=this.$_root;e.$_temp=Object.assign({},this.$_temp);e.$_temp.whens={};e._ids=this._ids.clone();e._preferences=this._preferences;e._valids=this._valids&&this._valids.clone();e._invalids=this._invalids&&this._invalids.clone();e._rules=this._rules.slice();e._singleRules=s(this._singleRules,{shallow:true});e._refs=this._refs.clone();e._flags=Object.assign({},this._flags);e._cache=null;e.$_terms={};for(const t in this.$_terms){e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null}e.$_super={};for(const t in this.$_super){e.$_super[t]=this._super[t].bind(e)}return e}_default(e,t,n={}){l.assertOptions(n,"literal");r(t!==undefined,"Missing",e,"value");r(typeof t==="function"||!n.literal,"Only function value supports literal option");if(typeof t==="function"&&n.literal){t={[l.symbols.literal]:true,literal:t}}const s=this.$_setFlag(e,t);return s}_generate(e,t,n){if(!this.$_terms.whens){return{schema:this}}const r=[];const s=[];for(let i=0;i<this.$_terms.whens.length;++i){const o=this.$_terms.whens[i];if(o.concat){r.push(o.concat);s.push(`${i}.concat`);continue}const a=o.ref?o.ref.resolve(e,t,n):e;const l=o.is?[o]:o.switch;const c=s.length;for(let c=0;c<l.length;++c){const{is:u,then:f,otherwise:d}=l[c];const m=`${i}${o.switch?"."+c:""}`;if(u.$_match(a,t.nest(u,`${m}.is`),n)){if(f){const i=t.localize([...t.path,`${m}.then`],t.ancestors,t.schemas);const{schema:o,id:a}=f._generate(e,i,n);r.push(o);s.push(`${m}.then${a?`(${a})`:""}`);break}}else if(d){const i=t.localize([...t.path,`${m}.otherwise`],t.ancestors,t.schemas);const{schema:o,id:a}=d._generate(e,i,n);r.push(o);s.push(`${m}.otherwise${a?`(${a})`:""}`);break}}if(o.break&&s.length>c){break}}const i=s.join(", ");t.mainstay.tracer.debug(t,"rule","when",i);if(!i){return{schema:this}}if(!t.mainstay.tracer.active&&this.$_temp.whens[i]){return{schema:this.$_temp.whens[i],id:i}}let o=this;if(this._definition.generate){o=this._definition.generate(this,e,t,n)}for(const e of r){o=o.concat(e)}if(this.$_root._tracer){this.$_root._tracer._combine(o,[this,...r])}this.$_temp.whens[i]=o;return{schema:o,id:i}}_inner(e,t,n={}){r(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const s=this.clone();if(!s.$_terms[e]||n.override){s.$_terms[e]=[]}if(n.single){s.$_terms[e].push(t)}else{s.$_terms[e].push(...t)}s.$_temp.ruleset=false;return s}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==false}_ruleRemove(e,t={}){if(!this._singleRules.has(e)){return this}const n=t.clone!==false?this.clone():this;n._singleRules.delete(e);const r=[];for(let t=0;t<n._rules.length;++t){const s=n._rules[t];if(s.name===e&&!s.keep){if(n._inRuleset()&&t<n.$_temp.ruleset){--n.$_temp.ruleset}continue}r.push(s)}n._rules=r;return n}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const n=this.clone();const s=e[0]===l.symbols.override;if(s){e=e.slice(1)}if(!n[t]&&e.length){n[t]=new b}else if(s){n[t]=e.length?new b:null;n.$_mutateRebuild()}if(!n[t]){return n}if(s){n[t].override()}for(const s of e){r(s!==undefined,"Cannot call allow/valid/invalid with undefined");r(s!==l.symbols.override,"Override must be the first value");const e=t==="_invalids"?"_valids":"_invalids";if(n[e]){n[e].remove(s);if(!n[e].length){r(t==="_valids"||!n._flags.only,"Setting invalid value",s,"leaves schema rejecting all values due to previous valid rule");n[e]=null}}n[t].add(s,n._refs)}return n}};_.Base.prototype.isImmutable=true;_.Base.prototype[l.symbols.any]={version:l.version,compile:c.compile,root:"$_root"};_.Base.prototype.deny=_.Base.prototype.invalid;_.Base.prototype.disallow=_.Base.prototype.invalid;_.Base.prototype.equal=_.Base.prototype.valid;_.Base.prototype.exist=_.Base.prototype.required;_.Base.prototype.not=_.Base.prototype.invalid;_.Base.prototype.options=_.Base.prototype.prefs;_.Base.prototype.preferences=_.Base.prototype.prefs;e.exports=new _.Base},6773:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(3221);const o={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision(e){return new o.Cache(e)}};o.Cache=class{constructor(e={}){i.assertOptions(e,["max"]);r(e.max===undefined||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size");this._max=e.max||o.max;this._map=new Map;this._list=new o.List}get length(){return this._map.size}set(e,t){if(e!==null&&!o.supported.has(typeof e)){return}let n=this._map.get(e);if(n){n.value=t;this._list.first(n);return}n=this._list.unshift({key:e,value:t});this._map.set(e,n);this._compact()}get(e){const t=this._map.get(e);if(t){this._list.first(t);return s(t.value)}}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}};o.List=class{constructor(){this.tail=null;this.head=null}unshift(e){e.next=null;e.prev=this.head;if(this.head){this.head.next=e}this.head=e;if(!this.tail){this.tail=e}return e}first(e){if(e===this.head){return}this._remove(e);this.unshift(e)}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:n}=e;t.prev=n;if(n){n.next=t}if(e===this.tail){this.tail=t}e.prev=null;e.next=null;return e}}},3221:(e,t,n)=>{const r=n(2718);const s=n(5563);const i=n(2542);let o;let a;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=i.version;t.defaults={abortEarly:true,allowUnknown:false,cache:true,context:null,convert:true,dateFormat:"iso",errors:{escapeHtml:false,label:"path",language:null,render:true,stack:false,wrapArrays:true},externals:true,messages:{},nonEnumerables:false,noDefaults:false,presence:"optional",skipFunctions:false,stripUnknown:false,warnings:false};t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),literal:Symbol("literal"),override:Symbol("override"),prefs:Symbol("prefs"),ref:Symbol("ref"),values:Symbol("values"),template:Symbol("template")};t.assertOptions=function(e,t,n="Options"){r(e&&typeof e==="object"&&!Array.isArray(e),"Options must be of type object");const s=Object.keys(e).filter(e=>!t.includes(e));r(s.length===0,`${n} contain unknown keys: ${s}`)};t.checkPreferences=function(e){a=a||n(3723);const t=a.preferences.validate(e);if(t.error){throw new s([t.error.details[0].message])}};t.compare=function(e,t,n){switch(n){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}};t.default=function(e,t){return e===undefined?t:e};t.isIsoDate=function(e){return l.isoDate.test(e)};t.isNumber=function(e){return typeof e==="number"&&!isNaN(e)};t.isResolvable=function(e){if(!e){return false}return e[t.symbols.ref]||e[t.symbols.template]};t.isSchema=function(e,n={}){const s=e&&e[t.symbols.any];if(!s){return false}r(n.legacy||s.version===t.version,"Cannot mix different versions of joi schemas");return true};t.isValues=function(e){return e[t.symbols.values]};t.limit=function(e){return Number.isSafeInteger(e)&&e>=0};t.preferences=function(e,r){o=o||n(676);e=e||{};r=r||{};const s=Object.assign({},e,r);if(r.errors&&e.errors){s.errors=Object.assign({},e.errors,r.errors)}if(r.messages){s.messages=o.compile(r.messages,e.messages)}delete s[t.symbols.prefs];return s};t.tryWithPath=function(e,t,n={}){try{return e()}catch(e){if(e.path!==undefined){e.path=t+"."+e.path}else{e.path=t}if(n.append){e.message=`${e.message} (${e.path})`}throw e}};t.validateArg=function(e,n,{assert:r,message:s}){if(t.isSchema(r)){const t=r.validate(e);if(!t.error){return}return t.error.message}else if(!r(e)){return n?`${n} ${s}`:s}};t.verifyFlat=function(e,t){for(const n of e){r(!Array.isArray(n),"Method no longer accepts array arguments:",t)}}},3579:(e,t,n)=>{const r=n(2718);const s=n(3221);const i=n(1802);const o={};t.schema=function(e,t,n={}){s.assertOptions(n,["appendPath","override"]);try{return o.schema(e,t,n)}catch(e){if(n.appendPath&&e.path!==undefined){e.message=`${e.message} (${e.path})`}throw e}};o.schema=function(e,t,n){r(t!==undefined,"Invalid undefined schema");if(Array.isArray(t)){r(t.length,"Invalid empty array schema");if(t.length===1){t=t[0]}}const i=(t,...r)=>{if(n.override!==false){return t.valid(e.override,...r)}return t.valid(...r)};if(o.simple(t)){return i(e,t)}if(typeof t==="function"){return e.custom(t)}r(typeof t==="object","Invalid schema content:",typeof t);if(s.isResolvable(t)){return i(e,t)}if(s.isSchema(t)){return t}if(Array.isArray(t)){for(const n of t){if(!o.simple(n)){return e.alternatives().try(...t)}}return i(e,...t)}if(t instanceof RegExp){return e.string().regex(t)}if(t instanceof Date){return i(e.date(),t)}r(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");return e.object().keys(t)};t.ref=function(e,t){return i.isRef(e)?e:i.create(e,t)};t.compile=function(e,n,i={}){s.assertOptions(i,["legacy"]);const a=n&&n[s.symbols.any];if(a){r(i.legacy||a.version===s.version,"Cannot mix different versions of joi schemas:",a.version,s.version);return n}if(typeof n!=="object"||!i.legacy){return t.schema(e,n,{appendPath:true})}const l=o.walk(n);if(!l){return t.schema(e,n,{appendPath:true})}return l.compile(l.root,n)};o.walk=function(e){if(typeof e!=="object"){return null}if(Array.isArray(e)){for(const t of e){const e=o.walk(t);if(e){return e}}return null}const t=e[s.symbols.any];if(t){return{root:e[t.root],compile:t.compile}}r(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const n=o.walk(e[t]);if(n){return n}}return null};o.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)};t.when=function(e,n,a){if(a===undefined){r(n&&typeof n==="object","Missing options");a=n;n=i.create(".")}if(Array.isArray(a)){a={switch:a}}s.assertOptions(a,["is","not","then","otherwise","switch","break"]);if(s.isSchema(n)){r(a.is===undefined,'"is" can not be used with a schema condition');r(a.not===undefined,'"not" can not be used with a schema condition');r(a.switch===undefined,'"switch" can not be used with a schema condition');return o.condition(e,{is:n,then:a.then,otherwise:a.otherwise,break:a.break})}r(i.isRef(n)||typeof n==="string","Invalid condition:",n);r(a.not===undefined||a.is===undefined,'Cannot combine "is" with "not"');if(a.switch===undefined){let l=a;if(a.not!==undefined){l={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break}}let c=l.is!==undefined?e.$_compile(l.is):e.$_root.invalid(null,false,0,"").required();r(l.then!==undefined||l.otherwise!==undefined,'options must have at least one of "then", "otherwise", or "switch"');r(l.break===undefined||l.then===undefined||l.otherwise===undefined,"Cannot specify then, otherwise, and break all together");if(a.is!==undefined&&!i.isRef(a.is)&&!s.isSchema(a.is)){c=c.required()}return o.condition(e,{ref:t.ref(n),is:c,then:l.then,otherwise:l.otherwise,break:l.break})}r(Array.isArray(a.switch),'"switch" must be an array');r(a.is===undefined,'Cannot combine "switch" with "is"');r(a.not===undefined,'Cannot combine "switch" with "not"');r(a.then===undefined,'Cannot combine "switch" with "then"');const l={ref:t.ref(n),switch:[],break:a.break};for(let t=0;t<a.switch.length;++t){const n=a.switch[t];const o=t===a.switch.length-1;s.assertOptions(n,o?["is","then","otherwise"]:["is","then"]);r(n.is!==undefined,'Switch statement missing "is"');r(n.then!==undefined,'Switch statement missing "then"');const c={is:e.$_compile(n.is),then:e.$_compile(n.then)};if(!i.isRef(n.is)&&!s.isSchema(n.is)){c.is=c.is.required()}if(o){r(a.otherwise===undefined||n.otherwise===undefined,'Cannot specify "otherwise" inside and outside a "switch"');const t=a.otherwise!==undefined?a.otherwise:n.otherwise;if(t!==undefined){r(l.break===undefined,"Cannot specify both otherwise and break");c.otherwise=e.$_compile(t)}}l.switch.push(c)}return l};o.condition=function(e,t){for(const n of["then","otherwise"]){if(t[n]===undefined){delete t[n]}else{t[n]=e.$_compile(t[n])}}return t}},2150:(e,t,n)=>{const r=n(5578);const s=n(3221);const i=n(5547);const o={annotations:Symbol("annotations")};t.Report=class{constructor(e,n,r,s,i,o,a){this.code=e;this.flags=s;this.messages=i;this.path=o.path;this.prefs=a;this.state=o;this.value=n;this.message=null;this.template=null;this.local=r||{};this.local.label=t.label(this.flags,this.state,this.prefs,this.messages);if(this.value!==undefined&&!this.local.hasOwnProperty("value")){this.local.value=this.value}if(this.path.length){const e=this.path[this.path.length-1];if(typeof e!=="object"){this.local.key=e}}}_setTemplate(e){this.template=e;if(!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");if(e){this.local.label=e}}}toString(){if(this.message){return this.message}const e=this.code;if(!this.prefs.errors.render){return this.code}const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);if(t===undefined){return`Error code "${e}" is not defined, your custom type is missing the correct messages definition`}this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]});if(!this.prefs.errors.label){this.message=this.message.replace(/^"" /,"").trim()}return this.message}_template(e,n){return t.template(this.value,e,n||this.code,this.state,this.prefs)}};t.path=function(e){let t="";for(const n of e){if(typeof n==="object"){continue}if(typeof n==="string"){if(t){t+="."}t+=n}else{t+=`[${n}]`}}return t};t.template=function(e,t,n,r,o){if(!t){return}if(i.isTemplate(t)){return n!=="root"?t:null}let a=o.errors.language;if(s.isResolvable(a)){a=a.resolve(e,r,o)}if(a&&t[a]&&t[a][n]!==undefined){return t[a][n]}return t[n]};t.label=function(e,n,r,s){if(e.label){return e.label}if(!r.errors.label){return""}let i=n.path;if(r.errors.label==="key"&&n.path.length>1){i=n.path.slice(-1)}return t.path(i)||t.template(null,r.messages,"root",n,r)||s&&t.template(null,s,"root",n,r)||"value"};t.process=function(e,n,r){if(!e){return null}const{override:s,message:i,details:o}=t.details(e);if(s){return s}if(r.errors.stack){return new t.ValidationError(i,o,n)}const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(i,o,n);Error.stackTraceLimit=a;return l};t.details=function(e,t={}){let n=[];const r=[];for(const s of e){if(s instanceof Error){if(t.override!==false){return{override:s}}const e=s.toString();n.push(e);r.push({message:e,type:"override",context:{error:s}});continue}const e=s.toString();n.push(e);r.push({message:e,path:s.path.filter(e=>typeof e!=="object"),type:s.code,context:s.local})}if(n.length>1){n=[...new Set(n)]}return{message:n.join(". "),details:r}};t.ValidationError=class extends Error{constructor(e,t,n){super(e);this._original=n;this.details=t}annotate(e){if(!this._original||typeof this._original!=="object"){return this.details[0].message}const t=e?"":"[31m";const n=e?"":"[41m";const i=e?"":"[0m";const a=r(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1;const n=this.details[e];const r=n.path;let i=a;for(let e=0;;++e){const a=r[e];if(s.isSchema(i)){i=i.clone()}if(e+1<r.length&&typeof i[a]!=="string"){i=i[a]}else{const e=i[o.annotations]||{errors:{},missing:{}};i[o.annotations]=e;const r=a||n.context.key;if(i[a]!==undefined){e.errors[r]=e.errors[r]||[];e.errors[r].push(t)}else{e.missing[r]=t}break}}}const l={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g};let c=o.safeStringify(a,2).replace(l.key,(e,n)=>`" ${t}[${n}]${i}`).replace(l.missing,(e,r,s)=>`${n}"${r}"${i}${t} [${s}]: -- missing --${i}`).replace(l.arrayIndex,(e,n,r)=>`\n${r} ${t}[${n}]${i}`).replace(l.specials,(e,t)=>t);c=`${c}\n${t}`;for(let e=0;e<this.details.length;++e){const t=e+1;c=`${c}\n[${t}] ${this.details[e].message}`}c=c+i;return c}};t.ValidationError.prototype.isJoi=true;t.ValidationError.prototype.name="ValidationError";o.safeStringify=function(e,t){return JSON.stringify(e,o.serializer(),t)};o.serializer=function(){const e=[];const t=[];const n=(n,r)=>{if(t[0]===r){return"[Circular ~]"}return"[Circular ~."+e.slice(0,t.indexOf(r)).join(".")+"]"};return function(r,s){if(t.length>0){const i=t.indexOf(this);if(~i){t.length=i+1;e.length=i+1;e[i]=r}else{t.push(this);e.push(r)}if(~t.indexOf(s)){s=n.call(this,r,s)}}else{t.push(s)}if(s){const e=s[o.annotations];if(e){if(Array.isArray(s)){const t=[];for(let n=0;n<s.length;++n){if(e.errors[n]){t.push(`_$idx$_${e.errors[n].sort().join(", ")}_$end$_`)}t.push(s[n])}s=t}else{for(const t in e.errors){s[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=s[t];s[t]=undefined}for(const t in e.missing){s[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}}return s}}if(s===Infinity||s===-Infinity||Number.isNaN(s)||typeof s==="function"||typeof s==="symbol"){return"["+s.toString()+"]"}return s}}},1669:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(3221);const o=n(676);const a={};t.type=function(e,t){const n=Object.getPrototypeOf(e);const l=s(n);const c=e._assign(Object.create(l));const u=Object.assign({},t);delete u.base;l._definition=u;const f=n._definition||{};u.messages=o.merge(f.messages,u.messages);u.properties=Object.assign({},f.properties,u.properties);c.type=u.type;u.flags=Object.assign({},f.flags,u.flags);const d=Object.assign({},f.terms);if(u.terms){for(const e in u.terms){const t=u.terms[e];r(c.$_terms[e]===undefined,"Invalid term override for",u.type,e);c.$_terms[e]=t.init;d[e]=t}}u.terms=d;if(!u.args){u.args=f.args}u.prepare=a.prepare(u.prepare,f.prepare);if(u.coerce){if(typeof u.coerce==="function"){u.coerce={method:u.coerce}}if(u.coerce.from&&!Array.isArray(u.coerce.from)){u.coerce={method:u.coerce.method,from:[].concat(u.coerce.from)}}}u.coerce=a.coerce(u.coerce,f.coerce);u.validate=a.validate(u.validate,f.validate);const m=Object.assign({},f.rules);if(u.rules){for(const e in u.rules){const t=u.rules[e];r(typeof t==="object","Invalid rule definition for",u.type,e);let n=t.method;if(n===undefined){n=function(){return this.$_addRule(e)}}if(n){r(!l[e],"Rule conflict in",u.type,e);l[e]=n}r(!m[e],"Rule conflict in",u.type,e);m[e]=t;if(t.alias){const e=[].concat(t.alias);for(const n of e){l[n]=t.method}}if(t.args){t.argsByName=new Map;t.args=t.args.map(e=>{if(typeof e==="string"){e={name:e}}r(!t.argsByName.has(e.name),"Duplicated argument name",e.name);if(i.isSchema(e.assert)){e.assert=e.assert.strict().label(e.name)}t.argsByName.set(e.name,e);return e})}}}u.rules=m;const h=Object.assign({},f.modifiers);if(u.modifiers){for(const e in u.modifiers){r(!l[e],"Rule conflict in",u.type,e);const t=u.modifiers[e];r(typeof t==="function","Invalid modifier definition for",u.type,e);const n=function(t){return this.rule({[e]:t})};l[e]=n;h[e]=t}}u.modifiers=h;if(u.overrides){l._super=n;c.$_super={};for(const e in u.overrides){r(n[e],"Cannot override missing",e);c.$_super[e]=n[e].bind(c)}Object.assign(l,u.overrides)}u.cast=Object.assign({},f.cast,u.cast);const p=Object.assign({},f.manifest,u.manifest);p.build=a.build(u.manifest&&u.manifest.build,f.manifest&&f.manifest.build);u.manifest=p;u.rebuild=a.rebuild(u.rebuild,f.rebuild);return c};a.build=function(e,t){if(!e||!t){return e||t}return function(n,r){return t(e(n,r),r)}};a.coerce=function(e,t){if(!e||!t){return e||t}return{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(n,r){let s;if(!t.from||t.from.includes(typeof n)){s=t.method(n,r);if(s){if(s.errors||s.value===undefined){return s}n=s.value}}if(!e.from||e.from.includes(typeof n)){const t=e.method(n,r);if(t){return t}}return s}}};a.prepare=function(e,t){if(!e||!t){return e||t}return function(n,r){const s=e(n,r);if(s){if(s.errors||s.value===undefined){return s}n=s.value}return t(n,r)||s}};a.rebuild=function(e,t){if(!e||!t){return e||t}return function(n){t(n);e(n)}};a.validate=function(e,t){if(!e||!t){return e||t}return function(n,r){const s=t(n,r);if(s){if(s.errors&&(!Array.isArray(s.errors)||s.errors.length)){return s}n=s.value}return e(n,r)||s}}},4010:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(6773);const o=n(3221);const a=n(3579);const l=n(2150);const c=n(1669);const u=n(8937);const f=n(1802);const d=n(5547);const m=n(121);let h;const p={types:{alternatives:n(7216),any:n(6866),array:n(9762),boolean:n(8686),date:n(9408),function:n(8146),link:n(9713),number:n(3730),object:n(1443),string:n(7769),symbol:n(9737)},aliases:{alt:"alternatives",bool:"boolean",func:"function"}};if(Buffer){p.types.binary=n(6754)}p.root=function(){const e={_types:new Set(Object.keys(p.types))};for(const t of e._types){e[t]=function(...e){r(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments");return p.generate(this,p.types[t],e)}}for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"]){e[t]=function(...e){return this.any()[t](...e)}}Object.assign(e,p.methods);for(const t in p.aliases){const n=p.aliases[t];e[t]=e[n]}e.x=e.expression;if(m.setup){m.setup(e)}return e};p.methods={ValidationError:l.ValidationError,version:o.version,cache:i.provider,assert(e,t,...n){p.assert(e,t,true,n)},attempt(e,t,...n){return p.assert(e,t,false,n)},build(e){r(typeof u.build==="function","Manifest functionality disabled");return u.build(this,e)},checkPreferences(e){o.checkPreferences(e)},compile(e,t){return a.compile(this,e,t)},defaults(e){r(typeof e==="function","modifier must be a function");const t=Object.assign({},this);for(const n of t._types){const s=e(t[n]());r(o.isSchema(s),"modifier must return a valid schema object");t[n]=function(...e){return p.generate(this,s,e)}}return t},expression(...e){return new d(...e)},extend(...e){o.verifyFlat(e,"extend");h=h||n(3723);r(e.length,"You need to provide at least one extension");this.assert(e,h.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let n of e){if(typeof n==="function"){n=n(t)}this.assert(n,h.extension);r(t[n.type]===undefined||t._types.has(n.type),"Cannot override name",n.type);const e=n.base||this.any();const s=c.type(e,n);t._types.add(n.type);t[n.type]=function(...e){return p.generate(this,s,e)}}return t},isExpression:d.isTemplate,isRef:f.isRef,isSchema:o.isSchema,in(...e){return f.in(...e)},override:o.symbols.override,ref(...e){return f.create(...e)},types(){const e={};for(const t of this._types){e[t]=this[t]()}for(const t in p.aliases){e[t]=this[t]()}return e}};p.assert=function(e,t,n,r){const i=r[0]instanceof Error||typeof r[0]==="string"?r[0]:null;const a=i?r[1]:r[0];const c=t.validate(e,o.preferences({errors:{stack:true}},a||{}));let u=c.error;if(!u){return c.value}if(i instanceof Error){throw i}n=n&&typeof u.annotate==="function";const f=n?u.annotate():u.message;if(u instanceof l.ValidationError===false){u=s(u)}u.message=i?`${i} ${f}`:f;throw u};p.generate=function(e,t,n){r(e,"Must be invoked on a Joi instance.");t.$_root=e;if(!t._definition.args||!n.length){return t}return t._definition.args(t,...n)};e.exports=p.root()},8937:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(3221);const o=n(676);const a=n(1802);const l=n(5547);let c;const u={};t.describe=function(e){const t=e._definition;const n={type:e.type,flags:{},rules:[]};for(const t in e._flags){if(t[0]!=="_"){n.flags[t]=u.describe(e._flags[t])}}if(!Object.keys(n.flags).length){delete n.flags}if(e._preferences){n.preferences=s(e._preferences,{shallow:["messages"]});delete n.preferences[i.symbols.prefs];if(n.preferences.messages){n.preferences.messages=o.decompile(n.preferences.messages)}}if(e._valids){n.allow=e._valids.describe()}if(e._invalids){n.invalid=e._invalids.describe()}for(const r of e._rules){const e=t.rules[r.name];if(e.manifest===false){continue}const s={name:r.name};for(const e in t.modifiers){if(r[e]!==undefined){s[e]=u.describe(r[e])}}if(r.args){s.args={};for(const e in r.args){const t=r.args[e];if(e==="options"&&!Object.keys(t).length){continue}s.args[e]=u.describe(t,{assign:e})}if(!Object.keys(s.args).length){delete s.args}}n.rules.push(s)}if(!n.rules.length){delete n.rules}for(const s in e.$_terms){if(s[0]==="_"){continue}r(!n[s],"Cannot describe schema due to internal name conflict with",s);const o=e.$_terms[s];if(!o){continue}if(o instanceof Map){if(o.size){n[s]=[...o.entries()]}continue}if(i.isValues(o)){n[s]=o.describe();continue}r(t.terms[s],"Term",s,"missing configuration");const a=t.terms[s].manifest;const l=typeof a==="object";if(!o.length&&!l){continue}const c=[];for(const e of o){c.push(u.describe(e))}if(l){const{from:e,to:t}=a.mapped;n[s]={};for(const r of c){n[s][r[t]]=r[e]}continue}if(a==="single"){r(c.length===1,"Term",s,"contains more than one item");n[s]=c[0];continue}n[s]=c}u.validate(e.$_root,n);return n};u.describe=function(e,t={}){if(Array.isArray(e)){return e.map(u.describe)}if(e===i.symbols.deepDefault){return{special:"deep"}}if(typeof e!=="object"||e===null){return e}if(t.assign==="options"){return s(e)}if(Buffer&&Buffer.isBuffer(e)){return{buffer:e.toString("binary")}}if(e instanceof Date){return e.toISOString()}if(e instanceof Error){return e}if(e instanceof RegExp){if(t.assign==="regex"){return e.toString()}return{regex:e.toString()}}if(e[i.symbols.literal]){return{function:e.literal}}if(typeof e.describe==="function"){if(t.assign==="ref"){return e.describe().ref}return e.describe()}const n={};for(const t in e){const r=e[t];if(r===undefined){continue}n[t]=u.describe(r,{assign:t})}return n};t.build=function(e,t){const n=new u.Builder(e);return n.parse(t)};u.Builder=class{constructor(e){this.joi=e}parse(e){u.validate(this.joi,e);let t=this.joi[e.type]();const n=t._definition;if(e.flags){for(const s in e.flags){const i=n.flags[s]&&n.flags[s].setter||s;r(typeof t[i]==="function","Invalid flag",s,"for type",e.type);t=t[i](this.build(e.flags[s]))}}if(e.preferences){t=t.preferences(this.build(e.preferences))}if(e.allow){t=t.allow(...this.build(e.allow))}if(e.invalid){t=t.invalid(...this.build(e.invalid))}if(e.rules){for(const s of e.rules){r(typeof t[s.name]==="function","Invalid rule",s.name,"for type",e.type);const i=[];if(s.args){const t={};for(const e in s.args){t[e]=this.build(s.args[e],{assign:e})}const o=Object.keys(t);const a=n.rules[s.name].args;if(a){r(o.length<=a.length,"Invalid number of arguments for",e.type,s.name,"(expected up to",a.length,", found",o.length,")");for(const{name:e}of a){i.push(t[e])}}else{r(o.length===1,"Invalid number of arguments for",e.type,s.name,"(expected up to 1, found",o.length,")");i.push(t[o[0]])}}t=t[s.name](...i);const o={};for(const e in n.modifiers){if(s[e]!==undefined){o[e]=this.build(s[e])}}if(Object.keys(o).length){t=t.rule(o)}}}const s={};for(const t in e){if(["allow","flags","invalid","whens","preferences","rules","type"].includes(t)){continue}r(n.terms[t],"Term",t,"missing configuration");const i=n.terms[t].manifest;if(i==="schema"){s[t]=e[t].map(e=>this.parse(e));continue}if(i==="values"){s[t]=e[t].map(e=>this.build(e));continue}if(i==="single"){s[t]=this.build(e[t]);continue}if(typeof i==="object"){s[t]={};for(const n in e[t]){const r=e[t][n];s[t][n]=this.parse(r)}continue}s[t]=this.build(e[t])}if(e.whens){s.whens=e.whens.map(e=>this.build(e))}t=n.manifest.build(t,s);t.$_temp.ruleset=false;return t}build(e,t={}){if(e===null){return null}if(Array.isArray(e)){return e.map(e=>this.build(e))}if(e instanceof Error){return e}if(t.assign==="options"){return s(e)}if(t.assign==="regex"){return u.regex(e)}if(t.assign==="ref"){return a.build(e)}if(typeof e!=="object"){return e}if(Object.keys(e).length===1){if(e.buffer){r(Buffer,"Buffers are not supported");return Buffer&&Buffer.from(e.buffer,"binary")}if(e.function){return{[i.symbols.literal]:true,literal:e.function}}if(e.override){return i.symbols.override}if(e.ref){return a.build(e.ref)}if(e.regex){return u.regex(e.regex)}if(e.special){r(["deep"].includes(e.special),"Unknown special value",e.special);return i.symbols.deepDefault}if(e.value){return s(e.value)}}if(e.type){return this.parse(e)}if(e.template){return l.build(e)}const n={};for(const t in e){n[t]=this.build(e[t],{assign:t})}return n}};u.regex=function(e){const t=e.lastIndexOf("/");const n=e.slice(1,t);const r=e.slice(t+1);return new RegExp(n,r)};u.validate=function(e,t){c=c||n(3723);e.assert(t,c.description)}},676:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(5547);const o={};t.compile=function(e,t){if(typeof e==="string"){r(!t,"Cannot set single message string");return new i(e)}if(i.isTemplate(e)){r(!t,"Cannot set single message template");return e}r(typeof e==="object"&&!Array.isArray(e),"Invalid message options");t=t?s(t):{};for(let n in e){const s=e[n];if(n==="root"||i.isTemplate(s)){t[n]=s;continue}if(typeof s==="string"){t[n]=new i(s);continue}r(typeof s==="object"&&!Array.isArray(s),"Invalid message for",n);const o=n;t[o]=t[o]||{};for(n in s){const e=s[n];if(n==="root"||i.isTemplate(e)){t[o][n]=e;continue}r(typeof e==="string","Invalid message for",n,"in",o);t[o][n]=new i(e)}}return t};t.decompile=function(e){const t={};for(let n in e){const r=e[n];if(n==="root"){t[n]=r;continue}if(i.isTemplate(r)){t[n]=r.describe({compact:true});continue}const s=n;t[s]={};for(n in r){const e=r[n];if(n==="root"){t[s][n]=e;continue}t[s][n]=e.describe({compact:true})}}return t};t.merge=function(e,n){if(!e){return t.compile(n)}if(!n){return e}if(typeof n==="string"){return new i(n)}if(i.isTemplate(n)){return n}const o=s(e);for(let e in n){const t=n[e];if(e==="root"||i.isTemplate(t)){o[e]=t;continue}if(typeof t==="string"){o[e]=new i(t);continue}r(typeof t==="object"&&!Array.isArray(t),"Invalid message for",e);const s=e;o[s]=o[s]||{};for(e in t){const n=t[e];if(e==="root"||i.isTemplate(n)){o[s][e]=n;continue}r(typeof n==="string","Invalid message for",e,"in",s);o[s][e]=new i(n)}}return o}},4462:(e,t,n)=>{const r=n(2718);const s=n(3221);const i=n(1802);const o={};t.Ids=o.Ids=class{constructor(){this._byId=new Map;this._byKey=new Map;this._schemaChain=false}clone(){const e=new o.Ids;e._byId=new Map(this._byId);e._byKey=new Map(this._byKey);e._schemaChain=this._schemaChain;return e}concat(e){if(e._schemaChain){this._schemaChain=true}for(const[t,n]of e._byId.entries()){r(!this._byKey.has(t),"Schema id conflicts with existing key:",t);this._byId.set(t,n)}for(const[t,n]of e._byKey.entries()){r(!this._byId.has(t),"Schema key conflicts with existing id:",t);this._byKey.set(t,n)}}fork(e,t,n){const i=this._collect(e);i.push({schema:n});const a=i.shift();let l={id:a.id,schema:t(a.schema)};r(s.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of i){l={id:e.id,schema:o.fork(e.schema,l.id,l.schema)}}return l.schema}labels(e,t=[]){const n=e[0];const r=this._get(n);if(!r){return[...t,...e].join(".")}const s=e.slice(1);t=[...t,r.schema._flags.label||n];if(!s.length){return t.join(".")}return r.schema._ids.labels(s,t)}reach(e,t=[]){const n=e[0];const s=this._get(n);r(s,"Schema does not contain path",[...t,...e].join("."));const i=e.slice(1);if(!i.length){return s.schema}return s.schema._ids.reach(i,[...t,n])}register(e,{key:t}={}){if(!e||!s.isSchema(e)){return}if(e.$_property("schemaChain")||e._ids._schemaChain){this._schemaChain=true}const n=e._flags.id;if(n){const t=this._byId.get(n);r(!t||t.schema===e,"Cannot add different schemas with the same id:",n);r(!this._byKey.has(n),"Schema id conflicts with existing key:",n);this._byId.set(n,{schema:e,id:n})}if(t){r(!this._byKey.has(t),"Schema already contains key:",t);r(!this._byId.has(t),"Schema key conflicts with existing id:",t);this._byKey.set(t,{schema:e,id:t})}}reset(){this._byId=new Map;this._byKey=new Map;this._schemaChain=false}_collect(e,t=[],n=[]){const s=e[0];const i=this._get(s);r(i,"Schema does not contain path",[...t,...e].join("."));n=[i,...n];const o=e.slice(1);if(!o.length){return n}return i.schema._ids._collect(o,[...t,s],n)}_get(e){return this._byId.get(e)||this._byKey.get(e)}};o.fork=function(e,n,r){const s=(e,{key:t})=>{if(n===(e._flags.id||t)){return r}};const i=t.schema(e,{each:s,ref:false});return i.$_mutateRebuild()};t.schema=function(e,t){let n;for(const r in e._flags){if(r[0]==="_"){continue}const s=o.scan(e._flags[r],{source:"flags",name:r},t);if(s!==undefined){n=n||e.clone();n._flags[r]=s}}for(let r=0;r<e._rules.length;++r){const s=e._rules[r];const i=o.scan(s.args,{source:"rules",name:s.name},t);if(i!==undefined){n=n||e.clone();const t=Object.assign({},s);t.args=i;n._rules[r]=t;const o=n._singleRules.get(s.name);if(o===s){n._singleRules.set(s.name,t)}}}for(const r in e.$_terms){if(r[0]==="_"){continue}const s=o.scan(e.$_terms[r],{source:"terms",name:r},t);if(s!==undefined){n=n||e.clone();n.$_terms[r]=s}}return n};o.scan=function(e,t,n,r,a){const l=r||[];if(e===null||typeof e!=="object"){return}let c;if(Array.isArray(e)){for(let r=0;r<e.length;++r){const s=t.source==="terms"&&t.name==="keys"&&e[r].key;const i=o.scan(e[r],t,n,[r,...l],s);if(i!==undefined){c=c||e.slice();c[r]=i}}return c}if(n.schema!==false&&s.isSchema(e)||n.ref!==false&&i.isRef(e)){const r=n.each(e,{...t,path:l,key:a});if(r===e){return}return r}for(const r in e){if(r[0]==="_"){continue}const s=o.scan(e[r],t,n,[r,...l],a);if(s!==undefined){c=c||Object.assign({},e);c[r]=s}}return c}},1802:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(8891);const o=n(3221);let a;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:false,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){r(typeof e==="string","Invalid reference key:",e);o.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","separator"]);r(!t.prefix||typeof t.prefix==="object","options.prefix must be of type object");const n=Object.assign({},l.defaults,t);delete n.prefix;const s=n.separator;const i=l.context(e,s,t.prefix);n.type=i.type;e=i.key;if(n.type==="value"){if(i.root){r(!s||e[0]!==s,"Cannot specify relative path with root prefix");n.ancestor="root";if(!e){e=null}}if(s&&s===e){e=null;n.ancestor=0}else{if(n.ancestor!==undefined){r(!s||!e||e[0]!==s,"Cannot combine prefix with ancestor option")}else{const[t,r]=l.ancestor(e,s);if(r){e=e.slice(r);if(e===""){e=null}}n.ancestor=t}}}n.path=s?e===null?[]:e.split(s):[e];return new l.Ref(n)};t.in=function(e,n={}){return t.create(e,Object.assign({},n,{in:true}))};t.isRef=function(e){return e?!!e[o.symbols.ref]:false};l.Ref=class{constructor(e){r(typeof e==="object","Invalid reference construction");o.assertOptions(e,["adjust","ancestor","in","iterables","map","path","separator","type","depth","key","root","display"]);r([false,undefined].includes(e.separator)||typeof e.separator==="string"&&e.separator.length===1,"Invalid separator");r(!e.adjust||typeof e.adjust==="function","options.adjust must be a function");r(!e.map||Array.isArray(e.map),"options.map must be an array");r(!e.map||!e.adjust,"Cannot set both map and adjust options");Object.assign(this,l.defaults,e);r(this.type==="value"||this.ancestor===undefined,"Non-value references cannot reference ancestors");if(Array.isArray(this.map)){this.map=new Map(this.map)}this.depth=this.path.length;this.key=this.path.length?this.path.join(this.separator):null;this.root=this.path[0];this.updateDisplay()}resolve(e,t,n,s,i={}){r(!this.in||i.in,"Invalid in() reference usage");if(this.type==="global"){return this._resolve(n.context,t,i)}if(this.type==="local"){return this._resolve(s,t,i)}if(!this.ancestor){return this._resolve(e,t,i)}if(this.ancestor==="root"){return this._resolve(t.ancestors[t.ancestors.length-1],t,i)}r(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display);return this._resolve(t.ancestors[this.ancestor-1],t,i)}_resolve(e,t,n){let r;if(this.type==="value"&&t.mainstay.shadow&&n.shadow!==false){r=t.mainstay.shadow.get(this.absolute(t))}if(r===undefined){r=i(e,this.path,{iterables:this.iterables,functions:true})}if(this.adjust){r=this.adjust(r)}if(this.map){const e=this.map.get(r);if(e!==undefined){r=e}}if(t.mainstay){t.mainstay.tracer.resolve(t,this,r)}return r}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};if(this.type!=="value"){e.type=this.type}if(this.separator!=="."){e.separator=this.separator}if(this.type==="value"&&this.ancestor!==1){e.ancestor=this.ancestor}if(this.map){e.map=[...this.map]}for(const t of["adjust","iterables"]){if(this[t]!==null){e[t]=this[t]}}if(this.in!==false){e.in=true}return{ref:e}}updateDisplay(){const e=this.key!==null?this.key:"";if(this.type!=="value"){this.display=`ref:${this.type}:${e}`;return}if(!this.separator){this.display=`ref:${e}`;return}if(!this.ancestor){this.display=`ref:${this.separator}${e}`;return}if(this.ancestor==="root"){this.display=`ref:root:${e}`;return}if(this.ancestor===1){this.display=`ref:${e||".."}`;return}const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}};l.Ref.prototype[o.symbols.ref]=true;t.build=function(e){e=Object.assign({},l.defaults,e);if(e.type==="value"&&e.ancestor===undefined){e.ancestor=1}return new l.Ref(e)};l.context=function(e,t,n={}){e=e.trim();if(n){const r=n.global===undefined?"$":n.global;if(r!==t&&e.startsWith(r)){return{key:e.slice(r.length),type:"global"}}const s=n.local===undefined?"#":n.local;if(s!==t&&e.startsWith(s)){return{key:e.slice(s.length),type:"local"}}const i=n.root===undefined?"/":n.root;if(i!==t&&e.startsWith(i)){return{key:e.slice(i.length),type:"value",root:true}}}return{key:e,type:"value"}};l.ancestor=function(e,t){if(!t){return[1,0]}if(e[0]!==t){return[1,0]}if(e[1]!==t){return[0,1]}let n=2;while(e[n]===t){++n}return[n-1,n]};t.toSibling=0;t.toParent=1;t.Manager=class{constructor(){this.refs=[]}register(e,r){if(!e){return}r=r===undefined?t.toParent:r;if(Array.isArray(e)){for(const t of e){this.register(t,r)}return}if(o.isSchema(e)){for(const t of e._refs.refs){if(t.ancestor-r>=0){this.refs.push({ancestor:t.ancestor-r,root:t.root})}}return}if(t.isRef(e)&&e.type==="value"&&e.ancestor-r>=0){this.refs.push({ancestor:e.ancestor-r,root:e.root})}a=a||n(5547);if(a.isTemplate(e)){this.register(e.refs(),r)}}get length(){return this.refs.length}clone(){const e=new t.Manager;e.refs=s(this.refs);return e}reset(){this.refs=[]}roots(){return this.refs.filter(e=>!e.ancestor).map(e=>e.root)}}},3723:(e,t,n)=>{const r=n(4010);const s={};t.preferences=r.object({allowUnknown:r.boolean(),abortEarly:r.boolean(),cache:r.boolean(),context:r.object(),convert:r.boolean(),dateFormat:r.valid("date","iso","string","time","utc"),debug:r.boolean(),errors:{escapeHtml:r.boolean(),label:r.valid("path","key",false),language:[r.string(),r.object().ref()],render:r.boolean(),stack:r.boolean(),wrapArrays:r.boolean()},externals:r.boolean(),messages:r.object(),noDefaults:r.boolean(),nonEnumerables:r.boolean(),presence:r.valid("required","optional","forbidden"),skipFunctions:r.boolean(),stripUnknown:r.object({arrays:r.boolean(),objects:r.boolean()}).or("arrays","objects").allow(true,false),warnings:r.boolean()}).strict();s.nameRx=/^[a-zA-Z0-9]+$/;s.rule=r.object({alias:r.array().items(r.string().pattern(s.nameRx)).single(),args:r.array().items(r.string(),r.object({name:r.string().pattern(s.nameRx).required(),ref:r.boolean(),assert:r.alternatives([r.function(),r.object().schema()]).conditional("ref",{is:true,then:r.required()}),normalize:r.function(),message:r.string().when("assert",{is:r.function(),then:r.required()})})),convert:r.boolean(),manifest:r.boolean(),method:r.function().allow(false),multi:r.boolean(),validate:r.function()});t.extension=r.object({type:r.string().required(),args:r.function(),base:r.object().schema(),coerce:[r.function().maxArity(3),r.object({method:r.function().maxArity(3).required(),from:r.array().items(r.string()).single()})],flags:r.object().pattern(s.nameRx,r.object({setter:r.string(),default:r.any()})),manifest:{build:r.function().arity(2)},messages:[r.object(),r.string()],modifiers:r.object().pattern(s.nameRx,r.function().minArity(1).maxArity(2)),overrides:r.object().pattern(s.nameRx,r.function()),prepare:r.function().maxArity(3),rebuild:r.function().arity(1),rules:r.object().pattern(s.nameRx,s.rule),terms:r.object().pattern(s.nameRx,r.object({init:r.array().allow(null).required(),manifest:r.object().pattern(/.+/,[r.valid("schema","single"),r.object({mapped:r.object({from:r.string().required(),to:r.string().required()}).required()})])})),validate:r.function().maxArity(3)}).strict();t.extensions=r.array().items(r.object(),r.function().arity(1)).strict();s.desc={buffer:r.object({buffer:r.string()}),func:r.object({function:r.function().required(),options:{literal:true}}),override:r.object({override:true}),ref:r.object({ref:r.object({type:r.valid("value","global","local"),path:r.array().required(),separator:r.string().length(1).allow(false),ancestor:r.number().min(0).integer().allow("root"),map:r.array().items(r.array().length(2)).min(1),adjust:r.function(),iterables:r.boolean(),in:r.boolean()}).required()}),regex:r.object({regex:r.string().min(3)}),special:r.object({special:r.valid("deep").required()}),template:r.object({template:r.string().required(),options:r.object()}),value:r.object({value:r.alternatives([r.object(),r.array()]).required()})};s.desc.entity=r.alternatives([r.array().items(r.link("...")),r.boolean(),r.function(),r.number(),r.string(),s.desc.buffer,s.desc.func,s.desc.ref,s.desc.regex,s.desc.special,s.desc.template,s.desc.value,r.link("/")]);s.desc.values=r.array().items(null,r.boolean(),r.function(),r.number().allow(Infinity,-Infinity),r.string().allow(""),r.symbol(),s.desc.buffer,s.desc.func,s.desc.override,s.desc.ref,s.desc.regex,s.desc.template,s.desc.value);s.desc.messages=r.object().pattern(/.+/,[r.string(),s.desc.template,r.object().pattern(/.+/,[r.string(),s.desc.template])]);t.description=r.object({type:r.string().required(),flags:r.object({cast:r.string(),default:r.any(),description:r.string(),empty:r.link("/"),failover:s.desc.entity,id:r.string(),label:r.string(),only:true,presence:["optional","required","forbidden"],result:["raw","strip"],strip:r.boolean(),unit:r.string()}).unknown(),preferences:{allowUnknown:r.boolean(),abortEarly:r.boolean(),cache:r.boolean(),convert:r.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:r.boolean(),label:["path","key"],language:[r.string(),s.desc.ref],wrapArrays:r.boolean()},externals:r.boolean(),messages:s.desc.messages,noDefaults:r.boolean(),nonEnumerables:r.boolean(),presence:["required","optional","forbidden"],skipFunctions:r.boolean(),stripUnknown:r.object({arrays:r.boolean(),objects:r.boolean()}).or("arrays","objects").allow(true,false),warnings:r.boolean()},allow:s.desc.values,invalid:s.desc.values,rules:r.array().min(1).items({name:r.string().required(),args:r.object().min(1),keep:r.boolean(),message:[r.string(),s.desc.messages],warn:r.boolean()}),keys:r.object().pattern(/.*/,r.link("/")),link:s.desc.ref}).pattern(/^[a-z]\w*$/,r.any())},9856:(e,t,n)=>{const r=n(5578);const s=n(8891);const i=n(3221);const o={value:Symbol("value")};e.exports=o.State=class{constructor(e,t,n){this.path=e;this.ancestors=t;this.mainstay=n.mainstay;this.schemas=n.schemas;this.debug=null}localize(e,t=null,n=null){const r=new o.State(e,t,this);if(n&&r.schemas){r.schemas=[o.schemas(n),...r.schemas]}return r}nest(e,t){const n=new o.State(this.path,this.ancestors,this);n.schemas=n.schemas&&[o.schemas(e),...n.schemas];n.debug=t;return n}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new o.Shadow;this.mainstay.shadow.set(this.path,e,t)}snapshot(){if(this.mainstay.shadow){this._snapshot=r(this.mainstay.shadow.node(this.path))}}restore(){if(this.mainstay.shadow){this.mainstay.shadow.override(this.path,this._snapshot);this._snapshot=undefined}}};o.schemas=function(e){if(i.isSchema(e)){return{schema:e}}return e};o.Shadow=class{constructor(){this._values=null}set(e,t,n){if(!e.length){return}if(n==="strip"&&typeof e[e.length-1]==="number"){return}this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const n=e[t];let s=r.get(n);if(!s){s=new Map;r.set(n,s)}r=s}r[o.value]=t}get(e){const t=this.node(e);if(t){return t[o.value]}}node(e){if(!this._values){return}return s(this._values,e,{iterables:true})}override(e,t){if(!this._values){return}const n=e.slice(0,-1);const r=e[e.length-1];const i=s(this._values,n,{iterables:true});if(t){i.set(r,t);return}if(i){i.delete(r)}}}},5547:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(4752);const o=n(1991);const a=n(3221);const l=n(2150);const c=n(1802);const u={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=t=u.Template=class{constructor(e,t){r(typeof e==="string","Template source must be a string");r(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters");this.source=e;this.rendered=e;this._template=null;this._settings=s(t);this._parse()}_parse(){if(!this.source.includes("{")){return}const e=u.encode(this.source);const t=u.split(e);let n=false;const r=[];const s=t.shift();if(s){r.push(s)}for(const e of t){const t=e[0]!=="{";const s=t?"}":"}}";const i=e.indexOf(s);if(i===-1||e[1]==="{"){r.push(`{${u.decode(e)}`);continue}const o=e.slice(t?0:1,i);const a=this._ref(u.decode(o),t);r.push(a);if(typeof a!=="string"){n=true}const l=e.slice(i+s.length);if(l){r.push(u.decode(l))}}if(!n){this.rendered=r.join("");return}this._template=r}static date(e,t){return u.dateFormat[t.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact){return this.source}const t={template:this.source};if(this._settings){t.options=this._settings}return t}static build(e){return new u.Template(e.template,e.options)}isDynamic(){return!!this._template}static isTemplate(e){return e?!!e[a.symbols.template]:false}refs(){if(!this._template){return}const e=[];for(const t of this._template){if(typeof t!=="string"){e.push(...t.refs)}}return e}resolve(e,t,n,r){if(this._template&&this._template.length===1){return this._part(this._template[0],e,t,n,r,{})}return this.render(e,t,n,r)}_part(e,...t){if(e.ref){return e.ref.resolve(...t)}return e.formula.evaluate(t)}render(e,t,n,r,s={}){if(!this.isDynamic()){return this.rendered}const o=[];for(const a of this._template){if(typeof a==="string"){o.push(a)}else{const l=this._part(a,e,t,n,r,s);const c=u.stringify(l,n,s.errors);if(c!==undefined){const e=a.raw||(s.errors&&s.errors.escapeHtml)===false?c:i(c);o.push(e)}}}return o.join("")}_ref(e,t){const n=[];const r=e=>{const t=c.create(e,this._settings);n.push(t);return e=>t.resolve(...e)};try{var s=new o(e,{reference:r,functions:u.functions,constants:u.constants})}catch(t){t.message=`Invalid template variable "${e}" fails due to: ${t.message}`;throw t}if(s.single){if(s.single.type==="reference"){return{ref:n[0],raw:t,refs:n}}return u.stringify(s.single.value)}return{formula:s,raw:t,refs:n}}toString(){return this.source}};u.Template.prototype[a.symbols.template]=true;u.Template.prototype.isImmutable=true;u.encode=function(e){return e.replace(/\\(\{+)/g,(e,t)=>{return u.opens.slice(0,t.length)}).replace(/\\(\}+)/g,(e,t)=>{return u.closes.slice(0,t.length)})};u.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")};u.split=function(e){const t=[];let n="";for(let r=0;r<e.length;++r){const s=e[r];if(s==="{"){let s="";while(r+1<e.length&&e[r+1]==="{"){s+="{";++r}t.push(n);n=s}else{n+=s}}t.push(n);return t};u.stringify=function(e,t,n){const r=typeof e;if(e===null){return"null"}if(r==="string"){return e}if(r==="number"||r==="function"||r==="symbol"){return e.toString()}if(r!=="object"){return JSON.stringify(e)}if(e instanceof Date){return u.Template.date(e,t)}if(e instanceof Map){const t=[];for(const[n,r]of e.entries()){t.push(`${n.toString()} -> ${r.toString()}`)}e=t}if(!Array.isArray(e)){return e.toString()}let s="";for(const r of e){s=s+(s.length?", ":"")+u.stringify(r,t,n)}return n.wrapArrays?"["+s+"]":s};u.constants={true:true,false:false,null:null,second:1e3,minute:60*1e3,hour:60*60*1e3,day:24*60*60*1e3};u.functions={if(e,t,n){return e?t:n},msg(e){const[t,n,r,s,i]=this;const o=i.messages;if(!o){return""}const a=l.template(t,o[0],e,n,r)||l.template(t,o[1],e,n,r);if(!a){return""}return a.render(t,n,r,s,i)},number(e){if(typeof e==="number"){return e}if(typeof e==="string"){return parseFloat(e)}if(typeof e==="boolean"){return e?1:0}if(e instanceof Date){return e.getTime()}return null}}},121:(e,t,n)=>{const r=n(5801);const s=n(989);const i=n(2150);const o={codes:{error:1,pass:2,full:3},labels:{0:"never used",1:"always error",2:"always pass"}};t.setup=function(e){const t=function(){e._tracer=e._tracer||new o.Tracer;return e._tracer};e.trace=t;e[Symbol.for("@hapi/lab/coverage/initialize")]=t;e.untrace=(()=>{e._tracer=null})};t.location=function(e){return e.$_setFlag("_tracerLocation",s.location(2))};o.Tracer=class{constructor(){this.name="Joi";this._schemas=new Map}_register(e){const t=this._schemas.get(e);if(t){return t.store}const n=new o.Store(e);const{filename:r,line:i}=e._flags._tracerLocation||s.location(5);this._schemas.set(e,{filename:r,line:i,store:n});return n}_combine(e,t){for(const{store:n}of this._schemas.values()){n._combine(e,t)}}report(e){const t=[];for(const{filename:n,line:r,store:s}of this._schemas.values()){if(e&&e!==n){continue}const i=[];const a=[];for(const[e,t]of s._sources.entries()){if(o.sub(t.paths,a)){continue}if(!t.entry){i.push({status:"never reached",paths:[...t.paths]});a.push(...t.paths);continue}for(const n of["valid","invalid"]){const r=e[`_${n}s`];if(!r){continue}const s=new Set(r._values);const o=new Set(r._refs);for(const{value:e,ref:r}of t[n]){s.delete(e);o.delete(r)}if(s.size||o.size){i.push({status:[...s,...[...o].map(e=>e.display)],rule:`${n}s`})}}const n=e._rules.map(e=>e.name);for(const t of["default","failover"]){if(e._flags[t]!==undefined){n.push(t)}}for(const e of n){const n=o.labels[t.rule[e]||0];if(n){const r={rule:e,status:n};if(t.paths.size){r.paths=[...t.paths]}i.push(r)}}}if(i.length){t.push({filename:n,line:r,missing:i,severity:"error",message:`Schema missing tests for ${i.map(o.message).join(", ")}`})}}return t.length?t:null}};o.Store=class{constructor(e){this.active=true;this._sources=new Map;this._combos=new Map;this._scan(e)}debug(e,t,n,r){e.mainstay.debug&&e.mainstay.debug.push({type:t,name:n,result:r,path:e.path})}entry(e,t){o.debug(t,{type:"entry"});this._record(e,e=>{e.entry=true})}filter(e,t,n,r){o.debug(t,{type:n,...r});this._record(e,e=>{e[n].add(r)})}log(e,t,n,r,s){o.debug(t,{type:n,name:r,result:s==="full"?"pass":s});this._record(e,e=>{e[n][r]=e[n][r]||0;e[n][r]|=o.codes[s]})}resolve(e,t,n){if(!e.mainstay.debug){return}const r={type:"resolve",ref:t.display,to:n,path:e.path};e.mainstay.debug.push(r)}value(e,t,n,s,i){if(!e.mainstay.debug||r(n,s)){return}const o={type:"value",by:t,from:n,to:s,path:e.path};if(i){o.name=i}e.mainstay.debug.push(o)}_record(e,t){const n=this._sources.get(e);if(n){t(n);return}const r=this._combos.get(e);for(const e of r){this._record(e,t)}}_scan(e,t){const n=t||[];let r=this._sources.get(e);if(!r){r={paths:new Set,entry:false,rule:{},valid:new Set,invalid:new Set};this._sources.set(e,r)}if(n.length){r.paths.add(n)}const s=(e,t)=>{const r=o.id(e,t);this._scan(e,n.concat(r))};e.$_modify({each:s,ref:false})}_combine(e,t){this._combos.set(e,t)}};o.message=function(e){const t=e.paths?i.path(e.paths[0])+(e.rule?":":""):"";return`${t}${e.rule||""} (${e.status})`};o.id=function(e,{source:t,name:n,path:r,key:s}){if(e._flags.id){return e._flags.id}if(s){return s}n=`@${n}`;if(t==="terms"){return[n,r[Math.min(r.length-1,1)]]}return n};o.sub=function(e,t){for(const n of e){for(const e of t){if(r(n.slice(0,e.length),e)){return true}}}return false};o.debug=function(e,t){if(e.mainstay.debug){t.path=e.debug?[...e.path,e.debug]:e.path;e.mainstay.debug.push(t)}}},7216:(e,t,n)=>{const r=n(2718);const s=n(6866);const i=n(3221);const o=n(3579);const a=n(2150);const l=n(1802);const c={};e.exports=s.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:l.toSibling}},args(e,...t){if(t.length===1){if(Array.isArray(t[0])){return e.try(...t[0])}}return e.try(...t)},validate(e,t){const{schema:n,error:r,state:s,prefs:i}=t;if(n._flags.match){let t=0;let o;for(let r=0;r<n.$_terms.matches.length;++r){const a=n.$_terms.matches[r];const l=s.nest(a.schema,`match.${r}`);l.snapshot();const c=a.schema.$_validate(e,l,i);if(!c.errors){++t;o=c.value}else{l.restore()}}if(!t){return{errors:r("alternatives.any")}}if(n._flags.match==="one"){return t===1?{value:o}:{errors:r("alternatives.one")}}return t===n.$_terms.matches.length?{value:e}:{errors:r("alternatives.all")}}const o=[];for(let t=0;t<n.$_terms.matches.length;++t){const r=n.$_terms.matches[t];if(r.schema){const n=s.nest(r.schema,`match.${t}`);n.snapshot();const a=r.schema.$_validate(e,n,i);if(!a.errors){return a}n.restore();o.push({schema:r.schema,reports:a.errors});continue}const a=r.ref?r.ref.resolve(e,s,i):e;const l=r.is?[r]:r.switch;for(let n=0;n<l.length;++n){const o=l[n];const{is:c,then:u,otherwise:f}=o;const d=`match.${t}${r.switch?"."+n:""}`;if(!c.$_match(a,s.nest(c,`${d}.is`),i)){if(f){return f.$_validate(e,s.nest(f,`${d}.otherwise`),i)}}else if(u){return u.$_validate(e,s.nest(u,`${d}.then`),i)}}}return c.errors(o,t)},rules:{conditional:{method(e,t){r(!this._flags._endedSwitch,"Unreachable condition");r(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule");r(t.break===undefined,"Cannot use break option with alternatives conditional");const n=this.clone();const s=o.when(n,e,t);const i=s.is?[s]:s.switch;for(const e of i){if(e.then&&e.otherwise){n.$_setFlag("_endedSwitch",true,{clone:false});break}}n.$_terms.matches.push(s);return n.$_mutateRebuild()}},match:{method(e){r(["any","one","all"].includes(e),"Invalid alternatives match mode",e);if(e!=="any"){for(const t of this.$_terms.matches){r(t.schema,"Cannot combine match mode",e,"with conditional rules")}}return this.$_setFlag("match",e)}},try:{method(...e){r(e.length,"Missing alternative schemas");i.verifyFlat(e,"try");r(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const n of e){t.$_terms.matches.push({schema:t.$_compile(n)})}return t.$_mutateRebuild()}}},overrides:{label(e){const t=this.$_super.label(e);const n=(t,n)=>n.path[0]!=="is"?t.label(e):undefined;return t.$_modify({each:n,ref:false})}},rebuild(e){const t=t=>{if(i.isSchema(t)&&t.type==="array"){e.$_setFlag("_arrayItems",true,{clone:false})}};e.$_modify({each:t})},manifest:{build(e,t){if(t.matches){for(const n of t.matches){const{schema:t,ref:r,is:s,not:i,then:o,otherwise:a}=n;if(t){e=e.try(t)}else if(r){e=e.conditional(r,{is:s,then:o,not:i,otherwise:a,switch:n.switch})}else{e=e.conditional(s,{then:o,otherwise:a})}}}return e}},messages:{"alternatives.all":'"{{#label}}" does not match all of the required types',"alternatives.any":'"{{#label}}" does not match any of the allowed types',"alternatives.match":'"{{#label}}" does not match any of the allowed types',"alternatives.one":'"{{#label}}" matches more than one allowed type',"alternatives.types":'"{{#label}}" must be one of {{#types}}'}});c.errors=function(e,{error:t,state:n}){if(!e.length){return{errors:t("alternatives.any")}}if(e.length===1){return{errors:e[0].reports}}const r=new Set;const s=[];for(const{reports:i,schema:o}of e){if(i.length>1){return c.unmatched(e,t)}const l=i[0];if(l instanceof a.Report===false){return c.unmatched(e,t)}if(l.state.path.length!==n.path.length){s.push({type:o.type,report:l});continue}if(l.code==="any.only"){for(const e of l.local.valids){r.add(e)}continue}const[u,f]=l.code.split(".");if(f!=="base"){s.push({type:o.type,report:l});continue}r.add(u)}if(!s.length){return{errors:t("alternatives.types",{types:[...r]})}}if(s.length===1){return{errors:s[0].report}}return c.unmatched(e,t)};c.unmatched=function(e,t){const n=[];for(const t of e){n.push(...t.reports)}return{errors:t("alternatives.match",a.details(n,{override:false}))}}},6866:(e,t,n)=>{const r=n(2718);const s=n(5403);const i=n(3221);const o=n(676);const a={};e.exports=s.extend({type:"any",flags:{only:{default:false}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){r(typeof e==="function","Method must be a function");r(t===undefined||t&&typeof t==="string","Description must be a non-empty string");return this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,{method:n}){try{return n(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:true},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){r(i.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();t.$_terms.shared=t.$_terms.shared||[];t.$_terms.shared.push(e);t.$_mutateRegister(e);return t}},warning:{method(e,t){r(e&&typeof e==="string","Invalid warning code");return this.$_addRule({name:"warning",args:{code:e,local:t},warn:true})},validate(e,t,{code:n,local:r}){return t.error(n,r)},args:["code","local"],multi:true}},modifiers:{keep(e,t=true){e.keep=t},message(e,t){e.message=o.compile(t)},warn(e,t=true){e.warn=t}},manifest:{build(e,t){for(const n in t){const r=t[n];if(["examples","externals","metas","notes","tags"].includes(n)){for(const t of r){e=e[n.slice(0,-1)](t)}continue}if(n==="alterations"){const t={};for(const{target:e,adjuster:n}of r){t[e]=n}e=e.alter(t);continue}if(n==="whens"){for(const t of r){const{ref:n,is:r,not:s,then:i,otherwise:o,concat:a}=t;if(a){e=e.concat(a)}else if(n){e=e.when(n,{is:r,not:s,then:i,otherwise:o,switch:t.switch,break:t.break})}else{e=e.when(r,{then:i,otherwise:o,break:t.break})}}continue}if(n==="shared"){for(const t of r){e=e.shared(t)}}}return e}},messages:{"any.custom":'"{{#label}}" failed custom validation because {{#error.message}}',"any.default":'"{{#label}}" threw an error when running default method',"any.failover":'"{{#label}}" threw an error when running failover method',"any.invalid":'"{{#label}}" contains an invalid value',"any.only":'"{{#label}}" must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":'"{{#label}}" {{#arg}} references "{{#ref}}" which {{#reason}}',"any.required":'"{{#label}}" is required',"any.unknown":'"{{#label}}" is not allowed'}})},9762:(e,t,n)=>{const r=n(2718);const s=n(5801);const i=n(8891);const o=n(6866);const a=n(3221);const l=n(3579);const c={};e.exports=o.extend({type:"array",flags:{single:{default:false},sparse:{default:false}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,{schema:t,state:n,prefs:r}){if(!Array.isArray(e)){return}const s=t.$_getRule("sort");if(!s){return}return c.sort(t,e,s.args.options,n,r)}},validate(e,{schema:t,error:n}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];t[a.symbols.arraySingle]=true;return{value:t}}return{errors:n("array.base")}}if(!t.$_getRule("items")&&!t.$_terms.externals){return}return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:true});const t=this.$_addRule({name:"has",args:{schema:e}});t.$_mutateRegister(e);return t},validate(e,{state:t,prefs:n,error:r},{schema:s}){const i=[e,...t.ancestors];for(let r=0;r<e.length;++r){const o=t.localize([...t.path,r],i,s);if(s.$_match(e[r],o,n)){return e}}const o=s._flags.label;if(o){return r("array.hasKnown",{patternLabel:o})}return r("array.hasUnknown",null)},multi:true},items:{method(...e){a.verifyFlat(e,"items");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=a.tryWithPath(()=>this.$_compile(e[n]),n,{append:true});t.$_terms.items.push(r)}return t.$_mutateRebuild()},validate(e,{schema:t,error:n,state:r,prefs:s}){const i=t.$_terms._requireds.slice();const o=t.$_terms.ordered.slice();const l=[...t.$_terms._inclusions,...i];const u=!e[a.symbols.arraySingle];delete e[a.symbols.arraySingle];const f=[];let d=e.length;for(let a=0;a<d;++a){const m=e[a];let h=false;let p=false;const g=u?a:new Number(a);const y=[...r.path,g];if(!t._flags.sparse&&m===undefined){f.push(n("array.sparse",{key:g,path:y,pos:a,value:undefined},r.localize(y)));if(s.abortEarly){return f}o.shift();continue}const b=[e,...r.ancestors];for(const e of t.$_terms._exclusions){if(!e.$_match(m,r.localize(y,b,e),s,{presence:"ignore"})){continue}f.push(n("array.excludes",{pos:a,value:m},r.localize(y)));if(s.abortEarly){return f}h=true;o.shift();break}if(h){continue}if(t.$_terms.ordered.length){if(o.length){const i=o.shift();const l=i.$_validate(m,r.localize(y,b,i),s);if(!l.errors){if(i._flags.result==="strip"){c.fastSplice(e,a);--a;--d}else if(!t._flags.sparse&&l.value===undefined){f.push(n("array.sparse",{key:g,path:y,pos:a,value:undefined},r.localize(y)));if(s.abortEarly){return f}continue}else{e[a]=l.value}}else{f.push(...l.errors);if(s.abortEarly){return f}}continue}else if(!t.$_terms.items.length){f.push(n("array.orderedLength",{pos:a,limit:t.$_terms.ordered.length}));if(s.abortEarly){return f}break}}const _=[];let A=i.length;for(let o=0;o<A;++o){const l=r.localize(y,b,i[o]);l.snapshot();const u=i[o].$_validate(m,l,s);_[o]=u;if(!u.errors){e[a]=u.value;p=true;c.fastSplice(i,o);--o;--A;if(!t._flags.sparse&&u.value===undefined){f.push(n("array.sparse",{key:g,path:y,pos:a,value:undefined},r.localize(y)));if(s.abortEarly){return f}}break}l.restore()}if(p){continue}const E=s.stripUnknown&&!!s.stripUnknown.arrays||false;A=l.length;for(const o of l){let l;const u=i.indexOf(o);if(u!==-1){l=_[u]}else{const i=r.localize(y,b,o);i.snapshot();l=o.$_validate(m,i,s);if(!l.errors){if(o._flags.result==="strip"){c.fastSplice(e,a);--a;--d}else if(!t._flags.sparse&&l.value===undefined){f.push(n("array.sparse",{key:g,path:y,pos:a,value:undefined},r.localize(y)));h=true}else{e[a]=l.value}p=true;break}i.restore()}if(A===1){if(E){c.fastSplice(e,a);--a;--d;p=true;break}f.push(...l.errors);if(s.abortEarly){return f}h=true;break}}if(h){continue}if(t.$_terms._inclusions.length&&!p){if(E){c.fastSplice(e,a);--a;--d;continue}f.push(n("array.includes",{pos:a,value:m},r.localize(y)));if(s.abortEarly){return f}}}if(i.length){c.fillMissedErrors(t,f,i,e,r,s)}if(o.length){c.fillOrderedErrors(t,f,o,e,r,s)}return f.length?f:e},priority:true,manifest:false},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,{limit:n},{name:r,operator:s,args:i}){if(a.compare(e.length,n,s)){return e}return t.error("array."+r,{limit:i.limit,value:e})},args:[{name:"limit",ref:true,assert:a.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(...e){a.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let n=0;n<e.length;++n){const r=a.tryWithPath(()=>this.$_compile(e[n]),n,{append:true});c.validateSingle(r,t);t.$_mutateRegister(r);t.$_terms.ordered.push(r)}return t.$_mutateRebuild()}},single:{method(e){const t=e===undefined?true:!!e;r(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items");return this.$_setFlag("single",t)}},sort:{method(e={}){a.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};if(e.by){t.by=l.ref(e.by,{ancestor:0});r(!t.by.ancestor,"Cannot sort by ancestor")}return this.$_addRule({name:"sort",args:{options:t}})},validate(e,{error:t,state:n,prefs:r,schema:s},{options:i}){const{value:o,errors:a}=c.sort(s,e,i,n,r);if(a){return a}for(let n=0;n<e.length;++n){if(e[n]!==o[n]){return t("array.sort",{order:i.order,by:i.by?i.by.key:"value"})}}return e},convert:true},sparse:{method(e){const t=e===undefined?true:!!e;if(this._flags.sparse===t){return this}const n=t?this.clone():this.$_addRule("items");return n.$_setFlag("sparse",t,{clone:false})}},unique:{method(e,t={}){r(!e||typeof e==="function"||typeof e==="string","comparator must be a function or a string");a.assertOptions(t,["ignoreUndefined","separator"]);const n={name:"unique",args:{options:t,comparator:e}};if(e){if(typeof e==="string"){const r=a.default(t.separator,".");n.path=r?e.split(r):[e]}else{n.comparator=e}}return this.$_addRule(n)},validate(e,{state:t,error:n,schema:o},{comparator:a,options:l},{comparator:c,path:u}){const f={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map};const d=c||s;const m=l.ignoreUndefined;for(let s=0;s<e.length;++s){const o=u?i(e[s],u):e[s];const l=c?f.custom:f[typeof o];r(l,"Failed to find unique map container for type",typeof o);if(l instanceof Map){const r=l.entries();let i;while(!(i=r.next()).done){if(d(i.value[0],o)){const r=t.localize([...t.path,s],[e,...t.ancestors]);const o={pos:s,value:e[s],dupePos:i.value[1],dupeValue:e[i.value[1]]};if(u){o.path=a}return n("array.unique",o,r)}}l.set(o,s)}else{if((!m||o!==undefined)&&l[o]!==undefined){const r={pos:s,value:e[s],dupePos:l[o],dupeValue:e[l[o]]};if(u){r.path=a}const i=t.localize([...t.path,s],[e,...t.ancestors]);return n("array.unique",r,i)}l[o]=s}}return e},args:["comparator","options"],multi:true}},cast:{set:{from:Array.isArray,to(e,t){return new Set(e)}}},rebuild(e){e.$_terms._inclusions=[];e.$_terms._exclusions=[];e.$_terms._requireds=[];for(const t of e.$_terms.items){c.validateSingle(t,e);if(t._flags.presence==="required"){e.$_terms._requireds.push(t)}else if(t._flags.presence==="forbidden"){e.$_terms._exclusions.push(t)}else{e.$_terms._inclusions.push(t)}}for(const t of e.$_terms.ordered){c.validateSingle(t,e)}},manifest:{build(e,t){if(t.items){e=e.items(...t.items)}if(t.ordered){e=e.ordered(...t.ordered)}return e}},messages:{"array.base":'"{{#label}}" must be an array',"array.excludes":'"{{#label}}" contains an excluded value',"array.hasKnown":'"{{#label}}" does not contain at least one required match for type "{#patternLabel}"',"array.hasUnknown":'"{{#label}}" does not contain at least one required match',"array.includes":'"{{#label}}" does not match any of the allowed types',"array.includesRequiredBoth":'"{{#label}}" does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)',"array.includesRequiredKnowns":'"{{#label}}" does not contain {{#knownMisses}}',"array.includesRequiredUnknowns":'"{{#label}}" does not contain {{#unknownMisses}} required value(s)',"array.length":'"{{#label}}" must contain {{#limit}} items',"array.max":'"{{#label}}" must contain less than or equal to {{#limit}} items',"array.min":'"{{#label}}" must contain at least {{#limit}} items',"array.orderedLength":'"{{#label}}" must contain at most {{#limit}} items',"array.sort":'"{{#label}}" must be sorted in {#order} order by {{#by}}',"array.sort.mismatching":'"{{#label}}" cannot be sorted due to mismatching types',"array.sort.unsupported":'"{{#label}}" cannot be sorted due to unsupported type {#type}',"array.sparse":'"{{#label}}" must not be a sparse array item',"array.unique":'"{{#label}}" contains a duplicate value'}});c.fillMissedErrors=function(e,t,n,r,s,i){const o=[];let a=0;for(const e of n){const t=e._flags.label;if(t){o.push(t)}else{++a}}if(o.length){if(a){t.push(e.$_createError("array.includesRequiredBoth",r,{knownMisses:o,unknownMisses:a},s,i))}else{t.push(e.$_createError("array.includesRequiredKnowns",r,{knownMisses:o},s,i))}}else{t.push(e.$_createError("array.includesRequiredUnknowns",r,{unknownMisses:a},s,i))}};c.fillOrderedErrors=function(e,t,n,r,s,i){const o=[];for(const e of n){if(e._flags.presence==="required"){o.push(e)}}if(o.length){c.fillMissedErrors(e,t,o,r,s,i)}};c.fastSplice=function(e,t){let n=t;while(n<e.length){e[n++]=e[n]}--e.length};c.validateSingle=function(e,t){if(e.type==="array"||e._flags._arrayItems){r(!t._flags.single,"Cannot specify array item with single rule enabled");t.$_setFlag("_arrayItems",true,{clone:false})}};c.sort=function(e,t,n,r,s){const i=n.order==="ascending"?1:-1;const o=-1*i;const a=i;const l=(l,u)=>{let f=c.compare(l,u,o,a);if(f!==null){return f}if(n.by){l=n.by.resolve(l,r,s);u=n.by.resolve(u,r,s)}f=c.compare(l,u,o,a);if(f!==null){return f}const d=typeof l;if(d!==typeof u){throw e.$_createError("array.sort.mismatching",t,null,r,s)}if(d!=="number"&&d!=="string"){throw e.$_createError("array.sort.unsupported",t,{type:d},r,s)}if(d==="number"){return(l-u)*i}return l<u?o:a};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}};c.compare=function(e,t,n,r){if(e===t){return 0}if(e===undefined){return 1}if(t===undefined){return-1}if(e===null){return r}if(t===null){return n}return null}},6754:(e,t,n)=>{const r=n(2718);const s=n(6866);const i=n(3221);const o={};e.exports=s.extend({type:"binary",coerce:{from:"string",method(e,{schema:t}){try{return{value:Buffer.from(e,t._flags.encoding)}}catch(e){}}},validate(e,{error:t}){if(!Buffer.isBuffer(e)){return{value:e,errors:t("binary.base")}}},rules:{encoding:{method(e){r(Buffer.isEncoding(e),"Invalid encoding:",e);return this.$_setFlag("encoding",e)}},length:{method(e){return this.$_addRule({name:"length",method:"length",args:{limit:e},operator:"="})},validate(e,t,{limit:n},{name:r,operator:s,args:o}){if(i.compare(e.length,n,s)){return e}return t.error("binary."+r,{limit:o.limit,value:e})},args:[{name:"limit",ref:true,assert:i.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}}},cast:{string:{from:e=>Buffer.isBuffer(e),to(e,t){return e.toString()}}},messages:{"binary.base":'"{{#label}}" must be a buffer or a string',"binary.length":'"{{#label}}" must be {{#limit}} bytes',"binary.max":'"{{#label}}" must be less than or equal to {{#limit}} bytes',"binary.min":'"{{#label}}" must be at least {{#limit}} bytes'}})},8686:(e,t,n)=>{const r=n(2718);const s=n(6866);const i=n(3221);const o=n(566);const a={};a.isBool=function(e){return typeof e==="boolean"};e.exports=s.extend({type:"boolean",flags:{sensitive:{default:false}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if(typeof e==="boolean"){return}if(typeof e==="string"){const n=t._flags.sensitive?e:e.toLowerCase();e=n==="true"?true:n==="false"?false:e}if(typeof e!=="boolean"){e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(t.$_terms.falsy&&t.$_terms.falsy.has(e,null,null,!t._flags.sensitive)?false:e)}return{value:e}},validate(e,{error:t}){if(typeof e!=="boolean"){return{value:e,errors:t("boolean.base")}}},rules:{truthy:{method(...e){i.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new o;for(let n=0;n<e.length;++n){const s=e[n];r(s!==undefined,"Cannot call truthy with undefined");t.$_terms.truthy.add(s)}return t}},falsy:{method(...e){i.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new o;for(let n=0;n<e.length;++n){const s=e[n];r(s!==undefined,"Cannot call falsy with undefined");t.$_terms.falsy.add(s)}return t}},sensitive:{method(e=true){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:a.isBool,to(e,t){return e?1:0}},string:{from:a.isBool,to(e,t){return e?"true":"false"}}},manifest:{build(e,t){if(t.truthy){e=e.truthy(...t.truthy)}if(t.falsy){e=e.falsy(...t.falsy)}return e}},messages:{"boolean.base":'"{{#label}}" must be a boolean'}})},9408:(e,t,n)=>{const r=n(2718);const s=n(6866);const i=n(3221);const o=n(5547);const a={};a.isDate=function(e){return e instanceof Date};e.exports=s.extend({type:"date",coerce:{from:["number","string"],method(e,{schema:t}){return{value:a.parse(e,t._flags.format)||e}}},validate(e,{schema:t,error:n,prefs:r}){if(e instanceof Date&&!isNaN(e.getTime())){return}const s=t._flags.format;if(!r.convert||!s||typeof e!=="string"){return{value:e,errors:n("date.base")}}return{value:e,errors:n("date.format",{format:s})}},rules:{compare:{method:false,validate(e,t,{date:n},{name:r,operator:s,args:o}){const a=n==="now"?Date.now():n.getTime();if(i.compare(e.getTime(),a,s)){return e}return t.error("date."+r,{limit:o.date,value:e})},args:[{name:"date",ref:true,normalize:e=>{return e==="now"?e:a.parse(e)},assert:e=>e!==null,message:"must have a valid date format"}]},format:{method(e){r(["iso","javascript","unix"].includes(e),"Unknown date format",e);return this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(e="javascript"){r(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"');return this.format(e)}}},cast:{number:{from:a.isDate,to(e,t){return e.getTime()}},string:{from:a.isDate,to(e,{prefs:t}){return o.date(e,t)}}},messages:{"date.base":'"{{#label}}" must be a valid date',"date.format":'"{{#label}}" must be in {msg("date.format." + #format) || #format} format',"date.greater":'"{{#label}}" must be greater than "{{#limit}}"',"date.less":'"{{#label}}" must be less than "{{#limit}}"',"date.max":'"{{#label}}" must be less than or equal to "{{#limit}}"',"date.min":'"{{#label}}" must be larger than or equal to "{{#limit}}"',"date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}});a.parse=function(e,t){if(e instanceof Date){return e}if(typeof e!=="string"&&(isNaN(e)||!isFinite(e))){return null}if(/^\s*$/.test(e)){return null}if(t==="iso"){if(!i.isIsoDate(e)){return null}return a.date(e.toString())}const n=e;if(typeof e==="string"&&/^[+-]?\d+(\.\d+)?$/.test(e)){e=parseFloat(e)}if(t){if(t==="javascript"){return a.date(1*e)}if(t==="unix"){return a.date(1e3*e)}if(typeof n==="string"){return null}}return a.date(e)};a.date=function(e){const t=new Date(e);if(!isNaN(t.getTime())){return t}return null}},8146:(e,t,n)=>{const r=n(2718);const s=n(1732);const i={};e.exports=s.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer");return this.$_addRule({name:"arity",args:{n:e}})},validate(e,t,{n:n}){if(e.length===n){return e}return t.error("function.arity",{n:n})}},class:{method(){return this.$_addRule("class")},validate(e,t){if(/^\s*class\s/.test(e.toString())){return e}return t.error("function.class",{value:e})}},minArity:{method(e){r(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer");return this.$_addRule({name:"minArity",args:{n:e}})},validate(e,t,{n:n}){if(e.length>=n){return e}return t.error("function.minArity",{n:n})}},maxArity:{method(e){r(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer");return this.$_addRule({name:"maxArity",args:{n:e}})},validate(e,t,{n:n}){if(e.length<=n){return e}return t.error("function.maxArity",{n:n})}}},messages:{"function.arity":'"{{#label}}" must have an arity of {{#n}}',"function.class":'"{{#label}}" must be a class',"function.maxArity":'"{{#label}}" must have an arity lesser or equal to {{#n}}',"function.minArity":'"{{#label}}" must have an arity greater or equal to {{#n}}'}})},1732:(e,t,n)=>{const r=n(5545);const s=n(2718);const i=n(5578);const o=n(8392);const a=n(6866);const l=n(3221);const c=n(3579);const u=n(2150);const f=n(1802);const d=n(5547);const m={renameDefaults:{alias:false,multiple:false,override:false}};e.exports=a.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:false}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args(e,t){return e.keys(t)},validate(e,{schema:t,error:n,state:r,prefs:s}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e)){return{value:e,errors:n("object.base",{type:t.$_property("typeof")})}}if(!t.$_terms.renames&&!t.$_terms.dependencies&&!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.externals){return}e=m.clone(e,s);const i=[];if(t.$_terms.renames&&!m.rename(t,e,r,s,i)){return{value:e,errors:i}}if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies){return{value:e,errors:i}}const o=new Set(Object.keys(e));if(t.$_terms.keys){const n=[e,...r.ancestors];for(const a of t.$_terms.keys){const t=a.key;const l=e[t];o.delete(t);const c=r.localize([...r.path,t],n,a);const u=a.schema.$_validate(l,c,s);if(u.errors){if(s.abortEarly){return{value:e,errors:u.errors}}i.push(...u.errors)}else if(a.schema._flags.result==="strip"||u.value===undefined&&l!==undefined){delete e[t]}else if(u.value!==undefined){e[t]=u.value}}}if(o.size||t._flags._hasPatternMatch){const n=m.unknown(t,e,o,i,r,s);if(n){return n}}if(t.$_terms.dependencies){for(const n of t.$_terms.dependencies){if(n.key&&n.key.resolve(e,r,s,null,{shadow:false})===undefined){continue}const o=m.dependencies[n.rel](t,n,e,r,s);if(o){const n=t.$_createError(o.code,e,o.context,r,s);if(s.abortEarly){return{value:e,errors:n}}i.push(n)}}}return{value:e,errors:i}},rules:{and:{method(...e){l.verifyFlat(e,"and");return m.dependency(this,"and",null,e)}},append:{method(e){if(e===null||e===undefined||Object.keys(e).length===0){return this}return this.keys(e)}},assert:{method(e,t,n){if(!d.isTemplate(e)){e=c.ref(e)}s(n===undefined||typeof n==="string","Message must be a string");t=this.$_compile(t,{appendPath:true});const r=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:n}});r.$_mutateRegister(e);r.$_mutateRegister(t);return r},validate(e,{error:t,prefs:n,state:r},{subject:s,schema:i,message:o}){const a=s.resolve(e,r,n);const l=f.isRef(s)?s.absolute(r):[];if(i.$_match(a,r.localize(l,[e,...r.ancestors],i),n)){return e}return t("object.assert",{subject:s,message:o})},args:["subject","schema","message"],multi:true},instance:{method(e,t){s(typeof e==="function","constructor must be a function");t=t||e.name;return this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate(e,t,{constructor:n,name:r}){if(e instanceof n){return e}return t.error("object.instance",{type:r,value:e})},args:["constructor","name"]},keys:{method(e){s(e===undefined||typeof e==="object","Object schema must be a valid object");s(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(!e){t.$_terms.keys=null}else if(!Object.keys(e).length){t.$_terms.keys=[]}else{t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter(t=>!e.hasOwnProperty(t.key)):[];for(const n in e){l.tryWithPath(()=>t.$_terms.keys.push({key:n,schema:this.$_compile(e[n])}),n)}}return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,{limit:n},{name:r,operator:s,args:i}){if(l.compare(Object.keys(e).length,n,s)){return e}return t.error("object."+r,{limit:i.limit,value:e})},args:[{name:"limit",ref:true,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(...e){l.verifyFlat(e,"nand");return m.dependency(this,"nand",null,e)}},or:{method(...e){l.verifyFlat(e,"or");return m.dependency(this,"or",null,e)}},oxor:{method(...e){return m.dependency(this,"oxor",null,e)}},pattern:{method(e,t,n={}){const r=e instanceof RegExp;if(!r){e=this.$_compile(e,{appendPath:true})}s(t!==undefined,"Invalid rule");l.assertOptions(n,["fallthrough","matches"]);if(r){s(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode")}t=this.$_compile(t,{appendPath:true});const i=this.clone();i.$_terms.patterns=i.$_terms.patterns||[];const o={[r?"regex":"schema"]:e,rule:t};if(n.matches){o.matches=this.$_compile(n.matches);if(o.matches.type!=="array"){o.matches=o.matches.$_root.array().items(o.matches)}i.$_mutateRegister(o.matches);i.$_setFlag("_hasPatternMatch",true,{clone:false})}if(n.fallthrough){o.fallthrough=true}i.$_terms.patterns.push(o);i.$_mutateRegister(t);return i}},ref:{method(){return this.$_addRule("ref")},validate(e,t){if(f.isRef(e)){return e}return t.error("object.refType",{value:e})}},rename:{method(e,t,n={}){s(typeof e==="string"||e instanceof RegExp,"Rename missing the from argument");s(typeof t==="string"||t instanceof d,"Invalid rename to argument");s(t!==e,"Cannot rename key to same name:",e);l.assertOptions(n,["alias","ignoreUndefined","override","multiple"]);const i=this.clone();i.$_terms.renames=i.$_terms.renames||[];for(const t of i.$_terms.renames){s(t.from!==e,"Cannot rename the same key multiple times")}if(t instanceof d){i.$_mutateRegister(t)}i.$_terms.renames.push({from:e,to:t,options:r(m.renameDefaults,n)});return i}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate(e,t,{type:n}){if(l.isSchema(e)&&(n==="any"||e.type===n)){return e}return t.error("object.schema",{type:n})}},unknown:{method(e){return this.$_setFlag("unknown",e!==false)}},with:{method(e,t,n={}){return m.dependency(this,"with",e,t,n)}},without:{method(e,t,n={}){return m.dependency(this,"without",e,t,n)}},xor:{method(...e){l.verifyFlat(e,"xor");return m.dependency(this,"xor",null,e)}}},overrides:{default(e,t){if(e===undefined){e=l.symbols.deepDefault}return this.$_super.default(e,t)}},rebuild(e){if(e.$_terms.keys){const t=new o;for(const n of e.$_terms.keys){l.tryWithPath(()=>t.add(n,{after:n.schema.$_rootReferences(),group:n.key}),n.key)}e.$_terms.keys=new m.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys){e=e.keys(t.keys)}if(t.dependencies){for(const{rel:n,key:r=null,peers:s,options:i}of t.dependencies){e=m.dependency(e,n,r,s,i)}}if(t.patterns){for(const{regex:n,schema:r,rule:s,fallthrough:i,matches:o}of t.patterns){e=e.pattern(n||r,s,{fallthrough:i,matches:o})}}if(t.renames){for(const{from:n,to:r,options:s}of t.renames){e=e.rename(n,r,s)}}return e}},messages:{"object.and":'"{{#label}}" contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}',"object.assert":'"{{#label}}" is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":'"{{#label}}" must be of type {{#type}}',"object.instance":'"{{#label}}" must be an instance of "{{#type}}"',"object.length":'"{{#label}}" must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'"{{#label}}" must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'"{{#label}}" must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":'"{{#label}}" must contain at least one of {{#peersWithLabels}}',"object.nand":'"{{#mainWithLabel}}" must not exist simultaneously with {{#peersWithLabels}}',"object.oxor":'"{{#label}}" contains a conflict between optional exclusive peers {{#peersWithLabels}}',"object.pattern.match":'"{{#label}}" keys failed to match pattern requirements',"object.refType":'"{{#label}}" must be a Joi reference',"object.rename.multiple":'"{{#label}}" cannot rename "{{#from}}" because multiple renames are disabled and another key was already renamed to "{{#to}}"',"object.rename.override":'"{{#label}}" cannot rename "{{#from}}" because override is disabled and target "{{#to}}" exists',"object.schema":'"{{#label}}" must be a Joi schema of {{#type}} type',"object.unknown":'"{{#label}}" is not allowed',"object.with":'"{{#mainWithLabel}}" missing required peer "{{#peerWithLabel}}"',"object.without":'"{{#mainWithLabel}}" conflict with forbidden peer "{{#peerWithLabel}}"',"object.xor":'"{{#label}}" contains a conflict between exclusive peers {{#peersWithLabels}}'}});m.clone=function(e,t){if(typeof e==="object"){if(t.nonEnumerables){return i(e,{shallow:true})}const n=Object.create(Object.getPrototypeOf(e));Object.assign(n,e);return n}const n=function(...t){return e.apply(this,t)};n.prototype=i(e.prototype);Object.defineProperty(n,"name",{value:e.name,writable:false});Object.defineProperty(n,"length",{value:e.length,writable:false});Object.assign(n,e);return n};m.dependency=function(e,t,n,r,i){s(n===null||typeof n==="string",t,"key must be a strings");if(!i){i=r.length>1&&typeof r[r.length-1]==="object"?r.pop():{}}l.assertOptions(i,["separator"]);r=[].concat(r);const o=l.default(i.separator,".");const a=[];for(const e of r){s(typeof e==="string",t,"peers must be a string or a reference");a.push(c.ref(e,{separator:o,ancestor:0,prefix:false}))}if(n!==null){n=c.ref(n,{separator:o,ancestor:0,prefix:false})}const u=e.clone();u.$_terms.dependencies=u.$_terms.dependencies||[];u.$_terms.dependencies.push(new m.Dependency(t,n,a,r));return u};m.dependencies={and(e,t,n,r,s){const i=[];const o=[];const a=t.peers.length;for(const e of t.peers){if(e.resolve(n,r,s,null,{shadow:false})===undefined){i.push(e.key)}else{o.push(e.key)}}if(i.length!==a&&o.length!==a){return{code:"object.and",context:{present:o,presentWithLabels:m.keysToLabels(e,o),missing:i,missingWithLabels:m.keysToLabels(e,i)}}}},nand(e,t,n,r,s){const i=[];for(const e of t.peers){if(e.resolve(n,r,s,null,{shadow:false})!==undefined){i.push(e.key)}}if(i.length!==t.peers.length){return}const o=t.paths[0];const a=t.paths.slice(1);return{code:"object.nand",context:{main:o,mainWithLabel:m.keysToLabels(e,o),peers:a,peersWithLabels:m.keysToLabels(e,a)}}},or(e,t,n,r,s){for(const e of t.peers){if(e.resolve(n,r,s,null,{shadow:false})!==undefined){return}}return{code:"object.missing",context:{peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)}}},oxor(e,t,n,r,s){const i=[];for(const e of t.peers){if(e.resolve(n,r,s,null,{shadow:false})!==undefined){i.push(e.key)}}if(!i.length||i.length===1){return}const o={peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)};o.present=i;o.presentWithLabels=m.keysToLabels(e,i);return{code:"object.oxor",context:o}},with(e,t,n,r,s){for(const i of t.peers){if(i.resolve(n,r,s,null,{shadow:false})===undefined){return{code:"object.with",context:{main:t.key.key,mainWithLabel:m.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:m.keysToLabels(e,i.key)}}}}},without(e,t,n,r,s){for(const i of t.peers){if(i.resolve(n,r,s,null,{shadow:false})!==undefined){return{code:"object.without",context:{main:t.key.key,mainWithLabel:m.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:m.keysToLabels(e,i.key)}}}}},xor(e,t,n,r,s){const i=[];for(const e of t.peers){if(e.resolve(n,r,s,null,{shadow:false})!==undefined){i.push(e.key)}}if(i.length===1){return}const o={peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)};if(i.length===0){return{code:"object.missing",context:o}}o.present=i;o.presentWithLabels=m.keysToLabels(e,i);return{code:"object.xor",context:o}}};m.keysToLabels=function(e,t){if(Array.isArray(t)){return t.map(t=>e.$_mapLabels(t))}return e.$_mapLabels(t)};m.rename=function(e,t,n,r,s){const i={};for(const o of e.$_terms.renames){const a=[];const l=typeof o.from!=="string";if(!l){if(Object.prototype.hasOwnProperty.call(t,o.from)&&(t[o.from]!==undefined||!o.options.ignoreUndefined)){a.push(o)}}else{for(const e in t){if(t[e]===undefined&&o.options.ignoreUndefined){continue}if(e===o.to){continue}const n=o.from.exec(e);if(!n){continue}a.push({from:e,to:o.to,match:n})}}for(const c of a){const a=c.from;let u=c.to;if(u instanceof d){u=u.render(t,n,r,c.match)}if(a===u){continue}if(!o.options.multiple&&i[u]){s.push(e.$_createError("object.rename.multiple",t,{from:a,to:u,pattern:l},n,r));if(r.abortEarly){return false}}if(Object.prototype.hasOwnProperty.call(t,u)&&!o.options.override&&!i[u]){s.push(e.$_createError("object.rename.override",t,{from:a,to:u,pattern:l},n,r));if(r.abortEarly){return false}}if(t[a]===undefined){delete t[u]}else{t[u]=t[a]}i[u]=true;if(!o.options.alias){delete t[a]}}}return true};m.unknown=function(e,t,n,r,s,i){if(e.$_terms.patterns){let o=false;const a=e.$_terms.patterns.map(e=>{if(e.matches){o=true;return[]}});const l=[t,...s.ancestors];for(const o of n){const c=t[o];const u=[...s.path,o];for(let f=0;f<e.$_terms.patterns.length;++f){const d=e.$_terms.patterns[f];if(d.regex){const e=d.regex.test(o);s.mainstay.tracer.debug(s,"rule",`pattern.${f}`,e?"pass":"error");if(!e){continue}}else{if(!d.schema.$_match(o,s.nest(d.schema,`pattern.${f}`),i)){continue}}n.delete(o);const m=s.localize(u,l,{schema:d.rule,key:o});const h=d.rule.$_validate(c,m,i);if(h.errors){if(i.abortEarly){return{value:t,errors:h.errors}}r.push(...h.errors)}if(d.matches){a[f].push(o)}t[o]=h.value;if(!d.fallthrough){break}}}if(o){for(let n=0;n<a.length;++n){const o=a[n];if(!o){continue}const c=e.$_terms.patterns[n].matches;const f=s.localize(s.path,l,c);const d=c.$_validate(o,f,i);if(d.errors){const n=u.details(d.errors,{override:false});n.matches=o;const a=e.$_createError("object.pattern.match",t,n,s,i);if(i.abortEarly){return{value:t,errors:a}}r.push(a)}}}}if(!n.size||!e.$_terms.keys&&!e.$_terms.patterns){return}if(i.stripUnknown&&!e._flags.unknown||i.skipFunctions){const e=i.stripUnknown?i.stripUnknown===true?true:!!i.stripUnknown.objects:false;for(const r of n){if(e){delete t[r];n.delete(r)}else if(typeof t[r]==="function"){n.delete(r)}}}const o=!l.default(e._flags.unknown,i.allowUnknown);if(o){for(const o of n){const n=s.localize([...s.path,o],[]);const a=e.$_createError("object.unknown",t[o],{child:o},n,i,{flags:false});if(i.abortEarly){return{value:t,errors:a}}r.push(a)}}};m.Dependency=class{constructor(e,t,n,r){this.rel=e;this.key=t;this.peers=n;this.paths=r}describe(){const e={rel:this.rel,peers:this.paths};if(this.key!==null){e.key=this.key.key}if(this.peers[0].separator!=="."){e.options={separator:this.peers[0].separator}}return e}};m.Keys=class extends Array{concat(e){const t=this.slice();const n=new Map;for(let e=0;e<t.length;++e){n.set(t[e].key,e)}for(const r of e){const e=r.key;const s=n.get(e);if(s!==undefined){t[s]={key:e,schema:t[s].schema.concat(r.schema)}}else{t.push(r)}}return t}}},9713:(e,t,n)=>{const r=n(2718);const s=n(6866);const i=n(3221);const o=n(3579);const a=n(2150);const l={};e.exports=s.extend({type:"link",properties:{schemaChain:true},terms:{link:{init:null,manifest:"single",register:false}},args(e,t){return e.ref(t)},validate(e,{schema:t,state:n,prefs:s}){r(t.$_terms.link,"Uninitialized link schema");const i=l.generate(t,e,n,s);const o=t.$_terms.link[0].ref;return i.$_validate(e,n.nest(i,`link:${o.display}:${i.type}`),s)},generate(e,t,n,r){return l.generate(e,t,n,r)},rules:{ref:{method(e){r(!this.$_terms.link,"Cannot reinitialize schema");e=o.ref(e);r(e.type==="value"||e.type==="local","Invalid reference type:",e.type);r(e.type==="local"||e.ancestor==="root"||e.ancestor>0,"Link cannot reference itself");const t=this.clone();t.$_terms.link=[{ref:e}];return t}},relative:{method(e=true){return this.$_setFlag("relative",e)}}},overrides:{concat(e){r(this.$_terms.link,"Uninitialized link schema");r(i.isSchema(e),"Invalid schema object");r(e.type!=="link","Cannot merge type link with another link");const t=this.clone();if(!t.$_terms.whens){t.$_terms.whens=[]}t.$_terms.whens.push({concat:e});return t.$_mutateRebuild()}},manifest:{build(e,t){r(t.link,"Invalid link description missing link");return e.ref(t.link)}}});l.generate=function(e,t,n,r){let s=n.mainstay.links.get(e);if(s){return s._generate(t,n,r).schema}const i=e.$_terms.link[0].ref;const{perspective:o,path:a}=l.perspective(i,n);l.assert(o,"which is outside of schema boundaries",i,e,n,r);try{s=a.length?o.$_reach(a):o}catch(t){l.assert(false,"to non-existing schema",i,e,n,r)}l.assert(s.type!=="link","which is another link",i,e,n,r);if(!e._flags.relative){n.mainstay.links.set(e,s)}return s._generate(t,n,r).schema};l.perspective=function(e,t){if(e.type==="local"){for(const{schema:n,key:r}of t.schemas){const t=n._flags.id||r;if(t===e.path[0]){return{perspective:n,path:e.path.slice(1)}}if(n.$_terms.shared){for(const t of n.$_terms.shared){if(t._flags.id===e.path[0]){return{perspective:t,path:e.path.slice(1)}}}}}return{perspective:null,path:null}}if(e.ancestor==="root"){return{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}}return{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}};l.assert=function(e,t,n,s,i,o){if(e){return}r(false,`"${a.label(s._flags,i,o)}" contains link reference "${n.display}" ${t}`)}},3730:(e,t,n)=>{const r=n(2718);const s=n(6866);const i=n(3221);const o={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/};e.exports=s.extend({type:"number",flags:{unsafe:{default:false}},coerce:{from:"string",method(e,{schema:t,error:n}){const r=e.match(o.numberRx);if(!r){return}e=e.trim();const s={value:parseFloat(e)};if(s.value===0){s.value=0}if(!t._flags.unsafe){if(e.match(/e/i)){const t=o.normalizeExponent(`${s.value/Math.pow(10,r[1])}e${r[1]}`);if(t!==o.normalizeExponent(e)){s.errors=n("number.unsafe");return s}}else{const t=s.value.toString();if(t.match(/e/i)){return s}if(t!==o.normalizeDecimal(e)){s.errors=n("number.unsafe");return s}}}return s}},validate(e,{schema:t,error:n,prefs:r}){if(e===Infinity||e===-Infinity){return{value:e,errors:n("number.infinity")}}if(!i.isNumber(e)){return{value:e,errors:n("number.base")}}const s={value:e};if(r.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);s.value=Math.round(s.value*t)/t}}if(s.value===0){s.value=0}if(!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)){s.errors=n("number.unsafe")}return s},rules:{compare:{method:false,validate(e,t,{limit:n},{name:r,operator:s,args:o}){if(i.compare(e,n,s)){return e}return t.error("number."+r,{limit:o.limit,value:e})},args:[{name:"limit",ref:true,assert:i.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate(e,t){if(Math.trunc(e)-e===0){return e}return t.error("number.integer")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate(e,t,{base:n},r){if(e%n===0){return e}return t.error("number.multiple",{multiple:r.args.base,value:e})},args:[{name:"base",ref:true,assert:e=>typeof e==="number"&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:true},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate(e,t){if(Number.isSafeInteger(e)&&e>=0&&e<=65535){return e}return t.error("number.port")}},positive:{method(){return this.sign("positive")}},precision:{method(e){r(Number.isSafeInteger(e),"limit must be an integer");return this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,{limit:n}){const r=e.toString().match(o.precisionRx);const s=Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0);if(s<=n){return e}return t.error("number.precision",{limit:n,value:e})},convert:true},sign:{method(e){r(["negative","positive"].includes(e),"Invalid sign",e);return this.$_addRule({name:"sign",args:{sign:e}})},validate(e,t,{sign:n}){if(n==="negative"&&e<0||n==="positive"&&e>0){return e}return t.error(`number.${n}`)}},unsafe:{method(e=true){r(typeof e==="boolean","enabled must be a boolean");return this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e==="number",to(e,t){return e.toString()}}},messages:{"number.base":'"{{#label}}" must be a number',"number.greater":'"{{#label}}" must be greater than {{#limit}}',"number.infinity":'"{{#label}}" cannot be infinity',"number.integer":'"{{#label}}" must be an integer',"number.less":'"{{#label}}" must be less than {{#limit}}',"number.max":'"{{#label}}" must be less than or equal to {{#limit}}',"number.min":'"{{#label}}" must be larger than or equal to {{#limit}}',"number.multiple":'"{{#label}}" must be a multiple of {{#multiple}}',"number.negative":'"{{#label}}" must be a negative number',"number.port":'"{{#label}}" must be a valid port',"number.positive":'"{{#label}}" must be a positive number',"number.precision":'"{{#label}}" must have no more than {{#limit}} decimal places',"number.unsafe":'"{{#label}}" must be a safe number'}});o.normalizeExponent=function(e){return e.replace(/E/,"e").replace(/\.(\d*[1-9])?0+e/,".$1e").replace(/\.e/,"e").replace(/e\+/,"e").replace(/^\+/,"").replace(/^(-?)0+([1-9])/,"$1$2")};o.normalizeDecimal=function(e){e=e.replace(/^\+/,"").replace(/\.0+$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([1-9])/,"$1$2");if(e.includes(".")&&e.endsWith("0")){e=e.replace(/0+$/,"")}if(e==="-0"){return"0"}return e}},1443:(e,t,n)=>{const r=n(1732);const s={};e.exports=r.extend({type:"object",cast:{map:{from:e=>e&&typeof e==="object",to(e,t){return new Map(Object.entries(e))}}}})},7769:(e,t,n)=>{const r=n(2718);const s=n(5541);const i=n(7318);const o=n(1965);const a=n(5026);const l=n(6866);const c=n(3221);const u=n(8751);const f=n(18);const d={tlds:a instanceof Set?{tlds:{allow:a,deny:null}}:false,base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,hostRegex:/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/,ipRegex:u.createIpRegex(["ipv4","ipv6","ipvfuture"],"optional"),isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},cidrPresences:["required","optional","forbidden"],normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=l.extend({type:"string",flags:{insensitive:{default:false},truncate:{default:false}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:n,prefs:r}){const s=t.$_getRule("normalize");if(s){e=e.normalize(s.args.form)}const i=t.$_getRule("case");if(i){e=i.args.direction==="upper"?e.toLocaleUpperCase():e.toLocaleLowerCase()}const o=t.$_getRule("trim");if(o&&o.args.enabled){e=e.trim()}if(t.$_terms.replacements){for(const n of t.$_terms.replacements){e=e.replace(n.pattern,n.replacement)}}const a=t.$_getRule("hex");if(a&&a.args.options.byteAligned&&e.length%2!==0){e=`0${e}`}if(t.$_getRule("isoDate")){const t=d.isoDate(e);if(t){e=t}}if(t._flags.truncate){const s=t.$_getRule("max");if(s){let i=s.args.limit;if(c.isResolvable(i)){i=i.resolve(e,n,r);if(!c.limit(i)){return{value:e,errors:t.$_createError("any.ref",i,{ref:s.args.limit,arg:"limit",reason:"must be a positive integer"},n,r)}}}e=e.slice(0,i)}}return{value:e}}},validate(e,{error:t}){if(typeof e!=="string"){return{value:e,errors:t("string.base")}}if(e===""){return{value:e,errors:t("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate(e,t){if(/^[a-zA-Z0-9]+$/.test(e)){return e}return t.error("string.alphanum")}},base64:{method(e={}){c.assertOptions(e,["paddingRequired","urlSafe"]);e={urlSafe:false,paddingRequired:true,...e};r(typeof e.paddingRequired==="boolean","paddingRequired must be boolean");r(typeof e.urlSafe==="boolean","urlSafe must be boolean");return this.$_addRule({name:"base64",args:{options:e}})},validate(e,t,{options:n}){const r=d.base64Regex[n.paddingRequired][n.urlSafe];if(r.test(e)){return e}return t.error("string.base64")}},case:{method(e){r(["lower","upper"].includes(e),"Invalid case:",e);return this.$_addRule({name:"case",args:{direction:e}})},validate(e,t,{direction:n}){if(n==="lower"&&e===e.toLocaleLowerCase()||n==="upper"&&e===e.toLocaleUpperCase()){return e}return t.error(`string.${n}case`)},convert:true},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let n=e.length;let r=0;let s=1;while(n--){const t=e.charAt(n)*s;r=r+(t-(t>9)*9);s=s^3}if(r>0&&r%10===0){return e}return t.error("string.creditCard")}},dataUri:{method(e={}){c.assertOptions(e,["paddingRequired"]);e={paddingRequired:true,...e};r(typeof e.paddingRequired==="boolean","paddingRequired must be boolean");return this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,{options:n}){const r=e.match(d.dataUriRegex);if(r){if(!r[2]){return e}if(r[2]!=="base64"){return e}const t=d.base64Regex[n.paddingRequired].false;if(t.test(r[3])){return e}}return t.error("string.dataUri")}},domain:{method(e){if(e){c.assertOptions(e,["allowUnicode","minDomainSegments","tlds"])}const t=d.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate(e,t,n,{address:r}){if(s.isValid(e,r)){return e}return t.error("string.domain")}},email:{method(e={}){c.assertOptions(e,["allowUnicode","ignoreLength","minDomainSegments","multiple","separator","tlds"]);r(e.multiple===undefined||typeof e.multiple==="boolean","multiple option must be an boolean");const t=d.addressOptions(e);const n=new RegExp(`\\s*[${e.separator?o(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:n,address:t})},validate(e,t,{options:n},{regex:r,address:s}){const o=n.multiple?e.split(r):[e];const a=[];for(const e of o){if(!i.isValid(e,s)){a.push(e)}}if(!a.length){return e}return t.error("string.email",{value:e,invalids:a})}},guid:{alias:"uuid",method(e={}){c.assertOptions(e,["version"]);let t="";if(e.version){const n=[].concat(e.version);r(n.length>=1,"version must have at least 1 valid version specified");const s=new Set;for(let e=0;e<n.length;++e){const i=n[e];r(typeof i==="string","version at position "+e+" must be a string");const o=d.guidVersions[i.toLowerCase()];r(o,"version at position "+e+" must be one of "+Object.keys(d.guidVersions).join(", "));r(!s.has(o),"version at position "+e+" must not be a duplicate");t+=o;s.add(o)}}const n=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}([:-]?)[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:n})},validate(e,t,n,{regex:r}){const s=r.exec(e);if(!s){return t.error("string.guid")}if(d.guidBrackets[s[1]]!==s[s.length-1]){return t.error("string.guid")}return e}},hex:{method(e={}){c.assertOptions(e,["byteAligned"]);e={byteAligned:false,...e};r(typeof e.byteAligned==="boolean","byteAligned must be boolean");return this.$_addRule({name:"hex",args:{options:e}})},validate(e,t,{options:n}){if(!d.hexRegex.test(e)){return t.error("string.hex")}if(n.byteAligned&&e.length%2!==0){return t.error("string.hexAlign")}return e}},hostname:{method(){return this.$_addRule("hostname")},validate(e,t){if(e.length<=255&&d.hostRegex.test(e)||d.ipRegex.test(e)){return e}return t.error("string.hostname")}},insensitive:{method(){return this.$_setFlag("insensitive",true)}},ip:{method(e={}){c.assertOptions(e,["cidr","version"]);e=Object.assign({},e);let t=d.ipRegex;if(e.cidr){r(typeof e.cidr==="string","cidr must be a string");e.cidr=e.cidr.toLowerCase();r(d.cidrPresences.includes(e.cidr),"cidr must be one of "+d.cidrPresences.join(", "));if(!e.version&&e.cidr!=="optional"){t=u.createIpRegex(["ipv4","ipv6","ipvfuture"],e.cidr)}}else{e.cidr="optional"}let n;if(e.version){if(!Array.isArray(e.version)){e.version=[e.version]}r(e.version.length>=1,"version must have at least 1 version specified");n=[];for(let t=0;t<e.version.length;++t){let s=e.version[t];r(typeof s==="string","version at position "+t+" must be a string");s=s.toLowerCase();r(u.versions[s],"version at position "+t+" must be one of "+Object.keys(u.versions).join(", "));n.push(s)}n=Array.from(new Set(n));t=u.createIpRegex(n,e.cidr)}return this.$_addRule({name:"ip",args:{options:e},versions:n,regex:t})},validate(e,t,{options:n},{versions:r,regex:s}){if(s.test(e)){return e}if(r){return t.error("string.ipVersion",{value:e,cidr:n.cidr,version:r})}return t.error("string.ip",{value:e,cidr:n.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(e,{error:t}){if(d.isoDate(e)){return e}return t("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate(e,t){if(d.isoDurationRegex.test(e)){return e}return t.error("string.isoDuration")}},length:{method(e,t){return d.length(this,"length",e,"=",t)},validate(e,t,{limit:n,encoding:r},{name:s,operator:i,args:o}){const a=r?Buffer&&Buffer.byteLength(e,r):e.length;if(c.compare(a,n,i)){return e}return t.error("string."+s,{limit:o.limit,value:e,encoding:r})},args:[{name:"limit",ref:true,assert:c.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return d.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return d.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){r(d.normalizationForms.includes(e),"normalization form must be one of "+d.normalizationForms.join(", "));return this.$_addRule({name:"normalize",args:{form:e}})},validate(e,{error:t},{form:n}){if(e===e.normalize(n)){return e}return t("string.normalize",{value:e,form:n})},convert:true},pattern:{alias:"regex",method(e,t={}){r(e instanceof RegExp,"regex must be a RegExp");r(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode");if(typeof t==="string"){t={name:t}}c.assertOptions(t,["invert","name"]);const n=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:n})},validate(e,t,{regex:n,options:r},{errorCode:s}){const i=n.test(e);if(i^r.invert){return e}return t.error(s,{name:r.name,regex:n,value:e})},args:["regex","options"],multi:true},replace:{method(e,t){if(typeof e==="string"){e=new RegExp(o(e),"g")}r(e instanceof RegExp,"pattern must be a RegExp");r(typeof t==="string","replacement must be a String");const n=this.clone();if(!n.$_terms.replacements){n.$_terms.replacements=[]}n.$_terms.replacements.push({pattern:e,replacement:t});return n}},token:{method(){return this.$_addRule("token")},validate(e,t){if(/^\w+$/.test(e)){return e}return t.error("string.token")}},trim:{method(e=true){r(typeof e==="boolean","enabled must be a boolean");return this.$_addRule({name:"trim",args:{enabled:e}})},validate(e,t,{enabled:n}){if(!n||e===e.trim()){return e}return t.error("string.trim")},convert:true},truncate:{method(e=true){r(typeof e==="boolean","enabled must be a boolean");return this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){c.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]);if(e.domain){c.assertOptions(e.domain,["allowUnicode","minDomainSegments","tlds"])}const t=f.createRegex(e);const n=e.domain?d.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n})},validate(e,t,{options:n},{regex:r,domain:i}){if(["http:/","https:/"].includes(e)){return t.error("string.uri")}const o=r.exec(e);if(o){if(i&&!s.isValid(o[1],i)){return t.error("string.domain",{value:o[1]})}return e}if(n.relativeOnly){return t.error("string.uriRelativeOnly")}if(n.scheme){return t.error("string.uriCustomScheme",{scheme:r.scheme,value:e})}return t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements){for(const{pattern:n,replacement:r}of t.replacements){e=e.replace(n,r)}}return e}},messages:{"string.alphanum":'"{{#label}}" must only contain alpha-numeric characters',"string.base":'"{{#label}}" must be a string',"string.base64":'"{{#label}}" must be a valid base64 string',"string.creditCard":'"{{#label}}" must be a credit card',"string.dataUri":'"{{#label}}" must be a valid dataUri string',"string.domain":'"{{#label}}" must contain a valid domain name',"string.email":'"{{#label}}" must be a valid email',"string.empty":'"{{#label}}" is not allowed to be empty',"string.guid":'"{{#label}}" must be a valid GUID',"string.hex":'"{{#label}}" must only contain hexadecimal characters',"string.hexAlign":'"{{#label}}" hex decoded representation must be byte aligned',"string.hostname":'"{{#label}}" must be a valid hostname',"string.ip":'"{{#label}}" must be a valid ip address with a {{#cidr}} CIDR',"string.ipVersion":'"{{#label}}" must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR',"string.isoDate":'"{{#label}}" must be in iso format',"string.isoDuration":'"{{#label}}" must be a valid ISO 8601 duration',"string.length":'"{{#label}}" length must be {{#limit}} characters long',"string.lowercase":'"{{#label}}" must only contain lowercase characters',"string.max":'"{{#label}}" length must be less than or equal to {{#limit}} characters long',"string.min":'"{{#label}}" length must be at least {{#limit}} characters long',"string.normalize":'"{{#label}}" must be unicode normalized in the {{#form}} form',"string.token":'"{{#label}}" must only contain alpha-numeric and underscore characters',"string.pattern.base":'"{{#label}}" with value "{[.]}" fails to match the required pattern: {{#regex}}',"string.pattern.name":'"{{#label}}" with value "{[.]}" fails to match the {{#name}} pattern',"string.pattern.invert.base":'"{{#label}}" with value "{[.]}" matches the inverted pattern: {{#regex}}',"string.pattern.invert.name":'"{{#label}}" with value "{[.]}" matches the inverted {{#name}} pattern',"string.trim":'"{{#label}}" must not have leading or trailing whitespace',"string.uri":'"{{#label}}" must be a valid uri',"string.uriCustomScheme":'"{{#label}}" must be a valid uri with a scheme matching the {{#scheme}} pattern',"string.uriRelativeOnly":'"{{#label}}" must be a valid relative uri',"string.uppercase":'"{{#label}}" must only contain uppercase characters'}});d.addressOptions=function(e){if(!e){return e}r(e.minDomainSegments===undefined||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer");if(e.tlds===false){return e}if(e.tlds===true||e.tlds===undefined){r(d.tlds,"Built-in TLD list disabled");return Object.assign({},e,d.tlds)}r(typeof e.tlds==="object","tlds must be true, false, or an object");const t=e.tlds.deny;if(t){if(Array.isArray(t)){e=Object.assign({},e,{tlds:{deny:new Set(t)}})}r(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean");r(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists");return e}const n=e.tlds.allow;if(!n){return e}if(n===true){r(d.tlds,"Built-in TLD list disabled");return Object.assign({},e,d.tlds)}if(Array.isArray(n)){e=Object.assign({},e,{tlds:{allow:new Set(n)}})}r(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean");return e};d.isoDate=function(e){if(!c.isIsoDate(e)){return null}const t=new Date(e);if(isNaN(t.getTime())){return null}return t.toISOString()};d.length=function(e,t,n,s,i){r(!i||Buffer&&Buffer.isEncoding(i),"Invalid encoding:",i);return e.$_addRule({name:t,method:"length",args:{limit:n,encoding:i},operator:s})}},8751:(e,t,n)=>{const r=n(18);const s={};t.cidrs={ipv4:{required:"\\/(?:"+r.ipv4Cidr+")",optional:"(?:\\/(?:"+r.ipv4Cidr+"))?",forbidden:""},ipv6:{required:"\\/"+r.ipv6Cidr,optional:"(?:\\/"+r.ipv6Cidr+")?",forbidden:""},ipvfuture:{required:"\\/"+r.ipv6Cidr,optional:"(?:\\/"+r.ipv6Cidr+")?",forbidden:""}};t.versions={ipv4:r.ipv4address,ipv6:r.ipv6address,ipvfuture:r.ipvFuture};t.createIpRegex=function(e,n){const r=e.map(e=>t.versions[e]+t.cidrs[e][n]);return new RegExp("^(?:"+r.join("|")+")$")}},18:(e,t,n)=>{const r=n(2718);const s=n(1965);const i={};i.generate=function(){const e={};const t="\\dA-Fa-f";const n="["+t+"]";const r="\\w-\\.~";const s="!\\$&'\\(\\)\\*\\+,;=";const i="%"+t;const o=r+i+s+":@";const a="["+o+"]";const l="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+l+"\\.){3}"+l;const c=n+"{1,4}";const u="(?:"+c+":"+c+"|"+e.ipv4address+")";const f="(?:"+c+":){6}"+u;const d="::(?:"+c+":){5}"+u;const m="(?:"+c+")?::(?:"+c+":){4}"+u;const h="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+u;const p="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+u;const g="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+u;const y="(?:(?:"+c+":){0,4}"+c+")?::"+u;const b="(?:(?:"+c+":){0,5}"+c+")?::"+c;const _="(?:(?:"+c+":){0,6}"+c+")?::";e.ipv4Cidr="\\d|[1-2]\\d|3[0-2]";e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])";e.ipv6address="(?:"+f+"|"+d+"|"+m+"|"+h+"|"+p+"|"+g+"|"+y+"|"+b+"|"+_+")";e.ipvFuture="v"+n+"+\\.["+r+s+":]+";e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*";e.schemeRegex=new RegExp(e.scheme);const A="["+r+i+s+":]*";const E="\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]";const v="["+r+i+s+"]{1,255}";const R="(?:"+E+"|"+e.ipv4address+"|"+v+")";const S="\\d*";const O="(?:"+A+"@)?"+R+"(?::"+S+")?";const N="(?:"+A+"@)?("+R+")(?::"+S+")?";const I=a+"*";const $=a+"+";const T="["+r+i+s+"@"+"]+";const w="";const C="(?:\\/"+I+")*";const L="\\/(?:"+$+C+")?";const x=$+C;const B=T+C;const D="(?:\\/\\/\\/"+I+C+")";e.hierPart="(?:"+"(?:\\/\\/"+O+C+")"+"|"+L+"|"+x+"|"+D+")";e.hierPartCapture="(?:"+"(?:\\/\\/"+N+C+")"+"|"+L+"|"+x+")";e.relativeRef="(?:"+"(?:\\/\\/"+O+C+")"+"|"+L+"|"+B+"|"+w+")";e.query="["+o+"\\/\\?]*(?=#|$)";e.queryWithSquareBrackets="["+o+"\\[\\]\\/\\?]*(?=#|$)";e.fragment="["+o+"\\/\\?]*";return e};e.exports=t=i.rfc3986=i.generate();i.createRegex=function(e){const t=i.rfc3986;const n=e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query;const o="(?:\\?"+n+")?"+"(?:#"+t.fragment+")?$";if(e.relativeOnly){return new RegExp("^"+t.relativeRef+o)}let a="";if(e.scheme){r(e.scheme instanceof RegExp||typeof e.scheme==="string"||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const n=[].concat(e.scheme);r(n.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let e=0;e<n.length;++e){const o=n[e];r(o instanceof RegExp||typeof o==="string","scheme at position "+e+" must be a RegExp or String");if(o instanceof RegExp){i.push(o.source.toString())}else{r(t.schemeRegex.test(o),"scheme at position "+e+" must be a valid scheme");i.push(s(o))}}a=i.join("|")}const l=a?"(?:"+a+")":t.scheme;const c="(?:"+l+":"+(e.domain?t.hierPartCapture:t.hierPart)+")";const u=e.allowRelative?"(?:"+c+"|"+t.relativeRef+")":c;const f=new RegExp("^"+u+o);f.scheme=a;return f};i.uriRegex=i.createRegex({});t.createRegex=function(e={}){if(e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain){return i.createRegex(e)}return i.uriRegex}},9737:(e,t,n)=>{const r=n(2718);const s=n(6866);const i={};i.Map=class extends Map{slice(){return new i.Map(this)}};e.exports=s.extend({type:"symbol",terms:{map:{init:new i.Map}},coerce:{method(e,{schema:t,error:n}){const r=t.$_terms.map.get(e);if(r){e=r}if(!t._flags.only||typeof e==="symbol"){return{value:e}}return{value:e,errors:n("symbol.map",{map:t.$_terms.map})}}},validate(e,{error:t}){if(typeof e!=="symbol"){return{value:e,errors:t("symbol.base")}}},rules:{map:{method(e){if(e&&!e[Symbol.iterator]&&typeof e==="object"){e=Object.entries(e)}r(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone();const n=[];for(const s of e){r(s&&s[Symbol.iterator],"Entry must be an iterable");const[e,i]=s;r(typeof e!=="object"&&typeof e!=="function"&&typeof e!=="symbol","Key must not be of type object, function, or Symbol");r(typeof i==="symbol","Value must be a Symbol");t.$_terms.map.set(e,i);n.push(i)}return t.valid(...n)}}},manifest:{build(e,t){if(t.map){e=e.map(t.map)}return e}},messages:{"symbol.base":'"{{#label}}" must be a symbol',"symbol.map":'"{{#label}}" must be one of {{#map}}'}})},9862:(e,t,n)=>{const r=n(2718);const s=n(5578);const i=n(2887);const o=n(8891);const a=n(3221);const l=n(2150);const c=n(9856);const u={result:Symbol("result")};t.entry=function(e,t,n){let s=a.defaults;if(n){r(n.warnings===undefined,"Cannot override warnings preference in synchronous validation");s=a.preferences(a.defaults,n)}const i=u.entry(e,t,s);r(!i.mainstay.externals.length,"Schema with external rules must use validateAsync()");const o={value:i.value};if(i.error){o.error=i.error}if(i.mainstay.warnings.length){o.warning=l.details(i.mainstay.warnings)}if(i.mainstay.debug){o.debug=i.mainstay.debug}return o};t.entryAsync=async function(e,t,n){let r=a.defaults;if(n){r=a.preferences(a.defaults,n)}const s=u.entry(e,t,r);const i=s.mainstay;if(s.error){if(i.debug){s.error.debug=i.debug}throw s.error}if(i.externals.length){let e=s.value;for(const{method:t,path:n,label:r}of i.externals){let s=e;let i;let a;if(n.length){i=n[n.length-1];a=o(e,n.slice(0,-1));s=a[i]}try{const n=await t(s);if(n===undefined||n===s){continue}if(a){a[i]=n}else{e=n}}catch(e){e.message+=` (${r})`;throw e}}s.value=e}if(!r.warnings&&!r.debug){return s.value}const c={value:s.value};if(i.warnings.length){c.warning=l.details(i.warnings)}if(i.debug){c.debug=i.debug}return c};u.entry=function(e,n,r){const{tracer:s,cleanup:i}=u.tracer(n,r);const o=r.debug?[]:null;const a=n._ids._schemaChain?new Map:null;const f={externals:[],warnings:[],tracer:s,debug:o,links:a};const d=n._ids._schemaChain?[{schema:n}]:null;const m=new c([],[],{mainstay:f,schemas:d});const h=t.validate(e,n,m,r);if(i){n.$_root.untrace()}const p=l.process(h.errors,e,r);return{value:h.value,error:p,mainstay:f}};u.tracer=function(e,t){if(e.$_root._tracer){return{tracer:e.$_root._tracer._register(e)}}if(t.debug){r(e.$_root.trace,"Debug mode not supported");return{tracer:e.$_root.trace()._register(e),cleanup:true}}return{tracer:u.ignore}};t.validate=function(e,t,n,r,s={}){if(t.$_terms.whens){t=t._generate(e,n,r).schema}if(t._preferences){r=u.prefs(t,r)}if(t._cache&&r.cache){const r=t._cache.get(e);n.mainstay.tracer.debug(n,"validate","cached",!!r);if(r){return r}}const i=(s,i,o)=>t.$_createError(s,e,i,o||n,r);const o={original:e,prefs:r,schema:t,state:n,error:i,warn:(e,t,r)=>n.mainstay.warnings.push(i(e,t,r)),message:(s,i)=>t.$_createError("custom",e,i,n,r,{messages:s})};n.mainstay.tracer.entry(t,n);const l=t._definition;if(l.prepare&&e!==undefined&&r.convert){const t=l.prepare(e,o);if(t){n.mainstay.tracer.value(n,"prepare",e,t.value);if(t.errors){return u.finalize(t.value,[].concat(t.errors),o)}e=t.value}}if(l.coerce&&e!==undefined&&r.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,o);if(t){n.mainstay.tracer.value(n,"coerced",e,t.value);if(t.errors){return u.finalize(t.value,[].concat(t.errors),o)}e=t.value}}const c=t._flags.empty;if(c&&c.$_match(u.trim(e,t),n.nest(c),a.defaults)){n.mainstay.tracer.value(n,"empty",e,undefined);e=undefined}const f=s.presence||t._flags.presence||(t._flags._endedSwitch?"ignore":r.presence);if(e===undefined){if(f==="forbidden"){return u.finalize(e,null,o)}if(f==="required"){return u.finalize(e,[t.$_createError("any.required",e,null,n,r)],o)}if(f==="optional"){if(t._flags.default!==a.symbols.deepDefault){return u.finalize(e,null,o)}n.mainstay.tracer.value(n,"default",e,{});e={}}}else if(f==="forbidden"){return u.finalize(e,[t.$_createError("any.unknown",e,null,n,r)],o)}const d=[];if(t._valids){const s=t._valids.get(e,n,r,t._flags.insensitive);if(s){if(r.convert){n.mainstay.tracer.value(n,"valids",e,s.value);e=s.value}n.mainstay.tracer.filter(t,n,"valid",s);return u.finalize(e,null,o)}if(t._flags.only){const s=t.$_createError("any.only",e,{valids:t._valids.values({display:true})},n,r);if(r.abortEarly){return u.finalize(e,[s],o)}d.push(s)}}if(t._invalids){const s=t._invalids.get(e,n,r,t._flags.insensitive);if(s){n.mainstay.tracer.filter(t,n,"invalid",s);const i=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:true})},n,r);if(r.abortEarly){return u.finalize(e,[i],o)}d.push(i)}}if(l.validate){const t=l.validate(e,o);if(t){n.mainstay.tracer.value(n,"base",e,t.value);e=t.value;if(t.errors){if(!Array.isArray(t.errors)){d.push(t.errors);return u.finalize(e,d,o)}if(t.errors.length){d.push(...t.errors);return u.finalize(e,d,o)}}}}if(!t._rules.length){return u.finalize(e,d,o)}return u.rules(e,d,o)};u.rules=function(e,t,n){const{schema:r,state:s,prefs:i}=n;for(const o of r._rules){const l=r._definition.rules[o.method];if(l.convert&&i.convert){s.mainstay.tracer.log(r,s,"rule",o.name,"full");continue}let c;let f=o.args;if(o._resolve.length){f=Object.assign({},f);for(const t of o._resolve){const n=l.argsByName.get(t);const o=f[t].resolve(e,s,i);const u=n.normalize?n.normalize(o):o;const d=a.validateArg(u,null,n);if(d){c=r.$_createError("any.ref",o,{arg:t,ref:f[t],reason:d},s,i);break}f[t]=u}}c=c||l.validate(e,n,f,o);const d=u.rule(c,o);if(d.errors){s.mainstay.tracer.log(r,s,"rule",o.name,"error");if(o.warn){s.mainstay.warnings.push(...d.errors);continue}if(i.abortEarly){return u.finalize(e,d.errors,n)}t.push(...d.errors)}else{s.mainstay.tracer.log(r,s,"rule",o.name,"pass");s.mainstay.tracer.value(s,"rule",e,d.value,o.name);e=d.value}}return u.finalize(e,t,n)};u.rule=function(e,t){if(e instanceof l.Report){u.error(e,t);return{errors:[e],value:null}}if(Array.isArray(e)&&(e[0]instanceof l.Report||e[0]instanceof Error)){e.forEach(e=>u.error(e,t));return{errors:e,value:null}}return{errors:null,value:e}};u.error=function(e,t){if(t.message){e._setTemplate(t.message)}return e};u.finalize=function(e,t,n){t=t||[];const{schema:s,state:i,prefs:o}=n;if(t.length){const r=u.default("failover",undefined,t,n);if(r!==undefined){i.mainstay.tracer.value(i,"failover",e,r);e=r;t=[]}}if(t.length&&s._flags.error){if(typeof s._flags.error==="function"){t=s._flags.error(t);if(!Array.isArray(t)){t=[t]}for(const e of t){r(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}}else{t=[s._flags.error]}}if(e===undefined){const r=u.default("default",e,t,n);i.mainstay.tracer.value(i,"default",e,r);e=r}if(s._flags.cast&&e!==undefined){const t=s._definition.cast[s._flags.cast];if(t.from(e)){const r=t.to(e,n);i.mainstay.tracer.value(i,"cast",e,r,s._flags.cast);e=r}}if(s.$_terms.externals&&o.externals&&o._externals!==false){for(const{method:e}of s.$_terms.externals){i.mainstay.externals.push({method:e,path:i.path,label:l.label(s._flags,i,o)})}}const a={value:e,errors:t.length?t:null};if(s._flags.result){a.value=s._flags.result==="strip"?undefined:n.original;i.mainstay.tracer.value(i,s._flags.result,e,a.value);i.shadow(e,s._flags.result)}if(s._cache&&o.cache!==false&&!s._refs.length){s._cache.set(n.original,a)}return a};u.prefs=function(e,t){const n=t===a.defaults;if(n&&e._preferences[a.symbols.prefs]){return e._preferences[a.symbols.prefs]}t=a.preferences(t,e._preferences);if(n){e._preferences[a.symbols.prefs]=t}return t};u.default=function(e,t,n,{schema:r,state:i,prefs:o}){const l=r._flags[e];if(o.noDefaults||l===undefined){return t}i.mainstay.tracer.log(r,i,"rule",e,"full");if(!l){return l}if(typeof l==="function"){const t=l.length>0?[s(i.ancestors[0]),o]:[];try{return l(...t)}catch(t){n.push(r.$_createError(`any.${e}`,null,{error:t},i,o));return}}if(typeof l!=="object"){return l}if(l[a.symbols.literal]){return l.literal}if(a.isResolvable(l)){return l.resolve(t,i,o)}return s(l)};u.trim=function(e,t){if(typeof e!=="string"){return e}const n=t.$_getRule("trim");if(!n||!n.args.enabled){return e}return e.trim()};u.ignore={active:false,debug:i,entry:i,filter:i,log:i,resolve:i,value:i}},566:(e,t,n)=>{const r=n(2718);const s=n(5801);const i=n(3221);const o={};e.exports=o.Values=class{constructor(e,t){this._values=new Set(e);this._refs=new Set(t);this._lowercase=o.lowercases(e);this._override=false}get length(){return this._values.size+this._refs.size}add(e,t){if(i.isResolvable(e)){if(!this._refs.has(e)){this._refs.add(e);if(t){t.register(e)}}return}if(!this.has(e,null,null,false)){this._values.add(e);if(typeof e==="string"){this._lowercase.set(e.toLowerCase(),e)}}}static merge(e,t,n){e=e||new o.Values;if(t){if(t._override){return t.clone()}for(const n of[...t._values,...t._refs]){e.add(n)}}if(n){for(const t of[...n._values,...n._refs]){e.remove(t)}}return e.length?e:null}remove(e){if(i.isResolvable(e)){this._refs.delete(e);return}this._values.delete(e);if(typeof e==="string"){this._lowercase.delete(e.toLowerCase())}}has(e,t,n,r){return!!this.get(e,t,n,r)}get(e,t,n,r){if(!this.length){return false}if(this._values.has(e)){return{value:e}}if(typeof e==="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t){return{value:t}}}if(!this._refs.size&&typeof e!=="object"){return false}if(typeof e==="object"){for(const t of this._values){if(s(t,e)){return{value:t}}}}if(t){for(const i of this._refs){const o=i.resolve(e,t,n,null,{in:true});if(o===undefined){continue}const a=!i.in||typeof o!=="object"?[o]:Array.isArray(o)?o:Object.keys(o);for(const t of a){if(typeof t!==typeof e){continue}if(r&&e&&typeof e==="string"){if(t.toLowerCase()===e.toLowerCase()){return{value:t,ref:i}}}else{if(s(t,e)){return{value:t,ref:i}}}}}}return false}override(){this._override=true}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs]){if(t!==undefined){e.push(t)}}return e}return Array.from([...this._values,...this._refs])}clone(){const e=new o.Values(this._values,this._refs);e._override=this._override;return e}concat(e){r(!e._override,"Cannot concat override set of values");const t=new o.Values([...this._values,...e._values],[...this._refs,...e._refs]);t._override=this._override;return t}describe(){const e=[];if(this._override){e.push({override:true})}for(const t of this._values.values()){e.push(t&&typeof t==="object"?{value:t}:t)}for(const t of this._refs.values()){e.push(t.describe())}return e}};o.Values.prototype[i.symbols.values]=true;o.Values.prototype.slice=o.Values.prototype.clone;o.lowercases=function(e){const t=new Map;if(e){for(const n of e){if(typeof n==="string"){t.set(n.toLowerCase(),n)}}}return t}},989:(e,t)=>{const n={};t.location=function(e=0){const t=Error.prepareStackTrace;Error.prepareStackTrace=((e,t)=>t);const n={};Error.captureStackTrace(n,this);const r=n.stack[e+1];Error.prepareStackTrace=t;return{filename:r.getFileName(),line:r.getLineNumber()}}},8392:(e,t,n)=>{const r=n(2718);const s={};e.exports=class Topo{constructor(){this._items=[];this.nodes=[]}add(e,t){t=t||{};const n=[].concat(t.before||[]);const s=[].concat(t.after||[]);const i=t.group||"?";const o=t.sort||0;r(!n.includes(i),`Item cannot come before itself: ${i}`);r(!n.includes("?"),"Item cannot come before unassociated items");r(!s.includes(i),`Item cannot come after itself: ${i}`);r(!s.includes("?"),"Item cannot come after unassociated items");if(!Array.isArray(e)){e=[e]}for(const t of e){const e={seq:this._items.length,sort:o,before:n,after:s,group:i,node:t};this._items.push(e)}const a=this._sort();r(a,"item",i!=="?"?`added into group ${i}`:"","created a dependencies error");return this.nodes}merge(e){if(!Array.isArray(e)){e=[e]}for(const t of e){if(t){for(const e of t._items){this._items.push(Object.assign({},e))}}}this._items.sort(s.mergeSort);for(let e=0;e<this._items.length;++e){this._items[e].seq=e}const t=this._sort();r(t,"merge created a dependencies error");return this.nodes}_sort(){const e={};const t=Object.create(null);const n=Object.create(null);for(const r of this._items){const s=r.seq;const i=r.group;n[i]=n[i]||[];n[i].push(s);e[s]=r.before;for(const e of r.after){t[e]=t[e]||[];t[e].push(s)}}for(const t in e){const r=[];for(const s in e[t]){const i=e[t][s];n[i]=n[i]||[];r.push(...n[i])}e[t]=r}for(const r in t){if(n[r]){for(const s of n[r]){e[s].push(...t[r])}}}const r={};for(const t in e){const n=e[t];for(const e of n){r[e]=r[e]||[];r[e].push(t)}}const s={};const i=[];for(let e=0;e<this._items.length;++e){let t=e;if(r[e]){t=null;for(let e=0;e<this._items.length;++e){if(s[e]===true){continue}if(!r[e]){r[e]=[]}const n=r[e].length;let i=0;for(let t=0;t<n;++t){if(s[r[e][t]]){++i}}if(i===n){t=e;break}}}if(t!==null){s[t]=true;i.push(t)}}if(i.length!==this._items.length){return false}const o={};for(const e of this._items){o[e.seq]=e}this._items=[];this.nodes=[];for(const e of i){const t=o[e];this.nodes.push(t.node);this._items.push(t)}return true}};s.mergeSort=((e,t)=>{return e.sort===t.sort?0:e.sort<t.sort?-1:1})},8835:e=>{e.exports=require("url")},9357:e=>{e.exports=require("util")}};var t={};function __nccwpck_require__(n){if(t[n]){return t[n].exports}var r=t[n]={exports:{}};var s=true;try{e[n](r,r.exports,__nccwpck_require__);s=false}finally{if(s)delete t[n]}return r.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(4010)})();