1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 2var initSitelocation = require('../../common_javascript/initialize-sitelocation'); 3var siteLocation = require('@yola/sitelocation'); 4var callAsync = require('../../common_javascript/call-async'); 5 6require('@yola/mobilemenu'); 7 8var initMenu = function() { 9 'use strict'; 10 11 var els = [ 12 document.querySelector('.yola_content_wrap'), 13 document.querySelector('.yola_footer_wrap'), 14 document.querySelector('.yola_banner_wrap'), 15 document.getElementById('sys_yolacredit_wrap') 16 ]; 17 18 var mobileMenuOpen = function(event) { 19 els.forEach(function(el) { 20 if (!el) { return; } 21 el.classList.add('small_device_hide'); 22 }); 23 }; 24 25 var mobileMenuClose = function(event) { 26 els.forEach(function(el) { 27 if (!el) { return; } 28 el.classList.remove('small_device_hide'); 29 }); 30 }; 31 32 $('.mob_menu').mobileMenu({ 33 onOpen: mobileMenuOpen, 34 onClose: mobileMenuClose 35 }); 36}; 37 38/* With all Javascript bundled into one file, javascript is significantly 39 * more brittle, especially given that users have the power to overwrite 40 * globals that could interfere with bundled code. Initializing each component 41 * on its own turn of the event loop should minimize failures to individual 42 * Javascript components, instead of the whole site. 43 */ 44callAsync(initMenu); 45callAsync(initSitelocation(siteLocation, 'locationData')); 46 47},{"../../common_javascript/call-async":73,"../../common_javascript/initialize-sitelocation":74,"@yola/mobilemenu":2,"@yola/sitelocation":8}],2:[function(require,module,exports){ 48'use strict'; 49 50/* 51 * jQuery mobilemenu plugin 52 */ 53 54(function ($, window, document, undefined) { 55 56 var pluginName = 'mobileMenu'; 57 var subName = 'subMenu'; 58 var defaults = {}; 59 60 //The plugin constructor 61 function MobileMenu(element, options) { 62 this.$element = $(element); 63 this.options = $.extend({}, defaults, options); 64 this._defaults = defaults; 65 this._name = pluginName; 66 this._onOpen = options.onOpen || $.noop; 67 this._onClose = options.onClose || $.noop; 68 this.init(); 69 } 70 71 MobileMenu.prototype.init = function() { 72 var menuToggle = this.menuToggle.bind(this); 73 var subToggle = this.subToggle.bind(this); 74 75 this.$menuToggleBtn = this.$element.find('.mob_menu_toggle'); 76 this.$menuToggleBtn.on('click', menuToggle); 77 78 this.$subMenuToggleBtns = this.$element.find('.mob_more_toggle'); 79 this.$subMenuToggleBtns.on('click', subToggle); 80 81 this.$subMenuWrappers = this.$element.find('li'); 82 }; 83 84 MobileMenu.prototype.menuToggle = function(event) { 85 this.$element.toggleClass('menu_open'); 86 87 if(! this.$element.hasClass('menu_open')) { 88 this.closeSubMenus(); 89 this._onClose(event); 90 } else { 91 this._onOpen(event); 92 } 93 }; 94 95 MobileMenu.prototype.subToggle = function(event) { 96 var $buttonClicked = $(event.target); 97 var $subMenu = $buttonClicked.closest('li'); 98 99 $subMenu.toggleClass('sub_menu_open'); 100 this.closeSubMenus($subMenu); 101 }; 102 103 MobileMenu.prototype.closeSubMenus = function(exclude) { 104 if(! exclude) { 105 return this.$subMenuWrappers.removeClass('sub_menu_open'); 106 } 107 108 this.$subMenuWrappers.each(function(index) { 109 if(this !== exclude.get(0)) { 110 $(this).removeClass('sub_menu_open'); 111 } 112 }); 113 }; 114 115 $.fn[pluginName] = function(options) { 116 return this.each(function() { 117 if (!$.data(this, 'plugin_' + pluginName)) { 118 119 var pluginInstance = new MobileMenu(this, options); 120 $.data(this, 'plugin_' + pluginName, pluginInstance); 121 122 } 123 }); 124 }; 125 126})(jQuery, window, document); 127 128},{}],3:[function(require,module,exports){ 129module.exports={"cs":{"Address":"Adresa","Call":"Zavolat","Closed":"ZavÅeno","Closed all day":"ZavÅeno celý den","Closes":"ZavÃrá","Current Location":"Aktuálnà pozice","Currently closed":"MomentálnÄ zavÅeno","Day":"Den","Friday":"Pátek","Hours":"Hodiny","Map":"Mapa","Monday":"PondÄlÃ","Open now":"OtevÅÃt nynÃ","Open today from %s to %s":"Dnes otevÅeno od %s do %s","Opens":"OtevÃrá","Phone":"Telefon","Saturday":"Sobota","Sunday":"NedÄle","This Week":"Tento týden","Thursday":"Ätvrtek","Today":"Dnes","Today's Hours":"DneÅ¡nà otevÃracà doba","Tuesday":"Ãterý","Wednesday":"StÅeda"},"da":{"Address":"Adresse","Call":"Ring","Closed":"Lukket","Closed all day":"Lukket hele dagen","Closes":"Lukker","Current Location":"Nuværende placering","Currently closed":"Lukket lige nu","Day":"Dag","Friday":"Fredag","Hours":"à bningstider","Map":"Kort","Monday":"Mandag","Open now":"à ben nu","Open today from %s to %s":"à ben i dag fra %s til %s","Opens":"à bner","Phone":"Telefon","Saturday":"Lørdag","Sunday":"Søndag","This Week":"Denne uge","Thursday":"Torsdag","Today":"I dag","Today's Hours":"Dagens Ã¥bningstider","Tuesday":"Tirsdag","Wednesday":"Onsdag"},"de":{"Address":"Adresse","Call":"Telefon","Closed":"Geschlossen","Closed all day":"Ganztägig geschlossen","Closes":"schlieÃt","Current Location":"aktueller Standort","Currently closed":"derzeit geschlossen","Day":"Wochentag","Friday":"Freitag","Hours":"Ãffnungszeiten","Map":"Karte","Monday":"Montag","Open now":"Jetzt geöffnet","Open today from %s to %s":"Heute geöffnet von %s bis %s","Opens":"öffnet","Phone":"Telefon","Saturday":"Samstag","Sunday":"Sonntag","This Week":"diese Woche","Thursday":"Donnerstag","Today":"heute","Today's Hours":"Ãffnungszeiten heute","Tuesday":"Dienstag","Wednesday":"Mittwoch"},"es":{"Address":"Dirección","Call":"Llamar","Closed":"Cerrada","Closed all day":"Cerrado todo el dÃa","Closes":"Cierra","Current Location":"Ubicación actual","Currently closed":"Cerrado de momento","Day":"DÃa","Frid
129ay":"Viernes","Hours":"Horas","Map":"Mapa","Monday":"Lunes","Open now":"Abrir ahora","Open today from %s to %s":"Abrir hoy de %s a %s","Opens":"Abre","Phone":"Teléfono","Saturday":"Sábado","Sunday":"Domingo","This Week":"Esta semana","Thursday":"Jueves","Today":"Hoy","Today's Hours":"Horas para el dÃa de hoy","Tuesday":"Martes","Wednesday":"Miércoles"},"fr":{"Address":"Adresse","Call":"Appel","Closed":"Fermé","Closed all day":"Fermé toute la journée","Closes":"Ferme","Current Location":"Emplacement actuel","Currently closed":"Actuellement fermé","Day":"Jour","Friday":"Vendredi","Hours":"Heures","Map":"Carte","Monday":"Lundi","Open now":"Ouvert maintenant","Open today from %s to %s":"Ouvert aujourd'hui de %s à %s","Opens":"Ouvre","Phone":"Téléphone","Saturday":"Samedi","Sunday":"Dimanche","This Week":"Cette semaine","Thursday":"Jeudi","Today":"Aujourd'hui","Today's Hours":"Heures du Jour","Tuesday":"Mardi","Wednesday":"Mercredi"},"hu":{"Address":"CÃm","Call":"HÃvás","Closed":"Zárva","Closed all day":"Egész nap zárva","Closes":"Bezár","Current Location":"Jelenlegi hely","Currently closed":"Jelenleg zárva","Day":"Nap","Friday":"Péntek","Hours":"Ãrák","Map":"Térkép","Monday":"HétfÅ","Open now":"Most nyitva","Open today from %s to %s":"Mai napon nyitva %s-tól %s-ig","Opens":"Nyit","Phone":"Telefon","Saturday":"Szombat","Sunday":"Vasárnap","This Week":"Ezen a héten","Thursday":"Csütörtök","Today":"Ma","Today's Hours":"Mai órák","Tuesday":"Kedd","Wednesday":"Szerda"},"id":{"Address":"Alamat","Call":"Telepon","Closed":"Tutup","Closed all day":"Tutup sepanjang hari","Closes":"Menutup","Current Location":"Lokasi saat ini","Currently closed":"Saat ini tutup","Day":"Hari","Friday":"Jumat","Hours":"Jam","Map":"Peta","Monday":"Senin","Open now":"Buka sekarang","Open today from %s to %s":"Hari ini buka dari %s sampai %s","Opens":"Buka","Phone":"Telepon","Saturday":"Sabtu","Sunday":"Hari Minggu","This Week":"Minggu ini","Thursday":"Kamis","Today":"Hari ini","Today's Hours":"Jam hari ini","Tuesday":"Selasa","Wednesday":"Hari Rabu"},"it":{"Address":"indirizzo","Call":"Chiamata","Closed":"Chiuso","Closed all day":"Chiuso tutto il giorno","Closes":"Chiude","Current Location":"Indirizzo attuale","Currently closed":"Attualmente chiuso","Day":"Giorno","Friday":"Venerdi'","Hours":"Ore","Map":"Mappa","Monday":"Lunedi'","Open now":"Aperto adesso","Open today from %s to %s":"aperto oggi dalle %s alle %s","Opens":"Apre","Phone":"Telefono","Saturday":"Sabato","Sunday":"Domenica","This Week":"Questa settimana","Thursday":"Giovedi'","Today":"Oggi","Today's Hours":"Ore di oggi","Tuesday":"Martedi'","Wednesday":"Mercoledi'"},"ja":{"Address":"ã¢ãã¬ã¹","Call":"é»è©±","Closed":"éé","Closed all day":"éåºæ¥","Closes":"éåº","Current Location":"ç¾å¨å°","Currently closed":"ç¾å¨ãéãã¦ãã¾ã","Day":"ææ¥","Friday":"éææ¥","Hours":"æ","Map":"å°å³","Monday":"æææ¥","Open now":"ç¾å¨ãéãã¦ãã¾ã","Open today from %s to %s":"æ¬æ¥ã%sæãã%sæã¾ã§ãªã¼ãã³","Opens":"éåº","Phone":"é»è©±","Saturday":"åææ¥","Sunday":"æ¥ææ¥","This Week":"ä»é±","Thursday":"æ¨ææ¥","Today":"仿¥","Today's Hours":"仿¥ã®å°±æ¥æé","Tuesday":"ç«ææ¥","Wednesday":"æ°´ææ¥"},"nb":{"Address":"Adresse","Call":"Ring","Closed":"Stengt","Closed all day":"Stengt hele dagen","Closes":"Stenger","Current Location":"NÃ¥værende posisjon","Currently closed":"For øyeblikket lukket","Day":"Dag","Friday":"Fredag","Hours":"Timer","Map":"Kart","Monday":"Mandag","Open now":"Ã
pen nÃ¥","Open today from %s to %s":"Ã
pen i dag fra %s til %s","Opens":"Ã
pner","Phone":"Telefon","Saturday":"Lørdag","Sunday":"Søndag","This Week":"Denne uken","Thursday":"Torsdag","Today":"I dag","Today's Hours":"Dagens Ã¥pningstider","Tuesday":"Tirsdag","Wednesday":"Onsdag"},"nl":{"Address":"Adres","Call":"Bel","Closed":"Gesloten","Closed all day":"De hele dag gesloten","Closes":"Sluit","Current Location":"Huidige locatie","Currently closed":"Momenteel gesloten","Day":"Dag","Friday":"Vrijdag","Hours":"Uren","Map":"Kaart","Monday":"Maandag","Open now":"Nu open","Open today from %s to %s":"Vandaag open van %s tot %s","Opens":"Opent","Phone":"Telefoon","Saturday":"Zaterdag","Sunday":"Zondag","This Week":"Deze Week","Thursday":"Donderdag","Today":"Vandaag","Today's Hours":"Uren van vandaag","Tuesday":"Dinsdag","Wednesday":"Woensdag"},"pl":{"Address":"Adres","Call":"PoÅÄ
czenie","Closed":"ZamkniÄty","Closed all day":"ZamkniÄte przez caÅy dzieÅ","Closes":"Zamyka","Current Location":"Aktualna lokalizacja","Currently closed":"Aktualnie zamkniÄte","Day":"DzieÅ","Friday":"PiÄ
tek","Hours":"Godziny","Map":"Mapa","Monday":"PoniedziaÅek","Open now":"Otwarte teraz","Open today from %s to %s":"Otwarte dzisiaj od %s do %s","Opens":"Otwiera","Phone":"Nr telefonu","Saturday":"Sobota","Sunday":"Niedziela","This Week":"W tym tygodniu","Thursday":"Czwartek","Today":"Dzisiaj","Today's Hours":"Dzisiejsze godziny","Tuesday":"Wtorek","Wednesday":"Åroda"},"pt_BR":{"Address":"Endereço","Call":"Ligar","Closed":"Fechado","Closed all day":"Fechado durante todo o dia","Closes":"Fecha","Current Location":"Localização Atual","Currently closed":"Atualmente fechado","Day":"Dia","Friday":"Sexta-feira","Hours":"Horas","Map":"Mapa","Monday":"Segunda-feira","Open now":"Aberto agora","Open today from %s to %s":"Aberto hoje das %s as %s","Opens":"Abre","Phone":"Telefone","Saturday":"Sábado","Sunday":"Domingo","This Week":"Esta Semana","Thursday":"Quinta-feira","Today":"Hoje","Today's Hours":"Horário de Hoje","Tuesday":"Terça-feira","Wednesday":"Quarta-feira"},"ru":{"Address":"ÐдÑеÑ","Call":"Ðвонок","Closed":"ÐакÑÑÑо","Closed all day":"ÐакÑÑÑо веÑÑ Ð´ÐµÐ½Ñ","Closes":"ÐакÑÑваеÑÑÑ","Current Location":"ÐÑнеÑнее ÐеÑÑонаÑ
ождение","Currently closed":"РданнÑй Ð¼Ð¾Ð¼ÐµÐ½Ñ Ð·Ð°ÐºÑÑÑ","Day":"ÐенÑ","Frid
129ay":"ÐÑÑниÑа","Hours":"ЧаÑÑ","Map":"ÐаÑÑа","Monday":"ÐонеделÑник","Open now":"ÐÑкÑÑÑÑ ÑейÑаÑ","Open today from %s to %s":"ÐÑкÑÑÑо ÑÐµÐ³Ð¾Ð´Ð½Ñ Ñ %s до %s","Opens":"ÐÑкÑÑваеÑÑÑ","Phone":"ТелеÑон","Saturday":"СÑббоÑа","Sunday":"ÐоÑкÑеÑенÑе","This Week":"Ðа ÑÑой неделе","Thursday":"ЧеÑвеÑг","Today":"СегоднÑ","Today's Hours":"РабоÑие ÑаÑÑ ÑегоднÑ","Tuesday":"ÐÑоÑник","Wednesday":"СÑеда"},"sk":{"Address":"Adresa","Call":"ZavolaÅ¥","Closed":"Zavreté","Closed all day":"Zavreté celý deÅ","Closes":"Zaviera sa","Current Location":"Aktuálna poloha","Currently closed":"Momentálne uzavreté","Day":"DeÅ","Friday":"Piatok","Hours":"HodÃn","Map":"Mapa","Monday":"Pondelok","Open now":"Teraz otvorené","Open today from %s to %s":"Dnes otvorené od %s do %s","Opens":"Otvára sa","Phone":"Telefón","Saturday":"Sobota","Sunday":"Nedeľa","This Week":"Tento týždeÅ","Thursday":"Å tvrtok","Today":"Dnes","Today's Hours":"DneÅ¡ný hodiny","Tuesday":"Utorok","Wednesday":"Streda"},"sv":{"Address":"Adress","Call":"Ring","Closed":"Stängd","Closed all day":"Stängt hela dagen","Closes":"Stänger","Current Location":"Nuvarande plats","Currently closed":"Stängt för närvarande","Day":"Dag","Friday":"Fredag","Hours":"Timmar","Map":"Karta","Monday":"MÃ¥ndag","Open now":"Ãppna nu","Open today from %s to %s":"Ãppet idag frÃ¥n %s till %s","Opens":"Ãppnar","Phone":"Telefon","Saturday":"Lördag","Sunday":"Söndag","This Week":"Den här veckan","Thursday":"Torsdag","Today":"Idag","Today's Hours":"Dagens timmar","Tuesday":"Tisdag","Wednesday":"Onsdag"},"zh_CN":{"Address":"å°å","Call":"æ¨æ","Closed":"å·²å ³é","Closed all day":"å ¨å¤©å ³é","Closes":"å ³é","Current Location":"å½åä½ç½®","Currently closed":"å½åå·²å ³é","Day":"天","Friday":"ææäº","Hours":"è¥ä¸æ¶é´","Map":"å°å¾","Monday":"ææä¸","Open now":"ç°å¨æå¼","Open today from %s to %s":"ä»å¤©ä» %s å° %sæå¼","Opens":"æå¼","Phone":"çµè¯","Saturday":"ææå ","Sunday":"æææ¥","This Week":"æ¬å¨","Thursday":"ææå","Today":"ä»å¤©","Today's Hours":"ä»å¤©çå°æ¶æ°","Tuesday":"ææäº","Wednesday":"ææä¸"}} 130},{}],4:[function(require,module,exports){ 131'use strict'; 132 133 134var canonicalize = function(phoneNumber) { 135 if(! phoneNumber) { 136 return null; 137 } 138 139 var canonicalPhone; 140 var phoneString = '' + phoneNumber; 141 var match = /^\+?[0-9()\-\s.]+$/.exec(phoneString); 142 143 if(match === null) { 144 console.error('Found invalid characters in phone number: ' + phoneString); 145 146 return null; 147 } 148 149 canonicalPhone = phoneString.replace(/[()\-\s.]+/g, ''); 150 151 if(canonicalPhone[0] === '+') { 152 return canonicalPhone; 153 } 154 155 if(canonicalPhone.length === 10) { 156 return '+1' + canonicalPhone; 157 } 158 159 if(canonicalPhone.length === 11 && canonicalPhone[0] === '1') { 160 return '+' + canonicalPhone; 161 } 162 163 return canonicalPhone; 164}; 165 166module.exports = canonicalize; 167 168},{}],5:[function(require,module,exports){ 169'use strict'; 170 171var cards = []; 172 173var counter = { 174 getCards: function() { 175 return cards; 176 }, 177 178 register: function(card) { 179 cards.push(card); 180 this.positionCards(); 181 }, 182 183 unregister: function(card) { 184 var cardIndex = cards.indexOf(card); 185 cards.splice(cardIndex, 1); 186 this.positionCards(); 187 }, 188 189 /* This function is responsible for vertically positioning 190 * stacked cards. The first card in the cards array will 191 * be positioned at the top, and the second below it and 192 * so on. 193 */ 194 positionCards: function() { 195 var cardEl; 196 var cardHeight; 197 var spacing = 15; 198 var verticalSpacing = 0; 199 200 for(var i = 0; i < cards.length; i++) { 201 cardEl = cards[i].getCardEl(); 202 cardHeight = cards[i].getCardHeight(); 203 cardHeight += spacing; 204 205 cardEl.style.top = (verticalSpacing + spacing) + 'px'; 206 verticalSpacing += cardHeight; 207 } 208 } 209}; 210 211module.exports = counter; 212 213},{}],6:[function(require,module,exports){ 214'use strict'; 215 216var siteData = require('./site-data'); 217var transCatalog = require('../i18n-catalog.json'); 218var Handlebars = require('hbsfy/runtime'); 219 220 221var trans = function(text) {
222 var locale = siteData.getLocale() || ''; 223 224 if (! locale) { 225 return text; 226 } 227 228 if (! transCatalog[locale]) { 229 setTimeout(function() { 230 throw new Error('Locale does not exist: ' + locale); 231 }); 232 233 return text; 234 } 235 236 if(! transCatalog[locale][text]) { 237 return text; 238 } 239 240 return transCatalog[locale][text]; 241}; 242 243Handlebars.registerHelper('trans', trans); 244 245module.exports = trans; 246 247},{"../i18n-catalog.json":3,"./site-data":13,"hbsfy/runtime":42}],7:[function(require,module,exports){ 248'use strict'; 249 250var gettext = require('./gettext'); 251var sprintf = require('sprintf-js').sprintf; 252var todaysHoursHTML = require('./templates/today-hours.hbs'); 253var weekHTML = require('./templates/hours-table.hbs'); 254require('date-utils'); 255 256var hoursRenderer = { 257 days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 258 formatTime: function(time) { 259 var formattedTime = ''; 260 var timeSplat = time.split(':'); 261 var hourDigit = Number(timeSplat[0]); 262 var isPm = hourDigit >= 12; 263 264 if(hourDigit > 12) { 265 hourDigit -= 12; 266 } else if (hourDigit === 0) { 267 hourDigit = 12; 268 } 269 270 formattedTime = hourDigit + ':' + timeSplat[1]; 271 272 formattedTime += isPm ? ' pm' : ' am'; 273 274 return formattedTime; 275 }, 276 277 today: function(hours) { 278 var date = new Date(); 279 var day = date.toFormat('DDD').substring(0,2); 280 var todaysHours = hours[day]; 281 282 if(! todaysHours) { 283 return; 284 } 285 286 var openTime = this.formatTime(todaysHours.open); 287 var closeTime = this.formatTime(todaysHours.close); 288 289 return { 290 open: openTime, 291 close: closeTime 292 }; 293 }, 294 295 openToday: function(hours) { 296 var openStatus; 297 var todaysHours = this.today(hours); 298 299 if(! todaysHours) { 300 return sprintf(gettext('Closed all day')); 301 } 302 303 openStatus = gettext('Open today from %s to %s'); 304 return sprintf(openStatus, todaysHours.open, todaysHours.close); 305 }, 306 307 isOpenNow: function(now, hours) { 308 var today = this.days[now.getDay()]; 309 var todaysHours = hours[today]; 310 311 if (! todaysHours) { 312 return false; 313 } 314 315 var openSplat = todaysHours.open.split(':'); 316 var closeSplat = todaysHours.close.split(':'); 317 318 var openDate = new Date( 319 now.getFullYear(), 320 now.getMonth(), 321 now.getDate(), 322 Number(openSplat[0]), 323 Number(openSplat[1]) 324 ); 325 326 var closeDate = new Date( 327 now.getFullYear(), 328 now.getMonth(), 329 now.getDate(), 330 Number(closeSplat[0]), 331 Number(closeSplat[1]) 332 ); 333 334 return now > openDate && now < closeDate; 335 }, 336 337 week: function(hours) { 338 var now = new Date(); 339 var wrapper = document.createElement('div'); 340 var todaysHours = this.today(hours); 341 var isOpenNow = this.isOpenNow(now, hours); 342 var dayRow, openEl, closeEl, openNowEl, openNowMsg, openCloseClass, todayEl; 343 var todayElContext; 344 var injectDay = function(day) { 345 dayRow = wrapper.querySelector('.' + day); 346 openEl = dayRow.querySelector('td:nth-child(2)'); 347 closeEl = dayRow.querySelector('td:nth-child(3)'); 348 349 if(! hours[day]) { 350 openEl.innerHTML = gettext('Closed'); 351 return; 352 } 353 354 openEl.innerHTML = this.formatTime(hours[day].open); 355 closeEl.innerHTML = this.formatTime(hours[day].close); 356 }; 357 358 wrapper.innerHTML = weekHTML(); 359 360 this.days.forEach(injectDay.bind(this)); 361 362 todayEl = wrapper.querySelector('.today'); 363 364 todayElContext = { 365 hasHours: todaysHours, 366 opens: todaysHours && todaysHours.open, 367 closes: todaysHours && todaysHours.close 368 }; 369 370 todayEl.innerHTML = todaysHoursHTML(todayElContext); 371 openNowEl = wrapper.querySelector('.now'); 372 373 openCloseClass = isOpenNow ? 'open' : 'closed'; 374 openNowMsg = isOpenNow ? gettext('Open now') : gettext('Currently closed'); 375 376 openNowEl.innerHTML = openNowMsg; 377 openNowEl.classList.add(openCloseClass); 378 return wrapper; 379 } 380}; 381 382module.exports = hoursRenderer; 383 384},{"./gettext":6,"./templates/hours-table.hbs":16,"./templates/today-hours.hbs":22,"date-utils":39,"sprintf-js":72}],8:[function(require,module,exports){ 385'use strict'; 386 387require('./gettext'); 388 389var Router = require('./router'); 390var setupMessaging = require('./messaging'); 391 392 393require('date-utils'); 394require('classlist-polyfill'); 395 396setupMessaging(Router); 397 398module.exports = { 399 initialize: Router.initInstance 400}; 401 402},{"./gettext":6,"./messaging":9,"./router":12,"classlist-polyfill":38,"date-utils":39}],9:[function(require,module,exports){ 403'use strict'; 404 405var windowManager = require('./window-manager'); 406 407 408var initializeMessageListening = function(router) { 409 var topWindow = windowManager.get('top'); 410 411 var receiveMessage = function(event) { 412 var parentOrigin = topWindow.location.origin; 413 414 if (event.origin !== parentOrigin) { 415 console.log('Message from an unknown source: ', event.origin); 416 return; 417 } 418 419 if (typeof event.data !== 'object') { 420 console.log('Message has no event.data property'); 421 return; 422 } 423 424 router.forceInit(event.data); 425 }; 426 427 windowManager.get().addEventListener('message', receiveMessage); 428}; 429 430module.exports = initializeMessageListening; 431 432}
432,{"./window-manager":32}],10:[function(require,module,exports){ 433'use strict'; 434 435/* Hideable is a mixin for objects that can be shown and hidden 436 * from view. 437 */ 438 439var hideable = { 440 hide: function(cb, timeout) { 441 var displayNone = function() { 442 this[this.contentName].classList.add('hide'); 443 this[this.contentName].classList.remove('open'); 444 if(typeof cb === 'function') { 445 cb(); 446 } 447 }; 448 449 if(timeout === undefined) { 450 timeout = 400; 451 } 452 453 if(this.noscroll) { 454 this.removeNoScroll(); 455 } 456 457 this[this.contentName].classList.remove(this.transIn || ''); 458 this[this.contentName].classList.add(this.transOut || ''); 459 setTimeout(displayNone.bind(this), timeout); 460 }, 461 462 show: function() { 463 if(this.noscroll) { 464 this.addNoScroll(); 465 } 466 467 this[this.contentName].classList.add('open'); 468 this[this.contentName].classList.remove('hide'); 469 this[this.contentName].classList.add(this.transIn || ''); 470 this[this.contentName].classList.remove(this.transOut || ''); 471 }, 472 473 addNoScroll: function() { 474 document.body.classList.add('noscroll'); 475 }, 476 477 removeNoScroll: function() { 478 document.body.classList.remove('noscroll'); 479 } 480}; 481 482module.exports = hideable; 483 484},{}],11:[function(require,module,exports){ 485'use strict'; 486 487 488var renderable = { 489 render: function(cb) { 490 if(! this.isRendered) { 491 this[this.wrapperName].appendChild(this[this.contentName]); 492 } 493 494 if(typeof this.onRender === 'function') { 495 this.onRender(cb); 496 } 497 498 this.isRendered = true; 499 }, 500 501 remove: function() { 502 if(this.isRendered) { 503 this[this.wrapperName].removeChild(this[this.contentName]); 504 } 505 506 if(typeof this.onRemove === 'function') { 507 this.onRemove(); 508 } 509 510 this.isRendered = false; 511 } 512}; 513 514module.exports = renderable; 515 516},{}],12:[function(require,module,exports){ 517'use strict'; 518 519var AmpersandRouter = require('ampersand-router'); 520var PageView = require('./views/page'); 521var siteData = require('./site-data'); 522 523 524var SiteLocationRouter = AmpersandRouter.extend({ 525 routes: { 526 'toolbar': 'toolbar', 527 'exit': 'exit', 528 'toolbar/map': 'map', 529 'toolbar/hours': 'hours' 530 }, 531 532 initialize: function() { 533 this.pageView = new PageView(); 534 }, 535 536 toolbar: function() { 537 this.pageView.renderToolbar(); 538 }, 539 540 exit: function() { 541 this.pageView.removeAll(); 542 543 this.navigate('', {replace: true}); 544 }, 545 546 map: function() { 547 this.pageView.renderMap(); 548 }, 549 550 hours: function() { 551 this.pageView.renderHours(); 552 }, 553 554 tearDown: function() { 555 var navOpts = { 556 trigger: true, 557 replace: true 558 }; 559 560 this.navigate('exit', navOpts); 561 562 this.pageView.removeAll(); 563 this.pageView.removeActionButton(); 564 } 565}); 566 567SiteLocationRouter.initInstance = function(data) { 568 if(SiteLocationRouter.instance) { 569 console.info('Sitelocation already instantiated.'); 570 return; 571 } 572 573 siteData.set(data); 574 575 if(! PageView.shouldRender()) { 576 console.info('No data for sitelocation to render.'); 577 return; 578 } 579 580 var router = new SiteLocationRouter(); 581 582 if(! router.history.started()) { 583 router.history.start({ pushState: false }); 584 } 585 586 SiteLocationRouter.instance = router; 587 588 return router; 589}; 590 591SiteLocationRouter.forceInit = function(data) { 592 var route = data.route || 'exit'; 593 var navOpts = { 594 trigger: true, 595 replace: true 596 }; 597 598 delete data.route; 599 600 if(this.instance) { 601 this.instance.tearDown(); 602 delete this.instance; 603 } 604 605 this.initInstance(data); 606 607 if(this.instance) { 608 this.instance.navigate(route, navOpts); 609 } 610}; 611 612module.exports = SiteLocationRouter; 613 614},{"./site-data":13,"./views/page":30,"ampersand-router":36}],13:[function(require,module,exports){ 615'use strict'; 616 617 618var siteData = { 619 data: {}, 620 621 set: function(key, value) { 622 if(typeof key === 'object') { 623 this.data = key; 624 } 625 626 this.data[key] = value; 627 }, 628 629 get: function(key) { 630 if (key === 'locale') { 631 return this.getLocale(); 632 } 633 634 return this.data[key]; 635 }, 636 637 getLocale: function() { 638 var langSplat; 639 var lang = this.get('lang') || ''; 640 641 if(lang === 'en') { 642 return ''; 643 } 644 645 if (lang.length !== 5) { 646 return lang; 647 } 648 649 langSplat = lang.split('-'); 650 651 return langSplat[0].toLowerCase() + '_' + langSplat[1].toUpperCase(); 652 } 653}; 654 655module.exports = siteData; 656 657},{}],14:[function(require,module,exports){ 658// hbsfy compiled Handlebars template 659var HandlebarsCompiler = require('hbsfy/runtime'); 660module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 661 return "<div class=\"title\">" 662 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(
662depth0 != null ? depth0 : (container.nullContext || {}),"Address",{"name":"trans","hash":{},"data":data})) 663 + ":</div>\n<address>\n <div class=\"line-one\"></div>\n <div class=\"line-two\"></div>\n</address>\n"; 664},"useData":true}); 665 666},{"hbsfy/runtime":42}],15:[function(require,module,exports){ 667// hbsfy compiled Handlebars template 668var HandlebarsCompiler = require('hbsfy/runtime'); 669module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 670 return "<div class=\"title\">" 671 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Today's Hours",{"name":"trans","hash":{},"data":data})) 672 + ":</div>\n<div class=\"hours\"></div>\n"; 673},"useData":true}); 674 675},{"hbsfy/runtime":42}],16:[function(require,module,exports){ 676// hbsfy compiled Handlebars template 677var HandlebarsCompiler = require('hbsfy/runtime'); 678module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 679 var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=container.escapeExpression; 680 681 return "<h2>" 682 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Hours",{"name":"trans","hash":{},"data":data})) 683 + "</h2>\n\n<h3>" 684 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Today",{"name":"trans","hash":{},"data":data})) 685 + "</h3>\n\n<div class=\"today\"></div>\n\n<h3>" 686 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"This Week",{"name":"trans","hash":{},"data":data})) 687 + "</h3>\n\n<table>\n <thead>\n <tr>\n <th>" 688 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Day",{"name":"trans","hash":{},"data":data})) 689 + "</th>\n <th>" 690 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Opens",{"name":"trans","hash":{},"data":data})) 691 + "</th>\n <th>" 692 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Closes",{"name":"trans","hash":{},"data":data})) 693 + "</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"Su\">\n <td>" 694 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Sunday",{"name":"trans","hash":{},"data":data})) 695 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Mo\">\n <td>" 696 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Monday",{"name":"trans","hash":{},"data":data})) 697 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Tu\">\n <td>" 698 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Tuesday",{"name":"trans","hash":{},"data":data})) 699 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"We\">\n <td>" 700 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Wednesday",{"name":"trans","hash":{},"data":data})) 701 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Th\">\n <td>" 702 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Thursday",{"name":"trans","hash":{},"data":data})) 703 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Fr\">\n <td>" 704 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Friday",{"name":"trans","hash":{},"data":data})) 705 + "</td>\n <td></td>\n <td></td>\n </tr>\n <tr class=\"Sa\">\n <td>" 706 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Saturday",{"name":"trans","hash":{},"data":data})) 707 + "</td>\n <td></td>\n <td></td>\n </tr>\n </tbody>\n</table>\n"; 708},"useData":true}); 709 710},{"hbsfy/runtime":42}],17:[function(require,module,exports){ 711// hbsfy compiled Handlebars template 712var HandlebarsCompiler = require('hbsfy/runtime'); 713module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 714 return "<input class=\"animated\" placeholder=\"" 715 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(
715depth0 != null ? depth0 : (container.nullContext || {}),"Current Location",{"name":"trans","hash":{},"data":data})) 716 + "\">\n<div class=\"transport-toggle\">\n <button class=\"walk-icon\" data-mode=\"walking\">\n <svg id=\"walk-icon\" x=\"0px\" y=\"0px\" width=\"25px\" height=\"25px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\">\n <path d=\"M48.947,11.08c0-3.972-3.111-7.08-7.081-7.08c-3.974,0-7.082,3.108-7.082,7.08 c0,3.971,3.108,7.082,7.082,7.082C45.835,18.162,48.947,15.051,48.947,11.08z\"/>\n <path d=\"M71.465,30.522c0,0-8.447-4.743-12.188-6.708c-3.744-1.97-11.175-7.06-17.801-1.17 C38.467,25.319,35,39,35,39l-14,8.634l2.299,3.204l15.251-5.544l4.262-5.516l4.513,9.945l-9.109,15.962l-7.188,26.828l7.438,2.508 l8.357-25.072l6.185-6.102l13.539,32.01l6.52-3.01L62.119,53.902c0,0,1.365-2.799,1.365-7.254c0-5.11-4.039-13.473-4.039-13.473 l6.611,1.518l1.48,16.639l4.162,0.391L71.465,30.522z\"/>\n </svg>\n </button>\n <button class=\"drive-icon selected\" data-mode=\"driving\">\n <svg id=\"drive-icon\" x=\"0px\" y=\"0px\" width=\"25px\" height=\"20px\" viewBox=\"0 0 100 83.648\" enable-background=\"new 0 0 100 83.648\" xml:space=\"preserve\">\n <path d=\"M15.727,43.753\"/>\n <path d=\"M90.925,28.696L82.728,7.529C81.195,3.477,77.845,0.029,71.505,0h-11.56H40.188H28.427\n c-6.311,0.029-9.661,3.477-11.222,7.529L9.006,28.696C5.751,29.116-0.01,32.941,0,40.187v26.951h7.999v8.603\n c-0.02,10.606,14.989,10.48,14.985,0v-8.603H50h26.948v8.603c0.033,10.48,15.042,10.606,15.052,0v-8.603h8V40.187\n C99.975,32.941,94.21,29.116,90.925,28.696z M15.727,50.874c-3.834,0.011-6.938-3.187-6.922-7.12\n c-0.016-3.96,3.088-7.161,6.922-7.128c3.822-0.033,6.926,3.168,6.921,7.128C22.653,47.687,19.548,50.884,15.727,50.874z M50,28.497\n h-0.067H17.541l6.182-16.668c0.746-2.366,1.904-4.059,4.639-4.1h21.571H50H71.64c2.693,0.041,3.854,1.733,4.636,4.1l6.183,16.668H50\n z M84.274,50.874c-3.861,0.011-6.967-3.187-6.988-7.12c0.021-3.96,3.127-7.161,6.988-7.128c3.795-0.033,6.898,3.168,6.922,7.128\n C91.172,47.687,88.069,50.884,84.274,50.874z\"/>\n <path d=\"M84.274,43.753\"/>\n </svg>\n </button>\n</div>\n"; 717},"useData":true}); 718 719},{"hbsfy/runtime":42}],18:[function(require,module,exports){ 720// hbsfy compiled Handlebars template 721var HandlebarsCompiler = require('hbsfy/runtime'); 722module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 723 var helper; 724 725 return "<iframe\n frameborder=\"0\"\n style=\"border:0;width:100%;height:100%;\"\n src=\"" 726 + container.escapeExpression(((helper = (helper = helpers.mapSource || (depth0 != null ? depth0.mapSource : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"mapSource","hash":{},"data":data}) : helper))) 727 + "\"\n allowfullscreen>\n</iframe>\n"; 728},"useData":true}); 729 730},{"hbsfy/runtime":42}],19:[function(require,module,exports){ 731// hbsfy compiled Handlebars template 732var HandlebarsCompiler = require('hbsfy/runtime'); 733module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 734 var alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3=container.escapeExpression; 735 736 return "<div>\n <a id=\"location-tools-phone\" class=\"phone hide\" href=\"\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 578.106 578.106\" style=\"enable-background:new 0 0 578.106 578.106;\" xml:space=\"preserve\">\n <g>\n <path d=\"M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.
736016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z\"/>\n </g>\n </svg>\n\n " 737 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Call",{"name":"trans","hash":{},"data":data})) 738 + "\n </a>\n <a id=\"location-tools-location\" class=\"map hide\" href=\"#toolbar/map\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 51.114 51.114\" style=\"enable-background:new 0 0 51.114 51.114;\" xml:space=\"preserve\">\n <g>\n <path d=\"M41.945,16.388C41.943,7.337,34.609,0,25.56,0C16.507,0,9.169,7.337,9.169,16.388 c0,7.812,12.208,28.683,15.553,34.251c0.176,0.295,0.494,0.475,0.837,0.475c0.343,0,0.662-0.18,0.836-0.474 C29.738,45.072,41.945,24.2,41.945,16.388z M25.559,29.068c-6.991,0-12.683-5.688-12.683-12.681 c0-6.992,5.69-12.681,12.683-12.681s12.679,5.689,12.679,12.681C38.238,23.379,32.551,29.068,25.559,29.068z\"/>\n </g>\n </svg>\n\n " 739 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Map",{"name":"trans","hash":{},"data":data})) 740 + "\n </a>\n <a id=\"location-tools-hours\" class=\"hours hide\" href=\"#toolbar/hours\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" id=\"Capa_1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 612 612\" style=\"enable-background:new 0 0 612 612;\" xml:space=\"preserve\">\n <g id=\"clock\">\n <path d=\"M306,0C136.992,0,0,136.992,0,306s136.992,306,306,306s306-137.012,306-306S475.008,0,306,0z M306,573.157 C158.451,573.157,38.843,453.55,38.843,306C38.843,158.451,158.451,38.843,306,38.843c147.55,0,267.157,119.608,267.157,267.157 C573.157,453.55,453.55,573.157,306,573.157z M325.125,115.955h-37.657l0.593,209.782l132.077,112.952l23.313-32.876 l-118.326-99.221V115.955z\"/>\n </g>\n </svg>\n\n " 741 + alias3((helpers.trans || (depth0 && depth0.trans) || alias2).call(alias1,"Hours",{"name":"trans","hash":{},"data":data})) 742 + "\n </a>\n</div>\n"; 743},"useData":true}); 744 745},{"hbsfy/runtime":42}],20:[function(require,module,exports){ 746// hbsfy compiled Handlebars template 747var HandlebarsCompiler = require('hbsfy/runtime'); 748module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 749 return "<div class=\"title\">" 750 + container.escapeExpression((helpers.trans || (depth0 && depth0.trans) || helpers.helperMissing).call(depth0 != null ? depth0 : (container.nullContext || {}),"Phone",{"name":"trans","hash":{},"data":data})) 751 + ":</div>\n<div class=\"phone\"></div>\n"; 752},"useData":true}); 753 754},{"hbsfy/runtime":42}],21:[function(require,module,exports){ 755// hbsfy compiled Handlebars template 756var HandlebarsCompiler = require('hbsfy/runtime'); 757module.exports = HandlebarsCompiler.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 758 return "<svg width=\"20\" height=\"20\">\n <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"20\" stroke-width=\"2\"></line>\n <line x1=\"0\" y1=\"10\" x2=\"20\" y2=\"10\" stroke-width=\"2\"></line>\n</svg>\n"; 759},"useData":true}); 760 761},{"hbsfy/runtime":42}],22:[function(require,module,exports){ 762// hbsfy compiled Handlebars template 763var HandlebarsCompiler = require('hbsfy/runtime'); 764module.exports = HandlebarsCompiler.template({"1":function(container,depth0,helpers,partials,data) { 765 var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; 766 767 return " <time class=\"open\">" 768 + alias4(((helper = (helper = helpers.opens || (depth0 != null ? depth0.opens : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"opens","hash":{},"data":data}) : helper))) 769 + "</time> - <time class=\"close\">" 770 + alias4(((helper = (helper = helpers.closes || (depth0 != null ? depth0.closes : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"closes","hash":{},"data":data}) : helper))) 771 + "</time>\n"; 772},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { 773 var stack1; 774 775 return "<span class=\"now\"></span>\n"
776 + ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.hasHours : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : ""); 777},"useData":true}); 778 779},{"hbsfy/runtime":42}],23:[function(require,module,exports){ 780'use strict'; 781 782var renderable = require('../mixins/renderable'); 783var windowManager = require('../window-manager'); 784var actionButtonHTML = require('../templates/plus.hbs'); 785 786 787function ActionButton(options) { 788 this.options = options || {}; 789 this.actionButton = document.createElement('button'); 790 this.actionButton.setAttribute('class', 'action-button'); 791 this.actionButton.innerHTML = actionButtonHTML(); 792 this.wrapperEl = this.options.wrapperEl || document.body; 793 this.wrapperName = 'wrapperEl'; 794 this.contentName = 'actionButton'; 795 796 this.actionButton.addEventListener('click', this.toggle.bind(this)); 797} 798 799ActionButton.prototype = Object.create(renderable); 800 801ActionButton.prototype.toggle = function(event) { 802 var window = windowManager.get(); 803 804 if(this.actionButton.classList.contains('open')) { 805 window.location.hash = 'exit'; 806 this.close(); 807 } else { 808 window.location.hash = 'toolbar'; 809 this.open(); 810 } 811}; 812 813ActionButton.prototype.open = function(event) { 814 this.actionButton.classList.add('open'); 815 816 if(typeof this.openCallback === 'function') { 817 this.openCallback(event); 818 } 819}; 820 821ActionButton.prototype.close = function(event) { 822 this.actionButton.classList.remove('open'); 823 824 if(typeof this.closeCallback === 'function') { 825 this.closeCallback(event); 826 } 827}; 828 829ActionButton.prototype.onOpen = function(func) { 830 this.openCallback = func; 831}; 832 833ActionButton.prototype.onClose = function(func) { 834 this.closeCallback = func; 835}; 836 837module.exports = ActionButton; 838 839},{"../mixins/renderable":11,"../templates/plus.hbs":21,"../window-manager":32}],24:[function(require,module,exports){ 840'use strict'; 841 842var hideable = require('../mixins/hideable'); 843var renderable = require('../mixins/renderable'); 844var extend = require('extend'); 845 846function Backdrop(options) { 847 this.options = options || {}; 848 this.backdropEl = document.createElement('div'); 849 this.backdropEl.setAttribute('class', 'backdrop animated hide'); 850 this.transIn = 'fadein'; 851 this.transOut = 'fadeout'; 852 this.contentName = 'backdropEl'; 853 this.wrapperName = 'wrapper'; 854 this.wrapper = this.options.wrapperEl || document.body; 855} 856 857extend(Backdrop.prototype, hideable, renderable); 858 859Backdrop.prototype.onClick = function(route) { 860 return this.backdropEl.addEventListener('click', function() { 861 window.location.hash = route; 862 }); 863}; 864 865module.exports = Backdrop; 866 867},{"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],25:[function(require,module,exports){ 868'use strict'; 869 870 871var siteData = require('../site-data'); 872var canonicalizePhone = require('../canonicalize-phone'); 873var Card = require('./card'); 874var hoursRenderer = require('../hours-renderer'); 875var addressHTML = require('../templates/address.hbs'); 876var hoursHTML = require('../templates/hours-card.hbs'); 877var phoneHTML = require('../templates/phone-card.hbs'); 878 879 880function CardListing(options) { 881 var location = siteData.get('location'); 882 var hoursData = siteData.get('hours'); 883 var addrSecondLine; 884 var phoneNumber = siteData.get('phone'); 885 886 this.cards = []; 887 this.options = options || {}; 888 889 if(location) { 890 addrSecondLine = location.city + ' ' + location.state + ', '; 891 addrSecondLine += location.zipcode; 892 893 this.addressCard = new Card({ 894 html: addressHTML(), 895 zLayer: 120 896 }); 897 898 this.addressCard.inject('.line-one', location.address); 899 this.addressCard.inject('.line-two', addrSecondLine); 900 this.cards.push(this.addressCard); 901 } 902 903 if(hoursData) { 904 this.hoursCard = new Card({ 905 html: hoursHTML(), 906 zLayer: 120 907 }); 908 909 this.hoursCard.inject('.hours', hoursRenderer.openToday(hoursData)); 910 this.cards.push(this.hoursCard); 911 } 912 913 if(canonicalizePhone(phoneNumber) !== null) { 914 this.phoneCard = new Card({ 915 html: phoneHTML(), 916 zLayer: 120 917 }); 918 919 this.phoneCard.inject('.phone', phoneNumber); 920 this.cards.push(this.phoneCard); 921 } 922} 923 924CardListing.prototype.renderCards = function() { 925 for(var i = 0; i < this.cards.length; i++) { 926 this.cards[i].render(); 927 this.cards[i].show(); 928 } 929}; 930 931CardListing.prototype.removeCards = function() { 932 for(var i = 0; i < this.cards.length; i++) { 933 this.cards[i].hideAndRemove(); 934 } 935}; 936 937module.exports = CardListing; 938 939},{"../canonicalize-phone":4,"../hours-renderer":7,"../site-data":13,"../templates/address.hbs":14,"../templates/hours-card.hbs":15,"../templates/phone-card.hbs":20,"./card":26}],26:[function(require,module,exports){ 940'use strict'; 941 942var cardCounter = require('../card-counter'); 943var renderable = require('../mixins/renderable'); 944var hideable = require('../mixins/hideable'); 945var extend = require('extend'); 946 947function Card(options) { 948 this.options = options || {}; 949 this.html = options.html; 950 951 this.contentName = 'cardEl'; 952 this.cardEl = document.createElement('div'); 953 this.cardEl.classList.add('info-card'); 954 this.cardEl.classList.add('animated'); 955 this.cardEl.classList.add('zoomIn'); 956 this.cardEl.innerHTML = options.html; 957 this.cardEl.style['z-index'] = options.zLayer || 0; 958 959 this.closeEl = document.createElement('button'); 960 this.closeEl.classList.add('close'); 961 this.closeEl.classList.add('fa'); 962 this.closeEl.classList.add('fa-times'); 963 964 this.closeEl.addEventListener('click', this.hideAndRemove.bind(this)); 965 this.cardEl.appendChild(this.closeEl); 966 967 this.wrapperName = 'wrapper'; 968 this.wrapper = this.options.wrapperEl || document.body; 969 970 this.transIn = 'zoomIn'; 971 this.transOut = 'zoomOut'; 972} 973 974extend(Card.prototype, hideable, renderable); 975 976Card.prototype.hideAndRemove = function() { 977 this.hide(this.remove.bind(this)); 978}; 979 980Card.prototype.inject = function(selector, content) { 981 this.cardEl.querySelector(selector).innerHTML = content; 982}; 983 984Card.prototype.getCardEl = function() { 985 return this.cardEl; 986}; 987 988Card.prototype.getCardHeight = function() { 989 var cardHeight = this.cardEl.offsetHeight; 990 cardHeight += parseInt(this.cardEl.style['margin-top']) || 0; 991 cardHeight += parseInt(this.cardEl.style['margin-bottom']) || 0; 992 993 return cardHeight; 994}; 995 996Card.prototype.onRender = function() { 997 cardCounter.register(this); 998}; 999 1000Card.prototype.onRemove = function() { 1001 cardCounter.unregister(this); 1002}; 1003 1004module.exports = Card; 1005 1006}
1006,{"../card-counter":5,"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],27:[function(require,module,exports){ 1007'use strict'; 1008 1009var hoursRenderer = require('../hours-renderer'); 1010var hideable = require('../mixins/hideable'); 1011var renderable = require('../mixins/renderable'); 1012var extend = require('extend'); 1013 1014 1015function HoursView(options) { 1016 this.options = options || {}; 1017 this.hours = options.hours; 1018 this.hoursEl = hoursRenderer.week(this.hours); 1019 this.contentEl = document.createElement('div'); 1020 this.contentEl.classList.add('hours-view'); 1021 this.contentEl.classList.add('animated'); 1022 this.contentEl.classList.add('hide'); 1023 this.contentEl.appendChild(this.hoursEl); 1024 this.contentName = 'contentEl'; 1025 this.wrapper = this.options.wrapperEl || document.body; 1026 1027 /* Properties to be consumed by hideable mixin */ 1028 this.transIn = 'fadein'; 1029 this.transOut = 'fadeout'; 1030 this.contentName = 'contentEl'; 1031 this.wrapperName = 'wrapper'; 1032 1033 this.setHeight(options.height || 500); 1034} 1035 1036extend(HoursView.prototype, hideable, renderable); 1037 1038HoursView.prototype.setHeight = function(newHeight) { 1039 this.contentEl.style.height = newHeight + 'px'; 1040}; 1041 1042module.exports = HoursView; 1043 1044},{"../hours-renderer":7,"../mixins/hideable":10,"../mixins/renderable":11,"extend":41}],28:[function(require,module,exports){ 1045'use strict'; 1046 1047var toolbarTemplate = require('../templates/map-toolbar.hbs'); 1048var renderable = require('../mixins/renderable'); 1049var hideable = require('../mixins/hideable'); 1050var extend = require('extend'); 1051 1052function MapToolbarView(options) { 1053 options = options || {}; 1054 this.options = options; 1055 this.wrapperName = options.wrapperName; 1056 this.wrapper = options.wrapper; 1057 this.contentName = 'contentEl'; 1058 this.contentEl = document.createElement('section'); 1059 this.contentEl.innerHTML = toolbarTemplate(); 1060 this.contentEl.classList.add('animated'); 1061 this.contentEl.classList.add('map-toolbar'); 1062 this.searchInput = this.contentEl.querySelector('input'); 1063 this.toggleDrive = this.contentEl.querySelector('.drive-icon'); 1064 this.toggleWalk = this.contentEl.querySelector('.walk-icon'); 1065 this.transIn = 'fadein'; 1066 this.transOut = 'fadeout'; 1067 this.selectedMode = 'driving'; 1068} 1069 1070extend(MapToolbarView.prototype, renderable, hideable); 1071 1072 1073/* This function handles the UI of the walk/drive selection. 1074 * It removes the style from the currently selected button and 1075 * adds it to the button passed in from the event handler. 1076 */ 1077MapToolbarView.prototype.select = function(button) { 1078 var selectedEl = this.contentEl.querySelector('.selected'); 1079 selectedEl.classList.remove('selected'); 1080 button.classList.add('selected'); 1081 this.selectedMode = button.getAttribute('data-mode'); 1082}; 1083 1084module.exports = MapToolbarView; 1085 1086},{"../mixins/hideable":10,"../mixins/renderable":11,"../templates/map-toolbar.hbs":17,"extend":41}],29:[function(require,module,exports){ 1087/* global google, navigator */ 1088 1089'use strict'; 1090 1091var debounce = require('debounce'); 1092var extend = require('extend'); 1093var url = require('url'); 1094 1095var googleMapsTemplate = require('../templates/map.hbs'); 1096var MapToolbarView = require('./map-toolbar'); 1097var renderable = require('../mixins/renderable'); 1098 1099var BASEURL = 'https://www.google.com/maps/embed/v1/'; 1100 1101/* This function is the Map constructor. 1102 * Options include: 1103 * 1104 * - height: the height of the map view 1105 * - google embed API key 1106 * - address, city, state, zipcode 1107 */ 1108function MapView(options) { 1109 options = options || {}; 1110 this.options = options; 1111 this.height = options.height || '100%'; 1112 this.address = options.address + ' ' + options.city + ', ' + options.state; 1113 this.address += ' ' + options.zipcode; 1114 this.mapOptions = { 1115 embedAPIKey: options.embedAPIKey, 1116 businessLocation: this.address 1117 }; 1118 this.mapContext = {}; 1119 1120 this.setupMarkup(); 1121 this.getOriginLocation(); 1122 this.attachListeners(); 1123} 1124 1125extend(MapView.prototype, renderable); 1126 1127MapView.prototype.setupMarkup = function() { 1128 var searchHeightOffset; 1129 1130 this.contentName = 'contentEl'; 1131 this.contentEl = document.createElement('div'); 1132 1133 this.wrapperName = 'wrapper'; 1134 this.wrapper = this.options.wrapperEl || document.body; 1135 1136 this.mapToolbar = new MapToolbarView({ 1137 wrapper: this.contentEl, 1138 wrapperName: this.wrapperName 1139 }); 1140 this.mapToolbar.render(); 1141 searchHeightOffset = this.mapToolbar.offsetHeight || 50; 1142 1143 this.mapWrapper = document.createElement('div'); 1144 this.mapWrapper.classList.add('google-map'); 1145 this.mapWrapper.classList.add('animated'); 1146 this.mapWrapper.style.height = this.height - searchHeightOffset + 'px'; 1147 1148 this.contentEl.appendChild(this.mapWrapper); 1149}; 1150 1151MapView.prototype.attachListeners = function() { 1152 var debounceCurrentLocation = debounce( 1153 this.getOriginLocation.bind(this), 1000); 1154 1155 this.mapToolbar.searchInput.addEventListener( 1156 'input', debounceCurrentLocation); 1157 1158 this.mapToolbar.toggleDrive.addEventListener( 1159 'click', this.setTransportMode.bind(this), false); 1160 1161 this.mapToolbar.toggleWalk.addEventListener( 1162 'click', this.setTransportMode.bind(this), false); 1163}; 1164 1165MapView.prototype.setTransportMode = function(event) { 1166 var button = event.currentTarget; 1167 1168 if (!button.classList.contains('selected')) { 1169 var mode = button.getAttribute('data-mode'); 1170 1171 this.mapToolbar.select(button); 1172 this.mapOptions.directionsMode = mode; 1173 this.renderDirectionsMode(); 1174 } 1175}; 1176 1177/* This function sets the origin location using 1178 * one of two methods: 1179 * 1180 * 1. It will use user provided address if the user 1181 * has entered a value via the seach box at the 1182 * top of the view. 1183 * 1184 * 2. If the user has not entered a value in the 1185 * search box and the user has a geolocation 1186 * enabled device and the site has SSL enabled, 1187 * then the function will use navigator to get 1188 * the current location. 1189 * 1190 * If 1 and 2 are not available, the map will 1191 * simply display a marker where the given business 1192 * address is located. 1193 */ 1194MapView.prototype.getOriginLocation = function() { 1195 var setCurrentLocation = function(position) { 1196 var latStr = String(position.coords.latitude); 1197 var lngStr = String(position.coords.longitude); 1198 this.mapOptions.originLocation = latStr + ',' + lngStr; 1199 this.render(); 1200 }.bind(this); 1201 1202 1203 if(this.mapToolbar.searchInput.value) { 1204 this.mapOptions.originLocation = this.mapToolbar.searchInput.value; 1205 this.renderDirectionsMode(); 1206 return; 1207 } 1208 1209 if(navigator.geolocation) { 1210 // HTML5 Geolocation API 1211 // renders business location if current position cannot be retrieved 1212 navigator.geolocation.getCurrentPosition( 1213 setCurrentLocation, 1214 this.renderPlaceMode.bind(this), 1215 {timeout: 3500} 1216 ); 1217 return; 1218 } 1219 1220 this.renderPlaceMode(); 1221}; 1222 1223MapView.prototype.renderPlaceMode = function() { 1224 var placeModeUrl = BASEURL + 'place'; 1225 var urlObj = url.parse(placeModeUrl); 1226 1227 urlObj.query ={ 1228 key: this.mapOptions.embedAPIKey, 1229 q: this.mapOptions.businessLocation 1230 }; 1231 1232 this.mapContext.mapSource = urlObj.format(); 1233 this.render(); 1234}; 1235 1236MapView.prototype.renderDirectionsMode = function() { 1237 var directionsModeUrl = BASEURL + 'directions'; 1238 var urlObj = url.parse(directionsModeUrl); 1239 1240 urlObj.query = { 1241 key: this.mapOptions.embedAPIKey, 1242 origin: this.mapOptions.originLocation, 1243 destination: this.mapOptions.businessLocation 1244 } 1245 1246 if(this.mapOptions.directionsMode) { 1247 urlObj.query.mode = this.mapOptions.directionsMode; 1248 } 1249 1250 this.mapContext.mapSource = urlObj.format(); 1251 this.render(); 1252}; 1253 1254MapView.prototype.getWrapper = function() { 1255 return this.mapWrapper; 1256}; 1257 1258/* Show the Map */ 1259MapView.prototype.show = function() { 1260 this.mapWrapper.classList.add('open'); 1261 this.mapWrapper.classList.add('fadein'); 1262 this.mapWrapper.classList.remove('fadeout'); 1263 this.mapToolbar.show(); 1264}; 1265 1266/* Hide the Map */ 1267MapView.prototype.hide = function(cb, timeout) { 1268 if(timeout === undefined) { 1269 timeout = 400; 1270 } 1271 1272 this.mapWrapper.classList.add('fadeout'); 1273 this.mapWrapper.classList.remove('fadein'); 1274 this.mapToolbar.hide(); 1275 1276 var removeOpenClass = function() { 1277 this.mapWrapper.classList.remove('open'); 1278 this.mapToolbar.contentEl.classList.remove('open'); 1279 if(typeof cb === 'function') { 1280 cb(); 1281 } 1282 }; 1283 1284 setTimeout(removeOpenClass.bind(this), timeout); 1285}; 1286 1287MapView.prototype.onRender = function() { 1288 this.mapWrapper.innerHTML = googleMapsTemplate(this.mapContext); 1289}; 1290 1291module.exports = MapView; 1292 1293},{"../mixins/renderable":11,"../templates/map.hbs":18,"./map-toolbar":28,"debounce":40,"extend":41,"url":141}],30:[function(require,module,exports){ 1294'use strict'; 1295 1296var MapView = require('./map'); 1297var Backdrop = require('./backdrop'); 1298var Toolbar = require('./toolbar'); 1299var ActionButton = require('./action-button'); 1300var HoursView = require('./hours'); 1301var animatedScrollTo = require('animated-scrollto'); 1302var siteData = require('../site-data'); 1303var CardListing = require('./card-listing'); 1304var canonicalizePhone = require('../canonicalize-phone'); 1305 1306
1307var getViewportHeight = function() { 1308 return Math.max( 1309 document.documentElement.clientHeight, window.innerHeight || 0); 1310}; 1311 1312function PageView(options) { 1313 this.options = options || {}; 1314 this.actionButton = new ActionButton(); 1315 this.toolbar = new Toolbar(); 1316 this.backdrop = new Backdrop(); 1317 this.mapHoursHeight = getViewportHeight() - this.toolbar.getHeight(); 1318 1319 this.cardListing = new CardListing(); 1320 1321 this.initializePhone(); 1322 1323 var hasLoc = siteData.get('location'); 1324 var hasPhone = siteData.get('phone'); 1325 var hasHours = siteData.get('hours'); 1326 1327 if(hasHours) { 1328 this.initializeHours(); 1329 } 1330 1331 if(hasLoc) { 1332 this.initializeMap(); 1333 } 1334 1335 if(hasLoc || hasHours || hasPhone) { 1336 this.actionButton.render(); 1337 } 1338 1339 this.backdrop.onClick('exit'); 1340 1341 var resize = function(event) { 1342 var mapHoursHeight = getViewportHeight() - this.toolbar.getHeight(); 1343 if(this.mapView && this.mapView.google) { 1344 this.mapView.setHeight(mapHoursHeight); 1345 } 1346 1347 if(this.hoursView) { 1348 this.hoursView.setHeight(mapHoursHeight); 1349 } 1350 }; 1351 1352 window.addEventListener('resize', resize.bind(this)); 1353} 1354 1355PageView.prototype.initializeMap = function() { 1356 var location = siteData.get('location'); 1357 var embedAPIKey = siteData.get('embedAPIKey'); 1358 1359 this.mapView = new MapView({ 1360 address: location.address, 1361 city: location.city, 1362 state: location.state, 1363 zipcode: location.zipcode, 1364 height: this.mapHoursHeight, 1365 embedAPIKey: embedAPIKey 1366 }); 1367 1368 this.toolbar.showButton('map'); 1369}; 1370 1371PageView.prototype.initializeHours = function() { 1372 this.hoursView = new HoursView({ 1373 hours: siteData.get('hours'), 1374 height: this.mapHoursHeight 1375 }); 1376 1377 this.toolbar.showButton('hours'); 1378}; 1379 1380PageView.prototype.initializePhone = function() { 1381 var phoneNumber = siteData.get('phone'); 1382 var canonicalPhone = canonicalizePhone(phoneNumber); 1383 1384 if(canonicalPhone !== null) { 1385 this.toolbar.phoneNumber(canonicalPhone); 1386 this.toolbar.showButton('phone'); 1387 } 1388}; 1389 1390PageView.prototype.open = function() { 1391 animatedScrollTo(document.body, 0, 400); 1392 this.backdrop.render(); 1393 this.backdrop.show(); 1394 this.actionButton.open(); 1395 this.toolbar.render(); 1396 this.toolbar.show(); 1397 this.actionButton.open(); 1398}; 1399 1400PageView.prototype.renderToolbar = function() { 1401 this.open(); 1402 this.cardListing.renderCards(); 1403}; 1404 1405PageView.prototype.renderHours = function() { 1406 if(this.hoursView) { 1407 this.hoursView.render(); 1408 this.hoursView.show(); 1409 } 1410 1411 this.removeMap(); 1412 this.open(); 1413 this.cardListing.removeCards(); 1414}; 1415 1416PageView.prototype.renderMap = function() { 1417 if(this.mapView) { 1418 this.mapView.render(); 1419 this.mapView.show(); 1420 } 1421 1422 this.removeHours(); 1423 this.open(); 1424 this.cardListing.removeCards(); 1425}; 1426 1427PageView.prototype.removeActionButton = function() { 1428 if(this.actionButton.isRendered) { 1429 this.actionButton.remove(); 1430 } 1431}; 1432 1433PageView.prototype.removeMap = function() { 1434 if(this.mapView) { 1435 this.mapView.hide(this.mapView.remove.bind(this.mapView)); 1436 } 1437}; 1438 1439PageView.prototype.removeHours = function() { 1440 if(this.hoursView) { 1441 this.hoursView.hide(this.hoursView.remove.bind(this.hoursView)); 1442 } 1443}; 1444 1445PageView.prototype.removeToolbar = function() { 1446 this.toolbar.hide(this.toolbar.remove.bind(this.toolbar)); 1447}; 1448 1449PageView.prototype.removeBackdrop = function() { 1450 this.backdrop.hide(this.backdrop.remove.bind(this.backdrop)); 1451}; 1452 1453PageView.prototype.removeAll = function() { 1454 this.removeHours(); 1455 this.removeMap(); 1456 this.removeBackdrop(); 1457 this.removeToolbar(); 1458 this.actionButton.close(); 1459 1460 this.cardListing.removeCards(); 1461}; 1462 1463PageView.shouldRender = function() { 1464 var phone = siteData.get('phone'); 1465 var hours = siteData.get('hours'); 1466 var location = siteData.get('location'); 1467 1468 return phone || hours || location; 1469}; 1470 1471module.exports = PageView; 1472 1473},{"../canonicalize-phone":4,"../site-data":13,"./action-button":23,"./backdrop":24,"./card-listing":25,"./hours":27,"./map":29,"./toolbar":31,"animated-scrollto":37}],31:[function(require,module,exports){ 1474'use strict'; 1475 1476var hideable = require('../mixins/hideable'); 1477var renderable = require('../mixins/renderable'); 1478var extend = require('extend');
1479var toolbarHTML = require('../templates/mobile-features.hbs'); 1480 1481function Toolbar(options) { 1482 this.options = options || {}; 1483 this.contentEl = document.createElement('section'); 1484 this.contentName = 'contentEl'; 1485 1486 this.wrapperEl = this.options.wrapperEl || document.body; 1487 this.wrapperName = 'wrapperEl'; 1488 1489 this.transIn = 'fadeinup'; 1490 this.transOut = 'fadeoutdown'; 1491 1492 this.contentEl.innerHTML = toolbarHTML(); 1493 1494 this.contentEl.classList.add('mobile-features'); 1495 this.contentEl.classList.add('animated'); 1496 this.contentEl.classList.add('hide'); 1497 1498 this.noscroll = true; 1499} 1500 1501extend(Toolbar.prototype, hideable, renderable); 1502 1503Toolbar.prototype.getWrapperEl = function() { 1504 return this.contentEl; 1505}; 1506 1507Toolbar.prototype.showButton = function(buttonName) { 1508 var buttonEl = this.contentEl.querySelector('.' + buttonName); 1509 1510 buttonEl.classList.remove('hide'); 1511}; 1512 1513Toolbar.prototype.phoneNumber = function(phoneNumber) { 1514 var callEl = this.contentEl.querySelector('#location-tools-phone'); 1515 1516 callEl.href = 'tel:' + phoneNumber; 1517}; 1518 1519Toolbar.prototype.getHeight = function() { 1520 return this.contentEl.offsetHeight || 70; 1521}; 1522 1523Toolbar.prototype.onDirectionsClick = function(func) { 1524 this.contentEl.querySelector('#location-tools-map') 1525 .addEventListener('click', func); 1526}; 1527 1528Toolbar.prototype.onPhoneClick = function(func) { 1529 this.contentEl.querySelector('#location-tools-phone') 1530 .addEventListener('click', func); 1531}; 1532 1533Toolbar.prototype.onHoursClick = function(func) { 1534 this.contentEl.querySelector('#location-tools-hours') 1535 .addEventListener('click', func); 1536}; 1537 1538module.exports = Toolbar; 1539 1540},{"../mixins/hideable":10,"../mixins/renderable":11,"../templates/mobile-features.hbs":19,"extend":41}],32:[function(require,module,exports){ 1541'use strict'; 1542 1543 1544var windowManager = { 1545 set: function(_window) { 1546 this.window = _window; 1547 }, 1548 1549 get: function() { 1550 return this.window; 1551 }, 1552 1553 reset: function() { 1554 this.window = this.originalWindow; 1555 }, 1556 1557 init: function(_window) { 1558 this.window = _window; 1559 this.originalWindow = _window; 1560 } 1561}; 1562 1563windowManager.init(window); 1564 1565module.exports = windowManager; 1566 1567},{}],33:[function(require,module,exports){ 1568var assign = require('lodash.assign'); 1569 1570/// Following code is largely pasted from Backbone.js 1571 1572// Helper function to correctly set up the prototype chain, for subclasses. 1573// Similar to `goog.inherits`, but uses a hash of prototype properties and 1574// class properties to be extended. 1575var extend = function(protoProps) { 1576 var parent = this; 1577 var child; 1578 var args = [].slice.call(arguments); 1579 1580 // The constructor function for the new subclass is either defined by you 1581 // (the "constructor" property in your `extend` definition), or defaulted 1582 // by us to simply call the parent's constructor. 1583 if (protoProps && protoProps.hasOwnProperty('constructor')) { 1584 child = protoProps.constructor; 1585 } else { 1586 child = function () { 1587 return parent.apply(this, arguments); 1588 }; 1589 } 1590 1591 // Add static properties to the constructor function from parent 1592 assign(child, parent); 1593 1594 // Set the prototype chain to inherit from `parent`, without calling 1595 // `parent`'s constructor function. 1596 var Surrogate = function(){ this.constructor = child; }; 1597 Surrogate.prototype = parent.prototype; 1598 child.prototype = new Surrogate(); 1599 1600 // Mix in all prototype properties to the subclass if supplied.
1601 if (protoProps) { 1602 args.unshift(child.prototype); 1603 assign.apply(null, args); 1604 } 1605 1606 // Set a convenience property in case the parent's prototype is needed 1607 // later. 1608 child.__super__ = parent.prototype; 1609 1610 return child; 1611}; 1612 1613// Expose the extend function 1614module.exports = extend; 1615 1616},{"lodash.assign":57}],34:[function(require,module,exports){ 1617;if (typeof window !== "undefined") { window.ampersand = window.ampersand || {}; window.ampersand["ampersand-events"] = window.ampersand["ampersand-events"] || []; window.ampersand["ampersand-events"].push("1.1.1");} 1618var runOnce = require('lodash.once'); 1619var uniqueId = require('lodash.uniqueid'); 1620var keys = require('lodash.keys'); 1621var isEmpty = require('lodash.isempty'); 1622var each = require('lodash.foreach'); 1623var bind = require('lodash.bind'); 1624var assign = require('lodash.assign'); 1625var slice = Array.prototype.slice; 1626var eventSplitter = /\s+/; 1627 1628 1629var Events = { 1630 // Bind an event to a `callback` function. Passing `"all"` will bind 1631 // the callback to all events fired. 1632 on: function(name, callback, context) { 1633 if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; 1634 this._events || (this._events = {}); 1635 var events = this._events[name] || (this._events[name] = []); 1636 events.push({callback: callback, context: context, ctx: context || this}); 1637 return this; 1638 }, 1639 1640 // Bind an event to only be triggered a single time. After the first time 1641 // the callback is invoked, it will be removed. 1642 once: function(name, callback, context) { 1643 if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; 1644 var self = this; 1645 var once = runOnce(function() { 1646 self.off(name, once); 1647 callback.apply(this, arguments); 1648 }); 1649 once._callback = callback; 1650 return this.on(name, once, context); 1651 }, 1652 1653 // Remove one or many callbacks. If `context` is null, removes all 1654 // callbacks with that function. If `callback` is null, removes all 1655 // callbacks for the event. If `name` is null, removes all bound 1656 // callbacks for all events. 1657 off: function(name, callback, context) { 1658 var retain, ev, events, names, i, l, j, k; 1659 if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; 1660 if (!name && !callback && !context) { 1661 this._events = void 0; 1662 return this; 1663 } 1664 names = name ? [name] : keys(this._events); 1665 for (i = 0, l = names.length; i < l; i++) { 1666 name = names[i]; 1667 if (events = this._events[name]) { 1668 this._events[name] = retain = []; 1669 if (callback || context) { 1670 for (j = 0, k = events.length; j < k; j++) { 1671 ev = events[j]; 1672 if ((callback && callback !== ev.callback && callback !== ev.callback._callback) || 1673 (context && context !== ev.context)) { 1674 retain.push(ev); 1675 } 1676 } 1677 } 1678 if (!retain.length) delete this._events[name]; 1679 } 1680 } 1681 1682 return this; 1683 }, 1684 1685 // Trigger one or many events, firing all bound callbacks. Callbacks are 1686 // passed the same arguments as `trigger` is, apart from the event name 1687 // (unless you're listening on `"all"`, which will cause your callback to 1688 // receive the true name of the event as the first argument). 1689 trigger: function(name) { 1690 if (!this._events) return this; 1691 var args = slice.call(arguments, 1); 1692 if (!eventsApi(this, 'trigger', name, args)) return this; 1693 var events = this._events[name]; 1694 var allEvents = this._events.all; 1695 if (events) triggerEvents(events, args); 1696 if (allEvents) triggerEvents(allEvents, arguments); 1697 return this; 1698 }, 1699 1700 // Tell this object to stop listening to either specific events ... or 1701 // to every object it's currently listening to. 1702 stopListening: function(obj, name, callback) { 1703 var listeningTo = this._listeningTo; 1704 if (!listeningTo) return this; 1705 var remove = !name && !callback; 1706 if (!callback && typeof name === 'object') callback = this; 1707 if (obj) (listeningTo = {})[obj._listenId] = obj; 1708 for (var id in listeningTo) { 1709 obj = listeningTo[id]; 1710 obj.off(name, callback, this); 1711 if (remove || isEmpty(obj._events)) delete this._listeningTo[id]; 1712 } 1713 return this; 1714 }, 1715 1716 // extend an object with event capabilities if passed 1717 // or just return a new one. 1718 createEmitter: function (obj) { 1719 return assign(obj || {}, Events); 1720 } 1721}; 1722 1723Events.bind = Events.on; 1724Events.unbind = Events.off; 1725 1726 1727// Implement fancy features of the Events API such as multiple event 1728// names `"change blur"` and jQuery-style event maps `{change: action}` 1729// in terms of the existing API. 1730var eventsApi = function(obj, action, name, rest) { 1731 if (!name) return true; 1732 1733 // Handle event maps. 1734 if (typeof name === 'object') { 1735 for (var key in name) { 1736 obj[action].apply(obj, [key, name[key]].concat(rest)); 1737 } 1738 return false;
1739 } 1740 1741 // Handle space separated event names. 1742 if (eventSplitter.test(name)) { 1743 var names = name.split(eventSplitter); 1744 for (var i = 0, l = names.length; i < l; i++) { 1745 obj[action].apply(obj, [names[i]].concat(rest)); 1746 } 1747 return false; 1748 } 1749 1750 return true; 1751}; 1752 1753// A difficult-to-believe, but optimized internal dispatch function for 1754// triggering events. Tries to keep the usual cases speedy. 1755var triggerEvents = function(events, args) { 1756 var ev; 1757 var i = -1; 1758 var l = events.length; 1759 var a1 = args[0]; 1760 var a2 = args[1]; 1761 var a3 = args[2]; 1762 switch (args.length) { 1763 case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; 1764 case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; 1765 case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; 1766 case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; 1767 default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; 1768 } 1769}; 1770 1771var listenMethods = { 1772 listenTo: 'on', 1773 listenToOnce: 'once' 1774}; 1775 1776// Inversion-of-control versions of `on` and `once`. Tell *this* object to 1777// listen to an event in another object ... keeping track of what it's 1778// listening to. 1779each(listenMethods, function(implementation, method) { 1780 Events[method] = function(obj, name, callback, run) { 1781 var listeningTo = this._listeningTo || (this._listeningTo = {}); 1782 var id = obj._listenId || (obj._listenId = uniqueId('l')); 1783 listeningTo[id] = obj; 1784 if (!callback && typeof name === 'object') callback = this; 1785 obj[implementation](name, callback, this); 1786 return this; 1787 }; 1788}); 1789 1790Events.listenToAndRun = function (obj, name, callback) { 1791 Events.listenTo.apply(this, arguments); 1792 if (!callback && typeof name === 'object') callback = this; 1793 callback.apply(this); 1794 return this; 1795}; 1796 1797module.exports = Events; 1798 1799},{"lodash.assign":57,"lodash.bind":59,"lodash.foreach":60,"lodash.isempty":63,"lodash.keys":67,"lodash.once":68,"lodash.uniqueid":71}],35:[function(require,module,exports){ 1800var Events = require('ampersand-events'); 1801var extend = require('lodash.assign'); 1802var bind = require('lodash.bind'); 1803 1804 1805// Handles cross-browser history management, based on either 1806// [pushState](http://diveintohtml5.info/history.html) and real URLs, or 1807// [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) 1808// and URL fragments. If the browser supports neither. 1809var History = function () { 1810 this.handlers = []; 1811 this.checkUrl = bind(this.checkUrl, this); 1812 1813 // Ensure that `History` can be used outside of the browser. 1814 if (typeof window !== 'undefined') { 1815 this.location = window.location; 1816 this.history = window.history; 1817 } 1818}; 1819 1820// Cached regex for stripping a leading hash/slash and trailing space. 1821var routeStripper = /^[#\/]|\s+$/g; 1822 1823// Cached regex for stripping leading and trailing slashes. 1824var rootStripper = /^\/+|\/+$/g; 1825 1826// Cached regex for stripping urls of hash. 1827var pathStripper = /#.*$/; 1828 1829// Has the history handling already been started? 1830History.started = false; 1831 1832// Set up all inheritable **Backbone.History** properties and methods. 1833extend(History.prototype, Events, { 1834 1835 // The default interval to poll for hash changes, if necessary, is 1836 // twenty times a second. 1837 interval: 50, 1838 1839 // Are we at the app root? 1840 atRoot: function () { 1841 var path = this.location.pathname.replace(/[^\/]$/, '$&/'); 1842 return path === this.root && !this.location.search; 1843 }, 1844 1845 // Gets the true hash value. Cannot use location.hash directly due to bug 1846 // in Firefox where location.hash will always be decoded. 1847 getHash: function (window) { 1848 var match = (window || this).location.href.match(/#(.*)$/); 1849 return match ? match[1] : ''; 1850 }, 1851 1852 // Get the pathname and search params, without the root. 1853 getPath: function () { 1854 var path = decodeURI(this.location.pathname + this.location.search); 1855 var root = this.root.slice(0, -1); 1856 if (!path.indexOf(root)) path = path.slice(root.length); 1857 return path.slice(1); 1858 }, 1859 1860 // Get the cross-browser normalized URL fragment from the path or hash. 1861 getFragment: function (fragment) { 1862 if (fragment == null) { 1863 if (this._hasPushState || !this._wantsHashChange) { 1864 fragment = this.getPath(); 1865 } else { 1866 fragment = this.getHash(); 1867 } 1868 } 1869 return fragment.replace(routeStripper, ''); 1870 }, 1871 1872 // Start the hash change handling, returning `true` if the current URL matches 1873 // an existing route, and `false` otherwise. 1874 start: function (options) { 1875 if (History.started) throw new Error("Backbone.history has already been started"); 1876 History.started = true; 1877 1878 // Figure out the initial configuration. 1879 // Is pushState desired ... is it available? 1880 this.options = extend({root: '/', pushState: true}, this.options, options); 1881 this.root = this.options.root; 1882 this._wantsHashChange = this.options.hashChange !== false; 1883 this._hasHashChange = 'onhashchange' in window; 1884 this._wantsPushState = !!this.options.pushState; 1885 this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); 1886 this.fragment = this.getFragment(); 1887 1888 // Add a cross-platform `addEventListener` shim for older browsers. 1889 var addEventListener = window.addEventListener; 1890 1891 // Normalize root to always include a leading and trailing slash. 1892 this.root = ('/' + this.root + '/').replace(rootStripper, '/'); 1893 1894 // Depending on whether we're using pushState or hashes, and whether 1895 // 'onhashchange' is supported, determine how we check the URL state. 1896 if (this._hasPushState) { 1897 addEventListener('popstate', this.checkUrl, false); 1898 } else if (this._wantsHashChange && this._hasHashChange) { 1899 addEventListener('hashchange', this.checkUrl, false); 1900 } else if (this._wantsHashChange) { 1901 this._checkUrlInterval = setInterval(this.checkUrl, this.interval); 1902 } 1903 1904 // Transition from hashChange to pushState or vice versa if both are 1905 // requested. 1906 if (this._wantsHashChange && this._wantsPushState) { 1907 1908 // If we've started off with a route from a `pushState`-enabled 1909 // browser, but we're currently in a browser that doesn't support it... 1910 if (!this._hasPushState && !this.atRoot()) { 1911 this.location.replace(this.root + '#' + this.getPath()); 1912 // Return immediately as browser will do redirect to new url 1913 return true; 1914 1915 // Or if we've started out with a hash-based route, but we're currently 1916 // in a browser where it could be `pushState`-based instead... 1917 } else if (this._hasPushState && this.atRoot()) { 1918 this.navigate(this.getHash(), {replace: true}); 1919 } 1920 } 1921 1922 if (!this.options.silent) return this.loadUrl(); 1923 }, 1924 1925 // Returns the value of History.started. Allows an app or units tests to 1926 // check whether or not the router has been started with 1927 // router.history.started(); otherwise the started flag is inaccessible 1928 started: function () { 1929 return History.started; 1930 }, 1931 1932 // Disable Backbone.history, perhaps temporarily. Not useful in a real app, 1933 // but possibly useful for unit testing Routers. 1934 stop: function () { 1935 // Add a cross-platform `removeEventListener` shim for older browsers. 1936 var removeEventListener = window.removeEventListener; 1937 1938 // Remove window listeners. 1939 if (this._hasPushState) { 1940 removeEventListener('popstate', this.checkUrl, false); 1941 } else if (this._wantsHashChange && this._hasHashChange) { 1942 removeEventListener('hashchange', this.checkUrl, false); 1943 } 1944 1945 // Some environments will throw when clearing an undefined interval. 1946 if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); 1947 History.started = false;
1948 }, 1949 1950 // Add a route to be tested when the fragment changes. Routes added later 1951 // may override previous routes. 1952 route: function (route, callback) { 1953 this.handlers.unshift({route: route, callback: callback}); 1954 }, 1955 1956 urlChanged: function () { 1957 var current = this.getFragment(); 1958 if (current === this.fragment) return false; 1959 return true; 1960 }, 1961 1962 // Checks the current URL to see if it has changed, and if it has, 1963 // calls `loadUrl`. 1964 checkUrl: function (e) { 1965 this.urlChanged() && this.loadUrl(); 1966 }, 1967 1968 // Attempt to load the current URL fragment. If a route succeeds with a 1969 // match, returns `true`. If no defined routes matches the fragment, 1970 // returns `false`. 1971 loadUrl: function (fragment) { 1972 fragment = this.fragment = this.getFragment(fragment); 1973 return this.handlers.some(function (handler) { 1974 if (handler.route.test(fragment)) { 1975 handler.callback(fragment); 1976 return true; 1977 } 1978 }); 1979 }, 1980 1981 // Save a fragment into the hash history, or replace the URL state if the 1982 // 'replace' option is passed. You are responsible for properly URL-encoding 1983 // the fragment in advance. 1984 // 1985 // The options object can contain `trigger: false` if you wish to have the 1986 // route callback not be fired (sometimes desirable), or `replace: true`, if 1987 // you wish to modify the current URL without adding an entry to the history. 1988 navigate: function (fragment, options) { 1989 if (!History.started) return false; 1990 options = extend({trigger: true}, options); 1991 1992 var url = this.root + (fragment = this.getFragment(fragment || '')); 1993 1994 // Strip the hash and decode for matching. 1995 fragment = decodeURI(fragment.replace(pathStripper, '')); 1996 1997 if (this.fragment === fragment) return; 1998 this.fragment = fragment; 1999 2000 // Don't include a trailing slash on the root. 2001 if (fragment === '' && url !== '/') url = url.slice(0, -1); 2002 2003 // If pushState is available, we use it to set the fragment as a real URL. 2004 if (this._hasPushState) { 2005 this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); 2006 2007 // If hash changes haven't been explicitly disabled, update the hash 2008 // fragment to store history. 2009 } else if (this._wantsHashChange) { 2010 this._updateHash(this.location, fragment, options.replace); 2011 // If you've told us that you explicitly don't want fallback hashchange- 2012 // based history, then `navigate` becomes a page refresh. 2013 } else { 2014 return this.location.assign(url); 2015 } 2016 2017 if (options.trigger) return this.loadUrl(fragment); 2018 }, 2019 2020 // Update the hash location, either replacing the current entry, or adding 2021 // a new one to the browser history. 2022 _updateHash: function (location, fragment, replace) { 2023 if (replace) { 2024 var href = location.href.replace(/(javascript:|#).*$/, ''); 2025 location.replace(href + '#' + fragment); 2026 } else { 2027 // Some browsers require that `hash` contains a leading #. 2028 location.hash = '#' + fragment; 2029 } 2030 } 2031 2032}); 2033 2034module.exports = new History(); 2035 2036},{"ampersand-events":34,"lodash.assign":57,"lodash.bind":59}],36:[function(require,module,exports){ 2037;if (typeof window !== "undefined") { window.ampersand = window.ampersand || {}; window.ampersand["ampersand-router"] = window.ampersand["ampersand-router"] || []; window.ampersand["ampersand-router"].push("3.0.2");} 2038var classExtend = require('ampersand-class-extend'); 2039var Events = require('ampersand-events'); 2040var extend = require('lodash.assign'); 2041var isRegexp = require('lodash.isregexp'); 2042var isFunction = require('lodash.isfunction'); 2043var result = require('lodash.result'); 2044 2045var ampHistory = require('./ampersand-history'); 2046 2047// Routers map faux-URLs to actions, and fire events when routes are 2048// matched. Creating a new one sets its `routes` hash, if not set statically. 2049var Router = module.exports = function (options) {
2050 options || (options = {}); 2051 this.history = options.history || ampHistory; 2052 if (options.routes) this.routes = options.routes; 2053 this._bindRoutes(); 2054 this.initialize.apply(this, arguments); 2055}; 2056 2057// Cached regular expressions for matching named param parts and splatted 2058// parts of route strings. 2059var optionalParam = /\((.*?)\)/g; 2060var namedParam = /(\(\?)?:\w+/g; 2061var splatParam = /\*\w+/g; 2062var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; 2063 2064// Set up all inheritable **Backbone.Router** properties and methods. 2065extend(Router.prototype, Events, { 2066 2067 // Initialize is an empty function by default. Override it with your own 2068 // initialization logic. 2069 initialize: function () {}, 2070 2071 // Manually bind a single named route to a callback. For example: 2072 // 2073 // this.route('search/:query/p:num', 'search', function (query, num) { 2074 // ... 2075 // }); 2076 // 2077 route: function (route, name, callback) { 2078 if (!isRegexp(route)) route = this._routeToRegExp(route); 2079 if (isFunction(name)) { 2080 callback = name; 2081 name = ''; 2082 } 2083 if (!callback) callback = this[name]; 2084 var router = this; 2085 this.history.route(route, function (fragment) { 2086 var args = router._extractParameters(route, fragment); 2087 if (router.execute(callback, args, name) !== false) { 2088 router.trigger.apply(router, ['route:' + name].concat(args)); 2089 router.trigger('route', name, args); 2090 router.history.trigger('route', router, name, args); 2091 } 2092 }); 2093 return this; 2094 }, 2095 2096 // Execute a route handler with the provided parameters. This is an 2097 // excellent place to do pre-route setup or post-route cleanup. 2098 execute: function (callback, args, name) { 2099 if (callback) callback.apply(this, args); 2100 }, 2101 2102 // Simple proxy to `ampHistory` to save a fragment into the history. 2103 navigate: function (fragment, options) { 2104 this.history.navigate(fragment, options); 2105 return this; 2106 }, 2107 2108 // Reload the current route as if it was navigated to from somewhere 2109 // else 2110 reload: function () { 2111 this.history.loadUrl(this.history.fragment); 2112 return this; 2113 }, 2114 2115 // Helper for doing `internal` redirects without adding to history 2116 // and thereby breaking backbutton functionality. 2117 redirectTo: function (newUrl) { 2118 this.navigate(newUrl, {replace: true}); 2119 }, 2120 2121 // Bind all defined routes to `history`. We have to reverse the 2122 // order of the routes here to support behavior where the most general 2123 // routes can be defined at the bottom of the route map. 2124 _bindRoutes: function () { 2125 if (!this.routes) return; 2126 this.routes = result(this, 'routes'); 2127 var route, routes = Object.keys(this.routes); 2128 while ((route = routes.pop()) != null) { 2129 this.route(route, this.routes[route]); 2130 } 2131 }, 2132 2133 // Convert a route string into a regular expression, suitable for matching 2134 // against the current location hash. 2135 _routeToRegExp: function (route) { 2136 route = route 2137 .replace(escapeRegExp, '\\$&') 2138 .replace(optionalParam, '(?:$1)?') 2139 .replace(namedParam, function (match, optional) { 2140 return optional ? match : '([^/?]+)'; 2141 }) 2142 .replace(splatParam, '([^?]*?)'); 2143 return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); 2144 }, 2145 2146 // Given a route, and a URL fragment that it matches, return the array of 2147 // extracted decoded parameters. Empty or unmatched parameters will be 2148 // treated as `null` to normalize cross-browser behavior. 2149 _extractParameters: function (route, fragment) { 2150 var params = route.exec(fragment).slice(1); 2151 return params.map(function (param, i) { 2152 // Don't decode the search params. 2153 if (i === params.length - 1) return param || null; 2154 return param ? decodeURIComponent(param) : null; 2155 }); 2156 } 2157 2158}); 2159 2160Router.extend = classExtend; 2161 2162},{"./ampersand-history":35,"ampersand-class-extend":33,"ampersand-events":34,"lodash.assign":57,"lodash.isfunction":64,"lodash.isregexp":65,"lodash.result":70}],37:[function(require,module,exports){ 2163(function (window) { 2164 var requestAnimFrame = (function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(callback){window.setTimeout(callback,1000/60);};})(); 2165 2166 var easeInOutQuad = function (t, b, c, d) { 2167 t /= d/2; 2168 if (t < 1) return c/2*t*t + b; 2169 t--; 2170 return -c/2 * (t*(t-2) - 1) + b; 2171 }; 2172 2173 var animatedScrollTo = function (element, to, duration, callback) { 2174 var start = element.scrollTop, 2175 change = to - start, 2176 animationStart = +new Date(); 2177 var animating = true; 2178 var lastpos = null; 2179 2180 var animateScroll = function() { 2181 if (!animating) { 2182 return; 2183 }
2184 requestAnimFrame(animateScroll); 2185 var now = +new Date(); 2186 var val = Math.floor(easeInOutQuad(now - animationStart, start, change, duration)); 2187 if (lastpos) { 2188 if (lastpos === element.scrollTop) { 2189 lastpos = val; 2190 element.scrollTop = val; 2191 } else { 2192 animating = false; 2193 } 2194 } else { 2195 lastpos = val; 2196 element.scrollTop = val; 2197 } 2198 if (now > animationStart + duration) { 2199 element.scrollTop = to; 2200 animating = false; 2201 if (callback) { callback(); } 2202 } 2203 }; 2204 requestAnimFrame(animateScroll); 2205 }; 2206 2207 if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { 2208 module.exports = animatedScrollTo; 2209 } else { 2210 window.animatedScrollTo = animatedScrollTo; 2211 } 2212})(window); 2213 2214},{}],38:[function(require,module,exports){ 2215/* 2216 * classList.js: Cross-browser full element.classList implementation. 2217 * 2014-07-23 2218 * 2219 * By Eli Grey, http://eligrey.com 2220 * Public Domain. 2221 * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. 2222 */ 2223 2224/*global self, document, DOMException */ 2225 2226/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2227 2228/* Copied from MDN: 2229 * https://developer.mozilla.org/en-US/docs/Web/API/Element/classList 2230 */ 2231 2232if ("document" in window.self) { 2233 2234 // Full polyfill for browsers with no classList support 2235 // Including IE < Edge missing SVGElement.classList 2236 if (!("classList" in document.createElement("_")) 2237 || document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))) { 2238 2239 (function (view) { 2240 2241 "use strict"; 2242 2243 if (!('Element' in view)) return; 2244 2245 var 2246 classListProp = "classList" 2247 , protoProp = "prototype" 2248 , elemCtrProto = view.Element[protoProp] 2249 , objCtr = Object 2250 , strTrim = String[protoProp].trim || function () { 2251 return this.replace(/^\s+|\s+$/g, ""); 2252 } 2253 , arrIndexOf = Array[protoProp].indexOf || function (item) { 2254 var 2255 i = 0 2256 , len = this.length 2257 ; 2258 for (; i < len; i++) { 2259 if (i in this && this[i] === item) { 2260 return i; 2261 } 2262 } 2263 return -1; 2264 } 2265 // Vendors: please allow content code to instantiate DOMExceptions 2266 , DOMEx = function (type, message) { 2267 this.name = type; 2268 this.code = DOMException[type]; 2269 this.message = message; 2270 } 2271 , checkTokenAndGetIndex = function (classList, token) { 2272 if (token === "") { 2273 throw new DOMEx( 2274 "SYNTAX_ERR" 2275 , "An invalid or illegal string was specified" 2276 ); 2277 } 2278 if (/\s/.test(token)) { 2279 throw new DOMEx( 2280 "INVALID_CHARACTER_ERR" 2281 , "String contains an invalid character" 2282 ); 2283 } 2284 return arrIndexOf.call(classList, token); 2285 } 2286 , ClassList = function (elem) { 2287 var 2288 trimmedClasses = strTrim.call(elem.getAttribute("class") || "") 2289 , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : [] 2290 , i = 0 2291 , len = classes.length 2292 ; 2293 for (; i < len; i++) { 2294 this.push(classes[i]); 2295 } 2296 this._updateClassName = function () { 2297 elem.setAttribute("class", this.toString()); 2298 }; 2299 } 2300 , classListProto = ClassList[protoProp] = [] 2301 , classListGetter = function () { 2302 return new ClassList(this); 2303 } 2304 ; 2305 // Most DOMException implementations don't allow calling DOMException's toString() 2306 // on non-DOMExceptions. Error's toString() is sufficient here. 2307 DOMEx[protoProp] = Error[protoProp]; 2308 classListProto.item = function (i) { 2309 return this[i] || null; 2310 }; 2311 classListProto.contains = function (token) { 2312 token += ""; 2313 return checkTokenAndGetIndex(this, token) !== -1; 2314 }; 2315 classListProto.add = function () { 2316 var 2317 tokens = arguments 2318 , i = 0 2319 , l = tokens.length 2320 , token 2321 , updated = false 2322 ; 2323 do { 2324 token = tokens[i] + ""; 2325 if (checkTokenAndGetIndex(this, token) === -1) { 2326 this.push(token); 2327 updated = true; 2328 } 2329 } 2330 while (++i < l); 2331 2332 if (updated) { 2333 this._updateClassName(); 2334 } 2335 }; 2336 classListProto.remove = function () { 2337 var 2338 tokens = arguments 2339 , i = 0 2340 , l = tokens.length 2341 , token 2342 , updated = false 2343 , index 2344 ; 2345 do { 2346 token = tokens[i] + ""; 2347 index = checkTokenAndGetIndex(this, token); 2348 while (index !== -1) { 2349 this.splice(index, 1); 2350 updated = true; 2351 index = checkTokenAndGetIndex(this, token); 2352 } 2353 } 2354 while (++i < l); 2355 2356 if (updated) { 2357 this._updateClassName(); 2358 } 2359 }; 2360 classListProto.toggle = function (token, force) { 2361 token += ""; 2362 2363 var 2364 result = this.contains(token) 2365 , method = result ? 2366 force !== true && "remove" 2367 : 2368 force !== false && "add" 2369 ; 2370 2371 if (method) { 2372 this[method](token); 2373 } 2374 2375 if (force === true || force === false) { 2376 return force; 2377 } else { 2378 return !result; 2379 } 2380 }; 2381 classListProto.toString = function () { 2382 return this.join(" "); 2383 }; 2384 2385 if (objCtr.defineProperty) { 2386 var classListPropDesc = { 2387 get: classListGetter 2388 , enumerable: true 2389 , configurable: true 2390 };
2391 try { 2392 objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); 2393 } catch (ex) { // IE 8 doesn't support enumerable:true 2394 if (ex.number === -0x7FF5EC54) { 2395 classListPropDesc.enumerable = false; 2396 objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc); 2397 } 2398 } 2399 } else if (objCtr[protoProp].__defineGetter__) { 2400 elemCtrProto.__defineGetter__(classListProp, classListGetter); 2401 } 2402 2403 }(window.self)); 2404 2405 } else { 2406 // There is full or partial native classList support, so just check if we need 2407 // to normalize the add/remove and toggle APIs. 2408 2409 (function () { 2410 "use strict"; 2411 2412 var testElement = document.createElement("_"); 2413 2414 testElement.classList.add("c1", "c2"); 2415 2416 // Polyfill for IE 10/11 and Firefox <26, where classList.add and 2417 // classList.remove exist but support only one argument at a time. 2418 if (!testElement.classList.contains("c2")) { 2419 var createMethod = function(method) { 2420 var original = DOMTokenList.prototype[method]; 2421 2422 DOMTokenList.prototype[method] = function(token) { 2423 var i, len = arguments.length; 2424 2425 for (i = 0; i < len; i++) { 2426 token = arguments[i]; 2427 original.call(this, token); 2428 } 2429 }; 2430 }; 2431 createMethod('add'); 2432 createMethod('remove'); 2433 } 2434 2435 testElement.classList.toggle("c3", false); 2436 2437 // Polyfill for IE 10 and Firefox <24, where classList.toggle does not 2438 // support the second argument. 2439 if (testElement.classList.contains("c3")) { 2440 var _toggle = DOMTokenList.prototype.toggle; 2441 2442 DOMTokenList.prototype.toggle = function(token, force) { 2443 if (1 in arguments && !this.contains(token) === !force) { 2444 return force; 2445 } else { 2446 return _toggle.call(this, token); 2447 } 2448 }; 2449 2450 } 2451 2452 testElement = null; 2453 }()); 2454 } 2455} 2456 2457},{}],39:[function(require,module,exports){ 2458/* 2459 2460© 2011 by Jerry Sievert 2461 2462Permission is hereby granted, free of charge, to any person obtaining a copy 2463of this software and associated documentation files (the "Software"), to deal 2464in the Software without restriction, including without limitation the rights 2465to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 2466copies of the Software, and to permit persons to whom the Software is 2467furnished to do so, subject to the following conditions: 2468 2469The above copyright notice and this permission notice shall be included in 2470all copies or substantial portions of the Software. 2471 2472THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2473IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 2474FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 2475AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 2476LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 2477OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 2478THE SOFTWARE. 2479 2480*/ 2481 2482 2483(function () { 2484 /** @class Date */ 2485 // constants 2486 var monthsAbbr = [], monthsFull = [], daysAbbr = [], daysFull = [], dayNames = {}, monthsAll, daysAll = [], monthNames = []; 2487 monthsAbbr = [ 2488 'Jan', 2489 'Feb', 2490 'Mar', 2491 'Apr', 2492 'May', 2493 'Jun', 2494 'Jul', 2495 'Aug', 2496 'Sep', 2497 'Oct', 2498 'Nov', 2499 'Dec' 2500 ]; 2501 2502 monthsFull = [ 2503 'January', 2504 'February', 2505 'March', 2506 'April', 2507 'May', 2508 'June', 2509 'July', 2510 'August', 2511 'September', 2512 'October', 2513 'November', 2514 'December' 2515 ]; 2516 2517 daysAbbr = [ 2518 'Sun', 2519 'Mon', 2520 'Tue', 2521 'Wed', 2522 'Thu', 2523 'Fri', 2524 'Sat' 2525 ]; 2526 2527 daysFull = [ 2528 'Sunday', 2529 'Monday', 2530 'Tuesday', 2531 'Wednesday', 2532 'Thursday', 2533 'Friday', 2534 'Saturday' 2535 ]; 2536 2537 dayNames = { 2538 'su': 0, 2539 'sun': 0, 2540 'sunday': 0, 2541 'mo': 1, 2542 'mon': 1, 2543 'monday': 1, 2544 'tu': 2, 2545 'tue': 2, 2546 'tuesday': 2, 2547 'we': 3, 2548 'wed': 3, 2549 'wednesday': 3, 2550 'th': 4, 2551 'thu': 4, 2552 'thursday': 4, 2553 'fr': 5, 2554 'fri': 5, 2555 'friday': 5,
2556 'sa': 6, 2557 'sat': 6, 2558 'saturday': 6 2559 }; 2560 monthsAll = monthsFull.concat(monthsAbbr); 2561 daysAll = [ 2562 'su', 2563 'sun', 2564 'sunday', 2565 'mo', 2566 'mon', 2567 'monday', 2568 'tu', 2569 'tue', 2570 'tuesday', 2571 'we', 2572 'wed', 2573 'wednesday', 2574 'th', 2575 'thu', 2576 'thursday', 2577 'fr', 2578 'fri', 2579 'friday', 2580 'sa', 2581 'sat', 2582 'saturday' 2583 ]; 2584 2585 monthNames = { 2586 'jan': 0, 2587 'january': 0, 2588 'feb': 1, 2589 'february': 1, 2590 'mar': 2, 2591 'march': 2, 2592 'apr': 3, 2593 'april': 3, 2594 'may': 4, 2595 'jun': 5, 2596 'june': 5, 2597 'jul': 6, 2598 'july': 6, 2599 'aug': 7, 2600 'august': 7, 2601 'sep': 8, 2602 'september': 8, 2603 'oct': 9, 2604 'october': 9, 2605 'nov': 10, 2606 'november': 10, 2607 'dec': 11, 2608 'december': 11 2609 }; 2610 2611 var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]; 2612 2613 2614 // private helper functions 2615 /** @ignore */ 2616 function pad(str, length) { 2617 str = String(str); 2618 while (str.length < length) { 2619 str = '0' + str; 2620 } 2621 return str; 2622 } 2623 2624 var isInteger = function (str) { 2625 if (str.match(/^(\d+)$/)) { 2626 return true; 2627 } 2628 return false; 2629 }; 2630 var getInt = function (str, i, minlength, maxlength) { 2631 for (var x = maxlength; x >= minlength; x--) { 2632 var token = str.substring(i, i + x); 2633 if (token.length < minlength) { 2634 return null; 2635 } 2636 if (isInteger(token)) { 2637 return token; 2638 } 2639 } 2640 return null; 2641 }; 2642 2643 // static class methods 2644 var origParse = Date.parse; 2645 // ------------------------------------------------------------------ 2646 // getDateFromFormat( date_string , format_string ) 2647 // 2648 // This function takes a date string and a format string. It matches 2649 // If the date string matches the format string, it returns the 2650 // getTime() of the date. If it does not match, it returns NaN. 2651 // Original Author: Matt Kruse <[email protected]> 2652 // WWW: http://www.mattkruse.com/ 2653 // Adapted from: http://www.mattkruse.com/javascript/date/source.html 2654 // ------------------------------------------------------------------ 2655 2656 2657 var getDateFromFormat = function (val, format) { 2658 val = val + ""; 2659 format = format + ""; 2660 var iVal = 0; 2661 var iFormat = 0; 2662 var c = ""; 2663 var token = ""; 2664 var token2 = ""; 2665 var x, y; 2666 var now = new Date(); 2667 var year = now.getYear(); 2668 var month = now.getMonth() + 1; 2669 var date = 1; 2670 var hh = 0; 2671 var mm = 0; 2672 var ss = 0; 2673 var ampm = ""; 2674 2675 2676 2677 while (iFormat < format.length) { 2678 // Get next token from format string 2679 c = format.charAt(iFormat); 2680 token = ""; 2681 while ((format.charAt(iFormat) === c) && (iFormat < format.length)) { 2682 token += format.charAt(iFormat++); 2683 } 2684 // Extract contents of value based on format token 2685 if (token === "yyyy" || token === "yy" || token === "y") { 2686 if (token === "yyyy") { 2687 x = 4; 2688 y = 4; 2689 } 2690 if (token === "yy") { 2691 x = 2; 2692 y = 2; 2693 } 2694 if (token === "y") { 2695 x = 2; 2696 y = 4; 2697 } 2698 year = getInt(val, iVal, x, y); 2699 if (year === null) { 2700 return NaN; 2701 } 2702 iVal += year.length; 2703 if (year.length === 2) { 2704 if (year > 70) { 2705 year = 1900 + (year - 0); 2706 } else { 2707 year = 2000 + (year - 0); 2708 } 2709 } 2710 } else if (token === "MMM" || token === "NNN") {
2711 month = 0; 2712 for (var i = 0; i < monthsAll.length; i++) { 2713 var monthName = monthsAll[i]; 2714 if (val.substring(iVal, iVal + monthName.length).toLowerCase() === monthName.toLowerCase()) { 2715 if (token === "MMM" || (token === "NNN" && i > 11)) { 2716 month = i + 1; 2717 if (month > 12) { 2718 month -= 12; 2719 } 2720 iVal += monthName.length; 2721 break; 2722 } 2723 } 2724 } 2725 if ((month < 1) || (month > 12)) { 2726 return NaN; 2727 } 2728 } else if (token === "EE" || token === "E") { 2729 for (var n = 0; n < daysAll.length; n++) { 2730 var dayName = daysAll[n]; 2731 if (val.substring(iVal, iVal + dayName.length).toLowerCase() === dayName.toLowerCase()) { 2732 iVal += dayName.length; 2733 break; 2734 } 2735 } 2736 } else if (token === "MM" || token === "M") { 2737 month = getInt(val, iVal, token.length, 2); 2738 if (month === null || (month < 1) || (month > 12)) { 2739 return NaN; 2740 } 2741 iVal += month.length; 2742 } else if (token === "dd" || token === "d") { 2743 date = getInt(val, iVal, token.length, 2); 2744 if (date === null || (date < 1) || (date > 31)) { 2745 return NaN; 2746 } 2747 iVal += date.length; 2748 } else if (token === "hh" || token === "h") { 2749 hh = getInt(val, iVal, token.length, 2); 2750 if (hh === null || (hh < 1) || (hh > 12)) { 2751 return NaN; 2752 } 2753 iVal += hh.length; 2754 } else if (token === "HH" || token === "H") { 2755 hh = getInt(val, iVal, token.length, 2); 2756 if (hh === null || (hh < 0) || (hh > 23)) { 2757 return NaN; 2758 } 2759 iVal += hh.length; 2760 } else if (token === "KK" || token === "K") { 2761 hh = getInt(val, iVal, token.length, 2); 2762 if (hh === null || (hh < 0) || (hh > 11)) { 2763 return NaN; 2764 } 2765 iVal += hh.length; 2766 } else if (token === "kk" || token === "k") { 2767 hh = getInt(val, iVal, token.length, 2); 2768 if (hh === null || (hh < 1) || (hh > 24)) { 2769 return NaN; 2770 } 2771 iVal += hh.length; 2772 hh--; 2773 } else if (token === "mm" || token === "m") { 2774 mm = getInt(val, iVal, token.length, 2); 2775 if (mm === null || (mm < 0) || (mm > 59)) { 2776 return NaN; 2777 } 2778 iVal += mm.length; 2779 } else if (token === "ss" || token === "s") { 2780 ss = getInt(val, iVal, token.length, 2); 2781 if (ss === null || (ss < 0) || (ss > 59)) { 2782 return NaN; 2783 } 2784 iVal += ss.length; 2785 } else if (token === "a") { 2786 if (val.substring(iVal, iVal + 2).toLowerCase() === "am") { 2787 ampm = "AM"; 2788 } else if (val.substring(iVal, iVal + 2).toLowerCase() === "pm") { 2789 ampm = "PM"; 2790 } else { 2791 return NaN; 2792 } 2793 iVal += 2; 2794 } else { 2795 if (val.substring(iVal, iVal + token.length) !== token) { 2796 return NaN; 2797 } else { 2798 iVal += token.length; 2799 } 2800 } 2801 } 2802 // If there are any trailing characters left in the value, it doesn't match 2803 if (iVal !== val.length) { 2804 return NaN; 2805 } 2806 // Is date valid for month? 2807 if (month === 2) { 2808 // Check for leap year 2809 if (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) { // leap year 2810 if (date > 29) { 2811 return NaN; 2812 } 2813 } else { 2814 if (date > 28) { 2815 return NaN; 2816 } 2817 } 2818 } 2819 if ((month === 4) || (month === 6) || (month === 9) || (month === 11)) { 2820 if (date > 30) { 2821 return NaN; 2822 } 2823 } 2824 // Correct hours value 2825 if (hh < 12 && ampm === "PM") { 2826 hh = hh - 0 + 12; 2827 } else if (hh > 11 && ampm === "AM") { 2828 hh -= 12; 2829 } 2830 var newdate = new Date(year, month - 1, date, hh, mm, ss); 2831 return newdate.getTime(); 2832 }; 2833 2834 2835 /** @ignore */ 2836 Date.parse = function (date, format) { 2837 if (format) { 2838 return getDateFromFormat(date, format); 2839 } 2840 var timestamp = origParse(date), minutesOffset = 0, match; 2841 if (isNaN(timestamp) && (match = /^(\d{4}|[+\-]\d{6})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?))?/.exec(date))) { 2842 if (match[8] !== 'Z') { 2843 minutesOffset = +match[10] * 60 + (+match[11]); 2844 2845 if (match[9] === '+') { 2846 minutesOffset = 0 - minutesOffset; 2847 } 2848 } 2849 2850 match[7] = match[7] || '000'; 2851 2852 timestamp = Date.UTC(+match[1], +match[2] - 1, +match[3], +match[4], +match[5] + minutesOffset, +match[6], +match[7].substr(0, 3)); 2853 } 2854 2855 return timestamp; 2856 }; 2857 2858 function polyfill(name, func) { 2859 if (Date.prototype[name] === undefined) { 2860 Date.prototype[name] = func; 2861 } 2862 } 2863 2864 /** 2865 Returns new instance of Date object with the date set to today and 2866 the time set to midnight 2867 @static 2868 @returns {Date} Today's Date 2869 @function today 2870 @memberof Date 2871 */ 2872 Date.today = function () { 2873 return new Date().clearTime(); 2874 }; 2875 2876 /** 2877 Returns new instance of Date object with the date set to today and 2878 the time set to midnight in UTC 2879 @static 2880 @returns {Date} Today's Date in UTC 2881 @function UTCtoday 2882 @memberof Date 2883 */ 2884 Date.UTCtoday = function () { 2885 return new Date().clearUTCTime(); 2886 }; 2887 2888 /** 2889 Returns new instance of Date object with the date set to tomorrow and 2890 the time set to midnight 2891 @static 2892 @returns {Date} Tomorrow's Date 2893 @function tomorrow 2894 @memberof Date 2895 */ 2896 Date.tomorrow = function () { 2897 return Date.today().add({days: 1}); 2898 }; 2899 2900 /** 2901 Returns new instance of Date object with the date set to tomorrow and 2902 the time set to midnight in UTC 2903 @static 2904 @returns {Date} Tomorrow's Date in UTC 2905 @function UTCtomorrow 2906 @memberof Date 2907 */ 2908 Date.UTCtomorrow = function () { 2909 return Date.UTCtoday().add({days: 1}); 2910 }; 2911 2912 /** 2913 Returns new instance of Date object with the date set to yesterday and 2914 the time set to midnight 2915 @static 2916 @returns {Date} Yesterday's Date 2917 @function yesterday 2918 @memberof Date 2919 */ 2920 Date.yesterday = function () { 2921 return Date.today().add({days: -1}); 2922 }; 2923 2924 /** 2925 Returns new instance of Date object with the date set to yesterday and 2926 the time set to midnight in UTC 2927 @static 2928 @returns {Date} Yesterday's Date in UTC 2929 @function UTCyesterday 2930 @memberof Date 2931 */ 2932 Date.UTCyesterday = function () { 2933 return Date.UTCtoday().add({days: -1}); 2934 }; 2935 2936 /** 2937 Returns whether the day is valid 2938 @static 2939 @param day {Number} day of the month 2940 @param year {Number} year 2941 @param month {Number} month of the year [0-11] 2942 @returns {Boolean} 2943 @function validateDay 2944 @memberof Date 2945 */ 2946 Date.validateDay = function (day, year, month) { 2947 var date = new Date(year, month, day); 2948 return (date.getFullYear() === year && 2949 date.getMonth() === month && 2950 date.getDate() === day); 2951 }; 2952 2953 /** 2954 Returns whether the year is valid 2955 @static 2956 @param year {Number} year 2957 @returns {Boolean} 2958 @function validateYear
2959 @memberof Date 2960 */ 2961 Date.validateYear = function (year) { 2962 return (year >= 0 && year <= 9999); 2963 }; 2964 2965 /** 2966 Returns whether the second is valid 2967 @static 2968 @param second {Number} second 2969 @returns {Boolean} 2970 @function validateSecond 2971 @memberof Date 2972 */ 2973 Date.validateSecond = function (second) { 2974 return (second >= 0 && second < 60); 2975 }; 2976 2977 /** 2978 Returns whether the month is valid [0-11] 2979 @static 2980 @param month {Number} month 2981 @returns {Boolean} 2982 @function validateMonth 2983 @memberof Date 2984 */ 2985 Date.validateMonth = function (month) { 2986 return (month >= 0 && month < 12); 2987 }; 2988 2989 /** 2990 Returns whether the minute is valid 2991 @static 2992 @param minute {Number} minute 2993 @returns {Boolean} 2994 @function validateMinute 2995 @memberof Date 2996 */ 2997 Date.validateMinute = function (minute) { 2998 return (minute >= 0 && minute < 60); 2999 }; 3000 3001 /** 3002 Returns whether the millisecond is valid 3003 @static 3004 @param millisecond {Number} millisecond 3005 @returns {Boolean} 3006 @function validateMillisecond 3007 @memberof Date 3008 */ 3009 Date.validateMillisecond = function (milli) { 3010 return (milli >= 0 && milli < 1000); 3011 }; 3012 3013 /** 3014 Returns whether the hour is valid [0-23] 3015 @static 3016 @param hour {Number} hour 3017 @returns {Boolean} 3018 @function validateHour 3019 @memberof Date 3020 */ 3021 Date.validateHour = function (hour) { 3022 return (hour >= 0 && hour < 24); 3023 }; 3024 3025 /** 3026 Compares two dates 3027 @static 3028 @param date1 {Date} first date 3029 @param date2 {Date} second date 3030 @returns {Number} -1 if date1 is less than date2, 0 if they are equal, 1 if date1 is more than date2 3031 @function compare 3032 @memberof Date 3033 */ 3034 Date.compare = function (date1, date2) { 3035 if (date1.valueOf() < date2.valueOf()) { 3036 return -1; 3037 } else if (date1.valueOf() > date2.valueOf()) { 3038 return 1; 3039 } 3040 return 0; 3041 }; 3042 3043 /** 3044 Compares two dates to the millisecond 3045 @static 3046 @param date1 {Date} first date 3047 @param date2 {Date} second date 3048 @returns {Boolean} 3049 @function equals 3050 @memberof Date 3051 */ 3052 Date.equals = function (date1, date2) { 3053 return date1.valueOf() === date2.valueOf(); 3054 }; 3055 3056 /** 3057 Compares two dates by day 3058 @static 3059 @param date1 {Date} first date 3060 @param date2 {Date} second date 3061 @returns {Boolean} 3062 @function equalsDay 3063 @memberof Date 3064 */ 3065 Date.equalsDay = function (date1, date2) { 3066 return date1.toYMD() === date2.toYMD(); 3067 }; 3068 3069 /** 3070 Returns the day number for a day [0-6] 3071 @static 3072 @param day {String} day name 3073 @returns {Number} 3074 @function getDayNumberFromName 3075 @memberof Date 3076 */ 3077 Date.getDayNumberFromName = function (name) { 3078 return dayNames[name.toLowerCase()]; 3079 }; 3080 3081 /** 3082 Returns the day number for a month [0-11] 3083 @static 3084 @param month {String} month name 3085 @returns {Number} 3086 @function getMonthNumberFromName 3087 @memberof Date 3088 */ 3089 Date.getMonthNumberFromName = function (name) { 3090 return monthNames[name.toLowerCase()]; 3091 }; 3092 3093 /** 3094 Returns the month name for a month [0-11] 3095 @static 3096 @param month {Number} month 3097 @returns {String} 3098 @function getMonthNameFromNumber 3099 @memberof Date 3100 */ 3101 Date.getMonthNameFromNumber = function (number) { 3102 return monthsFull[number]; 3103 }; 3104 3105 /** 3106 Returns the month name abbreviated for a month [0-11] 3107 @static 3108 @param month {Number} month 3109 @returns {String} 3110 @function getMonthAbbrFromNumber 3111 @memberof Date 3112 */ 3113 Date.getMonthAbbrFromNumber = function (number) { 3114 return monthsAbbr[number]; 3115 }; 3116 3117 /** 3118 Returns whether or not the year is a leap year 3119 @static 3120 @param year {Number} year 3121 @returns {Boolean} 3122 @function isLeapYear 3123 @memberof Date 3124 */ 3125 Date.isLeapYear = function (year) { 3126 return (new Date(year, 1, 29).getDate() === 29); 3127 }; 3128 3129 /** 3130 Returns the number of days in a month 3131 @static 3132 @param year {Number} year 3133 @param month {Number} month 3134 @returns {Number} 3135 @function getDaysInMonth 3136 @memberof Date 3137 */ 3138 Date.getDaysInMonth = function (year, month) { 3139 if (month === 1) { 3140 return Date.isLeapYear(year) ? 29 : 28; 3141 } 3142 return daysInMonth[month]; 3143 }; 3144 3145 /** 3146 Returns the abbreviated month name 3147 @returns {String} 3148 @function getMonthAbbr 3149 @instance 3150 @memberof Date 3151 */ 3152 polyfill('getMonthAbbr', function () { 3153 return monthsAbbr[this.getMonth()]; 3154 }); 3155 3156 /** 3157 Returns the month name 3158 @returns {String} 3159 @function getMonthName 3160 @instance 3161 @memberof Date 3162 */ 3163 polyfill('getMonthName', function () { 3164 return monthsFull[this.getMonth()]; 3165 }); 3166 3167 /** 3168 Returns the name of last month 3169 @returns {String} 3170 @function getLastMonthName 3171 @instance 3172 @memberof Date 3173 */ 3174 polyfill('getLastMonthName', function () { 3175 var i = this.getMonth(); 3176 i = (i === 0 ? 11 : i - 1); 3177 return monthsFull[i]; 3178 }); 3179 3180 /** 3181 Returns the current UTC office 3182 @returns {String} 3183 @function getUTCOffset 3184 @instance 3185 @memberof Date 3186 */ 3187 polyfill('getUTCOffset', function () { 3188 var tz = pad(Math.abs(this.getTimezoneOffset() / 0.6), 4); 3189 if (this.getTimezoneOffset() > 0) { 3190 tz = '-' + tz; 3191 } 3192 return tz; 3193 }); 3194 3195 /** 3196 Returns a padded Common Log Format 3197 @returns {String} 3198 @function toCLFString
3199 @deprecated Will be deprecated in version 2.0 in favor of toFormat 3200 @instance 3201 @memberof Date 3202 */ 3203 polyfill('toCLFString', function () { 3204 return pad(this.getDate(), 2) + '/' + this.getMonthAbbr() + '/' + 3205 this.getFullYear() + ':' + pad(this.getHours(), 2) + ':' + 3206 pad(this.getMinutes(), 2) + ':' + pad(this.getSeconds(), 2) + 3207 ' ' + this.getUTCOffset(); 3208 }); 3209 3210 /** 3211 Returns a padded Year/Month/Day 3212 @returns {String} 3213 @param separator {String} optional, defaults to "-" 3214 @function toYMD 3215 @deprecated Will be deprecated in version 2.0 in favor of toFormat 3216 @instance 3217 @memberof Date 3218 */ 3219 polyfill('toYMD', function (separator) { 3220 separator = typeof separator === 'undefined' ? '-' : separator; 3221 return this.getFullYear() + separator + pad(this.getMonth() + 1, 2) + 3222 separator + pad(this.getDate(), 2); 3223 }); 3224 3225 /** 3226 Returns a formatted String for database insertion 3227 @returns {String} 3228 @function toDBString
3229 @deprecated Will be deprecated in version 2.0 in favor of toFormat 3230 @instance 3231 @memberof Date 3232 */ 3233 polyfill('toDBString', function () { 3234 return this.getUTCFullYear() + '-' + pad(this.getUTCMonth() + 1, 2) + 3235 '-' + pad(this.getUTCDate(), 2) + ' ' + pad(this.getUTCHours(), 2) + 3236 ':' + pad(this.getUTCMinutes(), 2) + ':' + pad(this.getUTCSeconds(), 2); 3237 }); 3238 3239 /** 3240 Sets the time to 00:00:00.0000 and returns a new Date object 3241 @returns {Date} 3242 @function clearTime 3243 @instance 3244 @memberof Date 3245 */ 3246 polyfill('clearTime', function () { 3247 this.setHours(0); 3248 this.setMinutes(0); 3249 this.setSeconds(0); 3250 this.setMilliseconds(0); 3251 3252 return this; 3253 }); 3254 3255 /** 3256 Sets the time to 00:00:00.0000 and returns a new Date object with set to UTC 3257 @returns {Date} 3258 @function clearUTCTime 3259 @instance 3260 @memberof Date 3261 */ 3262 polyfill('clearUTCTime', function () { 3263 this.setUTCHours(0); 3264 this.setUTCMinutes(0); 3265 this.setUTCSeconds(0); 3266 this.setUTCMilliseconds(0); 3267 3268 return this; 3269 }); 3270 3271 /** 3272 Adds `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, and `years` and returns a new Date. 3273 Usage: `data.add({ "seconds": 10, "days": 1 })` 3274 @param additions {Object} 3275 @returns {Date} 3276 @function add 3277 @instance 3278 @memberof Date 3279 */ 3280 polyfill('add', function (obj) { 3281 if (obj.milliseconds !== undefined) { 3282 this.setMilliseconds(this.getMilliseconds() + obj.milliseconds); 3283 } 3284 if (obj.seconds !== undefined) { 3285 this.setSeconds(this.getSeconds() + obj.seconds); 3286 } 3287 if (obj.minutes !== undefined) { 3288 this.setMinutes(this.getMinutes() + obj.minutes); 3289 } 3290 if (obj.hours !== undefined) { 3291 this.setHours(this.getHours() + obj.hours); 3292 } 3293 if (obj.days !== undefined) { 3294 this.setDate(this.getDate() + obj.days); 3295 } 3296 if (obj.weeks !== undefined) { 3297 this.setDate(this.getDate() + (obj.weeks * 7)); 3298 } 3299 if (obj.months !== undefined) { 3300 this.setMonth(this.getMonth() + obj.months); 3301 } 3302 if (obj.years !== undefined) { 3303 this.setFullYear(this.getFullYear() + obj.years); 3304 } 3305 return this; 3306 }); 3307 3308 /** 3309 Adds milliseconds to the Date and returns it 3310 @returns {Date} 3311 @param milliseconds {Number} Number of milliseconds to add 3312 @function addMilliseconds
3313 @deprecated Will be deprecated in version 2.0 in favor of add 3314 @instance 3315 @memberof Date 3316 */ 3317 polyfill('addMilliseconds', function (milliseconds) { 3318 return this.add({ milliseconds: milliseconds }); 3319 }); 3320 3321 /** 3322 Adds seconds to the Date and returns it 3323 @returns {Date} 3324 @param seconds {Number} Number of seconds to add 3325 @function addSeconds 3326 @deprecated Will be deprecated in version 2.0 in favor of add 3327 @instance 3328 @memberof Date 3329 */ 3330 polyfill('addSeconds', function (seconds) { 3331 return this.add({ seconds: seconds }); 3332 }); 3333 3334 /** 3335 Adds minutes to the Date and returns it 3336 @returns {Date} 3337 @param minutes {Number} Number of minutes to add 3338 @function addMinutes 3339 @deprecated Will be deprecated in version 2.0 in favor of add 3340 @instance 3341 @memberof Date 3342 */ 3343 polyfill('addMinutes', function (minutes) { 3344 return this.add({ minutes: minutes }); 3345 }); 3346 3347 /** 3348 Adds hours to the Date and returns it 3349 @returns {Date} 3350 @param hours {Number} Number of hours to add 3351 @function addHours
3352 @deprecated Will be deprecated in version 2.0 in favor of add 3353 @instance 3354 @memberof Date 3355 */ 3356 polyfill('addHours', function (hours) { 3357 return this.add({ hours: hours }); 3358 }); 3359 3360 /** 3361 Adds days to the Date and returns it 3362 @returns {Date} 3363 @param days {Number} Number of days to add 3364 @function addSeconds 3365 @deprecated Will be deprecated in version 2.0 in favor of add 3366 @instance 3367 @memberof Date 3368 */ 3369 polyfill('addDays', function (days) { 3370 return this.add({ days: days }); 3371 }); 3372 3373 /** 3374 Adds weeks to the Date and returns it 3375 @returns {Date} 3376 @param weeks {Number} Number of weeks to add 3377 @function addWeeks 3378 @deprecated Will be deprecated in version 2.0 in favor of add 3379 @instance 3380 @memberof Date 3381 */ 3382 polyfill('addWeeks', function (weeks) { 3383 return this.add({ days: (weeks * 7) }); 3384 }); 3385 3386 /** 3387 Adds months to the Date and returns it 3388 @returns {Date} 3389 @param months {Number} Number of months to add 3390 @function addMonths
3391 @deprecated Will be deprecated in version 2.0 in favor of add 3392 @instance 3393 @memberof Date 3394 */ 3395 polyfill('addMonths', function (months) { 3396 return this.add({ months: months }); 3397 }); 3398 3399 /** 3400 Adds years to the Date and returns it 3401 @returns {Date} 3402 @param years {Number} Number of years to add 3403 @function addYears 3404 @deprecated Will be deprecated in version 2.0 in favor of add 3405 @instance 3406 @memberof Date 3407 */ 3408 polyfill('addYears', function (years) { 3409 return this.add({ years: years }); 3410 }); 3411 3412 /** 3413 Removes `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `weeks`, `months`, and `years` and returns a new Date. 3414 Usage: `data.remove({ "seconds": 10, "days": 1 })` 3415 @param removals {Object} 3416 @returns {Date} 3417 @function remove 3418 @instance 3419 @memberof Date 3420 */ 3421 polyfill('remove', function (obj) { 3422 if (obj.seconds !== undefined) { 3423 this.setSeconds(this.getSeconds() - obj.seconds); 3424 } 3425 if (obj.minutes !== undefined) { 3426 this.setMinutes(this.getMinutes() - obj.minutes); 3427 } 3428 if (obj.hours !== undefined) { 3429 this.setHours(this.getHours() - obj.hours); 3430 } 3431 if (obj.days !== undefined) { 3432 this.setDate(this.getDate() - obj.days); 3433 } 3434 if (obj.weeks !== undefined) { 3435 this.setDate(this.getDate() - (obj.weeks * 7)); 3436 } 3437 if (obj.months !== undefined) { 3438 this.setMonth(this.getMonth() - obj.months); 3439 } 3440 if (obj.years !== undefined) { 3441 this.setFullYear(this.getFullYear() - obj.years); 3442 } 3443 return this; 3444 }); 3445 3446 /** 3447 Removes milliseconds from the Date and returns it 3448 @returns {Date} 3449 @param milliseconds {Number} Number of millseconds to remove 3450 @function removeMilliseconds
3451 @deprecated Will be deprecated in version 2.0 in favor of remove 3452 @instance 3453 @memberof Date 3454 */ 3455 polyfill('removeMilliseconds', function (milliseconds) { 3456 throw new Error('Not implemented'); 3457 }); 3458 3459 /** 3460 Removes seconds from the Date and returns it 3461 @returns {Date} 3462 @param seconds {Number} Number of seconds to remove 3463 @function removeSeconds 3464 @deprecated Will be deprecated in version 2.0 in favor of remove 3465 @instance 3466 @memberof Date 3467 */ 3468 polyfill('removeSeconds', function (seconds) { 3469 return this.remove({ seconds: seconds }); 3470 }); 3471 3472 /** 3473 Removes minutes from the Date and returns it 3474 @returns {Date} 3475 @param seconds {Number} Number of minutes to remove 3476 @function removeMinutes 3477 @deprecated Will be deprecated in version 2.0 in favor of remove 3478 @instance 3479 @memberof Date 3480 */ 3481 polyfill('removeMinutes', function (minutes) { 3482 return this.remove({ minutes: minutes }); 3483 }); 3484 3485 /** 3486 Removes hours from the Date and returns it 3487 @returns {Date} 3488 @param hours {Number} Number of hours to remove 3489 @function removeHours
3490 @deprecated Will be deprecated in version 2.0 in favor of remove 3491 @instance 3492 @memberof Date 3493 */ 3494 polyfill('removeHours', function (hours) { 3495 return this.remove({ hours: hours }); 3496 }); 3497 3498 /** 3499 Removes days from the Date and returns it 3500 @returns {Date} 3501 @param days {Number} Number of days to remove 3502 @function removeDays 3503 @deprecated Will be deprecated in version 2.0 in favor of remove 3504 @instance 3505 @memberof Date 3506 */ 3507 polyfill('removeDays', function (days) { 3508 return this.remove({ days: days }); 3509 }); 3510 3511 /** 3512 Removes weeks from the Date and returns it 3513 @returns {Date} 3514 @param weeks {Number} Number of weeks to remove 3515 @function removeWeeks 3516 @deprecated Will be deprecated in version 2.0 in favor of remove 3517 @instance 3518 @memberof Date 3519 */ 3520 polyfill('removeWeeks', function (weeks) { 3521 return this.remove({ days: (weeks * 7) }); 3522 }); 3523 3524 /** 3525 Removes months from the Date and returns it 3526 @returns {Date} 3527 @param months {Number} Number of months to remove 3528 @function removeMonths
3529 @deprecated Will be deprecated in version 2.0 in favor of remove 3530 @instance 3531 @memberof Date 3532 */ 3533 polyfill('removeMonths', function (months) { 3534 return this.remove({ months: months }); 3535 }); 3536 3537 /** 3538 Removes years from the Date and returns it 3539 @returns {Date} 3540 @param years {Number} Number of years to remove 3541 @function removeYears 3542 @deprecated Will be deprecated in version 2.0 in favor of remove 3543 @instance 3544 @memberof Date 3545 */ 3546 polyfill('removeYears', function (years) { 3547 return this.remove({ years: years }); 3548 }); 3549 3550 /** 3551 Adds weekdays based on a Mon-Fri work schedule and returns it 3552 @returns {Date} 3553 @param weekdays {Number} Number of weekdays to add 3554 @function addWeekdays 3555 @instance 3556 @memberof Date 3557 */ 3558 polyfill('addWeekdays', function (weekdays) { 3559 var day = this.getDay(); 3560 if (day === 0) { day = 7; } 3561 var daysOffset = weekdays; 3562 var weekspan = Math.floor(( weekdays + day - 1 ) / 5.0); 3563 if (weekdays > 0){ 3564 daysOffset += weekspan * 2; 3565 if ( day > 5 ) { daysOffset -= day - 5; } 3566 } else { 3567 daysOffset += Math.min( weekspan * 2, 0); 3568 if ( day > 6 ) { daysOffset -= 1; } 3569 } 3570 return this.addDays( daysOffset ); 3571 }); 3572 3573 /** 3574 Sets the time and date to now 3575 @function setTimeToNow 3576 @instance 3577 @memberof Date 3578 */ 3579 polyfill('setTimeToNow', function () { 3580 var n = new Date(); 3581 this.setMilliseconds(n.getMilliseconds()); 3582 this.setSeconds(n.getSeconds()); 3583 this.setMinutes(n.getMinutes()); 3584 this.setHours(n.getHours()); 3585 }); 3586 3587 /** 3588 Returns a cloned copy of the current Date 3589 @function clone 3590 @instance 3591 @memberof Date 3592 */ 3593 polyfill('clone', function () { 3594 return new Date(this.valueOf()); 3595 }); 3596 3597 /** 3598 Returns whether this Date is between a start and end date 3599 @function between 3600 @returns {Boolean} 3601 @instance 3602 @memberof Date 3603 */ 3604 polyfill('between', function (start, end) { 3605 return (this.valueOf() >= start.valueOf() && 3606 this.valueOf() <= end.valueOf()); 3607 }); 3608 /** 3609 Compares a Date to this Date 3610 @param {Date} Date to compare to 3611 @function compareTo 3612 @returns {Number} -1 if less than date, 0 if they are equal, 1 if more than date 3613 @instance 3614 @memberof Date 3615 */ 3616 polyfill('compareTo', function (date) { 3617 return Date.compare(this, date); 3618 }); 3619 3620 /** 3621 Compares a Date and time to this Date and time for equality 3622 @param {Date} Date to compare to 3623 @function equals 3624 @returns {Boolean} 3625 @instance 3626 @memberof Date 3627 */ 3628 polyfill('equals', function (date) { 3629 return Date.equals(this, date); 3630 }); 3631 3632 /** 3633 Compares a Date to this Date for equality 3634 @param {Date} Date to compare to 3635 @function equalsDay 3636 @returns {Boolean} 3637 @instance 3638 @memberof Date 3639 */ 3640 polyfill('equalsDay', function (date) { 3641 return Date.equalsDay(this, date); 3642 }); 3643 3644 /** 3645 Checks to see if the Date is today 3646 @function isToday 3647 @returns {Boolean} 3648 @instance 3649 @memberof Date 3650 */ 3651 polyfill('isToday', function () { 3652 return Date.equalsDay(this, Date.today()); 3653 }); 3654 3655 /** 3656 Compares a Date to this Date for to see if it is after the Date passed 3657 @param {Date} Date to compare to 3658 @function isAfter 3659 @returns {Boolean} 3660 @instance 3661 @memberof Date 3662 */ 3663 polyfill('isAfter', function (date) { 3664 date = date ? date : new Date(); 3665 return (this.compareTo(date) > 0); 3666 }); 3667 3668 /** 3669 Compares a Date to this Date for to see if it is before the Date passed 3670 @param {Date} Date to compare to 3671 @function isBefore 3672 @returns {Boolean} 3673 @instance 3674 @memberof Date 3675 */ 3676 polyfill('isBefore', function (date) { 3677 date = date ? date : new Date(); 3678 return (this.compareTo(date) < 0); 3679 }); 3680 3681 /** 3682 Returns `true` if the Date is a weekend using standard Saturday/Sunday definition of a weekend 3683 @function isWeekend 3684 @returns {Boolean} 3685 @instance 3686 @memberof Date 3687 */ 3688 polyfill('isWeekend', function (date) { 3689 return (this.getDay() % 6 === 0); 3690 }); 3691 3692 /** 3693 Returns the number of days between this Date and the Date passed in 3694 @function getDaysBetween 3695 @param {Date} Date to compare to 3696 @returns {Number} 3697 @instance 3698 @memberof Date 3699 */ 3700 polyfill('getDaysBetween', function (date) { 3701 return ((date.clone().valueOf() - this.valueOf()) / 86400000) | 0; 3702 }); 3703 3704 /** 3705 Returns the number of hours between this Date and the Date passed in 3706 @function getHoursBetween 3707 @param {Date} Date to compare to 3708 @returns {Number} 3709 @instance 3710 @memberof Date 3711 */ 3712 polyfill('getHoursBetween', function (date) { 3713 return ((date.clone().valueOf() - this.valueOf()) / 3600000) | 0; 3714 }); 3715 3716 /** 3717 Returns the number of minutes between this Date and the Date passed in 3718 @function getMinutesBetween 3719 @param {Date} Date to compare to 3720 @returns {Number} 3721 @instance 3722 @memberof Date 3723 */ 3724 polyfill('getMinutesBetween', function (date) { 3725 return ((date.clone().valueOf() - this.valueOf()) / 60000) | 0; 3726 }); 3727 3728 /** 3729 Returns the number of seconds between this Date and the Date passed in 3730 @function getSecondsBetween 3731 @param {Date} Date to compare to 3732 @returns {Number} 3733 @instance 3734 @memberof Date 3735 */
3736 polyfill('getSecondsBetween', function (date) { 3737 return ((date.clone().valueOf() - this.valueOf()) / 1000) | 0; 3738 }); 3739 3740 /** 3741 Returns the number of milliseconds between this Date and the Date passed in 3742 @function getMillisecondsBetween 3743 @param {Date} Date to compare to 3744 @returns {Number} 3745 @instance 3746 @memberof Date 3747 */ 3748 polyfill('getMillisecondsBetween', function (date) { 3749 return ((date.clone().valueOf() - this.valueOf())) | 0; 3750 }); 3751 3752 /** 3753 Returns the number of months between this Date and the Date passed in 3754 @function getMonthsBetween 3755 @param {Date} Date to compare to 3756 @returns {Number} 3757 @instance 3758 @memberof Date 3759 */ 3760 polyfill('getMonthsBetween', function (date) { 3761 var daysDiff = Math.abs(((+this) / (86400 * 1000)) - ((+date) / (86400 * 1000))); 3762 var start = new Date((+date) < (+this) ? (+date) : (+this)); 3763 var end = new Date((date) > (+this) ? (+date) : (+this)); 3764 3765 var months = 0; 3766 while (+start < +end) { 3767 months++; 3768 start = start.addMonths(1); 3769 } 3770 3771 var days = Math.abs(((+start) / (86400 * 1000)) - ((+end) / (86400 * 1000))); 3772 3773 return months - (days / 31); 3774 }); 3775 3776 /** 3777 Returns the ordinal number of this Date 3778 @function getOrdinalNumber 3779 @returns {Number} 3780 @instance 3781 @memberof Date 3782 */ 3783 polyfill('getOrdinalNumber', function () { 3784 return Math.ceil((this.clone().clearTime() - new Date(this.getFullYear(), 0, 1)) / 86400000) + 1; 3785 }); 3786 3787 /** 3788 Returns the a formatted version of this Date 3789 @function toFormat 3790 @param format {String} Format of the Date, using `YYYY`, `YY`, `MM`, `DD`, `HH`, `HH24`, `MI`, `SS`, etc 3791 @returns {String} 3792 @instance 3793 @memberof Date 3794 */ 3795 polyfill('toFormat', function (format) { 3796 return toFormat(format, getReplaceMap(this)); 3797 }); 3798 3799 /** 3800 Returns the a formatted version of the UTC version of this Date 3801 @function toUTCFormat 3802 @param format {String} Format of the Date, using `YYYY`, `YY`, `MM`, `DD`, `HH`, `HH24`, `MI`, `SS`, etc 3803 @returns {String} 3804 @instance 3805 @memberof Date 3806 */ 3807 polyfill('toUTCFormat', function (format) { 3808 return toFormat(format, getUTCReplaceMap(this)); 3809 }); 3810 3811 /** 3812 Returns the week number of this Date 3813 @function getWeekNumber 3814 @returns {Number} 3815 @instance 3816 @memberof Date 3817 */ 3818 polyfill('getWeekNumber', function() { 3819 var onejan = new Date(this.getFullYear(),0,1); 3820 return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7); 3821 }); 3822 3823 /** 3824 Returns the week number of this Date, zero padded 3825 @function getFullWeekNumber 3826 @returns {Number} 3827 @instance 3828 @memberof Date 3829 */ 3830 polyfill('getFullWeekNumber', function() { 3831 var weekNumber = '' + this.getWeekNumber(); 3832 if (weekNumber.length === 1) { 3833 weekNumber = "0" + weekNumber; 3834 } 3835 3836 return weekNumber; 3837 }); 3838 3839 var toFormat = function(format, replaceMap) { 3840 var f = [ format ], i, l, s; 3841 var replace = function (str, rep) { 3842 var i = 0, l = f.length, j, ll, t, n = []; 3843 for (; i < l; i++) { 3844 if (typeof f[i] == 'string') { 3845 t = f[i].split(str); 3846 for (j = 0, ll = t.length - 1; j < ll; j++) { 3847 n.push(t[j]); 3848 n.push([rep]); // replacement pushed as non-string 3849 } 3850 n.push(t[ll]); 3851 } else { 3852 // must be a replacement, don't process, just push 3853 n.push(f[i]); 3854 } 3855 } 3856 f = n; 3857 }; 3858 3859 for (i in replaceMap) { 3860 replace(i, replaceMap[i]); 3861 } 3862 3863 s = ''; 3864 for (i = 0, l = f.length; i < l; i++) 3865 s += typeof f[i] == 'string' ? f[i] : f[i][0]; 3866 return f.join(''); 3867 }; 3868 3869 var getReplaceMap = function(date) { 3870 var hours = (date.getHours() % 12) ? date.getHours() % 12 : 12; 3871 return { 3872 'YYYY': date.getFullYear(), 3873 'YY': String(date.getFullYear()).slice(-2), 3874 'MMMM': monthsFull[date.getMonth()], 3875 'MMM': monthsAbbr[date.getMonth()], 3876 'MM': pad(date.getMonth() + 1, 2), 3877 'MI': pad(date.getMinutes(), 2), 3878 'M': date.getMonth() + 1, 3879 'DDDD': daysFull[date.getDay()], 3880 'DDD': daysAbbr[date.getDay()], 3881 'DD': pad(date.getDate(), 2), 3882 'D': date.getDate(), 3883 'HH24': pad(date.getHours(), 2), 3884 'HH': pad(hours, 2), 3885 'H': hours, 3886 'SS': pad(date.getSeconds(), 2), 3887 'PP': (date.getHours() >= 12) ? 'PM' : 'AM', 3888 'P': (date.getHours() >= 12) ? 'pm' : 'am', 3889 'LL': pad(date.getMilliseconds(), 3) 3890 }; 3891 }; 3892 3893 var getUTCReplaceMap = function(date) { 3894 var hours = (date.getUTCHours() % 12) ? date.getUTCHours() % 12 : 12; 3895 return { 3896 'YYYY': date.getUTCFullYear(), 3897 'YY': String(date.getUTCFullYear()).slice(-2), 3898 'MMMM': monthsFull[date.getUTCMonth()], 3899 'MMM': monthsAbbr[date.getUTCMonth()], 3900 'MM': pad(date.getUTCMonth() + 1, 2), 3901 'MI': pad(date.getUTCMinutes(), 2), 3902 'M': date.getUTCMonth() + 1, 3903 'DDDD': daysFull[date.getUTCDay()], 3904 'DDD': daysAbbr[date.getUTCDay()], 3905 'DD': pad(date.getUTCDate(), 2), 3906 'D': date.getUTCDate(), 3907 'HH24': pad(date.getUTCHours(), 2), 3908 'HH': pad(hours, 2), 3909 'H': hours, 3910 'SS': pad(date.getUTCSeconds(), 2), 3911 'PP': (date.getUTCHours() >= 12) ? 'PM' : 'AM', 3912 'P': (date.getUTCHours() >= 12) ? 'pm' : 'am', 3913 'LL': pad(date.getUTCMilliseconds(), 3) 3914 }; 3915 }; 3916 3917 /* 3918 * change the language 3919 * @param lang => support "es" Spanish, "fr" french, "pt-BR" Portuguese Brazil 3920 * translate => diego 3921 */ 3922 var language = function (lang) { 3923 if (lang == "es") { 3924 monthsAbbr = [ 3925 'Ene', 3926 'Feb', 3927 'Mar', 3928 'Abr', 3929 'May', 3930 'Jun', 3931 'Jul', 3932 'Ago', 3933 'Sep', 3934 'Oct',
3935 'Nov', 3936 'Dic' 3937 ]; 3938 3939 monthsFull = [ 3940 'Enero', 3941 'Febrero', 3942 'Marzo', 3943 'Abril', 3944 'Mayo', 3945 'Junio', 3946 'Julio', 3947 'Agosto', 3948 'Septiembre', 3949 'Octubre', 3950 'Noviembre', 3951 'Diciembre' 3952 ]; 3953 3954 daysAbbr = [ 3955 'Dom', 3956 'Lun', 3957 'Mar', 3958 'Mie', 3959 'Jue', 3960 'Vie', 3961 'Sab' 3962 ]; 3963 3964 daysFull = [ 3965 'Domingo', 3966 'Lunes', 3967 'Martes', 3968 'Miércoles', 3969 'Jueves', 3970 'Viernes', 3971 'Sábado' 3972 ]; 3973 3974 dayNames = { 3975 'do': 0, 3976 'dom': 0, 3977 'domingo': 0, 3978 'lu': 1, 3979 'lun': 1, 3980 'lunes': 1, 3981 'ma': 2, 3982 'mar': 2, 3983 'martes': 2, 3984 'mi': 3, 3985 'mie': 3, 3986 'miercoles': 3, 3987 'ju': 4, 3988 'jue': 4, 3989 'jueves': 4, 3990 'vi': 5, 3991 'vie': 5, 3992 'viernes': 5, 3993 'sa': 6, 3994 'sab': 6, 3995 'sabado': 6 3996 }; 3997 monthsAll = monthsFull.concat(monthsAbbr); 3998 daysAll = [ 3999 'do', 4000 'dom', 4001 'domingo', 4002 'lu', 4003 'lun', 4004 'lunes', 4005 'ma', 4006 'mar', 4007 'martes', 4008 'mi', 4009 'mie', 4010 'miércoles', 4011 'ju', 4012 'jue', 4013 'jueves', 4014 'vi', 4015 'vie', 4016 'viernes', 4017 'sa', 4018 'sab', 4019 'sábado' 4020 ]; 4021 4022 monthNames = { 4023 'ene': 0, 4024 'enero': 0, 4025 'feb': 1, 4026 'febrero': 1, 4027 'mar': 2, 4028 'marzo': 2, 4029 'abr': 3, 4030 'abril': 3, 4031 'may': 4, 4032 'mayo':4, 4033 'jun': 5, 4034 'junio': 5, 4035 'jul': 6, 4036 'julio': 6, 4037 'ago': 7, 4038 'agosto': 7, 4039 'sep': 8, 4040 'septiembre': 8, 4041 'oct': 9, 4042 'octubre': 9, 4043 'nov': 10, 4044 'noviembre': 10, 4045 'dic': 11, 4046 'diciembre': 11 4047 }; 4048 } else if (lang == "fr") { 4049 monthsAbbr = [ 4050 'Jan', 4051 'Fév', 4052 'Mar', 4053 'Avr', 4054 'Mai', 4055 'Jui', 4056 'Jul', 4057 'Aoû', 4058 'Sep', 4059 'Oct', 4060 'Nov', 4061 'Déc' 4062 ]; 4063 4064 monthsFull = [ 4065 'Janvier', 4066 'Février', 4067 'Mars', 4068 'Avril', 4069 'Mai', 4070 'Juin', 4071 'Juillet', 4072 'Août', 4073 'Septembre', 4074 'Octobre', 4075 'Novembre', 4076 'Décembre' 4077 ]; 4078 4079 daysAbbr = [ 4080 'Dim', 4081 'Lun', 4082 'Mar', 4083 'Mer', 4084 'Jeu', 4085 'Ven', 4086 'Sam' 4087 ]; 4088 4089 daysFull = [ 4090 'Dimanchi', 4091 'Lundi', 4092 'Mardi', 4093 'Mercredi', 4094 'Jeudi', 4095 'Vendredi', 4096 'Samedi' 4097 ]; 4098 4099 dayNames = { 4100 'di': 0, 4101 'dim': 0, 4102 'dimanchi': 0, 4103 'lu': 1, 4104 'lun': 1, 4105 'lundi': 1, 4106 'ma': 2, 4107 'mar': 2, 4108 'mardi': 2, 4109 'me': 3, 4110 'mer': 3, 4111 'mercredi': 3, 4112 'je': 4, 4113 'jeu': 4, 4114 'jeudi': 4, 4115 've': 5, 4116 'ven': 5, 4117 'vendredi': 5,
4118 'sa': 6, 4119 'sam': 6, 4120 'samedi': 6 4121 }; 4122 monthsAll = monthsFull.concat(monthsAbbr); 4123 daysAll = [ 4124 'di', 4125 'dim', 4126 'dimanchi', 4127 'lu', 4128 'lun', 4129 'lundi', 4130 'ma', 4131 'mar', 4132 'mardi', 4133 'me', 4134 'mer', 4135 'mercredi', 4136 'je', 4137 'jeu', 4138 'jeudi', 4139 've', 4140 'ven', 4141 'vendredi', 4142 'sa', 4143 'sam', 4144 'samedi' 4145 ]; 4146 4147 monthNames = { 4148 'jan': 0, 4149 'janvier': 0, 4150 'fév': 1, 4151 'février': 1, 4152 'mar': 2, 4153 'mars': 2, 4154 'avr': 3, 4155 'avril': 3, 4156 'mai': 4, 4157 'jui': 5, 4158 'juin': 5, 4159 'jul': 6, 4160 'juillet': 6, 4161 'aoû': 7, 4162 'août': 7, 4163 'sep': 8, 4164 'septembre': 8, 4165 'oct': 9, 4166 'octobre': 9, 4167 'nov': 10, 4168 'novembre': 10, 4169 'déc': 11, 4170 'décembre': 11 4171 }; 4172 } else if (lang == "pt-BR") { 4173 monthsAbbr = [ 4174 'Jan', 4175 'Fev', 4176 'Mar', 4177 'Abr', 4178 'Mai', 4179 'Jun', 4180 'Jul', 4181 'Ago', 4182 'Set', 4183 'Out', 4184 'Nov', 4185 'Dez' 4186 ]; 4187 4188 monthsFull = [ 4189 'Janeiro', 4190 'Fevereiro', 4191 'Março', 4192 'Abril', 4193 'Maio', 4194 'Junho', 4195 'Julho', 4196 'Agosto', 4197 'Setembro', 4198 'Outubro', 4199 'Novembro', 4200 'Dezembro' 4201 ]; 4202 4203 daysAbbr = [ 4204 'Dom', 4205 'Seg', 4206 'Ter', 4207 'Qua', 4208 'Qui', 4209 'Sex', 4210 'Sab' 4211 ]; 4212 4213 daysFull = [ 4214 'Domingo', 4215 'Segunda', 4216 'Terça', 4217 'Quarta', 4218 'Quinta', 4219 'Sexta', 4220 'Sábado' 4221 ]; 4222 4223 dayNames = { 4224 'do': 0, 4225 'dom': 0, 4226 'domingo': 0, 4227 'se': 1, 4228 'seg': 1, 4229 'segunda': 1, 4230 'te': 2, 4231 'ter': 2, 4232 'terca': 2, 4233 'qa': 3, 4234 'qua': 3, 4235 'quarta': 3, 4236 'qi': 4, 4237 'qui': 4, 4238 'quinta': 4, 4239 'se': 5, 4240 'sex': 5, 4241 'sexta': 5, 4242 'sa': 6, 4243 'sab': 6, 4244 'sabado': 6 4245 }; 4246 monthsAll = monthsFull.concat(monthsAbbr); 4247 daysAll = [ 4248 'do', 4249 'dom', 4250 'domingo', 4251 'se', 4252 'seg', 4253 'segunda', 4254 'te', 4255 'ter', 4256 'terça', 4257 'qa', 4258 'qua', 4259 'quarta', 4260 'qi', 4261 'qui', 4262 'quinta', 4263 'se', 4264 'sex', 4265 'sexta', 4266 'sa', 4267 'sab', 4268 'sábado' 4269 ]; 4270 4271 monthNames = { 4272 'jan': 0, 4273 'janeiro': 0, 4274 'fev': 1, 4275 'fevereiro': 1, 4276 'mar': 2, 4277 'março': 2, 4278 'abr': 3, 4279 'abril': 3, 4280 'mai': 4, 4281 'jun': 5, 4282 'junho': 5, 4283 'jul': 6, 4284 'julho': 6, 4285 'ago': 7, 4286 'agosto': 7, 4287 'set': 8, 4288 'setembro': 8, 4289 'out': 9, 4290 'outubro': 9, 4291 'nov': 10, 4292 'novembro': 10, 4293 'dez': 11, 4294 'dezembro': 11 4295 }; 4296 } 4297 }; 4298 4299 // Are we being imported?.. 4300 if (typeof module !== "undefined" && typeof module.exports === "object") { 4301 module.exports.language = language; 4302 } else if (typeof exports === "object") { 4303 exports.language = language; 4304 } else if (typeof Date.language === "undefined"){ 4305 // ...if not and if no language, then add statically to Date (for browsers.) 4306 Date.language = language; 4307 } 4308}()); 4309 4310},{}],40:[function(require,module,exports){ 4311/** 4312 * Returns a function, that, as long as it continues to be invoked, will not 4313 * be triggered. The function will be called after it stops being called for 4314 * N milliseconds. If `immediate` is passed, trigger the function on the 4315 * leading edge, instead of the trailing. The function also has a property 'clear' 4316 * that is a function which will clear the timer to prevent previously scheduled executions. 4317 * 4318 * @source underscore.js 4319 * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ 4320 * @param {Function} function to wrap 4321 * @param {Number} timeout in ms (`100`) 4322 * @param {Boolean} whether to execute at the beginning (`false`) 4323 * @api public 4324 */ 4325 4326module.exports = function debounce(func, wait, immediate){ 4327 var timeout, args, context, timestamp, result;
4328 if (null == wait) wait = 100; 4329 4330 function later() { 4331 var last = Date.now() - timestamp; 4332 4333 if (last < wait && last >= 0) { 4334 timeout = setTimeout(later, wait - last); 4335 } else { 4336 timeout = null; 4337 if (!immediate) { 4338 result = func.apply(context, args); 4339 context = args = null; 4340 } 4341 } 4342 }; 4343 4344 var debounced = function(){ 4345 context = this; 4346 args = arguments; 4347 timestamp = Date.now(); 4348 var callNow = immediate && !timeout; 4349 if (!timeout) timeout = setTimeout(later, wait); 4350 if (callNow) { 4351 result = func.apply(context, args); 4352 context = args = null; 4353 } 4354 4355 return result; 4356 }; 4357 4358 debounced.clear = function() { 4359 if (timeout) { 4360 clearTimeout(timeout); 4361 timeout = null; 4362 } 4363 }; 4364 4365 return debounced; 4366}; 4367 4368},{}],41:[function(require,module,exports){ 4369'use strict'; 4370 4371var hasOwn = Object.prototype.hasOwnProperty; 4372var toStr = Object.prototype.toString; 4373var defineProperty = Object.defineProperty; 4374var gOPD = Object.getOwnPropertyDescriptor; 4375 4376var isArray = function isArray(arr) { 4377 if (typeof Array.isArray === 'function') { 4378 return Array.isArray(arr); 4379 } 4380 4381 return toStr.call(arr) === '[object Array]'; 4382}; 4383 4384var isPlainObject = function isPlainObject(obj) { 4385 if (!obj || toStr.call(obj) !== '[object Object]') { 4386 return false; 4387 } 4388 4389 var hasOwnConstructor = hasOwn.call(obj, 'constructor'); 4390 var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); 4391 // Not own constructor property must be Object 4392 if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { 4393 return false; 4394 } 4395 4396 // Own properties are enumerated firstly, so to speed up, 4397 // if last one is own, then all properties are own. 4398 var key; 4399 for (key in obj) { /**/ } 4400 4401 return typeof key === 'undefined' || hasOwn.call(obj, key); 4402}; 4403 4404// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target 4405var setProperty = function setProperty(target, options) { 4406 if (defineProperty && options.name === '__proto__') { 4407 defineProperty(target, options.name, { 4408 enumerable: true, 4409 configurable: true, 4410 value: options.newValue, 4411 writable: true 4412 }); 4413 } else { 4414 target[options.name] = options.newValue; 4415 } 4416}; 4417 4418// Return undefined instead of __proto__ if '__proto__' is not an own property 4419var getProperty = function getProperty(obj, name) { 4420 if (name === '__proto__') { 4421 if (!hasOwn.call(obj, name)) { 4422 return void 0; 4423 } else if (gOPD) { 4424 // In early versions of node, obj['__proto__'] is buggy when obj has 4425 // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. 4426 return gOPD(obj, name).value; 4427 } 4428 } 4429 4430 return obj[name]; 4431}; 4432 4433module.exports = function extend() { 4434 var options, name, src, copy, copyIsArray, clone; 4435 var target = arguments[0]; 4436 var i = 1; 4437 var length = arguments.length; 4438 var deep = false; 4439 4440 // Handle a deep copy situation 4441 if (typeof target === 'boolean') { 4442 deep = target; 4443 target = arguments[1] || {}; 4444 // skip the boolean and the target 4445 i = 2; 4446 } 4447 if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { 4448 target = {}; 4449 } 4450 4451 for (; i < length; ++i) { 4452 options = arguments[i]; 4453 // Only deal with non-null/undefined values 4454 if (options != null) { 4455 // Extend the base object 4456 for (name in options) { 4457 src = getProperty(target, name); 4458 copy = getProperty(options, name); 4459 4460 // Prevent never-ending loop 4461 if (target !== copy) { 4462 // Recurse if we're merging plain objects or arrays 4463 if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { 4464 if (copyIsArray) { 4465 copyIsArray = false; 4466 clone = src && isArray(src) ? src : []; 4467 } else { 4468 clone = src && isPlainObject(src) ? src : {}; 4469 } 4470 4471 // Never move original objects, clone them 4472 setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); 4473 4474 // Don't bring in undefined values 4475 } else if (typeof copy !== 'undefined') { 4476 setProperty(target, { name: name, newValue: copy }); 4477 } 4478 } 4479 } 4480 } 4481 } 4482 4483 // Return the modified object 4484 return target; 4485}; 4486 4487},{}],42:[function(require,module,exports){ 4488module.exports = require("handlebars/runtime")["default"]; 4489 4490},{"handlebars/runtime":118}],43:[function(require,module,exports){ 4491/** 4492 * lodash 3.0.0 (Custom Build) <https://lodash.com/>
4493 * Build: `lodash modern modularize exports="npm" -o ./` 4494 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4495 * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> 4496 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4497 * Available under MIT license <https://lodash.com/license> 4498 */ 4499 4500/** 4501 * A specialized version of `_.forEach` for arrays without support for callback 4502 * shorthands or `this` binding. 4503 * 4504 * @private 4505 * @param {Array} array The array to iterate over. 4506 * @param {Function} iteratee The function invoked per iteration. 4507 * @returns {Array} Returns `array`. 4508 */ 4509function arrayEach(array, iteratee) { 4510 var index = -1, 4511 length = array.length; 4512 4513 while (++index < length) { 4514 if (iteratee(array[index], index, array) === false) { 4515 break; 4516 } 4517 } 4518 return array; 4519} 4520 4521module.exports = arrayEach; 4522 4523},{}],44:[function(require,module,exports){ 4524/** 4525 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 4526 * Build: `lodash modern modularize exports="npm" -o ./` 4527 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4528 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4529 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4530 * Available under MIT license <https://lodash.com/license> 4531 */ 4532var baseCopy = require('lodash._basecopy'), 4533 keys = require('lodash.keys'); 4534 4535/** 4536 * The base implementation of `_.assign` without support for argument juggling, 4537 * multiple sources, and `customizer` functions. 4538 * 4539 * @private 4540 * @param {Object} object The destination object. 4541 * @param {Object} source The source object. 4542 * @returns {Object} Returns `object`. 4543 */ 4544function baseAssign(object, source) { 4545 return source == null 4546 ? object 4547 : baseCopy(source, keys(source), object); 4548} 4549 4550module.exports = baseAssign; 4551 4552},{"lodash._basecopy":45,"lodash.keys":67}],45:[function(require,module,exports){ 4553/** 4554 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 4555 * Build: `lodash modern modularize exports="npm" -o ./` 4556 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4557 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4558 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4559 * Available under MIT license <https://lodash.com/license> 4560 */ 4561 4562/** 4563 * Copies properties of `source` to `object`. 4564 * 4565 * @private 4566 * @param {Object} source The object to copy properties from. 4567 * @param {Array} props The property names to copy. 4568 * @param {Object} [object={}] The object to copy properties to. 4569 * @returns {Object} Returns `object`. 4570 */ 4571function baseCopy(source, props, object) { 4572 object || (object = {}); 4573 4574 var index = -1, 4575 length = props.length; 4576 4577 while (++index < length) { 4578 var key = props[index]; 4579 object[key] = source[key]; 4580 } 4581 return object; 4582} 4583 4584module.exports = baseCopy; 4585 4586},{}],46:[function(require,module,exports){ 4587/** 4588 * lodash 3.0.4 (Custom Build) <https://lodash.com/> 4589 * Build: `lodash modern modularize exports="npm" -o ./` 4590 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4591 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4592 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4593 * Available under MIT license <https://lodash.com/license> 4594 */ 4595var keys = require('lodash.keys'); 4596 4597/** 4598 * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 4599 * of an array-like value. 4600 */ 4601var MAX_SAFE_INTEGER = 9007199254740991; 4602 4603/** 4604 * The base implementation of `_.forEach` without support for callback 4605 * shorthands and `this` binding. 4606 * 4607 * @private 4608 * @param {Array|Object|string} collection The collection to iterate over. 4609 * @param {Function} iteratee The function invoked per iteration. 4610 * @returns {Array|Object|string} Returns `collection`. 4611 */ 4612var baseEach = createBaseEach(baseForOwn); 4613 4614/** 4615 * The base implementation of `baseForIn` and `baseForOwn` which iterates 4616 * over `object` properties returned by `keysFunc` invoking `iteratee` for 4617 * each property. Iteratee functions may exit iteration early by explicitly 4618 * returning `false`. 4619 * 4620 * @private 4621 * @param {Object} object The object to iterate over. 4622 * @param {Function} iteratee The function invoked per iteration. 4623 * @param {Function} keysFunc The function to get the keys of `object`. 4624 * @returns {Object} Returns `object`. 4625 */ 4626var baseFor = createBaseFor(); 4627 4628/** 4629 * The base implementation of `_.forOwn` without support for callback 4630 * shorthands and `this` binding. 4631 * 4632 * @private 4633 * @param {Object} object The object to iterate over. 4634 * @param {Function} iteratee The function invoked per iteration. 4635 * @returns {Object} Returns `object`. 4636 */ 4637function baseForOwn(object, iteratee) { 4638 return baseFor(object, iteratee, keys); 4639} 4640 4641/** 4642 * The base implementation of `_.property` without support for deep paths. 4643 * 4644 * @private 4645 * @param {string} key The key of the property to get. 4646 * @returns {Function} Returns the new function. 4647 */ 4648function baseProperty(key) { 4649 return function(object) { 4650 return object == null ? undefined : object[key]; 4651 }; 4652} 4653 4654/** 4655 * Creates a `baseEach` or `baseEachRight` function. 4656 * 4657 * @private 4658 * @param {Function} eachFunc The function to iterate over a collection. 4659 * @param {boolean} [fromRight] Specify iterating from right to left. 4660 * @returns {Function} Returns the new base function. 4661 */ 4662function createBaseEach(eachFunc, fromRight) { 4663 return function(collection, iteratee) { 4664 var length = collection ? getLength(collection) : 0; 4665 if (!isLength(length)) { 4666 return eachFunc(collection, iteratee); 4667 } 4668 var index = fromRight ? length : -1, 4669 iterable = toObject(collection); 4670 4671 while ((fromRight ? index-- : ++index < length)) { 4672 if (iteratee(iterable[index], index, iterable) === false) { 4673 break; 4674 } 4675 } 4676 return collection; 4677 }; 4678} 4679 4680/** 4681 * Creates a base function for `_.forIn` or `_.forInRight`. 4682 * 4683 * @private 4684 * @param {boolean} [fromRight] Specify iterating from right to left. 4685 * @returns {Function} Returns the new base function. 4686 */ 4687function createBaseFor(fromRight) { 4688 return function(object, iteratee, keysFunc) { 4689 var iterable = toObject(object), 4690 props = keysFunc(object), 4691 length = props.length, 4692 index = fromRight ? length : -1; 4693 4694 while ((fromRight ? index-- : ++index < length)) { 4695 var key = props[index]; 4696 if (iteratee(iterable[key], key, iterable) === false) { 4697 break; 4698 } 4699 } 4700 return object; 4701 }; 4702} 4703 4704/** 4705 * Gets the "length" property value of `object`. 4706 * 4707 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 4708 * that affects Safari on at least iOS 8.1-8.3 ARM64. 4709 * 4710 * @private 4711 * @param {Object} object The object to query. 4712 * @returns {*} Returns the "length" value. 4713 */ 4714var getLength = baseProperty('length'); 4715 4716/** 4717 * Checks if `value` is a valid array-like length. 4718 * 4719 * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). 4720 * 4721 * @private 4722 * @param {*} value The value to check. 4723 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 4724 */ 4725function isLength(value) { 4726 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 4727} 4728 4729/** 4730 * Converts `value` to an object if it's not one. 4731 * 4732 * @private 4733 * @param {*} value The value to process. 4734 * @returns {Object} Returns the object. 4735 */ 4736function toObject(value) { 4737 return isObject(value) ? value : Object(value); 4738} 4739 4740/** 4741 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 4742 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 4743 * 4744 * @static 4745 * @memberOf _ 4746 * @category Lang 4747 * @param {*} value The value to check. 4748 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 4749 * @example 4750 * 4751 * _.isObject({}); 4752 * // => true 4753 * 4754 * _.isObject([1, 2, 3]); 4755 * // => true 4756 * 4757 * _.isObject(1); 4758 * // => false 4759 */ 4760function isObject(value) { 4761 // Avoid a V8 JIT bug in Chrome 19-20. 4762 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 4763 var type = typeof value; 4764 return !!value && (type == 'object' || type == 'function'); 4765} 4766 4767module.exports = baseEach; 4768 4769},{"lodash.keys":67}],47:[function(require,module,exports){ 4770/** 4771 * lodash 3.7.2 (Custom Build) <https://lodash.com/>
vendor: 5,345 bytes, lines 4772-4957
4772 * Build: `lodash modern modularize exports="npm" -o ./` 4773 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4774 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4775 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4776 * Available under MIT license <https://lodash.com/license> 4777 */ 4778 4779/** 4780 * The base implementation of `get` without support for string paths 4781 * and default values. 4782 * 4783 * @private 4784 * @param {Object} object The object to query. 4785 * @param {Array} path The path of the property to get. 4786 * @param {string} [pathKey] The key representation of path. 4787 * @returns {*} Returns the resolved value. 4788 */ 4789function baseGet(object, path, pathKey) { 4790 if (object == null) { 4791 return; 4792 } 4793 if (pathKey !== undefined && pathKey in toObject(object)) { 4794 path = [pathKey]; 4795 } 4796 var index = 0, 4797 length = path.length; 4798 4799 while (object != null && index < length) { 4800 object = object[path[index++]]; 4801 } 4802 return (index && index == length) ? object : undefined; 4803} 4804 4805/** 4806 * Converts `value` to an object if it's not one. 4807 * 4808 * @private 4809 * @param {*} value The value to process. 4810 * @returns {Object} Returns the object. 4811 */ 4812function toObject(value) { 4813 return isObject(value) ? value : Object(value); 4814} 4815 4816/** 4817 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 4818 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 4819 * 4820 * @static 4821 * @memberOf _ 4822 * @category Lang 4823 * @param {*} value The value to check. 4824 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 4825 * @example 4826 * 4827 * _.isObject({}); 4828 * // => true 4829 * 4830 * _.isObject([1, 2, 3]); 4831 * // => true 4832 * 4833 * _.isObject(1); 4834 * // => false 4835 */ 4836function isObject(value) { 4837 // Avoid a V8 JIT bug in Chrome 19-20. 4838 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 4839 var type = typeof value; 4840 return !!value && (type == 'object' || type == 'function'); 4841} 4842 4843module.exports = baseGet; 4844 4845},{}],48:[function(require,module,exports){ 4846/** 4847 * lodash 3.0.3 (Custom Build) <https://lodash.com/> 4848 * Build: `lodash modern modularize exports="npm" -o ./` 4849 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4850 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4851 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4852 * Available under MIT license <https://lodash.com/license> 4853 */ 4854 4855/** 4856 * The base implementation of `_.slice` without an iteratee call guard. 4857 * 4858 * @private 4859 * @param {Array} array The array to slice. 4860 * @param {number} [start=0] The start position. 4861 * @param {number} [end=array.length] The end position. 4862 * @returns {Array} Returns the slice of `array`. 4863 */ 4864function baseSlice(array, start, end) { 4865 var index = -1, 4866 length = array.length; 4867 4868 start = start == null ? 0 : (+start || 0); 4869 if (start < 0) { 4870 start = -start > length ? 0 : (length + start); 4871 } 4872 end = (end === undefined || end > length) ? length : (+end || 0); 4873 if (end < 0) { 4874 end += length; 4875 } 4876 length = start > end ? 0 : ((end - start) >>> 0); 4877 start >>>= 0; 4878 4879 var result = Array(length); 4880 while (++index < length) { 4881 result[index] = array[index + start]; 4882 } 4883 return result; 4884} 4885 4886module.exports = baseSlice; 4887 4888},{}],49:[function(require,module,exports){ 4889/** 4890 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 4891 * Build: `lodash modern modularize exports="npm" -o ./` 4892 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4893 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4894 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4895 * Available under MIT license <https://lodash.com/license> 4896 */ 4897 4898/** 4899 * A specialized version of `baseCallback` which only supports `this` binding 4900 * and specifying the number of arguments to provide to `func`. 4901 * 4902 * @private 4903 * @param {Function} func The function to bind. 4904 * @param {*} thisArg The `this` binding of `func`. 4905 * @param {number} [argCount] The number of arguments to provide to `func`. 4906 * @returns {Function} Returns the callback. 4907 */ 4908function bindCallback(func, thisArg, argCount) { 4909 if (typeof func != 'function') { 4910 return identity; 4911 } 4912 if (thisArg === undefined) { 4913 return func; 4914 } 4915 switch (argCount) { 4916 case 1: return function(value) { 4917 return func.call(thisArg, value); 4918 }; 4919 case 3: return function(value, index, collection) { 4920 return func.call(thisArg, value, index, collection); 4921 }; 4922 case 4: return function(accumulator, value, index, collection) { 4923 return func.call(thisArg, accumulator, value, index, collection); 4924 }; 4925 case 5: return function(value, other, key, object, source) { 4926 return func.call(thisArg, value, other, key, object, source); 4927 }; 4928 } 4929 return function() { 4930 return func.apply(thisArg, arguments); 4931 }; 4932} 4933 4934/** 4935 * This method returns the first argument provided to it. 4936 * 4937 * @static 4938 * @memberOf _ 4939 * @category Utility 4940 * @param {*} value Any value. 4941 * @returns {*} Returns `value`. 4942 * @example 4943 * 4944 * var object = { 'user': 'fred' }; 4945 * 4946 * _.identity(object) === object; 4947 * // => true 4948 */ 4949function identity(value) { 4950 return value; 4951} 4952 4953module.exports = bindCallback; 4954 4955},{}],50:[function(require,module,exports){ 4956/** 4957 * lodash 3.1.1 (Custom Build) <https://lodash.com/>
4958 * Build: `lodash modern modularize exports="npm" -o ./` 4959 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 4960 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 4961 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4962 * Available under MIT license <https://lodash.com/license> 4963 */ 4964var bindCallback = require('lodash._bindcallback'), 4965 isIterateeCall = require('lodash._isiterateecall'), 4966 restParam = require('lodash.restparam'); 4967 4968/** 4969 * Creates a function that assigns properties of source object(s) to a given 4970 * destination object. 4971 * 4972 * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. 4973 * 4974 * @private 4975 * @param {Function} assigner The function to assign values. 4976 * @returns {Function} Returns the new assigner function. 4977 */ 4978function createAssigner(assigner) { 4979 return restParam(function(object, sources) { 4980 var index = -1, 4981 length = object == null ? 0 : sources.length, 4982 customizer = length > 2 ? sources[length - 2] : undefined, 4983 guard = length > 2 ? sources[2] : undefined, 4984 thisArg = length > 1 ? sources[length - 1] : undefined; 4985 4986 if (typeof customizer == 'function') { 4987 customizer = bindCallback(customizer, thisArg, 5); 4988 length -= 2; 4989 } else { 4990 customizer = typeof thisArg == 'function' ? thisArg : undefined; 4991 length -= (customizer ? 1 : 0); 4992 } 4993 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 4994 customizer = length < 3 ? undefined : customizer; 4995 length = 1; 4996 } 4997 while (++index < length) { 4998 var source = sources[index]; 4999 if (source) { 5000 assigner(object, source, customizer); 5001 } 5002 } 5003 return object; 5004 }); 5005} 5006 5007module.exports = createAssigner; 5008 5009},{"lodash._bindcallback":49,"lodash._isiterateecall":53,"lodash.restparam":69}],51:[function(require,module,exports){ 5010/** 5011 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 5012 * Build: `lodash modularize exports="npm" -o ./` 5013 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 5014 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5015 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5016 * Available under MIT license <https://lodash.com/license> 5017 */ 5018var root = require('lodash._root'); 5019 5020/** Used to compose bitmasks for wrapper metadata. */ 5021var BIND_FLAG = 1, 5022 BIND_KEY_FLAG = 2, 5023 CURRY_BOUND_FLAG = 4, 5024 CURRY_FLAG = 8, 5025 CURRY_RIGHT_FLAG = 16, 5026 PARTIAL_FLAG = 32, 5027 PARTIAL_RIGHT_FLAG = 64, 5028 ARY_FLAG = 128, 5029 FLIP_FLAG = 512; 5030 5031/** Used as the `TypeError` message for "Functions" methods. */ 5032var FUNC_ERROR_TEXT = 'Expected a function'; 5033 5034/** Used as references for various `Number` constants. */ 5035var INFINITY = 1 / 0, 5036 MAX_SAFE_INTEGER = 9007199254740991, 5037 MAX_INTEGER = 1.7976931348623157e+308, 5038 NAN = 0 / 0; 5039 5040/** Used as the internal argument placeholder. */ 5041var PLACEHOLDER = '__lodash_placeholder__'; 5042 5043/** `Object#toString` result references. */ 5044var funcTag = '[object Function]', 5045 genTag = '[object GeneratorFunction]'; 5046 5047/** Used to match leading and trailing whitespace. */ 5048var reTrim = /^\s+|\s+$/g; 5049 5050/** Used to detect bad signed hexadecimal string values. */ 5051var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 5052 5053/** Used to detect binary string values. */ 5054var reIsBinary = /^0b[01]+$/i; 5055 5056/** Used to detect octal string values. */ 5057var reIsOctal = /^0o[0-7]+$/i; 5058 5059/** Used to detect unsigned integer values. */ 5060var reIsUint = /^(?:0|[1-9]\d*)$/; 5061 5062/** Built-in method references without a dependency on `root`. */ 5063var freeParseInt = parseInt; 5064 5065/** 5066 * A faster alternative to `Function#apply`, this function invokes `func` 5067 * with the `this` binding of `thisArg` and the arguments of `args`. 5068 * 5069 * @private 5070 * @param {Function} func The function to invoke. 5071 * @param {*} thisArg The `this` binding of `func`. 5072 * @param {...*} args The arguments to invoke `func` with. 5073 * @returns {*} Returns the result of `func`. 5074 */ 5075function apply(func, thisArg, args) { 5076 var length = args.length; 5077 switch (length) { 5078 case 0: return func.call(thisArg); 5079 case 1: return func.call(thisArg, args[0]); 5080 case 2: return func.call(thisArg, args[0], args[1]); 5081 case 3: return func.call(thisArg, args[0], args[1], args[2]); 5082 } 5083 return func.apply(thisArg, args); 5084} 5085 5086/** 5087 * Checks if `value` is a valid array-like index. 5088 * 5089 * @private 5090 * @param {*} value The value to check. 5091 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 5092 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 5093 */ 5094function isIndex(value, length) { 5095 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; 5096 length = length == null ? MAX_SAFE_INTEGER : length; 5097 return value > -1 && value % 1 == 0 && value < length; 5098} 5099 5100/** 5101 * Replaces all `placeholder` elements in `array` with an internal placeholder 5102 * and returns an array of their indexes. 5103 * 5104 * @private 5105 * @param {Array} array The array to modify. 5106 * @param {*} placeholder The placeholder to replace. 5107 * @returns {Array} Returns the new array of placeholder indexes. 5108 */ 5109function replaceHolders(array, placeholder) { 5110 var index = -1, 5111 length = array.length, 5112 resIndex = -1, 5113 result = []; 5114 5115 while (++index < length) { 5116 if (array[index] === placeholder) { 5117 array[index] = PLACEHOLDER; 5118 result[++resIndex] = index; 5119 } 5120 } 5121 return result; 5122} 5123 5124/** Used for built-in method references. */ 5125var objectProto = Object.prototype; 5126 5127/** 5128 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 5129 * of values. 5130 */ 5131var objectToString = objectProto.toString; 5132 5133/* Built-in method references for those with the same name as other `lodash` methods. */ 5134var nativeMax = Math.max, 5135 nativeMin = Math.min; 5136 5137/** 5138 * The base implementation of `_.create` without support for assigning 5139 * properties to the created object. 5140 * 5141 * @private 5142 * @param {Object} prototype The object to inherit from. 5143 * @returns {Object} Returns the new object. 5144 */ 5145var baseCreate = (function() { 5146 function object() {} 5147 return function(prototype) { 5148 if (isObject(prototype)) { 5149 object.prototype = prototype; 5150 var result = new object; 5151 object.prototype = undefined; 5152 } 5153 return result || {}; 5154 }; 5155}()); 5156 5157/** 5158 * Creates an array that is the composition of partially applied arguments, 5159 * placeholders, and provided arguments into a single array of arguments. 5160 * 5161 * @private 5162 * @param {Array|Object} args The provided arguments. 5163 * @param {Array}
5163 partials The arguments to prepend to those provided. 5164 * @param {Array} holders The `partials` placeholder indexes. 5165 * @returns {Array} Returns the new array of composed arguments. 5166 */ 5167function composeArgs(args, partials, holders) { 5168 var holdersLength = holders.length, 5169 argsIndex = -1, 5170 argsLength = nativeMax(args.length - holdersLength, 0), 5171 leftIndex = -1, 5172 leftLength = partials.length, 5173 result = Array(leftLength + argsLength); 5174 5175 while (++leftIndex < leftLength) { 5176 result[leftIndex] = partials[leftIndex]; 5177 } 5178 while (++argsIndex < holdersLength) { 5179 result[holders[argsIndex]] = args[argsIndex]; 5180 } 5181 while (argsLength--) { 5182 result[leftIndex++] = args[argsIndex++]; 5183 } 5184 return result; 5185} 5186 5187/** 5188 * This function is like `composeArgs` except that the arguments composition 5189 * is tailored for `_.partialRight`. 5190 * 5191 * @private 5192 * @param {Array|Object} args The provided arguments. 5193 * @param {Array} partials The arguments to append to those provided. 5194 * @param {Array} holders The `partials` placeholder indexes. 5195 * @returns {Array} Returns the new array of composed arguments. 5196 */ 5197function composeArgsRight(args, partials, holders) { 5198 var holdersIndex = -1, 5199 holdersLength = holders.length, 5200 argsIndex = -1, 5201 argsLength = nativeMax(args.length - holdersLength, 0), 5202 rightIndex = -1, 5203 rightLength = partials.length, 5204 result = Array(argsLength + rightLength); 5205 5206 while (++argsIndex < argsLength) { 5207 result[argsIndex] = args[argsIndex]; 5208 } 5209 var offset = argsIndex; 5210 while (++rightIndex < rightLength) { 5211 result[offset + rightIndex] = partials[rightIndex]; 5212 } 5213 while (++holdersIndex < holdersLength) { 5214 result[offset + holders[holdersIndex]] = args[argsIndex++]; 5215 } 5216 return result; 5217} 5218 5219/** 5220 * Copies the values of `source` to `array`. 5221 * 5222 * @private 5223 * @param {Array} source The array to copy values from. 5224 * @param {Array} [array=[]] The array to copy values to. 5225 * @returns {Array} Returns `array`. 5226 */ 5227function copyArray(source, array) { 5228 var index = -1, 5229 length = source.length; 5230 5231 array || (array = Array(length)); 5232 while (++index < length) { 5233 array[index] = source[index]; 5234 } 5235 return array; 5236} 5237 5238/** 5239 * Creates a function that wraps `func` to invoke it with the optional `this` 5240 * binding of `thisArg`. 5241 * 5242 * @private 5243 * @param {Function} func The function to wrap. 5244 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5245 * @param {*} [thisArg] The `this` binding of `func`. 5246 * @returns {Function} Returns the new wrapped function. 5247 */ 5248function createBaseWrapper(func, bitmask, thisArg) { 5249 var isBind = bitmask & BIND_FLAG, 5250 Ctor = createCtorWrapper(func); 5251 5252 function wrapper() { 5253 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 5254 return fn.apply(isBind ? thisArg : this, arguments); 5255 } 5256 return wrapper; 5257} 5258 5259/** 5260 * Creates a function that produces an instance of `Ctor` regardless of 5261 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 5262 * 5263 * @private 5264 * @param {Function} Ctor The constructor to wrap. 5265 * @returns {Function} Returns the new wrapped function. 5266 */ 5267function createCtorWrapper(Ctor) { 5268 return function() { 5269 // Use a `switch` statement to work with class constructors. 5270 // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 5271 // for more details. 5272 var args = arguments; 5273 switch (args.length) { 5274 case 0: return new Ctor; 5275 case 1: return new Ctor(args[0]); 5276 case 2: return new Ctor(args[0], args[1]); 5277 case 3: return new Ctor(args[0], args[1], args[2]); 5278 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 5279 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 5280 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 5281 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 5282 } 5283 var thisBinding = baseCreate(Ctor.prototype), 5284 result = Ctor.apply(thisBinding, args); 5285
5286 // Mimic the constructor's `return` behavior. 5287 // See https://es5.github.io/#x13.2.2 for more details. 5288 return isObject(result) ? result : thisBinding; 5289 }; 5290} 5291 5292/** 5293 * Creates a function that wraps `func` to enable currying. 5294 * 5295 * @private 5296 * @param {Function} func The function to wrap. 5297 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5298 * @param {number} arity The arity of `func`. 5299 * @returns {Function} Returns the new wrapped function. 5300 */ 5301function createCurryWrapper(func, bitmask, arity) { 5302 var Ctor = createCtorWrapper(func); 5303 5304 function wrapper() { 5305 var length = arguments.length, 5306 index = length, 5307 args = Array(length), 5308 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, 5309 placeholder = wrapper.placeholder; 5310 5311 while (index--) { 5312 args[index] = arguments[index]; 5313 } 5314 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 5315 ? [] 5316 : replaceHolders(args, placeholder); 5317 5318 length -= holders.length; 5319 return length < arity 5320 ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) 5321 : apply(fn, this, args); 5322 } 5323 return wrapper; 5324} 5325 5326/** 5327 * Creates a function that wraps `func` to invoke it with optional `this` 5328 * binding of `thisArg`, partial application, and currying. 5329 * 5330 * @private 5331 * @param {Function|string} func The function or method name to wrap. 5332 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5333 * @param {*} [thisArg] The `this` binding of `func`. 5334 * @param {Array} [partials] The arguments to prepend to those provided to the new function. 5335 * @param {Array} [holders] The `partials` placeholder indexes. 5336 * @param {Array} [partialsRight] The arguments to append to those provided to the new function. 5337 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 5338 * @param {Array} [argPos] The argument positions of the new function. 5339 * @param {number} [ary] The arity cap of `func`. 5340 * @param {number} [arity] The arity of `func`. 5341 * @returns {Function} Returns the new wrapped function. 5342 */ 5343function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 5344 var isAry = bitmask & ARY_FLAG, 5345 isBind = bitmask & BIND_FLAG, 5346 isBindKey = bitmask & BIND_KEY_FLAG, 5347 isCurry = bitmask & CURRY_FLAG, 5348 isCurryRight = bitmask & CURRY_RIGHT_FLAG, 5349 isFlip = bitmask & FLIP_FLAG, 5350 Ctor = isBindKey ? undefined : createCtorWrapper(func); 5351 5352 function wrapper() { 5353 var length = arguments.length, 5354 index = length, 5355 args = Array(length); 5356 5357 while (index--) { 5358 args[index] = arguments[index]; 5359 } 5360 if (partials) { 5361 args = composeArgs(args, partials, holders); 5362 } 5363 if (partialsRight) { 5364 args = composeArgsRight(args, partialsRight, holdersRight); 5365 } 5366 if (isCurry || isCurryRight) { 5367 var placeholder = wrapper.placeholder, 5368 argsHolders = replaceHolders(args, placeholder); 5369 5370 length -= argsHolders.length; 5371 if (length < arity) { 5372 return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); 5373 } 5374 } 5375 var thisBinding = isBind ? thisArg : this, 5376 fn = isBindKey ? thisBinding[func] : func; 5377 5378 if (argPos) { 5379 args = reorder(args, argPos); 5380 } else if (isFlip && args.length > 1) { 5381 args.reverse(); 5382 } 5383 if (isAry && ary < args.length) { 5384 args.length = ary; 5385 } 5386 if (this && this !== root && this instanceof wrapper) { 5387 fn = Ctor || createCtorWrapper(fn); 5388 } 5389 return fn.apply(thisBinding, args); 5390 } 5391 return wrapper; 5392} 5393 5394/** 5395 * Creates a function that wraps `func` to invoke it with the optional `this` 5396 * binding of `thisArg` and the `partials` prepended to those provided to 5397 * the wrapper. 5398 * 5399 * @private 5400 * @param {Function} func The function to wrap. 5401 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5402 * @param {*} thisArg The `this` binding of `func`. 5403 * @param {Array}
5403 partials The arguments to prepend to those provided to the new function. 5404 * @returns {Function} Returns the new wrapped function. 5405 */ 5406function createPartialWrapper(func, bitmask, thisArg, partials) { 5407 var isBind = bitmask & BIND_FLAG, 5408 Ctor = createCtorWrapper(func); 5409 5410 function wrapper() { 5411 var argsIndex = -1, 5412 argsLength = arguments.length, 5413 leftIndex = -1, 5414 leftLength = partials.length, 5415 args = Array(leftLength + argsLength), 5416 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 5417 5418 while (++leftIndex < leftLength) { 5419 args[leftIndex] = partials[leftIndex]; 5420 } 5421 while (argsLength--) { 5422 args[leftIndex++] = arguments[++argsIndex]; 5423 } 5424 return apply(fn, isBind ? thisArg : this, args); 5425 } 5426 return wrapper; 5427} 5428 5429/** 5430 * Creates a function that wraps `func` to continue currying. 5431 * 5432 * @private 5433 * @param {Function} func The function to wrap. 5434 * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. 5435 * @param {Function} wrapFunc The function to create the `func` wrapper. 5436 * @param {*} placeholder The placeholder to replace. 5437 * @param {*} [thisArg] The `this` binding of `func`. 5438 * @param {Array} [partials] The arguments to prepend to those provided to the new function. 5439 * @param {Array} [holders] The `partials` placeholder indexes. 5440 * @param {Array} [argPos] The argument positions of the new function. 5441 * @param {number} [ary] The arity cap of `func`. 5442 * @param {number} [arity] The arity of `func`. 5443 * @returns {Function} Returns the new wrapped function. 5444 */ 5445function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 5446 var isCurry = bitmask & CURRY_FLAG, 5447 newArgPos = argPos ? copyArray(argPos) : undefined, 5448 newsHolders = isCurry ? holders : undefined, 5449 newHoldersRight = isCurry ? undefined : holders, 5450 newPartials = isCurry ? partials : undefined, 5451 newPartialsRight = isCurry ? undefined : partials; 5452 5453 bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); 5454 bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); 5455 5456 if (!(bitmask & CURRY_BOUND_FLAG)) { 5457 bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); 5458 } 5459 var result = wrapFunc(func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity); 5460 5461 result.placeholder = placeholder; 5462 return result; 5463} 5464 5465/** 5466 * Creates a function that either curries or invokes `func` with optional 5467 * `this` binding and partially applied arguments. 5468 * 5469 * @private 5470 * @param {Function|string} func The function or method name to wrap. 5471 * @param {number} bitmask The bitmask of wrapper flags. 5472 * The bitmask may be composed of the following flags: 5473 * 1 - `_.bind` 5474 * 2 - `_.bindKey` 5475 * 4 - `_.curry` or `_.curryRight` of a bound function 5476 * 8 - `_.curry` 5477 * 16 - `_.curryRight` 5478 * 32 - `_.partial` 5479 * 64 - `_.partialRight` 5480 * 128 - `_.rearg` 5481 * 256 - `_.ary` 5482 * @param {*} [thisArg] The `this` binding of `func`. 5483 * @param {Array} [partials] The arguments to be partially applied. 5484 * @param {Array} [holders] The `partials` placeholder indexes. 5485 * @param {Array} [argPos] The argument positions of the new function. 5486 * @param {number} [ary] The arity cap of `func`. 5487 * @param {number} [arity] The arity of `func`. 5488 * @returns {Function} Returns the new wrapped function. 5489 */ 5490function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 5491 var isBindKey = bitmask & BIND_KEY_FLAG; 5492 if (!isBindKey && typeof func != 'function') { 5493 throw new TypeError(FUNC_ERROR_TEXT); 5494 } 5495 var length = partials ? partials.length : 0; 5496 if (!length) { 5497 bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); 5498 partials = holders = undefined; 5499 } 5500 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 5501 arity = arity === undefined ? arity : toInteger(arity); 5502 length -= holders ? holders.length : 0; 5503 5504 if (bitmask & PARTIAL_RIGHT_FLAG) { 5505 var partialsRight = partials, 5506 holdersRight = holders; 5507 5508 partials = holders = undefined; 5509 } 5510 var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; 5511 5512 func = newData[0]; 5513 bitmask = newData[1]; 5514 thisArg = newData[2]; 5515 partials = newData[3]; 5516 holders = newData[4]; 5517 arity = newData[9] = newData[9] == null 5518 ? (isBindKey ? 0 : func.length) 5519 : nativeMax(newData[9] - length, 0); 5520 5521 if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { 5522 bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); 5523 } 5524 if (!bitmask || bitmask == BIND_FLAG) { 5525 var result = createBaseWrapper(func, bitmask, thisArg); 5526 } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { 5527 result = createCurryWrapper(func, bitmask, arity); 5528 } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) {
5529 result = createPartialWrapper(func, bitmask, thisArg, partials); 5530 } else { 5531 result = createHybridWrapper.apply(undefined, newData); 5532 } 5533 return result; 5534} 5535 5536/** 5537 * Reorder `array` according to the specified indexes where the element at 5538 * the first index is assigned as the first element, the element at 5539 * the second index is assigned as the second element, and so on. 5540 * 5541 * @private 5542 * @param {Array} array The array to reorder. 5543 * @param {Array} indexes The arranged array indexes. 5544 * @returns {Array} Returns `array`. 5545 */ 5546function reorder(array, indexes) { 5547 var arrLength = array.length, 5548 length = nativeMin(indexes.length, arrLength), 5549 oldArray = copyArray(array); 5550 5551 while (length--) { 5552 var index = indexes[length]; 5553 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 5554 } 5555 return array; 5556} 5557 5558/** 5559 * Checks if `value` is classified as a `Function` object. 5560 * 5561 * @static 5562 * @memberOf _ 5563 * @category Lang 5564 * @param {*} value The value to check. 5565 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 5566 * @example 5567 * 5568 * _.isFunction(_); 5569 * // => true 5570 * 5571 * _.isFunction(/abc/); 5572 * // => false 5573 */ 5574function isFunction(value) { 5575 // The use of `Object#toString` avoids issues with the `typeof` operator 5576 // in Safari 8 which returns 'object' for typed array constructors, and 5577 // PhantomJS 1.9 which returns 'function' for `NodeList` instances. 5578 var tag = isObject(value) ? objectToString.call(value) : ''; 5579 return tag == funcTag || tag == genTag; 5580} 5581 5582/** 5583 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 5584 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5585 * 5586 * @static 5587 * @memberOf _ 5588 * @category Lang 5589 * @param {*} value The value to check. 5590 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5591 * @example 5592 * 5593 * _.isObject({}); 5594 * // => true 5595 * 5596 * _.isObject([1, 2, 3]); 5597 * // => true 5598 * 5599 * _.isObject(_.noop); 5600 * // => true 5601 * 5602 * _.isObject(null); 5603 * // => false 5604 */ 5605function isObject(value) { 5606 var type = typeof value; 5607 return !!value && (type == 'object' || type == 'function'); 5608} 5609 5610/** 5611 * Converts `value` to an integer. 5612 * 5613 * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). 5614 * 5615 * @static 5616 * @memberOf _ 5617 * @category Lang 5618 * @param {*} value The value to convert. 5619 * @returns {number} Returns the converted integer. 5620 * @example 5621 * 5622 * _.toInteger(3); 5623 * // => 3 5624 * 5625 * _.toInteger(Number.MIN_VALUE); 5626 * // => 0 5627 * 5628 * _.toInteger(Infinity); 5629 * // => 1.7976931348623157e+308 5630 * 5631 * _.toInteger('3'); 5632 * // => 3 5633 */ 5634function toInteger(value) { 5635 if (!value) { 5636 return value === 0 ? value : 0; 5637 } 5638 value = toNumber(value); 5639 if (value === INFINITY || value === -INFINITY) { 5640 var sign = (value < 0 ? -1 : 1); 5641 return sign * MAX_INTEGER; 5642 } 5643 var remainder = value % 1; 5644 return value === value ? (remainder ? value - remainder : value) : 0; 5645} 5646 5647/** 5648 * Converts `value` to a number. 5649 * 5650 * @static 5651 * @memberOf _ 5652 * @category Lang 5653 * @param {*} value The value to process. 5654 * @returns {number} Returns the number. 5655 * @example 5656 * 5657 * _.toNumber(3); 5658 * // => 3 5659 * 5660 * _.toNumber(Number.MIN_VALUE); 5661 * // => 5e-324 5662 * 5663 * _.toNumber(Infinity); 5664 * // => Infinity 5665 * 5666 * _.toNumber('3'); 5667 * // => 3 5668 */ 5669function toNumber(value) { 5670 if (isObject(value)) { 5671 var other = isFunction(value.valueOf) ? value.valueOf() : value; 5672 value = isObject(other) ? (other + '') : other; 5673 } 5674 if (typeof value != 'string') { 5675 return value === 0 ? value : +value; 5676 } 5677 value = value.replace(reTrim, ''); 5678 var isBinary = reIsBinary.test(value); 5679 return (isBinary || reIsOctal.test(value)) 5680 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 5681 : (reIsBadHex.test(value) ? NAN : +value); 5682} 5683 5684module.exports = createWrapper; 5685 5686},{"lodash._root":55}],52:[function(require,module,exports){ 5687/** 5688 * lodash 3.9.1 (Custom Build) <https://lodash.com/> 5689 * Build: `lodash modern modularize exports="npm" -o ./` 5690 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 5691 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5692 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5693 * Available under MIT license <https://lodash.com/license> 5694 */ 5695 5696/** `Object#toString` result references. */ 5697var funcTag = '[object Function]'; 5698 5699/** Used to detect host constructors (Safari > 5). */ 5700var reIsHostCtor = /^\[object .+?Constructor\]$/; 5701 5702/** 5703 * Checks if `value` is object-like. 5704 * 5705 * @private 5706 * @param {*} value The value to check. 5707 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 5708 */ 5709function isObjectLike(value) { 5710 return !!value && typeof value == 'object'; 5711} 5712 5713/** Used for native method references. */ 5714var objectProto = Object.prototype; 5715 5716/** Used to resolve the decompiled source of functions. */ 5717var fnToString = Function.prototype.toString; 5718 5719/** Used to check objects for own properties. */ 5720var hasOwnProperty = objectProto.hasOwnProperty; 5721 5722/** 5723 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 5724 * of values. 5725 */ 5726var objToString = objectProto.toString; 5727 5728/** Used to detect if a method is native. */ 5729var reIsNative = RegExp('^' + 5730 fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') 5731 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 5732); 5733 5734/** 5735 * Gets the native function at `key` of `object`. 5736 * 5737 * @private 5738 * @param {Object} object The object to query. 5739 * @param {string} key The key of the method to get. 5740 * @returns {*} Returns the function if it's native, else `undefined`. 5741 */ 5742function getNative(object, key) { 5743 var value = object == null ? undefined : object[key]; 5744 return isNative(value) ? value : undefined; 5745} 5746 5747/** 5748 * Checks if `value` is classified as a `Function` object. 5749 * 5750 * @static 5751 * @memberOf _ 5752 * @category Lang 5753 * @param {*} value The value to check. 5754 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 5755 * @example 5756 * 5757 * _.isFunction(_); 5758 * // => true 5759 * 5760 * _.isFunction(/abc/); 5761 * // => false 5762 */ 5763function isFunction(value) {
vendor: 9,135 bytes, lines 5764-6063
5764 // The use of `Object#toString` avoids issues with the `typeof` operator 5765 // in older versions of Chrome and Safari which return 'function' for regexes 5766 // and Safari 8 equivalents which return 'object' for typed array constructors. 5767 return isObject(value) && objToString.call(value) == funcTag; 5768} 5769 5770/** 5771 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 5772 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5773 * 5774 * @static 5775 * @memberOf _ 5776 * @category Lang 5777 * @param {*} value The value to check. 5778 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5779 * @example 5780 * 5781 * _.isObject({}); 5782 * // => true 5783 * 5784 * _.isObject([1, 2, 3]); 5785 * // => true 5786 * 5787 * _.isObject(1); 5788 * // => false 5789 */ 5790function isObject(value) { 5791 // Avoid a V8 JIT bug in Chrome 19-20. 5792 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 5793 var type = typeof value; 5794 return !!value && (type == 'object' || type == 'function'); 5795} 5796 5797/** 5798 * Checks if `value` is a native function. 5799 * 5800 * @static 5801 * @memberOf _ 5802 * @category Lang 5803 * @param {*} value The value to check. 5804 * @returns {boolean} Returns `true` if `value` is a native function, else `false`. 5805 * @example 5806 * 5807 * _.isNative(Array.prototype.push); 5808 * // => true 5809 * 5810 * _.isNative(_); 5811 * // => false 5812 */ 5813function isNative(value) { 5814 if (value == null) { 5815 return false; 5816 } 5817 if (isFunction(value)) { 5818 return reIsNative.test(fnToString.call(value)); 5819 } 5820 return isObjectLike(value) && reIsHostCtor.test(value); 5821} 5822 5823module.exports = getNative; 5824 5825},{}],53:[function(require,module,exports){ 5826/** 5827 * lodash 3.0.9 (Custom Build) <https://lodash.com/> 5828 * Build: `lodash modern modularize exports="npm" -o ./` 5829 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 5830 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 5831 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5832 * Available under MIT license <https://lodash.com/license> 5833 */ 5834 5835/** Used to detect unsigned integer values. */ 5836var reIsUint = /^\d+$/; 5837 5838/** 5839 * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 5840 * of an array-like value. 5841 */ 5842var MAX_SAFE_INTEGER = 9007199254740991; 5843 5844/** 5845 * The base implementation of `_.property` without support for deep paths. 5846 * 5847 * @private 5848 * @param {string} key The key of the property to get. 5849 * @returns {Function} Returns the new function. 5850 */ 5851function baseProperty(key) { 5852 return function(object) { 5853 return object == null ? undefined : object[key]; 5854 }; 5855} 5856 5857/** 5858 * Gets the "length" property value of `object`. 5859 * 5860 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 5861 * that affects Safari on at least iOS 8.1-8.3 ARM64. 5862 * 5863 * @private 5864 * @param {Object} object The object to query. 5865 * @returns {*} Returns the "length" value. 5866 */ 5867var getLength = baseProperty('length'); 5868 5869/** 5870 * Checks if `value` is array-like. 5871 * 5872 * @private 5873 * @param {*} value The value to check. 5874 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 5875 */ 5876function isArrayLike(value) { 5877 return value != null && isLength(getLength(value)); 5878} 5879 5880/** 5881 * Checks if `value` is a valid array-like index. 5882 * 5883 * @private 5884 * @param {*} value The value to check. 5885 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 5886 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 5887 */ 5888function isIndex(value, length) { 5889 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; 5890 length = length == null ? MAX_SAFE_INTEGER : length; 5891 return value > -1 && value % 1 == 0 && value < length; 5892} 5893 5894/** 5895 * Checks if the provided arguments are from an iteratee call. 5896 * 5897 * @private 5898 * @param {*} value The potential iteratee value argument. 5899 * @param {*} index The potential iteratee index or key argument. 5900 * @param {*} object The potential iteratee object argument. 5901 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. 5902 */ 5903function isIterateeCall(value, index, object) { 5904 if (!isObject(object)) { 5905 return false; 5906 } 5907 var type = typeof index; 5908 if (type == 'number' 5909 ? (isArrayLike(object) && isIndex(index, object.length)) 5910 : (type == 'string' && index in object)) { 5911 var other = object[index]; 5912 return value === value ? (value === other) : (other !== other); 5913 } 5914 return false; 5915} 5916 5917/** 5918 * Checks if `value` is a valid array-like length. 5919 * 5920 * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). 5921 * 5922 * @private 5923 * @param {*} value The value to check. 5924 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 5925 */ 5926function isLength(value) { 5927 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 5928} 5929 5930/** 5931 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 5932 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5933 * 5934 * @static 5935 * @memberOf _ 5936 * @category Lang 5937 * @param {*} value The value to check. 5938 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5939 * @example 5940 * 5941 * _.isObject({}); 5942 * // => true 5943 * 5944 * _.isObject([1, 2, 3]); 5945 * // => true 5946 * 5947 * _.isObject(1); 5948 * // => false 5949 */ 5950function isObject(value) { 5951 // Avoid a V8 JIT bug in Chrome 19-20. 5952 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 5953 var type = typeof value; 5954 return !!value && (type == 'object' || type == 'function'); 5955} 5956 5957module.exports = isIterateeCall; 5958 5959},{}],54:[function(require,module,exports){ 5960/** 5961 * lodash 3.0.0 (Custom Build) <https://lodash.com/> 5962 * Build: `lodash modern modularize exports="npm" -o ./` 5963 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 5964 * Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE> 5965 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 5966 * Available under MIT license <https://lodash.com/license> 5967 */ 5968 5969/** Used as the internal argument placeholder. */ 5970var PLACEHOLDER = '__lodash_placeholder__'; 5971 5972/** 5973 * Replaces all `placeholder` elements in `array` with an internal placeholder 5974 * and returns an array of their indexes. 5975 * 5976 * @private 5977 * @param {Array} array The array to modify. 5978 * @param {*} placeholder The placeholder to replace. 5979 * @returns {Array} Returns the new array of placeholder indexes. 5980 */ 5981function replaceHolders(array, placeholder) { 5982 var index = -1, 5983 length = array.length, 5984 resIndex = -1, 5985 result = []; 5986 5987 while (++index < length) { 5988 if (array[index] === placeholder) { 5989 array[index] = PLACEHOLDER; 5990 result[++resIndex] = index; 5991 } 5992 } 5993 return result; 5994} 5995 5996module.exports = replaceHolders; 5997 5998},{}],55:[function(require,module,exports){ 5999(function (global){(function (){ 6000/** 6001 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 6002 * Build: `lodash modularize exports="npm" -o ./` 6003 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 6004 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6005 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6006 * Available under MIT license <https://lodash.com/license> 6007 */ 6008 6009/** Used to determine if values are of the language type `Object`. */ 6010var objectTypes = { 6011 'function': true, 6012 'object': true 6013}; 6014 6015/** Detect free variable `exports`. */ 6016var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) 6017 ? exports 6018 : undefined; 6019 6020/** Detect free variable `module`. */ 6021var freeModule = (objectTypes[typeof module] && module && !module.nodeType) 6022 ? module 6023 : undefined; 6024 6025/** Detect free variable `global` from Node.js. */ 6026var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); 6027 6028/** Detect free variable `self`. */ 6029var freeSelf = checkGlobal(objectTypes[typeof self] && self); 6030 6031/** Detect free variable `window`. */ 6032var freeWindow = checkGlobal(objectTypes[typeof window] && window); 6033 6034/** Detect `this` as the global object. */ 6035var thisGlobal = checkGlobal(objectTypes[typeof this] && this); 6036 6037/** 6038 * Used as a reference to the global object. 6039 * 6040 * The `this` value is used if it's the global object to avoid Greasemonkey's 6041 * restricted `window` object, otherwise the `window` object is used. 6042 */ 6043var root = freeGlobal || 6044 ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || 6045 freeSelf || thisGlobal || Function('return this')(); 6046 6047/** 6048 * Checks if `value` is a global object. 6049 * 6050 * @private 6051 * @param {*} value The value to check. 6052 * @returns {null|Object} Returns `value` if it's a global object, else `null`. 6053 */ 6054function checkGlobal(value) { 6055 return (value && value.Object === Object) ? value : null; 6056} 6057 6058module.exports = root; 6059 6060}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 6061},{}],56:[function(require,module,exports){ 6062/** 6063 * lodash 3.8.1 (Custom Build) <https://lodash.com/>
6064 * Build: `lodash modern modularize exports="npm" -o ./` 6065 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6066 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6067 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6068 * Available under MIT license <https://lodash.com/license> 6069 */ 6070var isArray = require('lodash.isarray'); 6071 6072/** Used to match property names within property paths. */ 6073var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; 6074 6075/** Used to match backslashes in property paths. */ 6076var reEscapeChar = /\\(\\)?/g; 6077 6078/** 6079 * Converts `value` to a string if it's not one. An empty string is returned 6080 * for `null` or `undefined` values. 6081 * 6082 * @private 6083 * @param {*} value The value to process. 6084 * @returns {string} Returns the string. 6085 */ 6086function baseToString(value) { 6087 return value == null ? '' : (value + ''); 6088} 6089 6090/** 6091 * Converts `value` to property path array if it's not one. 6092 * 6093 * @private 6094 * @param {*} value The value to process. 6095 * @returns {Array} Returns the property path array. 6096 */ 6097function toPath(value) { 6098 if (isArray(value)) { 6099 return value; 6100 } 6101 var result = []; 6102 baseToString(value).replace(rePropName, function(match, number, quote, string) { 6103 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); 6104 }); 6105 return result; 6106} 6107 6108module.exports = toPath; 6109 6110},{"lodash.isarray":62}],57:[function(require,module,exports){ 6111/** 6112 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 6113 * Build: `lodash modern modularize exports="npm" -o ./` 6114 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6115 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6116 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6117 * Available under MIT license <https://lodash.com/license> 6118 */ 6119var baseAssign = require('lodash._baseassign'), 6120 createAssigner = require('lodash._createassigner'), 6121 keys = require('lodash.keys'); 6122 6123/** 6124 * A specialized version of `_.assign` for customizing assigned values without 6125 * support for argument juggling, multiple sources, and `this` binding `customizer` 6126 * functions. 6127 * 6128 * @private 6129 * @param {Object} object The destination object. 6130 * @param {Object} source The source object. 6131 * @param {Function} customizer The function to customize assigned values. 6132 * @returns {Object} Returns `object`. 6133 */ 6134function assignWith(object, source, customizer) { 6135 var index = -1, 6136 props = keys(source), 6137 length = props.length; 6138 6139 while (++index < length) { 6140 var key = props[index], 6141 value = object[key], 6142 result = customizer(value, source[key], key, object, source); 6143 6144 if ((result === result ? (result !== value) : (value === value)) || 6145 (value === undefined && !(key in object))) { 6146 object[key] = result; 6147 } 6148 } 6149 return object; 6150} 6151 6152/** 6153 * Assigns own enumerable properties of source object(s) to the destination 6154 * object. Subsequent sources overwrite property assignments of previous sources. 6155 * If `customizer` is provided it is invoked to produce the assigned values. 6156 * The `customizer` is bound to `thisArg` and invoked with five arguments: 6157 * (objectValue, sourceValue, key, object, source). 6158 * 6159 * **Note:** This method mutates `object` and is based on 6160 * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). 6161 * 6162 * @static 6163 * @memberOf _ 6164 * @alias extend 6165 * @category Object 6166 * @param {Object} object The destination object. 6167 * @param {...Object} [sources] The source objects. 6168 * @param {Function} [customizer] The function to customize assigned values. 6169 * @param {*} [thisArg] The `this` binding of `customizer`. 6170 * @returns {Object} Returns `object`. 6171 * @example 6172 * 6173 * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); 6174 * // => { 'user': 'fred', 'age': 40 } 6175 * 6176 * // using a customizer callback 6177 * var defaults = _.partialRight(_.assign, function(value, other) { 6178 * return _.isUndefined(value) ? other : value; 6179 * }); 6180 * 6181 * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); 6182 * // => { 'user': 'barney', 'age': 36 } 6183 */ 6184var assign = createAssigner(function(object, source, customizer) { 6185 return customizer 6186 ? assignWith(object, source, customizer) 6187 : baseAssign(object, source); 6188}); 6189 6190module.exports = assign; 6191 6192},{"lodash._baseassign":44,"lodash._createassigner":50,"lodash.keys":67}],58:[function(require,module,exports){ 6193/** 6194 * lodash 3.0.3 (Custom Build) <https://lodash.com/>
6195 * Build: `lodash modern modularize exports="npm" -o ./` 6196 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6197 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6198 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6199 * Available under MIT license <https://lodash.com/license> 6200 */ 6201 6202/** Used as the `TypeError` message for "Functions" methods. */ 6203var FUNC_ERROR_TEXT = 'Expected a function'; 6204 6205/** 6206 * Creates a function that invokes `func`, with the `this` binding and arguments 6207 * of the created function, while it is called less than `n` times. Subsequent 6208 * calls to the created function return the result of the last `func` invocation. 6209 * 6210 * @static 6211 * @memberOf _ 6212 * @category Function 6213 * @param {number} n The number of calls at which `func` is no longer invoked. 6214 * @param {Function} func The function to restrict. 6215 * @returns {Function} Returns the new restricted function. 6216 * @example 6217 * 6218 * jQuery('#add').on('click', _.before(5, addContactToList)); 6219 * // => allows adding up to 4 contacts to the list 6220 */ 6221function before(n, func) { 6222 var result; 6223 if (typeof func != 'function') { 6224 if (typeof n == 'function') { 6225 var temp = n; 6226 n = func; 6227 func = temp; 6228 } else { 6229 throw new TypeError(FUNC_ERROR_TEXT); 6230 } 6231 } 6232 return function() { 6233 if (--n > 0) { 6234 result = func.apply(this, arguments); 6235 } 6236 if (n <= 1) { 6237 func = undefined; 6238 } 6239 return result; 6240 }; 6241} 6242 6243module.exports = before; 6244 6245},{}],59:[function(require,module,exports){ 6246/** 6247 * lodash 3.1.0 (Custom Build) <https://lodash.com/> 6248 * Build: `lodash modern modularize exports="npm" -o ./` 6249 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6250 * Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> 6251 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6252 * Available under MIT license <https://lodash.com/license> 6253 */ 6254var createWrapper = require('lodash._createwrapper'), 6255 replaceHolders = require('lodash._replaceholders'), 6256 restParam = require('lodash.restparam'); 6257 6258/** Used to compose bitmasks for wrapper metadata. */ 6259var BIND_FLAG = 1, 6260 PARTIAL_FLAG = 32; 6261 6262/** 6263 * Creates a function that invokes `func` with the `this` binding of `thisArg` 6264 * and prepends any additional `_.bind` arguments to those provided to the 6265 * bound function. 6266 * 6267 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 6268 * may be used as a placeholder for partially applied arguments. 6269 * 6270 * **Note:** Unlike native `Function#bind` this method does not set the `length` 6271 * property of bound functions. 6272 * 6273 * @static 6274 * @memberOf _ 6275 * @category Function 6276 * @param {Function} func The function to bind. 6277 * @param {*} thisArg The `this` binding of `func`. 6278 * @param {...*} [partials] The arguments to be partially applied. 6279 * @returns {Function} Returns the new bound function. 6280 * @example 6281 * 6282 * var greet = function(greeting, punctuation) { 6283 * return greeting + ' ' + this.user + punctuation; 6284 * }; 6285 * 6286 * var object = { 'user': 'fred' }; 6287 * 6288 * var bound = _.bind(greet, object, 'hi'); 6289 * bound('!'); 6290 * // => 'hi fred!' 6291 * 6292 * // using placeholders 6293 * var bound = _.bind(greet, object, _, '!'); 6294 * bound('hi'); 6295 * // => 'hi fred!' 6296 */ 6297var bind = restParam(function(func, thisArg, partials) { 6298 var bitmask = BIND_FLAG; 6299 if (partials.length) { 6300 var holders = replaceHolders(partials, bind.placeholder); 6301 bitmask |= PARTIAL_FLAG; 6302 } 6303 return createWrapper(func, bitmask, thisArg, partials, holders); 6304}); 6305 6306// Assign default placeholders. 6307bind.placeholder = {}; 6308 6309module.exports = bind; 6310 6311},{"lodash._createwrapper":51,"lodash._replaceholders":54,"lodash.restparam":69}],60:[function(require,module,exports){ 6312/** 6313 * lodash 3.0.3 (Custom Build) <https://lodash.com/> 6314 * Build: `lodash modern modularize exports="npm" -o ./` 6315 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6316 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6317 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6318 * Available under MIT license <https://lodash.com/license> 6319 */ 6320var arrayEach = require('lodash._arrayeach'), 6321 baseEach = require('lodash._baseeach'), 6322 bindCallback = require('lodash._bindcallback'), 6323 isArray = require('lodash.isarray'); 6324 6325/** 6326 * Creates a function for `_.forEach` or `_.forEachRight`. 6327 * 6328 * @private 6329 * @param {Function} arrayFunc The function to iterate over an array.
6330 * @param {Function} eachFunc The function to iterate over a collection. 6331 * @returns {Function} Returns the new each function. 6332 */ 6333function createForEach(arrayFunc, eachFunc) { 6334 return function(collection, iteratee, thisArg) { 6335 return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) 6336 ? arrayFunc(collection, iteratee) 6337 : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); 6338 }; 6339} 6340 6341/** 6342 * Iterates over elements of `collection` invoking `iteratee` for each element. 6343 * The `iteratee` is bound to `thisArg` and invoked with three arguments: 6344 * (value, index|key, collection). Iteratee functions may exit iteration early 6345 * by explicitly returning `false`. 6346 * 6347 * **Note:** As with other "Collections" methods, objects with a "length" property 6348 * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` 6349 * may be used for object iteration. 6350 * 6351 * @static 6352 * @memberOf _ 6353 * @alias each 6354 * @category Collection 6355 * @param {Array|Object|string} collection The collection to iterate over. 6356 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 6357 * @param {*} [thisArg] The `this` binding of `iteratee`. 6358 * @returns {Array|Object|string} Returns `collection`. 6359 * @example 6360 * 6361 * _([1, 2]).forEach(function(n) { 6362 * console.log(n); 6363 * }).value(); 6364 * // => logs each value from left to right and returns the array 6365 * 6366 * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { 6367 * console.log(n, key); 6368 * }); 6369 * // => logs each value-key pair and returns the object (iteration order is not guaranteed) 6370 */ 6371var forEach = createForEach(arrayEach, baseEach); 6372 6373module.exports = forEach; 6374 6375},{"lodash._arrayeach":43,"lodash._baseeach":46,"lodash._bindcallback":49,"lodash.isarray":62}],61:[function(require,module,exports){ 6376/** 6377 * lodash (Custom Build) <https://lodash.com/> 6378 * Build: `lodash modularize exports="npm" -o ./` 6379 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 6380 * Released under MIT license <https://lodash.com/license> 6381 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6382 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6383 */ 6384 6385/** Used as references for various `Number` constants. */ 6386var MAX_SAFE_INTEGER = 9007199254740991; 6387 6388/** `Object#toString` result references. */ 6389var argsTag = '[object Arguments]', 6390 funcTag = '[object Function]', 6391 genTag = '[object GeneratorFunction]'; 6392 6393/** Used for built-in method references. */ 6394var objectProto = Object.prototype; 6395 6396/** Used to check objects for own properties. */ 6397var hasOwnProperty = objectProto.hasOwnProperty; 6398 6399/** 6400 * Used to resolve the 6401 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 6402 * of values. 6403 */ 6404var objectToString = objectProto.toString; 6405 6406/** Built-in value references. */ 6407var propertyIsEnumerable = objectProto.propertyIsEnumerable; 6408 6409/** 6410 * Checks if `value` is likely an `arguments` object. 6411 * 6412 * @static 6413 * @memberOf _ 6414 * @since 0.1.0 6415 * @category Lang 6416 * @param {*} value The value to check. 6417 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 6418 * else `false`. 6419 * @example 6420 * 6421 * _.isArguments(function() { return arguments; }()); 6422 * // => true 6423 * 6424 * _.isArguments([1, 2, 3]); 6425 * // => false 6426 */ 6427function isArguments(value) { 6428 // Safari 8.1 makes `arguments.callee` enumerable in strict mode. 6429 return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && 6430 (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); 6431} 6432 6433/** 6434 * Checks if `value` is array-like. A value is considered array-like if it's 6435 * not a function and has a `value.length` that's an integer greater than or 6436 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 6437 * 6438 * @static 6439 * @memberOf _ 6440 * @since 4.0.0 6441 * @category Lang 6442 * @param {*} value The value to check. 6443 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 6444 * @example 6445 * 6446 * _.isArrayLike([1, 2, 3]); 6447 * // => true 6448 * 6449 * _.isArrayLike(document.body.children); 6450 * // => true 6451 * 6452 * _.isArrayLike('abc'); 6453 * // => true 6454 * 6455 * _.isArrayLike(_.noop); 6456 * // => false 6457 */ 6458function isArrayLike(value) { 6459 return value != null && isLength(value.length) && !isFunction(value); 6460} 6461 6462/** 6463 * This method is like `_.isArrayLike` except that it also checks if `value` 6464 * is an object. 6465 * 6466 * @static 6467 * @memberOf _ 6468 * @since 4.0.0 6469 * @category Lang 6470 * @param {*} value The value to check. 6471 * @returns {boolean} Returns `true` if `value` is an array-like object, 6472 * else `false`. 6473 * @example 6474 * 6475 * _.isArrayLikeObject([1, 2, 3]); 6476 * // => true 6477 * 6478 * _.isArrayLikeObject(document.body.children); 6479 * // => true 6480 * 6481 * _.isArrayLikeObject('abc'); 6482 * // => false 6483 * 6484 * _.isArrayLikeObject(_.noop); 6485 * // => false 6486 */ 6487function isArrayLikeObject(value) { 6488 return isObjectLike(value) && isArrayLike(value); 6489} 6490 6491/** 6492 * Checks if `value` is classified as a `Function` object. 6493 * 6494 * @static 6495 * @memberOf _ 6496 * @since 0.1.0 6497 * @category Lang 6498 * @param {*} value The value to check. 6499 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 6500 * @example 6501 * 6502 * _.isFunction(_); 6503 * // => true 6504 * 6505 * _.isFunction(/abc/); 6506 * // => false 6507 */ 6508function isFunction(value) {
vendor: 11,073 bytes, lines 6509-6911
6509 // The use of `Object#toString` avoids issues with the `typeof` operator 6510 // in Safari 8-9 which returns 'object' for typed array and other constructors. 6511 var tag = isObject(value) ? objectToString.call(value) : ''; 6512 return tag == funcTag || tag == genTag; 6513} 6514 6515/** 6516 * Checks if `value` is a valid array-like length. 6517 * 6518 * **Note:** This method is loosely based on 6519 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 6520 * 6521 * @static 6522 * @memberOf _ 6523 * @since 4.0.0 6524 * @category Lang 6525 * @param {*} value The value to check. 6526 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6527 * @example 6528 * 6529 * _.isLength(3); 6530 * // => true 6531 * 6532 * _.isLength(Number.MIN_VALUE); 6533 * // => false 6534 * 6535 * _.isLength(Infinity); 6536 * // => false 6537 * 6538 * _.isLength('3'); 6539 * // => false 6540 */ 6541function isLength(value) { 6542 return typeof value == 'number' && 6543 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 6544} 6545 6546/** 6547 * Checks if `value` is the 6548 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 6549 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 6550 * 6551 * @static 6552 * @memberOf _ 6553 * @since 0.1.0 6554 * @category Lang 6555 * @param {*} value The value to check. 6556 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 6557 * @example 6558 * 6559 * _.isObject({}); 6560 * // => true 6561 * 6562 * _.isObject([1, 2, 3]); 6563 * // => true 6564 * 6565 * _.isObject(_.noop); 6566 * // => true 6567 * 6568 * _.isObject(null); 6569 * // => false 6570 */ 6571function isObject(value) { 6572 var type = typeof value; 6573 return !!value && (type == 'object' || type == 'function'); 6574} 6575 6576/** 6577 * Checks if `value` is object-like. A value is object-like if it's not `null` 6578 * and has a `typeof` result of "object". 6579 * 6580 * @static 6581 * @memberOf _ 6582 * @since 4.0.0 6583 * @category Lang 6584 * @param {*} value The value to check. 6585 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6586 * @example 6587 * 6588 * _.isObjectLike({}); 6589 * // => true 6590 * 6591 * _.isObjectLike([1, 2, 3]); 6592 * // => true 6593 * 6594 * _.isObjectLike(_.noop); 6595 * // => false 6596 * 6597 * _.isObjectLike(null); 6598 * // => false 6599 */ 6600function isObjectLike(value) { 6601 return !!value && typeof value == 'object'; 6602} 6603 6604module.exports = isArguments; 6605 6606},{}],62:[function(require,module,exports){ 6607/** 6608 * lodash 3.0.4 (Custom Build) <https://lodash.com/> 6609 * Build: `lodash modern modularize exports="npm" -o ./` 6610 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6611 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6612 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6613 * Available under MIT license <https://lodash.com/license> 6614 */ 6615 6616/** `Object#toString` result references. */ 6617var arrayTag = '[object Array]', 6618 funcTag = '[object Function]'; 6619 6620/** Used to detect host constructors (Safari > 5). */ 6621var reIsHostCtor = /^\[object .+?Constructor\]$/; 6622 6623/** 6624 * Checks if `value` is object-like. 6625 * 6626 * @private 6627 * @param {*} value The value to check. 6628 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6629 */ 6630function isObjectLike(value) { 6631 return !!value && typeof value == 'object'; 6632} 6633 6634/** Used for native method references. */ 6635var objectProto = Object.prototype; 6636 6637/** Used to resolve the decompiled source of functions. */ 6638var fnToString = Function.prototype.toString; 6639 6640/** Used to check objects for own properties. */ 6641var hasOwnProperty = objectProto.hasOwnProperty; 6642 6643/** 6644 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 6645 * of values. 6646 */ 6647var objToString = objectProto.toString; 6648 6649/** Used to detect if a method is native. */ 6650var reIsNative = RegExp('^' + 6651 fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') 6652 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 6653); 6654 6655/* Native method references for those with the same name as other `lodash` methods. */ 6656var nativeIsArray = getNative(Array, 'isArray'); 6657 6658/** 6659 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) 6660 * of an array-like value. 6661 */ 6662var MAX_SAFE_INTEGER = 9007199254740991; 6663 6664/** 6665 * Gets the native function at `key` of `object`. 6666 * 6667 * @private 6668 * @param {Object} object The object to query. 6669 * @param {string} key The key of the method to get. 6670 * @returns {*} Returns the function if it's native, else `undefined`. 6671 */ 6672function getNative(object, key) { 6673 var value = object == null ? undefined : object[key]; 6674 return isNative(value) ? value : undefined; 6675} 6676 6677/** 6678 * Checks if `value` is a valid array-like length. 6679 * 6680 * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). 6681 * 6682 * @private 6683 * @param {*} value The value to check. 6684 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6685 */ 6686function isLength(value) { 6687 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 6688} 6689 6690/** 6691 * Checks if `value` is classified as an `Array` object. 6692 * 6693 * @static 6694 * @memberOf _ 6695 * @category Lang 6696 * @param {*} value The value to check. 6697 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 6698 * @example 6699 * 6700 * _.isArray([1, 2, 3]); 6701 * // => true 6702 * 6703 * _.isArray(function() { return arguments; }()); 6704 * // => false 6705 */ 6706var isArray = nativeIsArray || function(value) { 6707 return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; 6708}; 6709 6710/** 6711 * Checks if `value` is classified as a `Function` object. 6712 * 6713 * @static 6714 * @memberOf _ 6715 * @category Lang 6716 * @param {*} value The value to check. 6717 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 6718 * @example 6719 * 6720 * _.isFunction(_); 6721 * // => true 6722 * 6723 * _.isFunction(/abc/); 6724 * // => false 6725 */ 6726function isFunction(value) { 6727 // The use of `Object#toString` avoids issues with the `typeof` operator 6728 // in older versions of Chrome and Safari which return 'function' for regexes 6729 // and Safari 8 equivalents which return 'object' for typed array constructors. 6730 return isObject(value) && objToString.call(value) == funcTag; 6731} 6732 6733/** 6734 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 6735 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 6736 * 6737 * @static 6738 * @memberOf _ 6739 * @category Lang 6740 * @param {*} value The value to check. 6741 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 6742 * @example 6743 * 6744 * _.isObject({}); 6745 * // => true 6746 * 6747 * _.isObject([1, 2, 3]); 6748 * // => true 6749 * 6750 * _.isObject(1); 6751 * // => false 6752 */ 6753function isObject(value) { 6754 // Avoid a V8 JIT bug in Chrome 19-20. 6755 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 6756 var type = typeof value; 6757 return !!value && (type == 'object' || type == 'function'); 6758} 6759 6760/** 6761 * Checks if `value` is a native function. 6762 * 6763 * @static 6764 * @memberOf _ 6765 * @category Lang 6766 * @param {*} value The value to check. 6767 * @returns {boolean} Returns `true` if `value` is a native function, else `false`. 6768 * @example 6769 * 6770 * _.isNative(Array.prototype.push); 6771 * // => true 6772 * 6773 * _.isNative(_); 6774 * // => false 6775 */ 6776function isNative(value) { 6777 if (value == null) { 6778 return false; 6779 } 6780 if (isFunction(value)) { 6781 return reIsNative.test(fnToString.call(value)); 6782 } 6783 return isObjectLike(value) && reIsHostCtor.test(value); 6784} 6785 6786module.exports = isArray; 6787 6788},{}],63:[function(require,module,exports){ 6789/** 6790 * lodash 3.0.4 (Custom Build) <https://lodash.com/> 6791 * Build: `lodash modern modularize exports="npm" -o ./` 6792 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 6793 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6794 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6795 * Available under MIT license <https://lodash.com/license> 6796 */ 6797var isArguments = require('lodash.isarguments'), 6798 isArray = require('lodash.isarray'), 6799 isFunction = require('lodash.isfunction'), 6800 isString = require('lodash.isstring'), 6801 keys = require('lodash.keys'); 6802 6803/** 6804 * Checks if `value` is object-like. 6805 * 6806 * @private 6807 * @param {*} value The value to check. 6808 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 6809 */ 6810function isObjectLike(value) { 6811 return !!value && typeof value == 'object'; 6812} 6813 6814/** 6815 * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) 6816 * of an array-like value. 6817 */ 6818var MAX_SAFE_INTEGER = 9007199254740991; 6819 6820/** 6821 * The base implementation of `_.property` without support for deep paths. 6822 * 6823 * @private 6824 * @param {string} key The key of the property to get. 6825 * @returns {Function} Returns the new function. 6826 */ 6827function baseProperty(key) { 6828 return function(object) { 6829 return object == null ? undefined : object[key]; 6830 }; 6831} 6832 6833/** 6834 * Gets the "length" property value of `object`. 6835 * 6836 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 6837 * that affects Safari on at least iOS 8.1-8.3 ARM64. 6838 * 6839 * @private 6840 * @param {Object} object The object to query. 6841 * @returns {*} Returns the "length" value. 6842 */ 6843var getLength = baseProperty('length'); 6844 6845/** 6846 * Checks if `value` is array-like. 6847 * 6848 * @private 6849 * @param {*} value The value to check. 6850 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 6851 */ 6852function isArrayLike(value) { 6853 return value != null && isLength(getLength(value)); 6854} 6855 6856/** 6857 * Checks if `value` is a valid array-like length. 6858 * 6859 * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). 6860 * 6861 * @private 6862 * @param {*} value The value to check. 6863 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 6864 */ 6865function isLength(value) { 6866 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 6867} 6868 6869/** 6870 * Checks if `value` is empty. A value is considered empty unless it is an 6871 * `arguments` object, array, string, or jQuery-like collection with a length 6872 * greater than `0` or an object with own enumerable properties. 6873 * 6874 * @static 6875 * @memberOf _ 6876 * @category Lang 6877 * @param {Array|Object|string} value The value to inspect. 6878 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 6879 * @example 6880 * 6881 * _.isEmpty(null); 6882 * // => true 6883 * 6884 * _.isEmpty(true); 6885 * // => true 6886 * 6887 * _.isEmpty(1); 6888 * // => true 6889 * 6890 * _.isEmpty([1, 2, 3]); 6891 * // => false 6892 * 6893 * _.isEmpty({ 'a': 1 }); 6894 * // => false 6895 */ 6896function isEmpty(value) { 6897 if (value == null) { 6898 return true; 6899 } 6900 if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || 6901 (isObjectLike(value) && isFunction(value.splice)))) { 6902 return !value.length; 6903 } 6904 return !keys(value).length; 6905} 6906 6907module.exports = isEmpty; 6908 6909},{"lodash.isarguments":61,"lodash.isarray":62,"lodash.isfunction":64,"lodash.isstring":66,"lodash.keys":67}],64:[function(require,module,exports){ 6910(function (global){(function (){ 6911/**
6912 * Lodash (Custom Build) <https://lodash.com/> 6913 * Build: `lodash modularize exports="npm" -o ./` 6914 * Copyright JS Foundation and other contributors <https://js.foundation/> 6915 * Released under MIT license <https://lodash.com/license> 6916 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 6917 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 6918 */ 6919 6920/** `Object#toString` result references. */ 6921var asyncTag = '[object AsyncFunction]', 6922 funcTag = '[object Function]', 6923 genTag = '[object GeneratorFunction]', 6924 nullTag = '[object Null]', 6925 proxyTag = '[object Proxy]', 6926 undefinedTag = '[object Undefined]'; 6927 6928/** Detect free variable `global` from Node.js. */ 6929var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 6930 6931/** Detect free variable `self`. */ 6932var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 6933 6934/** Used as a reference to the global object. */ 6935var root = freeGlobal || freeSelf || Function('return this')(); 6936 6937/** Used for built-in method references. */ 6938var objectProto = Object.prototype; 6939 6940/** Used to check objects for own properties. */ 6941var hasOwnProperty = objectProto.hasOwnProperty; 6942 6943/** 6944 * Used to resolve the 6945 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 6946 * of values. 6947 */ 6948var nativeObjectToString = objectProto.toString; 6949 6950/** Built-in value references. */ 6951var Symbol = root.Symbol, 6952 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 6953 6954/** 6955 * The base implementation of `getTag` without fallbacks for buggy environments. 6956 * 6957 * @private 6958 * @param {*} value The value to query. 6959 * @returns {string} Returns the `toStringTag`. 6960 */ 6961function baseGetTag(value) { 6962 if (value == null) { 6963 return value === undefined ? undefinedTag : nullTag; 6964 } 6965 return (symToStringTag && symToStringTag in Object(value)) 6966 ? getRawTag(value) 6967 : objectToString(value); 6968} 6969 6970/** 6971 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 6972 * 6973 * @private 6974 * @param {*} value The value to query. 6975 * @returns {string} Returns the raw `toStringTag`. 6976 */ 6977function getRawTag(value) { 6978 var isOwn = hasOwnProperty.call(value, symToStringTag), 6979 tag = value[symToStringTag]; 6980 6981 try { 6982 value[symToStringTag] = undefined; 6983 var unmasked = true; 6984 } catch (e) {} 6985 6986 var result = nativeObjectToString.call(value); 6987 if (unmasked) { 6988 if (isOwn) { 6989 value[symToStringTag] = tag; 6990 } else { 6991 delete value[symToStringTag]; 6992 } 6993 } 6994 return result; 6995} 6996 6997/** 6998 * Converts `value` to a string using `Object.prototype.toString`. 6999 * 7000 * @private 7001 * @param {*} value The value to convert. 7002 * @returns {string} Returns the converted string. 7003 */ 7004function objectToString(value) { 7005 return nativeObjectToString.call(value); 7006} 7007 7008/** 7009 * Checks if `value` is classified as a `Function` object. 7010 * 7011 * @static 7012 * @memberOf _ 7013 * @since 0.1.0 7014 * @category Lang 7015 * @param {*} value The value to check. 7016 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 7017 * @example 7018 * 7019 * _.isFunction(_); 7020 * // => true 7021 * 7022 * _.isFunction(/abc/); 7023 * // => false 7024 */ 7025function isFunction(value) { 7026 if (!isObject(value)) { 7027 return false; 7028 } 7029 // The use of `Object#toString` avoids issues with the `typeof` operator 7030 // in Safari 9 which returns 'object' for typed arrays and other constructors. 7031 var tag = baseGetTag(value); 7032 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 7033} 7034 7035/** 7036 * Checks if `value` is the 7037 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 7038 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7039 * 7040 * @static 7041 * @memberOf _ 7042 * @since 0.1.0 7043 * @category Lang 7044 * @param {*} value The value to check. 7045 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7046 * @example 7047 * 7048 * _.isObject({}); 7049 * // => true 7050 * 7051 * _.isObject([1, 2, 3]); 7052 * // => true 7053 * 7054 * _.isObject(_.noop); 7055 * // => true 7056 * 7057 * _.isObject(null); 7058 * // => false 7059 */ 7060function isObject(value) { 7061 var type = typeof value; 7062 return value != null && (type == 'object' || type == 'function'); 7063} 7064 7065module.exports = isFunction; 7066 7067}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 7068},{}],65:[function(require,module,exports){ 7069/** 7070 * lodash 3.0.5 (Custom Build) <https://lodash.com/>
vendor: 10,156 bytes, lines 7071-7435
7071 * Build: `lodash modularize exports="npm" -o ./` 7072 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 7073 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7074 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7075 * Available under MIT license <https://lodash.com/license> 7076 */ 7077 7078/** `Object#toString` result references. */ 7079var regexpTag = '[object RegExp]'; 7080 7081/** Used for built-in method references. */ 7082var objectProto = Object.prototype; 7083 7084/** 7085 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 7086 * of values. 7087 */ 7088var objectToString = objectProto.toString; 7089 7090/** 7091 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 7092 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7093 * 7094 * @static 7095 * @memberOf _ 7096 * @category Lang 7097 * @param {*} value The value to check. 7098 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7099 * @example 7100 * 7101 * _.isObject({}); 7102 * // => true 7103 * 7104 * _.isObject([1, 2, 3]); 7105 * // => true 7106 * 7107 * _.isObject(_.noop); 7108 * // => true 7109 * 7110 * _.isObject(null); 7111 * // => false 7112 */ 7113function isObject(value) { 7114 var type = typeof value; 7115 return !!value && (type == 'object' || type == 'function'); 7116} 7117 7118/** 7119 * Checks if `value` is classified as a `RegExp` object. 7120 * 7121 * @static 7122 * @memberOf _ 7123 * @category Lang 7124 * @param {*} value The value to check. 7125 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 7126 * @example 7127 * 7128 * _.isRegExp(/abc/); 7129 * // => true 7130 * 7131 * _.isRegExp('/abc/'); 7132 * // => false 7133 */ 7134function isRegExp(value) { 7135 return isObject(value) && objectToString.call(value) == regexpTag; 7136} 7137 7138module.exports = isRegExp; 7139 7140},{}],66:[function(require,module,exports){ 7141/** 7142 * lodash 3.0.1 (Custom Build) <https://lodash.com/> 7143 * Build: `lodash modern modularize exports="npm" -o ./` 7144 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7145 * Based on Underscore.js 1.8.2 <http://underscorejs.org/LICENSE> 7146 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7147 * Available under MIT license <https://lodash.com/license> 7148 */ 7149 7150/** `Object#toString` result references. */ 7151var stringTag = '[object String]'; 7152 7153/** 7154 * Checks if `value` is object-like. 7155 * 7156 * @private 7157 * @param {*} value The value to check. 7158 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 7159 */ 7160function isObjectLike(value) { 7161 return !!value && typeof value == 'object'; 7162} 7163 7164/** Used for native method references. */ 7165var objectProto = Object.prototype; 7166 7167/** 7168 * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) 7169 * of values. 7170 */ 7171var objToString = objectProto.toString; 7172 7173/** 7174 * Checks if `value` is classified as a `String` primitive or object. 7175 * 7176 * @static 7177 * @memberOf _ 7178 * @category Lang 7179 * @param {*} value The value to check. 7180 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 7181 * @example 7182 * 7183 * _.isString('abc'); 7184 * // => true 7185 * 7186 * _.isString(1); 7187 * // => false 7188 */ 7189function isString(value) { 7190 return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); 7191} 7192 7193module.exports = isString; 7194 7195},{}],67:[function(require,module,exports){ 7196/** 7197 * lodash 3.1.2 (Custom Build) <https://lodash.com/> 7198 * Build: `lodash modern modularize exports="npm" -o ./` 7199 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7200 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7201 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7202 * Available under MIT license <https://lodash.com/license> 7203 */ 7204var getNative = require('lodash._getnative'), 7205 isArguments = require('lodash.isarguments'), 7206 isArray = require('lodash.isarray'); 7207 7208/** Used to detect unsigned integer values. */ 7209var reIsUint = /^\d+$/; 7210 7211/** Used for native method references. */ 7212var objectProto = Object.prototype; 7213 7214/** Used to check objects for own properties. */ 7215var hasOwnProperty = objectProto.hasOwnProperty; 7216 7217/* Native method references for those with the same name as other `lodash` methods. */ 7218var nativeKeys = getNative(Object, 'keys'); 7219 7220/** 7221 * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) 7222 * of an array-like value. 7223 */ 7224var MAX_SAFE_INTEGER = 9007199254740991; 7225 7226/** 7227 * The base implementation of `_.property` without support for deep paths. 7228 * 7229 * @private 7230 * @param {string} key The key of the property to get. 7231 * @returns {Function} Returns the new function. 7232 */ 7233function baseProperty(key) { 7234 return function(object) { 7235 return object == null ? undefined : object[key]; 7236 }; 7237} 7238 7239/** 7240 * Gets the "length" property value of `object`. 7241 * 7242 * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) 7243 * that affects Safari on at least iOS 8.1-8.3 ARM64. 7244 * 7245 * @private 7246 * @param {Object} object The object to query. 7247 * @returns {*} Returns the "length" value. 7248 */ 7249var getLength = baseProperty('length'); 7250 7251/** 7252 * Checks if `value` is array-like. 7253 * 7254 * @private 7255 * @param {*} value The value to check. 7256 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 7257 */ 7258function isArrayLike(value) { 7259 return value != null && isLength(getLength(value)); 7260} 7261 7262/** 7263 * Checks if `value` is a valid array-like index. 7264 * 7265 * @private 7266 * @param {*} value The value to check. 7267 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 7268 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 7269 */ 7270function isIndex(value, length) { 7271 value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; 7272 length = length == null ? MAX_SAFE_INTEGER : length; 7273 return value > -1 && value % 1 == 0 && value < length; 7274} 7275 7276/** 7277 * Checks if `value` is a valid array-like length. 7278 * 7279 * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). 7280 * 7281 * @private 7282 * @param {*} value The value to check. 7283 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 7284 */ 7285function isLength(value) { 7286 return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 7287} 7288 7289/** 7290 * A fallback implementation of `Object.keys` which creates an array of the 7291 * own enumerable property names of `object`. 7292 * 7293 * @private 7294 * @param {Object} object The object to query. 7295 * @returns {Array} Returns the array of property names. 7296 */ 7297function shimKeys(object) { 7298 var props = keysIn(object), 7299 propsLength = props.length, 7300 length = propsLength && object.length; 7301 7302 var allowIndexes = !!length && isLength(length) && 7303 (isArray(object) || isArguments(object)); 7304 7305 var index = -1, 7306 result = []; 7307 7308 while (++index < propsLength) { 7309 var key = props[index]; 7310 if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { 7311 result.push(key); 7312 } 7313 } 7314 return result; 7315} 7316 7317/** 7318 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 7319 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7320 * 7321 * @static 7322 * @memberOf _ 7323 * @category Lang 7324 * @param {*} value The value to check. 7325 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7326 * @example 7327 * 7328 * _.isObject({}); 7329 * // => true 7330 * 7331 * _.isObject([1, 2, 3]); 7332 * // => true 7333 * 7334 * _.isObject(1); 7335 * // => false 7336 */ 7337function isObject(value) { 7338 // Avoid a V8 JIT bug in Chrome 19-20. 7339 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 7340 var type = typeof value; 7341 return !!value && (type == 'object' || type == 'function'); 7342} 7343 7344/** 7345 * Creates an array of the own enumerable property names of `object`. 7346 * 7347 * **Note:** Non-object values are coerced to objects. See the 7348 * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) 7349 * for more details. 7350 * 7351 * @static 7352 * @memberOf _ 7353 * @category Object 7354 * @param {Object} object The object to query. 7355 * @returns {Array} Returns the array of property names. 7356 * @example 7357 * 7358 * function Foo() { 7359 * this.a = 1; 7360 * this.b = 2; 7361 * } 7362 * 7363 * Foo.prototype.c = 3; 7364 * 7365 * _.keys(new Foo); 7366 * // => ['a', 'b'] (iteration order is not guaranteed) 7367 * 7368 * _.keys('hi'); 7369 * // => ['0', '1'] 7370 */ 7371var keys = !nativeKeys ? shimKeys : function(object) { 7372 var Ctor = object == null ? undefined : object.constructor; 7373 if ((typeof Ctor == 'function' && Ctor.prototype === object) || 7374 (typeof object != 'function' && isArrayLike(object))) { 7375 return shimKeys(object); 7376 } 7377 return isObject(object) ? nativeKeys(object) : []; 7378}; 7379 7380/** 7381 * Creates an array of the own and inherited enumerable property names of `object`. 7382 * 7383 * **Note:** Non-object values are coerced to objects. 7384 * 7385 * @static 7386 * @memberOf _ 7387 * @category Object 7388 * @param {Object} object The object to query. 7389 * @returns {Array} Returns the array of property names. 7390 * @example 7391 * 7392 * function Foo() { 7393 * this.a = 1; 7394 * this.b = 2; 7395 * } 7396 * 7397 * Foo.prototype.c = 3; 7398 * 7399 * _.keysIn(new Foo); 7400 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 7401 */ 7402function keysIn(object) { 7403 if (object == null) { 7404 return []; 7405 } 7406 if (!isObject(object)) { 7407 object = Object(object); 7408 } 7409 var length = object.length; 7410 length = (length && isLength(length) && 7411 (isArray(object) || isArguments(object)) && length) || 0; 7412 7413 var Ctor = object.constructor, 7414 index = -1, 7415 isProto = typeof Ctor == 'function' && Ctor.prototype === object, 7416 result = Array(length), 7417 skipIndexes = length > 0; 7418 7419 while (++index < length) { 7420 result[index] = (index + ''); 7421 } 7422 for (var key in object) { 7423 if (!(skipIndexes && isIndex(key, length)) && 7424 !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 7425 result.push(key); 7426 } 7427 } 7428 return result; 7429} 7430 7431module.exports = keys; 7432 7433},{"lodash._getnative":52,"lodash.isarguments":61,"lodash.isarray":62}],68:[function(require,module,exports){ 7434/** 7435 * lodash 3.0.1 (Custom Build) <https://lodash.com/>
7436 * Build: `lodash modern modularize exports="npm" -o ./` 7437 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7438 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7439 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7440 * Available under MIT license <https://lodash.com/license> 7441 */ 7442var before = require('lodash.before'); 7443 7444/** 7445 * Creates a function that is restricted to invoking `func` once. Repeat calls 7446 * to the function return the value of the first call. The `func` is invoked 7447 * with the `this` binding and arguments of the created function. 7448 * 7449 * @static 7450 * @memberOf _ 7451 * @category Function 7452 * @param {Function} func The function to restrict. 7453 * @returns {Function} Returns the new restricted function. 7454 * @example 7455 * 7456 * var initialize = _.once(createApplication); 7457 * initialize(); 7458 * initialize(); 7459 * // `initialize` invokes `createApplication` once 7460 */ 7461function once(func) { 7462 return before(2, func); 7463} 7464 7465module.exports = once; 7466 7467},{"lodash.before":58}],69:[function(require,module,exports){ 7468/** 7469 * lodash 3.6.1 (Custom Build) <https://lodash.com/> 7470 * Build: `lodash modern modularize exports="npm" -o ./` 7471 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7472 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7473 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7474 * Available under MIT license <https://lodash.com/license> 7475 */ 7476 7477/** Used as the `TypeError` message for "Functions" methods. */ 7478var FUNC_ERROR_TEXT = 'Expected a function'; 7479 7480/* Native method references for those with the same name as other `lodash` methods. */ 7481var nativeMax = Math.max; 7482 7483/** 7484 * Creates a function that invokes `func` with the `this` binding of the 7485 * created function and arguments from `start` and beyond provided as an array. 7486 * 7487 * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). 7488 * 7489 * @static 7490 * @memberOf _ 7491 * @category Function 7492 * @param {Function} func The function to apply a rest parameter to. 7493 * @param {number} [start=func.length-1] The start position of the rest parameter. 7494 * @returns {Function} Returns the new function. 7495 * @example 7496 * 7497 * var say = _.restParam(function(what, names) { 7498 * return what + ' ' + _.initial(names).join(', ') + 7499 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 7500 * }); 7501 * 7502 * say('hello', 'fred', 'barney', 'pebbles'); 7503 * // => 'hello fred, barney, & pebbles' 7504 */ 7505function restParam(func, start) { 7506 if (typeof func != 'function') { 7507 throw new TypeError(FUNC_ERROR_TEXT); 7508 } 7509 start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); 7510 return function() { 7511 var args = arguments, 7512 index = -1, 7513 length = nativeMax(args.length - start, 0), 7514 rest = Array(length); 7515 7516 while (++index < length) { 7517 rest[index] = args[start + index]; 7518 } 7519 switch (start) { 7520 case 0: return func.call(this, rest); 7521 case 1: return func.call(this, args[0], rest); 7522 case 2: return func.call(this, args[0], args[1], rest); 7523 } 7524 var otherArgs = Array(start + 1); 7525 index = -1; 7526 while (++index < start) { 7527 otherArgs[index] = args[index]; 7528 } 7529 otherArgs[start] = rest; 7530 return func.apply(this, otherArgs); 7531 }; 7532} 7533 7534module.exports = restParam; 7535 7536},{}],70:[function(require,module,exports){ 7537/** 7538 * lodash 3.1.2 (Custom Build) <https://lodash.com/> 7539 * Build: `lodash modern modularize exports="npm" -o ./` 7540 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> 7541 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7542 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7543 * Available under MIT license <https://lodash.com/license> 7544 */ 7545var baseGet = require('lodash._baseget'), 7546 baseSlice = require('lodash._baseslice'), 7547 toPath = require('lodash._topath'), 7548 isArray = require('lodash.isarray'), 7549 isFunction = require('lodash.isfunction'); 7550 7551/** Used to match property names within property paths. */ 7552var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, 7553 reIsPlainProp = /^\w*$/; 7554 7555/** 7556 * Checks if `value` is a property name and not a property path. 7557 * 7558 * @private 7559 * @param {*} value The value to check. 7560 * @param {Object} [object] The object to query keys on. 7561 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 7562 */ 7563function isKey(value, object) { 7564 var type = typeof value; 7565 if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { 7566 return true; 7567 } 7568 if (isArray(value)) { 7569 return false;
7570 } 7571 var result = !reIsDeepProp.test(value); 7572 return result || (object != null && value in toObject(object)); 7573} 7574 7575/** 7576 * Converts `value` to an object if it's not one. 7577 * 7578 * @private 7579 * @param {*} value The value to process. 7580 * @returns {Object} Returns the object. 7581 */ 7582function toObject(value) { 7583 return isObject(value) ? value : Object(value); 7584} 7585 7586/** 7587 * Gets the last element of `array`. 7588 * 7589 * @static 7590 * @memberOf _ 7591 * @category Array 7592 * @param {Array} array The array to query. 7593 * @returns {*} Returns the last element of `array`. 7594 * @example 7595 * 7596 * _.last([1, 2, 3]); 7597 * // => 3 7598 */ 7599function last(array) { 7600 var length = array ? array.length : 0; 7601 return length ? array[length - 1] : undefined; 7602} 7603 7604/** 7605 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. 7606 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 7607 * 7608 * @static 7609 * @memberOf _ 7610 * @category Lang 7611 * @param {*} value The value to check. 7612 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 7613 * @example 7614 * 7615 * _.isObject({}); 7616 * // => true 7617 * 7618 * _.isObject([1, 2, 3]); 7619 * // => true 7620 * 7621 * _.isObject(1); 7622 * // => false 7623 */ 7624function isObject(value) { 7625 // Avoid a V8 JIT bug in Chrome 19-20. 7626 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. 7627 var type = typeof value; 7628 return !!value && (type == 'object' || type == 'function'); 7629} 7630 7631/** 7632 * This method is like `_.get` except that if the resolved value is a function 7633 * it is invoked with the `this` binding of its parent object and its result 7634 * is returned. 7635 * 7636 * @static 7637 * @memberOf _ 7638 * @category Object 7639 * @param {Object} object The object to query. 7640 * @param {Array|string} path The path of the property to resolve. 7641 * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. 7642 * @returns {*} Returns the resolved value. 7643 * @example 7644 * 7645 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 7646 * 7647 * _.result(object, 'a[0].b.c1'); 7648 * // => 3 7649 * 7650 * _.result(object, 'a[0].b.c2'); 7651 * // => 4 7652 * 7653 * _.result(object, 'a.b.c', 'default'); 7654 * // => 'default' 7655 * 7656 * _.result(object, 'a.b.c', _.constant('default')); 7657 * // => 'default' 7658 */ 7659function result(object, path, defaultValue) { 7660 var result = object == null ? undefined : object[path]; 7661 if (result === undefined) { 7662 if (object != null && !isKey(path, object)) { 7663 path = toPath(path); 7664 object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); 7665 result = object == null ? undefined : object[last(path)]; 7666 } 7667 result = result === undefined ? defaultValue : result; 7668 } 7669 return isFunction(result) ? result.call(object) : result; 7670} 7671 7672module.exports = result; 7673 7674},{"lodash._baseget":47,"lodash._baseslice":48,"lodash._topath":56,"lodash.isarray":62,"lodash.isfunction":64}],71:[function(require,module,exports){ 7675/** 7676 * lodash 3.2.0 (Custom Build) <https://lodash.com/> 7677 * Build: `lodash modularize exports="npm" -o ./` 7678 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/> 7679 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 7680 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 7681 * Available under MIT license <https://lodash.com/license> 7682 */ 7683var root = require('lodash._root'); 7684 7685/** Used as references for various `Number` constants. */ 7686var INFINITY = 1 / 0; 7687 7688/** `Object#toString` result references. */ 7689var symbolTag = '[object Symbol]'; 7690 7691/** Used for built-in method references. */ 7692var objectProto = Object.prototype; 7693 7694/** Used to generate unique IDs. */ 7695var idCounter = 0; 7696 7697/** 7698 * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) 7699 * of values. 7700 */ 7701var objectToString = objectProto.toString; 7702 7703/** Built-in value references. */ 7704var Symbol = root.Symbol; 7705 7706/** Used to convert symbols to primitives and strings. */ 7707var symbolProto = Symbol ? Symbol.prototype : undefined, 7708 symbolToString = Symbol ? symbolProto.toString : undefined; 7709 7710/** 7711 * Checks if `value` is object-like. A value is object-like if it's not `null` 7712 * and has a `typeof` result of "object". 7713 * 7714 * @static 7715 * @memberOf _ 7716 * @category Lang 7717 * @param {*} value The value to check. 7718 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 7719 * @example 7720 * 7721 * _.isObjectLike({}); 7722 * // => true 7723 * 7724 * _.isObjectLike([1, 2, 3]); 7725 * // => true 7726 * 7727 * _.isObjectLike(_.noop); 7728 * // => false 7729 * 7730 * _.isObjectLike(null); 7731 * // => false 7732 */ 7733function isObjectLike(value) { 7734 return !!value && typeof value == 'object'; 7735} 7736 7737/** 7738 * Checks if `value` is classified as a `Symbol` primitive or object. 7739 * 7740 * @static 7741 * @memberOf _ 7742 * @category Lang 7743 * @param {*} value The value to check. 7744 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 7745 * @example 7746 * 7747 * _.isSymbol(Symbol.iterator); 7748 * // => true 7749 * 7750 * _.isSymbol('abc'); 7751 * // => false 7752 */ 7753function isSymbol(value) { 7754 return typeof value == 'symbol' || 7755 (isObjectLike(value) && objectToString.call(value) == symbolTag); 7756} 7757 7758/** 7759 * Converts `value` to a string if it's not one. An empty string is returned 7760 * for `null` and `undefined` values. The sign of `-0` is preserved. 7761 * 7762 * @static 7763 * @memberOf _ 7764 * @category Lang 7765 * @param {*} value The value to process. 7766 * @returns {string} Returns the string. 7767 * @example 7768 * 7769 * _.toString(null); 7770 * // => '' 7771 * 7772 * _.toString(-0); 7773 * // => '-0' 7774 * 7775 * _.toString([1, 2, 3]); 7776 * // => '1,2,3' 7777 */ 7778function toString(value) { 7779 // Exit early for strings to avoid a performance hit in some environments. 7780 if (typeof value == 'string') { 7781 return value; 7782 } 7783 if (value == null) { 7784 return ''; 7785 } 7786 if (isSymbol(value)) { 7787 return Symbol ? symbolToString.call(value) : ''; 7788 } 7789 var result = (value + ''); 7790 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 7791} 7792 7793/** 7794 * Generates a unique ID. If `prefix` is provided the ID is appended to it. 7795 * 7796 * @static 7797 * @memberOf _ 7798 * @category Util 7799 * @param {string} [prefix] The value to prefix the ID with. 7800 * @returns {string} Returns the unique ID. 7801 * @example 7802 * 7803 * _.uniqueId('contact_'); 7804 * // => 'contact_104' 7805 * 7806 * _.uniqueId(); 7807 * // => '105' 7808 */ 7809function uniqueId(prefix) { 7810 var id = ++idCounter; 7811 return toString(prefix) + id; 7812} 7813 7814module.exports = uniqueId; 7815 7816},{"lodash._root":55}],72:[function(require,module,exports){ 7817(function(window) { 7818 var re = { 7819 not_string: /[^s]/, 7820 number: /[diefg]/, 7821 json: /[j]/, 7822 not_json: /[^j]/, 7823 text: /^[^\x25]+/, 7824 modulo: /^\x25{2}/, 7825 placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])
7825/, 7826 key: /^([a-z_][a-z_\d]*)/i, 7827 key_access: /^\.([a-z_][a-z_\d]*)/i, 7828 index_access: /^\[(\d+)\]/, 7829 sign: /^[\+\-]/ 7830 } 7831 7832 function sprintf() { 7833 var key = arguments[0], cache = sprintf.cache 7834 if (!(cache[key] && cache.hasOwnProperty(key))) { 7835 cache[key] = sprintf.parse(key) 7836 } 7837 return sprintf.format.call(null, cache[key], arguments) 7838 } 7839 7840 sprintf.format = function(parse_tree, argv) { 7841 var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" 7842 for (i = 0; i < tree_length; i++) { 7843 node_type = get_type(parse_tree[i]) 7844 if (node_type === "string") { 7845 output[output.length] = parse_tree[i] 7846 } 7847 else if (node_type === "array") { 7848 match = parse_tree[i] // convenience purposes only 7849 if (match[2]) { // keyword argument 7850 arg = argv[cursor] 7851 for (k = 0; k < match[2].length; k++) { 7852 if (!arg.hasOwnProperty(match[2][k])) { 7853 throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) 7854 } 7855 arg = arg[match[2][k]] 7856 } 7857 } 7858 else if (match[1]) { // positional argument (explicit) 7859 arg = argv[match[1]] 7860 } 7861 else { // positional argument (implicit) 7862 arg = argv[cursor++] 7863 } 7864 7865 if (get_type(arg) == "function") { 7866 arg = arg() 7867 } 7868 7869 if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { 7870 throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) 7871 } 7872 7873 if (re.number.test(match[8])) { 7874 is_positive = arg >= 0 7875 } 7876 7877 switch (match[8]) { 7878 case "b": 7879 arg = arg.toString(2) 7880 break 7881 case "c": 7882 arg = String.fromCharCode(arg) 7883 break 7884 case "d": 7885 case "i": 7886 arg = parseInt(arg, 10) 7887 break 7888 case "j": 7889 arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) 7890 break 7891 case "e": 7892 arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() 7893 break 7894 case "f": 7895 arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) 7896 break 7897 case "g": 7898 arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) 7899 break 7900 case "o": 7901 arg = arg.toString(8) 7902 break 7903 case "s": 7904 arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) 7905 break 7906 case "u": 7907 arg = arg >>> 0 7908 break 7909 case "x": 7910 arg = arg.toString(16) 7911 break 7912 case "X": 7913 arg = arg.toString(16).toUpperCase() 7914 break 7915 } 7916 if (re.json.test(match[8])) { 7917 output[output.length] = arg 7918 } 7919 else { 7920 if (re.number.test(match[8]) && (!is_positive || match[3])) { 7921 sign = is_positive ? "+" : "-" 7922 arg = arg.toString().replace(re.sign, "") 7923 } 7924 else { 7925 sign = "" 7926 } 7927 pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " 7928 pad_length = match[6] - (sign + arg).length 7929 pad = match[6] ? (pad_length >
7929 0 ? str_repeat(pad_character, pad_length) : "") : "" 7930 output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) 7931 } 7932 } 7933 } 7934 return output.join("") 7935 } 7936 7937 sprintf.cache = {} 7938 7939 sprintf.parse = function(fmt) { 7940 var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 7941 while (_fmt) { 7942 if ((match = re.text.exec(_fmt)) !== null) { 7943 parse_tree[parse_tree.length] = match[0] 7944 } 7945 else if ((match = re.modulo.exec(_fmt)) !== null) { 7946 parse_tree[parse_tree.length] = "%" 7947 } 7948 else if ((match = re.placeholder.exec(_fmt)) !== null) { 7949 if (match[2]) { 7950 arg_names |= 1 7951 var field_list = [], replacement_field = match[2], field_match = [] 7952 if ((field_match = re.key.exec(replacement_field)) !== null) { 7953 field_list[field_list.length] = field_match[1] 7954 while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { 7955 if ((field_match = re.key_access.exec(replacement_field)) !== null) { 7956 field_list[field_list.length] = field_match[1] 7957 } 7958 else if ((field_match = re.index_access.exec(replacement_field)) !== null) { 7959 field_list[field_list.length] = field_match[1] 7960 } 7961 else { 7962 throw new SyntaxError("[sprintf] failed to parse named argument key") 7963 } 7964 } 7965 } 7966 else { 7967 throw new SyntaxError("[sprintf] failed to parse named argument key") 7968 } 7969 match[2] = field_list 7970 } 7971 else { 7972 arg_names |= 2 7973 } 7974 if (arg_names === 3) { 7975 throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") 7976 } 7977 parse_tree[parse_tree.length] = match 7978 } 7979 else { 7980 throw new SyntaxError("[sprintf] unexpected placeholder") 7981 } 7982 _fmt = _fmt.substring(match[0].length) 7983 } 7984 return parse_tree 7985 } 7986 7987 var vsprintf = function(fmt, argv, _argv) { 7988 _argv = (argv || []).slice(0) 7989 _argv.splice(0, 0, fmt) 7990 return sprintf.apply(null, _argv) 7991 } 7992 7993 /** 7994 * helpers 7995 */ 7996 function get_type(variable) { 7997 return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() 7998 } 7999 8000 function str_repeat(input, multiplier) { 8001 return Array(multiplier + 1).join(input) 8002 } 8003 8004 /** 8005 * export to either browser or node.js 8006 */ 8007 if (typeof exports !== "undefined") { 8008 exports.sprintf = sprintf 8009 exports.vsprintf = vsprintf 8010 } 8011 else { 8012 window.sprintf = sprintf 8013 window.vsprintf = vsprintf 8014 8015 if (typeof define === "function" && define.amd) { 8016 define(function() { 8017 return { 8018 sprintf: sprintf, 8019 vsprintf: vsprintf 8020 } 8021 }) 8022 } 8023 } 8024})(typeof window === "undefined" ? this : window); 8025 8026},{}],73:[function(require,module,exports){ 8027module.exports = function(func) { 8028 setTimeout(func, 0); 8029}; 8030 8031},{}],74:[function(require,module,exports){ 8032var checkEmpty = function(locationData) { 8033 if(! locationData || locationData.trim().length === 0 ) { 8034 return null; 8035 } 8036 return locationData; 8037}; 8038 8039var parseJsonLocationData = function(jsonLocationDataEl) { 8040 if(!jsonLocationDataEl) { 8041 return {address: {}}; 8042 } 8043 8044 return JSON.parse(jsonLocationDataEl.textContent); 8045}; 8046 8047var getEmbedKey = function(locationDataEl) { 8048 if(!locationDataEl) { 8049 return ''; 8050 } 8051 8052 return locationDataEl.getAttribute('data-embed-key'); 8053}; 8054 8055var formatHours = function(hoursData) { 8056 8057 if (! hoursData || hoursData.length === 0) { 8058 return null; 8059 } 8060 8061 var hoursArray = hoursData.map(function(day) { 8062 var daySplat = day.split(' '); 8063 var dayAbbrev = daySplat[0]; 8064 var openCloseSplat = daySplat[1].split('-'); 8065 8066 return { 8067 day: dayAbbrev, 8068 open: openCloseSplat[0], 8069 close: openCloseSplat[1] 8070 }; 8071 }); 8072 8073 return hoursArray.reduce(function(accumulatedDayObject, dayObject) { 8074 accumulatedDayObject[dayObject.day] = { 8075 open: dayObject.open, 8076 close: dayObject.close 8077 }; 8078 8079 return accumulatedDayObject; 8080 }, {}); 8081}; 8082 8083var initializeSiteLocation = function(siteLocation, locationDataID) { 8084 var initializeHelper = function() { 8085 var locationDataEl = document.getElementById(locationDataID); 8086 var embedAPIKey = getEmbedKey(locationDataEl); 8087 var jsonld = parseJsonLocationData(locationDataEl); 8088 var hoursObject, locationData, address, city, state, zipcode, country; 8089 address = checkEmpty(jsonld.address.streetAddress); 8090 city = checkEmpty(jsonld.address.addressLocality); 8091 state = checkEmpty(jsonld.address.addressRegion); 8092 zipcode = checkEmpty(jsonld.address.postalCode); 8093 country = checkEmpty(jsonld.address.addressCountry); 8094 hoursObject = formatHours(jsonld.openingHours); 8095 8096 8097 if(address || city || state || zipcode || country) { 8098 locationData = { 8099 address: address, 8100 city: city, 8101 state: state, 8102 zipcode: zipcode, 8103 country: country 8104 }; 8105 } 8106 8107 var cleintWidth = document.documentElement.clientWidth; 8108 var innerWidth = window.innerWidth || 0; 8109 var viewportWidth = Math.max(cleintWidth, innerWidth); 8110 var lang = document.body.lang || 'en'; 8111 8112 /* Only initialize the sitelocation view if the viewport is smaller than 8113 * 736 pixels. 8114 */ 8115 if(viewportWidth <= 736) { 8116 siteLocation.initialize({ 8117 lang: lang, 8118 hours: hoursObject, 8119 phone: checkEmpty(jsonld.telephone), 8120 location: locationData, 8121 embedAPIKey: embedAPIKey 8122 }); 8123 } 8124 }; 8125 8126 return initializeHelper; 8127}; 8128 8129module.exports = initializeSiteLocation; 8130 8131},{}],75:[function(require,module,exports){ 8132 8133},{}],76:[function(require,module,exports){ 8134'use strict'; 8135 8136var bind = require('function-bind'); 8137 8138var $apply = require('./functionApply'); 8139var $call = require('./functionCall');
vendor: 6,737 bytes, lines 8140-8390
8140var $reflectApply = require('./reflectApply'); 8141 8142/** @type {import('./actualApply')} */ 8143module.exports = $reflectApply || bind.call($call, $apply); 8144 8145},{"./functionApply":77,"./functionCall":78,"./reflectApply":80,"function-bind":93}],77:[function(require,module,exports){ 8146'use strict'; 8147 8148/** @type {import('./functionApply')} */ 8149module.exports = Function.prototype.apply; 8150 8151},{}],78:[function(require,module,exports){ 8152'use strict'; 8153 8154/** @type {import('./functionCall')} */ 8155module.exports = Function.prototype.call; 8156 8157},{}],79:[function(require,module,exports){ 8158'use strict'; 8159 8160var bind = require('function-bind'); 8161var $TypeError = require('es-errors/type'); 8162 8163var $call = require('./functionCall'); 8164var $actualApply = require('./actualApply'); 8165 8166/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ 8167module.exports = function callBindBasic(args) { 8168 if (args.length < 1 || typeof args[0] !== 'function') { 8169 throw new $TypeError('a function is required'); 8170 } 8171 return $actualApply(bind, $call, args); 8172}; 8173 8174},{"./actualApply":76,"./functionCall":78,"es-errors/type":89,"function-bind":93}],80:[function(require,module,exports){ 8175'use strict'; 8176 8177/** @type {import('./reflectApply')} */ 8178module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; 8179 8180},{}],81:[function(require,module,exports){ 8181'use strict'; 8182 8183var GetIntrinsic = require('get-intrinsic'); 8184 8185var callBindBasic = require('call-bind-apply-helpers'); 8186 8187/** @type {(thisArg: string, searchString: string, position?: number) => number} */ 8188var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); 8189 8190/** @type {import('.')} */ 8191module.exports = function callBoundIntrinsic(name, allowMissing) { 8192 /* eslint no-extra-parens: 0 */ 8193 8194 var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); 8195 if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { 8196 return callBindBasic(/** @type {const} */ ([intrinsic])); 8197 } 8198 return intrinsic; 8199}; 8200 8201},{"call-bind-apply-helpers":79,"get-intrinsic":94}],82:[function(require,module,exports){ 8202'use strict'; 8203 8204var callBind = require('call-bind-apply-helpers'); 8205var gOPD = require('gopd'); 8206 8207var hasProtoAccessor; 8208try { 8209 // eslint-disable-next-line no-extra-parens, no-proto 8210 hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; 8211} catch (e) { 8212 if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { 8213 throw e; 8214 } 8215} 8216 8217// eslint-disable-next-line no-extra-parens 8218var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); 8219 8220var $Object = Object; 8221var $getPrototypeOf = $Object.getPrototypeOf; 8222 8223/** @type {import('./get')} */ 8224module.exports = desc && typeof desc.get === 'function' 8225 ? callBind([desc.get]) 8226 : typeof $getPrototypeOf === 'function' 8227 ? /** @type {import('./get')} */ function getDunder(value) { 8228 // eslint-disable-next-line eqeqeq 8229 return $getPrototypeOf(value == null ? value : $Object(value)); 8230 } 8231 : false; 8232 8233},{"call-bind-apply-helpers":79,"gopd":99}],83:[function(require,module,exports){ 8234'use strict'; 8235 8236/** @type {import('.')} */ 8237var $defineProperty = Object.defineProperty || false; 8238if ($defineProperty) { 8239 try { 8240 $defineProperty({}, 'a', { value: 1 }); 8241 } catch (e) { 8242 // IE 8 has a broken defineProperty 8243 $defineProperty = false; 8244 } 8245} 8246 8247module.exports = $defineProperty; 8248 8249},{}],84:[function(require,module,exports){ 8250'use strict'; 8251 8252/** @type {import('./eval')} */ 8253module.exports = EvalError; 8254 8255},{}],85:[function(require,module,exports){ 8256'use strict'; 8257 8258/** @type {import('.')} */ 8259module.exports = Error; 8260 8261},{}],86:[function(require,module,exports){ 8262'use strict'; 8263 8264/** @type {import('./range')} */ 8265module.exports = RangeError; 8266 8267},{}],87:[function(require,module,exports){ 8268'use strict'; 8269 8270/** @type {import('./ref')} */ 8271module.exports = ReferenceError; 8272 8273},{}],88:[function(require,module,exports){ 8274'use strict'; 8275 8276/** @type {import('./syntax')} */ 8277module.exports = SyntaxError; 8278 8279},{}],89:[function(require,module,exports){ 8280'use strict'; 8281 8282/** @type {import('./type')} */ 8283module.exports = TypeError; 8284 8285},{}],90:[function(require,module,exports){ 8286'use strict'; 8287 8288/** @type {import('./uri')} */ 8289module.exports = URIError; 8290 8291},{}],91:[function(require,module,exports){ 8292'use strict'; 8293 8294/** @type {import('.')} */ 8295module.exports = Object; 8296 8297},{}],92:[function(require,module,exports){ 8298'use strict'; 8299 8300/* eslint no-invalid-this: 1 */ 8301 8302var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; 8303var toStr = Object.prototype.toString; 8304var max = Math.max; 8305var funcType = '[object Function]'; 8306 8307var concatty = function concatty(a, b) { 8308 var arr = []; 8309 8310 for (var i = 0; i < a.length; i += 1) { 8311 arr[i] = a[i]; 8312 } 8313 for (var j = 0; j < b.length; j += 1) { 8314 arr[j + a.length] = b[j]; 8315 } 8316 8317 return arr; 8318}; 8319 8320var slicy = function slicy(arrLike, offset) { 8321 var arr = []; 8322 for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { 8323 arr[j] = arrLike[i]; 8324 } 8325 return arr; 8326}; 8327 8328var joiny = function (arr, joiner) { 8329 var str = ''; 8330 for (var i = 0; i < arr.length; i += 1) { 8331 str += arr[i]; 8332 if (i + 1 < arr.length) { 8333 str += joiner; 8334 } 8335 } 8336 return str; 8337}; 8338 8339module.exports = function bind(that) { 8340 var target = this; 8341 if (typeof target !== 'function' || toStr.apply(target) !== funcType) { 8342 throw new TypeError(ERROR_MESSAGE + target); 8343 } 8344 var args = slicy(arguments, 1); 8345 8346 var bound; 8347 var binder = function () { 8348 if (this instanceof bound) { 8349 var result = target.apply( 8350 this, 8351 concatty(args, arguments) 8352 ); 8353 if (Object(result) === result) { 8354 return result; 8355 } 8356 return this; 8357 } 8358 return target.apply( 8359 that, 8360 concatty(args, arguments) 8361 ); 8362 8363 }; 8364 8365 var boundLength = max(0, target.length - args.length); 8366 var boundArgs = []; 8367 for (var i = 0; i < boundLength; i++) { 8368 boundArgs[i] = '$' + i; 8369 } 8370 8371 bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); 8372 8373 if (target.prototype) { 8374 var Empty = function Empty() {}; 8375 Empty.prototype = target.prototype; 8376 bound.prototype = new Empty(); 8377 Empty.prototype = null; 8378 } 8379 8380 return bound; 8381}; 8382 8383},{}],93:[function(require,module,exports){ 8384'use strict'; 8385 8386var implementation = require('./implementation'); 8387 8388module.exports = Function.prototype.bind || implementation; 8389 8390},{"./implementation":92}],94
vendor: 6,095 bytes, lines 8390-8537
8390:[function(require,module,exports){ 8391'use strict'; 8392 8393var undefined; 8394 8395var $Object = require('es-object-atoms'); 8396 8397var $Error = require('es-errors'); 8398var $EvalError = require('es-errors/eval'); 8399var $RangeError = require('es-errors/range'); 8400var $ReferenceError = require('es-errors/ref'); 8401var $SyntaxError = require('es-errors/syntax'); 8402var $TypeError = require('es-errors/type'); 8403var $URIError = require('es-errors/uri'); 8404 8405var abs = require('math-intrinsics/abs'); 8406var floor = require('math-intrinsics/floor'); 8407var max = require('math-intrinsics/max'); 8408var min = require('math-intrinsics/min'); 8409var pow = require('math-intrinsics/pow'); 8410var round = require('math-intrinsics/round'); 8411var sign = require('math-intrinsics/sign'); 8412 8413var $Function = Function; 8414 8415// eslint-disable-next-line consistent-return 8416var getEvalledConstructor = function (expressionSyntax) { 8417 try { 8418 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 8419 } catch (e) {} 8420}; 8421 8422var $gOPD = require('gopd'); 8423var $defineProperty = require('es-define-property'); 8424 8425var throwTypeError = function () { 8426 throw new $TypeError(); 8427}; 8428var ThrowTypeError = $gOPD 8429 ? (function () { 8430 try { 8431 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 8432 arguments.callee; // IE 8 does not throw here 8433 return throwTypeError; 8434 } catch (calleeThrows) { 8435 try { 8436 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 8437 return $gOPD(arguments, 'callee').get; 8438 } catch (gOPDthrows) { 8439 return throwTypeError; 8440 } 8441 } 8442 }()) 8443 : throwTypeError; 8444 8445var hasSymbols = require('has-symbols')(); 8446 8447var getProto = require('get-proto'); 8448var $ObjectGPO = require('get-proto/Object.getPrototypeOf'); 8449var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf'); 8450 8451var $apply = require('call-bind-apply-helpers/functionApply'); 8452var $call = require('call-bind-apply-helpers/functionCall'); 8453 8454var needsEval = {}; 8455 8456var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); 8457 8458var INTRINSICS = { 8459 __proto__: null, 8460 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 8461 '%Array%': Array, 8462 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 8463 '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, 8464 '%AsyncFromSyncIteratorPrototype%': undefined, 8465 '%AsyncFunction%': needsEval, 8466 '%AsyncGenerator%': needsEval, 8467 '%AsyncGeneratorFunction%': needsEval, 8468 '%AsyncIteratorPrototype%': needsEval, 8469 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 8470 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 8471 '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, 8472 '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, 8473 '%Boolean%': Boolean, 8474 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 8475 '%Date%': Date, 8476 '%decodeURI%': decodeURI, 8477 '%decodeURIComponent%': decodeURIComponent, 8478 '%encodeURI%': encodeURI, 8479 '%encodeURIComponent%': encodeURIComponent, 8480 '%Error%': $Error, 8481 '%eval%': eval, // eslint-disable-line no-eval 8482 '%EvalError%': $EvalError, 8483 '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, 8484 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 8485 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 8486 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 8487 '%Function%': $Function, 8488 '%GeneratorFunction%': needsEval, 8489 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 8490 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 8491 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 8492 '%isFinite%': isFinite, 8493 '%isNaN%': isNaN, 8494 '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, 8495 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 8496 '%Map%': typeof Map === 'undefined' ? undefined : Map, 8497 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), 8498 '%Math%': Math, 8499 '%Number%': Number, 8500 '%Object%': $Object, 8501 '%Object.getOwnPropertyDescriptor%': $gOPD, 8502 '%parseFloat%': parseFloat, 8503 '%parseInt%': parseInt, 8504 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 8505 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 8506 '%RangeError%': $RangeError, 8507 '%ReferenceError%': $ReferenceError, 8508 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 8509 '%RegExp%': RegExp, 8510 '%Set%': typeof Set === 'undefined' ? undefined : Set, 8511 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), 8512 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 8513 '%String%': String, 8514 '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, 8515 '%Symbol%': hasSymbols ? Symbol : undefined, 8516 '%SyntaxError%': $SyntaxError, 8517 '%ThrowTypeError%': ThrowTypeError, 8518 '%TypedArray%': TypedArray, 8519 '%TypeError%': $TypeError, 8520 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 8521 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 8522 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 8523 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 8524 '%URIError%': $URIError, 8525 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 8526 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 8527 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, 8528 8529 '%Function.prototype.call%': $call, 8530 '%Function.prototype.apply%': $apply, 8531 '%Object.defineProperty%': $defineProperty, 8532 '%Object.getPrototypeOf%': $ObjectGPO, 8533 '%Math.abs%': abs, 8534 '%Math.floor%': floor, 8535 '%Math.max%': max, 8536 '%Math.min%': min, 8537 '%Math.pow%': pow,
vendor: 8,380 bytes, lines 8538-8768
8538 '%Math.round%': round, 8539 '%Math.sign%': sign, 8540 '%Reflect.getPrototypeOf%': $ReflectGPO 8541}; 8542 8543if (getProto) { 8544 try { 8545 null.error; // eslint-disable-line no-unused-expressions 8546 } catch (e) { 8547 // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 8548 var errorProto = getProto(getProto(e)); 8549 INTRINSICS['%Error.prototype%'] = errorProto; 8550 } 8551} 8552 8553var doEval = function doEval(name) { 8554 var value; 8555 if (name === '%AsyncFunction%') { 8556 value = getEvalledConstructor('async function () {}'); 8557 } else if (name === '%GeneratorFunction%') { 8558 value = getEvalledConstructor('function* () {}'); 8559 } else if (name === '%AsyncGeneratorFunction%') { 8560 value = getEvalledConstructor('async function* () {}'); 8561 } else if (name === '%AsyncGenerator%') { 8562 var fn = doEval('%AsyncGeneratorFunction%'); 8563 if (fn) { 8564 value = fn.prototype; 8565 } 8566 } else if (name === '%AsyncIteratorPrototype%') { 8567 var gen = doEval('%AsyncGenerator%'); 8568 if (gen && getProto) { 8569 value = getProto(gen.prototype); 8570 } 8571 } 8572 8573 INTRINSICS[name] = value; 8574 8575 return value; 8576}; 8577 8578var LEGACY_ALIASES = { 8579 __proto__: null, 8580 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 8581 '%ArrayPrototype%': ['Array', 'prototype'], 8582 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 8583 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 8584 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 8585 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 8586 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 8587 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 8588 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 8589 '%BooleanPrototype%': ['Boolean', 'prototype'], 8590 '%DataViewPrototype%': ['DataView', 'prototype'], 8591 '%DatePrototype%': ['Date', 'prototype'], 8592 '%ErrorPrototype%': ['Error', 'prototype'], 8593 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 8594 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 8595 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 8596 '%FunctionPrototype%': ['Function', 'prototype'], 8597 '%Generator%': ['GeneratorFunction', 'prototype'], 8598 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 8599 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 8600 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 8601 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 8602 '%JSONParse%': ['JSON', 'parse'], 8603 '%JSONStringify%': ['JSON', 'stringify'], 8604 '%MapPrototype%': ['Map', 'prototype'], 8605 '%NumberPrototype%': ['Number', 'prototype'], 8606 '%ObjectPrototype%': ['Object', 'prototype'], 8607 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 8608 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 8609 '%PromisePrototype%': ['Promise', 'prototype'], 8610 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 8611 '%Promise_all%': ['Promise', 'all'], 8612 '%Promise_reject%': ['Promise', 'reject'], 8613 '%Promise_resolve%': ['Promise', 'resolve'], 8614 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 8615 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 8616 '%RegExpPrototype%': ['RegExp', 'prototype'], 8617 '%SetPrototype%': ['Set', 'prototype'], 8618 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 8619 '%StringPrototype%': ['String', 'prototype'], 8620 '%SymbolPrototype%': ['Symbol', 'prototype'], 8621 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 8622 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 8623 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 8624 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 8625 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 8626 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 8627 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 8628 '%URIErrorPrototype%': ['URIError', 'prototype'], 8629 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 8630 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 8631}; 8632 8633var bind = require('function-bind'); 8634var hasOwn = require('hasown'); 8635var $concat = bind.call($call, Array.prototype.concat); 8636var $spliceApply = bind.call($apply, Array.prototype.splice); 8637var $replace = bind.call($call, String.prototype.replace); 8638var $strSlice = bind.call($call, String.prototype.slice); 8639var $exec = bind.call($call, RegExp.prototype.exec); 8640 8641/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 8642var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 8643var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 8644var stringToPath = function stringToPath(string) { 8645 var first = $strSlice(string, 0, 1); 8646 var last = $strSlice(string, -1); 8647 if (first === '%' && last !== '%') { 8648 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 8649 } else if (last === '%' && first !== '%') { 8650 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 8651 } 8652 var result = []; 8653 $replace(string, rePropName, function (match, number, quote, subString) { 8654 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 8655 }); 8656 return result; 8657}; 8658/* end adaptation */ 8659 8660var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 8661 var intrinsicName = name; 8662 var alias; 8663 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 8664 alias = LEGACY_ALIASES[intrinsicName]; 8665 intrinsicName = '%' + alias[0] + '%'; 8666 } 8667 8668 if (hasOwn(INTRINSICS, intrinsicName)) { 8669 var value = INTRINSICS[intrinsicName]; 8670 if (value === needsEval) { 8671 value = doEval(intrinsicName); 8672 } 8673 if (typeof value === 'undefined' && !allowMissing) { 8674 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 8675 } 8676 8677 return { 8678 alias: alias, 8679 name: intrinsicName, 8680 value: value 8681 }; 8682 } 8683 8684 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 8685}; 8686 8687module.exports = function GetIntrinsic(name, allowMissing) { 8688 if (typeof name !== 'string' || name.length === 0) { 8689 throw new $TypeError('intrinsic name must be a non-empty string'); 8690 } 8691 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 8692 throw new $TypeError('"allowMissing" argument must be a boolean'); 8693 } 8694 8695 if ($exec(/^%?[^%]*%?$/, name) === null) { 8696 throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); 8697 } 8698 var parts = stringToPath(name); 8699 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 8700 8701 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 8702 var intrinsicRealName = intrinsic.name; 8703 var value = intrinsic.value; 8704 var skipFurtherCaching = false; 8705 8706 var alias = intrinsic.alias; 8707 if (alias) { 8708 intrinsicBaseName = alias[0]; 8709 $spliceApply(parts, $concat([0, 1], alias)); 8710 } 8711 8712 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 8713 var part = parts[i]; 8714 var first = $strSlice(part, 0, 1); 8715 var last = $strSlice(part, -1); 8716 if ( 8717 ( 8718 (first === '"' || first === "'" || first === '`') 8719 || (last === '"' || last === "'" || last === '`') 8720 ) 8721 && first !== last 8722 ) { 8723 throw new $SyntaxError('property names with quotes must have matching quotes'); 8724 } 8725 if (part === 'constructor' || !isOwn) { 8726 skipFurtherCaching = true; 8727 } 8728 8729 intrinsicBaseName += '.' + part; 8730 intrinsicRealName = '%' + intrinsicBaseName + '%'; 8731 8732 if (hasOwn(INTRINSICS, intrinsicRealName)) { 8733 value = INTRINSICS[intrinsicRealName]; 8734 } else if (value != null) { 8735 if (!(part in value)) { 8736 if (!allowMissing) { 8737 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 8738 } 8739 return void undefined; 8740 } 8741 if ($gOPD && (i + 1) >= parts.length) { 8742 var desc = $gOPD(value, part); 8743 isOwn = !!desc; 8744 8745 // By convention, when a data property is converted to an accessor 8746 // property to emulate a data property that does not suffer from 8747 // the override mistake, that accessor's getter is marked with 8748 // an `originalValue` property. Here, when we detect this, we 8749 // uphold the illusion by pretending to see that original data 8750 // property, i.e., returning the value rather than the getter 8751 // itself. 8752 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 8753 value = desc.get; 8754 } else { 8755 value = value[part]; 8756 } 8757 } else { 8758 isOwn = hasOwn(value, part); 8759 value = value[part]; 8760 } 8761 8762 if (isOwn && !skipFurtherCaching) { 8763 INTRINSICS[intrinsicRealName] = value; 8764 } 8765 } 8766 } 8767 return value; 8768};
8769 8770},{"call-bind-apply-helpers/functionApply":77,"call-bind-apply-helpers/functionCall":78,"es-define-property":83,"es-errors":85,"es-errors/eval":84,"es-errors/range":86,"es-errors/ref":87,"es-errors/syntax":88,"es-errors/type":89,"es-errors/uri":90,"es-object-atoms":91,"function-bind":93,"get-proto":97,"get-proto/Object.getPrototypeOf":95,"get-proto/Reflect.getPrototypeOf":96,"gopd":99,"has-symbols":119,"hasown":121,"math-intrinsics/abs":122,"math-intrinsics/floor":123,"math-intrinsics/max":125,"math-intrinsics/min":126,"math-intrinsics/pow":127,"math-intrinsics/round":128,"math-intrinsics/sign":129}],95:[function(require,module,exports){ 8771'use strict'; 8772 8773var $Object = require('es-object-atoms'); 8774 8775/** @type {import('./Object.getPrototypeOf')} */ 8776module.exports = $Object.getPrototypeOf || null; 8777 8778},{"es-object-atoms":91}],96:[function(require,module,exports){ 8779'use strict'; 8780 8781/** @type {import('./Reflect.getPrototypeOf')} */ 8782module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; 8783 8784},{}],97:[function(require,module,exports){ 8785'use strict'; 8786 8787var reflectGetProto = require('./Reflect.getPrototypeOf'); 8788var originalGetProto = require('./Object.getPrototypeOf'); 8789 8790var getDunderProto = require('dunder-proto/get'); 8791 8792/** @type {import('.')} */ 8793module.exports = reflectGetProto 8794 ? function getProto(O) { 8795 // @ts-expect-error TS can't narrow inside a closure, for some reason 8796 return reflectGetProto(O); 8797 } 8798 : originalGetProto 8799 ? function getProto(O) { 8800 if (!O || (typeof O !== 'object' && typeof O !== 'function')) { 8801 throw new TypeError('getProto: not an object'); 8802 } 8803 // @ts-expect-error TS can't narrow inside a closure, for some reason 8804 return originalGetProto(O); 8805 } 8806 : getDunderProto 8807 ? function getProto(O) { 8808 // @ts-expect-error TS can't narrow inside a closure, for some reason 8809 return getDunderProto(O); 8810 } 8811 : null; 8812 8813},{"./Object.getPrototypeOf":95,"./Reflect.getPrototypeOf":96,"dunder-proto/get":82}],98:[function(require,module,exports){ 8814'use strict'; 8815 8816/** @type {import('./gOPD')} */ 8817module.exports = Object.getOwnPropertyDescriptor; 8818 8819},{}],99:[function(require,module,exports){ 8820'use strict'; 8821 8822/** @type {import('.')} */ 8823var $gOPD = require('./gOPD'); 8824 8825if ($gOPD) { 8826 try { 8827 $gOPD([], 'length'); 8828 } catch (e) { 8829 // IE 8 has a broken gOPD 8830 $gOPD = null; 8831 } 8832} 8833 8834module.exports = $gOPD; 8835 8836},{"./gOPD":98}],100:[function(require,module,exports){ 8837'use strict'; 8838 8839exports.__esModule = true; 8840// istanbul ignore next 8841 8842function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8843 8844// istanbul ignore next 8845 8846function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } 8847 8848var _handlebarsBase = require('./handlebars/base'); 8849 8850var base = _interopRequireWildcard(_handlebarsBase); 8851 8852// Each of these augment the Handlebars object. No need to setup here. 8853// (This is done to easily share code between commonjs and browse envs) 8854 8855var _handlebarsSafeString = require('./handlebars/safe-string'); 8856 8857var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); 8858 8859var _handlebarsException = require('./handlebars/exception'); 8860 8861var _handlebarsException2 = _interopRequireDefault(_handlebarsException); 8862 8863var _handlebarsUtils = require('./handlebars/utils'); 8864 8865var Utils = _interopRequireWildcard(_handlebarsUtils); 8866 8867var _handlebarsRuntime = require('./handlebars/runtime'); 8868 8869var runtime = _interopRequireWildcard(_handlebarsRuntime); 8870 8871var _handlebarsNoConflict = require('./handlebars/no-conflict'); 8872 8873var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 8874 8875// For compatibility and usage outside of module systems, make the Handlebars object a namespace 8876function create() { 8877 var hb = new base.HandlebarsEnvironment(); 8878 8879 Utils.extend(hb, base); 8880 hb.SafeString = _handlebarsSafeString2['default']; 8881 hb.Exception = _handlebarsException2['default']; 8882 hb.Utils = Utils; 8883 hb.escapeExpression = Utils.escapeExpression; 8884 8885 hb.VM = runtime; 8886 hb.template = function (spec) { 8887 return runtime.template(spec, hb); 8888 }; 8889 8890 return hb; 8891} 8892 8893var inst = create(); 8894inst.create = create; 8895 8896_handlebarsNoConflict2['default'](inst); 8897 8898inst['default'] = inst; 8899 8900exports['default'] = inst; 8901module.exports = exports['default']; 8902 8903 8904},{"./handlebars/base":101,"./handlebars/exception":104,"./handlebars/no-conflict":114,"./handlebars/runtime":115,"./handlebars/safe-string":116,"./handlebars/utils":117}],101:[function(require,module,exports){ 8905'use strict'; 8906 8907exports.__esModule = true; 8908exports.HandlebarsEnvironment = HandlebarsEnvironment; 8909// istanbul ignore next 8910 8911function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 8912 8913var _utils = require('./utils'); 8914 8915var _exception = require('./exception'); 8916 8917var _exception2 = _interopRequireDefault(_exception); 8918 8919var _helpers = require('./helpers'); 8920 8921var _decorators = require('./decorators'); 8922 8923var _logger = require('./logger'); 8924 8925var _logger2 = _interopRequireDefault(_logger); 8926 8927var VERSION = '4.0.14'; 8928exports.VERSION = VERSION; 8929var COMPILER_REVISION = 7; 8930 8931exports.COMPILER_REVISION = COMPILER_REVISION; 8932var REVISION_CHANGES = { 8933 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 8934 2: '== 1.0.0-rc.3', 8935 3: '== 1.0.0-rc.4', 8936 4: '== 1.x.x', 8937 5: '== 2.0.0-alpha.x', 8938 6: '>
vendor: 28,057 bytes, lines 8938-9902
8938= 2.0.0-beta.1', 8939 7: '>= 4.0.0' 8940}; 8941 8942exports.REVISION_CHANGES = REVISION_CHANGES; 8943var objectType = '[object Object]'; 8944 8945function HandlebarsEnvironment(helpers, partials, decorators) { 8946 this.helpers = helpers || {}; 8947 this.partials = partials || {}; 8948 this.decorators = decorators || {}; 8949 8950 _helpers.registerDefaultHelpers(this); 8951 _decorators.registerDefaultDecorators(this); 8952} 8953 8954HandlebarsEnvironment.prototype = { 8955 constructor: HandlebarsEnvironment, 8956 8957 logger: _logger2['default'], 8958 log: _logger2['default'].log, 8959 8960 registerHelper: function registerHelper(name, fn) { 8961 if (_utils.toString.call(name) === objectType) { 8962 if (fn) { 8963 throw new _exception2['default']('Arg not supported with multiple helpers'); 8964 } 8965 _utils.extend(this.helpers, name); 8966 } else { 8967 this.helpers[name] = fn; 8968 } 8969 }, 8970 unregisterHelper: function unregisterHelper(name) { 8971 delete this.helpers[name]; 8972 }, 8973 8974 registerPartial: function registerPartial(name, partial) { 8975 if (_utils.toString.call(name) === objectType) { 8976 _utils.extend(this.partials, name); 8977 } else { 8978 if (typeof partial === 'undefined') { 8979 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); 8980 } 8981 this.partials[name] = partial; 8982 } 8983 }, 8984 unregisterPartial: function unregisterPartial(name) { 8985 delete this.partials[name]; 8986 }, 8987 8988 registerDecorator: function registerDecorator(name, fn) { 8989 if (_utils.toString.call(name) === objectType) { 8990 if (fn) { 8991 throw new _exception2['default']('Arg not supported with multiple decorators'); 8992 } 8993 _utils.extend(this.decorators, name); 8994 } else { 8995 this.decorators[name] = fn; 8996 } 8997 }, 8998 unregisterDecorator: function unregisterDecorator(name) { 8999 delete this.decorators[name]; 9000 } 9001}; 9002 9003var log = _logger2['default'].log; 9004 9005exports.log = log; 9006exports.createFrame = _utils.createFrame; 9007exports.logger = _logger2['default']; 9008 9009 9010},{"./decorators":102,"./exception":104,"./helpers":105,"./logger":113,"./utils":117}],102:[function(require,module,exports){ 9011'use strict'; 9012 9013exports.__esModule = true; 9014exports.registerDefaultDecorators = registerDefaultDecorators; 9015// istanbul ignore next 9016 9017function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9018 9019var _decoratorsInline = require('./decorators/inline'); 9020 9021var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); 9022 9023function registerDefaultDecorators(instance) { 9024 _decoratorsInline2['default'](instance); 9025} 9026 9027 9028},{"./decorators/inline":103}],103:[function(require,module,exports){ 9029'use strict'; 9030 9031exports.__esModule = true; 9032 9033var _utils = require('../utils'); 9034 9035exports['default'] = function (instance) { 9036 instance.registerDecorator('inline', function (fn, props, container, options) { 9037 var ret = fn; 9038 if (!props.partials) { 9039 props.partials = {}; 9040 ret = function (context, options) { 9041 // Create a new partials stack frame prior to exec. 9042 var original = container.partials; 9043 container.partials = _utils.extend({}, original, props.partials); 9044 var ret = fn(context, options); 9045 container.partials = original; 9046 return ret; 9047 }; 9048 } 9049 9050 props.partials[options.args[0]] = options.fn; 9051 9052 return ret; 9053 }); 9054}; 9055 9056module.exports = exports['default']; 9057 9058 9059},{"../utils":117}],104:[function(require,module,exports){ 9060'use strict'; 9061 9062exports.__esModule = true; 9063 9064var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; 9065 9066function Exception(message, node) { 9067 var loc = node && node.loc, 9068 line = undefined, 9069 column = undefined; 9070 if (loc) { 9071 line = loc.start.line; 9072 column = loc.start.column; 9073 9074 message += ' - ' + line + ':' + column; 9075 } 9076 9077 var tmp = Error.prototype.constructor.call(this, message); 9078 9079 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. 9080 for (var idx = 0; idx < errorProps.length; idx++) { 9081 this[errorProps[idx]] = tmp[errorProps[idx]]; 9082 } 9083 9084 /* istanbul ignore else */ 9085 if (Error.captureStackTrace) { 9086 Error.captureStackTrace(this, Exception); 9087 } 9088 9089 try { 9090 if (loc) { 9091 this.lineNumber = line; 9092 9093 // Work around issue under safari where we can't directly set the column value 9094 /* istanbul ignore next */ 9095 if (Object.defineProperty) { 9096 Object.defineProperty(this, 'column', { 9097 value: column, 9098 enumerable: true 9099 }); 9100 } else { 9101 this.column = column; 9102 } 9103 } 9104 } catch (nop) { 9105 /* Ignore if the browser is very particular */ 9106 } 9107} 9108 9109Exception.prototype = new Error(); 9110 9111exports['default'] = Exception; 9112module.exports = exports['default']; 9113 9114 9115},{}],105:[function(require,module,exports){ 9116'use strict'; 9117 9118exports.__esModule = true; 9119exports.registerDefaultHelpers = registerDefaultHelpers; 9120// istanbul ignore next 9121 9122function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9123 9124var _helpersBlockHelperMissing = require('./helpers/block-helper-missing'); 9125 9126var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); 9127 9128var _helpersEach = require('./helpers/each'); 9129 9130var _helpersEach2 = _interopRequireDefault(_helpersEach); 9131 9132var _helpersHelperMissing = require('./helpers/helper-missing'); 9133 9134var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); 9135 9136var _helpersIf = require('./helpers/if'); 9137 9138var _helpersIf2 = _interopRequireDefault(_helpersIf); 9139 9140var _helpersLog = require('./helpers/log'); 9141 9142var _helpersLog2 = _interopRequireDefault(_helpersLog); 9143 9144var _helpersLookup = require('./helpers/lookup'); 9145 9146var _helpersLookup2 = _interopRequireDefault(_helpersLookup); 9147 9148var _helpersWith = require('./helpers/with'); 9149 9150var _helpersWith2 = _interopRequireDefault(_helpersWith); 9151 9152function registerDefaultHelpers(instance) { 9153 _helpersBlockHelperMissing2['default'](instance); 9154 _helpersEach2['default'](instance); 9155 _helpersHelperMissing2['default'](instance); 9156 _helpersIf2['default'](instance); 9157 _helpersLog2['default'](instance); 9158 _helpersLookup2['default'](instance); 9159 _helpersWith2['default'](instance); 9160} 9161 9162 9163},{"./helpers/block-helper-missing":106,"./helpers/each":107,"./helpers/helper-missing":108,"./helpers/if":109,"./helpers/log":110,"./helpers/lookup":111,"./helpers/with":112}],106:[function(require,module,exports){ 9164'use strict'; 9165 9166exports.__esModule = true; 9167 9168var _utils = require('../utils'); 9169 9170exports['default'] = function (instance) { 9171 instance.registerHelper('blockHelperMissing', function (context, options) { 9172 var inverse = options.inverse, 9173 fn = options.fn; 9174 9175 if (context === true) { 9176 return fn(this); 9177 } else if (context === false || context == null) { 9178 return inverse(this); 9179 } else if (_utils.isArray(context)) { 9180 if (context.length > 0) { 9181 if (options.ids) { 9182 options.ids = [options.name]; 9183 } 9184 9185 return instance.helpers.each(context, options); 9186 } else { 9187 return inverse(this); 9188 } 9189 } else { 9190 if (options.data && options.ids) { 9191 var data = _utils.createFrame(options.data); 9192 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); 9193 options = { data: data }; 9194 } 9195 9196 return fn(context, options); 9197 } 9198 }); 9199}; 9200 9201module.exports = exports['default']; 9202 9203 9204},{"../utils":117}],107:[function(require,module,exports){ 9205'use strict'; 9206 9207exports.__esModule = true; 9208// istanbul ignore next 9209 9210function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9211 9212var _utils = require('../utils'); 9213 9214var _exception = require('../exception'); 9215 9216var _exception2 = _interopRequireDefault(_exception); 9217 9218exports['default'] = function (instance) { 9219 instance.registerHelper('each', function (context, options) { 9220 if (!options) { 9221 throw new _exception2['default']('Must pass iterator to #each'); 9222 } 9223 9224 var fn = options.fn, 9225 inverse = options.inverse, 9226 i = 0, 9227 ret = '', 9228 data = undefined, 9229 contextPath = undefined; 9230 9231 if (options.data && options.ids) { 9232 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; 9233 } 9234 9235 if (_utils.isFunction(context)) { 9236 context = context.call(this); 9237 } 9238 9239 if (options.data) { 9240 data = _utils.createFrame(options.data); 9241 } 9242 9243 function execIteration(field, index, last) { 9244 if (data) { 9245 data.key = field; 9246 data.index = index; 9247 data.first = index === 0; 9248 data.last = !!last; 9249 9250 if (contextPath) { 9251 data.contextPath = contextPath + field; 9252 } 9253 } 9254 9255 ret = ret + fn(context[field], { 9256 data: data, 9257 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) 9258 }); 9259 } 9260 9261 if (context && typeof context === 'object') { 9262 if (_utils.isArray(context)) { 9263 for (var j = context.length; i < j; i++) { 9264 if (i in context) { 9265 execIteration(i, i, i === context.length - 1); 9266 } 9267 } 9268 } else { 9269 var priorKey = undefined; 9270 9271 for (var key in context) { 9272 if (context.hasOwnProperty(key)) { 9273 // We're running the iterations one step out of sync so we can detect 9274 // the last iteration without have to scan the object twice and create 9275 // an itermediate keys array. 9276 if (priorKey !== undefined) { 9277 execIteration(priorKey, i - 1); 9278 } 9279 priorKey = key; 9280 i++; 9281 } 9282 } 9283 if (priorKey !== undefined) { 9284 execIteration(priorKey, i - 1, true); 9285 } 9286 } 9287 } 9288 9289 if (i === 0) { 9290 ret = inverse(this); 9291 } 9292 9293 return ret; 9294 }); 9295}; 9296 9297module.exports = exports['default']; 9298 9299 9300},{"../exception":104,"../utils":117}],108:[function(require,module,exports){ 9301'use strict'; 9302 9303exports.__esModule = true; 9304// istanbul ignore next 9305 9306function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9307 9308var _exception = require('../exception'); 9309 9310var _exception2 = _interopRequireDefault(_exception); 9311 9312exports['default'] = function (instance) { 9313 instance.registerHelper('helperMissing', function () /* [args, ]options */{ 9314 if (arguments.length === 1) { 9315 // A missing field in a {{foo}} construct. 9316 return undefined; 9317 } else { 9318 // Someone is actually trying to call something, blow up. 9319 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); 9320 } 9321 }); 9322}; 9323 9324module.exports = exports['default']; 9325 9326 9327},{"../exception":104}],109:[function(require,module,exports){ 9328'use strict'; 9329 9330exports.__esModule = true; 9331 9332var _utils = require('../utils'); 9333 9334exports['default'] = function (instance) { 9335 instance.registerHelper('if', function (conditional, options) { 9336 if (_utils.isFunction(conditional)) { 9337 conditional = conditional.call(this); 9338 } 9339 9340 // Default behavior is to render the positive path if the value is truthy and not empty. 9341 // The `includeZero` option may be set to treat the condtional as purely not empty based on the 9342 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. 9343 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { 9344 return options.inverse(this); 9345 } else { 9346 return options.fn(this); 9347 } 9348 }); 9349 9350 instance.registerHelper('unless', function (conditional, options) { 9351 return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); 9352 }); 9353}; 9354 9355module.exports = exports['default']; 9356 9357 9358},{"../utils":117}],110:[function(require,module,exports){ 9359'use strict'; 9360 9361exports.__esModule = true; 9362 9363exports['default'] = function (instance) { 9364 instance.registerHelper('log', function () /* message, options */{ 9365 var args = [undefined], 9366 options = arguments[arguments.length - 1]; 9367 for (var i = 0; i < arguments.length - 1; i++) { 9368 args.push(arguments[i]); 9369 } 9370 9371 var level = 1; 9372 if (options.hash.level != null) { 9373 level = options.hash.level; 9374 } else if (options.data && options.data.level != null) { 9375 level = options.data.level; 9376 } 9377 args[0] = level; 9378 9379 instance.log.apply(instance, args); 9380 }); 9381}; 9382 9383module.exports = exports['default']; 9384 9385 9386},{}],111:[function(require,module,exports){ 9387'use strict'; 9388 9389exports.__esModule = true; 9390 9391exports['default'] = function (instance) { 9392 instance.registerHelper('lookup', function (obj, field) { 9393 if (!obj) { 9394 return obj; 9395 } 9396 if (field === 'constructor' && !obj.propertyIsEnumerable(field)) { 9397 return undefined; 9398 } 9399 return obj[field]; 9400 }); 9401}; 9402 9403module.exports = exports['default']; 9404 9405 9406},{}],112:[function(require,module,exports){ 9407'use strict'; 9408 9409exports.__esModule = true; 9410 9411var _utils = require('../utils'); 9412 9413exports['default'] = function (instance) { 9414 instance.registerHelper('with', function (context, options) { 9415 if (_utils.isFunction(context)) { 9416 context = context.call(this); 9417 } 9418 9419 var fn = options.fn; 9420 9421 if (!_utils.isEmpty(context)) { 9422 var data = options.data; 9423 if (options.data && options.ids) { 9424 data = _utils.createFrame(options.data); 9425 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); 9426 } 9427 9428 return fn(context, { 9429 data: data, 9430 blockParams: _utils.blockParams([context], [data && data.contextPath]) 9431 }); 9432 } else { 9433 return options.inverse(this); 9434 } 9435 }); 9436}; 9437 9438module.exports = exports['default']; 9439 9440 9441},{"../utils":117}],113:[function(require,module,exports){ 9442'use strict'; 9443 9444exports.__esModule = true; 9445 9446var _utils = require('./utils'); 9447 9448var logger = { 9449 methodMap: ['debug', 'info', 'warn', 'error'], 9450 level: 'info', 9451 9452 // Maps a given level value to the `methodMap` indexes above. 9453 lookupLevel: function lookupLevel(level) { 9454 if (typeof level === 'string') { 9455 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); 9456 if (levelMap >= 0) { 9457 level = levelMap; 9458 } else { 9459 level = parseInt(level, 10); 9460 } 9461 } 9462 9463 return level; 9464 }, 9465 9466 // Can be overridden in the host environment 9467 log: function log(level) { 9468 level = logger.lookupLevel(level); 9469 9470 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { 9471 var method = logger.methodMap[level]; 9472 if (!console[method]) { 9473 // eslint-disable-line no-console 9474 method = 'log'; 9475 } 9476 9477 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 9478 message[_key - 1] = arguments[_key]; 9479 } 9480 9481 console[method].apply(console, message); // eslint-disable-line no-console 9482 } 9483 } 9484}; 9485 9486exports['default'] = logger; 9487module.exports = exports['default']; 9488 9489 9490},{"./utils":117}],114:[function(require,module,exports){ 9491(function (global){(function (){ 9492/* global window */ 9493'use strict'; 9494 9495exports.__esModule = true; 9496 9497exports['default'] = function (Handlebars) { 9498 /* istanbul ignore next */ 9499 var root = typeof global !== 'undefined' ? global : window, 9500 $Handlebars = root.Handlebars; 9501 /* istanbul ignore next */ 9502 Handlebars.noConflict = function () { 9503 if (root.Handlebars === Handlebars) { 9504 root.Handlebars = $Handlebars; 9505 } 9506 return Handlebars; 9507 }; 9508}; 9509 9510module.exports = exports['default']; 9511 9512 9513}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 9514},{}],115:[function(require,module,exports){ 9515'use strict'; 9516 9517exports.__esModule = true; 9518exports.checkRevision = checkRevision; 9519exports.template = template; 9520exports.wrapProgram = wrapProgram; 9521exports.resolvePartial = resolvePartial; 9522exports.invokePartial = invokePartial; 9523exports.noop = noop; 9524// istanbul ignore next 9525 9526function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 9527 9528// istanbul ignore next 9529 9530function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } 9531 9532var _utils = require('./utils'); 9533 9534var Utils = _interopRequireWildcard(_utils); 9535 9536var _exception = require('./exception'); 9537 9538var _exception2 = _interopRequireDefault(_exception); 9539 9540var _base = require('./base'); 9541 9542function checkRevision(compilerInfo) { 9543 var compilerRevision = compilerInfo && compilerInfo[0] || 1, 9544 currentRevision = _base.COMPILER_REVISION; 9545 9546 if (compilerRevision !== currentRevision) { 9547 if (compilerRevision < currentRevision) { 9548 var runtimeVersions = _base.REVISION_CHANGES[currentRevision], 9549 compilerVersions = _base.REVISION_CHANGES[compilerRevision]; 9550 throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); 9551 } else { 9552 // Use the embedded version info since the runtime doesn't know about this revision yet 9553 throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); 9554 } 9555 } 9556} 9557 9558function template(templateSpec, env) { 9559 /* istanbul ignore next */ 9560 if (!env) { 9561 throw new _exception2['default']('No environment passed to template'); 9562 } 9563 if (!templateSpec || !templateSpec.main) { 9564 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); 9565 } 9566 9567 templateSpec.main.decorator = templateSpec.main_d; 9568 9569 // Note: Using env.VM references rather than local var references throughout this section to allow 9570 // for external users to override these as psuedo-supported APIs. 9571 env.VM.checkRevision(templateSpec.compiler); 9572 9573 function invokePartialWrapper(partial, context, options) { 9574 if (options.hash) { 9575 context = Utils.extend({}, context, options.hash); 9576 if (options.ids) { 9577 options.ids[0] = true; 9578 } 9579 } 9580 9581 partial = env.VM.resolvePartial.call(this, partial, context, options); 9582 var result = env.VM.invokePartial.call(this, partial, context, options); 9583 9584 if (result == null && env.compile) { 9585 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); 9586 result = options.partials[options.name](context, options); 9587 } 9588 if (result != null) { 9589 if (options.indent) { 9590 var lines = result.split('\n'); 9591 for (var i = 0, l = lines.length; i < l; i++) { 9592 if (!lines[i] && i + 1 === l) { 9593 break; 9594 } 9595 9596 lines[i] = options.indent + lines[i]; 9597 } 9598 result = lines.join('\n'); 9599 } 9600 return result; 9601 } else { 9602 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); 9603 } 9604 } 9605 9606 // Just add water 9607 var container = { 9608 strict: function strict(obj, name) { 9609 if (!(name in obj)) { 9610 throw new _exception2['default']('"' + name + '" not defined in ' + obj); 9611 } 9612 return obj[name]; 9613 }, 9614 lookup: function lookup(depths, name) { 9615 var len = depths.length; 9616 for (var i = 0; i < len; i++) { 9617 if (depths[i] && depths[i][name] != null) { 9618 return depths[i][name]; 9619 } 9620 } 9621 }, 9622 lambda: function lambda(current, context) { 9623 return typeof current === 'function' ? current.call(context) : current; 9624 }, 9625 9626 escapeExpression: Utils.escapeExpression, 9627 invokePartial: invokePartialWrapper, 9628 9629 fn: function fn(i) { 9630 var ret = templateSpec[i]; 9631 ret.decorator = templateSpec[i + '_d']; 9632 return ret; 9633 }, 9634 9635 programs: [], 9636 program: function program(i, data, declaredBlockParams, blockParams, depths) { 9637 var programWrapper = this.programs[i], 9638 fn = this.fn(i); 9639 if (data || depths || blockParams || declaredBlockParams) { 9640 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); 9641 } else if (!programWrapper) { 9642 programWrapper = this.programs[i] = wrapProgram(this, i, fn); 9643 } 9644 return programWrapper; 9645 }, 9646 9647 data: function data(value, depth) { 9648 while (value && depth--) { 9649 value = value._parent; 9650 } 9651 return value; 9652 }, 9653 merge: function merge(param, common) { 9654 var obj = param || common; 9655 9656 if (param && common && param !== common) { 9657 obj = Utils.extend({}, common, param); 9658 } 9659 9660 return obj; 9661 }, 9662 // An empty object to use as replacement for null-contexts 9663 nullContext: Object.seal({}), 9664 9665 noop: env.VM.noop, 9666 compilerInfo: templateSpec.compiler 9667 }; 9668 9669 function ret(context) { 9670 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 9671 9672 var data = options.data; 9673 9674 ret._setup(options); 9675 if (!options.partial && templateSpec.useData) { 9676 data = initData(context, data); 9677 } 9678 var depths = undefined, 9679 blockParams = templateSpec.useBlockParams ? [] : undefined; 9680 if (templateSpec.useDepths) { 9681 if (options.depths) { 9682 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths; 9683 } else { 9684 depths = [context]; 9685 } 9686 } 9687 9688 function main(context /*, options*/) { 9689 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); 9690 } 9691 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); 9692 return main(context, options); 9693 } 9694 ret.isTop = true; 9695 9696 ret._setup = function (options) { 9697 if (!options.partial) { 9698 container.helpers = container.merge(options.helpers, env.helpers); 9699 9700 if (templateSpec.usePartial) { 9701 container.partials = container.merge(options.partials, env.partials); 9702 } 9703 if (templateSpec.usePartial || templateSpec.useDecorators) { 9704 container.decorators = container.merge(options.decorators, env.decorators); 9705 } 9706 } else { 9707 container.helpers = options.helpers; 9708 container.partials = options.partials; 9709 container.decorators = options.decorators; 9710 } 9711 }; 9712 9713 ret._child = function (i, data, blockParams, depths) { 9714 if (templateSpec.useBlockParams && !blockParams) { 9715 throw new _exception2['default']('must pass block params'); 9716 } 9717 if (templateSpec.useDepths && !depths) { 9718 throw new _exception2['default']('must pass parent depths'); 9719 } 9720 9721 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); 9722 }; 9723 return ret; 9724} 9725 9726function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { 9727 function prog(context) { 9728 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 9729 9730 var currentDepths = depths; 9731 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) { 9732 currentDepths = [context].concat(depths); 9733 } 9734 9735 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); 9736 } 9737 9738 prog = executeDecorators(fn, prog, container, depths, data, blockParams); 9739 9740 prog.program = i; 9741 prog.depth = depths ? depths.length : 0; 9742 prog.blockParams = declaredBlockParams || 0; 9743 return prog; 9744} 9745 9746function resolvePartial(partial, context, options) { 9747 if (!partial) { 9748 if (options.name === '@partial-block') { 9749 partial = options.data['partial-block']; 9750 } else { 9751 partial = options.partials[options.name]; 9752 } 9753 } else if (!partial.call && !options.name) { 9754 // This is a dynamic partial that returned a string 9755 options.name = partial; 9756 partial = options.partials[partial]; 9757 } 9758 return partial; 9759} 9760 9761function invokePartial(partial, context, options) { 9762 // Use the current closure context to save the partial-block if this partial 9763 var currentPartialBlock = options.data && options.data['partial-block']; 9764 options.partial = true; 9765 if (options.ids) { 9766 options.data.contextPath = options.ids[0] || options.data.contextPath; 9767 } 9768 9769 var partialBlock = undefined; 9770 if (options.fn && options.fn !== noop) { 9771 (function () { 9772 options.data = _base.createFrame(options.data); 9773 // Wrapper function to get access to currentPartialBlock from the closure 9774 var fn = options.fn; 9775 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) { 9776 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 9777 9778 // Restore the partial-block from the closure for the execution of the block 9779 // i.e. the part inside the block of the partial call. 9780 options.data = _base.createFrame(options.data); 9781 options.data['partial-block'] = currentPartialBlock; 9782 return fn(context, options); 9783 }; 9784 if (fn.partials) { 9785 options.partials = Utils.extend({}, options.partials, fn.partials); 9786 } 9787 })(); 9788 } 9789 9790 if (partial === undefined && partialBlock) { 9791 partial = partialBlock; 9792 } 9793 9794 if (partial === undefined) { 9795 throw new _exception2['default']('The partial ' + options.name + ' could not be found'); 9796 } else if (partial instanceof Function) { 9797 return partial(context, options); 9798 } 9799} 9800 9801function noop() { 9802 return ''; 9803} 9804 9805function initData(context, data) { 9806 if (!data || !('root' in data)) { 9807 data = data ? _base.createFrame(data) : {}; 9808 data.root = context; 9809 } 9810 return data; 9811} 9812 9813function executeDecorators(fn, prog, container, depths, data, blockParams) { 9814 if (fn.decorator) { 9815 var props = {}; 9816 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); 9817 Utils.extend(prog, props); 9818 } 9819 return prog; 9820} 9821 9822 9823},{"./base":101,"./exception":104,"./utils":117}],116:[function(require,module,exports){ 9824// Build out our basic SafeString type 9825'use strict'; 9826 9827exports.__esModule = true; 9828function SafeString(string) { 9829 this.string = string; 9830} 9831 9832SafeString.prototype.toString = SafeString.prototype.toHTML = function () { 9833 return '' + this.string; 9834}; 9835 9836exports['default'] = SafeString; 9837module.exports = exports['default']; 9838 9839 9840},{}],117:[function(require,module,exports){ 9841'use strict'; 9842 9843exports.__esModule = true; 9844exports.extend = extend; 9845exports.indexOf = indexOf; 9846exports.escapeExpression = escapeExpression; 9847exports.isEmpty = isEmpty; 9848exports.createFrame = createFrame; 9849exports.blockParams = blockParams; 9850exports.appendContextPath = appendContextPath; 9851var escape = { 9852 '&': '&', 9853 '<': '<', 9854 '>': '>', 9855 '"': '"', 9856 "'": ''', 9857 '`': '`', 9858 '=': '=' 9859}; 9860 9861var badChars = /[&<>"'`=]/g, 9862 possible = /[&<>"'`=]/; 9863 9864function escapeChar(chr) { 9865 return escape[chr]; 9866} 9867 9868function extend(obj /* , ...source */) { 9869 for (var i = 1; i < arguments.length; i++) { 9870 for (var key in arguments[i]) { 9871 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { 9872 obj[key] = arguments[i][key]; 9873 } 9874 } 9875 } 9876 9877 return obj; 9878} 9879 9880var toString = Object.prototype.toString; 9881 9882exports.toString = toString; 9883// Sourced from lodash 9884// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt 9885/* eslint-disable func-style */ 9886var isFunction = function isFunction(value) { 9887 return typeof value === 'function'; 9888}; 9889// fallback for older versions of Chrome and Safari 9890/* istanbul ignore next */ 9891if (isFunction(/x/)) { 9892 exports.isFunction = isFunction = function (value) { 9893 return typeof value === 'function' && toString.call(value) === '[object Function]'; 9894 }; 9895} 9896exports.isFunction = isFunction; 9897 9898/* eslint-enable func-style */ 9899 9900/* istanbul ignore next */ 9901var isArray = Array.isArray || function (value) { 9902 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
9903}; 9904 9905exports.isArray = isArray; 9906// Older IE versions do not directly support indexOf so we must implement our own, sadly. 9907 9908function indexOf(array, value) { 9909 for (var i = 0, len = array.length; i < len; i++) { 9910 if (array[i] === value) { 9911 return i; 9912 } 9913 } 9914 return -1; 9915} 9916 9917function escapeExpression(string) { 9918 if (typeof string !== 'string') { 9919 // don't escape SafeStrings, since they're already safe 9920 if (string && string.toHTML) { 9921 return string.toHTML(); 9922 } else if (string == null) { 9923 return ''; 9924 } else if (!string) { 9925 return string + ''; 9926 } 9927 9928 // Force a string conversion as this will be done by the append regardless and 9929 // the regex test will do this transparently behind the scenes, causing issues if 9930 // an object's to string has escaped characters in it. 9931 string = '' + string; 9932 } 9933 9934 if (!possible.test(string)) { 9935 return string; 9936 } 9937 return string.replace(badChars, escapeChar); 9938} 9939 9940function isEmpty(value) { 9941 if (!value && value !== 0) { 9942 return true; 9943 } else if (isArray(value) && value.length === 0) { 9944 return true; 9945 } else { 9946 return false; 9947 } 9948} 9949 9950function createFrame(object) { 9951 var frame = extend({}, object); 9952 frame._parent = object; 9953 return frame; 9954} 9955 9956function blockParams(params, ids) { 9957 params.path = ids; 9958 return params; 9959} 9960 9961function appendContextPath(contextPath, id) { 9962 return (contextPath ? contextPath + '.' : '') + id; 9963} 9964 9965 9966},{}],118:[function(require,module,exports){ 9967// Create a simple path alias to allow browserify to resolve 9968// the runtime on a supported path. 9969module.exports = require('./dist/cjs/handlebars.runtime')['default']; 9970 9971},{"./dist/cjs/handlebars.runtime":100}],119:[function(require,module,exports){ 9972'use strict'; 9973 9974var origSymbol = typeof Symbol !== 'undefined' && Symbol; 9975var hasSymbolSham = require('./shams'); 9976 9977/** @type {import('.')} */ 9978module.exports = function hasNativeSymbols() { 9979 if (typeof origSymbol !== 'function') { return false; } 9980 if (typeof Symbol !== 'function') { return false; } 9981 if (typeof origSymbol('foo') !== 'symbol') { return false; } 9982 if (typeof Symbol('bar') !== 'symbol') { return false; } 9983 9984 return hasSymbolSham(); 9985}; 9986 9987},{"./shams":120}],120:[function(require,module,exports){ 9988'use strict'; 9989 9990/** @type {import('./shams')} */ 9991/* eslint complexity: [2, 18], max-statements: [2, 33] */ 9992module.exports = function hasSymbols() { 9993 if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } 9994 if (typeof Symbol.iterator === 'symbol') { return true; } 9995 9996 /** @type {{ [k in symbol]?: unknown }} */ 9997 var obj = {}; 9998 var sym = Symbol('test'); 9999 var symObj = Object(sym); 10000 if (typeof sym === 'string') { return false; } 10001 10002 if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } 10003 if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } 10004 10005 // temp disabled per https://github.com/ljharb/object.assign/issues/17 10006 // if (sym instanceof Symbol) { return false; } 10007 // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 10008 // if (!(symObj instanceof Symbol)) { return false; } 10009 10010 // if (typeof Symbol.prototype.toString !== 'function') { return false; } 10011 // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } 10012 10013 var symVal = 42; 10014 obj[sym] = symVal; 10015 for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop 10016 if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } 10017 10018 if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } 10019 10020 var syms = Object.getOwnPropertySymbols(obj); 10021 if (syms.length !== 1 || syms[0] !== sym) { return false; } 10022 10023 if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } 10024 10025 if (typeof Object.getOwnPropertyDescriptor === 'function') { 10026 // eslint-disable-next-line no-extra-parens 10027 var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); 10028 if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } 10029 } 10030 10031 return true; 10032}; 10033 10034},{}],121:[function(require,module,exports){ 10035'use strict'; 10036 10037var call = Function.prototype.call; 10038var $hasOwn = Object.prototype.hasOwnProperty; 10039var bind = require('function-bind'); 10040 10041/** @type {import('.')} */ 10042module.exports = bind.call(call, $hasOwn); 10043 10044},{"function-bind":93}],122:[function(require,module,exports){ 10045'use strict'; 10046 10047/** @type {import('./abs')} */ 10048module.exports = Math.abs; 10049 10050},{}],123:[function(require,module,exports){ 10051'use strict'; 10052 10053/** @type {import('./floor')} */ 10054module.exports = Math.floor; 10055 10056},{}],124:[function(require,module,exports){ 10057'use strict'; 10058 10059/** @type {import('./isNaN')} */ 10060module.exports = Number.isNaN || function isNaN(a) { 10061 return a !== a; 10062}; 10063 10064},{}],125:[function(require,module,exports){ 10065'use strict'; 10066 10067/** @type {import('./max')} */ 10068module.exports = Math.max; 10069 10070},{}],126:[function(require,module,exports){ 10071'use strict'; 10072 10073/** @type {import('./min')} */ 10074module.exports = Math.min; 10075 10076},{}],127:[function(require,module,exports){ 10077'use strict'; 10078 10079/** @type {import('./pow')} */ 10080module.exports = Math.pow; 10081 10082},{}],128:[function(require,module,exports){ 10083'use strict'; 10084 10085/** @type {import('./round')} */ 10086module.exports = Math.round; 10087 10088},{}],129:[function(require,module,exports){ 10089'use strict'; 10090 10091var $isNaN = require('./isNaN'); 10092 10093/** @type {import('./sign')} */ 10094module.exports = function sign(number) { 10095 if ($isNaN(number) || number === 0) { 10096 return number; 10097 } 10098 return number < 0 ? -1 : +1; 10099}; 10100 10101},{"./isNaN":124}],13
vendor: 6,833 bytes, lines 10101-10275
101010:[function(require,module,exports){ 10102(function (global){(function (){ 10103var hasMap = typeof Map === 'function' && Map.prototype; 10104var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; 10105var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; 10106var mapForEach = hasMap && Map.prototype.forEach; 10107var hasSet = typeof Set === 'function' && Set.prototype; 10108var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; 10109var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; 10110var setForEach = hasSet && Set.prototype.forEach; 10111var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; 10112var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; 10113var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; 10114var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; 10115var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype; 10116var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; 10117var booleanValueOf = Boolean.prototype.valueOf; 10118var objectToString = Object.prototype.toString; 10119var functionToString = Function.prototype.toString; 10120var $match = String.prototype.match; 10121var $slice = String.prototype.slice; 10122var $replace = String.prototype.replace; 10123var $toUpperCase = String.prototype.toUpperCase; 10124var $toLowerCase = String.prototype.toLowerCase; 10125var $test = RegExp.prototype.test; 10126var $concat = Array.prototype.concat; 10127var $join = Array.prototype.join; 10128var $arrSlice = Array.prototype.slice; 10129var $floor = Math.floor; 10130var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; 10131var gOPS = Object.getOwnPropertySymbols; 10132var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null; 10133var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object'; 10134// ie, `has-tostringtag/shams 10135var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol') 10136 ? Symbol.toStringTag 10137 : null; 10138var isEnumerable = Object.prototype.propertyIsEnumerable; 10139 10140var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ( 10141 [].__proto__ === Array.prototype // eslint-disable-line no-proto 10142 ? function (O) { 10143 return O.__proto__; // eslint-disable-line no-proto 10144 } 10145 : null 10146); 10147 10148function addNumericSeparator(num, str) { 10149 if ( 10150 num === Infinity 10151 || num === -Infinity 10152 || num !== num 10153 || (num && num > -1000 && num < 1000) 10154 || $test.call(/e/, str) 10155 ) { 10156 return str; 10157 } 10158 var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; 10159 if (typeof num === 'number') { 10160 var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num) 10161 if (int !== num) { 10162 var intStr = String(int); 10163 var dec = $slice.call(str, intStr.length + 1); 10164 return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, ''); 10165 } 10166 } 10167 return $replace.call(str, sepRegex, '$&_'); 10168} 10169 10170var utilInspect = require('./util.inspect'); 10171var inspectCustom = utilInspect.custom; 10172var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; 10173 10174var quotes = { 10175 __proto__: null, 10176 'double': '"', 10177 single: "'" 10178}; 10179var quoteREs = { 10180 __proto__: null, 10181 'double': /(["\\])/g, 10182 single: /(['\\])/g 10183}; 10184 10185module.exports = function inspect_(obj, options, depth, seen) { 10186 var opts = options || {}; 10187 10188 if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) { 10189 throw new TypeError('option "quoteStyle" must be "single" or "double"'); 10190 } 10191 if ( 10192 has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number' 10193 ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity 10194 : opts.maxStringLength !== null 10195 ) 10196 ) { 10197 throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); 10198 } 10199 var customInspect = has(opts, 'customInspect') ? opts.customInspect : true; 10200 if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') { 10201 throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'); 10202 } 10203 10204 if ( 10205 has(opts, 'indent') 10206 && opts.indent !== null 10207 && opts.indent !== '\t' 10208 && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0) 10209 ) { 10210 throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); 10211 } 10212 if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') { 10213 throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); 10214 } 10215 var numericSeparator = opts.numericSeparator; 10216 10217 if (typeof obj === 'undefined') { 10218 return 'undefined'; 10219 } 10220 if (obj === null) { 10221 return 'null'; 10222 } 10223 if (typeof obj === 'boolean') { 10224 return obj ? 'true' : 'false'; 10225 } 10226 10227 if (typeof obj === 'string') { 10228 return inspectString(obj, opts); 10229 } 10230 if (typeof obj === 'number') { 10231 if (obj === 0) { 10232 return Infinity / obj > 0 ? '0' : '-0'; 10233 } 10234 var str = String(obj); 10235 return numericSeparator ? addNumericSeparator(obj, str) : str; 10236 } 10237 if (typeof obj === 'bigint') { 10238 var bigIntStr = String(obj) + 'n'; 10239 return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; 10240 } 10241 10242 var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; 10243 if (typeof depth === 'undefined') { depth = 0; } 10244 if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { 10245 return isArray(obj) ? '[Array]' : '[Object]'; 10246 } 10247 10248 var indent = getIndent(opts, depth); 10249 10250 if (typeof seen === 'undefined') { 10251 seen = []; 10252 } else if (indexOf(seen, obj) >= 0) { 10253 return '[Circular]'; 10254 } 10255 10256 function inspect(value, from, noIndent) { 10257 if (from) { 10258 seen = $arrSlice.call(seen); 10259 seen.push(from); 10260 } 10261 if (noIndent) { 10262 var newOpts = { 10263 depth: opts.depth 10264 }; 10265 if (has(opts, 'quoteStyle')) { 10266 newOpts.quoteStyle = opts.quoteStyle; 10267 } 10268 return inspect_(value, newOpts, depth + 1, seen); 10269 } 10270 return inspect_(value, opts, depth + 1, seen); 10271 } 10272 10273 if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable 10274 var name = nameOf(obj); 10275 var keys = arrObjKeys(obj, inspect);
vendor: 5,552 bytes, lines 10276-10402
10276 return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : ''); 10277 } 10278 if (isSymbol(obj)) { 10279 var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj); 10280 return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString; 10281 } 10282 if (isElement(obj)) { 10283 var s = '<' + $toLowerCase.call(String(obj.nodeName)); 10284 var attrs = obj.attributes || []; 10285 for (var i = 0; i < attrs.length; i++) { 10286 s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); 10287 } 10288 s += '>'; 10289 if (obj.childNodes && obj.childNodes.length) { s += '...'; } 10290 s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>'; 10291 return s; 10292 } 10293 if (isArray(obj)) { 10294 if (obj.length === 0) { return '[]'; } 10295 var xs = arrObjKeys(obj, inspect); 10296 if (indent && !singleLineValues(xs)) { 10297 return '[' + indentedJoin(xs, indent) + ']'; 10298 } 10299 return '[ ' + $join.call(xs, ', ') + ' ]'; 10300 } 10301 if (isError(obj)) { 10302 var parts = arrObjKeys(obj, inspect); 10303 if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) { 10304 return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }'; 10305 } 10306 if (parts.length === 0) { return '[' + String(obj) + ']'; } 10307 return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }'; 10308 } 10309 if (typeof obj === 'object' && customInspect) { 10310 if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) { 10311 return utilInspect(obj, { depth: maxDepth - depth }); 10312 } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') { 10313 return obj.inspect(); 10314 } 10315 } 10316 if (isMap(obj)) { 10317 var mapParts = []; 10318 if (mapForEach) { 10319 mapForEach.call(obj, function (value, key) { 10320 mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj)); 10321 }); 10322 } 10323 return collectionOf('Map', mapSize.call(obj), mapParts, indent); 10324 } 10325 if (isSet(obj)) { 10326 var setParts = []; 10327 if (setForEach) { 10328 setForEach.call(obj, function (value) { 10329 setParts.push(inspect(value, obj)); 10330 }); 10331 } 10332 return collectionOf('Set', setSize.call(obj), setParts, indent); 10333 } 10334 if (isWeakMap(obj)) { 10335 return weakCollectionOf('WeakMap'); 10336 } 10337 if (isWeakSet(obj)) { 10338 return weakCollectionOf('WeakSet'); 10339 } 10340 if (isWeakRef(obj)) { 10341 return weakCollectionOf('WeakRef'); 10342 } 10343 if (isNumber(obj)) { 10344 return markBoxed(inspect(Number(obj))); 10345 } 10346 if (isBigInt(obj)) { 10347 return markBoxed(inspect(bigIntValueOf.call(obj))); 10348 } 10349 if (isBoolean(obj)) { 10350 return markBoxed(booleanValueOf.call(obj)); 10351 } 10352 if (isString(obj)) { 10353 return markBoxed(inspect(String(obj))); 10354 } 10355 // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other 10356 /* eslint-env browser */ 10357 if (typeof window !== 'undefined' && obj === window) { 10358 return '{ [object Window] }'; 10359 } 10360 if ( 10361 (typeof globalThis !== 'undefined' && obj === globalThis) 10362 || (typeof global !== 'undefined' && obj === global) 10363 ) { 10364 return '{ [object globalThis] }'; 10365 } 10366 if (!isDate(obj) && !isRegExp(obj)) { 10367 var ys = arrObjKeys(obj, inspect); 10368 var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; 10369 var protoTag = obj instanceof Object ? '' : 'null prototype'; 10370 var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : ''; 10371 var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : ''; 10372 var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : ''); 10373 if (ys.length === 0) { return tag + '{}'; } 10374 if (indent) { 10375 return tag + '{' + indentedJoin(ys, indent) + '}'; 10376 } 10377 return tag + '{ ' + $join.call(ys, ', ') + ' }'; 10378 } 10379 return String(obj); 10380}; 10381 10382function wrapQuotes(s, defaultStyle, opts) { 10383 var style = opts.quoteStyle || defaultStyle; 10384 var quoteChar = quotes[style]; 10385 return quoteChar + s + quoteChar; 10386} 10387 10388function quote(s) { 10389 return $replace.call(String(s), /"/g, '"'); 10390} 10391 10392function canTrustToString(obj) { 10393 return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined')); 10394} 10395function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); } 10396function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); } 10397function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); } 10398function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); } 10399function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); } 10400function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); } 10401function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); } 10402
vendor: 6,745 bytes, lines 10403-10647
10403// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives 10404function isSymbol(obj) { 10405 if (hasShammedSymbols) { 10406 return obj && typeof obj === 'object' && obj instanceof Symbol; 10407 } 10408 if (typeof obj === 'symbol') { 10409 return true; 10410 } 10411 if (!obj || typeof obj !== 'object' || !symToString) { 10412 return false; 10413 } 10414 try { 10415 symToString.call(obj); 10416 return true; 10417 } catch (e) {} 10418 return false; 10419} 10420 10421function isBigInt(obj) { 10422 if (!obj || typeof obj !== 'object' || !bigIntValueOf) { 10423 return false; 10424 } 10425 try { 10426 bigIntValueOf.call(obj); 10427 return true; 10428 } catch (e) {} 10429 return false; 10430} 10431 10432var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; 10433function has(obj, key) { 10434 return hasOwn.call(obj, key); 10435} 10436 10437function toStr(obj) { 10438 return objectToString.call(obj); 10439} 10440 10441function nameOf(f) { 10442 if (f.name) { return f.name; } 10443 var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); 10444 if (m) { return m[1]; } 10445 return null; 10446} 10447 10448function indexOf(xs, x) { 10449 if (xs.indexOf) { return xs.indexOf(x); } 10450 for (var i = 0, l = xs.length; i < l; i++) { 10451 if (xs[i] === x) { return i; } 10452 } 10453 return -1; 10454} 10455 10456function isMap(x) { 10457 if (!mapSize || !x || typeof x !== 'object') { 10458 return false; 10459 } 10460 try { 10461 mapSize.call(x); 10462 try { 10463 setSize.call(x); 10464 } catch (s) { 10465 return true; 10466 } 10467 return x instanceof Map; // core-js workaround, pre-v2.5.0 10468 } catch (e) {} 10469 return false; 10470} 10471 10472function isWeakMap(x) { 10473 if (!weakMapHas || !x || typeof x !== 'object') { 10474 return false; 10475 } 10476 try { 10477 weakMapHas.call(x, weakMapHas); 10478 try { 10479 weakSetHas.call(x, weakSetHas); 10480 } catch (s) { 10481 return true; 10482 } 10483 return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 10484 } catch (e) {} 10485 return false; 10486} 10487 10488function isWeakRef(x) { 10489 if (!weakRefDeref || !x || typeof x !== 'object') { 10490 return false; 10491 } 10492 try { 10493 weakRefDeref.call(x); 10494 return true; 10495 } catch (e) {} 10496 return false; 10497} 10498 10499function isSet(x) { 10500 if (!setSize || !x || typeof x !== 'object') { 10501 return false; 10502 } 10503 try { 10504 setSize.call(x); 10505 try { 10506 mapSize.call(x); 10507 } catch (m) { 10508 return true; 10509 } 10510 return x instanceof Set; // core-js workaround, pre-v2.5.0 10511 } catch (e) {} 10512 return false; 10513} 10514 10515function isWeakSet(x) { 10516 if (!weakSetHas || !x || typeof x !== 'object') { 10517 return false; 10518 } 10519 try { 10520 weakSetHas.call(x, weakSetHas); 10521 try { 10522 weakMapHas.call(x, weakMapHas); 10523 } catch (s) { 10524 return true; 10525 } 10526 return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 10527 } catch (e) {} 10528 return false; 10529} 10530 10531function isElement(x) { 10532 if (!x || typeof x !== 'object') { return false; } 10533 if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { 10534 return true; 10535 } 10536 return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; 10537} 10538 10539function inspectString(str, opts) { 10540 if (str.length > opts.maxStringLength) { 10541 var remaining = str.length - opts.maxStringLength; 10542 var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : ''); 10543 return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; 10544 } 10545 var quoteRE = quoteREs[opts.quoteStyle || 'single']; 10546 quoteRE.lastIndex = 0; 10547 // eslint-disable-next-line no-control-regex 10548 var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte); 10549 return wrapQuotes(s, 'single', opts); 10550} 10551 10552function lowbyte(c) { 10553 var n = c.charCodeAt(0); 10554 var x = { 10555 8: 'b', 10556 9: 't', 10557 10: 'n', 10558 12: 'f', 10559 13: 'r' 10560 }[n]; 10561 if (x) { return '\\' + x; } 10562 return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16)); 10563} 10564 10565function markBoxed(str) { 10566 return 'Object(' + str + ')'; 10567} 10568 10569function weakCollectionOf(type) { 10570 return type + ' { ? }'; 10571} 10572 10573function collectionOf(type, size, entries, indent) { 10574 var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', '); 10575 return type + ' (' + size + ') {' + joinedEntries + '}'; 10576} 10577 10578function singleLineValues(xs) { 10579 for (var i = 0; i < xs.length; i++) { 10580 if (indexOf(xs[i], '\n') >= 0) { 10581 return false; 10582 } 10583 } 10584 return true; 10585} 10586 10587function getIndent(opts, depth) { 10588 var baseIndent; 10589 if (opts.indent === '\t') { 10590 baseIndent = '\t'; 10591 } else if (typeof opts.indent === 'number' && opts.indent > 0) { 10592 baseIndent = $join.call(Array(opts.indent + 1), ' '); 10593 } else { 10594 return null; 10595 } 10596 return { 10597 base: baseIndent, 10598 prev: $join.call(Array(depth + 1), baseIndent) 10599 }; 10600} 10601 10602function indentedJoin(xs, indent) { 10603 if (xs.length === 0) { return ''; } 10604 var lineJoiner = '\n' + indent.prev + indent.base; 10605 return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev; 10606} 10607 10608function arrObjKeys(obj, inspect) { 10609 var isArr = isArray(obj); 10610 var xs = []; 10611 if (isArr) { 10612 xs.length = obj.length; 10613 for (var i = 0; i < obj.length; i++) { 10614 xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; 10615 } 10616 } 10617 var syms = typeof gOPS === 'function' ? gOPS(obj) : []; 10618 var symMap; 10619 if (hasShammedSymbols) { 10620 symMap = {}; 10621 for (var k = 0; k < syms.length; k++) { 10622 symMap['$' + syms[k]] = syms[k]; 10623 } 10624 } 10625 10626 for (var key in obj) { // eslint-disable-line no-restricted-syntax 10627 if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 10628 if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue 10629 if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) { 10630 // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section 10631 continue; // eslint-disable-line no-restricted-syntax, no-continue 10632 } else if ($test.call(/[^\w$]/, key)) { 10633 xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); 10634 } else { 10635 xs.push(key + ': ' + inspect(obj[key], obj)); 10636 } 10637 } 10638 if (typeof gOPS === 'function') { 10639 for (var j = 0; j < syms.length; j++) { 10640 if (isEnumerable.call(obj, syms[j])) { 10641 xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj)); 10642 } 10643 } 10644 } 10645 return xs; 10646} 10647
10648}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 10649},{"./util.inspect":75}],131:[function(require,module,exports){ 10650(function (global){(function (){
vendor: 14,672 bytes, lines 10650-11184
10650 10651/*! https://mths.be/punycode v1.4.1 by @mathias */ 10652;(function(root) { 10653 10654 /** Detect free variables */ 10655 var freeExports = typeof exports == 'object' && exports && 10656 !exports.nodeType && exports; 10657 var freeModule = typeof module == 'object' && module && 10658 !module.nodeType && module; 10659 var freeGlobal = typeof global == 'object' && global; 10660 if ( 10661 freeGlobal.global === freeGlobal || 10662 freeGlobal.window === freeGlobal || 10663 freeGlobal.self === freeGlobal 10664 ) { 10665 root = freeGlobal; 10666 } 10667 10668 /** 10669 * The `punycode` object. 10670 * @name punycode 10671 * @type Object 10672 */ 10673 var punycode, 10674 10675 /** Highest positive signed 32-bit float value */ 10676 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 10677 10678 /** Bootstring parameters */ 10679 base = 36, 10680 tMin = 1, 10681 tMax = 26, 10682 skew = 38, 10683 damp = 700, 10684 initialBias = 72, 10685 initialN = 128, // 0x80 10686 delimiter = '-', // '\x2D' 10687 10688 /** Regular expressions */ 10689 regexPunycode = /^xn--/, 10690 regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars 10691 regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators 10692 10693 /** Error messages */ 10694 errors = { 10695 'overflow': 'Overflow: input needs wider integers to process', 10696 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 10697 'invalid-input': 'Invalid input' 10698 }, 10699 10700 /** Convenience shortcuts */ 10701 baseMinusTMin = base - tMin, 10702 floor = Math.floor, 10703 stringFromCharCode = String.fromCharCode, 10704 10705 /** Temporary variable */ 10706 key; 10707 10708 /*--------------------------------------------------------------------------*/ 10709 10710 /** 10711 * A generic error utility function. 10712 * @private 10713 * @param {String} type The error type. 10714 * @returns {Error} Throws a `RangeError` with the applicable error message. 10715 */ 10716 function error(type) { 10717 throw new RangeError(errors[type]); 10718 } 10719 10720 /** 10721 * A generic `Array#map` utility function. 10722 * @private 10723 * @param {Array} array The array to iterate over. 10724 * @param {Function} callback The function that gets called for every array 10725 * item. 10726 * @returns {Array} A new array of values returned by the callback function. 10727 */ 10728 function map(array, fn) { 10729 var length = array.length; 10730 var result = []; 10731 while (length--) { 10732 result[length] = fn(array[length]); 10733 } 10734 return result; 10735 } 10736 10737 /** 10738 * A simple `Array#map`-like wrapper to work with domain name strings or email 10739 * addresses. 10740 * @private 10741 * @param {String} domain The domain name or email address. 10742 * @param {Function} callback The function that gets called for every 10743 * character. 10744 * @returns {Array} A new string of characters returned by the callback 10745 * function. 10746 */ 10747 function mapDomain(string, fn) { 10748 var parts = string.split('@'); 10749 var result = ''; 10750 if (parts.length > 1) { 10751 // In email addresses, only the domain name should be punycoded. Leave 10752 // the local part (i.e. everything up to `@`) intact. 10753 result = parts[0] + '@'; 10754 string = parts[1]; 10755 } 10756 // Avoid `split(regex)` for IE8 compatibility. See #17. 10757 string = string.replace(regexSeparators, '\x2E'); 10758 var labels = string.split('.'); 10759 var encoded = map(labels, fn).join('.'); 10760 return result + encoded; 10761 } 10762 10763 /** 10764 * Creates an array containing the numeric code points of each Unicode 10765 * character in the string. While JavaScript uses UCS-2 internally, 10766 * this function will convert a pair of surrogate halves (each of which 10767 * UCS-2 exposes as separate characters) into a single code point, 10768 * matching UTF-16. 10769 * @see `punycode.ucs2.encode` 10770 * @see <https://mathiasbynens.be/notes/javascript-encoding> 10771 * @memberOf punycode.ucs2 10772 * @name decode 10773 * @param {String} string The Unicode input string (UCS-2). 10774 * @returns {Array} The new array of code points. 10775 */ 10776 function ucs2decode(string) { 10777 var output = [], 10778 counter = 0, 10779 length = string.length, 10780 value, 10781 extra; 10782 while (counter < length) { 10783 value = string.charCodeAt(counter++); 10784 if (value >= 0xD800 && value <= 0xDBFF && counter < length) { 10785 // high surrogate, and there is a next character 10786 extra = string.charCodeAt(counter++); 10787 if ((extra & 0xFC00) == 0xDC00) { // low surrogate 10788 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); 10789 } else { 10790 // unmatched surrogate; only append this code unit, in case the next 10791 // code unit is the high surrogate of a surrogate pair 10792 output.push(value); 10793 counter--; 10794 } 10795 } else { 10796 output.push(value); 10797 } 10798 } 10799 return output; 10800 } 10801 10802 /** 10803 * Creates a string based on an array of numeric code points. 10804 * @see `punycode.ucs2.decode` 10805 * @memberOf punycode.ucs2 10806 * @name encode 10807 * @param {Array} codePoints The array of numeric code points. 10808 * @returns {String} The new Unicode string (UCS-2). 10809 */ 10810 function ucs2encode(array) { 10811 return map(array, function(value) { 10812 var output = ''; 10813 if (value > 0xFFFF) { 10814 value -= 0x10000; 10815 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); 10816 value = 0xDC00 | value & 0x3FF; 10817 } 10818 output += stringFromCharCode(value); 10819 return output; 10820 }).join(''); 10821 } 10822 10823 /** 10824 * Converts a basic code point into a digit/integer. 10825 * @see `digitToBasic()` 10826 * @private 10827 * @param {Number} codePoint The basic numeric code point value. 10828 * @returns {Number} The numeric value of a basic code point (for use in 10829 * representing integers) in the range `0` to `base - 1`, or `base` if 10830 * the code point does not represent a value. 10831 */ 10832 function basicToDigit(codePoint) { 10833 if (codePoint - 48 < 10) { 10834 return codePoint - 22; 10835 } 10836 if (codePoint - 65 < 26) { 10837 return codePoint - 65; 10838 } 10839 if (codePoint - 97 < 26) { 10840 return codePoint - 97; 10841 } 10842 return base; 10843 } 10844 10845 /** 10846 * Converts a digit/integer into a basic code point. 10847 * @see `basicToDigit()` 10848 * @private 10849 * @param {Number} digit The numeric value of a basic code point. 10850 * @returns {Number} The basic code point whose value (when used for 10851 * representing integers) is `digit`, which needs to be in the range 10852 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is 10853 * used; else, the lowercase form is used. The behavior is undefined 10854 * if `flag` is non-zero and `digit` has no uppercase form. 10855 */ 10856 function digitToBasic(digit, flag) { 10857 // 0..25 map to ASCII a..z or A..Z 10858 // 26..35 map to ASCII 0..9 10859 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); 10860 } 10861 10862 /** 10863 * Bias adaptation function as per section 3.4 of RFC 3492. 10864 * https://tools.ietf.org/html/rfc3492#section-3.4 10865 * @private 10866 */ 10867 function adapt(delta, numPoints, firstTime) { 10868 var k = 0; 10869 delta = firstTime ? floor(delta / damp) : delta >> 1; 10870 delta += floor(delta / numPoints); 10871 for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { 10872 delta = floor(delta / baseMinusTMin); 10873 } 10874 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); 10875 } 10876 10877 /** 10878 * Converts a Punycode string of ASCII-only symbols to a string of Unicode 10879 * symbols. 10880 * @memberOf punycode 10881 * @param {String} input The Punycode string of ASCII-only symbols. 10882 * @returns {String} The resulting string of Unicode symbols. 10883 */ 10884 function decode(input) { 10885 // Don't use UCS-2 10886 var output = [], 10887 inputLength = input.length, 10888 out, 10889 i = 0, 10890 n = initialN, 10891 bias = initialBias, 10892 basic, 10893 j, 10894 index, 10895 oldi, 10896 w, 10897 k, 10898 digit, 10899 t, 10900 /** Cached calculation results */ 10901 baseMinusT; 10902 10903 // Handle the basic code points: let `basic` be the number of input code 10904 // points before the last delimiter, or `0` if there is none, then copy 10905 // the first basic code points to the output. 10906 10907 basic = input.lastIndexOf(delimiter); 10908 if (basic < 0) { 10909 basic = 0; 10910 } 10911 10912 for (j = 0; j < basic; ++j) { 10913 // if it's not a basic code point 10914 if (input.charCodeAt(j) >= 0x80) { 10915 error('not-basic'); 10916 } 10917 output.push(input.charCodeAt(j)); 10918 } 10919 10920 // Main decoding loop: start just after the last delimiter if any basic code 10921 // points were copied; start at the beginning otherwise. 10922 10923 for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { 10924 10925 // `index` is the index of the next character to be consumed. 10926 // Decode a generalized variable-length integer into `delta`, 10927 // which gets added to `i`. The overflow checking is easier 10928 // if we increase `i` as we go, then subtract off its starting 10929 // value at the end to obtain `delta`. 10930 for (oldi = i, w = 1, k = base; /* no condition */; k += base) { 10931 10932 if (index >= inputLength) { 10933 error('invalid-input'); 10934 } 10935 10936 digit = basicToDigit(input.charCodeAt(index++)); 10937 10938 if (digit >= base || digit > floor((maxInt - i) / w)) { 10939 error('overflow'); 10940 } 10941 10942 i += digit * w; 10943 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 10944 10945 if (digit < t) { 10946 break; 10947 } 10948 10949 baseMinusT = base - t; 10950 if (w > floor(maxInt / baseMinusT)) { 10951 error('overflow'); 10952 } 10953 10954 w *= baseMinusT; 10955 10956 } 10957 10958 out = output.length + 1; 10959 bias = adapt(i - oldi, out, oldi == 0); 10960 10961 // `i` was supposed to wrap around from `out` to `0`, 10962 // incrementing `n` each time, so we'll fix that now: 10963 if (floor(i / out) > maxInt - n) { 10964 error('overflow'); 10965 } 10966 10967 n += floor(i / out); 10968 i %= out; 10969 10970 // Insert `n` at position `i` of the output 10971 output.splice(i++, 0, n); 10972 10973 } 10974 10975 return ucs2encode(output); 10976 } 10977 10978 /** 10979 * Converts a string of Unicode symbols (e.g. a domain name label) to a 10980 * Punycode string of ASCII-only symbols. 10981 * @memberOf punycode 10982 * @param {String} input The string of Unicode symbols. 10983 * @returns {String} The resulting Punycode string of ASCII-only symbols. 10984 */ 10985 function encode(input) { 10986 var n, 10987 delta, 10988 handledCPCount, 10989 basicLength, 10990 bias, 10991 j, 10992 m, 10993 q, 10994 k, 10995 t, 10996 currentValue, 10997 output = [], 10998 /** `inputLength` will hold the number of code points in `input`. */ 10999 inputLength, 11000 /** Cached calculation results */ 11001 handledCPCountPlusOne, 11002 baseMinusT, 11003 qMinusT; 11004 11005 // Convert the input in UCS-2 to Unicode 11006 input = ucs2decode(input); 11007 11008 // Cache the length 11009 inputLength = input.length; 11010 11011 // Initialize the state 11012 n = initialN; 11013 delta = 0; 11014 bias = initialBias; 11015 11016 // Handle the basic code points 11017 for (j = 0; j < inputLength; ++j) { 11018 currentValue = input[j]; 11019 if (currentValue < 0x80) { 11020 output.push(stringFromCharCode(currentValue)); 11021 } 11022 } 11023 11024 handledCPCount = basicLength = output.length; 11025 11026 // `handledCPCount` is the number of code points that have been handled; 11027 // `basicLength` is the number of basic code points. 11028 11029 // Finish the basic string - if it is not empty - with a delimiter 11030 if (basicLength) { 11031 output.push(delimiter); 11032 } 11033 11034 // Main encoding loop: 11035 while (handledCPCount < inputLength) { 11036 11037 // All non-basic code points < n have been handled already. Find the next 11038 // larger one: 11039 for (m = maxInt, j = 0; j < inputLength; ++j) { 11040 currentValue = input[j]; 11041 if (currentValue >= n && currentValue < m) { 11042 m = currentValue; 11043 } 11044 } 11045 11046 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, 11047 // but guard against overflow 11048 handledCPCountPlusOne = handledCPCount + 1; 11049 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { 11050 error('overflow'); 11051 } 11052 11053 delta += (m - n) * handledCPCountPlusOne; 11054 n = m; 11055 11056 for (j = 0; j < inputLength; ++j) { 11057 currentValue = input[j]; 11058 11059 if (currentValue < n && ++delta > maxInt) { 11060 error('overflow'); 11061 } 11062 11063 if (currentValue == n) { 11064 // Represent delta as a generalized variable-length integer 11065 for (q = delta, k = base; /* no condition */; k += base) { 11066 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); 11067 if (q < t) { 11068 break; 11069 } 11070 qMinusT = q - t; 11071 baseMinusT = base - t; 11072 output.push( 11073 stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) 11074 ); 11075 q = floor(qMinusT / baseMinusT); 11076 } 11077 11078 output.push(stringFromCharCode(digitToBasic(q, 0))); 11079 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); 11080 delta = 0; 11081 ++handledCPCount; 11082 } 11083 } 11084 11085 ++delta; 11086 ++n; 11087 11088 } 11089 return output.join(''); 11090 } 11091 11092 /** 11093 * Converts a Punycode string representing a domain name or an email address 11094 * to Unicode. Only the Punycoded parts of the input will be converted, i.e. 11095 * it doesn't matter if you call it on a string that has already been 11096 * converted to Unicode. 11097 * @memberOf punycode 11098 * @param {String} input The Punycoded domain name or email address to 11099 * convert to Unicode. 11100 * @returns {String} The Unicode representation of the given Punycode 11101 * string. 11102 */ 11103 function toUnicode(input) { 11104 return mapDomain(input, function(string) { 11105 return regexPunycode.test(string) 11106 ? decode(string.slice(4).toLowerCase()) 11107 : string; 11108 }); 11109 } 11110 11111 /** 11112 * Converts a Unicode string representing a domain name or an email address to 11113 * Punycode. Only the non-ASCII parts of the domain name will be converted, 11114 * i.e. it doesn't matter if you call it with a domain that's already in 11115 * ASCII. 11116 * @memberOf punycode 11117 * @param {String} input The domain name or email address to convert, as a 11118 * Unicode string. 11119 * @returns {String} The Punycode representation of the given domain name or 11120 * email address. 11121 */ 11122 function toASCII(input) { 11123 return mapDomain(input, function(string) { 11124 return regexNonASCII.test(string) 11125 ? 'xn--' + encode(string) 11126 : string; 11127 }); 11128 } 11129 11130 /*--------------------------------------------------------------------------*/ 11131 11132 /** Define the public API */ 11133 punycode = { 11134 /** 11135 * A string representing the current Punycode.js version number. 11136 * @memberOf punycode 11137 * @type String 11138 */ 11139 'version': '1.4.1', 11140 /** 11141 * An object of methods to convert from JavaScript's internal character 11142 * representation (UCS-2) to Unicode code points, and back. 11143 * @see <https://mathiasbynens.be/notes/javascript-encoding> 11144 * @memberOf punycode 11145 * @type Object 11146 */ 11147 'ucs2': { 11148 'decode': ucs2decode, 11149 'encode': ucs2encode 11150 }, 11151 'decode': decode, 11152 'encode': encode, 11153 'toASCII': toASCII, 11154 'toUnicode': toUnicode 11155 }; 11156 11157 /** Expose `punycode` */ 11158 // Some AMD build optimizers, like r.js, check for specific condition patterns 11159 // like the following: 11160 if ( 11161 typeof define == 'function' && 11162 typeof define.amd == 'object' && 11163 define.amd 11164 ) { 11165 define('punycode', function() { 11166 return punycode; 11167 }); 11168 } else if (freeExports && freeModule) { 11169 if (module.exports == freeExports) { 11170 // in Node.js, io.js, or RingoJS v0.8.0+ 11171 freeModule.exports = punycode; 11172 } else { 11173 // in Narwhal or RingoJS v0.7.0- 11174 for (key in punycode) { 11175 punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); 11176 } 11177 } 11178 } else { 11179 // in Rhino or a web browser 11180 root.punycode = punycode; 11181 } 11182 11183}(this)); 11184
vendor: 10,122 bytes, lines 11185-11510
11185}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) 11186},{}],132:[function(require,module,exports){ 11187'use strict'; 11188 11189var inspect = require('object-inspect'); 11190 11191var $TypeError = require('es-errors/type'); 11192 11193/* 11194* This function traverses the list returning the node corresponding to the given key. 11195* 11196* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. 11197* By doing so, all the recently used nodes can be accessed relatively quickly. 11198*/ 11199/** @type {import('./list.d.ts').listGetNode} */ 11200// eslint-disable-next-line consistent-return 11201var listGetNode = function (list, key, isDelete) { 11202 /** @type {typeof list | NonNullable<(typeof list)['next']>} */ 11203 var prev = list; 11204 /** @type {(typeof list)['next']} */ 11205 var curr; 11206 // eslint-disable-next-line eqeqeq 11207 for (; (curr = prev.next) != null; prev = curr) { 11208 if (curr.key === key) { 11209 prev.next = curr.next; 11210 if (!isDelete) { 11211 // eslint-disable-next-line no-extra-parens 11212 curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next); 11213 list.next = curr; // eslint-disable-line no-param-reassign 11214 } 11215 return curr; 11216 } 11217 } 11218}; 11219 11220/** @type {import('./list.d.ts').listGet} */ 11221var listGet = function (objects, key) { 11222 if (!objects) { 11223 return void undefined; 11224 } 11225 var node = listGetNode(objects, key); 11226 return node && node.value; 11227}; 11228/** @type {import('./list.d.ts').listSet} */ 11229var listSet = function (objects, key, value) { 11230 var node = listGetNode(objects, key); 11231 if (node) { 11232 node.value = value; 11233 } else { 11234 // Prepend the new node to the beginning of the list 11235 objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens 11236 key: key, 11237 next: objects.next, 11238 value: value 11239 }); 11240 } 11241}; 11242/** @type {import('./list.d.ts').listHas} */ 11243var listHas = function (objects, key) { 11244 if (!objects) { 11245 return false; 11246 } 11247 return !!listGetNode(objects, key); 11248}; 11249/** @type {import('./list.d.ts').listDelete} */ 11250// eslint-disable-next-line consistent-return 11251var listDelete = function (objects, key) { 11252 if (objects) { 11253 return listGetNode(objects, key, true); 11254 } 11255}; 11256 11257/** @type {import('.')} */ 11258module.exports = function getSideChannelList() { 11259 /** @typedef {ReturnType<typeof getSideChannelList>} Channel */ 11260 /** @typedef {Parameters<Channel['get']>[0]} K */ 11261 /** @typedef {Parameters<Channel['set']>[1]} V */ 11262 11263 /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o; 11264 11265 /** @type {Channel} */ 11266 var channel = { 11267 assert: function (key) { 11268 if (!channel.has(key)) { 11269 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11270 } 11271 }, 11272 'delete': function (key) { 11273 var root = $o && $o.next; 11274 var deletedNode = listDelete($o, key); 11275 if (deletedNode && root && root === deletedNode) { 11276 $o = void undefined; 11277 } 11278 return !!deletedNode; 11279 }, 11280 get: function (key) { 11281 return listGet($o, key); 11282 }, 11283 has: function (key) { 11284 return listHas($o, key); 11285 }, 11286 set: function (key, value) { 11287 if (!$o) { 11288 // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head 11289 $o = { 11290 next: void undefined 11291 }; 11292 } 11293 // eslint-disable-next-line no-extra-parens 11294 listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value); 11295 } 11296 }; 11297 // @ts-expect-error TODO: figure out why this is erroring 11298 return channel; 11299}; 11300 11301},{"es-errors/type":89,"object-inspect":130}],133:[function(require,module,exports){ 11302'use strict'; 11303 11304var GetIntrinsic = require('get-intrinsic'); 11305var callBound = require('call-bound'); 11306var inspect = require('object-inspect'); 11307 11308var $TypeError = require('es-errors/type'); 11309var $Map = GetIntrinsic('%Map%', true); 11310 11311/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */ 11312var $mapGet = callBound('Map.prototype.get', true); 11313/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */ 11314var $mapSet = callBound('Map.prototype.set', true); 11315/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 11316var $mapHas = callBound('Map.prototype.has', true); 11317/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */ 11318var $mapDelete = callBound('Map.prototype.delete', true); 11319/** @type {<K, V>(thisArg: Map<K, V>) => number} */ 11320var $mapSize = callBound('Map.prototype.size', true); 11321 11322/** @type {import('.')} */ 11323module.exports = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() { 11324 /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */ 11325 /** @typedef {Parameters<Channel['get']>[0]} K */ 11326 /** @typedef {Parameters<Channel['set']>[1]} V */ 11327 11328 /** @type {Map<K, V> | undefined} */ var $m; 11329 11330 /** @type {Channel} */ 11331 var channel = { 11332 assert: function (key) { 11333 if (!channel.has(key)) { 11334 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11335 } 11336 }, 11337 'delete': function (key) { 11338 if ($m) { 11339 var result = $mapDelete($m, key); 11340 if ($mapSize($m) === 0) { 11341 $m = void undefined; 11342 } 11343 return result; 11344 } 11345 return false; 11346 }, 11347 get: function (key) { // eslint-disable-line consistent-return 11348 if ($m) { 11349 return $mapGet($m, key); 11350 } 11351 }, 11352 has: function (key) { 11353 if ($m) { 11354 return $mapHas($m, key); 11355 } 11356 return false; 11357 }, 11358 set: function (key, value) { 11359 if (!$m) { 11360 // @ts-expect-error TS can't handle narrowing a variable inside a closure 11361 $m = new $Map(); 11362 } 11363 $mapSet($m, key, value); 11364 } 11365 }; 11366 11367 // @ts-expect-error TODO: figure out why TS is erroring here 11368 return channel; 11369}; 11370 11371},{"call-bound":81,"es-errors/type":89,"get-intrinsic":94,"object-inspect":130}],134:[function(require,module,exports){ 11372'use strict'; 11373 11374var GetIntrinsic = require('get-intrinsic'); 11375var callBound = require('call-bound'); 11376var inspect = require('object-inspect'); 11377var getSideChannelMap = require('side-channel-map'); 11378 11379var $TypeError = require('es-errors/type'); 11380var $WeakMap = GetIntrinsic('%WeakMap%', true); 11381 11382/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */ 11383var $weakMapGet = callBound('WeakMap.prototype.get', true); 11384/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */ 11385var $weakMapSet = callBound('WeakMap.prototype.set', true); 11386/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 11387var $weakMapHas = callBound('WeakMap.prototype.has', true); 11388/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */ 11389var $weakMapDelete = callBound('WeakMap.prototype.delete', true); 11390 11391/** @type {import('.')} */ 11392module.exports = $WeakMap 11393 ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() { 11394 /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */ 11395 /** @typedef {Parameters<Channel['get']>[0]} K */ 11396 /** @typedef {Parameters<Channel['set']>[1]} V */ 11397 11398 /** @type {WeakMap<K & object, V> | undefined} */ var $wm; 11399 /** @type {Channel | undefined} */ var $m; 11400 11401 /** @type {Channel} */ 11402 var channel = { 11403 assert: function (key) { 11404 if (!channel.has(key)) { 11405 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11406 } 11407 }, 11408 'delete': function (key) { 11409 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11410 if ($wm) { 11411 return $weakMapDelete($wm, key); 11412 } 11413 } else if (getSideChannelMap) { 11414 if ($m) { 11415 return $m['delete'](key); 11416 } 11417 } 11418 return false; 11419 }, 11420 get: function (key) { 11421 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11422 if ($wm) { 11423 return $weakMapGet($wm, key); 11424 } 11425 } 11426 return $m && $m.get(key); 11427 }, 11428 has: function (key) { 11429 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11430 if ($wm) { 11431 return $weakMapHas($wm, key); 11432 } 11433 } 11434 return !!$m && $m.has(key); 11435 }, 11436 set: function (key, value) { 11437 if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) { 11438 if (!$wm) { 11439 $wm = new $WeakMap(); 11440 } 11441 $weakMapSet($wm, key, value); 11442 } else if (getSideChannelMap) { 11443 if (!$m) { 11444 $m = getSideChannelMap(); 11445 } 11446 // eslint-disable-next-line no-extra-parens 11447 /** @type {NonNullable<typeof $m>} */ ($m).set(key, value); 11448 } 11449 } 11450 }; 11451 11452 // @ts-expect-error TODO: figure out why this is erroring 11453 return channel; 11454 } 11455 : getSideChannelMap; 11456 11457},{"call-bound":81,"es-errors/type":89,"get-intrinsic":94,"object-inspect":130,"side-channel-map":133}],135:[function(require,module,exports){ 11458'use strict'; 11459 11460var $TypeError = require('es-errors/type'); 11461var inspect = require('object-inspect'); 11462var getSideChannelList = require('side-channel-list'); 11463var getSideChannelMap = require('side-channel-map'); 11464var getSideChannelWeakMap = require('side-channel-weakmap'); 11465 11466var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList; 11467 11468/** @type {import('.')} */ 11469module.exports = function getSideChannel() { 11470 /** @typedef {ReturnType<typeof getSideChannel>} Channel */ 11471 11472 /** @type {Channel | undefined} */ var $channelData; 11473 11474 /** @type {Channel} */ 11475 var channel = { 11476 assert: function (key) { 11477 if (!channel.has(key)) { 11478 throw new $TypeError('Side channel does not contain ' + inspect(key)); 11479 } 11480 }, 11481 'delete': function (key) { 11482 return !!$channelData && $channelData['delete'](key); 11483 }, 11484 get: function (key) { 11485 return $channelData && $channelData.get(key); 11486 }, 11487 has: function (key) { 11488 return !!$channelData && $channelData.has(key); 11489 }, 11490 set: function (key, value) { 11491 if (!$channelData) { 11492 $channelData = makeChannel(); 11493 } 11494 11495 $channelData.set(key, value); 11496 } 11497 }; 11498 // @ts-expect-error TODO: figure out why this is erroring 11499 return channel; 11500}; 11501 11502},{"es-errors/type":89,"object-inspect":130,"side-channel-list":132,"side-channel-map":133,"side-channel-weakmap":134}],136:[function(require,module,exports){ 11503'use strict'; 11504 11505var replace = String.prototype.replace; 11506var percentTwenties = /%20/g; 11507 11508var Format = { 11509 RFC1738: 'RFC1738', 11510 RFC3986: 'RFC3986'
vendor: 11,115 bytes, lines 11511-11851
11511}; 11512 11513module.exports = { 11514 'default': Format.RFC3986, 11515 formatters: { 11516 RFC1738: function (value) { 11517 return replace.call(value, percentTwenties, '+'); 11518 }, 11519 RFC3986: function (value) { 11520 return String(value); 11521 } 11522 }, 11523 RFC1738: Format.RFC1738, 11524 RFC3986: Format.RFC3986 11525}; 11526 11527},{}],137:[function(require,module,exports){ 11528'use strict'; 11529 11530var stringify = require('./stringify'); 11531var parse = require('./parse'); 11532var formats = require('./formats'); 11533 11534module.exports = { 11535 formats: formats, 11536 parse: parse, 11537 stringify: stringify 11538}; 11539 11540},{"./formats":136,"./parse":138,"./stringify":139}],138:[function(require,module,exports){ 11541'use strict'; 11542 11543var utils = require('./utils'); 11544 11545var has = Object.prototype.hasOwnProperty; 11546var isArray = Array.isArray; 11547 11548var defaults = { 11549 allowDots: false, 11550 allowEmptyArrays: false, 11551 allowPrototypes: false, 11552 allowSparse: false, 11553 arrayLimit: 20, 11554 charset: 'utf-8', 11555 charsetSentinel: false, 11556 comma: false, 11557 decodeDotInKeys: false, 11558 decoder: utils.decode, 11559 delimiter: '&', 11560 depth: 5, 11561 duplicates: 'combine', 11562 ignoreQueryPrefix: false, 11563 interpretNumericEntities: false, 11564 parameterLimit: 1000, 11565 parseArrays: true, 11566 plainObjects: false, 11567 strictDepth: false, 11568 strictNullHandling: false, 11569 throwOnLimitExceeded: false 11570}; 11571 11572var interpretNumericEntities = function (str) { 11573 return str.replace(/&#(\d+);/g, function ($0, numberStr) { 11574 return String.fromCharCode(parseInt(numberStr, 10)); 11575 }); 11576}; 11577 11578var parseArrayValue = function (val, options, currentArrayLength) { 11579 if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { 11580 return val.split(','); 11581 } 11582 11583 if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) { 11584 throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.'); 11585 } 11586 11587 return val; 11588}; 11589 11590// This is what browsers will submit when the â character occurs in an 11591// application/x-www-form-urlencoded body and the encoding of the page containing 11592// the form is iso-8859-1, or when the submitted form has an accept-charset 11593// attribute of iso-8859-1. Presumably also with other charsets that do not contain 11594// the â character, such as us-ascii. 11595var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') 11596 11597// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. 11598var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('â') 11599 11600var parseValues = function parseQueryStringValues(str, options) { 11601 var obj = { __proto__: null }; 11602 11603 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; 11604 cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']'); 11605 11606 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; 11607 var parts = cleanStr.split( 11608 options.delimiter, 11609 options.throwOnLimitExceeded ? limit + 1 : limit 11610 ); 11611 11612 if (options.throwOnLimitExceeded && parts.length > limit) { 11613 throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.'); 11614 } 11615 11616 var skipIndex = -1; // Keep track of where the utf8 sentinel was found 11617 var i; 11618 11619 var charset = options.charset; 11620 if (options.charsetSentinel) { 11621 for (i = 0; i < parts.length; ++i) { 11622 if (parts[i].indexOf('utf8=') === 0) { 11623 if (parts[i] === charsetSentinel) { 11624 charset = 'utf-8'; 11625 } else if (parts[i] === isoSentinel) { 11626 charset = 'iso-8859-1'; 11627 } 11628 skipIndex = i; 11629 i = parts.length; // The eslint settings do not allow break; 11630 } 11631 } 11632 } 11633 11634 for (i = 0; i < parts.length; ++i) { 11635 if (i === skipIndex) { 11636 continue; 11637 } 11638 var part = parts[i]; 11639 11640 var bracketEqualsPos = part.indexOf(']='); 11641 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; 11642 11643 var key; 11644 var val; 11645 if (pos === -1) { 11646 key = options.decoder(part, defaults.decoder, charset, 'key'); 11647 val = options.strictNullHandling ? null : ''; 11648 } else { 11649 key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); 11650 11651 if (key !== null) { 11652 val = utils.maybeMap( 11653 parseArrayValue( 11654 part.slice(pos + 1), 11655 options, 11656 isArray(obj[key]) ? obj[key].length : 0 11657 ), 11658 function (encodedVal) { 11659 return options.decoder(encodedVal, defaults.decoder, charset, 'value'); 11660 } 11661 ); 11662 } 11663 } 11664 11665 if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { 11666 val = interpretNumericEntities(String(val)); 11667 } 11668 11669 if (part.indexOf('[]=') > -1) { 11670 val = isArray(val) ? [val] : val; 11671 } 11672 11673 if (key !== null) { 11674 var existing = has.call(obj, key); 11675 if (existing && options.duplicates === 'combine') { 11676 obj[key] = utils.combine( 11677 obj[key], 11678 val, 11679 options.arrayLimit, 11680 options.plainObjects 11681 ); 11682 } else if (!existing || options.duplicates === 'last') { 11683 obj[key] = val; 11684 } 11685 } 11686 } 11687 11688 return obj; 11689}; 11690 11691var parseObject = function (chain, val, options, valuesParsed) { 11692 var currentArrayLength = 0; 11693 if (chain.length > 0 && chain[chain.length - 1] === '[]') { 11694 var parentKey = chain.slice(0, -1).join(''); 11695 currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0; 11696 } 11697 11698 var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength); 11699 11700 for (var i = chain.length - 1; i >= 0; --i) { 11701 var obj; 11702 var root = chain[i]; 11703 11704 if (root === '[]' && options.parseArrays) { 11705 if (utils.isOverflow(leaf)) { 11706 // leaf is already an overflow object, preserve it 11707 obj = leaf; 11708 } else { 11709 obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null)) 11710 ? [] 11711 : utils.combine( 11712 [], 11713 leaf, 11714 options.arrayLimit, 11715 options.plainObjects 11716 ); 11717 } 11718 } else { 11719 obj = options.plainObjects ? { __proto__: null } : {}; 11720 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; 11721 var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot; 11722 var index = parseInt(decodedRoot, 10); 11723 if (!options.parseArrays && decodedRoot === '') { 11724 obj = { 0: leaf }; 11725 } else if ( 11726 !isNaN(index) 11727 && root !== decodedRoot 11728 && String(index) === decodedRoot 11729 && index >= 0 11730 && (options.parseArrays && index <= options.arrayLimit) 11731 ) { 11732 obj = []; 11733 obj[index] = leaf; 11734 } else if (decodedRoot !== '__proto__') { 11735 obj[decodedRoot] = leaf; 11736 } 11737 } 11738 11739 leaf = obj; 11740 } 11741 11742 return leaf; 11743}; 11744 11745var splitKeyIntoSegments = function splitKeyIntoSegments(givenKey, options) { 11746 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; 11747 11748 if (options.depth <= 0) { 11749 if (!options.plainObjects && has.call(Object.prototype, key)) { 11750 if (!options.allowPrototypes) { 11751 return; 11752 } 11753 } 11754 11755 return [key]; 11756 } 11757 11758 var brackets = /(\[[^[\]]*])/; 11759 var child = /(\[[^[\]]*])/g; 11760 11761 var segment = brackets.exec(key); 11762 var parent = segment ? key.slice(0, segment.index) : key; 11763 11764 var keys = []; 11765 11766 if (parent) { 11767 if (!options.plainObjects && has.call(Object.prototype, parent)) { 11768 if (!options.allowPrototypes) { 11769 return; 11770 } 11771 } 11772 11773 keys.push(parent); 11774 } 11775 11776 var i = 0; 11777 while ((segment = child.exec(key)) !== null && i < options.depth) { 11778 i += 1; 11779 11780 var segmentContent = segment[1].slice(1, -1); 11781 if (!options.plainObjects && has.call(Object.prototype, segmentContent)) { 11782 if (!options.allowPrototypes) { 11783 return; 11784 } 11785 } 11786 11787 keys.push(segment[1]); 11788 } 11789 11790 if (segment) { 11791 if (options.strictDepth === true) { 11792 throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true'); 11793 } 11794 11795 keys.push('[' + key.slice(segment.index) + ']'); 11796 } 11797 11798 return keys; 11799}; 11800 11801var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { 11802 if (!givenKey) { 11803 return; 11804 } 11805 11806 var keys = splitKeyIntoSegments(givenKey, options); 11807 11808 if (!keys) { 11809 return; 11810 } 11811 11812 return parseObject(keys, val, options, valuesParsed); 11813}; 11814 11815var normalizeParseOptions = function normalizeParseOptions(opts) { 11816 if (!opts) { 11817 return defaults; 11818 } 11819 11820 if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { 11821 throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); 11822 } 11823 11824 if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') { 11825 throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided'); 11826 } 11827 11828 if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') { 11829 throw new TypeError('Decoder has to be a function.'); 11830 } 11831 11832 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 11833 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 11834 } 11835 11836 if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') { 11837 throw new TypeError('`throwOnLimitExceeded` option must be a boolean'); 11838 } 11839 11840 var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; 11841 11842 var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates; 11843 11844 if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') { 11845 throw new TypeError('The duplicates option must be either combine, first, or last'); 11846 } 11847 11848 var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; 11849 11850 return { 11851 allowDots: allowDots,
vendor: 3,003 bytes, lines 11852-11907
11852 allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 11853 allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, 11854 allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse, 11855 arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, 11856 charset: charset, 11857 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 11858 comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, 11859 decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys, 11860 decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, 11861 delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, 11862 // eslint-disable-next-line no-implicit-coercion, no-extra-parens 11863 depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, 11864 duplicates: duplicates, 11865 ignoreQueryPrefix: opts.ignoreQueryPrefix === true, 11866 interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, 11867 parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, 11868 parseArrays: opts.parseArrays !== false, 11869 plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, 11870 strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth, 11871 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, 11872 throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false 11873 }; 11874}; 11875 11876module.exports = function (str, opts) { 11877 var options = normalizeParseOptions(opts); 11878 11879 if (str === '' || str === null || typeof str === 'undefined') { 11880 return options.plainObjects ? { __proto__: null } : {}; 11881 } 11882 11883 var tempObj = typeof str === 'string' ? parseValues(str, options) : str; 11884 var obj = options.plainObjects ? { __proto__: null } : {}; 11885 11886 // Iterate over the keys and setup the new object 11887 11888 var keys = Object.keys(tempObj); 11889 for (var i = 0; i < keys.length; ++i) { 11890 var key = keys[i]; 11891 var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string'); 11892 obj = utils.merge(obj, newObj, options); 11893 } 11894 11895 if (options.allowSparse === true) { 11896 return obj; 11897 } 11898 11899 return utils.compact(obj); 11900}; 11901 11902},{"./utils":140}],139:[function(require,module,exports){ 11903'use strict'; 11904 11905var getSideChannel = require('side-channel'); 11906var utils = require('./utils'); 11907var formats = require('./formats'
vendor: 11,350 bytes, lines 11907-12259
11907); 11908var has = Object.prototype.hasOwnProperty; 11909 11910var arrayPrefixGenerators = { 11911 brackets: function brackets(prefix) { 11912 return prefix + '[]'; 11913 }, 11914 comma: 'comma', 11915 indices: function indices(prefix, key) { 11916 return prefix + '[' + key + ']'; 11917 }, 11918 repeat: function repeat(prefix) { 11919 return prefix; 11920 } 11921}; 11922 11923var isArray = Array.isArray; 11924var push = Array.prototype.push; 11925var pushToArray = function (arr, valueOrArray) { 11926 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); 11927}; 11928 11929var toISO = Date.prototype.toISOString; 11930 11931var defaultFormat = formats['default']; 11932var defaults = { 11933 addQueryPrefix: false, 11934 allowDots: false, 11935 allowEmptyArrays: false, 11936 arrayFormat: 'indices', 11937 charset: 'utf-8', 11938 charsetSentinel: false, 11939 commaRoundTrip: false, 11940 delimiter: '&', 11941 encode: true, 11942 encodeDotInKeys: false, 11943 encoder: utils.encode, 11944 encodeValuesOnly: false, 11945 filter: void undefined, 11946 format: defaultFormat, 11947 formatter: formats.formatters[defaultFormat], 11948 // deprecated 11949 indices: false, 11950 serializeDate: function serializeDate(date) { 11951 return toISO.call(date); 11952 }, 11953 skipNulls: false, 11954 strictNullHandling: false 11955}; 11956 11957var isNonNullishPrimitive = function isNonNullishPrimitive(v) { 11958 return typeof v === 'string' 11959 || typeof v === 'number' 11960 || typeof v === 'boolean' 11961 || typeof v === 'symbol' 11962 || typeof v === 'bigint'; 11963}; 11964 11965var sentinel = {}; 11966 11967var stringify = function stringify( 11968 object, 11969 prefix, 11970 generateArrayPrefix, 11971 commaRoundTrip, 11972 allowEmptyArrays, 11973 strictNullHandling, 11974 skipNulls, 11975 encodeDotInKeys, 11976 encoder, 11977 filter, 11978 sort, 11979 allowDots, 11980 serializeDate, 11981 format, 11982 formatter, 11983 encodeValuesOnly, 11984 charset, 11985 sideChannel 11986) { 11987 var obj = object; 11988 11989 var tmpSc = sideChannel; 11990 var step = 0; 11991 var findFlag = false; 11992 while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) { 11993 // Where object last appeared in the ref tree 11994 var pos = tmpSc.get(object); 11995 step += 1; 11996 if (typeof pos !== 'undefined') { 11997 if (pos === step) { 11998 throw new RangeError('Cyclic object value'); 11999 } else { 12000 findFlag = true; // Break while 12001 } 12002 } 12003 if (typeof tmpSc.get(sentinel) === 'undefined') { 12004 step = 0; 12005 } 12006 } 12007 12008 if (typeof filter === 'function') { 12009 obj = filter(prefix, obj); 12010 } else if (obj instanceof Date) { 12011 obj = serializeDate(obj); 12012 } else if (generateArrayPrefix === 'comma' && isArray(obj)) { 12013 obj = utils.maybeMap(obj, function (value) { 12014 if (value instanceof Date) { 12015 return serializeDate(value); 12016 } 12017 return value; 12018 }); 12019 } 12020 12021 if (obj === null) { 12022 if (strictNullHandling) { 12023 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix; 12024 } 12025 12026 obj = ''; 12027 } 12028 12029 if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { 12030 if (encoder) { 12031 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format); 12032 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))]; 12033 } 12034 return [formatter(prefix) + '=' + formatter(String(obj))]; 12035 } 12036 12037 var values = []; 12038 12039 if (typeof obj === 'undefined') { 12040 return values; 12041 } 12042 12043 var objKeys; 12044 if (generateArrayPrefix === 'comma' && isArray(obj)) { 12045 // we need to join elements in 12046 if (encodeValuesOnly && encoder) { 12047 obj = utils.maybeMap(obj, encoder); 12048 } 12049 objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; 12050 } else if (isArray(filter)) { 12051 objKeys = filter; 12052 } else { 12053 var keys = Object.keys(obj); 12054 objKeys = sort ? keys.sort(sort) : keys; 12055 } 12056 12057 var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); 12058 12059 var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix; 12060 12061 if (allowEmptyArrays && isArray(obj) && obj.length === 0) { 12062 return adjustedPrefix + '[]'; 12063 } 12064 12065 for (var j = 0; j < objKeys.length; ++j) { 12066 var key = objKeys[j]; 12067 var value = typeof key === 'object' && key && typeof key.value !== 'undefined' 12068 ? key.value 12069 : obj[key]; 12070 12071 if (skipNulls && value === null) { 12072 continue; 12073 } 12074 12075 var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key); 12076 var keyPrefix = isArray(obj) 12077 ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix 12078 : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']'); 12079 12080 sideChannel.set(object, step); 12081 var valueSideChannel = getSideChannel(); 12082 valueSideChannel.set(sentinel, sideChannel); 12083 pushToArray(values, stringify( 12084 value, 12085 keyPrefix, 12086 generateArrayPrefix, 12087 commaRoundTrip, 12088 allowEmptyArrays, 12089 strictNullHandling, 12090 skipNulls, 12091 encodeDotInKeys, 12092 generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder, 12093 filter, 12094 sort, 12095 allowDots, 12096 serializeDate, 12097 format, 12098 formatter, 12099 encodeValuesOnly, 12100 charset, 12101 valueSideChannel 12102 )); 12103 } 12104 12105 return values; 12106}; 12107 12108var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { 12109 if (!opts) { 12110 return defaults; 12111 } 12112 12113 if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { 12114 throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); 12115 } 12116 12117 if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { 12118 throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); 12119 } 12120 12121 if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { 12122 throw new TypeError('Encoder has to be a function.'); 12123 } 12124 12125 var charset = opts.charset || defaults.charset; 12126 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 12127 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 12128 } 12129 12130 var format = formats['default']; 12131 if (typeof opts.format !== 'undefined') { 12132 if (!has.call(formats.formatters, opts.format)) { 12133 throw new TypeError('Unknown format option provided.'); 12134 } 12135 format = opts.format; 12136 } 12137 var formatter = formats.formatters[format]; 12138 12139 var filter = defaults.filter; 12140 if (typeof opts.filter === 'function' || isArray(opts.filter)) { 12141 filter = opts.filter; 12142 } 12143 12144 var arrayFormat; 12145 if (opts.arrayFormat in arrayPrefixGenerators) { 12146 arrayFormat = opts.arrayFormat; 12147 } else if ('indices' in opts) { 12148 arrayFormat = opts.indices ? 'indices' : 'repeat'; 12149 } else { 12150 arrayFormat = defaults.arrayFormat; 12151 } 12152 12153 if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { 12154 throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); 12155 } 12156 12157 var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots; 12158 12159 return { 12160 addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, 12161 allowDots: allowDots, 12162 allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, 12163 arrayFormat: arrayFormat, 12164 charset: charset, 12165 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 12166 commaRoundTrip: !!opts.commaRoundTrip, 12167 delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, 12168 encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, 12169 encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, 12170 encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, 12171 encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, 12172 filter: filter, 12173 format: format, 12174 formatter: formatter, 12175 serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, 12176 skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, 12177 sort: typeof opts.sort === 'function' ? opts.sort : null, 12178 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling 12179 }; 12180}; 12181 12182module.exports = function (object, opts) { 12183 var obj = object; 12184 var options = normalizeStringifyOptions(opts); 12185 12186 var objKeys; 12187 var filter; 12188 12189 if (typeof options.filter === 'function') { 12190 filter = options.filter; 12191 obj = filter('', obj); 12192 } else if (isArray(options.filter)) { 12193 filter = options.filter; 12194 objKeys = filter; 12195 } 12196 12197 var keys = []; 12198 12199 if (typeof obj !== 'object' || obj === null) { 12200 return ''; 12201 } 12202 12203 var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; 12204 var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; 12205 12206 if (!objKeys) { 12207 objKeys = Object.keys(obj); 12208 } 12209 12210 if (options.sort) { 12211 objKeys.sort(options.sort); 12212 } 12213 12214 var sideChannel = getSideChannel(); 12215 for (var i = 0; i < objKeys.length; ++i) { 12216 var key = objKeys[i]; 12217 var value = obj[key]; 12218 12219 if (options.skipNulls && value === null) { 12220 continue; 12221 } 12222 pushToArray(keys, stringify( 12223 value, 12224 key, 12225 generateArrayPrefix, 12226 commaRoundTrip, 12227 options.allowEmptyArrays, 12228 options.strictNullHandling, 12229 options.skipNulls, 12230 options.encodeDotInKeys, 12231 options.encode ? options.encoder : null, 12232 options.filter, 12233 options.sort, 12234 options.allowDots, 12235 options.serializeDate, 12236 options.format, 12237 options.formatter, 12238 options.encodeValuesOnly, 12239 options.charset, 12240 sideChannel 12241 )); 12242 } 12243 12244 var joined = keys.join(options.delimiter); 12245 var prefix = options.addQueryPrefix === true ? '?' : ''; 12246 12247 if (options.charsetSentinel) { 12248 if (options.charset === 'iso-8859-1') { 12249 // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark 12250 prefix += 'utf8=%26%2310003%3B&'; 12251 } else { 12252 // encodeURIComponent('â') 12253 prefix += 'utf8=%E2%9C%93&'; 12254 } 12255 } 12256 12257 return joined.length > 0 ? prefix + joined : ''; 12258}; 12259
12260},{"./formats":136,"./utils":140,"side-channel":135}],140:[function(require,module,exports){ 12261'use strict'; 12262 12263var formats = require('./formats'); 12264var getSideChannel = require('side-channel'); 12265 12266var has = Object.prototype.hasOwnProperty; 12267var isArray = Array.isArray; 12268 12269// Track objects created from arrayLimit overflow using side-channel 12270// Stores the current max numeric index for O(1) lookup 12271var overflowChannel = getSideChannel(); 12272 12273var markOverflow = function markOverflow(obj, maxIndex) { 12274 overflowChannel.set(obj, maxIndex); 12275 return obj; 12276}; 12277 12278var isOverflow = function isOverflow(obj) { 12279 return overflowChannel.has(obj); 12280}; 12281 12282var getMaxIndex = function getMaxIndex(obj) { 12283 return overflowChannel.get(obj); 12284}; 12285 12286var setMaxIndex = function setMaxIndex(obj, maxIndex) { 12287 overflowChannel.set(obj, maxIndex); 12288}; 12289 12290var hexTable = (function () { 12291 var array = []; 12292 for (var i = 0; i < 256; ++i) { 12293 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); 12294 } 12295 12296 return array; 12297}()); 12298
vendor: 4,308 bytes, lines 12299-12439
12299var compactQueue = function compactQueue(queue) { 12300 while (queue.length > 1) { 12301 var item = queue.pop(); 12302 var obj = item.obj[item.prop]; 12303 12304 if (isArray(obj)) { 12305 var compacted = []; 12306 12307 for (var j = 0; j < obj.length; ++j) { 12308 if (typeof obj[j] !== 'undefined') { 12309 compacted.push(obj[j]); 12310 } 12311 } 12312 12313 item.obj[item.prop] = compacted; 12314 } 12315 } 12316}; 12317 12318var arrayToObject = function arrayToObject(source, options) { 12319 var obj = options && options.plainObjects ? { __proto__: null } : {}; 12320 for (var i = 0; i < source.length; ++i) { 12321 if (typeof source[i] !== 'undefined') { 12322 obj[i] = source[i]; 12323 } 12324 } 12325 12326 return obj; 12327}; 12328 12329var merge = function merge(target, source, options) { 12330 /* eslint no-param-reassign: 0 */ 12331 if (!source) { 12332 return target; 12333 } 12334 12335 if (typeof source !== 'object' && typeof source !== 'function') { 12336 if (isArray(target)) { 12337 target.push(source); 12338 } else if (target && typeof target === 'object') { 12339 if (isOverflow(target)) { 12340 // Add at next numeric index for overflow objects 12341 var newIndex = getMaxIndex(target) + 1; 12342 target[newIndex] = source; 12343 setMaxIndex(target, newIndex); 12344 } else if ( 12345 (options && (options.plainObjects || options.allowPrototypes)) 12346 || !has.call(Object.prototype, source) 12347 ) { 12348 target[source] = true; 12349 } 12350 } else { 12351 return [target, source]; 12352 } 12353 12354 return target; 12355 } 12356 12357 if (!target || typeof target !== 'object') { 12358 if (isOverflow(source)) { 12359 // Create new object with target at 0, source values shifted by 1 12360 var sourceKeys = Object.keys(source); 12361 var result = options && options.plainObjects 12362 ? { __proto__: null, 0: target } 12363 : { 0: target }; 12364 for (var m = 0; m < sourceKeys.length; m++) { 12365 var oldKey = parseInt(sourceKeys[m], 10); 12366 result[oldKey + 1] = source[sourceKeys[m]]; 12367 } 12368 return markOverflow(result, getMaxIndex(source) + 1); 12369 } 12370 return [target].concat(source); 12371 } 12372 12373 var mergeTarget = target; 12374 if (isArray(target) && !isArray(source)) { 12375 mergeTarget = arrayToObject(target, options); 12376 } 12377 12378 if (isArray(target) && isArray(source)) { 12379 source.forEach(function (item, i) { 12380 if (has.call(target, i)) { 12381 var targetItem = target[i]; 12382 if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { 12383 target[i] = merge(targetItem, item, options); 12384 } else { 12385 target.push(item); 12386 } 12387 } else { 12388 target[i] = item; 12389 } 12390 }); 12391 return target; 12392 } 12393 12394 return Object.keys(source).reduce(function (acc, key) { 12395 var value = source[key]; 12396 12397 if (has.call(acc, key)) { 12398 acc[key] = merge(acc[key], value, options); 12399 } else { 12400 acc[key] = value; 12401 } 12402 return acc; 12403 }, mergeTarget); 12404}; 12405 12406var assign = function assignSingleSource(target, source) { 12407 return Object.keys(source).reduce(function (acc, key) { 12408 acc[key] = source[key]; 12409 return acc; 12410 }, target); 12411}; 12412 12413var decode = function (str, defaultDecoder, charset) { 12414 var strWithoutPlus = str.replace(/\+/g, ' '); 12415 if (charset === 'iso-8859-1') { 12416 // unescape never throws, no try...catch needed: 12417 return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); 12418 } 12419 // utf-8 12420 try { 12421 return decodeURIComponent(strWithoutPlus); 12422 } catch (e) { 12423 return strWithoutPlus; 12424 } 12425}; 12426 12427var limit = 1024; 12428 12429/* eslint operator-linebreak: [2, "before"] */ 12430 12431var encode = function encode(str, defaultEncoder, charset, kind, format) { 12432 // This code was originally written by Brian White (mscdex) for the io.js core querystring library. 12433 // It has been adapted here for stricter adherence to RFC 3986 12434 if (str.length === 0) { 12435 return str; 12436 } 12437 12438 var string = str; 12439 if (typeof str === 'symbol') {
vendor: 4,022 bytes, lines 12440-12582
12440 string = Symbol.prototype.toString.call(str); 12441 } else if (typeof str !== 'string') { 12442 string = String(str); 12443 } 12444 12445 if (charset === 'iso-8859-1') { 12446 return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { 12447 return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; 12448 }); 12449 } 12450 12451 var out = ''; 12452 for (var j = 0; j < string.length; j += limit) { 12453 var segment = string.length >= limit ? string.slice(j, j + limit) : string; 12454 var arr = []; 12455 12456 for (var i = 0; i < segment.length; ++i) { 12457 var c = segment.charCodeAt(i); 12458 if ( 12459 c === 0x2D // - 12460 || c === 0x2E // . 12461 || c === 0x5F // _ 12462 || c === 0x7E // ~ 12463 || (c >= 0x30 && c <= 0x39) // 0-9 12464 || (c >= 0x41 && c <= 0x5A) // a-z 12465 || (c >= 0x61 && c <= 0x7A) // A-Z 12466 || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( ) 12467 ) { 12468 arr[arr.length] = segment.charAt(i); 12469 continue; 12470 } 12471 12472 if (c < 0x80) { 12473 arr[arr.length] = hexTable[c]; 12474 continue; 12475 } 12476 12477 if (c < 0x800) { 12478 arr[arr.length] = hexTable[0xC0 | (c >> 6)] 12479 + hexTable[0x80 | (c & 0x3F)]; 12480 continue; 12481 } 12482 12483 if (c < 0xD800 || c >= 0xE000) { 12484 arr[arr.length] = hexTable[0xE0 | (c >> 12)] 12485 + hexTable[0x80 | ((c >> 6) & 0x3F)] 12486 + hexTable[0x80 | (c & 0x3F)]; 12487 continue; 12488 } 12489 12490 i += 1; 12491 c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF)); 12492 12493 arr[arr.length] = hexTable[0xF0 | (c >> 18)] 12494 + hexTable[0x80 | ((c >> 12) & 0x3F)] 12495 + hexTable[0x80 | ((c >> 6) & 0x3F)] 12496 + hexTable[0x80 | (c & 0x3F)]; 12497 } 12498 12499 out += arr.join(''); 12500 } 12501 12502 return out; 12503}; 12504 12505var compact = function compact(value) { 12506 var queue = [{ obj: { o: value }, prop: 'o' }]; 12507 var refs = []; 12508 12509 for (var i = 0; i < queue.length; ++i) { 12510 var item = queue[i]; 12511 var obj = item.obj[item.prop]; 12512 12513 var keys = Object.keys(obj); 12514 for (var j = 0; j < keys.length; ++j) { 12515 var key = keys[j]; 12516 var val = obj[key]; 12517 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { 12518 queue.push({ obj: obj, prop: key }); 12519 refs.push(val); 12520 } 12521 } 12522 } 12523 12524 compactQueue(queue); 12525 12526 return value; 12527}; 12528 12529var isRegExp = function isRegExp(obj) { 12530 return Object.prototype.toString.call(obj) === '[object RegExp]'; 12531}; 12532 12533var isBuffer = function isBuffer(obj) { 12534 if (!obj || typeof obj !== 'object') { 12535 return false; 12536 } 12537 12538 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 12539}; 12540 12541var combine = function combine(a, b, arrayLimit, plainObjects) { 12542 // If 'a' is already an overflow object, add to it 12543 if (isOverflow(a)) { 12544 var newIndex = getMaxIndex(a) + 1; 12545 a[newIndex] = b; 12546 setMaxIndex(a, newIndex); 12547 return a; 12548 } 12549 12550 var result = [].concat(a, b); 12551 if (result.length > arrayLimit) { 12552 return markOverflow(arrayToObject(result, { plainObjects: plainObjects }), result.length - 1); 12553 } 12554 return result; 12555}; 12556 12557var maybeMap = function maybeMap(val, fn) { 12558 if (isArray(val)) { 12559 var mapped = []; 12560 for (var i = 0; i < val.length; i += 1) { 12561 mapped.push(fn(val[i])); 12562 } 12563 return mapped; 12564 } 12565 return fn(val); 12566}; 12567 12568module.exports = { 12569 arrayToObject: arrayToObject, 12570 assign: assign, 12571 combine: combine, 12572 compact: compact, 12573 decode: decode, 12574 encode: encode, 12575 isBuffer: isBuffer, 12576 isOverflow: isOverflow, 12577 isRegExp: isRegExp, 12578 maybeMap: maybeMap, 12579 merge: merge 12580}; 12581 12582},{"./formats":136,"side-channel":135}],141
vendor: 23,586 bytes, lines 12582-13360
12582:[function(require,module,exports){ 12583/* 12584 * Copyright Joyent, Inc. and other Node contributors. 12585 * 12586 * Permission is hereby granted, free of charge, to any person obtaining a 12587 * copy of this software and associated documentation files (the 12588 * "Software"), to deal in the Software without restriction, including 12589 * without limitation the rights to use, copy, modify, merge, publish, 12590 * distribute, sublicense, and/or sell copies of the Software, and to permit 12591 * persons to whom the Software is furnished to do so, subject to the 12592 * following conditions: 12593 * 12594 * The above copyright notice and this permission notice shall be included 12595 * in all copies or substantial portions of the Software. 12596 * 12597 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 12598 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 12599 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 12600 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 12601 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 12602 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 12603 * USE OR OTHER DEALINGS IN THE SOFTWARE. 12604 */ 12605 12606'use strict'; 12607 12608var punycode = require('punycode/'); 12609 12610function Url() { 12611 this.protocol = null; 12612 this.slashes = null; 12613 this.auth = null; 12614 this.host = null; 12615 this.port = null; 12616 this.hostname = null; 12617 this.hash = null; 12618 this.search = null; 12619 this.query = null; 12620 this.pathname = null; 12621 this.path = null; 12622 this.href = null; 12623} 12624 12625// Reference: RFC 3986, RFC 1808, RFC 2396 12626 12627/* 12628 * define these here so at least they only have to be 12629 * compiled once on the first module load. 12630 */ 12631var protocolPattern = /^([a-z0-9.+-]+:)/i, 12632 portPattern = /:[0-9]*$/, 12633 12634 // Special case for a simple path URL 12635 simplePathPattern = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, 12636 12637 /* 12638 * RFC 2396: characters reserved for delimiting URLs. 12639 * We actually just auto-escape these. 12640 */ 12641 delims = [ 12642 '<', '>', '"', '`', ' ', '\r', '\n', '\t' 12643 ], 12644 12645 // RFC 2396: characters not allowed for various reasons. 12646 unwise = [ 12647 '{', '}', '|', '\\', '^', '`' 12648 ].concat(delims), 12649 12650 // Allowed by RFCs, but cause of XSS attacks. Always escape these. 12651 autoEscape = ['\''].concat(unwise), 12652 /* 12653 * Characters that are never ever allowed in a hostname. 12654 * Note that any invalid chars are also handled, but these 12655 * are the ones that are *expected* to be seen, so we fast-path 12656 * them. 12657 */ 12658 nonHostChars = [ 12659 '%', '/', '?', ';', '#' 12660 ].concat(autoEscape), 12661 hostEndingChars = [ 12662 '/', '?', '#' 12663 ], 12664 hostnameMaxLen = 255, 12665 hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, 12666 hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, 12667 // protocols that can allow "unsafe" and "unwise" chars. 12668 unsafeProtocol = { 12669 javascript: true, 12670 'javascript:': true 12671 }, 12672 // protocols that never have a hostname. 12673 hostlessProtocol = { 12674 javascript: true, 12675 'javascript:': true 12676 }, 12677 // protocols that always contain a // bit. 12678 slashedProtocol = { 12679 http: true, 12680 https: true, 12681 ftp: true, 12682 gopher: true, 12683 file: true, 12684 'http:': true, 12685 'https:': true, 12686 'ftp:': true, 12687 'gopher:': true, 12688 'file:': true 12689 }, 12690 querystring = require('qs'); 12691 12692function urlParse(url, parseQueryString, slashesDenoteHost) { 12693 if (url && typeof url === 'object' && url instanceof Url) { return url; } 12694 12695 var u = new Url(); 12696 u.parse(url, parseQueryString, slashesDenoteHost); 12697 return u; 12698} 12699 12700Url.prototype.parse = function (url, parseQueryString, slashesDenoteHost) { 12701 if (typeof url !== 'string') { 12702 throw new TypeError("Parameter 'url' must be a string, not " + typeof url); 12703 } 12704 12705 /* 12706 * Copy chrome, IE, opera backslash-handling behavior. 12707 * Back slashes before the query string get converted to forward slashes 12708 * See: https://code.google.com/p/chromium/issues/detail?id=25916 12709 */ 12710 var queryIndex = url.indexOf('?'), 12711 splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#', 12712 uSplit = url.split(splitter), 12713 slashRegex = /\\/g; 12714 uSplit[0] = uSplit[0].replace(slashRegex, '/'); 12715 url = uSplit.join(splitter); 12716 12717 var rest = url; 12718 12719 /* 12720 * trim before proceeding. 12721 * This is to support parse stuff like " http://foo.com \n" 12722 */ 12723 rest = rest.trim(); 12724 12725 if (!slashesDenoteHost && url.split('#').length === 1) { 12726 // Try fast path regexp 12727 var simplePath = simplePathPattern.exec(rest); 12728 if (simplePath) { 12729 this.path = rest; 12730 this.href = rest; 12731 this.pathname = simplePath[1]; 12732 if (simplePath[2]) { 12733 this.search = simplePath[2]; 12734 if (parseQueryString) { 12735 this.query = querystring.parse(this.search.substr(1)); 12736 } else { 12737 this.query = this.search.substr(1); 12738 } 12739 } else if (parseQueryString) { 12740 this.search = ''; 12741 this.query = {}; 12742 } 12743 return this; 12744 } 12745 } 12746 12747 var proto = protocolPattern.exec(rest); 12748 if (proto) { 12749 proto = proto[0]; 12750 var lowerProto = proto.toLowerCase(); 12751 this.protocol = lowerProto; 12752 rest = rest.substr(proto.length); 12753 } 12754 12755 /* 12756 * figure out if it's got a host 12757 * user@server is *always* interpreted as a hostname, and url 12758 * resolution will treat //foo/bar as host=foo,path=bar because that's 12759 * how the browser resolves relative URLs. 12760 */ 12761 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@/]+@[^@/]+/)) { 12762 var slashes = rest.substr(0, 2) === '//'; 12763 if (slashes && !(proto && hostlessProtocol[proto])) { 12764 rest = rest.substr(2); 12765 this.slashes = true; 12766 } 12767 } 12768 12769 if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { 12770 12771 /* 12772 * there's a hostname. 12773 * the first instance of /, ?, ;, or # ends the host. 12774 * 12775 * If there is an @ in the hostname, then non-host chars *are* allowed 12776 * to the left of the last @ sign, unless some host-ending character 12777 * comes *before* the @-sign. 12778 * URLs are obnoxious. 12779 * 12780 * ex: 12781 * http://a@b@c/ => user:a@b host:c 12782 * http://a@b?@c => user:a host:c path:/?@c 12783 */ 12784 12785 /* 12786 * v0.12 TODO(isaacs): This is not quite how Chrome does things. 12787 * Review our test case against browsers more comprehensively. 12788 */ 12789 12790 // find the first instance of any hostEndingChars 12791 var hostEnd = -1; 12792 for (var i = 0; i < hostEndingChars.length; i++) { 12793 var hec = rest.indexOf(hostEndingChars[i]); 12794 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; } 12795 } 12796 12797 /* 12798 * at this point, either we have an explicit point where the 12799 * auth portion cannot go past, or the last @ char is the decider. 12800 */ 12801 var auth, atSign; 12802 if (hostEnd === -1) { 12803 // atSign can be anywhere. 12804 atSign = rest.lastIndexOf('@'); 12805 } else { 12806 /* 12807 * atSign must be in auth portion. 12808 * http://a@b/c@d => host:b auth:a path:/c@d 12809 */ 12810 atSign = rest.lastIndexOf('@', hostEnd); 12811 } 12812 12813 /* 12814 * Now we have a portion which is definitely the auth. 12815 * Pull that off. 12816 */ 12817 if (atSign !== -1) { 12818 auth = rest.slice(0, atSign); 12819 rest = rest.slice(atSign + 1); 12820 this.auth = decodeURIComponent(auth); 12821 } 12822 12823 // the host is the remaining to the left of the first non-host char 12824 hostEnd = -1; 12825 for (var i = 0; i < nonHostChars.length; i++) { 12826 var hec = rest.indexOf(nonHostChars[i]); 12827 if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; } 12828 } 12829 // if we still have not hit it, then the entire thing is a host. 12830 if (hostEnd === -1) { hostEnd = rest.length; } 12831 12832 this.host = rest.slice(0, hostEnd); 12833 rest = rest.slice(hostEnd); 12834 12835 // pull out port. 12836 this.parseHost(); 12837 12838 /* 12839 * we've indicated that there is a hostname, 12840 * so even if it's empty, it has to be present. 12841 */ 12842 this.hostname = this.hostname || ''; 12843 12844 /* 12845 * if hostname begins with [ and ends with ] 12846 * assume that it's an IPv6 address. 12847 */ 12848 var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; 12849 12850 // validate a little. 12851 if (!ipv6Hostname) { 12852 var hostparts = this.hostname.split(/\./); 12853 for (var i = 0, l = hostparts.length; i < l; i++) { 12854 var part = hostparts[i]; 12855 if (!part) { continue; } 12856 if (!part.match(hostnamePartPattern)) { 12857 var newpart = ''; 12858 for (var j = 0, k = part.length; j < k; j++) { 12859 if (part.charCodeAt(j) > 127) { 12860 /* 12861 * we replace non-ASCII char with a temporary placeholder 12862 * we need this to make sure size of hostname is not 12863 * broken by replacing non-ASCII by nothing 12864 */ 12865 newpart += 'x'; 12866 } else { 12867 newpart += part[j]; 12868 } 12869 } 12870 // we test again with ASCII char only 12871 if (!newpart.match(hostnamePartPattern)) { 12872 var validParts = hostparts.slice(0, i); 12873 var notHost = hostparts.slice(i + 1); 12874 var bit = part.match(hostnamePartStart); 12875 if (bit) { 12876 validParts.push(bit[1]); 12877 notHost.unshift(bit[2]); 12878 } 12879 if (notHost.length) { 12880 rest = '/' + notHost.join('.') + rest; 12881 } 12882 this.hostname = validParts.join('.'); 12883 break; 12884 } 12885 } 12886 } 12887 } 12888 12889 if (this.hostname.length > hostnameMaxLen) { 12890 this.hostname = ''; 12891 } else { 12892 // hostnames are always lower case. 12893 this.hostname = this.hostname.toLowerCase(); 12894 } 12895 12896 if (!ipv6Hostname) { 12897 /* 12898 * IDNA Support: Returns a punycoded representation of "domain". 12899 * It only converts parts of the domain name that 12900 * have non-ASCII characters, i.e. it doesn't matter if 12901 * you call it with a domain that already is ASCII-only. 12902 */ 12903 this.hostname = punycode.toASCII(this.hostname); 12904 } 12905 12906 var p = this.port ? ':' + this.port : ''; 12907 var h = this.hostname || ''; 12908 this.host = h + p; 12909 this.href += this.host; 12910 12911 /* 12912 * strip [ and ] from the hostname 12913 * the host field still retains them, though 12914 */ 12915 if (ipv6Hostname) { 12916 this.hostname = this.hostname.substr(1, this.hostname.length - 2); 12917 if (rest[0] !== '/') { 12918 rest = '/' + rest; 12919 } 12920 } 12921 } 12922 12923 /* 12924 * now rest is set to the post-host stuff. 12925 * chop off any delim chars. 12926 */ 12927 if (!unsafeProtocol[lowerProto]) { 12928 12929 /* 12930 * First, make 100% sure that any "autoEscape" chars get 12931 * escaped, even if encodeURIComponent doesn't think they 12932 * need to be. 12933 */ 12934 for (var i = 0, l = autoEscape.length; i < l; i++) { 12935 var ae = autoEscape[i]; 12936 if (rest.indexOf(ae) === -1) { continue; } 12937 var esc = encodeURIComponent(ae); 12938 if (esc === ae) { 12939 esc = escape(ae); 12940 } 12941 rest = rest.split(ae).join(esc); 12942 } 12943 } 12944 12945 // chop off from the tail first. 12946 var hash = rest.indexOf('#'); 12947 if (hash !== -1) { 12948 // got a fragment string. 12949 this.hash = rest.substr(hash); 12950 rest = rest.slice(0, hash); 12951 } 12952 var qm = rest.indexOf('?'); 12953 if (qm !== -1) { 12954 this.search = rest.substr(qm); 12955 this.query = rest.substr(qm + 1); 12956 if (parseQueryString) { 12957 this.query = querystring.parse(this.query); 12958 } 12959 rest = rest.slice(0, qm); 12960 } else if (parseQueryString) { 12961 // no query string, but parseQueryString still requested 12962 this.search = ''; 12963 this.query = {}; 12964 } 12965 if (rest) { this.pathname = rest; } 12966 if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { 12967 this.pathname = '/'; 12968 } 12969 12970 // to support http.request 12971 if (this.pathname || this.search) { 12972 var p = this.pathname || ''; 12973 var s = this.search || ''; 12974 this.path = p + s; 12975 } 12976 12977 // finally, reconstruct the href based on what has been validated. 12978 this.href = this.format(); 12979 return this; 12980}; 12981 12982// format a parsed object into a url string 12983function urlFormat(obj) { 12984 /* 12985 * ensure it's an object, and not a string url. 12986 * If it's an obj, this is a no-op. 12987 * this way, you can call url_format() on strings 12988 * to clean up potentially wonky urls. 12989 */ 12990 if (typeof obj === 'string') { obj = urlParse(obj); } 12991 if (!(obj instanceof Url)) { return Url.prototype.format.call(obj); } 12992 return obj.format(); 12993} 12994 12995Url.prototype.format = function () { 12996 var auth = this.auth || ''; 12997 if (auth) { 12998 auth = encodeURIComponent(auth); 12999 auth = auth.replace(/%3A/i, ':'); 13000 auth += '@'; 13001 } 13002 13003 var protocol = this.protocol || '', 13004 pathname = this.pathname || '', 13005 hash = this.hash || '', 13006 host = false, 13007 query = ''; 13008 13009 if (this.host) { 13010 host = auth + this.host; 13011 } else if (this.hostname) { 13012 host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); 13013 if (this.port) { 13014 host += ':' + this.port; 13015 } 13016 } 13017 13018 if (this.query && typeof this.query === 'object' && Object.keys(this.query).length) { 13019 query = querystring.stringify(this.query, { 13020 arrayFormat: 'repeat', 13021 addQueryPrefix: false 13022 }); 13023 } 13024 13025 var search = this.search || (query && ('?' + query)) || ''; 13026 13027 if (protocol && protocol.substr(-1) !== ':') { protocol += ':'; } 13028 13029 /* 13030 * only the slashedProtocols get the //. Not mailto:, xmpp:, etc. 13031 * unless they had them to begin with. 13032 */ 13033 if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { 13034 host = '//' + (host || ''); 13035 if (pathname && pathname.charAt(0) !== '/') { pathname = '/' + pathname; } 13036 } else if (!host) { 13037 host = ''; 13038 } 13039 13040 if (hash && hash.charAt(0) !== '#') { hash = '#' + hash; } 13041 if (search && search.charAt(0) !== '?') { search = '?' + search; } 13042 13043 pathname = pathname.replace(/[?#]/g, function (match) { 13044 return encodeURIComponent(match); 13045 }); 13046 search = search.replace('#', '%23'); 13047 13048 return protocol + host + pathname + search + hash; 13049}; 13050 13051function urlResolve(source, relative) { 13052 return urlParse(source, false, true).resolve(relative); 13053} 13054 13055Url.prototype.resolve = function (relative) { 13056 return this.resolveObject(urlParse(relative, false, true)).format(); 13057}; 13058 13059function urlResolveObject(source, relative) { 13060 if (!source) { return relative; } 13061 return urlParse(source, false, true).resolveObject(relative); 13062} 13063 13064Url.prototype.resolveObject = function (relative) { 13065 if (typeof relative === 'string') { 13066 var rel = new Url(); 13067 rel.parse(relative, false, true); 13068 relative = rel; 13069 } 13070 13071 var result = new Url(); 13072 var tkeys = Object.keys(this); 13073 for (var tk = 0; tk < tkeys.length; tk++) { 13074 var tkey = tkeys[tk]; 13075 result[tkey] = this[tkey]; 13076 } 13077 13078 /* 13079 * hash is always overridden, no matter what. 13080 * even href="" will remove it. 13081 */ 13082 result.hash = relative.hash; 13083 13084 // if the relative url is empty, then there's nothing left to do here. 13085 if (relative.href === '') { 13086 result.href = result.format(); 13087 return result; 13088 } 13089 13090 // hrefs like //foo/bar always cut to the protocol. 13091 if (relative.slashes && !relative.protocol) { 13092 // take everything except the protocol from relative 13093 var rkeys = Object.keys(relative); 13094 for (var rk = 0; rk < rkeys.length; rk++) { 13095 var rkey = rkeys[rk]; 13096 if (rkey !== 'protocol') { result[rkey] = relative[rkey]; } 13097 } 13098 13099 // urlParse appends trailing / to urls like http://www.example.com 13100 if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { 13101 result.pathname = '/'; 13102 result.path = result.pathname; 13103 } 13104 13105 result.href = result.format(); 13106 return result; 13107 } 13108 13109 if (relative.protocol && relative.protocol !== result.protocol) { 13110 /* 13111 * if it's a known url protocol, then changing 13112 * the protocol does weird things 13113 * first, if it's not file:, then we MUST have a host, 13114 * and if there was a path 13115 * to begin with, then we MUST have a path. 13116 * if it is file:, then the host is dropped, 13117 * because that's known to be hostless. 13118 * anything else is assumed to be absolute. 13119 */ 13120 if (!slashedProtocol[relative.protocol]) { 13121 var keys = Object.keys(relative); 13122 for (var v = 0; v < keys.length; v++) { 13123 var k = keys[v]; 13124 result[k] = relative[k]; 13125 } 13126 result.href = result.format(); 13127 return result; 13128 } 13129 13130 result.protocol = relative.protocol; 13131 if (!relative.host && !hostlessProtocol[relative.protocol]) { 13132 var relPath = (relative.pathname || '').split('/'); 13133 while (relPath.length && !(relative.host = relPath.shift())) { } 13134 if (!relative.host) { relative.host = ''; } 13135 if (!relative.hostname) { relative.hostname = ''; } 13136 if (relPath[0] !== '') { relPath.unshift(''); } 13137 if (relPath.length < 2) { relPath.unshift(''); } 13138 result.pathname = relPath.join('/'); 13139 } else { 13140 result.pathname = relative.pathname; 13141 } 13142 result.search = relative.search; 13143 result.query = relative.query; 13144 result.host = relative.host || ''; 13145 result.auth = relative.auth; 13146 result.hostname = relative.hostname || relative.host; 13147 result.port = relative.port; 13148 // to support http.request 13149 if (result.pathname || result.search) { 13150 var p = result.pathname || ''; 13151 var s = result.search || ''; 13152 result.path = p + s; 13153 } 13154 result.slashes = result.slashes || relative.slashes; 13155 result.href = result.format(); 13156 return result; 13157 } 13158 13159 var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/', 13160 isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/', 13161 mustEndAbs = isRelAbs || isSourceAbs || (result.host && relative.pathname), 13162 removeAllDots = mustEndAbs, 13163 srcPath = result.pathname && result.pathname.split('/') || [], 13164 relPath = relative.pathname && relative.pathname.split('/') || [], 13165 psychotic = result.protocol && !slashedProtocol[result.protocol]; 13166 13167 /* 13168 * if the url is a non-slashed url, then relative 13169 * links like ../.. should be able 13170 * to crawl up to the hostname, as well. This is strange. 13171 * result.protocol has already been set by now. 13172 * Later on, put the first path part into the host field. 13173 */ 13174 if (psychotic) { 13175 result.hostname = ''; 13176 result.port = null; 13177 if (result.host) { 13178 if (srcPath[0] === '') { srcPath[0] = result.host; } else { srcPath.unshift(result.host); } 13179 } 13180 result.host = ''; 13181 if (relative.protocol) { 13182 relative.hostname = null; 13183 relative.port = null; 13184 if (relative.host) { 13185 if (relPath[0] === '') { relPath[0] = relative.host; } else { relPath.unshift(relative.host); } 13186 } 13187 relative.host = null; 13188 } 13189 mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); 13190 } 13191 13192 if (isRelAbs) { 13193 // it's absolute. 13194 result.host = relative.host || relative.host === '' ? relative.host : result.host; 13195 result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname; 13196 result.search = relative.search; 13197 result.query = relative.query; 13198 srcPath = relPath; 13199 // fall through to the dot-handling below. 13200 } else if (relPath.length) { 13201 /* 13202 * it's relative 13203 * throw away the existing file, and take the new path instead. 13204 */ 13205 if (!srcPath) { srcPath = []; } 13206 srcPath.pop(); 13207 srcPath = srcPath.concat(relPath); 13208 result.search = relative.search; 13209 result.query = relative.query; 13210 } else if (relative.search != null) { 13211 /* 13212 * just pull out the search. 13213 * like href='?foo'. 13214 * Put this after the other two cases because it simplifies the booleans 13215 */ 13216 if (psychotic) { 13217 result.host = srcPath.shift(); 13218 result.hostname = result.host; 13219 /* 13220 * occationaly the auth can get stuck only in host 13221 * this especially happens in cases like 13222 * url.resolveObject('mailto:local1@domain1', 'local2@domain2') 13223 */ 13224 var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; 13225 if (authInHost) { 13226 result.auth = authInHost.shift(); 13227 result.hostname = authInHost.shift(); 13228 result.host = result.hostname; 13229 } 13230 } 13231 result.search = relative.search; 13232 result.query = relative.query; 13233 // to support http.request 13234 if (result.pathname !== null || result.search !== null) { 13235 result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); 13236 } 13237 result.href = result.format(); 13238 return result; 13239 } 13240 13241 if (!srcPath.length) { 13242 /* 13243 * no path at all. easy. 13244 * we've already handled the other stuff above. 13245 */ 13246 result.pathname = null; 13247 // to support http.request 13248 if (result.search) { 13249 result.path = '/' + result.search; 13250 } else { 13251 result.path = null; 13252 } 13253 result.href = result.format(); 13254 return result; 13255 } 13256 13257 /* 13258 * if a url ENDs in . or .., then it must get a trailing slash. 13259 * however, if it ends in anything else non-slashy, 13260 * then it must NOT get a trailing slash. 13261 */ 13262 var last = srcPath.slice(-1)[0]; 13263 var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''; 13264 13265 /* 13266 * strip single dots, resolve double dots to parent dir 13267 * if the path tries to go above the root, `up` ends up > 0 13268 */ 13269 var up = 0; 13270 for (var i = srcPath.length; i >= 0; i--) { 13271 last = srcPath[i]; 13272 if (last === '.') { 13273 srcPath.splice(i, 1); 13274 } else if (last === '..') { 13275 srcPath.splice(i, 1); 13276 up++; 13277 } else if (up) { 13278 srcPath.splice(i, 1); 13279 up--; 13280 } 13281 } 13282 13283 // if the path is allowed to go above the root, restore leading ..s 13284 if (!mustEndAbs && !removeAllDots) { 13285 for (; up--; up) { 13286 srcPath.unshift('..'); 13287 } 13288 } 13289 13290 if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { 13291 srcPath.unshift(''); 13292 } 13293 13294 if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { 13295 srcPath.push(''); 13296 } 13297 13298 var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); 13299 13300 // put the host back 13301 if (psychotic) { 13302 result.hostname = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; 13303 result.host = result.hostname; 13304 /* 13305 * occationaly the auth can get stuck only in host 13306 * this especially happens in cases like 13307 * url.resolveObject('mailto:local1@domain1', 'local2@domain2') 13308 */ 13309 var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; 13310 if (authInHost) { 13311 result.auth = authInHost.shift(); 13312 result.hostname = authInHost.shift(); 13313 result.host = result.hostname; 13314 } 13315 } 13316 13317 mustEndAbs = mustEndAbs || (result.host && srcPath.length); 13318 13319 if (mustEndAbs && !isAbsolute) { 13320 srcPath.unshift(''); 13321 } 13322 13323 if (srcPath.length > 0) { 13324 result.pathname = srcPath.join('/'); 13325 } else { 13326 result.pathname = null; 13327 result.path = null; 13328 } 13329 13330 // to support request.http 13331 if (result.pathname !== null || result.search !== null) { 13332 result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); 13333 } 13334 result.auth = relative.auth || result.auth; 13335 result.slashes = result.slashes || relative.slashes; 13336 result.href = result.format(); 13337 return result; 13338}; 13339 13340Url.prototype.parseHost = function () { 13341 var host = this.host; 13342 var port = portPattern.exec(host); 13343 if (port) { 13344 port = port[0]; 13345 if (port !== ':') { 13346 this.port = port.substr(1); 13347 } 13348 host = host.substr(0, host.length - port.length); 13349 } 13350 if (host) { this.hostname = host; } 13351}; 13352 13353exports.parse = urlParse; 13354exports.resolve = urlResolve; 13355exports.resolveObject = urlResolveObject; 13356exports.format = urlFormat; 13357 13358exports.Url = Url; 13359 13360},{"punycode/":
13360131,"qs":137}]},{},[1]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.