(function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((i&1&&(n=t(n)),i&8)||i&4&&typeof n=="object"&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=493)})({493:function(n,t,i){n.exports=i(494)},494:function(n,t,i){"use strict";var u=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},r,f;Object.defineProperty(t,"__esModule",{value:!0});r=u(i(495));f=new r.default("globalHelpers")},495:function(n,t,i){"use strict";var r=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t["default"]=n,t},u=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}};Object.defineProperty(t,"__esModule",{value:!0});var f=r(i(496)),e=r(i(500)),o=r(i(501)),s=r(i(516)),h=r(i(520)),c=r(i(521)),l=u(i(523)),a=function(){function n(n){window[n]?console.error("requested global key in window already exists"):window[n]={charts:f,googleTagManager:e,formsApp:o,crimeMap:s,focus:h,cookie:l.default,languageSelector:c}}return n}();t.default=a},496:function(n,t,i){"use strict";var f=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},u,r;Object.defineProperty(t,"__esModule",{value:!0});u=i(497);r=f(i(499));t.renderTooltip=function(n){var o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et="",ot="",at="",vt="",st="",ht="",ct="",f,t,i,e,wt;if((s=(o=this===null||this===void 0?void 0:this._chart)===null||o===void 0?void 0:o.config)===null||s===void 0?void 0:s.custom){if(this._chart.config.custom.tooltipId&&this._chart.config.custom.chartWrapperId)et=this._chart.config.custom.tooltipId,ot=this._chart.config.custom.chartWrapperId;else{console.warn("Chart must have a unique chart ID and tooltip ID none was supplied in the config");return}((l=(c=(h=this===null||this===void 0?void 0:this._chart)===null||h===void 0?void 0:h.config)===null||c===void 0?void 0:c.custom)===null||l===void 0?void 0:l.tooltipSuffix)&&(at=this._chart.config.custom.tooltipSuffix);((y=(v=(a=this===null||this===void 0?void 0:this._chart)===null||a===void 0?void 0:a.config)===null||v===void 0?void 0:v.custom)===null||y===void 0?void 0:y.tooltip)&&(((k=(b=(w=(p=this===null||this===void 0?void 0:this._chart)===null||p===void 0?void 0:p.config)===null||w===void 0?void 0:w.custom)===null||b===void 0?void 0:b.tooltip)===null||k===void 0?void 0:k.alignment)&&(vt=this._chart.config.custom.tooltip.alignment),((tt=(nt=(g=(d=this===null||this===void 0?void 0:this._chart)===null||d===void 0?void 0:d.config)===null||g===void 0?void 0:g.custom)===null||nt===void 0?void 0:nt.tooltip)===null||tt===void 0?void 0:tt.maxWidth)&&(ht=this._chart.config.custom.tooltip.maxWidth.toString()),((ft=(ut=(rt=(it=this===null||this===void 0?void 0:this._chart)===null||it===void 0?void 0:it.config)===null||rt===void 0?void 0:rt.custom)===null||ut===void 0?void 0:ut.tooltip)===null||ft===void 0?void 0:ft.maxWidthMobile)&&(ct=this._chart.config.custom.tooltip.maxWidthMobile.toString()))}if(f=document.getElementById(ot),t=document.getElementById(et),!t){if(t=document.createElement("div"),t.classList.add("c-chart-tooltip_wrapper"),t.id=et,t.style.maxWidth=r.default.isMobile()?ct+"px":ht+"px",f===null){console.warn("The attached chart ID ("+ot+") is incorrect or the element does not exist, check both ID references match and the chart element exists on the page.");return}f.appendChild(t)}if(window.addEventListener("resize",u.debounce(50,function(){t.style.display="none";t.style.maxWidth=r.default.isMobile()?ct+"px":ht+"px"})),n.opacity===0){t.style.opacity="0";return}if(i="",vt=="inline")n.caretX>f.clientWidth/2?i="right":n.caretX<0+f.clientWidth/2&&(i="left"),st="inline";else{switch(n.yAlign){case"top":i="top";break;case"bottom":i="bottom"}switch(n.xAlign){case"left":i="left";break;case"right":i="right"}n.caretX>f.clientWidth-f.clientWidth/5?i="right":n.caretX<0+f.clientWidth/5&&(i="left")}if(t.classList.remove("c-chart-tooltip_wrapper--left"),t.classList.remove("c-chart-tooltip_wrapper--right"),t.classList.remove("c-chart-tooltip_wrapper--top"),t.classList.remove("c-chart-tooltip_wrapper--bottom"),t.classList.add("c-chart-tooltip_wrapper--"+i),n.body){var yt=[],pt=[],lt=[];for(e=0;e<n.dataPoints.length;e++)yt.push(this._data.datasets[n.dataPoints[e].datasetIndex].data[n.dataPoints[e].index]),pt.push(this._data.labels[n.dataPoints[e].index]),this._data.datasets[n.dataPoints[e].datasetIndex].label&&lt.push(this._data.datasets[n.dataPoints[e].datasetIndex].label);wt='\n            <div class="c-chart-tooltip">\n                <span class="c-chart-tooltip_caret c-chart-tooltip_caret--'+i+'"><\/span>\n                '+pt.map(function(n,t){return'\n                            <p class="c-chart-tooltip_title c-chart-tooltip_title--'+st+'">'+(lt[t]?lt[t]:"")+'<\/p>\n                            <p class="c-chart-tooltip_body c-chart-tooltip_body--'+st+'">'+n+": "+(yt[t]+at)+"<\/p>\n                        "}).join("")+"\n            <\/div>\n        ";t.innerHTML=wt}t.style.opacity="1";t.style.display="block";t.style.left=n.caretX+"px";t.style.top=n.caretY+"px"};t.datapointLegend=function(n){var i=[],t;for(i.push('<ul class="c-custom-legend_list '+n.id+'-legend">'),t=0;t<n.data.datasets[0].data.length;t++)i.push('<li class="c-custom-legend_item">\n                <span class="c-custom-legend_legend">\n                    <span class="c-custom-legend_color" style="background-color:'+n.data.datasets[0].backgroundColor[t]+'"><\/span>\n                <\/span>\n                <span class="c-custom-legend_text">\n                    '+(n.data.labels[t]?n.data.labels[t]:"")+'\n                    <span class="u-visually-hidden">: '+n.data.datasets[0].data[t]+"<\/span>\n                <\/span>\n            <\/li>");return i.push("<\/ul>"),i.join("")};t.datasetLegend=function(n){var r=[],t,i;for(r.push('<ul class="c-custom-legend_list '+n.id+'-legend">'),t=0;t<n.data.datasets.length;t++){var f=n.data.labels&&n.data.labels.length?n.data.labels:[],e=n.data.datasets[t].data&&n.data.datasets[t].data.length?n.data.datasets[t].data:[],o=n.data.datasets[t].label?n.data.datasets[t].label:"",u=[];if(o){if(f.length===e.length){for(u.push('<ul class="u-visually-hidden">'),i=0;i<f.length;i++)u.push("<li>"+f[i]+": "+e[i]+"<\/li>");u.push("<\/ul>")}r.push('\n                <li class="c-custom-legend_item">\n                    <span class="c-custom-legend_legend">\n                        <span class="c-custom-legend_color" style="background-color:'+n.data.datasets[t].backgroundColor+'"><\/span>\n                    <\/span>\n                    <span class="c-custom-legend_text">'+o+"<\/span>\n                    "+u.join("")+"\n                <\/li>\n            ")}}return r.push("<\/ul>"),r.join("")};t.formatDateLabel=function(n){var t=n.replace("- ","");return t.split(" ")};t.barChartTopValues=function(n){if(n.chart){var t=n.chart.ctx;t.font='bold 14px "LatoWebBold", "Arial", sans-serif';t.fillStyle="#1f2025";t.textAlign="center";t.textBaseline="bottom";n.data.datasets.forEach(function(n){for(var r=null,u=null,f=null,i=0;i<n.data.length;i++)n._meta[Object.keys(n._meta)[0]].data[i]&&(r=n._meta[Object.keys(n._meta)[0]].data[i]._model,u=n._meta[Object.keys(n._meta)[0]].data[i]._yScale.maxHeight,f=r.y-5,(u-r.y)/u>=.9&&(f=r.y+20),t.fillText(n.data[i],r.x,f))})}};t.noDataValues=function(n){var r,u,f,t,o;if(n.chart){var i=14,e="No Data",s="#fff";((f=(u=(r=n===null||n===void 0?void 0:n.chart)===null||r===void 0?void 0:r.config)===null||u===void 0?void 0:u.custom)===null||f===void 0?void 0:f.noData)&&(n.chart.config.custom.noData.fontSize&&(i=n.chart.config.custom.noData.fontSize),n.chart.config.custom.noData.text&&(e=n.chart.config.custom.noData.text));t=n.chart.ctx;o=t.measureText(e);t.font="bold "+i+'px "LatoWebBold", "Arial", sans-serif';t.fillStyle="#1f2025";t.textAlign="center";t.textBaseline="bottom";n.data.datasets.forEach(function(r){for(var h,c,u=null,f=0;f<r.data.length;f++)r._meta[Object.keys(r._meta)[0]].data[f]&&(u=r._meta[Object.keys(r._meta)[0]].data[f]._model,h=i+20,c=o.width+30,u.skip===!0&&(t.save(),t.translate(u.x,n.chart.height/2),t.rotate(Math.PI/-2),t.fillStyle=s,t.fillRect(-c/2,-h/2,c,h),t.restore(),t.save(),t.translate(u.x,n.chart.height/2),t.rotate(Math.PI/-2),t.fillText(e,0,i/2),t.restore()))})}};t.splitLabel=function(n){for(var t=n.split(" "),i=[];t.length;)i.push(t.splice(0,2).join(" "));return i};t.roundIntegerLabel=function(n){if(Math.floor(n)===n)return n}},497:function(n,t,i){"use strict";var u=this,r;Object.defineProperty(t,"__esModule",{value:!0});r=i(498);t.debounce=function(n,t){var i;return function(){for(var e,f=[],r=0;r<arguments.length;r++)f[r]=arguments[r];e=u;clearTimeout(i);i=setTimeout(function(){return t.apply(e,f)},n)}};t.cachedScript=function(n,t){var i=Object.assign(t||{},{dataType:"script",cache:!0,url:n});return $.ajax(i)};t.wrapElement=function(n,t){$(t).parent().hasClass(n)||$(t).wrap('<div class="'+n+'"><\/div>')};t.storeInSession=function(n,t){var i=t&&JSON.stringify(t);window&&window.sessionStorage&&window.sessionStorage.setItem(n,i)};t.storageAvailable=function(n){var t,r;try{return t=window[n],r="__storage_test__",t.setItem(r,r),t.removeItem(r),!0}catch(i){return i instanceof DOMException&&(i.code===22||i.code===1014||i.name==="QuotaExceededError"||i.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0}};t.stripExifData=function(n){var i=new DataView(n),s=new Blob([n],{type:"image/jpg"}),t=0,f=0,e=[],o=0,r,u;if(i.getUint16(t)==65496){for(t+=2,r=i.getUint16(t),t+=2;t<i.byteLength;){if(r==65505)e[o]={recess:f,offset:t-2},f=t+i.getUint16(t),o++;else if(r==65498)break;t+=i.getUint16(t);r=i.getUint16(t);t+=2}if(e.length>0)return u=[],e.forEach(function(t){u.push(n.slice(t.recess,t.offset))}),u.push(n.slice(f)),new Blob(u,{type:"image/jpg"})}return s};t.scrollToEl=function(n,t,i){t===void 0&&(t=0);i===void 0&&(i=300);n&&n.offset()&&$("html, body").animate({scrollTop:n.offset().top-t},i)};t.getRenderableValue=function(n){var r=null,i,t;if(!n||!n.length)return r;for(i=0;i<n.length;i++)if(t=n[i],typeof t!="undefined"&&t!==null&&t!==""&&(t.trim?t.trim()!=="":!0)&&(Array.isArray(t)?t.length>0:!0)){r=t;break}return r};t.isDefined=function(n){return typeof n!="undefined"&&n!==null};t.hideElement=function(n){return n.addClass(r.HIDDEN_CLASS).attr("aria-hidden","true"),n};t.showElement=function(n){return n.removeClass(r.HIDDEN_CLASS).attr("aria-hidden","false"),n}},498:function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HIDDENCLASS="dom-hidden";t.ACTIVECLASS="active";t.MATCHINGVALUE="matchingValue";t.UNMATCHINGVALUE="unMatchingValue";t.HIDDEN_CLASS="u-dom-hidden";t.TABLET_LOWER_BOUND=768;t.DESKTOP_UPPER_BOUND=960;t.COLOURS={CERULEAN:"#0971ce",WARNINGRED:"#de3423",SUCCESSGREEN:"#0f8568"};t.FORM_SUBMISSION_STARTED="formSubmissionStarted";t.FORM_STEP_LOADED="formStepLoaded";t.FORM_SUBMISSION_CLIENT_ERROR="formSubmissionClientError";t.FORM_SUBMISSION_COMPLETE="formSubmissionComplete";t.QUERY_CHANGED="queryChanged";t.ELEMENT_TOGGLED="elementToggled";t.NO_CHART_CONFIG="No chart config Id supplied";t.NO_CHART_LEGEND_ELEMENT="Chosen legend ID (#) is present in the config but the HTML element could not be found, are you sure it exists and that the ID is correct?";t.NO_HORIZONTAL_CHART_BAR_PADDING="Horizontal bar chart needs a bar padding and thickness value to calculate its height";t.NO_CRIME_STATS_FILTER_SELECT="No filter update button present in html";t.DYNAMIC_PANELS_NO_CRIME_FILTERS="The active incident type, year or month was not given in the query";t.CHART_TYPE_HORIZONTAL_BAR="horizontalBar";t.CHART_TYPE_LINE="line";t.CHART_TYPE_PIE="pie";t.SESSION_STORAGE="sessionStorage";t.YOUR_AREA_ORIGINAL_LOCATION="YOUR_AREA_ORIGINAL_LOCATION";t.CRIME_MAP_SESSION_STORAGE="crimeMapSessionStorage";t.CONSENT_COOKIE_NAME="cookie-consent";t.ANNOUNCEMENT_BANNER_COOKIE_NAME="announcement-close";t.BETA_POPUP_COOKIE_NAME="mps-beta-close";t.LANGUAGE_SELECTOR_COOKIE_NAME="hasBeenShownLanguageSelector";t.MULTI_FIELD="multiField";t.UNKNOWN_ERROR="An Unknown error has occured";t.MULTI_FIELD_ANY="any";t.MULTI_FIELD_ALL="all";t.MULTI_FIELD_ALL_OR_NONE="allOrNone";t.MULTI_FIELD_SOME_OR_NONE="someOrNone";t.ONLINE_FORM_START="onlineFormStart";t.ONLINE_FORM_STEP="onlineFormStep";t.ONLINE_FORM_SUBMISSION_ERROR="onlineFormError";t.ONLINE_FORM_SUBMISSION="onlineFormSubmission"},499:function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(498),u=function(){function n(){}return n.isMobile=function(){return this.getWindowWidth()<r.TABLET_LOWER_BOUND},n.isTablet=function(){var n=this.getWindowWidth();return n>=r.TABLET_LOWER_BOUND&&n<r.DESKTOP_UPPER_BOUND},n.isDesktop=function(){return this.getWindowWidth()>=r.DESKTOP_UPPER_BOUND},n.getWindowWidth=function(){return $(window).width()},n.getCurrent=function(){return this.isMobile()?"mobile":this.isTablet()?"tablet":"desktop"},n.isCurrentAllowed=function(n){var i,r,t,u;if(n){for(i=n.split(","),r=!1,t=0;t<i.length;t++)u=i[t],u===this.getCurrent()&&(r=!0);return r}return!1},n}();t.default=u},500:function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(498);t.pushGtmEventToDataLayer=function(n,t){if(window&&window.dataLayer)if(t){var i=!0;window.dataLayer.forEach(function(r){typeof r=="object"&&r[t]&&r.event&&r[t]===n[t]&&r.event===n.event&&(i=!1)});i&&window.dataLayer.push(n)}else window.dataLayer.push(n)};t.findFields=function(n,i){var r=[];return t.matchFieldsToIds(n,i,r),r};t.matchFieldsToIds=function(n,i,r){for(var e,f=[],u=0;u<n.length;u++){if(r.length===i.length)return;for(e=0;e<i.length;e++)if(n[u].uniqueId===i[e]){r.push(n[u]);break}"fields"in n[u]&&(f=f.concat(n[u].fields))}f.length&&t.matchFieldsToIds(f,i,r)};t.formStepLoaded=function(n,i){if(n&&n.length){var u=n.findIndex(function(n){return n.isActive}),f=n[u].navigationTitle;u===0&&t.pushGtmEventToDataLayer({event:r.ONLINE_FORM_START,formName:i},"form");t.pushGtmEventToDataLayer({event:r.ONLINE_FORM_STEP,formName:i,formStep:u+1,formStepName:f},"form")}};t.formSubmissionComplete=function(n,i){if(n&&n.length){var u=n.findIndex(function(n){return n.isActive}),f=n[u].navigationTitle;t.pushGtmEventToDataLayer({event:r.ONLINE_FORM_SUBMISSION,formName:i,formStep:u+1,formStepName:f},"form")}};t.formClientSubmissionError=function(n,i,u,f){var e=u.submission.steps.findIndex(function(n){return n.isActive}),h=u.submission.steps[e].navigationTitle,c=u.submission.steps[e].fields,l=Object.keys(i),a=t.findFields(c,l),o=[],s;a.forEach(function(n){o.push(n.label)});s=o.join(" | ");t.pushGtmEventToDataLayer({event:r.ONLINE_FORM_SUBMISSION_ERROR,formName:f,formStep:e+1,formStepName:h,formErrorFields:n?n:s},"formErrorFields")};t.pushFormStartAndSubmissionToDatalayer=function(){var i,r,n;window&&window.dataLayer&&(i=$(".js-gtm-form-values"),r=$(".js-gtm-form-complete-values"),r.length?(n=r.data("form-name"),t.pushGtmEventToDataLayer({event:"onlineFormSubmission",formName:n},"formName")):i.length&&(n=i.first().data("form-name"),t.pushGtmEventToDataLayer({event:"onlineFormStart",formName:n},"formName")))}},501:function(n,t,i){"use strict";var f=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t["default"]=n,t},e=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}};Object.defineProperty(t,"__esModule",{value:!0});var u=i(498),o=f(i(500)),s=e(i(502)),h=e(i(503)),r=f(i(504)),c=i(505),l=i(512),a=i(514),v=i(515);t.formsInitCallback=function(n,t){var i,e,p=$(n).siblings("#js-form-name").get(0),y=p.innerText,w=document.getElementById("js-live-chat-global-vars"),b=new s.default(w),f=new c.FileUploadHandlers;t.on(u.FORM_STEP_LOADED,function(n){n&&n.length&&(o.formStepLoaded(n,y),b.incrementCurrentStep())});t.on(u.FORM_SUBMISSION_CLIENT_ERROR,function(n,t,i){t&&i&&o.formClientSubmissionError(n,t,i,y)});t.on(u.ELEMENT_TOGGLED,function(){window.popups.checkHeight()});t.setHooks((i={},i[r.PRE_SUBMIT_REQUEST]=v.preSubmitRequestHook,i[r.PRE_CHANGE_FIELD_REQUEST]=l.preChangeRequestHook,i[r.PRE_GENERIC_API_REQUEST]=a.preGenericApiRequest,i[r.FILE_UPLOAD_SUBMIT_REQUEST]=f.fileUploadSubmitRequest,i[r.FILE_UPLOAD_DELETE_REQUEST]=f.fileUploadDeleteRequest,i[r.FILE_UPLOAD_CANCEL_REQUEST]=f.fileUploadCancelRequest,i[r.FILE_UPLOAD_SUCCESS_REQUEST]=f.fileUploadSuccessRequest,i));t.setValidators((e={},e[r.MULTI_FIELD]=h.default,e))}},502:function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(n){var t=this;this.setGlobalVariables=function(){window&&t.submissionIdVariableName&&t.currentStepVariableName&&t.refNoVariableName&&(window[t.submissionIdVariableName]=t.submissionId,window[t.currentStepVariableName]=t.currentStep,window[t.refNoVariableName]=t.refNo,window.attempts=0)};this.incrementCurrentStep=function(){window&&t.currentStepVariableName&&(window[t.currentStepVariableName]=t.currentStep+1)};this.element=n;this.element&&(this.submissionId=this.element.getAttribute("data-submission-id"),this.currentStep=parseInt(this.element.getAttribute("data-current-step")||""),this.refNo=this.element.getAttribute("data-ref-no"),this.submissionIdVariableName=this.element.getAttribute("data-submission-id-variable-name"),this.currentStepVariableName=this.element.getAttribute("data-current-step-variable-name"),this.refNoVariableName=this.element.getAttribute("data-ref-no-variable-name"),this.setGlobalVariables())}return n}();t.default=i},503:function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(498),u=i(497);t.default=function(n){return function(t,i){try{var c=n.message,s=n.items,h=n.fieldIndex;if(s&&s.length){var e=[],f=!0,o=0;return s.forEach(function(n){var b=n.conditionType,t=n.fieldUniqueIds,c,v,l,y,a,p,s,w;switch(b){case r.MULTI_FIELD_ANY:for(f=!1,c=0;c<t.length;c++)if(s=t[c],v=i[s],u.getRenderableValue([v])){f=!0;break}e.push(f);break;case r.MULTI_FIELD_ALL:for(f=!0,l=0;l<t.length;l++)if(s=t[l],y=i[s],!u.getRenderableValue([y])){f=!1;break}e.push(f);break;case r.MULTI_FIELD_ALL_OR_NONE:for(o=0,f=!0,a=0;a<t.length;a++)s=t[a],p=i[s],u.getRenderableValue([p])&&o++;o===0||o===t.length?f=!0:h>=0&&(s=t[h],w=i[s],u.getRenderableValue([w])||(f=!1));e.push(f)}}),e.includes(!0)?undefined:c}return undefined}catch(l){return console.error(l),r.UNKNOWN_ERROR}}}},504:function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CONFIRM_ON_DESELCTION="confirmOnDeselection";t.MULTI_FIELD="multiField";t.PRE_SUBMIT_REQUEST="preSubmitRequest";t.PRE_CHANGE_FIELD_REQUEST="preChangeFieldRequest";t.PRE_GENERIC_API_REQUEST="preGenericApiRequest";t.FILE_UPLOAD_SUBMIT_REQUEST="fileUploadSubmitRequest";t.FILE_UPLOAD_CANCEL_REQUEST="fileUploadCancelRequest";t.FILE_UPLOAD_DELETE_REQUEST="fileUploadDeleteRequest";t.FILE_UPLOAD_SUCCESS_REQUEST="fileUploadSuccessRequest";t.SELECT="select";t.LOCAL="local";t.AZURE="azure"},505:function(n,t,i){"use strict";var u=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},f=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e};Object.defineProperty(t,"__esModule",{value:!0});var r=i(504),e=i(506),o=i(511),s=function(){function n(){var n=this;this.traditionalHandlers=new o.FileUploadHandlersTraditional;this.azureHandlers=new e.FileUploadHandlersAzure;this.fileUploadSubmitRequest=function(t,i,e){return u(n,void 0,void 0,function(){var n=this;return f(this,function(){return[2,new Promise(function(o){return u(n,void 0,void 0,function(){var n,h,u,s;return f(this,function(){n=i.formMeta;h=n.apiType;u=n.config.text.genericErrorText;s=t.uuid;this.traditionalHandlers.genericErrorResponseMessage=u;this.azureHandlers.genericErrorResponseMessage=u;switch(h){case r.LOCAL:return this.traditionalHandlers.addUploadInstance(s),[2,o(this.traditionalHandlers.fileUploadSubmitRequestWithRetry(t,i,e))];case r.AZURE:return this.azureHandlers.addUploadInstance(s),[2,o(this.azureHandlers.fileUploadSubmitRequestWithRetry(t,i,e))];default:console.error("Api type not supplied")}return[2]})})})]})})};this.fileUploadCancelRequest=function(t,i,e){return u(n,void 0,void 0,function(){var n=this;return f(this,function(){return[2,new Promise(function(o){return u(n,void 0,void 0,function(){var u,n;return f(this,function(){u=(i||r.LOCAL).formMeta.apiType;n=t.uuid;switch(u){case r.LOCAL:return this.traditionalHandlers.addUploadInstance(n),[2,o(this.traditionalHandlers.fileUploadCancelRequest(t,i,e))];case r.AZURE:return this.azureHandlers.addUploadInstance(n),[2,o(this.azureHandlers.fileUploadDeleteRequest(t,i,e))];default:console.error("Api type not supplied")}return[2]})})})]})})};this.fileUploadDeleteRequest=function(t,i,e){return u(n,void 0,void 0,function(){var n=this;return f(this,function(){return[2,new Promise(function(o){return u(n,void 0,void 0,function(){var u,n;return f(this,function(){u=(i||r.LOCAL).formMeta.apiType;n=t.uuid;switch(u){case r.LOCAL:return this.traditionalHandlers.addUploadInstance(n),[2,o(this.traditionalHandlers.fileUploadDeleteRequest(t,i,e))];case r.AZURE:return this.azureHandlers.addUploadInstance(n),[2,o(this.azureHandlers.fileUploadDeleteRequest(t,i,e))];default:console.error("Api type not supplied")}return[2]})})})]})})};this.fileUploadSuccessRequest=function(t,i,e){return u(n,void 0,void 0,function(){var n=this;return f(this,function(){return[2,new Promise(function(o){return u(n,void 0,void 0,function(){var n,u;return f(this,function(){n=(i||r.LOCAL).formMeta.apiType;u=t.uuid;switch(n){case r.LOCAL:break;case r.AZURE:return this.azureHandlers.addUploadInstance(u),[2,o(this.azureHandlers.fileUploadSuccessRequestWithRetry(t,i,e))];default:console.error("Api type not supplied")}return[2]})})})]})})}}return n}();t.FileUploadHandlers=s},506:function(n,t,i){"use strict";var e=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),r=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},u=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},o=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}};Object.defineProperty(t,"__esModule",{value:!0});var s=o(i(507)),h=i(509),f=i(510),c=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.fileUploadSubmitRequestWithRetry=function(n,i,f){return r(t,void 0,void 0,function(){var t=this;return u(this,function(){return[2,new Promise(function(e){return r(t,void 0,void 0,function(){var t,r,s,h,c,l,o;return u(this,function(u){switch(u.label){case 0:return(t=n.uuid,!!((o=this.currentUploads[t])===null||o===void 0?void 0:o.sasUri))?[3,2]:[4,this.requestWithRetry(this.getSasUri,n,i,f)];case 1:if(r=u.sent(),s=r.isError,h=r.shouldBreak,s||h)return this.removeAbortController(t),[2,e(r)];c=r.payload;this.currentUploads[t]=Object.assign({},this.currentUploads[t],{sasUri:c});u.label=2;case 2:return l=e,[4,this.requestWithRetry(this.fileUploadSubmitRequest,n,i,f)];case 3:return[2,l.apply(void 0,[u.sent()])]}})})})]})})},t.fileUploadSuccessRequestWithRetry=function(n,i,f){return r(t,void 0,void 0,function(){var t=this;return u(this,function(){return[2,new Promise(function(e){return r(t,void 0,void 0,function(){var t;return u(this,function(r){switch(r.label){case 0:return t=e,[4,this.requestWithRetry(this.fileUploadSuccessRequest,n,i,f)];case 1:return[2,t.apply(void 0,[r.sent()])]}})})})]})})},t.fileUploadDeleteRequest=function(n,i){return r(t,void 0,void 0,function(){var t=this;return u(this,function(){return[2,new Promise(function(e){return r(t,void 0,void 0,function(){var t,s,h,c,l,a,r,o;return u(this,function(u){switch(u.label){case 0:return(t=n.uuid,s=n.hasUploadedChunk,((r=this.currentUploads[t])===null||r===void 0?void 0:r.controller)&&this.currentUploads[t].controller.abort(),h=new Headers({Origin:window.location.origin,"x-ms-version":"2019-12-12"}),c=f.setDeleteFetchOpts(h),l=(o=this.currentUploads[t])===null||o===void 0?void 0:o.sasUri,!s)?[3,2]:(a=e,[4,this.resolveGenericFileUploadHook(l,c,n,i,t)]);case 1:return a.apply(void 0,[u.sent()]),[3,3];case 2:e({payload:n,meta:i,isError:!1,shouldBreak:!1});u.label=3;case 3:return[2]}})})})]})})},t.fileUploadSubmitRequest=function(n,i){return r(t,void 0,void 0,function(){var t=this;return u(this,function(){return[2,new Promise(function(e){return r(t,void 0,void 0,function(){var o,s,p,w,t,b,r,k,d,g,h,c,l,a,nt,v,y;return u(this,function(u){switch(u.label){case 0:return(o=n.file,s=n.chunk,p=n.totalChunks,w=n.chunkId,t=n.uuid,b=o.name,r=o.type,!s)?[3,2]:(k=s.blob,d=s.index,d===p-1&&(n={shouldRunSuccessHook:!0}),h=new Headers({Accept:r,"Content-Type":r,Origin:window.location.origin,"x-ms-version":"2019-12-12","x-ms-date":(new Date).toDateString()}),c=f.setPutFetchOpts(h,k),l=this.addAbortController(c,t),a=((v=this.currentUploads[t])===null||v===void 0?void 0:v.sasUri)+"&comp=block&blockid="+encodeURIComponent(btoa(w)),g=e,[4,this.resolveGenericFileUploadHook(a,l,n,i,t)]);case 1:return g.apply(void 0,[u.sent()]),[3,4];case 2:return h=new Headers({Accept:r,"Content-Type":r,Origin:window.location.origin,"x-ms-version":"2019-12-12","x-ms-date":(new Date).toDateString(),"x-ms-blob-content-disposition":'attachment; filename="'+b+'"',"x-ms-blob-type":"BlockBlob "}),c=f.setPutFetchOpts(h,o),l=this.addAbortController(c,t),a=(y=this.currentUploads[t])===null||y===void 0?void 0:y.sasUri,nt=e,[4,this.resolveGenericFileUploadHook(a,l,n,i,t)];case 3:nt.apply(void 0,[u.sent()]);u.label=4;case 4:return[2]}})})})]})})},t.fileUploadSuccessRequest=function(n,i){return r(t,void 0,void 0,function(){var t=this;return u(this,function(){return[2,new Promise(function(e){return r(t,void 0,void 0,function(){var s,t,h,r,c,l,a,v,y,p,o;return u(this,function(u){switch(u.label){case 0:return s=n.file,t=n.uuid,h=n.chunks,r=s.type,c=new Headers({Accept:r,"Content-Type":r,Origin:window.location.origin,"x-ms-version":"2019-12-12","x-ms-date":(new Date).toDateString()}),l=this.constructBlockListXml(h),a=f.setPutFetchOpts(c,l.output),v=this.addAbortController(a,t),y=((o=this.currentUploads[t])===null||o===void 0?void 0:o.sasUri)+"&comp=blocklist",p=e,[4,this.resolveGenericFileUploadHook(y,v,n,i,t)];case 1:return p.apply(void 0,[u.sent()]),[2]}})})})]})})},t.resolveGenericFileUploadHook=function(n,i,e,o,s){return new Promise(function(h){return r(t,void 0,void 0,function(){var v,y,p,t,r,c,l,a;return u(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),v=(r=this.currentUploads[s])===null||r===void 0?void 0:r.controller,[4,f.fetchWithTimeOutAndController(n,i,6e4,v)];case 1:return y=u.sent(),y.ok?(this.removeAbortController(s),h({payload:e,meta:o,isError:!1,shouldBreak:!1})):(this.removeAbortController(s),h({payload:this.genericErrorResponseMessage,meta:o,isError:!0,shouldBreak:!1})),[3,3];case 2:return p=u.sent(),t=!1,((a=(l=(c=this.currentUploads[s])===null||c===void 0?void 0:c.controller)===null||l===void 0?void 0:l.signal)===null||a===void 0?void 0:a.aborted)&&(t=!0),this.removeAbortController(s),h({payload:this.genericErrorResponseMessage,meta:o,isError:!0,shouldBreak:t}),[3,3];case 3:return[2]}})})})},t.getSasUri=function(n,i){return r(t,void 0,void 0,function(){var t=this;return u(this,function(){return[2,new Promise(function(e){return r(t,void 0,void 0,function(){var r,o,k,lt,d,g,nt,tt,s,it,rt,ut,ft,et,t,c,ot,st,ht,h,l,ct,at,a,v,y,p,w,b;return u(this,function(u){switch(u.label){case 0:r=i.formMeta;o=r.config;k=r.fieldUniqueId;lt=r.contentId;d=o.fileUploadUrls.azure.sas;g=o.customHeaders;nt=o.submissionId;tt=n.file;s=n.uuid;it=tt.name;rt=JSON.stringify({id:k,submissionId:nt,fileName:it});ut=f.setPostFetchOpts(f.getFetchHeadersForJSON(g),rt);ft=this.addAbortController(ut,s);u.label=1;case 1:return u.trys.push([1,7,,8]),et=(v=this.currentUploads[s])===null||v===void 0?void 0:v.controller,[4,f.fetchWithTimeOutAndController(d,ft,6e4,et)];case 2:return(t=u.sent(),!t.ok)?[3,4]:[4,t.json()];case 3:return h=u.sent(),c=h.data.attributes,ot=c.sohUploadUri,st=c.accessToken,ht=ot+"?"+st,e({payload:ht,meta:i,isError:!1,shouldBreak:!1}),[3,6];case 4:return[4,t.json()];case 5:h=u.sent();l=h.errors;ct=l.length>0?(y=l[0])===null||y===void 0?void 0:y.title:t.status+" "+t.statusText;e({payload:ct,meta:i,isError:!0,shouldBreak:!1});u.label=6;case 6:return[3,8];case 7:return at=u.sent(),a=!1,((b=(w=(p=this.currentUploads[s])===null||p===void 0?void 0:p.controller)===null||w===void 0?void 0:w.signal)===null||b===void 0?void 0:b.aborted)&&(a=!0),e({payload:this.genericErrorResponseMessage,meta:i,isError:!0,shouldBreak:a}),[3,8];case 8:return[2]}})})})]})})},t.constructBlockListXml=function(n){var t=new s.default(!0);return t.startDocument("1.0","utf-8"),t.startElement("BlockList"),n.forEach(function(n){var i=n.id;t.writeElement("Latest",encodeURIComponent(btoa(i)))}),t.endElement(),t.endDocument(),t},t}return e(t,n),t}(h.FileUploadHandlersBase);t.FileUploadHandlersAzure=c},507:function(n,t,i){n.exports=i(508)},508:function(n){function r(n){return typeof n!="number"&&!n}function t(n){if(typeof n=="string")return n;if(typeof n=="number")return n+"";if(typeof n=="function")return n();if(n instanceof i)return n.toString();throw Error("Bad Parameter");}function i(n,t){if(!(this instanceof i))return new i;this.name_regex=/[_:A-Za-z][-._:A-Za-z0-9]*/;this.indent=n?!0:!1;this.indentString=this.indent&&typeof n=="string"?n:"    ";this.output="";this.stack=[];this.tags=0;this.attributes=0;this.attribute=0;this.texts=0;this.comment=0;this.dtd=0;this.root="";this.pi=0;this.cdata=0;this.started_write=!1;this.writer;this.writer_encoding="UTF-8";this.writer=typeof t=="function"?t:function(n){this.output+=n}}i.prototype={toString:function(){return this.flush(),this.output},indenter:function(){if(this.indent){this.write("\n");for(var n=1;n<this.tags;n++)this.write(this.indentString)}},write:function(){for(var n=0;n<arguments.length;n++)this.writer(arguments[n],this.writer_encoding)},flush:function(){for(var n=this.tags;n>0;n--)this.endElement();this.tags=0},startDocument:function(n,t,i){return this.tags||this.attributes?this:(this.startPI("xml"),this.startAttribute("version"),this.text(typeof n=="string"?n:"1.0"),this.endAttribute(),typeof t=="string"&&(this.startAttribute("encoding"),this.text(t),this.endAttribute(),this.writer_encoding=t),i&&(this.startAttribute("standalone"),this.text("yes"),this.endAttribute()),this.endPI(),this.indent||this.write("\n"),this)},endDocument:function(){return this.attributes&&this.endAttributes(),this},writeElement:function(n,t){return this.startElement(n).text(t).endElement()},writeElementNS:function(n,t,i,r){return r||(r=i),this.startElementNS(n,t,i).text(r).endElement()},startElement:function(n){if(n=t(n),!n.match(this.name_regex))throw Error("Invalid Parameter");if(this.tags===0&&this.root&&this.root!==n)throw Error("Invalid Parameter");return this.attributes&&this.endAttributes(),++this.tags,this.texts=0,this.stack.length>0&&(this.stack[this.stack.length-1].containsTag=!0),this.stack.push({name:n,tags:this.tags}),this.started_write&&this.indenter(),this.write("<",n),this.startAttributes(),this.started_write=!0,this},startElementNS:function(n,i){if(n=t(n),i=t(i),!n.match(this.name_regex))throw Error("Invalid Parameter");if(!i.match(this.name_regex))throw Error("Invalid Parameter");return this.attributes&&this.endAttributes(),++this.tags,this.texts=0,this.stack.length>0&&(this.stack[this.stack.length-1].containsTag=!0),this.stack.push({name:n+":"+i,tags:this.tags}),this.started_write&&this.indenter(),this.write("<",n+":"+i),this.startAttributes(),this.started_write=!0,this},endElement:function(){if(!this.tags)return this;var n=this.stack.pop();return this.attributes>0?(this.attribute&&(this.texts&&this.endAttribute(),this.endAttribute()),this.write("/"),this.endAttributes()):(n.containsTag&&this.indenter(),this.write("<\/",n.name,">")),--this.tags,this.texts=0,this},writeAttribute:function(n,t){return(typeof t=="function"&&(t=t()),r(t))?this:this.startAttribute(n).text(t).endAttribute()},writeAttributeNS:function(n,t,i,u){return(u||(u=i),typeof u=="function"&&(u=u()),r(u))?this:this.startAttributeNS(n,t,i).text(u).endAttribute()},startAttributes:function(){return this.attributes=1,this},endAttributes:function(){return this.attributes?(this.attribute&&this.endAttribute(),this.attributes=0,this.attribute=0,this.texts=0,this.write(">"),this):this},startAttribute:function(n){if(n=t(n),!n.match(this.name_regex))throw Error("Invalid Parameter");return!this.attributes&&!this.pi?this:this.attribute?this:(this.attribute=1,this.write(" ",n,'="'),this)},startAttributeNS:function(n,i){if(n=t(n),i=t(i),!n.match(this.name_regex))throw Error("Invalid Parameter");if(!i.match(this.name_regex))throw Error("Invalid Parameter");return!this.attributes&&!this.pi?this:this.attribute?this:(this.attribute=1,this.write(" ",n+":"+i,'="'),this)},endAttribute:function(){return this.attribute?(this.attribute=0,this.texts=0,this.write('"'),this):this},text:function(n){return(n=t(n),!this.tags&&!this.comment&&!this.pi&&!this.cdata)?this:this.attributes&&this.attribute?(++this.texts,this.write(n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")),this):(this.attributes&&!this.attribute&&this.endAttributes(),this.comment||this.cdata?this.write(n):this.write(n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),++this.texts,this.started_write=!0,this)},writeComment:function(n){return this.startComment().text(n).endComment()},startComment:function(){return this.comment?this:(this.attributes&&this.endAttributes(),this.indenter(),this.write("<!--"),this.comment=1,this.started_write=!0,this)},endComment:function(){return this.comment?(this.write("-->"),this.comment=0,this):this},writeDocType:function(n,t,i,r){return this.startDocType(n,t,i,r).endDocType()},startDocType:function(n,i,r,u){if(this.dtd||this.tags)return this;if(n=t(n),i=i?t(i):i,r=r?t(r):r,u=u?t(u):u,!n.match(this.name_regex))throw Error("Invalid Parameter");if(i&&!i.match(/^[\w\-][\w\s\-\/\+\:\.]*/))throw Error("Invalid Parameter");if(r&&!r.match(/^[\w\.][\w\-\/\\\:\.]*/))throw Error("Invalid Parameter");if(u&&!u.match(/[\w\s\<\>\+\.\!\#\-\?\*\,\(\)\|]*/))throw Error("Invalid Parameter");return i=i?' PUBLIC "'+i+'"':r?" SYSTEM":"",r=r?' "'+r+'"':"",u=u?" ["+u+"]":"",this.started_write&&this.indenter(),this.write("<!DOCTYPE ",n,i,r,u),this.root=n,this.dtd=1,this.started_write=!0,this},endDocType:function(){return this.dtd?(this.write(">"),this):this},writePI:function(n,t){return this.startPI(n).text(t).endPI()},startPI:function(n){if(n=t(n),!n.match(this.name_regex))throw Error("Invalid Parameter");return this.pi?this:(this.attributes&&this.endAttributes(),this.started_write&&this.indenter(),this.write("<?",n),this.pi=1,this.started_write=!0,this)},endPI:function(){return this.pi?(this.write("?>"),this.pi=0,this):this},writeCData:function(n){return this.startCData().text(n).endCData()},startCData:function(){return this.cdata?this:(this.attributes&&this.endAttributes(),this.indenter(),this.write("<![CDATA["),this.cdata=1,this.started_write=!0,this)},endCData:function(){return this.cdata?(this.write("]\]>"),this.cdata=0,this):this},writeRaw:function(n){return(n=t(n),!this.tags&&!this.comment&&!this.pi&&!this.cdata)?this:this.attributes&&this.attribute?(++this.texts,this.write(n.replace("&","&amp;").replace('"',"&quot;")),this):(this.attributes&&!this.attribute&&this.endAttributes(),++this.texts,this.write(n),this.started_write=!0,this)}};n.exports=i},509:function(n,t){"use strict";var r=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},u=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},i;Object.defineProperty(t,"__esModule",{value:!0});i=function(){function n(){var n=this;this.currentUploads={};this.genericErrorResponseMessage="An unexpected error occured. please try again.";this.addUploadInstance=function(t){n.currentUploads[t]||(n.currentUploads[t]={})};this.addAbortController=function(t,i){var r=new AbortController,u=r.signal;return t.signal=u,n.currentUploads[i]=Object.assign({},n.currentUploads[i],{controller:r}),t};this.removeAbortController=function(t){var i;(i=n.currentUploads[t])===null||i===void 0?!0:delete i.controller};this.requestWithRetry=function(t,i,f,e,o){return o===void 0&&(o=0),new Promise(function(s){return r(n,void 0,void 0,function(){var n,r,h,c,l;return u(this,function(u){switch(u.label){case 0:return[4,t(i,f,e)];case 1:return(n=u.sent(),r=n.isError,h=n.shouldBreak,!(r&&!h))?[3,6]:(o<3)?(c=e.retry,c(),o+=1,[4,this.timer(500)]):[3,4];case 2:return u.sent(),l=s,[4,this.requestWithRetry(t,i,f,e,o)];case 3:return[2,l.apply(void 0,[u.sent()])];case 4:return[2,s(n)];case 5:return[3,7];case 6:return[2,s(n)];case 7:return[2]}})})})};this.timer=function(n){return new Promise(function(t){setTimeout(function(){return t({})},n)})}}return n}();t.FileUploadHandlersBase=i},510:function(n,t){"use strict";var i=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},r=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e};Object.defineProperty(t,"__esModule",{value:!0});t.fetchWithTimeOut=function(n,t,i,r){return r===void 0&&(r=!0),Promise.race([fetch(n,t).then(function(n){if(r&&!n.ok)throw new Error(n.status+": "+n.statusText);return n}),new Promise(function(n,t){return setTimeout(function(){return t(new Error("This request has timed out"))},i)})])};t.fetchWithTimeOutAndController=function(n,t,i,r){return Promise.race([fetch(n,t).then(function(n){return n}),new Promise(function(n,t){return setTimeout(function(){r&&r.abort();t(new Error("This request has timed out"))},i)})])};t.fetchJSON=function(n,u,f){return i(void 0,void 0,void 0,function(){return r(this,function(){return[2,t.fetchWithTimeOut(n,u,f).then(function(n){if(!n.ok){var t=n.status+": "+n.statusText;return new Error(t)}return n.json()}).catch(function(n){return new Error(n.message)})]})})};t.fetchText=function(n,i,r){return t.fetchWithTimeOut(n,i,r).then(function(n){if(!n.ok){var t=n.status+": "+n.statusText;return new Error(t)}return n.text()}).catch(function(n){return new Error(n.message)})};t.getFetchHeadersForJSON=function(n){n===void 0&&(n={});return new Headers(Object.assign({},{Accept:"application/json","Content-Type":"application/json"},n))};t.getFetchHeadersForFormData=function(n){n===void 0&&(n={});return new Headers(Object.assign({},{Accept:"application/json"},n))};t.getFetchHeadersForText=function(n){n===void 0&&(n={});return new Headers(Object.assign({},{Accept:"text/html","Content-Type":"text/html"},n))};t.setGetFetchOpts=function(n,t){return{method:"GET",credentials:"include",headers:n,body:t}};t.setPostFetchOpts=function(n,t){return{method:"POST",credentials:"include",headers:n,body:t}};t.setPutFetchOpts=function(n,t){return{method:"PUT",credentials:"include",headers:n,body:t}};t.setDeleteFetchOpts=function(n,t){return{method:"DELETE",credentials:"include",headers:n,body:t}};t.createFormDataObject=function(n){var t=new FormData;return Object.keys(n).forEach(function(i){t.append(i,n[i])}),t}},511:function(n,t,i){"use strict";var e=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),u=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},f=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e};Object.defineProperty(t,"__esModule",{value:!0});var o=i(509),r=i(510),s=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.fileUploadSubmitRequestWithRetry=function(n,i,r){return u(t,void 0,void 0,function(){var t=this;return f(this,function(){return[2,new Promise(function(e){return u(t,void 0,void 0,function(){var t;return f(this,function(u){switch(u.label){case 0:return t=e,[4,this.requestWithRetry(this.fileUploadSubmitRequest,n,i,r)];case 1:return t.apply(void 0,[u.sent()]),[2]}})})})]})})},t.fileUploadSubmitRequest=function(n,i){return u(t,void 0,void 0,function(){var t=this;return f(this,function(){return[2,new Promise(function(e){return u(t,void 0,void 0,function(){var s,u,c,l,b,a,k,v,h,t,d,o,y,p,w,g,nt,tt,it,rt,ut,ft;return f(this,function(f){switch(f.label){case 0:return s=i.formMeta,u=s.config,c=s.fieldUniqueId,l=s.contentId,b=u.fileUploadUrls.core.submit,a=u.submissionId,k=u.customHeaders,v=u.maximumTotalFileSize,h=n.file,t=n.chunk,d=n.totalChunks,o=n.uuid,y=h.name,p=h.size,t?(g=t.blob,nt=t.size,tt=t.index,it=t.byteOffset,w=r.createFormDataObject({submissionId:a,contentId:l,fieldUniqueId:c,maxFileSize:v,qqpartindex:tt,qqpartbyteoffset:it,qqchunksize:nt,qqtotalParts:d,qquuid:o,qqfilename:y,qqtotalfilesize:p,qqfile:g})):w=r.createFormDataObject({submissionId:a,contentId:l,fieldUniqueId:c,maxFileSize:v,qquuid:o,qqfilename:y,qqtotalfilesize:p,qqfile:h}),rt=r.setPostFetchOpts(r.getFetchHeadersForFormData(k),w),ut=this.addAbortController(rt,o),ft=e,[4,this.resolveGenericFileUploadHooks(b,ut,n,i,o)];case 1:return ft.apply(void 0,[f.sent()]),[2]}})})})]})})},t.fileUploadDeleteRequest=function(n,i){return u(t,void 0,void 0,function(){var t=this;return f(this,function(){return[2,new Promise(function(e){return u(t,void 0,void 0,function(){var u,t,s,h,c,l,a,o,v,y,p,w,b;return f(this,function(f){switch(f.label){case 0:return u=i.formMeta,t=u.config,s=u.fieldUniqueId,h=t.fileUploadUrls.core.delete,c=t.submissionId,l=t.customHeaders,a=n.file,o=n.uuid,v=a.name,y={fileName:v,submissionId:c,fieldUniqueId:s,qquuid:o},p=r.createFormDataObject(y),w=r.setPostFetchOpts(r.getFetchHeadersForFormData(l),p),b=e,[4,this.resolveGenericFileUploadHooks(h,w,n,i,o)];case 1:return b.apply(void 0,[f.sent()]),[2]}})})})]})})},t.fileUploadCancelRequest=function(n,i){return u(t,void 0,void 0,function(){var t=this;return f(this,function(){return[2,new Promise(function(e){return u(t,void 0,void 0,function(){var o,u,h,c,l,a,v,t,y,p,w,b,k,s;return f(this,function(f){switch(f.label){case 0:return o=i.formMeta,u=o.config,h=o.fieldUniqueId,c=u.fileUploadUrls.core.cancel,l=u.submissionId,a=u.customHeaders,v=n.file,t=n.uuid,y=v.name,((s=this.currentUploads[t])===null||s===void 0?void 0:s.controller)&&this.currentUploads[t].controller.abort(),p={fileName:y,submissionId:l,fieldUniqueId:h,qquuid:t},w=r.createFormDataObject(p),b=r.setPostFetchOpts(r.getFetchHeadersForFormData(a),w),k=e,[4,this.resolveGenericFileUploadHooks(c,b,n,i,t)];case 1:return k.apply(void 0,[f.sent()]),[2]}})})})]})})},t.resolveGenericFileUploadHooks=function(n,i,e,o,s){return new Promise(function(h){return u(t,void 0,void 0,function(){var p,t,u,w,b,k,c,l,a,v,y;return f(this,function(f){switch(f.label){case 0:return f.trys.push([0,5,,6]),p=(l=this.currentUploads[s])===null||l===void 0?void 0:l.controller,[4,r.fetchWithTimeOutAndController(n,i,6e4,p)];case 1:return(t=f.sent(),!t.ok)?[3,3]:[4,t.json()];case 2:return u=f.sent(),w=u.success,b=u.error,w?(this.removeAbortController(s),h({payload:e,meta:o,isError:!1,shouldBreak:!1})):(this.removeAbortController(s),h({payload:b,meta:o,isError:!0,shouldBreak:!1})),[3,4];case 3:this.removeAbortController(s);h({payload:this.genericErrorResponseMessage,meta:o,isError:!0,shouldBreak:!1});f.label=4;case 4:return[3,6];case 5:return k=f.sent(),c=!1,((y=(v=(a=this.currentUploads[s])===null||a===void 0?void 0:a.controller)===null||v===void 0?void 0:v.signal)===null||y===void 0?void 0:y.aborted)&&(c=!0),this.removeAbortController(s),h({payload:this.genericErrorResponseMessage,meta:o,isError:!0,shouldBreak:c}),[3,6];case 6:return[2]}})})})},t}return e(t,n),t}(o.FileUploadHandlersBase);t.FileUploadHandlersTraditional=s},512:function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(513);t.preChangeRequestHook=function(n){var e=n.targetFieldUniqueId,t=n.newValue,i=n.currentValue,u=n.changeHandlers,f=!1;return u.forEach(function(n){var u=n.type;f=r.customChangeHandlers[u](t,i,n)}),new Promise(function(n){return n({payload:{targetFieldUniqueId:e,currentValue:i,newValue:t,changeHandlers:u},shouldBreak:f,isError:!1})})}},513:function(n,t,i){"use strict";var e=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t["default"]=n,t},r,u,f;Object.defineProperty(t,"__esModule",{value:!0});u=i(497);f=e(i(504));t.shouldConfirmOnDeselect=function(n,t,i){var r=i.matchValue,e=i.message,f;return(t=u.getRenderableValue(t),n=u.getRenderableValue(n),f=Boolean(t===r&&n!==r),f)?confirm(e)?!1:!0:!1};t.customChangeHandlers=(r={},r[f.CONFIRM_ON_DESELCTION]=t.shouldConfirmOnDeselect,r)},514:function(n,t,i){"use strict";var u=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t["default"]=n,t},r;Object.defineProperty(t,"__esModule",{value:!0});r=u(i(504));t.preGenericApiRequest=function(n,i){return new Promise(function(u){if(i===null||i===void 0?void 0:i.renderer)switch(i.renderer){case r.SELECT:var f=i.options,e=t.filterOptionsByStart(n,f);u({payload:{options:e},shouldBreak:!0,isError:!1})}u({payload:n,shouldBreak:!1,isError:!1})})};t.filterOptionsByStart=function(n,t){return t.filter(function(t){return t.label.toLowerCase().match("^"+n.toLowerCase())}).slice(0,5)}},515:function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.preSubmitRequestHook=function(n){return new Promise(function(t){var i=n.formSubmissionBody,r=i.activeStepContentId,u=i.targetStepContentId;window.liveChatPlugin&&window.Comm100API&&r>=0&&u===null&&window.liveChatPlugin.chatInProgress?confirm(window.liveChatPlugin.options.confirmMessage)?(window.Comm100API.end_chat(),window.liveChatPlugin.chatInProgress=!1,t({isError:!1,payload:n,shouldBreak:!1})):t({isError:!1,payload:n,shouldBreak:!0}):t({isError:!1,payload:n,shouldBreak:!1})})}},516:function(n,t,i){"use strict";var u=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},f=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},e=this&&this.__importStar||function(n){var t,i;if(n&&n.__esModule)return n;if(t={},n!=null)for(i in n)Object.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t["default"]=n,t};Object.defineProperty(t,"__esModule",{value:!0});var o=i(498),s=i(517),r=e(i(510));t.crimeMapInitCallback=function(n,t){var i=[],e=$(".js-crime-map-description");$(".js-dynamic-prevention-advice-panels").each(function(n,t){var r=$(t),u=r.data("api-url"),f=new s.DynamicCrimePreventionPanels(r,u);i.push(f)});t.on(o.QUERY_CHANGED,function(n){return u(void 0,void 0,void 0,function(){var t,o,s,h,c,u,l,a,v,y;return f(this,function(f){switch(f.label){case 0:return(t=n.activeIncidentType,o=n.activeYear,s=n.activeMonth,h=n.forceCode,c=n.descriptionApi,u=n.descriptionHtml,l=c+"?forceCode="+h+"&year="+o+"&month="+s+"&crimeSelected="+t,!(t!==null&&t.length))?[3,2]:(v=r.getFetchHeadersForText(),y=r.setPostFetchOpts(v),[4,r.fetchText(encodeURI(l),y,1e4)]);case 1:a=f.sent();u=JSON.parse(a);f.label=2;case 2:return e.html(u),i.forEach(function(t){return t.getPanelContent(n)}),[2]}})})})}},517:function(n,t,i){"use strict";var f=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),e=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}},r,u;Object.defineProperty(t,"__esModule",{value:!0});r=e(i(518));u=function(n){function t(t,i){var r=n.call(this,t)||this;return r.getPanelContent=r.getPanelContent.bind(r),r.setPanelContent=r.setPanelContent.bind(r),t&&i&&(r.$element=t,r.apiUrl=i),r}return f(t,n),t.prototype.getPanelContent=function(n){var r=this;if(n){var u=n.activeIncidentType,f=n.activeMonth,e=n.activeYear,t={crimeType:u,month:f,year:e},i=t?Object.keys(t).map(function(n){return n+"="+encodeURIComponent(t[n])}).join("&"):"",o=i?this.apiUrl+"?"+i:this.apiUrl;$.ajax({method:"GET",url:o}).done(function(n){r.setPanelContent(n)})}},t.prototype.setPanelContent=function(n){this.$element&&n&&(this.$element.html(n),window.masonry&&window.masonry.init())},t}(r.default);t.DynamicCrimePreventionPanels=u},518:function(n,t,i){"use strict";var e=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),u,r,f;Object.defineProperty(t,"__esModule",{value:!0});u=i(498);r=i(519);r.defaultMaxListeners=100;f=function(n){function t(t){var i=n.call(this)||this;return i.$component=undefined,i.setComponentVisibility=i.setComponentVisibility.bind(i),i.disableComponentFormElements=i.disableComponentFormElements.bind(i),i.$component=t,i}return e(t,n),t.prototype.setComponentVisibility=function(n){this.$component.toggleClass(u.HIDDENCLASS,!n)},t.prototype.disableComponentFormElements=function(n){this.$component.find("input, select, textarea, button").each(function(t,i){var r=$(i);r.is(":visible")&&!r.hasClass("js-no-disable")&&r.prop("disabled",n)})},t}(r);t.default=f},519:function(n){"use strict";function p(n){console&&console.warn&&console.warn(n)}function t(){t.init.call(this)}function r(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);}function s(n){return n._maxListeners===undefined?t.defaultMaxListeners:n._maxListeners}function h(n,t,i,u){var h,e,f,o;return r(i),e=n._events,e===undefined?(e=n._events=Object.create(null),n._eventsCount=0):(e.newListener!==undefined&&(n.emit("newListener",t,i.listener?i.listener:i),e=n._events),f=e[t]),f===undefined?(f=e[t]=i,++n._eventsCount):(typeof f=="function"?f=e[t]=u?[i,f]:[f,i]:u?f.unshift(i):f.push(i),h=s(n),h>0&&f.length>h&&!f.warned&&(f.warned=!0,o=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit"),o.name="MaxListenersExceededWarning",o.emitter=n,o.type=t,o.count=f.length,p(o))),n}function w(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(n,t,i){var u={fired:!1,wrapFn:undefined,target:n,type:t,listener:i},r=w.bind(u);return r.listener=i,u.wrapFn=r,r}function l(n,t,i){var u=n._events,r;return u===undefined?[]:(r=u[t],r===undefined)?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?k(r):v(r,r.length)}function a(n){var i=this._events,t;if(i!==undefined){if(t=i[n],typeof t=="function")return 1;if(t!==undefined)return t.length}return 0}function v(n,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=n[i];return r}function b(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}function k(n){for(var i=new Array(n.length),t=0;t<i.length;++t)i[t]=n[t].listener||n[t];return i}function d(n,t){return new Promise(function(i,r){function u(i){n.removeListener(t,f);r(i)}function f(){typeof n.removeListener=="function"&&n.removeListener("error",u);i([].slice.call(arguments))}y(n,t,f,{once:!0});t!=="error"&&g(n,u,{once:!0})})}function g(n,t,i){typeof n.on=="function"&&y(n,"error",t,i)}function y(n,t,i,r){if(typeof n.on=="function")if(r.once)n.once(t,i);else n.on(t,i);else if(typeof n.addEventListener=="function")n.addEventListener(t,function u(f){r.once&&n.removeEventListener(t,u);i(f)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n);}var i=typeof Reflect=="object"?Reflect:null,e=i&&typeof i.apply=="function"?i.apply:function(n,t,i){return Function.prototype.apply.call(n,t,i)},o,u,f;o=i&&typeof i.ownKeys=="function"?i.ownKeys:Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:function(n){return Object.getOwnPropertyNames(n)};u=Number.isNaN||function(n){return n!==n};n.exports=t;n.exports.once=d;t.EventEmitter=t;t.prototype._events=undefined;t.prototype._eventsCount=0;t.prototype._maxListeners=undefined;f=10;Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(n){if(typeof n!="number"||n<0||u(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");f=n}});t.init=function(){(this._events===undefined||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0);this._maxListeners=this._maxListeners||undefined};t.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||u(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};t.prototype.getMaxListeners=function(){return s(this)};t.prototype.emit=function(n){for(var f,o,i,s,r,h,c,u=[],t=1;t<arguments.length;t++)u.push(arguments[t]);if(f=n==="error",o=this._events,o!==undefined)f=f&&o.error===undefined;else if(!f)return!1;if(f){if(u.length>0&&(i=u[0]),i instanceof Error)throw i;s=new Error("Unhandled error."+(i?" ("+i.message+")":""));s.context=i;throw s;}if(r=o[n],r===undefined)return!1;if(typeof r=="function")e(r,this,u);else for(h=r.length,c=v(r,h),t=0;t<h;++t)e(c[t],this,u);return!0};t.prototype.addListener=function(n,t){return h(this,n,t,!1)};t.prototype.on=t.prototype.addListener;t.prototype.prependListener=function(n,t){return h(this,n,t,!0)};t.prototype.once=function(n,t){r(t);this.on(n,c(this,n,t));return this};t.prototype.prependOnceListener=function(n,t){return r(t),this.prependListener(n,c(this,n,t)),this};t.prototype.removeListener=function(n,t){var i,u,e,f,o;if((r(t),u=this._events,u===undefined)||(i=u[n],i===undefined))return this;if(i===t||i.listener===t)--this._eventsCount==0?this._events=Object.create(null):(delete u[n],u.removeListener&&this.emit("removeListener",n,i.listener||t));else if(typeof i!="function"){for(e=-1,f=i.length-1;f>=0;f--)if(i[f]===t||i[f].listener===t){o=i[f].listener;e=f;break}if(e<0)return this;e===0?i.shift():b(i,e);i.length===1&&(u[n]=i[0]);u.removeListener!==undefined&&this.emit("removeListener",n,o||t)}return this};t.prototype.off=t.prototype.removeListener;t.prototype.removeAllListeners=function(n){var r,i,t,u,f;if(i=this._events,i===undefined)return this;if(i.removeListener===undefined)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[n]!==undefined&&(--this._eventsCount==0?this._events=Object.create(null):delete i[n]),this;if(arguments.length===0){for(u=Object.keys(i),t=0;t<u.length;++t)(f=u[t],f!=="removeListener")&&this.removeAllListeners(f);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[n],typeof r=="function")this.removeListener(n,r);else if(r!==undefined)for(t=r.length-1;t>=0;t--)this.removeListener(n,r[t]);return this};t.prototype.listeners=function(n){return l(this,n,!0)};t.prototype.rawListeners=function(n){return l(this,n,!1)};t.listenerCount=function(n,t){return typeof n.listenerCount=="function"?n.listenerCount(t):a.call(n,t)};t.prototype.listenerCount=a;t.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},520:function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getActiveElement=function(){return document.hasFocus()&&document.activeElement!==document.body&&document.activeElement!==document.documentElement&&document.activeElement||null};t.trapFocus=function(n,i){var r,u,f;return i===void 0&&(i=[]),r="",i&&i.forEach(function(n,t){r+=n+":visible:not([disabled]):not(.u-dom-hidden)";t!==i.length-1&&(r+=",")}),u=r||'\n        a[href]:visible:not([disabled]):not(.u-dom-hidden),\n        button:visible:not([disabled]):not(.u-dom-hidden),\n        textarea:visible:not([disabled]):not(.u-dom-hidden),\n        input[type="text"]:visible:not([disabled]):not(.u-dom-hidden),\n        input[type="radio"]:visible:not([disabled]):not(.u-dom-hidden),\n        input[type="checkbox"]:visible:not([disabled]):not(.u-dom-hidden),\n        select:visible:not([disabled]):not(.u-dom-hidden)\n    ',f=function(i){var r=$(n).find(u),f=r[0],e=r[r.length-1],o=t.getActiveElement();(i.key==="Tab"||i.keyCode===9)&&(i.shiftKey?o===f&&(e.focus(),i.cancelable&&i.preventDefault()):o===e&&(f.focus(),i.cancelable&&i.preventDefault()))},f}},521:function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(522);t.createLanguageSelectorHelper=function(n){var t=new r.LanguageSelector(n)}},522:function(n,t,i){"use strict";var r=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},u=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},f=this&&this.__spreadArrays||function(){for(var i=0,n=0,r=arguments.length;n<r;n++)i+=arguments[n].length;for(var u=Array(i),f=0,n=0;n<r;n++)for(var e=arguments[n],t=0,o=e.length;t<o;t++,f++)u[f]=e[t];return u},e=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{"default":n}};Object.defineProperty(t,"__esModule",{value:!0});var o=e(i(523)),s=i(497),h=function(){function n(n){var t=this;this.currentLanguage="en-GB";this.setLanguageCookie=function(){return r(t,void 0,void 0,function(){return u(this,function(){return o.default.setCookie(this.cookieName,"true",{path:"/",expires:0,duration:"seconds"}),[2]})})};this.setLanguageCookie=this.setLanguageCookie.bind(this);this.element=n;this.element?(this.currentLanguage=this.element.getAttribute("data-language-for"),this.cookieName=this.element.getAttribute("data-language-cookie-name"),this.anchors=f(this.element.querySelectorAll("a")),this.anchors.length&&this.anchors.forEach(function(i){i.addEventListener("click",function(r){r.preventDefault();t.setLanguageCookie();var f=i.getAttribute("data-language-for"),u=i.getAttribute("href");f!==t.currentLanguage&&s.isDefined(u)?window.location.replace(u):(n.classList.add("u-dom-hidden"),n.setAttribute("aria-hidden","true"))})})):this.setLanguageCookie()}return n}();t.LanguageSelector=h},523:function(n,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.setCookie=function(n,t,i){var u,r,f;typeof t!="undefined"&&(u="",r=void 0,i.expires!==0&&i.duration==="seconds"?(r=new Date,r.setTime(r.getTime()+i.expires*1e3),u="expires="+r.toUTCString()):i.expires!==0&&i.duration==="years"&&(r=new Date((new Date).setFullYear((new Date).getFullYear()+i.expires)),u="expires="+r.toUTCString()),f=i.path||"/",document.cookie=n+"="+encodeURIComponent(t)+"; "+u+"; path="+f)},n.getCookie=function(n){var i=null,u=null,r,f,t,e;if(document.cookie&&document.cookie!=="")for(r=document.cookie.split(";"),f=r.length,t=0;t<f;++t)if(i=r[t].replace(/\s*/g,""),i.substring(0,n.length+1)===n+"="){e=n.length;u=decodeURIComponent(i.substring(e+1));break}return u},n.getAllCookieKeys=function(){var n=[];return document.cookie&&document.cookie!==""&&document.cookie.split(";").forEach(function(t){var i=t.trim(),r=i.indexOf("="),u=i.substr(0,r);n.push(u)}),n},n.deleteCookie=function(n){var t=new Date;t.setTime(t.getTime());document.cookie=n+"=; expires="+t.toUTCString()+"; path=/"},n.deleteCookies=function(t,i){var r=n.getAllCookieKeys();r.forEach(function(r){var f=!0,u,e;for(i.includes(r)&&(f=!1),u=0;u<t.length;u++)e=new RegExp("^("+t[u]+")"),e.test(r)&&(f=!1);f&&n.deleteCookie(r)})},n}();t.default=i}})