(function(){"use strict";Promise.withResolver=function withResolver(){var resolver=void 0;var promise=new Promise(function(resolve,reject){resolver=resolve});return[promise,resolver]};"use strict";Djblets.buildURL=function(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var url=options.baseURL||"";var queryData=options.queryData;if(queryData){var queryString=void 0;if(typeof queryData==="string"){queryString=queryData;if(queryString.indexOf("?")===0){queryString=queryString.substr(1)}}else{queryString=$.param(queryData)}if(queryString){url+="?"+queryString}}var anchor=options.anchor;if(anchor){if(anchor.indexOf("#")===0){url+=anchor}else{url+="#"+anchor}}return url};Djblets.parseQueryString=function(url){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var allowMultiValue=options.allowMultiValue;var j=url.indexOf("?");var queryString=void 0;if(j===-1){queryString=url}else{queryString=url.substr(j+1)}var query={};if(queryString.length===0){return query}var queryParams=queryString.split("&");for(var i=0;i<queryParams.length;i++){var queryParam=queryParams[i];var key=void 0;var value=void 0;j=queryParam.indexOf("=");if(j===-1){key=decodeURIComponent(queryParam);value=null}else{key=decodeURIComponent(queryParam.substr(0,j));value=decodeURIComponent(queryParam.substr(j+1))}if(allowMultiValue&&query.hasOwnProperty(key)){if(_.isArray(query[key])){query[key].push(value)}else{query[key]=[query[key],value]}}else{query[key]=value}}return query}}).call(this);
