-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.js
1 lines (1 loc) · 48.4 KB
/
bundle.js
1
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(10),i(n(1)),i(n(12));var r=i(n(13));function i(t){return t&&t.__esModule?t:{default:t}}var o=null,a=null,c=null,u=null,l=null,s=null,f=null,d=null,p="Sun Nov 19",h="Sat Nov 25",g="NYC",v="LAX",y=null,m=null,b="Fall19",w=d3.select("#flights"),k=w.select(".graphic-wrapper"),x=k.select(".flights-chart"),A=(w.select(".date-selection-check").select("input"),w.select(".city-block-destination")),_=A.selectAll(".city-details"),M=A.select(".city-prompt"),P=w.selectAll(".chart-cta-link"),D=null,E=null,C=null,L=null;function j(t){t.preventDefault();var e=d3.select(this).attr("href");return trackOutboundLink(e,"flights"),!1}function S(t){var e=d3.timeParse("%a %b %d"),n=d3.timeFormat("%B"),r="December Holidays"===y&&"December"===n(e(t))?m-1:m;return d3.timeFormat(r+"-%m-%d")(e(t))}function O(){var t=d3.map(d,function(t){return t.code}),e=t.get(g).link,n=t.get(v).link,r=S(p),i=S(h);!0==new Date(r)<new Date?P.classed("is-hidden",!0):P.classed("is-hidden",!1);var o="https://google.com/flights?source="+b+"#flt="+e+"."+n+"."+r+"*"+n+"."+e+"."+i;P.attr("href",o).attr("target","_blank"),P.node().addEventListener("click",j)}function F(t){var e=k.select(".city-block-"+t),n=d3.select("#holiday-select").node(),i=(n.options[n.selectedIndex].value,null),o=null;"origin"==t&&(i=g,o="assets/images/"+l.get(i).name.replace(/\s/g,"")+"-color.png",(0,r.default)(o,function(t,e){t?(d3.selectAll(".city-connector").classed("no-img",!0),d3.selectAll(".city-img-wrapper").classed("is-hidden",!0)):(d3.selectAll(".city-connector").classed("no-img",!1),d3.selectAll(".city-img-wrapper").classed("is-hidden",!1))})),"destination"==t&&(i=v,o="assets/images/"+l.get(i).name.replace(/\s/g,"")+"-color.png",C(a),E(p,h)),e.select(".city-code").text(i),e.select(".city-name").text(l.get(i).name),e.select(".city-lines").attr("src",o)}function H(){var t=k.select(".destination-dropdown");t.selectAll("option").remove(),t.selectAll("option").data(function(t){var e=d3.nest().key(function(t){return t.destination}).entries(c).map(function(t){return t.key});return e.unshift("Destination City"),e}).enter().append("option").attr("value",function(t){return t}).text(function(t){return t}).each(function(t){"Destination City"===t&&d3.select(this).property("disabled",!0)}).property("selected",function(t){return"Destination City"===v?t===v:t===l.get(v).name}),t.on("change",function(t){var e=this.value;v=u.get(e).code,M.classed("is-active",!1),_.classed("is-active",!0),a=o.filter(function(t){return t.originCode==g&&t.destinationCode==v}),F("destination"),d3.select(".flights-chart").classed("hidden",!1),O()})}e.default={init:function(){},resize:function(){L()},setupHolidayFlights:function(t,e,n,r,i){d3.select("#flights").classed("not-loaded",!1),d3.select(".not-loaded-text").remove(),o=t,y=e;var b=n;!function(t){t=t,u=d3.map(t,function(t){return t.name}),l=d3.map(t,function(t){return t.code})}(r),d=i;var w=b.filter(function(t){return t.holiday==y});p=w[0].dep,h=w[0].ret,m=w[0].year,f=d3.nest().key(function(t){return t.originCode}).key(function(t){return t.destinationCode}).entries(o),g=f[0].key,v=f[0].values[0].key,c=o.filter(function(t){return t.originCode==g}),a=o.filter(function(t){return t.originCode==g&&t.destinationCode==v}),C||(D=x.datum(a).flightChart(),_.classed("is-active",!0),E=D.highlight,C=D.data,D.median,L=D.resize),function(){var t=k.select(".origin-dropdown");t.selectAll("option").remove(),t.selectAll("option").data(function(t){var e=d3.nest().key(function(t){return t.origin}).entries(o).map(function(t){return t.key});return e.unshift("Origin City"),e}).enter().append("option").attr("value",function(t){return t}).text(function(t){return t}).each(function(t){"Origin City"===t&&d3.select(this).property("disabled",!0)}).property("selected",function(t){return t===l.get(g).name}),t.on("change",function(t){g=u.get(this.value).code,M.classed("is-active",!0),_.classed("is-active",!1),v="Destination City",c=o.filter(function(t){return t.originCode==g}),H(),d3.select(".flights-chart").classed("hidden",!0),F("origin")})}(),H(),function(){var t=k.select(".originDate-dropdown"),e=d3.nest().key(function(t){return t.destinationCode}).entries(c);s=d3.nest().key(function(t){return t.depDate}).key(function(t){return t.retDate}).entries(e[0].values),t.selectAll("option").remove(),t.selectAll("option").data(function(t){return s.map(function(t){return t.key}).filter(function(t){return"median"!=t})}).enter().append("option").attr("value",function(t){return t}).text(function(t){return t}),t.on("change",function(t){d3.select(this),p=this.value,function(){var t=k.select(".returnDate-dropdown"),e=s.filter(function(t){return t.key===p})[0].values;t.selectAll("option").data(function(t){return e.map(function(t){return t.key})}).enter().append("option").attr("value",function(t){return t}).text(function(t){return t})}(),E(p,h),O()});var n=k.select(".returnDate-dropdown"),r=s.filter(function(t){return t.key===p})[0].values;n.selectAll("option").remove(),n.selectAll("option").data(function(t){var e=r.map(function(t){return t.key}).map(function(t){return t.concat(" "+(m-1))}),n=d3.timeParse("%a %b %d %Y"),i=e.map(function(t){return n(t)}).sort(function(t,e){return t-e}),o=d3.timeFormat("%a %b %d");return i.map(function(t){return o(t)})}).enter().append("option").attr("value",function(t){return t}).text(function(t){return t}),n.on("change",function(t){h=this.value,E(p,h),O()})}(),F("origin"),"Destination City"!=v&&(F("destination"),O())}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i=c(n(0)),o=c(n(2)),a=c(n(3));function c(t){return t&&t.__esModule?t:{default:t}}var u=d3.select("#holiday-select"),l=d3.selectAll(".holiday-span"),s=d3.select(".dataYear"),f=(d3.selectAll("#content"),d3.select("#holiday-select").node(),null),d=null,p=null,h=null,g=null,v=null,y=null,m=null,b=null,w=d3.timeParse("%y-%m-%d"),k=d3.timeFormat("%a %b %d"),x=null;function A(){return new Promise(function(t,e){var n="assets/data/flights-"+g.get(x).abb+".csv";d3.loadData(n,function(n,o){n&&e(n),d=o[0].map(function(t){return r({},t,{origin:p.get(t.origin).name,originCode:p.get(t.origin).code,originAirports:p.get(t.origin).airport,destination:p.get(t.destination).name,destinationCode:p.get(t.destination).code,destinationAirport:p.get(t.destination).airport,depDate:k(w(h.get(t.departureDate).date)),retDate:k(w(h.get(t.returnDate).date)),price:10*+t.price,daysBeforeDeparture:+t.daysBeforeDeparture,origHoliday:t.holiday,holiday:v.get(t.holiday).holiday,dateRange:k(w(h.get(t.departureDate).date))+" - "+k(w(h.get(t.returnDate).date))})}),i.default.setupHolidayFlights(d,x,m,f,b),t()})})}function _(t){console.error(t)}function M(t){!function(t){f=t[0],p=d3.map(f,function(t){return t.value}),y=t[1],h=d3.map(y,function(t){return t.value}),m=t[2],g=d3.map(m,function(t){return t.holiday}),v=d3.map(m,function(t){return t.abb}),b=t[3]}(t),function(){var t=new Date,e=m.map(function(e){var n=new Date(e.checkin),r=d3.timeDay.count(t,n);return{holiday:e.holiday,difDate:r}}).sort(function(t,e){return d3.ascending(t.difDate,e.difDate)}).filter(function(t){return t.difDate>=0});x=e[0].holiday,u.selectAll("option").data(function(t){var e=m.map(function(t){return t.holiday});return e.unshift("2020"),e.splice(2,0,"2019"),e}).enter().append("option").attr("value",function(t){return t}).text(function(t){return t}).property("selected",function(t){return t==x}).each(function(t){"2019"!==t&&"2020"!==t||d3.select(this).property("disabled",!0)}),u.on("change",function(t){x=this.value,a.default.setupHoliday(x),A(),l.text(x),o.default.setupHolidayHotels(x,m);var e=m.filter(function(t){return t.holiday==x})[0].year-1;s.text(e)})}(),l.text(x),a.default.setupHoliday(x)}e.default={init:function(){return new Promise(function(t,e){new Promise(function(t,e){d3.loadData("assets/data/flightsDictionary.csv","assets/data/dateDictionary.csv","assets/data/holidayDetails.json","assets/data/airportLinks.json",function(n,r){n?e(n):t(r)})}).then(M).then(A).then(t).catch(_)})},resize:function(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(11);var r=null,i=null,o=null,a=["assets/data/hotelsData.csv","assets/data/POI.csv","assets/data/hotelNamesData.csv","assets/data/holidayDetails.json","assets/data/cityLinks.json"],c=null,u=null,l=(d3.select("#hotels"),d3.select(".city-table"));function s(){var t=r[0],e=r[1],n=r[2];u=r[3];var o=r[4];null==i&&function(t){var e=new Date,n=u.map(function(t){var n=new Date(t.checkin),r=d3.timeDay.count(e,n);return{holiday:t.holiday,difDate:r}}).sort(function(t,e){return d3.ascending(t.difDate,e.difDate)}).filter(function(t){return t.difDate>=0});i=n[0].holiday}();var a=t.filter(function(t){return t.holiday===i}),l=d3.nest().key(function(t){return t.city}).entries(a).map(function(t){return t.key}),s=e.filter(function(t){var e;return e="Washington"==t.dest_name?"Washington DC":t.dest_name,l.includes(e)}),f=d3.nest().key(function(t){return t.city}).entries(a).map(function(t){return t.key}),d=n.filter(function(t){var e;return e="Washington"==t.dest_name?"Washington DC":t.dest_name,t.holiday==i&&f.includes(e)});c=[a,s,d,u,o,i]}d3.select("#holiday-select"),e.default={init:function(){return new Promise(function(t){new Promise(function(t,e){var n;(n=d3).loadData.apply(n,a.concat([function(n,i){n?e(n):t(i),r=i}]))}).then(function(e){!function(){d3.select("#hotels").classed("not-loaded",!1),s();var t=l.datum(c).hotelsMap();o=t.data}(),t()})})},resize:function(){},setupHolidayHotels:function(t,e){i=t,s(),c.pop(),o(c,i)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=[],i=d3.selectAll(".trending__graphic").selectAll(".container__city"),o=d3.selectAll("#trending"),a="Fall19",c=o.selectAll(".dropdown-wrapper .select-wrapper"),u=o.selectAll(".select-text"),l=o.selectAll(".select-us"),s=o.selectAll(".select-can"),f=o.selectAll(".trending-dropdown"),d="United States",p=null;function h(t){if(p.length>0){var e=p.filter(function(e){return e.CountryFilter===t});o.classed("is-visible",!0),i.each(function(t,n,r){d3.select(r[n]).select(".city-name").text(e[n].City),d3.select(r[n]).select(".city-circle").attr("src",function(t){return"assets/images/"+e[n].City.replace(/\s/g,"")+"-circles.png"});var i=d3.select(r[n]).select(".city-guide-link");i.attr("href",e[n].Link+"&dest_src="+a),i.attr("target","_blank"),i.node().addEventListener("click",function(t){!function(t,e,n){t.preventDefault();var r=n.attr("href");trackOutboundLink(r,"cityGuide")}(t,0,d3.select(this))})})}else o.classed("is-visible",!1)}e.default={init:function(){return new Promise(function(t){d3.loadData("assets/data/trending.csv",function(e,n){r=n[0],t()})})},resize:function(){},setupHoliday:function(t){p=r.filter(function(e){return e.Holiday==t}),"Memorial Day"==t||"Fourth of July"==t||"Labor Day"==t||"Thanksgiving"==t?(c.classed("is-hidden",!0),u.classed("is-hidden",!0),s.classed("is-hidden",!0),l.classed("is-hidden",!1)):"Canadian Thanksgiving"==t?(c.classed("is-hidden",!0),u.classed("is-hidden",!0),s.classed("is-hidden",!1),l.classed("is-hidden",!0)):(c.classed("is-hidden",!1),u.classed("is-hidden",!1),s.classed("is-hidden",!0),l.classed("is-hidden",!0)),d="Lunar New Year"===t?"China":"Canadian Thanksgiving"===t?"Canada":"United States",function(){var t=d3.nest().key(function(t){return t.CountryFilter}).sortKeys(d3.ascending).entries(p);f.selectAll("option").remove(),f.selectAll("option").data(t).enter().append("option").attr("value",function(t){return t.key}).text(function(t){return t.key}).property("selected",function(t){return"United States"===t.key}),f.on("change",function(t){h(d=this.value)})}(),h(d)}}},function(t,e,n){"use strict";var r=s(n(5)),i=s(n(7)),o=s(n(8)),a=s(n(0)),c=s(n(2)),u=s(n(1)),l=s(n(3));function s(t){return t&&t.__esModule?t:{default:t}}var f=d3.select("body"),d=0;f.classed("is-mobile",i.default.any()),window.addEventListener("resize",(0,r.default)(function(){var t=f.node().offsetWidth;d!==t&&(d=t,o.default.resize(),a.default.resize())},150)),l.default.init(),u.default.init().then(c.default.init),o.default.init()},function(t,e,n){(function(e){var n=NaN,r="[object Symbol]",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt,l="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,f=l||s||Function("return this")(),d=Object.prototype.toString,p=Math.max,h=Math.min,g=function(){return f.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&d.call(t)==r}(t))return n;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(i,"");var l=a.test(t);return l||c.test(t)?u(t.slice(2),l?2:8):o.test(t)?n:+t}t.exports=function(t,e,n){var r,i,o,a,c,u,l=0,s=!1,f=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=r,o=i;return r=i=void 0,l=e,a=t.apply(o,n)}function b(t){var n=t-u;return void 0===u||n>=e||n<0||f&&t-l>=o}function w(){var t=g();if(b(t))return k(t);c=setTimeout(w,function(t){var n=e-(t-u);return f?h(n,o-(t-l)):n}(t))}function k(t){return c=void 0,d&&r?m(t):(r=i=void 0,a)}function x(){var t=g(),n=b(t);if(r=arguments,i=this,u=t,n){if(void 0===c)return function(t){return l=t,c=setTimeout(w,e),s?m(t):a}(u);if(f)return c=setTimeout(w,e),m(u)}return void 0===c&&(c=setTimeout(w,e)),a}return e=y(e)||0,v(n)&&(s=!!n.leading,o=(f="maxWait"in n)?p(y(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),x.cancel=function(){void 0!==c&&clearTimeout(c),l=0,r=u=i=c=void 0},x.flush=function(){return void 0===c?a:k(g())},x}}).call(this,n(6))},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={android:function(){return navigator.userAgent.match(/Android/i)},blackberry:function(){return navigator.userAgent.match(/BlackBerry/i)},ios:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},opera:function(){return navigator.userAgent.match(/Opera Mini/i)},windows:function(){return navigator.userAgent.match(/IEMobile/i)},any:function(){return r.android()||r.blackberry()||r.ios()||r.opera()||r.windows()}};e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){return t&&t.__esModule?t:{default:t}}(n(9)),i=d3.select(".dropdown-sticky-outer"),o=d3.select(".type-button-flights"),a=d3.select(".type-button-hotels"),c=d3.select(".type-button-trending");e.default={init:function(){(0,r.default)({selector:"#dropdown-sticky",offset:1,enter:function(){i.classed("is-fixed",!0)},exit:function(){i.classed("is-fixed",!1)}}),(0,r.default)({selector:"#flights",offset:.9,enter:function(){c.classed("is-active",!1),o.classed("is-active",!0)},exit:function(){c.classed("is-active",!0),o.classed("is-active",!1)}}),(0,r.default)({selector:"#hotels",offset:.9,enter:function(){a.classed("is-active",!0),o.classed("is-active",!1)},exit:function(){c.classed("is-active",!1),o.classed("is-active",!0),a.classed("is-active",!1)}}),(0,r.default)({selector:"#trending",offset:.9,enter:function(){c.classed("is-active",!0),o.classed("is-active",!1),a.classed("is-active",!1)},exit:function(){c.classed("is-active",!0),o.classed("is-active",!1),a.classed("is-active",!1)}})},resize:function(){}}},function(t,e,n){"use strict";var r,i;void 0===(i="function"==typeof(r=function(){return function(t){function e(){p=!1;var t=function(){if(l&&"number"==typeof l){var t=Math.min(Math.max(0,l),1);return g-t*g}return g}();(h=h.filter(function(e){var n=e.getBoundingClientRect().top<t;if(n&&!e.__enter_view){if(a(e),f)return!1}else!n&&e.__enter_view&&c&&c(e);return e.__enter_view=n,!0})).length||window.removeEventListener("scroll",n,!0)}function n(){p||(p=!0,d(e))}function r(){(function(){var t=document.documentElement.clientHeight,e=window.innerHeight||0;g=Math.max(t,e)})(),e()}function i(t){for(var e=t.length,n=[],r=0;r<e;r+=1)n.push(t[r]);return n}var o=t.selector,a=t.enter,c=t.exit,u=t.offset,l=void 0===u?0:u,s=t.once,f=void 0!==s&&s,d=null,p=!1,h=[],g=0;o&&a||console.error("must set selector and enter options"),d=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,1e3/60)},h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return"string"==typeof t?i(e.querySelectorAll(t)):t instanceof NodeList?i(t):t instanceof Array?t:void 0}(o),window.addEventListener("resize",r,!0),window.addEventListener("scroll",n,!0),r(),e()}})?r.call(e,n,e,t):r)||(t.exports=i)},function(t,e,n){"use strict";d3.selection.prototype.flightChart=function(t){var e=this.nodes().map(function(t){var e=d3.select(t),n=e.datum(),r=null,i=0,o=0,a=null,c=null,u=null,l=d3.scaleLinear(),s=null,f=d3.scaleLinear(),d=null,p=null,h=null,g=null;function v(){var t=(r=d3.nest().key(function(t){return t.dateRange}).sortValues(function(t,e){return t.daysBeforeDeparture-e.daysBeforeDeparture}).entries(n)).map(function(t){var e=t.values.map(function(t){return t.daysBeforeDeparture});return d3.max(e,function(t){return t})});a=d3.min(t,function(t){return t});var e=d3.max(n,function(t){return t.price});l=d3.scaleLinear().domain([a,0]).range([0,i]).clamp(!0);var c=.15*e;f=d3.scaleLinear().domain([0,e+c]).range([o,0]),s=d3.axisBottom(l).tickPadding(8).ticks(10),d=d3.axisLeft(f).tickPadding(8).tickSize(-i).ticks(8).tickFormat(function(t){return"$"+t})}function y(t){var e=d3.selectAll(".cat-path.path-highlight").data()[0].values,n=d3.bisector(function(t){return t.daysBeforeDeparture}).left,r=l.invert(d3.mouse(this)[0]),i=n(e,r,1),o=e[i-1],c=e[i],u=r-o.daysBeforeDeparture>c.daysBeforeDeparture-r?c:o,s=l(u.daysBeforeDeparture),d=f(u.price);g.attr("transform","translate("+s+", "+d+")"),g.selectAll(".tooltip-price, .tooltip-price-bg").text("Minimum: $"+u.price).attr("text-anchor",function(t){return u.daysBeforeDeparture>=a-20?"start":u.daysBeforeDeparture<=20?"end":"middle"}),g.selectAll(".tooltip-days, .tooltip-days-bg").text(u.daysBeforeDeparture+" Days Before Departure").attr("text-anchor",function(t){return u.daysBeforeDeparture>=a-20?"start":u.daysBeforeDeparture<=20?"end":"middle"})}var m={init:function(){c=e.append("svg"),u=c.append("g.g-axis");var t=c.append("g");t.at("transform","translate(0, 10)"),u.append("g").attr("class","x axis").at("transform","translate(45,"+o+")"),u.append("g").attr("class","y axis").selectAll("g").classed("g-baseline",function(t){return 0==t}),t.append("g.g-vis"),m.resize(),m.render()},resize:function(){return i=e.node().offsetWidth-45-5,o=e.node().offsetHeight-10-50,h=o,v(),p=d3.line().x(function(t){return l(t.daysBeforeDeparture)}).y(function(t){return f(t.price)}),u.select(".x").at("transform","translate(45,"+h+")").call(s),u.select(".y").call(d).at("transform","translate(45, 10)"),c.at({width:i+45+5,height:o+10+50}),c.select(".g-vis").selectAll(".cat-path, .cat-path-median").size()>0&&m.updateSize(),m},render:function(){var t=c.select(".g-vis").attr("transform","translate(45, 0)");return t.selectAll(".cat-path, .cat-path-median").remove(),t.selectAll(".cat-path").data(r).enter().append("path").attr("class",function(t){return"median"==t.key?"cat-path-median":"cat-path"}).attr("data-range",function(t){return t.key}),(g=t.append("g").attr("class","tooltip").style("display","none")).append("circle").attr("r",4).attr("tooltip-circle"),g.append("text").attr("class","tooltip-price-bg").attr("dy","-12px"),g.append("text").attr("class","tooltip-days-bg").attr("dy","-29px"),g.append("text").attr("class","tooltip-price").attr("dy","-12px"),g.append("text").attr("class","tooltip-days").attr("dy","-29px"),t.selectAll(".overlay").remove(),t.append("rect").attr("width",i).attr("height",o).attr("class","overlay").on("mouseover",function(){return g.style("display",null)}).on("mouseout",function(){return g.style("display","none")}).on("mousemove touchstart",y),m.updateSize(),m},updateSize:function(){c.select(".g-vis").selectAll(".cat-path, .cat-path-median").attr("d",function(t){return p(t.values)})},data:function(t){return arguments.length?(n=t,e.datum(n),v(),u.select(".y").transition().duration(500).call(d),u.select(".x").transition().duration(500).call(s),m.render(),m):n},highlight:function(t,e){var n=c.select(".g-vis").selectAll(".cat-path");n.classed("path-highlight",!1),n.filter(function(n){return n.key==t+" - "+e}).classed("path-highlight",!0).raise(),g.raise()},median:function(){var t=c.select(".g-vis").selectAll(".cat-path-median");t.classed("is-active",!t.classed("is-active"))}};return m.init(),m});return e.length>1?e:e.pop()}},function(t,e,n){"use strict";!function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(14)),d3.selection.prototype.hotelsMap=function(t){var e=this.nodes().map(function(t){var e=d3.select("#hotels"),n=d3.select(t),r=n.datum(),i=r[0],o=r[1],a=r[2],c=r[3],u=r[4],l=r[5],s="Chicago",f=d3.map(c,function(t){return t.holiday}),d="Fall19";function p(t,e,n){t.preventDefault();var r=n.attr("href");return trackOutboundLink(r,e),!1}function h(t){s=t.city,d3.selectAll(".row").classed("highlighted",!1),d3.selectAll(".row-"+t.city.replace(/\s/g,"").replace(/'/g,"")).classed("highlighted",!0),d3.selectAll(".individHotel").classed("is-active",function(e){var n;return n="Washington DC"==t.city?"Washington":t.city,e.dest_name==n}),d3.selectAll(".individHotel.is-active").selectAll("img").attr("src",function(t){return t.photo_url}),d3.selectAll(".attraction, .attraction-link").classed("is-active",function(e){var n;return n="Washington DC"==t.city?"Washington":t.city,e.dest_name==n}),d3.selectAll(".attraction.is-active").selectAll("img").attr("src",function(t){return t.poi_img_url}),d3.selectAll("span.location").text(function(e){return t.city}),g()}function g(){var t=e.select(".hotels-cta"),n=d3.map(u,function(t){return t.code}),r=n.get(s).link,o=n.get(s).key,a=f.get(l).checkin,c=f.get(l).checkout;s=i[0].city;var h=i.filter(function(t){return t.city===s}),g=null;h[0].link&&(g=h[0].link),t.attr("href",function(t){return null!=g?g:"https://search.google.com/local/places/hotel/categorical?q="+r+"+hotels&hotel_dates="+a+","+c+"&hotel_mode=1&utm_source=marketing&utm_campaign="+d}).attr("target","_blank"),t.node().addEventListener("click",function(t){p(t,"hotels",d3.select(this))}),t.selectAll(".cityName").text(s);var v=e.select(".activities-cta");v.attr("href","https://www.google.com/destination/map/topsights?q=things+to+do+in+"+r+"&site=search&output=search&dest_mid="+o+"&sa&dest_src="+d).attr("target","_blank"),v.selectAll(".cityName").text(s),v.node().addEventListener("click",function(t){p(t,"POI",d3.select(this))})}var v={init:function(){g(),v.resize(),v.render()},resize:function(){return v},render:function(){var t=f.get(l).checkin,e=f.get(l).checkout,n=d3.select(".city-table");n.selectAll(".row").remove();var r=n.selectAll(".row").data(i).enter().append("div").attr("class",function(t){return"row row-"+t.city.replace(/\s/g,"").replace(/'/g,"")}).on("mouseover",h);r.append("p").attr("class","rank").text(function(t){return t.rank}),r.append("p").attr("class","city-name").text(function(t){return t.city}),r.append("p").attr("class","hotel-price").text(function(t){return"$"+t.price}),r.append("p").attr("class","hotel-savings").text(function(t){return(100*t.holidaySavings).toFixed(0)+"%"});var c=d3.select(".hotel-list");c.selectAll(".individHotel, .hotel-link").remove();var u=c.selectAll(".hotel-link").data(a).enter().append("a").attr("target","_blank").attr("class","hotel-link").attr("href",function(n){return n.link?n.link:"https://search.google.com/local/places/hotel/categorical?q="+n.hotel_name.replace(/\s/g,"+").toLowerCase()+"&hotel_dates="+t+","+e+"&hotel_mode=1&utm_source=marketing&utm_campaign=HD19"}).selectAll(".individHotel").data(function(t){return[t]}).enter().append("div").attr("class",function(t){return"individHotel individHotel-"+t.dest_name.replace(/\s/g,"")});u.append("div").attr("class","imgHotel-wrapper").append("img").attr("data-src",function(t){return t.photo_url}).attr("class","hotel-img");var d=u.append("div").attr("class","descHotel");d3.select("#holiday-select").node(),d.append("div").attr("class",function(t){return"star-img-"+t.stars}),d.append("h5").text(function(t){return t.hotel_name}),d.append("p").text(function(t){return t.description.substring(0,97)+"..."});var p=d3.select(".things-to-do");p.selectAll(".attraction, .attraction-link").remove();var y=p.selectAll(".attraction-link").data(o).enter().append("a").attr("target","_blank").attr("class",function(t){return"attraction-link attraction-link-"+t.dest_name.replace(/\s/g,"")}).attr("href",function(t){return"https://google.com/search?q="+t.poi_name.replace(/\s/g,"+").toLowerCase()+"&utm_source=marketing&utm_campaign=Holiday2018"}).selectAll(".attraction").data(function(t){return[t]}).enter().append("div").attr("class",function(t){return"attraction attraction-"+t.dest_name.replace(/\s/g,"")}).attr("data-search",function(t){return t.poi_name.replace(/\s/g,"+").toLowerCase()});y.append("div").attr("class","img-wrapper").append("img").attr("data-src",function(t){return t.poi_img_url}).attr("class","attr-img");var m=y.append("div").attr("class","desc");return m.append("h5").text(function(t){return t.poi_name}),m.append("p").text(function(t){return t.poi_medium_description}),function(){var t=f.get(l).defaultCity;s=t;var e=t.replace(/\s/g,"");d3.selectAll(".individHotel-"+e+", .attraction-"+e+", .attraction-link-"+e).classed("is-active",!0),d3.selectAll(".individHotel.is-active").selectAll("img").attr("src",function(t){return t.photo_url}),d3.selectAll(".attraction.is-active").selectAll("img").attr("src",function(t){return t.poi_img_url}),d3.select(".row-"+e).classed("highlighted",!0),d3.selectAll("span.location").text(function(e){return t})}(),g(),v},updateSize:function(){},data:function(t,e){return arguments.length?(r=t,n.datum(t),l=e,i=t[0],o=t[1],a=t[2],i.map(function(t){return{0:+t.longitude,1:+t.latitude}}),v.render(),v):r}};return v.init(),v});return e.length>1?e:e.pop()}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=window.location.hostname.indexOf("localhost")>-1,i={};e.default={send:function(t){var e=t.category,n=t.action,o=t.once;(function(t){var e=t.action;if(t.once){var n=""+t.category.toString().replace(/\W+/g,"")+e.toString().replace(/\W+/g,"");return!i[n]&&(i[n]=!0,!0)}return!0})({category:e,action:n,once:o})&&(r?console.log({category:e,action:n,once:o}):window.ga&&ga("send",{hitType:"event",eventCategory:e.toString(),eventAction:n.toString()}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=new Image;n.onload=function(){return e(null,n)},n.onerror=function(){return e("error loading image: "+t)},n.src=t}},function(t,e,n){"use strict";n.r(e);var r=function(t){return t},i=function(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],c=t.translate[1];return function(t,r){r||(e=n=0);var u=2,l=t.length,s=new Array(l);for(s[0]=(e+=t[0])*i+a,s[1]=(n+=t[1])*o+c;u<l;)s[u]=t[u],++u;return s}},o=function(t){var e,n=i(t.transform),r=1/0,o=r,a=-r,c=-r;function u(t){(t=n(t))[0]<r&&(r=t[0]),t[0]>a&&(a=t[0]),t[1]<o&&(o=t[1]),t[1]>c&&(c=t[1])}function l(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(l);break;case"Point":u(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(u)}}for(e in t.arcs.forEach(function(t){for(var e,i=-1,u=t.length;++i<u;)(e=n(t[i],i))[0]<r&&(r=e[0]),e[0]>a&&(a=e[0]),e[1]<o&&(o=e[1]),e[1]>c&&(c=e[1])}),t.objects)l(t.objects[e]);return[r,o,a,c]},a=function(t,e){for(var n,r=t.length,i=r-e;i<--r;)n=t[i],t[i++]=t[r],t[r]=n},c=function(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return u(t,e)})}:u(t,e)};function u(t,e){var n=e.id,r=e.bbox,i=null==e.properties?{}:e.properties,o=l(t,e);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}function l(t,e){var n=i(t.transform),r=t.arcs;function o(t,e){e.length&&e.pop();for(var i=r[t<0?~t:t],o=0,c=i.length;o<c;++o)e.push(n(i[o],o));t<0&&a(e,c)}function c(t){return n(t)}function u(t){for(var e=[],n=0,r=t.length;n<r;++n)o(t[n],e);return e.length<2&&e.push(e[0]),e}function l(t){for(var e=u(t);e.length<4;)e.push(e[0]);return e}function s(t){return t.map(l)}return function t(e){var n,r=e.type;switch(r){case"GeometryCollection":return{type:r,geometries:e.geometries.map(t)};case"Point":n=c(e.coordinates);break;case"MultiPoint":n=e.coordinates.map(c);break;case"LineString":n=u(e.arcs);break;case"MultiLineString":n=e.arcs.map(u);break;case"Polygon":n=s(e.arcs);break;case"MultiPolygon":n=e.arcs.map(s);break;default:return null}return{type:r,coordinates:n}}(e)}var s=function(t,e){var n={},r={},i={},o=[],a=-1;function c(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}return e.forEach(function(n,r){var i,o=t.arcs[n<0?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=e[++a],e[a]=n,e[r]=i)}),e.forEach(function(e){var n,o,a=function(e){var n,r=t.arcs[e<0?~e:e],i=r[0];return t.transform?(n=[0,0],r.forEach(function(t){n[0]+=t[0],n[1]+=t[1]})):n=r[r.length-1],e<0?[n,i]:[i,n]}(e),c=a[0],u=a[1];if(n=i[c])if(delete i[n.end],n.push(e),n.end=u,o=r[u]){delete r[o.start];var l=o===n?n:n.concat(o);r[l.start=n.start]=i[l.end=o.end]=l}else r[n.start]=i[n.end]=n;else if(n=r[u])if(delete r[n.start],n.unshift(e),n.start=c,o=i[c]){delete i[o.end];var s=o===n?n:o.concat(n);r[s.start=o.start]=i[s.end=n.end]=s}else r[n.start]=i[n.end]=n;else r[(n=[e]).start=c]=i[n.end=u]=n}),c(i,r),c(r,i),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},f=function(t){return l(t,d.apply(this,arguments))};function d(t,e,n){var r,i,o;if(arguments.length>1)r=function(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function c(t){t.forEach(a)}function u(t){t.forEach(c)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":c(e.arcs);break;case"MultiLineString":case"Polygon":u(e.arcs);break;case"MultiPolygon":e.arcs.forEach(u)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(o=t.arcs.length);i<o;++i)r[i]=i;return{type:"MultiLineString",arcs:s(t,r)}}var p=function(t){return l(t,h.apply(this,arguments))};function h(t,e){var n={},r=[],i=[];function o(t){t.forEach(function(e){e.forEach(function(e){(n[e=e<0?~e:e]||(n[e]=[])).push(t)})}),r.push(t)}function a(e){return function(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)}(l(t,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function t(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"Polygon":o(e.arcs);break;case"MultiPolygon":e.arcs.forEach(o)}}),r.forEach(function(t){if(!t._){var e=[],r=[t];for(t._=1,i.push(e);t=r.pop();)e.push(t),t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].forEach(function(t){t._||(t._=1,r.push(t))})})})}}),r.forEach(function(t){delete t._}),{type:"MultiPolygon",arcs:i.map(function(e){var r,i=[];if(e.forEach(function(t){t.forEach(function(t){t.forEach(function(t){n[t<0?~t:t].length<2&&i.push(t)})})}),(r=(i=s(t,i)).length)>1)for(var o,c,u=1,l=a(i[0]);u<r;++u)(o=a(i[u]))>l&&(c=i[0],i[0]=i[u],i[u]=c,l=o);return i})}}var g=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;t[i]<e?n=i+1:r=i}return n},v=function(t){var e={},n=t.map(function(){return[]});function r(t,n){t.forEach(function(t){t<0&&(t=~t);var r=e[t];r?r.push(n):e[t]=[n]})}function i(t,e){t.forEach(function(t){r(t,e)})}var o={LineString:r,MultiLineString:i,Polygon:i,MultiPolygon:function(t,e){t.forEach(function(t){i(t,e)})}};for(var a in t.forEach(function t(e,n){"GeometryCollection"===e.type?e.geometries.forEach(function(e){t(e,n)}):e.type in o&&o[e.type](e.arcs,n)}),e)for(var c=e[a],u=c.length,l=0;l<u;++l)for(var s=l+1;s<u;++s){var f,d=c[l],p=c[s];(f=n[d])[a=g(f,p)]!==p&&f.splice(a,0,p),(f=n[p])[a=g(f,d)]!==d&&f.splice(a,0,d)}return n},y=function(t){if(null==t)return r;var e,n,i=t.scale[0],o=t.scale[1],a=t.translate[0],c=t.translate[1];return function(t,r){r||(e=n=0);var u=2,l=t.length,s=new Array(l),f=Math.round((t[0]-a)/i),d=Math.round((t[1]-c)/o);for(s[0]=f-e,e=f,s[1]=d-n,n=d;u<l;)s[u]=t[u],++u;return s}},m=function(t,e){if(t.transform)throw new Error("already quantized");if(e&&e.scale)u=t.bbox;else{if(!((n=Math.floor(e))>=2))throw new Error("n must be ≥2");var n,r=(u=t.bbox||o(t))[0],i=u[1],a=u[2],c=u[3];e={scale:[a-r?(a-r)/(n-1):1,c-i?(c-i)/(n-1):1],translate:[r,i]}}var u,l,s=y(e),f=t.objects,d={};function p(t){return s(t)}function h(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(h)};break;case"Point":e={type:"Point",coordinates:p(t.coordinates)};break;case"MultiPoint":e={type:"MultiPoint",coordinates:t.coordinates.map(p)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}for(l in f)d[l]=h(f[l]);return{type:"Topology",bbox:u,transform:e,objects:d,arcs:t.arcs.map(function(t){var e,n=0,r=1,i=t.length,o=new Array(i);for(o[0]=s(t[0],0);++n<i;)((e=s(t[n],n))[0]||e[1])&&(o[r++]=e);return 1===r&&(o[r++]=[0,0]),o.length=r,o})}},b=function(t,e,n,r,i,o){3===arguments.length&&(r=o=Array,i=null);for(var a=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),c=new o(t),u=t-1,l=0;l<t;++l)a[l]=i;return{set:function(r,o){for(var l=e(r)&u,s=a[l],f=0;s!=i;){if(n(s,r))return c[l]=o;if(++f>=t)throw new Error("full hashmap");s=a[l=l+1&u]}return a[l]=r,c[l]=o,o},maybeSet:function(r,o){for(var l=e(r)&u,s=a[l],f=0;s!=i;){if(n(s,r))return c[l];if(++f>=t)throw new Error("full hashmap");s=a[l=l+1&u]}return a[l]=r,c[l]=o,o},get:function(r,o){for(var l=e(r)&u,s=a[l],f=0;s!=i;){if(n(s,r))return c[l];if(++f>=t)break;s=a[l=l+1&u]}return o},keys:function(){for(var t=[],e=0,n=a.length;e<n;++e){var r=a[e];r!=i&&t.push(r)}return t}}},w=function(t,e){return t[0]===e[0]&&t[1]===e[1]},k=new ArrayBuffer(16),x=new Float64Array(k),A=new Uint32Array(k),_=function(t){x[0]=t[0],x[1]=t[1];var e=A[0]^A[1];return 2147483647&(e<<5^e>>7^A[2]^A[3])};function M(t,e,n,r){P(t,e,n),P(t,e,e+r),P(t,e+r,n)}function P(t,e,n){for(var r,i=e+(n---e>>1);e<i;++e,--n)r=t[e],t[e]=t[n],t[n]=r}function D(t){return null==t?{type:null}:("FeatureCollection"===t.type?function(t){var e={type:"GeometryCollection",geometries:t.features.map(E)};return null!=t.bbox&&(e.bbox=t.bbox),e}:"Feature"===t.type?E:C)(t)}function E(t){var e,n=C(t.geometry);for(e in null!=t.id&&(n.id=t.id),null!=t.bbox&&(n.bbox=t.bbox),t.properties){n.properties=t.properties;break}return n}function C(t){if(null==t)return{type:null};var e="GeometryCollection"===t.type?{type:"GeometryCollection",geometries:t.geometries.map(C)}:"Point"===t.type||"MultiPoint"===t.type?{type:t.type,coordinates:t.coordinates}:{type:t.type,arcs:t.coordinates};return null!=t.bbox&&(e.bbox=t.bbox),e}var L=function(t,e){var n=function(t){var e=1/0,n=1/0,r=-1/0,i=-1/0;function o(t){null!=t&&a.hasOwnProperty(t.type)&&a[t.type](t)}var a={GeometryCollection:function(t){t.geometries.forEach(o)},Point:function(t){c(t.coordinates)},MultiPoint:function(t){t.coordinates.forEach(c)},LineString:function(t){u(t.arcs)},MultiLineString:function(t){t.arcs.forEach(u)},Polygon:function(t){t.arcs.forEach(u)},MultiPolygon:function(t){t.arcs.forEach(l)}};function c(t){var o=t[0],a=t[1];o<e&&(e=o),o>r&&(r=o),a<n&&(n=a),a>i&&(i=a)}function u(t){t.forEach(c)}function l(t){t.forEach(u)}for(var s in t)o(t[s]);return r>=e&&i>=n?[e,n,r,i]:void 0}(t=function(t){var e,n={};for(e in t)n[e]=D(t[e]);return n}(t)),r=e>0&&n&&function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],c=o-r?(n-1)/(o-r):1,u=a-i?(n-1)/(a-i):1;function l(t){return[Math.round((t[0]-r)*c),Math.round((t[1]-i)*u)]}function s(t,e){for(var n,o,a,l,s,f=-1,d=0,p=t.length,h=new Array(p);++f<p;)n=t[f],l=Math.round((n[0]-r)*c),s=Math.round((n[1]-i)*u),l===o&&s===a||(h[d++]=[o=l,a=s]);for(h.length=d;d<e;)d=h.push([h[0][0],h[0][1]]);return h}function f(t){return s(t,2)}function d(t){return s(t,4)}function p(t){return t.map(d)}function h(t){null!=t&&g.hasOwnProperty(t.type)&&g[t.type](t)}var g={GeometryCollection:function(t){t.geometries.forEach(h)},Point:function(t){t.coordinates=l(t.coordinates)},MultiPoint:function(t){t.coordinates=t.coordinates.map(l)},LineString:function(t){t.arcs=f(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(f)},Polygon:function(t){t.arcs=p(t.arcs)},MultiPolygon:function(t){t.arcs=t.arcs.map(p)}};for(var v in t)h(t[v]);return{scale:[1/c,1/u],translate:[r,i]}}(t,n,e),i=function(t){var e,n,r,i,o=t.coordinates,a=t.lines,c=t.rings,u=a.length+c.length;for(delete t.lines,delete t.rings,r=0,i=a.length;r<i;++r)for(e=a[r];e=e.next;)++u;for(r=0,i=c.length;r<i;++r)for(n=c[r];n=n.next;)++u;var l=b(2*u*1.4,_,w),s=t.arcs=[];for(r=0,i=a.length;r<i;++r){e=a[r];do{f(e)}while(e=e.next)}for(r=0,i=c.length;r<i;++r)if((n=c[r]).next)do{f(n)}while(n=n.next);else d(n);function f(t){var e,n,r,i,a,c,u,f;if(r=l.get(e=o[t[0]]))for(u=0,f=r.length;u<f;++u)if(p(i=r[u],t))return t[0]=i[0],void(t[1]=i[1]);if(a=l.get(n=o[t[1]]))for(u=0,f=a.length;u<f;++u)if(h(c=a[u],t))return t[1]=c[0],void(t[0]=c[1]);r?r.push(t):l.set(e,[t]),a?a.push(t):l.set(n,[t]),s.push(t)}function d(t){var e,n,r,i,a;if(n=l.get(o[t[0]]))for(i=0,a=n.length;i<a;++i){if(g(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(v(r,t))return t[0]=r[1],void(t[1]=r[0])}if(n=l.get(e=o[t[0]+y(t)]))for(i=0,a=n.length;i<a;++i){if(g(r=n[i],t))return t[0]=r[0],void(t[1]=r[1]);if(v(r,t))return t[0]=r[1],void(t[1]=r[0])}n?n.push(t):l.set(e,[t]),s.push(t)}function p(t,e){var n=t[0],r=e[0],i=t[1];if(n-i!=r-e[1])return!1;for(;n<=i;++n,++r)if(!w(o[n],o[r]))return!1;return!0}function h(t,e){var n=t[0],r=e[0],i=t[1],a=e[1];if(n-i!=r-a)return!1;for(;n<=i;++n,--a)if(!w(o[n],o[a]))return!1;return!0}function g(t,e){var n=t[0],r=e[0],i=t[1]-n;if(i!==e[1]-r)return!1;for(var a=y(t),c=y(e),u=0;u<i;++u)if(!w(o[n+(u+a)%i],o[r+(u+c)%i]))return!1;return!0}function v(t,e){var n=t[0],r=e[0],i=t[1],a=e[1],c=i-n;if(c!==a-r)return!1;for(var u=y(t),l=c-y(e),s=0;s<c;++s)if(!w(o[n+(s+u)%c],o[a-(s+l)%c]))return!1;return!0}function y(t){for(var e=t[0],n=t[1],r=e,i=r,a=o[r];++r<n;){var c=o[r];(c[0]<a[0]||c[0]===a[0]&&c[1]<a[1])&&(i=r,a=c)}return i-e}return t}(function(t){var e,n,r,i=function(t){var e,n,r,i,o=t.coordinates,a=t.lines,c=t.rings,u=function(){for(var t=b(1.4*o.length,A,M,Int32Array,-1,Int32Array),e=new Int32Array(o.length),n=0,r=o.length;n<r;++n)e[n]=t.maybeSet(n,n);return e}(),l=new Int32Array(o.length),s=new Int32Array(o.length),f=new Int32Array(o.length),d=new Int8Array(o.length),p=0;for(e=0,n=o.length;e<n;++e)l[e]=s[e]=f[e]=-1;for(e=0,n=a.length;e<n;++e){var h=a[e],g=h[0],v=h[1];for(r=u[g],i=u[++g],++p,d[r]=1;++g<=v;)x(e,r,r=i,i=u[g]);++p,d[i]=1}for(e=0,n=o.length;e<n;++e)l[e]=-1;for(e=0,n=c.length;e<n;++e){var y=c[e],m=y[0]+1,k=y[1];for(x(e,u[k-1],r=u[m-1],i=u[m]);++m<=k;)x(e,r,r=i,i=u[m])}function x(t,e,n,r){if(l[n]!==t){l[n]=t;var i=s[n];if(i>=0){var o=f[n];i===e&&o===r||i===r&&o===e||(++p,d[n]=1)}else s[n]=e,f[n]=r}}function A(t){return _(o[t])}function M(t,e){return w(o[t],o[e])}l=s=f=null;var P,D=function(t,e,n,r,i){3===arguments.length&&(r=Array,i=null);for(var o=new r(t=1<<Math.max(4,Math.ceil(Math.log(t)/Math.LN2))),a=t-1,c=0;c<t;++c)o[c]=i;return{add:function(r){for(var c=e(r)&a,u=o[c],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)throw new Error("full hashset");u=o[c=c+1&a]}return o[c]=r,!0},has:function(r){for(var c=e(r)&a,u=o[c],l=0;u!=i;){if(n(u,r))return!0;if(++l>=t)break;u=o[c=c+1&a]}return!1},values:function(){for(var t=[],e=0,n=o.length;e<n;++e){var r=o[e];r!=i&&t.push(r)}return t}}}(1.4*p,_,w);for(e=0,n=o.length;e<n;++e)d[P=u[e]]&&D.add(o[P]);return D}(t),o=t.coordinates,a=t.lines,c=t.rings;for(n=0,r=a.length;n<r;++n)for(var u=a[n],l=u[0],s=u[1];++l<s;)i.has(o[l])&&(e={0:l,1:u[1]},u[1]=l,u=u.next=e);for(n=0,r=c.length;n<r;++n)for(var f=c[n],d=f[0],p=d,h=f[1],g=i.has(o[d]);++p<h;)i.has(o[p])&&(g?(e={0:p,1:f[1]},f[1]=p,f=f.next=e):(M(o,d,h,h-p),o[h]=o[d],g=!0,p=d));return t}(function(t){var e=-1,n=[],r=[],i=[];function o(t){t&&a.hasOwnProperty(t.type)&&a[t.type](t)}var a={GeometryCollection:function(t){t.geometries.forEach(o)},LineString:function(t){t.arcs=c(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(c)},Polygon:function(t){t.arcs=t.arcs.map(u)},MultiPolygon:function(t){t.arcs=t.arcs.map(l)}};function c(t){for(var r=0,o=t.length;r<o;++r)i[++e]=t[r];var a={0:e-o+1,1:e};return n.push(a),a}function u(t){for(var n=0,o=t.length;n<o;++n)i[++e]=t[n];var a={0:e-o+1,1:e};return r.push(a),a}function l(t){return t.map(u)}for(var s in t)o(t[s]);return{type:"Topology",coordinates:i,lines:n,rings:r,objects:t}}(t))),o=i.coordinates,a=b(1.4*i.arcs.length,j,S);function c(t){t&&u.hasOwnProperty(t.type)&&u[t.type](t)}t=i.objects,i.bbox=n,i.arcs=i.arcs.map(function(t,e){return a.set(t,e),o.slice(t[0],t[1]+1)}),delete i.coordinates,o=null;var u={GeometryCollection:function(t){t.geometries.forEach(c)},LineString:function(t){t.arcs=l(t.arcs)},MultiLineString:function(t){t.arcs=t.arcs.map(l)},Polygon:function(t){t.arcs=t.arcs.map(l)},MultiPolygon:function(t){t.arcs=t.arcs.map(s)}};function l(t){var e=[];do{var n=a.get(t);e.push(t[0]<t[1]?n:~n)}while(t=t.next);return e}function s(t){return t.map(l)}for(var f in t)c(t[f]);return r&&(i.transform=r,i.arcs=function(t){for(var e=-1,n=t.length;++e<n;){for(var r,i,o=t[e],a=0,c=1,u=o.length,l=o[0],s=l[0],f=l[1];++a<u;)r=(l=o[a])[0],i=l[1],r===s&&i===f||(o[c++]=[r-s,i-f],s=r,f=i);1===c&&(o[c++]=[0,0]),o.length=c}return t}(i.arcs)),i};function j(t){var e,n=t[0],r=t[1];return r<n&&(e=n,n=r,r=e),n+31*r}function S(t,e){var n,r=t[0],i=t[1],o=e[0],a=e[1];return i<r&&(n=r,r=i,i=n),a<o&&(n=o,o=a,a=n),r===o&&i===a}var O=function(t,e){var n,r=t.objects,i={};function o(t){var e,n;switch(t.type){case"Polygon":e=(n=a(t.arcs))?{type:"Polygon",arcs:n}:{type:null};break;case"MultiPolygon":e=(n=t.arcs.map(a).filter(H)).length?{type:"MultiPolygon",arcs:n}:{type:null};break;case"GeometryCollection":e=(n=t.geometries.map(o).filter(z)).length?{type:"GeometryCollection",geometries:n}:{type:null};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}function a(t){return t.length&&function(t){return e(t,!1)}(t[0])?[t[0]].concat(t.slice(1).filter(c)):null}function c(t){return e(t,!0)}for(n in null==e&&(e=F),r)i[n]=o(r[n]);return function(t){var e,n,r=t.objects,i={},o=t.arcs,a=o.length,c=-1,u=new Array(a),l=0,s=-1;function f(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(f);break;case"LineString":p(t.arcs);break;case"MultiLineString":case"Polygon":t.arcs.forEach(p);break;case"MultiPolygon":t.arcs.forEach(h)}}function d(t){t<0&&(t=~t),u[t]||(u[t]=1,++l)}function p(t){t.forEach(d)}function h(t){t.forEach(p)}function g(t){var e;switch(t.type){case"GeometryCollection":e={type:"GeometryCollection",geometries:t.geometries.map(g)};break;case"LineString":e={type:"LineString",arcs:y(t.arcs)};break;case"MultiLineString":e={type:"MultiLineString",arcs:t.arcs.map(y)};break;case"Polygon":e={type:"Polygon",arcs:t.arcs.map(y)};break;case"MultiPolygon":e={type:"MultiPolygon",arcs:t.arcs.map(m)};break;default:return t}return null!=t.id&&(e.id=t.id),null!=t.bbox&&(e.bbox=t.bbox),null!=t.properties&&(e.properties=t.properties),e}function v(t){return t<0?~u[~t]:u[t]}function y(t){return t.map(v)}function m(t){return t.map(y)}for(n in r)f(r[n]);for(e=new Array(l);++c<a;)u[c]&&(u[c]=++s,e[s]=o[c]);for(n in r)i[n]=g(r[n]);return{type:"Topology",bbox:t.bbox,transform:t.transform,objects:i,arcs:e}}({type:"Topology",bbox:t.bbox,transform:t.transform,objects:i,arcs:t.arcs})};function F(){return!0}function H(t){return t}function z(t){return null!=t.type}var B=function(t){var e,n=new Array(t.arcs.length),r=0;function i(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(i);break;case"Polygon":o(t.arcs);break;case"MultiPolygon":t.arcs.forEach(o)}}function o(t){for(var e=0,i=t.length;e<i;++e,++r)for(var o=t[e],a=0,c=o.length;a<c;++a){var u=o[a];u<0&&(u=~u);var l=n[u];null==l?n[u]=r:l!==r&&(n[u]=-1)}}for(e in t.objects)i(t.objects[e]);return function(t){for(var e,r=0,i=t.length;r<i;++r)if(-1===n[(e=t[r])<0?~e:e])return!0;return!1}};function G(t){var e=t[0],n=t[1],r=t[2];return Math.abs((e[0]-r[0])*(n[1]-e[1])-(e[0]-n[0])*(r[1]-e[1]))/2}function T(t){for(var e,n=-1,r=t.length,i=t[r-1],o=0;++n<r;)e=i,i=t[n],o+=e[0]*i[1]-e[1]*i[0];return Math.abs(o)/2}var I=function(t,e,n){return e=null==e?Number.MIN_VALUE:+e,null==n&&(n=T),function(r,i){return n(c(t,{type:"Polygon",arcs:[r]}).geometry.coordinates[0],i)>=e}},N=function(t,e,n){var r=B(t),i=I(t,e,n);return function(t,e){return r(t,e)||i(t,e)}};function W(t,e){return t[1][2]-e[1][2]}function q(t){return[t[0],t[1],0]}var R=function(t,e){var n=t.transform?i(t.transform):q,r=function(){var t={},e=[],n=0;function r(t,n){for(;n>0;){var r=(n+1>>1)-1,i=e[r];if(W(t,i)>=0)break;e[i._=n]=i,e[t._=n=r]=t}}function i(t,r){for(;;){var i=r+1<<1,o=i-1,a=r,c=e[a];if(o<n&&W(e[o],c)<0&&(c=e[a=o]),i<n&&W(e[i],c)<0&&(c=e[a=i]),a===r)break;e[c._=r]=c,e[t._=r=a]=t}}return t.push=function(t){return r(e[t._=n]=t,n++),n},t.pop=function(){if(!(n<=0)){var t,r=e[0];return--n>0&&(t=e[n],i(e[t._=0]=t,0)),r}},t.remove=function(t){var o,a=t._;if(e[a]===t)return a!==--n&&(W(o=e[n],t)<0?r:i)(e[o._=a]=o,a),a},t}();null==e&&(e=G);var o=t.arcs.map(function(t){var i,o,c,u=[],l=0;for(o=1,c=(t=t.map(n)).length-1;o<c;++o)(i=[t[o-1],t[o],t[o+1]])[1][2]=e(i),u.push(i),r.push(i);for(t[0][2]=t[c][2]=1/0,o=0,c=u.length;o<c;++o)(i=u[o]).previous=u[o-1],i.next=u[o+1];for(;i=r.pop();){var s=i.previous,f=i.next;i[1][2]<l?i[1][2]=l:l=i[1][2],s&&(s.next=f,s[2]=i[2],a(s)),f&&(f.previous=s,f[0]=i[0],a(f))}return t});function a(t){r.remove(t),t[1][2]=e(t),r.push(t)}return{type:"Topology",bbox:t.bbox,objects:t.objects,arcs:o}},$=function(t,e){var n=[];return t.arcs.forEach(function(t){t.forEach(function(t){isFinite(t[2])&&n.push(t[2])})}),n.length&&function(t,e){if(n=t.length){if((e=+e)<=0||n<2)return t[0];if(e>=1)return t[n-1];var n,r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}}(n.sort(U),e)};function U(t,e){return e-t}var Y=function(t,e){e=null==e?Number.MIN_VALUE:+e;var n=t.arcs.map(function(t){for(var n,r=-1,i=0,o=t.length,a=new Array(o);++r<o;)(n=t[r])[2]>=e&&(a[i++]=[n[0],n[1]]);return a.length=i,a});return{type:"Topology",transform:t.transform,bbox:t.bbox,objects:t.objects,arcs:n}},V=Math.PI,J=2*V,K=V/4,X=V/180,Q=Math.abs,Z=Math.atan2,tt=Math.cos,et=Math.sin;function nt(t,e){for(var n,r,i,o=0,a=t.length,c=0,u=t[e?o++:a-1],l=u[0]*X,s=u[1]*X/2+K,f=tt(s),d=et(s);o<a;++o){n=l,l=(u=t[o])[0]*X,s=u[1]*X/2+K,r=f,f=tt(s),i=d,d=et(s);var p=l-n,h=p>=0?1:-1,g=h*p,v=i*d,y=r*f+v*tt(g),m=v*h*et(g);c+=Z(m,y)}return c}function rt(t,e){var n=nt(t,!0);return e&&(n*=-1),2*(n<0?J+n:n)}function it(t){return 2*Q(nt(t,!1))}n.d(e,"bbox",function(){return o}),n.d(e,"feature",function(){return c}),n.d(e,"mesh",function(){return f}),n.d(e,"meshArcs",function(){return d}),n.d(e,"merge",function(){return p}),n.d(e,"mergeArcs",function(){return h}),n.d(e,"neighbors",function(){return v}),n.d(e,"quantize",function(){return m}),n.d(e,"transform",function(){return i}),n.d(e,"untransform",function(){return y}),n.d(e,"topology",function(){return L}),n.d(e,"filter",function(){return O}),n.d(e,"filterAttached",function(){return B}),n.d(e,"filterAttachedWeight",function(){return N}),n.d(e,"filterWeight",function(){return I}),n.d(e,"planarRingArea",function(){return T}),n.d(e,"planarTriangleArea",function(){return G}),n.d(e,"presimplify",function(){return R}),n.d(e,"quantile",function(){return $}),n.d(e,"simplify",function(){return Y}),n.d(e,"sphericalRingArea",function(){return rt}),n.d(e,"sphericalTriangleArea",function(){return it})}]);