From 6b489126c5fc67039136df239fffffaf50a8d484 Mon Sep 17 00:00:00 2001 From: Joel Pearce Date: Mon, 31 Jul 2023 17:04:52 +0100 Subject: [PATCH] removed unneeded custom js --- app/static/src/js/custom.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/static/src/js/custom.js b/app/static/src/js/custom.js index 183c337..e69de29 100644 --- a/app/static/src/js/custom.js +++ b/app/static/src/js/custom.js @@ -1,2 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define("GOVUKFrontend",["exports"],e):e(t.GOVUKFrontend={})}(this,(function(t){"use strict";function e(t,e){if(window.NodeList.prototype.forEach)return t.forEach(e);for(var n=0;n1&&i.shift(),n[i.join(".")]=t[o]}return n}function i(t){if("string"!=typeof t)return t;var e=t.trim();return"true"===e||"false"!==e&&(e.length>0&&isFinite(Number(e))?Number(e):t)}function s(t){var e={};for(var n in t)e[n]=i(t[n]);return e}function r(t,e){this.translations=t||{},this.locale=e&&e.locale||document.documentElement.lang||"en"}(function(t){var e,n,o,i;"defineProperty"in Object&&function(){try{return Object.defineProperty({},"test",{value:42}),!0}catch(t){return!1}}()||(e=Object.defineProperty,n=Object.prototype.hasOwnProperty("__defineGetter__"),o="Getters & setters cannot be defined on this javascript engine",i="A property cannot both have accessors and be writable or have a value",Object.defineProperty=function(t,s,r){if(e&&(t===window||t===document||t===Element.prototype||t instanceof Element))return e(t,s,r);if(null===t||!(t instanceof Object||"object"==typeof t))throw new TypeError("Object.defineProperty called on non-object");if(!(r instanceof Object))throw new TypeError("Property description must be an object");var a=String(s),l="value"in r||"writable"in r,c="get"in r&&typeof r.get,u="set"in r&&typeof r.set;if(c){if("function"!==c)throw new TypeError("Getter must be a function");if(!n)throw new TypeError(o);if(l)throw new TypeError(i);Object.__defineGetter__.call(t,a,r.get)}else t[a]=r.value;if(u){if("function"!==u)throw new TypeError("Setter must be a function");if(!n)throw new TypeError(o);if(l)throw new TypeError(i);Object.__defineSetter__.call(t,a,r.set)}return"value"in r&&(t[a]=r.value),t})}).call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Document"in this||"undefined"==typeof WorkerGlobalScope&&"function"!=typeof importScripts&&(this.HTMLDocument?this.Document=this.HTMLDocument:(this.Document=this.HTMLDocument=document.constructor=new Function("return function Document() {}")(),this.Document.prototype=document))}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){"Element"in this&&"HTMLElement"in this||function(){if(!window.Element||window.HTMLElement){window.Element=window.HTMLElement=new Function("return function Element() {}")();var t,e=document.appendChild(document.createElement("body")),n=e.appendChild(document.createElement("iframe")).contentWindow.document,o=Element.prototype=n.appendChild(n.createElement("*")),i={},s=function(t,e){var n,o,r,a=t.childNodes||[],l=-1;if(1===t.nodeType&&t.constructor!==Element)for(n in t.constructor=Element,i)o=i[n],t[n]=o;for(;r=e&&a[++l];)s(r,e);return t},r=document.getElementsByTagName("*"),a=document.createElement,l=100;o.attachEvent("onpropertychange",(function(t){for(var e,n=t.propertyName,s=!i.hasOwnProperty(n),a=o[n],l=i[n],c=-1;e=r[++c];)1===e.nodeType&&(s||e[n]===l)&&(e[n]=a);i[n]=a})),o.constructor=Element,o.hasAttribute||(o.hasAttribute=function(t){return null!==this.getAttribute(t)}),c()||(document.onreadystatechange=c,t=setInterval(c,25)),document.createElement=function(t){var e=a(String(t).toLowerCase());return s(e)},document.removeChild(e)}else window.HTMLElement=window.Element;function c(){return l--||clearTimeout(t),!(!document.body||document.body.prototype||!/(complete|interactive)/.test(document.readyState))&&(s(document,!0),t&&document.body.prototype&&clearTimeout(t),!!document.body.prototype)}}()}.call("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),function(t){(function(){if(!document.documentElement.dataset)return!1;var t=document.createElement("div");return t.setAttribute("data-a-b","c"),t.dataset&&"c"==t.dataset.aB})()||Object.defineProperty(Element.prototype,"dataset",{get:function(){for(var t=this.attributes,e={},n=0;n=3&&t%100<=10?"few":t%100>=11&&t%100<=99?"many":"other"},chinese:function(){return"other"},french:function(t){return 0===t||1===t?"one":"other"},german:function(t){return 1===t?"one":"other"},irish:function(t){return 1===t?"one":2===t?"two":t>=3&&t<=6?"few":t>=7&&t<=10?"many":"other"},russian:function(t){var e=t%100,n=e%10;return 1===n&&11!==e?"one":n>=2&&n<=4&&!(e>=12&&e<=14)?"few":0===n||n>=5&&n<=9||e>=11&&e<=14?"many":"other"},scottish:function(t){return 1===t||11===t?"one":2===t||12===t?"two":t>=3&&t<=10||t>=13&&t<=19?"few":"other"},spanish:function(t){return 1===t?"one":t%1e6==0&&0!==t?"many":"other"},welsh:function(t){return 0===t?"zero":1===t?"one":2===t?"two":3===t?"few":6===t?"many":"other"}},function(t){var e;"DOMTokenList"in this&&(!("classList"in(e=document.createElement("x")))||!e.classList.toggle("x",!1)&&!e.className)||function(e){var n;"DOMTokenList"in e&&e.DOMTokenList&&(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg")||document.createElementNS("http://www.w3.org/2000/svg","svg").classList instanceof DOMTokenList)||(e.DOMTokenList=function(){var e=!0,o=function(t,n,o,i){Object.defineProperty?Object.defineProperty(t,n,{configurable:!1===e||!!i,get:o}):t.__defineGetter__(n,o)};try{o({},"support")}catch(n){e=!1}return function(e,n){var i=this,s=[],r={},a=0,l=0,c=function(t){o(i,t,(function(){return d(),s[t]}),!1)},u=function(){if(a>=l)for(;l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u())},i.remove=function(){d.apply(i,t=arguments);for(var t,o={},l=0,c=[];l>>0,"object"==typeof e[n]?e[n].baseVal=s.join(" "):e[n]=s.join(" "),u()},i.toggle=function(e,n){return d.apply(i,[e]),t!==n?n?(i.add(e),!0):(i.remove(e),!1):r[e]?(i.remove(e),!1):(i.add(e),!0)},i}}()),"classList"in(n=document.createElement("span"))&&(n.classList.toggle("x",!1),n.classList.contains("x")&&(n.classList.constructor.prototype.toggle=function(e){var n=arguments[1];if(n===t){var o=!this.contains(e);return this[o?"add":"remove"](e),o}return this[(n=!!n)?"add":"remove"](e),n})),function(){var t=document.createElement("span");if("classList"in t&&(t.classList.add("a","b"),!t.classList.contains("b"))){var e=t.classList.constructor.prototype.add;t.classList.constructor.prototype.add=function(){for(var t=arguments,n=arguments.length,o=0;o=this.lastInputTimestamp)&&this.updateIfValueChanged()}.bind(this),1e3)},h.prototype.handleBlur=function(){clearInterval(this.valueChecker)},h.prototype.updateIfValueChanged=function(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())},h.prototype.updateCountMessage=function(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()},h.prototype.updateVisibleCountMessage=function(){var t=this.$textarea,e=this.$visibleCountMessage,n=this.maxLength-this.count(t.value);this.isOverThreshold()?e.classList.remove("govuk-character-count__message--disabled"):e.classList.add("govuk-character-count__message--disabled"),n<0?(t.classList.add("govuk-textarea--error"),e.classList.remove("govuk-hint"),e.classList.add("govuk-error-message")):(t.classList.remove("govuk-textarea--error"),e.classList.remove("govuk-error-message"),e.classList.add("govuk-hint")),e.innerText=this.getCountMessage()},h.prototype.updateScreenReaderCountMessage=function(){var t=this.$screenReaderCountMessage;this.isOverThreshold()?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden","true"),t.innerText=this.getCountMessage()},h.prototype.count=function(t){return"maxwords"in this.config&&this.config.maxwords?(t.match(/\S+/g)||[]).length:t.length},h.prototype.getCountMessage=function(){var t=this.maxLength-this.count(this.$textarea.value),e="maxwords"in this.config&&this.config.maxwords?"words":"characters";return this.formatCountMessage(t,e)},h.prototype.formatCountMessage=function(t,e){if(0===t)return this.i18n.t(e+"AtLimit");var n=t<0?"OverLimit":"UnderLimit";return this.i18n.t(e+n,{count:Math.abs(t)})},h.prototype.isOverThreshold=function(){if(!this.config.threshold)return!0;var t=this.$textarea,e=this.count(t.value);return this.maxLength*this.config.threshold/100<=e},p.prototype.init=function(){if(this.$module&&this.$inputs){var t=this.$module;e(this.$inputs,(function(t){var e=t.getAttribute("data-aria-controls");e&&document.getElementById(e)&&(t.setAttribute("aria-controls",e),t.removeAttribute("data-aria-controls"))})),window.addEventListener("onpageshow"in window?"pageshow":"DOMContentLoaded",this.syncAllConditionalReveals.bind(this)),this.syncAllConditionalReveals(),t.addEventListener("click",this.handleClick.bind(this))}},p.prototype.syncAllConditionalReveals=function(){e(this.$inputs,this.syncConditionalRevealWithInputState.bind(this))},p.prototype.syncConditionalRevealWithInputState=function(t){var e=t.getAttribute("aria-controls");if(e){var n=document.getElementById(e);if(n&&n.classList.contains("govuk-checkboxes__conditional")){var o=t.checked;t.setAttribute("aria-expanded",o.toString()),n.classList.toggle("govuk-checkboxes__conditional--hidden",!o)}}},p.prototype.unCheckAllInputsExcept=function(t){var n=this;e(document.querySelectorAll('input[type="checkbox"][name="'+t.name+'"]'),(function(e){t.form===e.form&&e!==t&&(e.checked=!1,n.syncConditionalRevealWithInputState(e))}))},p.prototype.unCheckExclusiveInputs=function(t){var n=this;e(document.querySelectorAll('input[data-behaviour="exclusive"][type="checkbox"][name="'+t.name+'"]'),(function(e){t.form===e.form&&(e.checked=!1,n.syncConditionalRevealWithInputState(e))}))},p.prototype.handleClick=function(t){var e=t.target;e instanceof HTMLInputElement&&"checkbox"===e.type&&(e.getAttribute("aria-controls")&&this.syncConditionalRevealWithInputState(e),e.checked&&("exclusive"===e.getAttribute("data-behaviour")?this.unCheckAllInputsExcept(e):this.unCheckExclusiveInputs(e)))};function f(t){if(!(t instanceof HTMLElement))return this;this.$module=t,this.$summary=null,this.$content=null}function m(t,e){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=n({disableAutoFocus:!1},e||{},s(t.dataset))}function b(t){if(!(t instanceof HTMLElement))return this;this.$module=t,this.$menuButton=t.querySelector(".govuk-js-header-toggle"),this.$menu=this.$menuButton&&t.querySelector("#"+this.$menuButton.getAttribute("aria-controls")),this.menuIsOpen=!1,this.mql=null}function v(t,e){if(!(t instanceof HTMLElement))return this;this.$module=t;this.config=n({disableAutoFocus:!1},e||{},s(t.dataset))}function g(t){if(!(t instanceof HTMLElement))return this;var e=t.querySelectorAll('input[type="radio"]');if(!e.length)return this;this.$module=t,this.$inputs=e}function y(t){if(!(t instanceof HTMLAnchorElement))return this;this.$module=t,this.$linkedElement=null,this.linkedElementListener=!1}function w(t){if(!(t instanceof HTMLElement))return this;var e=t.querySelectorAll("a.govuk-tabs__tab");if(!e.length)return this;this.$module=t,this.$tabs=e,this.keys={left:37,right:39,up:38,down:40},this.jsHiddenClass="govuk-tabs__panel--hidden",this.boundTabClick=this.onTabClick.bind(this),this.boundTabKeydown=this.onTabKeydown.bind(this),this.boundOnHashChange=this.onHashChange.bind(this),this.changingHash=!1}f.prototype.init=function(){this.$module&&("HTMLDetailsElement"in window&&this.$module instanceof HTMLDetailsElement||this.polyfillDetails())},f.prototype.polyfillDetails=function(){var t,e=this.$module,n=this.$summary=e.getElementsByTagName("summary").item(0),o=this.$content=e.getElementsByTagName("div").item(0);n&&o&&(o.id||(o.id="details-content-"+(t=(new Date).getTime(),"undefined"!=typeof window.performance&&"function"==typeof window.performance.now&&(t+=window.performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)})))),e.setAttribute("role","group"),n.setAttribute("role","button"),n.setAttribute("aria-controls",o.id),n.tabIndex=0,this.$module.hasAttribute("open")?n.setAttribute("aria-expanded","true"):(n.setAttribute("aria-expanded","false"),o.style.display="none"),this.polyfillHandleInputs(this.polyfillSetAttributes.bind(this)))},f.prototype.polyfillSetAttributes=function(){return this.$module.hasAttribute("open")?(this.$module.removeAttribute("open"),this.$summary.setAttribute("aria-expanded","false"),this.$content.style.display="none"):(this.$module.setAttribute("open","open"),this.$summary.setAttribute("aria-expanded","true"),this.$content.style.display=""),!0},f.prototype.polyfillHandleInputs=function(t){this.$summary.addEventListener("keypress",(function(e){var n=e.target;13!==e.keyCode&&32!==e.keyCode||n instanceof HTMLElement&&"summary"===n.nodeName.toLowerCase()&&(e.preventDefault(),n.click?n.click():t(e))})),this.$summary.addEventListener("keyup",(function(t){var e=t.target;32===t.keyCode&&e instanceof HTMLElement&&"summary"===e.nodeName.toLowerCase()&&t.preventDefault()})),this.$summary.addEventListener("click",t)},m.prototype.init=function(){if(this.$module){var t=this.$module;this.setFocus(),t.addEventListener("click",this.handleClick.bind(this))}},m.prototype.setFocus=function(){var t=this.$module;this.config.disableAutoFocus||(t.setAttribute("tabindex","-1"),t.addEventListener("blur",(function(){t.removeAttribute("tabindex")})),t.focus())},m.prototype.handleClick=function(t){var e=t.target;this.focusTarget(e)&&t.preventDefault()},m.prototype.focusTarget=function(t){if(!(t instanceof HTMLAnchorElement))return!1;var e=this.getFragmentFromUrl(t.href);if(!e)return!1;var n=document.getElementById(e);if(!n)return!1;var o=this.getAssociatedLegendOrLabel(n);return!!o&&(o.scrollIntoView(),n.focus({preventScroll:!0}),!0)},m.prototype.getFragmentFromUrl=function(t){return-1===t.indexOf("#")?undefined:t.split("#").pop()},m.prototype.getAssociatedLegendOrLabel=function(t){var e=t.closest("fieldset");if(e){var n=e.getElementsByTagName("legend");if(n.length){var o=n[0];if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return o;var i=o.getBoundingClientRect().top,s=t.getBoundingClientRect();if(s.height&&window.innerHeight)if(s.top+s.height-i