text: !function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).overpassWizardExpand=e()}(function(){return function r(o,i,u){function s(t,e){if(!i[t]){if(!o[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=i[t]={exports:{}},o[t][0].call(n.exports,function(e){return s(o[t][1][e]||e)},n,n.exports,r,o,i,u)}return i[t].exports}for(var c="function"==typeof require&&require,e=0;e<u.length;e++)s(u[e]);return s}({1:[function(e,t,n){"use strict";var r=e("./raw"),o=[],i=[],u=r.makeRequestCallFromTimer(function(){if(i.length)throw i.shift()});function s(e){var t=o.length?o.pop():new c;t.task=e,r(t)}function c(){this.task=null}t.exports=s,c.prototype.call=function(){try{this.task.call()}catch(e){s.onerror?s.onerror(e):(i.push(e),u())}finally{this.task=null,o[o.length]=this}}},{"./raw":2}],2:[function(e,p,t){(function(l){(function(){"use strict";function e(e){r.length||(t(),0),r[r.length]=e}p.exports=e;var t,r=[],o=0;function n(){for(;o<r.length;){var e=o;if(o+=1,r[e].call(),1024<o){for(var t=0,n=r.length-o;t<n;t++)r[t]=r[t+o];r.length-=o,o=0}}r.length=0,o=0,0}var i,u,s,c=void 0!==l?l:self,f=c.MutationObserver||c.WebKitMutationObserver;function a(r){return function(){var e=setTimeout(n,0),t=setInterval(n,50);function n(){clearTimeout(e),clearInterval(t),r()}}}t="function"==typeof f?(u=1,i=new f(i=n),s=document.createTextNode(""),i.observe(s,{characterData:!0}),function(){u=-u,s.data=u}):a(n),e.requestFlush=t,e.makeRequestCallFromTimer=a}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){},{}],4:[function(e,t,n){var u=e("promise"),o=e("request-promise");function r(t,n){var r,e="https://nominatim.openstreetmap.org/search?format=json&q="+encodeURIComponent(t),e="undefined"!=typeof XMLHttpRequest?(r=e,new u(function(e,t){var n=new XMLHttpRequest;n.open("GET",r),n.onload=function(){200==n.status?e(n.response):t(Error("XMLHttpRequest Error: "+n.statusText))},n.onerror=function(){t(Error("Network Error"))},n.send()}).then(JSON.parse)):o({url:e,method:"GET",headers:{"User-Agent":"overpass-wizard"},json:!0});return e.then(function(e){return n&&(e=e.filter(n)),0===e.length?u.reject(new Error("No result found for geocoding search: "+t)):e[0]})}var s={date:function(e,t){var n=Date.now();if(null===(e=e.toLowerCase().match(/(-?[0-9]+) ?(seconds?|minutes?|hours?|days?|weeks?|months?|years?)?/)))return u.reject(new Error("unable to expand date shortcut."));var r=parseInt(e[1]);switch(e[2]){case"second":case"seconds":o=1;break;case"minute":case"minutes":o=60;break;case"hour":case"hours":o=3600;break;case"day":case"days":default:o=86400;break;case"week":case"weeks":o=604800;break;case"month":case"months":o=2628e3;break;case"year":case"years":o=31536e3}var o=n-r*o*1e3;return u.resolve(new Date(o).toISOString())},geocodeArea:function(e){return r(e,function(e){return e.osm_type&&e.osm_id&&"node"!==e.osm_type}).then(function(e){var t=+e.osm_id;return"way"==e.osm_type&&(t+=24e8),"relation"==e.osm_type&&(t+=36e8),e="area("+t+")"})},geocodeCoords:function(e){return r(e).then(function(e){return e=e.lat+","+e.lon})}};t.exports=function(r,e,t){e&&(r=r.replace(/{{bbox}}/g,e));var o="{{([a-zA-Z0-9_]+)=(.+?)}}";(r.match(new RegExp(o,"g"))||[]).forEach(function(e){for(var e=e.match(new RegExp(o)),t="{{"+e[1]+"}}",n=e[2];0<=r.indexOf(t);)r=r.replace(t,n)});var n="{{(date|geocodeArea|geocodeCoords):([\\s\\S]*?)}}",i=r.match(new RegExp(n,"g"))||[];return u.all(i.map(function(e){return e=e.match(new RegExp(n)),s[e[1]](e[2])})).then(function(e){return e.forEach(function(e,t){r=r.replace(i[t],e)}),r}).then(function(e){t(void 0,e)}).catch(function(e){t(e)})}},{promise:5,"request-promise":3}],5:[function(e,t,n){"use strict";t.exports=e("./lib")},{"./lib":10}],6:[function(e,t,n){"use strict";var o=e("asap/raw");function u(){}var i=null,s={};function c(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("Promise constructor's argument is not a function");this._40=0,this._65=0,this._55=null,this._72=null,e!==u&&h(e,this)}function f(e,t){for(;3===e._65;)e=e._55;if(c._37&&c._37(e),0===e._65)return 0===e._40?(e._40=1,void(e._72=t)):1===e._40?(e._40=2,void(e._72=[e._72,t])):void e._72.push(t);var n,r;n=e,r=t,o(function(){var e=1===n._65?r.onFulfilled:r.onRejected;null!==e?(e=function(e,t){try{return e(t)}catch(e){return i=e,s}}(e,n._55))===s?l(r.promise,i):a(r.promise,e):(1===n._65?a:l)(r.promise,n._55)})}function a(e,t){if(t===e)return l(e,new TypeError("A promise cannot be resolved with itself.")),0;if(t&&("object"==typeof t||"function"==typeof t)){var n=function(e){try{return e.then}catch(e){return i=e,s}}(t);if(n===s)return l(e,i),0;if(n===e.then&&t instanceof c)return e._65=3,e._55=t,void r(e);if("function"==typeof n)return void h(n.bind(t),e)}e._65=1,e._55=t,r(e)}function l(e,t){e._65=2,e._55=t,c._87&&c._87(e,t),r(e)}function r(e){if(1===e._40&&(f(e,e._72),e._72=null),2===e._40){for(var t=0;t<e._72.length;t++)f(e,e._72[t]);e._72=null}}function p(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function h(e,t){var n=!1,e=function(e,t,n){try{e(t,n)}catch(e){return i=e,s}}(e,function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,l(t,e))});n||e!==s||(n=!0,l(t,i))}(t.exports=c)._37=null,c._87=null,c._61=u,c.prototype.then=function(e,t){if(this.constructor!==c)return o=e,i=t,new(r=this).constructor(function(e,t){var n=new c(u);n.then(e,t),f(r,new p(o,i,n))});var r,o,i,n=new c(u);return f(this,new p(e,t,n)),n}},{"asap/raw":2}],7:[function(e,t,n){"use strict";e=e("./core.js");(t.exports=e).prototype.done=function(e,t){(arguments.length?this.then.apply(this,arguments):this).then(null,function(e){setTimeout(function(){throw e},0)})}},{"./core.js":6}],8:[function(e,t,n){"use strict";var c=e("./core.js");t.exports=c;var r=a(!0),o=a(!1),i=a(null),u=a(void 0),s=a(0),f=a("");function a(e){var t=new c(c._61);return t._65=1,t._55=e,t}c.resolve=function(e){if(e instanceof c)return e;if(null===e)return i;if(void 0===e)return u;if(!0===e)return r;if(!1===e)return o;if(0===e)return s;if(""===e)return f;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new c(t.bind(e))}catch(n){return new c(function(e,t){t(n)})}return a(e)},c.all=function(e){var s=Array.prototype.slice.call(e);return new c(function(o,i){if(0===s.length)return o([]);var u=s.length;for(var e=0;e<s.length;e++)!function t(n,e){if(e&&("object"==typeof e||"function"==typeof e)){if(e instanceof c&&e.then===c.prototype.then){for(;3===e._65;)e=e._55;return 1===e._65?t(n,e._55):(2===e._65&&i(e._55),void e.then(function(e){t(n,e)},i))}var r=e.then;if("function"==typeof r)return void new c(r.bind(e)).then(function(e){t(n,e)},i)}s[n]=e,0==--u&&o(s)}(e,s[e])})},c.reject=function(n){return new c(function(e,t){t(n)})},c.race=function(e){return new c(function(t,n){e.forEach(function(e){c.resolve(e).then(t,n)})})},c.prototype.catch=function(e){return this.then(null,e)}},{"./core.js":6}],9:[function(e,t,n){"use strict";var r=e("./core.js");(t.exports=r).prototype.finally=function(t){return this.then(function(e){return r.resolve(t()).then(function(){return e})},function(e){return r.resolve(t()).then(function(){throw e})})}},{"./core.js":6}],10:[function(e,t,n){"use strict";t.exports=e("./core.js"),e("./done.js"),e("./finally.js"),e("./es6-extensions.js"),e("./node-extensions.js"),e("./synchronous.js")},{"./core.js":6,"./done.js":7,"./es6-extensions.js":8,"./finally.js":9,"./node-extensions.js":11,"./synchronous.js":12}],11:[function(e,t,n){"use strict";var i=e("./core.js"),o=e("asap");(t.exports=i).denodeify=function(e,t){return"number"==typeof t&&t!==1/0?function(e,t){for(var n=[],r=0;r<t;r++)n.push("a"+r);var o=["return function ("+n.join(",")+") {","var self = this;","return new Promise(function (rs, rj) {","var res = fn.call(",["self"].concat(n).concat([u]).join(","),");","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],o)(i,e)}(e,t):function(e){for(var t=Math.max(e.length-1,3),n=[],r=0;r<t;r++)n.push("a"+r);var o=["return function ("+n.join(",")+") {","var self = this;","var args;","var argLength = arguments.length;","if (arguments.length > "+t+") {","args = new Array(arguments.length + 1);","for (var i = 0; i < arguments.length; i++) {","args[i] = arguments[i];","}","}","return new Promise(function (rs, rj) {","var cb = "+u+";","var res;","switch (argLength) {",n.concat(["extra"]).map(function(e,t){return"case "+t+":res = fn.call("+["self"].concat(n.slice(0,t)).concat("cb").join(",")+");break;"}).join(""),"default:","args[argLength] = cb;","res = fn.apply(self, args);","}","if (res &&",'(typeof res === "object" || typeof res === "function") &&','typeof res.then === "function"',") {rs(res);}","});","};"].join("");return Function(["Promise","fn"],o)(i,e)}(e)};var u="function (err, res) {if (err) { rj(err); } else { rs(res); }}";i.nodeify=function(n){return function(){var e=Array.prototype.slice.call(arguments),t="function"==typeof e[e.length-1]?e.pop():null,r=this;try{return n.apply(this,arguments).nodeify(t,r)}catch(n){if(null==t)return new i(function(e,t){t(n)});o(function(){t.call(r,n)})}}},i.prototype.nodeify=function(t,n){if("function"!=typeof t)return this;this.then(function(e){o(function(){t.call(n,null,e)})},function(e){o(function(){t.call(n,e)})})}},{"./core.js":6,asap:1}],12:[function(e,t,n){"use strict";var r=e("./core.js");(t.exports=r).enableSynchronous=function(){r.prototype.isPending=function(){return 0==this.getState()},r.prototype.isFulfilled=function(){return 1==this.getState()},r.prototype.isRejected=function(){return 2==this.getState()},r.prototype.getValue=function(){if(3===this._65)return this._55.getValue();if(!this.isFulfilled())throw new Error("Cannot get a value of an unfulfilled promise.");return this._55},r.prototype.getReason=function(){if(3===this._65)return this._55.getReason();if(!this.isRejected())throw new Error("Cannot get a rejection reason of a non-rejected promise.");return this._55},r.prototype.getState=function(){return 3===this._65?this._55.getState():-1===this._65||-2===this._65?0:this._65}},r.disableSynchronous=function(){r.prototype.isPending=void 0,r.prototype.isFulfilled=void 0,r.prototype.isRejected=void 0,r.prototype.getValue=void 0,r.prototype.getReason=void 0,r.prototype.getState=void 0}},{"./core.js":6}]},{},[4])(4)});