From b31d57f261df83ba920deeb1b45b35bbede18c8d Mon Sep 17 00:00:00 2001 From: Martyn Whitwell Date: Tue, 10 Dec 2024 17:30:32 +0000 Subject: [PATCH] update webchat code (#4410) --- .../javascript/{index-c4b64105.js => index-24235727.js} | 2 +- app/webpacker/packs/chat.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename app/webpacker/javascript/{index-c4b64105.js => index-24235727.js} (93%) diff --git a/app/webpacker/javascript/index-c4b64105.js b/app/webpacker/javascript/index-24235727.js similarity index 93% rename from app/webpacker/javascript/index-c4b64105.js rename to app/webpacker/javascript/index-24235727.js index 4936d01c11..5a04670ccb 100644 --- a/app/webpacker/javascript/index-c4b64105.js +++ b/app/webpacker/javascript/index-24235727.js @@ -33,4 +33,4 @@ var e,t=Object.defineProperty,n=(e,n,r)=>(((e,n,r)=>{n in e?t(e,n,{enumerable:!0 * * @author Feross Aboukhadijeh * @license MIT - */;var ew=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},tw=Object.prototype.hasOwnProperty,nw=Object.prototype.toString,rw=Object.defineProperty,ow=Object.getOwnPropertyDescriptor,iw=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===nw.call(e)},aw=function(e){if(!e||"[object Object]"!==nw.call(e))return!1;var t,n=tw.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&tw.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||tw.call(e,t)},sw=function(e,t){rw&&"__proto__"===t.name?rw(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},lw=function(e,t){if("__proto__"===t){if(!tw.call(e,t))return;if(ow)return ow(e,t).value}return e[t]},uw=[].slice;var cw=function(e,t){var n;return function(){var t,i=uw.call(arguments,0),a=e.length>i.length;a&&i.push(r);try{t=e.apply(null,i)}catch(s){if(a&&n)throw s;return r(s)}a||(t&&"function"==typeof t.then?t.then(o,r):t instanceof Error?r(t):o(t))};function r(){n||(n=!0,t.apply(null,arguments))}function o(e){r(null,e)}},dw=pw;pw.wrap=cw;var fw=[].slice;function pw(){var e=[],t={run:function(){var t=-1,n=fw.call(arguments,0,-1),r=arguments[arguments.length-1];if("function"!=typeof r)throw new Error("Expected function as last argument, not "+r);(function o(i){var a=e[++t],s=fw.call(arguments,0).slice(1),l=n.length,u=-1;if(i)r(i);else{for(;++ue.length){for(;n--;)if(47===e.charCodeAt(n)){if(o){a=n+1;break}}else s<0&&(o=!0,s=n+1);return s<0?"":e.slice(a,s)}if(t===e)return"";r=-1,i=t.length-1;for(;n--;)if(47===e.charCodeAt(n)){if(o){a=n+1;break}}else r<0&&(o=!0,r=n+1),i>-1&&(e.charCodeAt(n)===t.charCodeAt(i--)?i<0&&(s=n):(i=-1,s=r));a===s?s=r:s<0&&(s=e.length);return e.slice(a,s)},_w.dirname=function(e){var t,n,r;if(Cw(e),!e.length)return".";t=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(n){t=r;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},_w.extname=function(e){var t,n,r,o=-1,i=0,a=-1,s=0;Cw(e),r=e.length;for(;r--;)if(47!==(n=e.charCodeAt(r)))a<0&&(t=!0,a=r+1),46===n?o<0?o=r:1!==s&&(s=1):o>-1&&(s=-1);else if(t){i=r+1;break}if(o<0||a<0||0===s||1===s&&o===a-1&&o===i+1)return"";return e.slice(o,a)},_w.join=function(){var e,t=-1;for(;++t2){if((r=o.lastIndexOf("/"))!==o.length-1){r<0?(o="",i=0):i=(o=o.slice(0,r)).length-1-o.lastIndexOf("/"),a=l,s=0;continue}}else if(o.length){o="",i=0,a=l,s=0;continue}t&&(o=o.length?o+"/..":"..",i=2)}else o.length?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t),n.length||t||(n=".");n.length&&47===e.charCodeAt(e.length-1)&&(n+="/");return t?"/"+n:n}(e)},_w.sep="/";var kw={};kw.cwd=function(){return"/"};var Tw=_w,Nw=kw,Ow=ew,Iw=Pw,Aw={}.hasOwnProperty,Rw=["history","path","basename","stem","extname","dirname"];function Pw(e){var t,n;if(e){if("string"==typeof e||Ow(e))e={contents:e};else if("message"in e&&"messages"in e)return e}else e={};if(!(this instanceof Pw))return new Pw(e);for(this.data={},this.messages=[],this.history=[],this.cwd=Nw.cwd(),n=-1;++n-1)throw new Error("`"+t+"` cannot be a path: did not expect `"+Tw.sep+"`")}function Dw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Fw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}Pw.prototype.toString=function(e){return(this.contents||"").toString(e)},Object.defineProperty(Pw.prototype,"path",{get:function(){return this.history[this.history.length-1]},set:function(e){Dw(e,"path"),this.path!==e&&this.history.push(e)}}),Object.defineProperty(Pw.prototype,"dirname",{get:function(){return"string"==typeof this.path?Tw.dirname(this.path):void 0},set:function(e){Fw(this.path,"dirname"),this.path=Tw.join(e||"",this.basename)}}),Object.defineProperty(Pw.prototype,"basename",{get:function(){return"string"==typeof this.path?Tw.basename(this.path):void 0},set:function(e){Dw(e,"basename"),Lw(e,"basename"),this.path=Tw.join(this.dirname||"",e)}}),Object.defineProperty(Pw.prototype,"extname",{get:function(){return"string"==typeof this.path?Tw.extname(this.path):void 0},set:function(e){if(Lw(e,"extname"),Fw(this.path,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.indexOf(".",1)>-1)throw new Error("`extname` cannot contain multiple dots")}this.path=Tw.join(this.dirname,this.stem+(e||""))}}),Object.defineProperty(Pw.prototype,"stem",{get:function(){return"string"==typeof this.path?Tw.basename(this.path,this.extname):void 0},set:function(e){Dw(e,"stem"),Lw(e,"stem"),this.path=Tw.join(this.dirname||"",e+(this.extname||""))}});var jw=ww,Mw=Iw,zw=Mw;Mw.prototype.message=function(e,t,n){var r=new jw(e,t,n);this.path&&(r.name=this.path+":"+r.name,r.file=this.path);return r.fatal=!1,this.messages.push(r),r},Mw.prototype.info=function(){var e=this.message.apply(this,arguments);return e.fatal=null,e},Mw.prototype.fail=function(){var e=this.message.apply(this,arguments);throw e.fatal=!0,e};var Uw=Zb,Bw=ew,Hw=function e(){var t,n,r,o,i,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},Gw=dw,Ww=zw,Vw=function e(){var t,n=[],r=Gw(),o={},i=-1;return a.data=function(e,n){if("string"==typeof e)return 2===arguments.length?(Zw("data",t),o[e]=n,a):Qw.call(o,e)&&o[e]||null;if(e)return Zw("data",t),o=e,a;return o},a.freeze=s,a.attachers=n,a.use=function(e){var r;if(Zw("use",t),null==e);else if("function"==typeof e)c.apply(null,arguments);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?u(e):i(e)}r&&(o.settings=Hw(o.settings||{},r));return a;function i(e){u(e.plugins),e.settings&&(r=Hw(r||{},e.settings))}function s(e){if("function"==typeof e)c(e);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?c.apply(null,e):i(e)}}function u(e){var t=-1;if(null==e);else{if("object"!=typeof e||!("length"in e))throw new Error("Expected a list of plugins, not `"+e+"`");for(;++t13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":uE(n)},dE={};var fE=function(e){return e<-2};var pE=function(e){return-2===e||-1===e||32===e},hE=pE;var mE=function(e,t,n,r){var o=r?r-1:1/0,i=0;return function(r){if(hE(r))return e.enter(n),a(r);return t(r)};function a(r){return hE(r)&&i++t;)o.containerState=i[s][1],i[s][0].exit.call(o,e);i.length=t}},TE={tokenize:function(e,t,n){return _E(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}},NE={tokenize:function(e,t,n){return _E(e,e.lazy(this.parser.constructs.flow,t,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}};bE.tokenize=kE;var OE={};var IE=function(e){for(var t=-1,n=0;++ti?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(o=Array.from(r)).unshift(t,n),PE.apply(e,o);else for(n&&PE.apply(e,[t,n]);a-1||$E(r.events,"linePrefix")<4?e.interrupt(r.parser.constructs.flow,n,t)(o):t(o)}},partial:!0};var QE=VE;Object.defineProperty(OE,"__esModule",{value:!0});var KE=QE,YE=mE,XE=SE,JE=function(e){var t=this,n=e.attempt(XE,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,YE(e,e.attempt(this.parser.constructs.flow,r,e.attempt(KE,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}};OE.tokenize=JE;var ZE={};Object.defineProperty(ZE,"__esModule",{value:!0});var eS=iE,tS=FE,nS=iS("text"),rS=iS("string"),oS={resolveAll:aS()};function iS(e){return{tokenize:function(t){var n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){var t=r[e],o=-1;if(null===e)return!0;if(t)for(;++o-1&&(n[0]=n[0].slice(o)),a>0&&n.push(e[i].slice(0,a))),n};var NS=function(e,t,n){var r=n?kS(n):{line:1,column:1,offset:0},o={},i=[],a=[],s=[],l={consume:function(e){wS(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e},enter:function(e,t){var n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){var t=s.pop();return t.end=f(),u.events.push(["exit",t,u]),t},attempt:g((function(e,t){v(e,t.from)})),check:g(m),interrupt:g(m,{interrupt:!0}),lazy:g(m,{lazy:!0})},u={previous:null,events:[],parser:e,sliceStream:d,sliceSerialize:function(e){return CS(d(e))},now:f,defineSkip:function(e){o[e.line]=e.column,y()},write:function(e){if(a=ES(a,e),p(),null!==a[a.length-1])return[];return v(t,0),u.events=_S(i,u.events,u),u.events}},c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),r._index=0,r._bufferIndex=-1,u;function d(e){return TS(a,e)}function f(){return kS(r)}function p(){for(var e,t;r._index-1)return v();return e.tokenize.call(t?bS({},u,t):u,l,g,v)(n)}}function g(t){return e(d,p),o}function v(e){return p.restore(),++c1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1)>1?"strongSequence":"emphasisSequence",start:BS($S(e[n][1].end),-s),end:$S(e[n][1].end)},a={type:s>1?"strongSequence":"emphasisSequence",start:$S(e[c][1].start),end:BS($S(e[c][1].start),s)},o={type:s>1?"strongText":"emphasisText",start:$S(e[n][1].end),end:$S(e[c][1].start)},r={type:s>1?"strong":"emphasis",start:$S(i.start),end:$S(a.end)},e[n][1].end=$S(i.start),e[c][1].start=$S(a.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=MS(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=MS(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=MS(l,HS(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=MS(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=MS(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,zS(e,n-1,c-n+3,l),c=n+l.length-u-2;break}c=-1;for(;++c-1?void 0:4)}},exit:function(e){e.exit("blockQuote")}};var rx=nx,ox=RS(/[!-/:-@[-`{-~]/);var ix,ax={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return ox(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},sx=function(e){var t,n="&"+e+";";if((ix=ix||document.createElement("i")).innerHTML=n,59===(t=ix.textContent).charCodeAt(t.length-1)&&"semi"!==e)return!1;return t!==n&&t};var lx=RS(/\d/),ux=RS(/[\dA-Fa-f]/),cx=VS,dx=lx,fx=ux;function px(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var hx=px(sx);var mx={name:"characterReference",tokenize:function(e,t,n){var r,o,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,o=cx,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=fx,u):(e.enter("characterReferenceValue"),r=7,o=dx,u(t))}function u(s){var l;return 59===s&&a?(l=e.exit("characterReferenceValue"),o!==cx||hx.default(i.sliceSerialize(l))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)):o(s)&&a++-1?void 0:4);function i(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}function a(t){return t===r?(e.consume(t),o++,a):ou?n(o):(e.consume(o),h):41===o?c--?(e.consume(o),h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o)):null===o||Ax(o)?c?n(o):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o)):Ix(o)?n(o):(e.consume(o),92===o?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}},Lx=fE,Dx=pE;var Fx=function(e,t,n,r,o,i){var a,s=this,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):Lx(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||Lx(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a=a||!Dx(t),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}},jx=fE,Mx=pE,zx=mE;var Ux=function(e,t){var n;return function r(o){if(jx(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(Mx(o))return zx(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}},Bx=fE,Hx=mE;var $x=function(e,t,n,r,o,i){var a;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):Bx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Hx(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||Bx(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}},Gx=fE,Wx=IS,Vx=sE,qx=Px,Qx=Fx,Kx=mE,Yx=Ux,Xx=$x,Jx={name:"definition",tokenize:function(e,t,n){var r,o=this;return function(t){return e.enter("definition"),Qx.call(o,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function i(t){return r=Vx(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),Yx(e,qx(e,e.attempt(Zx,Kx(e,a,"whitespace"),Kx(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(t)}function a(i){return null===i||Gx(i)?(e.exit("definition"),o.parser.defined.indexOf(r)<0&&o.parser.defined.push(r),t(i)):n(i)}}},Zx={tokenize:function(e,t,n){return function(t){return Wx(t)?Yx(e,r)(t):n(t)};function r(t){return 34===t||39===t||40===t?Xx(e,Kx(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):n(t)}function o(e){return null===e||Gx(e)?t(e):n(e)}},partial:!0};var e_=Jx,t_=fE;var n_={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(t),r};function r(r){return t_(r)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(r)):n(r)}}},r_=fE,o_=IS,i_=pE,a_=LE,s_=mE;var l_={name:"headingAtx",tokenize:function(e,t,n){var r=this,o=0;return function(t){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),i(t)};function i(s){return 35===s&&o++<6?(e.consume(s),i):null===s||o_(s)?(e.exit("atxHeadingSequence"),r.interrupt?t(s):a(s)):n(s)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||r_(n)?(e.exit("atxHeading"),t(n)):i_(n)?s_(e,a,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),a(t))}function l(t){return null===t||35===t||o_(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),l)}},resolve:function(e,t){var n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},a_(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e}},u_=WS,c_=VS,d_=fE,f_=IS,p_=pE,h_=lE,m_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],g_=["pre","script","style","textarea"],v_=SE,y_={name:"htmlFlow",tokenize:function(e,t,n){var r,o,i,a,s,l=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u};function u(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),p):63===a?(e.consume(a),r=3,l.interrupt?t:P):u_(a)?(e.consume(a),i=h_(a),o=!0,h):n(a)}function c(o){return 45===o?(e.consume(o),r=2,d):91===o?(e.consume(o),r=5,i="CDATA[",a=0,f):u_(o)?(e.consume(o),r=4,l.interrupt?t:P):n(o)}function d(r){return 45===r?(e.consume(r),l.interrupt?t:P):n(r)}function f(r){return r===i.charCodeAt(a++)?(e.consume(r),a===i.length?l.interrupt?t:k:f):n(r)}function p(t){return u_(t)?(e.consume(t),i=h_(t),h):n(t)}function h(a){return null===a||47===a||62===a||f_(a)?47!==a&&o&&g_.indexOf(i.toLowerCase())>-1?(r=1,l.interrupt?t(a):k(a)):m_.indexOf(i.toLowerCase())>-1?(r=6,47===a?(e.consume(a),m):l.interrupt?t(a):k(a)):(r=7,l.interrupt?n(a):o?v(a):g(a)):45===a||c_(a)?(e.consume(a),i+=h_(a),h):n(a)}function m(r){return 62===r?(e.consume(r),l.interrupt?t:k):n(r)}function g(t){return p_(t)?(e.consume(t),g):_(t)}function v(t){return 47===t?(e.consume(t),_):58===t||95===t||u_(t)?(e.consume(t),y):p_(t)?(e.consume(t),v):_(t)}function y(t){return 45===t||46===t||58===t||95===t||c_(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),w):p_(t)?(e.consume(t),b):v(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,E):p_(t)?(e.consume(t),w):(s=void 0,S(t))}function E(t){return t===s?(e.consume(t),x):null===t||d_(t)?n(t):(e.consume(t),E)}function S(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||f_(t)?b(t):(e.consume(t),S)}function x(e){return 47===e||62===e||p_(e)?v(e):n(e)}function _(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return p_(t)?(e.consume(t),C):null===t||d_(t)?k(t):n(t)}function k(t){return 45===t&&2===r?(e.consume(t),O):60===t&&1===r?(e.consume(t),I):62===t&&4===r?(e.consume(t),L):63===t&&3===r?(e.consume(t),P):93===t&&5===r?(e.consume(t),R):!d_(t)||6!==r&&7!==r?null===t||d_(t)?T(t):(e.consume(t),k):e.check(b_,L,T)(t)}function T(t){return e.exit("htmlFlowData"),N(t)}function N(t){return null===t?D(t):d_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N):(e.enter("htmlFlowData"),k(t))}function O(t){return 45===t?(e.consume(t),P):k(t)}function I(t){return 47===t?(e.consume(t),i="",A):k(t)}function A(t){return 62===t&&g_.indexOf(i.toLowerCase())>-1?(e.consume(t),L):u_(t)&&i.length<8?(e.consume(t),i+=h_(t),A):k(t)}function R(t){return 93===t?(e.consume(t),P):k(t)}function P(t){return 62===t?(e.consume(t),L):k(t)}function L(t){return null===t||d_(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),L)}function D(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){var t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},b_={tokenize:function(e,t,n){return function(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(v_,t,n)}},partial:!0};var w_=y_,E_=WS,S_=VS,x_=fE,__=IS,C_=pE,k_=mE;var T_={name:"htmlText",tokenize:function(e,t,n){var r,o,i,a,s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),u):47===t?(e.consume(t),S):63===t?(e.consume(t),w):E_(t)?(e.consume(t),C):n(t)}function u(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o="CDATA[",i=0,m):E_(t)?(e.consume(t),b):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function d(t){return null===t||62===t?n(t):45===t?(e.consume(t),f):p(t)}function f(e){return null===e||62===e?n(e):p(e)}function p(t){return null===t?n(t):45===t?(e.consume(t),h):x_(t)?(a=p,P(t)):(e.consume(t),p)}function h(t){return 45===t?(e.consume(t),D):p(t)}function m(t){return t===o.charCodeAt(i++)?(e.consume(t),i===o.length?g:m):n(t)}function g(t){return null===t?n(t):93===t?(e.consume(t),v):x_(t)?(a=g,P(t)):(e.consume(t),g)}function v(t){return 93===t?(e.consume(t),y):g(t)}function y(t){return 62===t?D(t):93===t?(e.consume(t),y):g(t)}function b(t){return null===t||62===t?D(t):x_(t)?(a=b,P(t)):(e.consume(t),b)}function w(t){return null===t?n(t):63===t?(e.consume(t),E):x_(t)?(a=w,P(t)):(e.consume(t),w)}function E(e){return 62===e?D(e):w(e)}function S(t){return E_(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||S_(t)?(e.consume(t),x):_(t)}function _(t){return x_(t)?(a=_,P(t)):C_(t)?(e.consume(t),_):D(t)}function C(t){return 45===t||S_(t)?(e.consume(t),C):47===t||62===t||__(t)?k(t):n(t)}function k(t){return 47===t?(e.consume(t),D):58===t||95===t||E_(t)?(e.consume(t),T):x_(t)?(a=k,P(t)):C_(t)?(e.consume(t),k):D(t)}function T(t){return 45===t||46===t||58===t||95===t||S_(t)?(e.consume(t),T):N(t)}function N(t){return 61===t?(e.consume(t),O):x_(t)?(a=N,P(t)):C_(t)?(e.consume(t),N):k(t)}function O(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,I):x_(t)?(a=O,P(t)):C_(t)?(e.consume(t),O):(e.consume(t),r=void 0,R)}function I(t){return t===r?(e.consume(t),A):null===t?n(t):x_(t)?(a=I,P(t)):(e.consume(t),I)}function A(e){return 62===e||47===e||__(e)?k(e):n(e)}function R(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):62===t||__(t)?k(t):(e.consume(t),R)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),k_(e,L,"linePrefix",s.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}function L(t){return e.enter("htmlTextData"),a(t)}function D(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}}},N_=IS,O_=gS,I_=LE,A_=sE,R_=vS,P_=FE,L_=Px,D_=Fx,F_=$x,j_=Ux,M_={name:"labelEnd",tokenize:function(e,t,n){var r,o,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){if(!r)return n(t);return r._inactive?l(t):(o=i.parser.defined.indexOf(A_(i.sliceSerialize({start:r.end,end:i.now()})))>-1,e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s)};function s(n){return 40===n?e.attempt(z_,t,o?t:l)(n):91===n?e.attempt(U_,t,o?e.attempt(B_,t,l):l)(n):o?t(n):l(n)}function l(e){return r._balanced=!0,n(e)}},resolveTo:function(e,t){var n,r,o,i,a,s,l,u=e.length,c=0;for(;u--;)if(i=e[u][1],a){if("link"===i.type||"labelLink"===i.type&&i._inactive)break;"enter"===e[u][0]&&"labelLink"===i.type&&(i._inactive=!0)}else if(s){if("enter"===e[u][0]&&("labelImage"===i.type||"labelLink"===i.type)&&!i._balanced&&(a=u,"labelLink"!==i.type)){c=2;break}}else"labelEnd"===i.type&&(s=u);return n={type:"labelLink"===e[a][1].type?"link":"image",start:P_(e[a][1].start),end:P_(e[e.length-1][1].end)},r={type:"label",start:P_(e[a][1].start),end:P_(e[s][1].end)},o={type:"labelText",start:P_(e[a+c+2][1].end),end:P_(e[s-2][1].start)},l=O_(l=[["enter",n,t],["enter",r,t]],e.slice(a+1,a+c+3)),l=O_(l,[["enter",o,t]]),l=O_(l,R_(t.parser.constructs.insideSpan.null,e.slice(a+c+4,s-3),t)),l=O_(l,[["exit",o,t],e[s-2],e[s-1],["exit",r,t]]),l=O_(l,e.slice(s+1)),l=O_(l,[["exit",n,t]]),I_(e,a,e.length,l),e},resolveAll:function(e){var t,n=-1;for(;++n-1?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},iC={tokenize:function(e,t,n){var r=this;return tC(e,(function(e){return J_(e)||!Z_(r.events,"listItemPrefixWhitespace")?n(e):t(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:5)},partial:!0},aC={tokenize:function(e,t,n){var r=this;return tC(e,(function(e){return Z_(r.events,"listItemIndent")===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0};var sC=oC,lC=fE,uC=FE,cC=mE;var dC={name:"setextUnderline",tokenize:function(e,t,n){var r,o,i=this,a=i.events.length;for(;a--;)if("lineEnding"!==i.events[a][1].type&&"linePrefix"!==i.events[a][1].type&&"content"!==i.events[a][1].type){o="paragraph"===i.events[a][1].type;break}return function(t){if(!i.lazy&&(i.interrupt||o))return e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),r=t,s(t);return n(t)};function s(t){return t===r?(e.consume(t),s):(e.exit("setextHeadingLineSequence"),cC(e,l,"lineSuffix")(t))}function l(r){return null===r||lC(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){var n,r,o,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),o||"definition"!==e[a][1].type||(o=a);i={type:"setextHeading",start:uC(e[r][1].start),end:uC(e[e.length-1][1].end)},e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=uC(e[o][1].end)):e[n][1]=i;return e.push(["exit",i,t]),e}};Object.defineProperty(OS,"__esModule",{value:!0});var fC={42:sC,43:sC,45:sC,48:sC,49:sC,50:sC,51:sC,52:sC,53:sC,54:sC,55:sC,56:sC,57:sC,62:rx},pC={91:e_},hC={"-2":Tx,"-1":Tx,32:Tx},mC={35:l_,42:Y_,45:[dC,Y_],60:w_,61:dC,95:Y_,96:wx,126:wx},gC={38:mx,92:ax},vC={"-5":V_,"-4":V_,"-3":V_,33:$_,38:mx,42:GS,60:[ZS,T_],91:G_,92:[n_,ax],93:H_,95:GS,96:Ox},yC={null:[GS,ZE.resolver]};OS.contentInitial=pC,OS.disable={null:[]},OS.document=fC,OS.flow=mC,OS.flowInitial=hC,OS.insideSpan=yC,OS.string=gC,OS.text=vC;var bC=dE,wC=bE,EC=OE,SC=ZE,xC=hS,_C=NS,CC=lS,kC=OS;var TC=/[\0\t\n\r]/g;var NC=BE;var OC=function(e,t,n){"string"!=typeof t&&(n=t,t=void 0);return function(e){var t=e||{},n=function(e,t){var n=-1;for(;++n-1&&(O.call(this,e),I.call(this,e))}function R(){a("atHardBreak",!0)}function P(){var e=this.resume();this.stack[this.stack.length-1].value=e}function L(){var e=this.resume();this.stack[this.stack.length-1].value=e}function D(){var e=this.resume();this.stack[this.stack.length-1].value=e}function F(){var e=this.stack[this.stack.length-1];s("inReference")?(e.type+="Reference",e.referenceType=s("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),a("referenceType")}function j(){var e=this.stack[this.stack.length-1];s("inReference")?(e.type+="Reference",e.referenceType=s("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),a("referenceType")}function M(e){this.stack[this.stack.length-2].identifier=PC(this.sliceSerialize(e)).toLowerCase()}function z(){var e=this.stack[this.stack.length-1],t=this.resume();this.stack[this.stack.length-1].label=t,a("inReference",!0),"link"===this.stack[this.stack.length-1].type?this.stack[this.stack.length-1].children=e.children:this.stack[this.stack.length-1].alt=t}function U(){var e=this.resume();this.stack[this.stack.length-1].url=e}function B(){var e=this.resume();this.stack[this.stack.length-1].title=e}function H(){a("inReference")}function $(){a("referenceType","collapsed")}function G(e){var t=this.resume();this.stack[this.stack.length-1].label=t,this.stack[this.stack.length-1].identifier=PC(this.sliceSerialize(e)).toLowerCase(),a("referenceType","full")}function W(e){a("characterReferenceType",e.type)}function V(e){var t,n,r=this.sliceSerialize(e),o=s("characterReferenceType");o?(t=LC(r,"characterReferenceMarkerNumeric"===o?10:16),a("characterReferenceType")):t=MC(r),(n=this.stack.pop()).value+=t,n.position.end=l(e.end)}function q(e){I.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function Q(e){I.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function K(){return{type:"blockquote",children:[]}}function Y(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function J(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Z(){return{type:"emphasis",children:[]}}function ee(){return{type:"heading",depth:void 0,children:[]}}function te(){return{type:"break"}}function ne(){return{type:"html",value:""}}function re(){return{type:"image",title:null,url:"",alt:null}}function oe(){return{type:"link",title:null,url:"",children:[]}}function ie(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function ae(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function se(){return{type:"paragraph",children:[]}}function le(){return{type:"strong",children:[]}}function ue(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}(n)(jC(DC(n).document().write(FC()(e,t,!0))))},IC=nE,AC=iE,RC=aE,PC=sE,LC=cE,DC=function(e){var t={defined:[],constructs:xC([kC].concat(CC((e||{}).extensions))),content:n(bC),document:n(wC),flow:n(EC),string:n(SC.string),text:n(SC.text)};return t;function n(e){return function(n){return _C(t,e,n)}}},FC=function(){var e,t=!0,n=1,r="";return function(o,i,a){var s,l,u,c,d,f=[];o=r+o.toString(i),u=0,r="",t&&(65279===o.charCodeAt(0)&&u++,t=void 0);for(;u":""))+")");return d;function d(){var u,c,d=l.concat(a),f=[];if((!t||i(a,s,l[l.length-1]||null))&&(f=function(e){if(null!==e&&"object"==typeof e&&"length"in e)return e;if("number"==typeof e)return[YC,e];return[e]}(n(a,l)),f[0]===JC))return f;if(a.children&&f[0]!==XC)for(c=(r?a.children.length:-1)+o;c>-1&&c$/i,uk=/^<(\/?)([a-z]+)\s*>$/;var ck={},dk=ek,fk=[].splice;function pk(e,t){return function(e){return dk(e,n),e};function n(n,r,o){if(o&&!e(n,r,o)){var i=[r,1];return"unwrap"===t&&n.children&&(i=i.concat(n.children)),fk.apply(o.children,i),r}}}ck.ofType=function(e,t){return pk((function(t,n,r){return!e.includes(t.type)}),t)},ck.ifNotMatch=pk;var hk={exports:{}},mk={},gk="function"==typeof Symbol&&Symbol.for,vk=gk?Symbol.for("react.element"):60103,yk=gk?Symbol.for("react.portal"):60106,bk=gk?Symbol.for("react.fragment"):60107,wk=gk?Symbol.for("react.strict_mode"):60108,Ek=gk?Symbol.for("react.profiler"):60114,Sk=gk?Symbol.for("react.provider"):60109,xk=gk?Symbol.for("react.context"):60110,_k=gk?Symbol.for("react.async_mode"):60111,Ck=gk?Symbol.for("react.concurrent_mode"):60111,kk=gk?Symbol.for("react.forward_ref"):60112,Tk=gk?Symbol.for("react.suspense"):60113,Nk=gk?Symbol.for("react.suspense_list"):60120,Ok=gk?Symbol.for("react.memo"):60115,Ik=gk?Symbol.for("react.lazy"):60116,Ak=gk?Symbol.for("react.block"):60121,Rk=gk?Symbol.for("react.fundamental"):60117,Pk=gk?Symbol.for("react.responder"):60118,Lk=gk?Symbol.for("react.scope"):60119;function Dk(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case vk:switch(e=e.type){case _k:case Ck:case bk:case Ek:case wk:case Tk:return e;default:switch(e=e&&e.$$typeof){case xk:case kk:case Ik:case Ok:case Sk:return e;default:return t}}case yk:return t}}}function Fk(e){return Dk(e)===Ck}mk.AsyncMode=_k,mk.ConcurrentMode=Ck,mk.ContextConsumer=xk,mk.ContextProvider=Sk,mk.Element=vk,mk.ForwardRef=kk,mk.Fragment=bk,mk.Lazy=Ik,mk.Memo=Ok,mk.Portal=yk,mk.Profiler=Ek,mk.StrictMode=wk,mk.Suspense=Tk,mk.isAsyncMode=function(e){return Fk(e)||Dk(e)===_k},mk.isConcurrentMode=Fk,mk.isContextConsumer=function(e){return Dk(e)===xk},mk.isContextProvider=function(e){return Dk(e)===Sk},mk.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===vk},mk.isForwardRef=function(e){return Dk(e)===kk},mk.isFragment=function(e){return Dk(e)===bk},mk.isLazy=function(e){return Dk(e)===Ik},mk.isMemo=function(e){return Dk(e)===Ok},mk.isPortal=function(e){return Dk(e)===yk},mk.isProfiler=function(e){return Dk(e)===Ek},mk.isStrictMode=function(e){return Dk(e)===wk},mk.isSuspense=function(e){return Dk(e)===Tk},mk.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===bk||e===Ck||e===Ek||e===wk||e===Tk||e===Nk||"object"==typeof e&&null!==e&&(e.$$typeof===Ik||e.$$typeof===Ok||e.$$typeof===Sk||e.$$typeof===xk||e.$$typeof===kk||e.$$typeof===Rk||e.$$typeof===Pk||e.$$typeof===Lk||e.$$typeof===Ak)},mk.typeOf=Dk,hk.exports=mk;var jk=hk.exports,Mk=$,zk=Xb,Uk=jk;function Bk(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=t.renderers[e.type];e.position||(e.position={start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}});var i=e.position.start,a=[e.type,i.line,i.column,r].join("-");if(!Uk.isValidElementType(o))throw new Error("Renderer for type `".concat(e.type,"` not defined or is not renderable"));var s=function(e,t,n,r,o,i){var a={key:t},s="string"==typeof r||r===Mk.Fragment;n.sourcePos&&e.position&&(a["data-sourcepos"]=function(e){return[e.start.line,":",e.start.column,"-",e.end.line,":",e.end.column].map(String).join("")}(e.position));n.rawSourcePos&&!s&&(a.sourcePosition=e.position);n.includeNodeIndex&&o.node&&o.node.children&&!s&&(a.index=o.node.children.indexOf(e),a.parentChildCount=o.node.children.length);var l=null!==e.identifier&&void 0!==e.identifier?n.definitions[e.identifier.toUpperCase()]||{}:null;switch(e.type){case"root":Hk(a,{className:n.className});break;case"text":a.nodeKey=t,a.children=e.value;break;case"heading":a.level=e.depth;break;case"list":a.start=e.start,a.ordered=e.ordered,a.spread=e.spread,a.depth=e.depth;break;case"listItem":a.checked=e.checked,a.spread=e.spread,a.ordered=e.ordered,a.index=e.index,a.children=function(e,t){var n=t&&t.node?function(e){var t=e.children,n=e.spread,r=-1;for(;!n&&++r1:t}var Gk=Bk,Wk=ek;function Vk(e){var t=e.children;e.children=[{type:"tableHead",align:e.align,children:[t[0]],position:t[0].position}],t.length>1&&e.children.push({type:"tableBody",align:e.align,children:t.slice(1),position:{start:t[1].position.start,end:t[t.length-1].position.end}})}var qk=ek,Qk=["http","https","mailto","tel"],Kk=Xb,Yk=$,Xk=parseInt((Yk.version||"16").slice(0,2),10)>=16,Jk=Yk.createElement,Zk={break:"br",paragraph:"p",emphasis:"em",strong:"strong",thematicBreak:"hr",blockquote:"blockquote",delete:"del",link:"a",image:"img",linkReference:"a",imageReference:"img",table:eT.bind(null,"table"),tableHead:eT.bind(null,"thead"),tableBody:eT.bind(null,"tbody"),tableRow:eT.bind(null,"tr"),tableCell:function(e){var t=e.align?{textAlign:e.align}:void 0,n=tT(e);return Jk(e.isHeader?"th":"td",t?Kk({style:t},n):n,e.children)},root:function(e){var t=e.className,n=!t&&Yk.Fragment||"div";return Jk(n,t?{className:t}:null,e.children)},text:function(e){var t=e.children||"";return Xk?t:Jk("span",null,t)},list:function(e){var t=tT(e);null!==e.start&&1!==e.start&&void 0!==e.start&&(t.start=e.start.toString());return Jk(e.ordered?"ol":"ul",t,e.children)},listItem:function(e){var t=null;if(null!==e.checked&&void 0!==e.checked){var n=e.checked;t=Jk("input",{type:"checkbox",checked:n,readOnly:!0})}return Jk("li",tT(e),t,e.children)},definition:function(){return null},heading:function(e){return Jk("h".concat(e.level),tT(e),e.children)},inlineCode:function(e){return Jk("code",tT(e),e.children)},code:function(e){var t=e.language&&"language-".concat(e.language),n=Jk("code",t?{className:t}:null,e.value);return Jk("pre",tT(e),n)},html:function(e){if(e.skipHtml)return null;var t=e.allowDangerousHtml||!1===e.escapeHtml,n=e.isBlock?"div":"span";if(!t)return Jk(Yk.Fragment||n,null,e.value);var r={dangerouslySetInnerHTML:{__html:e.value}};return Jk(n,r)},virtualHtml:function(e){return Jk(e.tag,tT(e),e.children)},parsedHtml:function(e){return e["data-sourcepos"]?Yk.cloneElement(e.element,{"data-sourcepos":e["data-sourcepos"]}):e.element}};function eT(e,t){return Jk(e,tT(t),t.children)}function tT(e){var t=e["data-sourcepos"];return t?{"data-sourcepos":t}:{}}var nT={},rT="__RMD_HTML_PARSER__";nT.HtmlParser="undefined"==typeof Symbol?rT:Symbol(rT);var oT=Xb,iT=Vw,aT=BC,sT=Db,lT=GC,uT=function(e){var t,n;return ak(e,"html",(function(e,r,o){n!==o&&(t=[],n=o);var i=function(e){var t=e.value.match(lk);return!!t&&t[1]}(e);if(i)return o.children.splice(r,1,{type:sk,tag:i,position:e.position}),!0;var a=function(e){var t=e.value.match(uk);return!!t&&{tag:t[2],opening:!t[1],node:e}}(e);if(!a)return!0;var s=function(e,t){var n=e.length;for(;n--;)if(e[n].tag===t)return e.splice(n,1)[0];return!1}(t,a.tag);return s?o.children.splice(r,0,function(e,t,n){var r=n.children.indexOf(e.node),o=n.children.indexOf(t.node),i=n.children.splice(r,o-r+1),a=i.slice(1,-1);return{type:sk,children:a,tag:e.tag,position:{start:e.node.position.start,end:t.node.position.end,indent:[]}}}(a,s,o)):a.opening||t.push(a),!0}),!0),e},cT=ck,dT=Gk,fT=function(e){return Wk(e,"table",Vk),e},pT=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qk(e,"definition",(function(e){var n=e.identifier.toUpperCase();n in t||(t[n]={href:e.url,title:e.title})})),t},hT=function(e){var t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;var r=t.indexOf(":");if(-1===r)return t;for(var o=Qk.length,i=-1;++ii||-1!==(i=t.indexOf("#"))&&r>i?t:"javascript:void(0)"},mT=Zk,gT=nT,vT=Object.keys(mT),yT=function(e){var t=e.source||e.children||"";if(e.allowedTypes&&e.disallowedTypes)throw new Error("Only one of `allowedTypes` and `disallowedTypes` should be defined");var n=oT(mT,e.renderers),r=iT().use(aT).use(e.plugins||[]),o=r.runSync(r.parse(t)),i=oT(e,{renderers:n,definitions:pT(o)});return function(e){var t=[fT,lT()],n=e.disallowedTypes;e.allowedTypes&&(n=vT.filter((function(t){return"root"!==t&&-1===e.allowedTypes.indexOf(t)})));var r=e.unwrapDisallowed?"unwrap":"remove";n&&n.length>0&&t.push(cT.ofType(n,r));e.allowNode&&t.push(cT.ifNotMatch(e.allowNode,r));var o=(e.allowDangerousHtml||!1===e.escapeHtml)&&!e.skipHtml,i=(e.astPlugins||[]).some((function(e){return e.identity===gT.HtmlParser}));o&&!i&&t.push(uT);e.astPlugins&&(t=t.concat(e.astPlugins));return t.push(dT),t}(e).forEach((function(e){o=e(o,i)})),o};yT.defaultProps={transformLinkUri:hT},yT.propTypes={className:sT.string,source:sT.string,children:sT.string,sourcePos:sT.bool,rawSourcePos:sT.bool,escapeHtml:sT.bool,allowDangerousHtml:sT.bool,skipHtml:sT.bool,allowNode:sT.func,allowedTypes:sT.arrayOf(sT.oneOf(vT)),disallowedTypes:sT.arrayOf(sT.oneOf(vT)),transformLinkUri:sT.oneOfType([sT.func,sT.bool]),linkTarget:sT.oneOfType([sT.func,sT.string]),transformImageUri:sT.func,astPlugins:sT.arrayOf(sT.func),unwrapDisallowed:sT.bool,renderers:sT.object,plugins:sT.array},yT.types=vT,yT.renderers=mT,yT.uriTransformer=hT;const bT=o(yT),wT=by("a").withConfig({shouldForwardProp:e=>!["noVisitedState","textColour","muted"].includes(e),displayName:"src__Link",componentId:"sc-1loawqx-0"})(...Lm.common(),Lm.styleDefault,Lm.printFriendly,(e=>{let{muted:t=!1}=e;return t?Lm.styleMuted:void 0}),(e=>{let{textColour:t=!1}=e;return t?Lm.styleText:void 0}),(e=>{let{noVisitedState:t=!1}=e;return t?Lm.styleNoVisitedState:void 0}));wT.displayName="Link",by(bT).withConfig({displayName:"src__StyledParagraph",componentId:"sc-sgc9po-0"})({margin:0,"> p":{margin:0},"> p > code":{padding:"0.2em 0.4em",margin:"0",fontSize:"85%",backgroundColor:"rgba(27,31,35,0.05)",borderRadius:"3px"},"> pre":{padding:"16px",overflow:"auto",fontSize:"85%",lineHeight:"1.45",backgroundColor:"#f6f8fa",borderRadius:"3px"},"> pre > code":{display:"inline",padding:"0",margin:"0",border:"0",overflow:"visible",lineHeight:"inherit",wordWrap:"normal"}},(e=>{let{supportingText:t}=e;return Nm.font({size:t?16:19})}),Sm.withWhiteSpace({marginBottom:4})),by(wT).withConfig({displayName:"src__StyledErrorText",componentId:"sc-6d0w2-0"})({fontFamily:om,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",fontWeight:700,marginBottom:Yh,textDecoration:"underline",textDecorationSkipInk:"none",textTransform:"none",cursor:"pointer",fontSize:um,lineHeight:hm,":visited":{color:`${qp}`},[rm.LARGESCREEN]:{fontSize:cm,lineHeight:mm},color:`${qp}`,paddingTop:"4px",paddingBottom:"2px"}),by("div").withConfig({displayName:"src__StyledErrorSummary",componentId:"sc-6d0w2-1"})({color:Yp,padding:Rh.mobile,border:`4px solid ${qp}`,"&:focus":{outline:`${Oh} solid ${Xp}`,outlineOffset:"0"},[rm.LARGESCREEN]:{padding:Rh.tablet,border:`${Gh} solid ${qp}`}},Sm.withWhiteSpace({marginBottom:6}));by("legend").withConfig({displayName:"legend__StyledLegend",componentId:"sc-12rap65-0"})(Sm.withWhiteSpace(),Nm.font({size:19}),Nm.textColour,{boxSizing:"border-box",display:"table",maxWidth:"100%",marginBottom:Fh[2],padding:0,whiteSpace:"normal"},(e=>{let{size:t}=e;const n=Number.isNaN(Number(t))?zh[t]:t;if(void 0!==t&&!n)throw Error(`Unknown size ${t} used for legend.`);if(n)return{...Nm.font({size:n,weight:"bold"}),...n>19?{marginBottom:Fh[3]}:void 0}})),by("h1").withConfig({displayName:"legend__StyledHeading",componentId:"sc-12rap65-1"})({margin:0,fontSize:"inherit",fontWeight:"inherit"});function ET(){return ET=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{meta:n={},children:r,hint:o,acceptedFormats:i,onChange:a,name:s,...l}=e;return $.createElement(Ab,ET({},l,{error:n.touched&&!!n.error}),$.createElement(Nb,null,r),o&&$.createElement(bb,null,o),n.touched&&n.error&&$.createElement(Ob,null,n.error),$.createElement(ST,{type:"file",accept:i,onChange:a,name:s,ref:t}))})).displayName="FileUpload";by("span").withConfig({shouldForwardProp:e=>!["important","focusable"].includes(e),displayName:"src__VisuallyHidden",componentId:"sc-nxwj55-0"}).attrs((e=>{let{focusable:t=!1,tabIndex:n}=e;return t&&void 0===n?{tabIndex:"0"}:void 0}))((e=>{let{focusable:t=!1,important:n=!0}=e;return gm({focusable:t,important:n})})).displayName="VisuallyHidden",by("div").withConfig({displayName:"width-container__WidthContainer",componentId:"sc-213f5v-0"})({maxWidth:qh,margin:`0 ${Kh}`,[rm.TABLET]:{margin:`0 ${Qh}`},[rm.MAX]:{margin:"0 auto"}},Sm.withWhiteSpace()),by("div").withConfig({displayName:"navigation__NavigationContainer",componentId:"sc-1wmnar6-0"})({display:"flex",marginRight:`-${Kh}`,marginLeft:`-${Kh}`,flexWrap:"wrap"}),by(wT).withConfig({displayName:"link__FooterLink",componentId:"sc-1vhdcoj-0"})({":link, :visited":{color:$p},":hover":{color:Hp}}),by("hr").withConfig({displayName:"section-break__SectionBreak",componentId:"sc-1i3rjvm-0"})({margin:0,border:0,borderBottom:`1px solid ${Qp}`},Sm.withWhiteSpace({marginBottom:8})),by("div").withConfig({displayName:"meta-custom__MetaCustom",componentId:"sc-1dgx5ff-0"})({marginBottom:Sm.simple(4)}),by("svg").withConfig({displayName:"licence__LicenceLogo",componentId:"sc-76bcjk-0"})({display:"inline-block",marginRight:Sm.simple(2),marginBottom:Sm.simple(3),verticalAlign:"top",[rm.DESKTOP]:{marginBottom:0}}),by("span").withConfig({displayName:"licence__LicenceDescription",componentId:"sc-76bcjk-1"})({display:"inline-block"}),by("div").withConfig({displayName:"meta__Meta",componentId:"sc-b55tvf-0"})({display:"flex",marginRight:`-${Kh}`,marginLeft:`-${Kh}`,flexWrap:"wrap",alignItems:"flex-end",justifyContent:"center"},Nm.common()),by("div").withConfig({displayName:"meta-item__MetaItem",componentId:"sc-nseoos-0"})({marginRight:Kh,marginBottom:Sm.simple(5),marginLeft:Kh},(e=>{let{grow:t=!1}=e;return t&&{flex:1,flexBasis:"320px",[rm.DESKTOP]:{flexBasis:0}}})),by(wT).withConfig({displayName:"copyright__StyledCopyright",componentId:"sc-1i22iwf-0"})({display:"inline-block",textAlign:"center",textDecoration:"none",whiteSpace:"nowrap",":link, :visited":{color:$p},":hover":{color:Hp}},(e=>{let{image:t}=e;return t&&{minWidth:t.width,paddingTop:t.height+10,backgroundImage:`url(${t.src})`,backgroundRepeat:"no-repeat",backgroundPosition:"50% 0%",backgroundSize:`${t.width}px ${t.height}px`}})),by("ul").withConfig({displayName:"unordered-list__UnorderedList",componentId:"sc-1r7pzdm-0"})((e=>{let{inline:t=!1}=e;return t?{marginTop:0,marginBottom:Sm.simple(3),padding:0}:{margin:0,padding:0,listStyle:"none",columnGap:`${Qh}`}}),(e=>{let{columns:t}=e;return t&&{[rm.DESKTOP]:{columnCount:t}}})),by("li").withConfig({displayName:"list-item__ListItem",componentId:"sc-hn98ju-0"})((e=>{let{inline:t=!1}=e;return t?{display:"inline-block",marginRight:Sm.simple(3),marginBottom:Sm.simple(1)}:Sm.withWhiteSpace({marginBottom:4})}),{"&:last-child":{marginBottom:0}}),by("div").withConfig({displayName:"section__Section",componentId:"sc-1fjqcmw-0"})({display:"inline-block",marginRight:Kh,marginBottom:Qh,marginLeft:Kh,verticalAlign:"top",flexGrow:1,flexShrink:1,flexBasis:"200px",[rm.DESKTOP]:{flexBasis:"auto","&:first-of-type":{flexGrow:2}}}),by((e=>$.createElement(Yb,Qb({as:"h2",size:Hh[2]},e)))).withConfig({displayName:"section-heading__SectionHeading",componentId:"sc-1i3z2gv-0"})({borderBottom:`1px solid ${Qp}`,paddingBottom:Sm.simple(2),marginTop:0,[rm.DESKTOP]:{paddingBottom:Sm.simple(4)}},Sm.withWhiteSpace({marginBottom:7})),by("footer").withConfig({displayName:"src__FooterContainer",componentId:"sc-1t3c5e2-0"})({borderTop:`1px solid ${Gp}`,background:`${Wp}`,color:`${Bp}`},Nm.font({size:16}),Sm.withWhiteSpace({padding:[{size:7,direction:"top"},{size:5,direction:"bottom"}]}));by("div").withConfig({displayName:"src__FormGroup",componentId:"sc-1m4431t-0"})(Sm.responsiveMargin({size:6,direction:"bottom"}),{"& &:last-of-type":{marginBottom:0}},(e=>{let{error:t=!1}=e;return t?{paddingLeft:Fh[3],borderLeft:`${Vh} solid ${qp}`,"&& &":{padding:0,border:0}}:void 0}),Sm.withWhiteSpace()).displayName="FormGroup";const xT=function(e){for(var t=[],n=1;n{let t=kT(e);if(!t){let n;Object.entries(e).forEach((e=>{let[t,r]=e;if(CT[t]&&!0===r){const e=t.replace("column","").replace(/^([A-Z][a-z]+)([A-Z])/,"$1-$2").toLocaleLowerCase();console.warn(`deprecated prop ${t} used in GridCol, please replace with setWidth="${e}"`),n=CT[t]}})),t={[rm.TABLET]:{width:n}}}t[rm.TABLET]=NT(t[rm.TABLET]);const n=TT({setWidth:e.setDesktopWidth});return n&&(n[rm.DESKTOP]=NT(n[rm.DESKTOP])),{...t,...n}}));$.forwardRef(((e,t)=>{let{columnOneQuarter:n=!1,columnOneThird:r=!1,columnOneHalf:o=!1,columnTwoThirds:i=!1,columnThreeQuarters:a=!1,columnFull:s=!1,...l}=e;return $.createElement(OT,_T({columnOneThird:r,columnOneHalf:o,columnTwoThirds:i,columnThreeQuarters:a,columnFull:s,columnOneQuarter:n},l),l.children)})).displayName="GridCol";function IT(){return IT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{meta:t={},children:n,hint:r,input:o={},...i}=e;return $.createElement(Ab,IT({},i,{error:t.touched&&!!t.error}),$.createElement(Nb,null,n),r&&$.createElement(bb,null,r),t.touched&&t.error&&$.createElement(Ob,null,t.error),$.createElement(Ib,IT({error:t.touched&&!!t.error},o)))};AT.displayName="InputField";by("div").withConfig({displayName:"src__InsetText",componentId:"sc-5ju5m4-0"})(Nm.font({size:19}),Nm.textColour,{padding:Fh[3]},Sm.withWhiteSpace({margin:{size:6,direction:["top","bottom"]}}),{clear:"both",borderLeft:`10px solid ${Qp}`,":first-child":{marginTop:0},":only-child,:last-child":{marginBottom:0}}).displayName="InsetText";by("p").withConfig({displayName:"src__LeadParagraph",componentId:"sc-1bvfkuk-0"})(Nm.textColour,Nm.font({size:24}),{marginTop:0},Sm.withWhiteSpace({marginBottom:6})).displayName="LeadParagraph";const RT="a-f\\d",PT=`#?[${RT}]{3}[${RT}]?`,LT=`#?[${RT}]{6}([${RT}]{2})?`,DT=new RegExp(`[^#${RT}]`,"gi"),FT=new RegExp(`^${PT}$|^${LT}$`,"i");const jT=o(((e,t={})=>{if("string"!=typeof e||DT.test(e)||!FT.test(e))throw new TypeError("Expected a valid hex string");let n=1;8===(e=e.replace(/^#/,"")).length&&(n=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),4===e.length&&(n=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const r=Number.parseInt(e,16),o=r>>16,i=r>>8&255,a=255&r,s="number"==typeof t.alpha?t.alpha:n;if("array"===t.format)return[o,i,a,s];if("css"===t.format){return`rgb(${o} ${i} ${a}${1===s?"":` / ${Number((100*s).toFixed(2))}%`})`}return{red:o,green:i,blue:a,alpha:s}}));function MT(){return MT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{children:t,title:n,fill:r="currentColor",width:o="100%",...i}=e;return G.createElement(zT,MT({version:"1.1",height:"100%",fill:r,width:o},i),G.createElement("title",null,n),t)},BT=e=>{let{fill:t="currentColor",title:n="Search",...r}=e;return $.createElement(UT,MT({viewBox:"0 0 57 57",title:n,fill:t},r),$.createElement("path",{d:"M55.146,51.887L41.588,37.786c3.486-4.144,5.396-9.358,5.396-14.786c0-12.682-10.318-23-23-23s-23,10.318-23,23 s10.318,23,23,23c4.761,0,9.298-1.436,13.177-4.162l13.661,14.208c0.571,0.593,1.339,0.92,2.162,0.92 c0.779,0,1.518-0.297,2.079-0.837C56.255,54.982,56.293,53.08,55.146,51.887z M23.984,6c9.374,0,17,7.626,17,17s-7.626,17-17,17 s-17-7.626-17-17S14.61,6,23.984,6z"}))},HT=function(e){for(var t=[],n=1;n83*e.animationDelay));const $T="icon-loading";function GT(){return GT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{timeIn:t,timeOut:n,backgroundColor:r,backgroundColorOpacity:o}=e;return{position:"absolute",height:"100%",top:0,right:0,left:0,bottom:0,display:"flex",justifyContent:"center",[`& .${$T}`]:{position:"absolute",zIndex:101,opacity:1,display:"block",height:"100%",maxHeight:"calc(50vh + 100px)",transition:`opacity ${t}ms ease-in-out`,willChange:"opacity"},"& .overlay":{zIndex:100,transition:`background-color ${t}ms ease-in-out`,willChange:"background-color",backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n ${o})`},"&.fade-enter":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n 0)`,transitionDuration:`${t}ms`},[`& .${$T}`]:{opacity:0,transitionDuration:`${t}ms`,transitionDelay:t/2+"ms"}},"&.fade-enter-active":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n ${o})`,transitionDuration:`${t}ms`},[`& .${$T}`]:{opacity:1,transitionDuration:`${t}ms`,transitionDelay:t/2+"ms"}},"&.fade-exit":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n ${o})`,transitionDuration:`${n}ms`},[`& .${$T}`]:{opacity:1,transitionDuration:`${n}ms`}},"&.fade-exit-active":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n 0)`,transitionDuration:`${n}ms`},[`& .${$T}`]:{opacity:0,transitionDuration:`${n}ms`}}}})),by("div").withConfig({displayName:"src__Overlay",componentId:"sc-gm1edz-2"})({position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden",height:"100%",width:"100%"}),by("div").withConfig({displayName:"src__OuterContainer",componentId:"sc-1lvyroj-0"})({paddingTop:em,textAlign:"center"}),by("div").withConfig({displayName:"src__InnerContainer",componentId:"sc-1lvyroj-1"})({maxWidth:qh,marginLeft:Jh,marginRight:Jh,textAlign:"left",[rm.LARGESCREEN]:{marginLeft:em,marginRight:em},"@media only screen and (min-width:1020px)":{margin:"0 auto"}}),by("div").withConfig({displayName:"src__StyledFieldset",componentId:"sc-g1up10-0"})({padding:0,margin:0,border:0,boxSizing:"border-box",width:"100%",":after":{content:"''",display:"table",clear:"both"}},(e=>{let{error:t}=e;return{borderLeft:t?`4px solid ${qp}`:void 0,marginRight:t?Jh:void 0,paddingLeft:t?Xh:void 0}}),Sm.withWhiteSpace({marginBottom:0}));const WT=by("a").withConfig({displayName:"src__StyledSkipLink",componentId:"sc-njuwuz-0"})(gm.focusable(),Lm.common(),Lm.styleText,Nm.responsive(16),{display:"block",padding:`${Fh[2]}px ${Fh[3]}px`,"@supports (padding:max(calc(0px)))":{paddingRight:`max(${Fh[3]}px, calc(${Fh[3]}px + env(safe-area-inset-right)))`,paddingLeft:`max(${Fh[3]}px, calc(${Fh[3]}px + env(safe-area-inset-left)))`}});G.forwardRef(((e,t)=>{let{children:n="Skip to main content",href:r="#content",...o}=e;return G.createElement(WT,GT({ref:t,href:r},o),n)})).displayName="SkipLink";var VT=["children","fill","title","className"];function qT(){return qT=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,VT);return G.createElement("svg",qT({version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",className:o,style:{display:"block"},fill:n},i),G.createElement("title",null,r),t)};QT.propTypes={children:Fb.node.isRequired,className:Fb.string,title:Fb.string,fill:Fb.string},QT.defaultProps={className:void 0,title:void 0,fill:"currentColor"};var KT=["fill","title"];function YT(){return YT=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,KT);return G.createElement(QT,YT({viewBox:"0 0 28 21",title:n,fill:t},r),G.createElement("path",{d:"M12.6323095,3.55271368e-15 L13.3909515,2.38583111 L13.3855375,2.39239563 C13.3171852,2.44572391 13.2556006,2.50656416 13.2034905,2.57613454 L13.1967229,2.58141323 L11.3133145,1.98532767 L11.3133145,4.76503003 L13.2007834,3.77500554 L13.204844,3.77899839 C13.2603379,3.85229093 13.3253063,3.91678566 13.3990726,3.97194117 L12.316265,7.24080185 C12.3155883,7.24486238 12.313558,7.24892291 12.3122045,7.25230668 L12.310851,7.25636721 C12.2607711,7.42014185 12.2330242,7.59271431 12.2330242,7.77205431 C12.2330242,8.65657274 12.8854157,9.38611433 13.7347429,9.51131396 C13.7476013,9.51334422 13.7597828,9.51672799 13.7726412,9.5180815 C13.8450539,9.52755607 13.9181434,9.53432362 13.99394,9.53432362 C14.068383,9.53432362 14.1435028,9.52823283 14.2159155,9.5180815 C14.2280971,9.51672799 14.2402787,9.51402098 14.2524603,9.51131396 C15.1017875,9.38611433 15.7555325,8.65657274 15.7555325,7.77205431 C15.7555325,7.59271431 15.7271088,7.42014185 15.6777057,7.25636721 L15.6763522,7.25230668 C15.6756755,7.24824615 15.674322,7.24418562 15.6722917,7.24080185 L14.5894841,3.97194117 C14.6632504,3.91678566 14.7282189,3.85235861 14.7843895,3.77899839 L14.7891268,3.77500554 L16.675919,4.76503003 L16.675919,1.98532767 L14.7904803,2.58141323 L14.785743,2.57613454 C14.7329561,2.50656416 14.672725,2.44572391 14.6030192,2.39239563 L14.5976052,2.38583111 L15.3562472,3.55271368e-15 L13.9952935,3.55271368e-15 L12.6323095,3.55271368e-15 Z M5.84513631,3.57543057 C5.26698475,3.58436374 4.7158357,3.93485501 4.48106948,4.50461481 C4.16786739,5.26068519 4.53026955,6.13227761 5.28336221,6.44087776 C6.05086975,6.75759897 6.92205611,6.39485844 7.23404003,5.63608104 C7.54873098,4.87899553 7.18937422,3.99962044 6.42125761,3.68513251 C6.2333905,3.60777945 6.03787605,3.57245285 5.84513631,3.57543057 Z M22.155602,3.57543057 C21.9627269,3.57245285 21.766468,3.60777945 21.5783302,3.68513251 C20.8108903,3.99962044 20.4515336,4.87899553 20.7655478,5.63608104 C21.0782085,6.39485844 21.9491918,6.75759897 22.7173084,6.44087776 C23.4705364,6.13227761 23.8326002,5.26068519 23.5199395,4.50461481 C23.2851056,3.93485501 22.7342273,3.58436374 22.155602,3.57543057 Z M9.61601365,4.76638354 C9.03806511,4.7753167 8.48651001,5.12553727 8.25167612,5.69556778 C7.93901543,6.45170584 8.30107921,7.32201242 9.05430722,7.63061257 C9.82174708,7.94733378 10.6927304,7.58594676 11.0053911,6.82730471 C11.3194053,6.07069293 10.9600485,5.18982897 10.1926087,4.87473197 C10.0037941,4.79744658 9.80888874,4.76333814 9.61601365,4.76638354 Z M18.3847246,4.76638354 C18.1918495,4.76333814 17.9962674,4.79744658 17.8081296,4.87473197 C17.0413665,5.18982897 16.6799795,6.07069293 16.9939937,6.82730471 C17.3073311,7.58594676 18.1783145,7.94733378 18.9464311,7.63061257 C19.6989823,7.32201242 20.0617229,6.45170584 19.7490622,5.69556778 C19.5142283,5.12553727 18.9633499,4.7753167 18.3847246,4.76638354 Z M2.4654232,5.55547955 C1.88733932,5.56461574 1.33639329,5.91483631 1.1012887,6.48486682 C0.788560341,7.24012509 1.15048877,8.11246194 1.9036491,8.42106209 C2.67156269,8.7377833 3.54335813,8.37504277 3.85588346,7.61640072 C4.17043906,6.85911218 3.80959344,5.98027849 3.04167985,5.66518149 C2.85360971,5.58796378 2.65809527,5.55243416 2.4654232,5.55547955 Z M25.5339616,5.55547955 C25.3417632,5.55243416 25.1461811,5.58796378 24.9580433,5.66518149 C24.1912802,5.98027849 23.8305699,6.85911218 24.1452609,7.61640072 C24.4579216,8.37504277 25.3282281,8.7377833 26.0963448,8.42106209 C26.848896,8.11246194 27.2123133,7.24012509 26.8996526,6.48486682 C26.6648187,5.91483631 26.1125869,5.56461574 25.5339616,5.55547955 Z M1.47668455,9.31167131 C0.898397633,9.32114588 0.347654636,9.67102807 0.11261772,10.2415323 C-0.200381341,10.9974673 0.162054653,11.8691274 0.914910448,12.1777276 C1.68302706,12.4944488 2.55421342,12.1330618 2.86721248,11.373743 C3.18149738,10.6171312 2.82200527,9.73667328 2.05429471,9.42198233 C1.86615689,9.34415554 1.66949197,9.30896429 1.47668455,9.31167131 Z M26.5240537,9.31167131 C26.3318554,9.30896429 26.1362733,9.34415554 25.9481355,9.42198233 C25.1800189,9.73667328 24.8193086,10.6171312 25.1339995,11.373743 C25.4459835,12.1330618 26.3183203,12.4944488 27.0857602,12.1777276 C27.8389882,11.8691274 28.2003752,10.9974673 27.8870378,10.2415323 C27.6528806,9.67102807 27.102679,9.32114588 26.5240537,9.31167131 Z M6.8677127,9.70824958 C5.63798169,11.343289 5.81258441,12.6934147 7.33602697,14.2134058 C6.34390454,13.6645577 4.80266333,14.2418295 5.71140957,16.0954607 C6.18642372,14.9422706 7.2040598,15.2021445 7.41656078,16.1929134 C7.56003279,16.8926778 7.13435406,17.716965 6.20977176,17.8861537 C5.45261857,18.0262419 4.28413386,17.5071711 3.34804672,15.4911187 C3.87571238,15.5039771 4.33570257,15.7706184 4.93422445,16.1827621 L3.95083215,12.9086227 C3.7029369,13.8283324 3.38702779,14.4292906 3.0520342,14.7561631 C2.82613347,14.0936202 2.85882073,13.6151546 3.05995223,12.5844572 L1.03097388,13.3065545 C2.10829973,14.7771425 3.15178785,16.8425979 4.00896538,20.4469936 C7.02878033,20.0152241 10.4172912,19.7722691 13.9978652,19.7722691 C17.5785744,19.7722691 20.9684388,20.0152241 23.9887952,20.4483471 C24.8462434,16.8425979 25.890476,14.7771425 26.9685462,13.3065545 L24.9396356,12.5844572 C25.1413085,13.6151546 25.173116,14.0936202 24.9470799,14.7561631 C24.612763,14.4292906 24.2946883,13.8283324 24.0469961,12.9086227 L23.065025,16.1827621 C23.6625994,15.7706184 24.1248229,15.5039771 24.6526916,15.4911187 C23.7167398,17.5071711 22.5473076,18.0262419 21.7893423,17.8861537 C20.8648954,17.716965 20.4392166,16.8926778 20.5826886,16.1929134 C20.7958664,15.2021445 21.8130287,14.9422706 22.2881106,16.0954607 C23.1963154,14.2418295 21.6553449,13.6645577 20.6632225,14.2134058 C22.1872741,12.6934147 22.3612001,11.343289 21.1315367,9.70824958 C19.417317,11.0184467 19.3976911,12.3151088 20.1691915,14.1403163 C19.1682713,12.9952473 17.6103819,13.6090638 18.1727651,15.4593113 C18.8941856,14.342666 19.8511168,15.0458141 19.7008772,16.1069655 C19.5743241,17.0320892 18.3534586,17.7778729 16.8327907,17.6459058 C14.6543172,17.4482934 14.5237036,15.9458979 14.4695632,14.7006692 C15.0048762,14.601863 15.9692517,15.0979242 16.7915087,16.2524678 L17.0946948,12.7800393 C16.200025,13.7132841 15.3872426,13.889917 14.483775,13.9183407 C14.7842541,12.9803587 16.1668641,11.4441255 16.1668641,11.4441255 L14.1589328,11.4441255 L14.1575793,11.4441255 L11.83225,11.4441255 C11.83225,11.4441255 13.2141832,12.9803587 13.515339,13.9183407 C12.6118715,13.889917 11.799089,13.7132841 10.9044193,12.7800393 L11.2076054,16.2524678 C12.0305392,15.0979242 12.9942379,14.601863 13.5295509,14.7006692 C13.4760873,15.9458979 13.3454736,17.4482934 11.1663234,17.6459058 C9.6456555,17.7778729 8.42614349,17.0320892 8.29959035,16.1069655 C8.1493508,15.0458141 9.10425172,14.342666 9.82634902,15.4593113 C10.3887322,13.6090638 8.83016606,12.9952473 7.82992257,14.1403163 C8.60142296,12.3151088 8.58179707,11.0184467 6.86757735,9.70824958 L6.8677127,9.70824958 Z"}))}).defaultProps={title:"GOV.UK",fill:"currentColor"},by("div").withConfig({displayName:"top-nav-wrapper__TopNavWrapper",componentId:"sc-1wnrl5k-0"})((e=>{let{bgColor:t,color:n}=e;return{display:"flex",justifyContent:"center",backgroundColor:t,color:n,fontFamily:om,fontWeight:400,fontSize:lm,lineHeight:pm,[rm.LARGESCREEN]:{fontSize:um,lineHeight:hm}}})),by("div").withConfig({displayName:"top-nav-inner__TopNavInner",componentId:"sc-15yph1v-0"})({display:"flex",flexDirection:"column",width:`calc(100% - ${em})`,maxWidth:"960px",padding:`calc(${Xh} * 0.8) ${Jh}`,boxSizing:"border-box",[rm.LARGESCREEN]:{padding:`calc(${Xh} * 0.8) 0`,flexDirection:"row",width:`calc(100% - ${tm})`}}),by("div").withConfig({displayName:"bottom-nav-wrapper__BottomNavWrapper",componentId:"sc-1334g24-0"})({borderBottom:`10px solid ${dh}`,maxWidth:"960px",margin:"0 auto",width:`calc(100% - ${em})`,[rm.LARGESCREEN]:{width:`calc(100% - ${tm})`}}),by("div").withConfig({displayName:"company__Company",componentId:"sc-fxukuq-0"})({display:"flex",fontWeight:800,alignItems:"center",justifyContent:"flex-start",fontSize:"30px"}),by("div").withConfig({displayName:"logo-search-wrapper__LogoSearchWrapper",componentId:"sc-1iq7ssu-0"})({display:"flex",justifyContent:"space-between",[rm.LARGESCREEN]:{display:"block",paddingRight:Jh,width:"33.33%"}}),by("div").withConfig({displayName:"right-hand-side__RightHandSide",componentId:"sc-1c11aed-0"})({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",marginTop:Xh,[rm.LARGESCREEN]:{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",width:"66.66%",paddingLeft:Jh,marginTop:0}}),by("div").withConfig({displayName:"search-wrapper__SearchWrapper",componentId:"sc-on0jnt-0"})({marginTop:Yh,width:"50%",minWidth:"110px",[rm.LARGESCREEN]:{width:"100%"}}),by("ul").withConfig({shouldForwardProp:e=>!["serviceTitle","open"].includes(String(e)),displayName:"unordered-list__Ul",componentId:"sc-otbf2p-0"})((e=>{let{serviceTitle:t,open:n}=e;return{display:n?"flex":"none",flexWrap:"wrap",margin:0,padding:0,marginTop:Yh,width:"100%",[rm.LARGESCREEN]:{display:"flex",paddingTop:t?0:em,width:"auto"}}})),by("li").withConfig({displayName:"list-item__Li",componentId:"sc-1kicpn1-0"})({flex:"1 0 50%",width:"100%",listStyleType:"none",margin:0,padding:"3px 0",borderBottom:`1px solid ${Vp}`,[rm.LARGESCREEN]:{borderBottom:0,flex:"none",width:"auto",paddingRight:Jh}}),by("label").withConfig({displayName:"menu-button__Button",componentId:"sc-1yd67mz-0"})({display:"flex",alignItems:"center",[rm.LARGESCREEN]:{display:"none"}}),by("div").withConfig({displayName:"menu-button__ButtonText",componentId:"sc-1yd67mz-1"})({cursor:"default",":hover":{textDecoration:"underline"}}),by("div").withConfig({displayName:"menu-button__ButtonIcon",componentId:"sc-1yd67mz-2"})((e=>{let{open:t}=e;return{content:'""',display:"inline-block",width:"0",height:"0",borderStyle:"solid",borderColor:"transparent",clipPath:t?"polygon(50% 0%, 0% 100%, 100% 100%)":"polygon(0% 0%, 50% 100%, 100% 0%)",borderWidth:t?"0 5px 8.66px 5px":"8.66px 5px 0 5px",marginLeft:"5px",borderTopColor:"inherit",borderBottomColor:"inherit"}}));by("div").withConfig({displayName:"icon-title__Container",componentId:"sc-onvli0-0"})({verticalAlign:"baseline"}),by("span").withConfig({displayName:"icon-title__IconContainer",componentId:"sc-onvli0-1"})({width:"36px",maxHeight:"27px",display:"inline-block",marginRight:"7px"}),by("span").withConfig({displayName:"icon-title__TitleContainer",componentId:"sc-onvli0-2"})({display:"inline-block",fontWeight:700});const XT=by("a").withConfig({displayName:"top-nav-anchor__TopNavAnchor",componentId:"sc-lt39h5-0"})({color:oh,textDecoration:"none",textDecorationSkipInk:"none",borderBottom:"1px solid transparent",fontWeight:700,lineHeight:1,":hover":{borderBottomColor:oh},":focus":{outline:`3px solid ${uh}`}});XT.displayName="TopNav.Anchor";by(XT).withConfig({displayName:"nav-link-anchor__NavLinkAnchor",componentId:"sc-1pr115z-0"})({display:"inline-block",":focus":{color:sh,backgroundColor:uh,outline:`3px solid ${uh}`,":hover":{borderBottomColor:sh}}}).displayName="TopNav.NavLink",by("div").withConfig({displayName:"src__ServiceTitleWrapper",componentId:"sc-140rlix-0"})(Nm.font({size:24}),{width:"50%",[rm.LARGESCREEN]:{width:"auto"}}),by("div").withConfig({displayName:"src__MenuButtonWrapper",componentId:"sc-140rlix-1"})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",width:"50%",[rm.LARGESCREEN]:{width:"auto"}}),by("input").withConfig({displayName:"src__Input",componentId:"sc-140rlix-2"})({position:"absolute",top:"-999em",":checked + ul":{display:"flex"},[rm.LARGESCREEN]:{display:"none"}}),by("main").withConfig({displayName:"main__Main",componentId:"sc-hiygwk-0"})(Sm.withWhiteSpace({padding:{size:6,direction:["top","bottom"]}}),{display:"block"}),by("div").withConfig({displayName:"width-container__WidthContainer",componentId:"sc-paw03d-0"})({maxWidth:qh,margin:`0 ${Kh}`,[rm.TABLET]:{margin:`0 ${Qh}`},[rm.MAX]:{margin:"0 auto"}},Sm.withWhiteSpace()),by("li").withConfig({displayName:"anchor__PaginationWrapper",componentId:"sc-2udijf-0"})({boxSizing:"border-box",margin:0,padding:0,listStyleType:"none",fontFamily:om,fontWeight:400,textTransform:"none",fontSize:dm,lineHeight:hm,width:"100%",[rm.LARGESCREEN]:{fontSize:fm,lineHeight:hm},"> a":{boxSizing:"border-box",color:dh,fill:"currentColor",padding:Jh,backgroundColor:oh,textDecoration:"none",outlineColor:"transparent",display:"flex",flexDirection:"column",alignItems:"center",width:"100%",":hover":{backgroundColor:ih},":focus":{outline:`3px solid ${uh}`},":visited":{color:ch}}},(e=>{let{previousPage:t}=e;return{marginRight:t?"3px":void 0," > a":{alignItems:t?"flex-start":void 0}," > a div":{justifyContent:t?"flex-start":void 0," > svg":{height:t?"13px":void 0,width:t?"17px":void 0,marginRight:t?"10px":void 0}}}}),(e=>{let{nextPage:t}=e;return{" > a":{alignItems:t?"flex-end":void 0}," > a div":{justifyContent:t?"flex-end":void 0," > svg":{height:t?"13px":void 0,width:t?"17px":void 0,marginLeft:t?"10px":void 0}}}})),by("div").withConfig({displayName:"anchor__InnerWrap",componentId:"sc-2udijf-1"})({display:"flex",alignItems:"center",width:"100%"}),by("span").withConfig({displayName:"anchor__PageTitle",componentId:"sc-2udijf-2"})({fontSize:lm,lineHeight:pm,textDecoration:"underline",[rm.LARGESCREEN]:{fontSize:um,lineHeight:hm}}),by("a").withConfig({displayName:"anchor__Anchor",componentId:"sc-2udijf-3"})({}),by("ul").withConfig({displayName:"src__StyledList",componentId:"sc-elluw3-0"})(Nm.font({size:19}),{boxSizing:"border-box",display:"flex",flexDirection:"column",marginTop:Fh[5],padding:Fh[2],justifyContent:"space-between",width:"100%",[rm.LARGESCREEN]:{flexDirection:"row"}},Sm.withWhiteSpace({marginBottom:6}));const JT=Number(Ay(Gh));by("div").withConfig({displayName:"src__StyledPanel",componentId:"sc-12tinr5-0"})(Nm.font({size:19}),{boxSizing:"border-box",marginBottom:Fh[3],padding:Fh[6]-JT,border:`${Gh} solid transparent`,textAlign:"center",[rm.TABLET]:{padding:Fh[7]-JT},color:oh,background:"#00703c"},Sm.withWhiteSpace()),by("h1").withConfig({displayName:"src__StyledTitle",componentId:"sc-12tinr5-1"})({marginTop:0,marginBottom:Fh[6],":last-child":{marginBottom:0}},Nm.font({size:48,weight:"bold"})),by("div").withConfig({displayName:"src__StyledBody",componentId:"sc-12tinr5-2"})(Nm.font({size:36}));const ZT={SOLID:{background:dh,text:oh},GREY:{background:"#eeefef",text:"#383f43"},GREEN:{background:"#cce2d8",text:"#005a30"},TURQUOISE:{background:"#bfe3e0",text:"#10403c"},BLUE:{background:"#d2e2f1",text:"#144e81"},PURPLE:{background:"#dbd5e9",text:"#3d2375"},PINK:{background:"#f7d7e6",text:"#80224d"},RED:{background:"#f6d7d2",text:"#942514"},ORANGE:{background:"#fcd6c3",text:"#6e3619"},YELLOW:{background:"#fff7bf",text:"#594d00"}},eN=by("strong").withConfig({displayName:"src__Tag",componentId:"sc-10wvgvx-0"})(Nm.font({size:16,weight:"bold",lineHeight:1}),{display:"inline-block",paddingTop:"5px",paddingRight:"8px",paddingBottom:"4px",paddingLeft:"8px",outline:"2px solid transparent",outlineOffset:-2,letterSpacing:1,textDecoration:"none",textTransform:"uppercase"},(e=>{let{tint:t="SOLID"}=e;return{backgroundColor:ZT[t].background,color:ZT[t].text}}),(e=>{let{inactive:t=!1}=e;return t?{backgroundColor:ZT.GREY.background,color:ZT.GREY.text}:void 0}),(e=>{let{backgroundColor:t}=e;return t?{backgroundColor:t}:void 0}),(e=>{let{color:t}=e;return t?{color:t}:void 0}));function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{inline:t}=e;return t&&{[rm.LARGESCREEN]:{float:"left",clear:"none",marginRight:Fh[4]}}}),(e=>{let{sizeVariant:t}=e;return"SMALL"===t&&{span:{padding:"12px 15px 13px 0",fontSize:um,[rm.LARGESCREEN]:{fontSize:cm,padding:"10px 15px 10px 1px"},":after":{top:15,left:7,borderWidth:5},":before":{top:8,width:24,height:24}}}}),Sm.withWhiteSpace({marginBottom:2})),iN=by("input").withConfig({displayName:"src__Input",componentId:"sc-9fy7us-1"})({position:"absolute",zIndex:1,top:0,left:0,width:nN,height:nN,cursor:"pointer",opacity:0,":checked + span::after":{opacity:1},":focus + span::before":{outline:`${Oh} solid transparent`,outlineOffset:Oh,boxShadow:`0 0 0 4px ${Xp}`}},(e=>{let{disabled:t}=e;return{cursor:t?"auto":"pointer"," + span":{opacity:t?".5":"1",pointerEvents:t?"none":"auto"}}})),aN=by("span").withConfig({displayName:"src__LabelText",componentId:"sc-9fy7us-2"})({display:"inline-block",marginBottom:0,padding:`8px ${rN}px ${Fh[1]}px`,cursor:"pointer",MsTouchAction:"manipulation",touchAction:"manipulation",":before":{content:"''",boxSizing:"border-box",position:"absolute",top:0,left:0,width:nN,height:nN,border:`${Wh} solid black`,borderRadius:"50%",background:"transparent"},":after":{content:"''",position:"absolute",top:Fh[2],left:Fh[2],width:0,height:0,border:`${Fh[2]}px solid`,borderRadius:"50%",background:"currentColor",opacity:0}}),sN=by(bb).withConfig({displayName:"src__StyledRadioHint",componentId:"sc-9fy7us-3"})({display:"block",paddingLeft:rN,paddingRight:rN});$.forwardRef(((e,t)=>{let{inline:n=!1,children:r,className:o,hint:i,sizeVariant:a="MEDIUM",...s}=e;return $.createElement(oN,{inline:n,className:o,sizeVariant:a},$.createElement(iN,tN({type:"radio",ref:t},s)),$.createElement(aN,null,r),i&&$.createElement(sN,null,i))})).displayName="Radio";function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t h3":{marginBottom:Xh},"> ul":{marginBottom:Zh,"> li":{marginBottom:`calc(${Xh} + 2px)`}}},Sm.withWhiteSpace({marginBottom:0})).displayName="RelatedItems";const uN=by.input.attrs((e=>{let{type:t="search"}=e;return{type:t}})).withConfig({displayName:"src__Input",componentId:"sc-bgtefr-0"})({width:"100%",height:"40px",padding:"6px",margin:0,border:`solid 1px ${ah}`,borderRight:0,boxSizing:"border-box",fontFamily:om,fontWeight:400,textTransform:"none",fontSize:"16px",lineHeight:"1.75",background:oh,borderRadius:0,WebkitAppearance:"none",":focus":{marginRight:"3px",outline:`3px solid ${uh}`,outlineOffset:0," ~ button":{width:"46px"}}}),cN=by("button").withConfig({displayName:"src__SearchButton",componentId:"sc-bgtefr-1"})({backgroundColor:lh,border:0,display:"block",color:oh,position:"relative",padding:"10px",width:"45px",height:"40px",backgroundRepeat:"no-repeat",backgroundPosition:"2px 50%",textIndent:"-999em",overflow:"hidden",":focus":{outline:`3px solid ${uh}`,outlineOffset:0}}),dN=by("div").withConfig({displayName:"src__StyledSearchBox",componentId:"sc-bgtefr-2"})({boxSizing:"border-box",display:"flex",width:"100%",background:oh},Sm.withWhiteSpace({marginBottom:0})),fN=$.forwardRef(((e,t)=>$.createElement(dN,lN({},e,{ref:t}))));fN.Input=uN,fN.Button=e=>$.createElement(cN,lN({title:"Search"},e),$.createElement(BT,{fill:oh})),fN.displayName="SearchBox",fN.Input.displayName="SearchBox.Input",fN.Button.displayName="SearchBox.Button";const pN={XL:8,XLARGE:8,L:6,LARGE:6,M:4,MEDIUM:4};function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{level:t}=e;const n=pN[t];return n?Sm.withWhiteSpace({margin:{size:n,direction:["top","bottom"]}}):Sm.withWhiteSpace()}),(e=>{let{visible:t}=e;return t?{borderBottom:`1px solid ${Qp}`}:void 0})).displayName="SectionBreak";const mN=by("select").withConfig({displayName:"src__StyledSelect",componentId:"sc-sgud4a-0"})(Nm.font({size:19}),{boxSizing:"border-box",width:"100%",height:"33px",padding:"5px 4px 4px",border:`2px solid ${sh}`,[rm.LARGESCREEN]:{width:"50%",height:"38px"},":focus":{outline:`3px solid ${uh}`,outlineOffset:0}},(e=>{let{error:t}=e;return{border:t?`4px solid ${qp}`:void 0}})),gN=e=>{let{children:t,hint:n,label:r,meta:o={},input:i={},...a}=e;return $.createElement(Ab,hN({},a,{error:o.touched&&!!o.error}),$.createElement(Nb,null,r),n&&$.createElement(bb,null,n),o.touched&&o.error&&$.createElement(Ob,null,o.error),$.createElement(mN,hN({error:o.touched&&!!o.error},i),t))};gN.displayName="Select",mN.displayName="SelectInput",by("thead").withConfig({displayName:"TableHeader",componentId:"sc-1n1nw4b-0"})({}),by("tbody").withConfig({displayName:"TableBody",componentId:"sc-1qqarm8-0"})({}),by("caption").withConfig({displayName:"Caption",componentId:"sc-pvwfz5-0"})({fontWeight:Number($h.bold),display:"table-caption",textAlign:"left"}),by("td").withConfig({displayName:"Cell",componentId:"sc-msv0l6-0"})((e=>{let{numeric:t,alignRight:n=t,bold:r}=e;return{padding:`${Fh[2]}px ${Fh[4]}px ${Fh[2]}px 0`,borderBottom:`1px solid ${Qp}`,textAlign:n?"right":"left",fontWeight:r?Number($h.bold):void 0,":last-child":{paddingRight:0}}}),(e=>{let{numeric:t,isHeader:n}=e;return t&&!n?Nm.font({tabular:!0}):void 0}),Sm.withWidth()),by("tr").withConfig({displayName:"Row",componentId:"sc-1y8eqfp-0"})({}),by("table").withConfig({displayName:"src__StyledTable",componentId:"sc-16s660v-0"})(Nm.font({size:19}),Nm.textColour,{width:"100%",borderSpacing:0,borderCollapse:"collapse"},Sm.withWhiteSpace({marginBottom:6})),by("ul").withConfig({displayName:"list__TabList",componentId:"sc-srtuwr-0"})({margin:0},Sm.responsive({size:6,property:"margin",direction:"bottom"}),{padding:0,listStyle:"none",[rm.TABLET]:{borderBottom:`1px solid ${Qp}`,marginBottom:0,"::after":{content:"''",display:"block",clear:"both"}}}),by("section").withConfig({displayName:"panel__TabPanel",componentId:"sc-1c8lkp4-0"})(Sm.responsiveMargin({size:8,direction:"bottom"}),{[rm.TABLET]:{marginBottom:Sm.simple(0),paddingTop:Sm.simple(6),paddingRight:Sm.simple(4),paddingBottom:Sm.simple(6),paddingLeft:Sm.simple(4),border:`1px solid ${Qp}`,borderTop:0,"& > :last-child":{marginBottom:0}}},(e=>{let{selected:t}=e;return{display:"block",[rm.TABLET]:{display:!t&&"none"}}}));const vN=Sm.simple(1),yN=Sm.simple(2),bN=Sm.simple(3),wN=Sm.simple(4),EN=Sm.simple(5);by("li").withConfig({displayName:"tab__StyledListItem",componentId:"sc-1e33m29-0"})({marginLeft:EN,":before":{content:"'\\2014 '",marginLeft:-EN,paddingRight:vN},[rm.TABLET]:{marginLeft:0,":before":{content:"none"}}}),by("a").withConfig({displayName:"tab__StyledHyperLink",componentId:"sc-1e33m29-1"})(Nm.font({size:19}),Lm.common(),Lm.styleDefault,{display:"inline-block",paddingTop:yN,paddingBottom:yN},(e=>{let{selected:t}=e;return{color:t&&sh,textDecoration:t?"none":void 0,[rm.TABLET]:{marginRight:vN,float:"left",textAlign:"center",textDecoration:"none",color:sh,":link,:visited":{color:sh},marginTop:t?-vN:void 0,marginBottom:t?-1:void 0,paddingTop:t?bN-1:void 0,paddingRight:t?wN-1:wN,paddingBottom:t?bN+1:void 0,paddingLeft:t?wN-1:wN,border:t&&`1px solid ${Qp}`,borderBottom:t?0:1,backgroundColor:t?oh:ih,":focus":{backgroundColor:t?"transparent":ih}}}})),by("h2").withConfig({displayName:"title__StyledTabsTitle",componentId:"sc-5azs4d-0"})(Nm.font({size:19}),{marginBottom:Sm.simple(1),[rm.TABLET]:{display:"none"}}),by("div").withConfig({displayName:"src__TabsContainer",componentId:"sc-k251l1-0"})(Nm.font({size:19}),Nm.textColour,Sm.responsiveMargin({size:1,direction:"top"}),Sm.responsiveMargin({size:6,direction:"bottom"}),Sm.withWhiteSpace()),by("textarea").withConfig({displayName:"src__TextAreaField",componentId:"sc-z0ua7p-0"})({boxSizing:"border-box",fontFamily:om,fontWeight:400,textTransform:"none",fontSize:um,lineHeight:hm,[rm.LARGESCREEN]:{fontSize:cm,lineHeight:mm,width:"75%"},width:"100%",padding:"5px 4px 4px",border:`2px solid ${sh}`,":focus":{outline:`3px solid ${uh}`,outlineOffset:0}},(e=>{let{error:t}=e;return{border:t?`4px solid ${qp}`:void 0}})),by("div").withConfig({displayName:"src__StyledWarningText",componentId:"sc-14ghfbq-0"})({alignItems:"center",boxSizing:"border-box",display:"flex",width:"100%"},Sm.withWhiteSpace({marginBottom:0})),by("div").withConfig({displayName:"src__IconImportantWrapper",componentId:"sc-14ghfbq-1"})({flex:"none",height:35,marginRight:Fh[3],width:35}),by("strong").withConfig({displayName:"src__WarningTextWrapper",componentId:"sc-14ghfbq-2"})(Nm.font({size:19,weight:"bold"}));const SN=({setName:e,name:t,subject:n,setSubject:r,situation:o,setSituation:i,setStage:a,useValidation:s,setMenuOpen:l,handleStartChat:u,headerEndChatButtonRef:c,setSR_errorMessages:d,setSR_chatWindowEvents:f,setPreviousStage:p,channelIdTarget:h})=>{const m=$.useRef(null),[g,v]=$.useState({name:{touched:!1},subject:{touched:!1},situation:{touched:!1}}),[y,b]=$.useState([]);$.useEffect((()=>{document.querySelectorAll('[class*="ErrorText"]').forEach((e=>{e.style.fontSize="19px"}))}),[y]);const w=()=>{try{const e=(e=>({skillId:123456,available:e,status_age:3}))(!0);return!!(null==e?void 0:e.available)||(a("BUSY"),!1)}catch(e){console.error("Error processing availability",e)}};$.useEffect((()=>{p("NEW"),w()}),[]);const E=(e,t)=>{t(e.target.value)};$.useEffect((()=>{const e=[];for(let t in g)if(g[t].error){const n={targetName:`${t}-input`,text:g[t].error};e.push(n)}e.forEach((e=>{"name-input"==e.targetName?e["aria-name"]="name":"subject-input"==e.targetName?e["aria-name"]="subject":"situation-input"==e.targetName&&(e["aria-name"]="situation")})),b(e)}),[g]),$.useEffect((()=>{document.querySelectorAll("[class^='src__LabelText']").forEach((e=>{e.classList.add("!font-bold")}))}),[]);$.useEffect((()=>{y.length>0&&m.current&&m.current.focus()}),[y]);return J.jsxs("div",{className:"prechat-container px-2 !text-19px max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsxs("div",{children:[J.jsx("h1",{tabIndex:0,className:"govuk-heading-l pt-4 mb-4 h1-fix",children:"Tell us about yourself"}),y.length?J.jsx("div",{className:"prechat-row py-4 ",children:J.jsx("div",{className:"border-5 border-gds-error-red py-4 px-4",children:J.jsxs("div",{role:"alert",children:[J.jsx("h2",{tabIndex:0,ref:m,className:"govuk-error-summary__title text-19px",children:"There is a problem"}),J.jsx("div",{className:"govuk-error-summary__body",children:J.jsx("ul",{className:"govuk-list govuk-error-summary__list",children:J.jsx("ul",{children:y.map(((e,t)=>J.jsx("li",{className:"pb-2",children:J.jsx("a",{href:"#",className:"text-19px",onClick:t=>{switch(e.targetName){case"name-input":const e=document.getElementById("name-input");e&&e.focus();break;case"subject-input":const t=document.getElementById("subject-input");t&&t.focus();break;case"situation-input":const n=document.getElementById("situation-input");n&&n.focus()}},children:e.text})},t)))})})})]})})}):null,J.jsx("div",{className:"py-4",style:{fontSize:"19px"},children:J.jsx(AT,{"aria-label":"name-input",style:Yd,htmlFor:"name-input",input:{style:Qd,className:"text-input-git",id:"name-input",name:"name",value:t,onChange:t=>e(t.target.value),"aria-invalid":y.some((e=>"name-input"===e.targetName))?"true":"false"},meta:g.name,children:J.jsx("span",{style:{fontSize:"19px"},children:"Name"})})}),J.jsxs("div",{className:"py-4",children:[J.jsx(Nb,{style:Yd,as:"label",htmlFor:"subject-input",children:J.jsx("span",{style:Yd,children:"What do you need help with?"})}),J.jsxs(gN,{className:"!text-19px",input:{id:"subject-input",style:Kd,className:"govuk-select-fix select-git",name:"subject-select",onChange:e=>E(e,r),value:n,"aria-invalid":y.some((e=>"subject-input"===e.targetName))?"true":"false"},meta:g.subject,children:[J.jsx("option",{value:"",children:"Choose an option"}),J.jsx("option",{value:"Routes into teaching",children:"Routes into teaching"}),J.jsx("option",{value:"Entry requirements for teacher training",children:"Entry requirements for teacher training"}),J.jsx("option",{value:"Support available to get into teaching",children:"Support available to get into teaching"}),J.jsx("option",{value:"Applying for teacher training",children:"Applying for teacher training"}),J.jsx("option",{value:"Funding teacher training",children:"Funding teacher training"}),J.jsx("option",{value:"Getting classroom experience",children:"Getting classroom experience"}),J.jsx("option",{value:"Training to teach in England as non-UK citizen",children:"Training to teach in England as non-UK citizen"}),J.jsx("option",{value:"Teaching in England as a qualified teacher from outside the UK",children:"Teaching in England as a qualified teacher from outside the UK"}),J.jsx("option",{value:"Returning to teaching",children:"Returning to teaching"}),J.jsx("option",{value:"Other",children:"Other"})]})]}),J.jsxs("div",{className:"py-4",children:[J.jsx(Nb,{style:Yd,as:"label",htmlFor:"situation-input",children:J.jsx("span",{style:Yd,children:"What best describes your current situation?"})}),J.jsxs(gN,{style:Yd,htmlFor:"situation-input",input:{style:Kd,id:"situation-input",className:"govuk-select-fix select-git",name:"situation-select",onChange:e=>E(e,i),value:o,"aria-invalid":y.some((e=>"situation-input"===e.targetName))?"true":"false"},meta:g.situation,children:[J.jsx("option",{value:"",children:"Choose an option"}),J.jsx("option",{value:"I am a UK citizen living in the UK",children:"I am a UK citizen living in the UK"}),J.jsx("option",{value:"I am a UK citizen living outside of the UK",children:"I am a UK citizen living outside of the UK"}),J.jsx("option",{value:"I am a non-UK citizen living in the UK",children:"I am a non-UK citizen living in the UK"}),J.jsx("option",{value:"I am a non-UK citizen living outside of the UK",children:"I am a non-UK citizen living outside of the UK"})]})]})]}),J.jsx("div",{className:"prechat-row py-4",children:J.jsxs("p",{tabIndex:0,className:"text-19px",children:["Your details are protected under the terms of our"," ",J.jsx("a",{tabIndex:0,"aria-label":"privacy notice opens in a new tab",href:"https://getintoteaching.education.gov.uk/privacy-policy",className:`text-git-link-default underline visited:text-git-link-visited active:text-git-link-active ${Wd} focus:text-git-link-focus active:text-git-link-active underline focus:decoration-4 focus:text-white focus:bg-black focus:decoration-pink-500 ${Vd}`,target:"_blank",rel:"noopener noreferrer",children:"privacy notice (opens in a new tab)"}),". This explains how we use your personal data."]})}),J.jsx("div",{className:"prechat-row py-4",children:J.jsx(yb,{tabIndex:0,id:"continue-button","aria-label":"start-chat",type:"button",onClick:async()=>{if(!(await(async e=>{let t="",n=!1;t="prod"==e?"https://d3ercbmn7thtar.cloudfront.net/PROD/availability/23062371":"https://d3ercbmn7thtar.cloudfront.net/UAT/availability/23062370";try{n=!!(await Up.get(t)).data.available}catch(r){console.error("couldn't get open hours",r)}finally{return n}})(h)))return console.error("chat operations are unavailable"),a("UNAVAILABLE"),void localStorage.clear();if(s){const e=(()=>{let e={name:"",subject:"",situation:""};return n||(e.subject="Tell us what you need help with"),o||(e.situation="Tell us what best describes your current situation"),t&&t.trim()?t.length>30&&(e.name="First name must be 30 characters or less"):e.name="Enter your name",e})();let r={...g};for(let t in g)e.hasOwnProperty(t)?r[t]={error:e[t],touched:!0}:r[t]={};v(r);if(Object.keys(e).filter((t=>""!==e[t])).length>0)return console.error("errors present on the form"),void m.current.focus()}const e={name:t,candidate_enquiry:n,candidate_situation:o};l(!1);if(!w())return;a("OPEN"),localStorage.setItem("firstLoad","false"),localStorage.setItem("chatStatus","OPEN");const r=`I need help with ${n.charAt(0).toLowerCase()+n.slice(1)}.\n${o}.`;await u(r,e);try{c.current.focus()}catch(i){console.error(i)}},className:"govuk-!-static-margin-top-3 button-git",style:{width:"100%",fontSize:"19px"},children:"Start chat"})})]})},xN=()=>J.jsxs("div",{className:"typing-indicator",children:[J.jsx("div",{}),J.jsx("div",{}),J.jsx("div",{})]}),_N=({type:e,queuePosition:t,name:n})=>{switch(e){case"queuePosition":return J.jsx(J.Fragment,{children:J.jsxs("div",{className:"govuk-grid-column-full govuk-!-static-padding-0",children:[J.jsx("div",{className:"force-pl-0 pl-0 pr-2 pt-2 pb-2 w-full message-header",children:J.jsx("p",{tabIndex:0,className:`govuk-body-s govuk-!-static-padding-bottom-0 govuk-!-static-margin-bottom-0 text-16px ${qd}`,children:"Get Into Teaching"})}),J.jsx("p",{tabIndex:0,className:`p-2 border border-black rounded-lg w-full bg-gray-min-contrast text-white box-border break-words whitespace-pre-wrap ${qd} rounded-lg text-19px`,children:"Thanks. We can now connect you to a member of our support team. Our support team are real people, so it might take a minute or two for them to reply to messages."})]})});case"loadingMessage":return J.jsx(J.Fragment,{children:J.jsxs("div",{className:"govuk-grid-column-full govuk-!-static-padding-0",children:[J.jsx("div",{className:"force-pl-0 pl-0 pr-2 pt-2 pb-2 w-full message-header",children:J.jsx("p",{tabIndex:0,className:"govuk-body-s govuk-!-static-padding-bottom-0 govuk-!-static-margin-bottom-0 text-16px",children:"Get Into Teaching"})}),J.jsx("div",{className:"p-2 border border-black rounded-lg w-full bg-gray-min-contrast text-white box-border break-words whitespace-pre-wrap",children:"Messages loading..."})]})});case"agentJoined":return J.jsx("div",{className:"line-through",children:J.jsxs("p",{className:"agent-joined",children:["Agent ",n," joined the conversation"]})},n);default:return null}},CN=({messages:e,chatWindowRef:t,agentTyping:n,queuePosition:r,agentResolvedCase:o,agentEscalatedCase:i,setSR_messages:a,setSR_newAgentAssigned:s,stage:l,handleSaveTranscript:u,messageCount:c,setMessageCount:d,surveyInProgress:f,setSurveyInProgress:p,surveyFinished:h,setSurveyFinished:m,surveyLookupValues:g,setSurveyLookupValues:v,enteredSurvey:y,setEnteredSurvey:b,surveyInputResponse:w,setSurveyInputResponse:E,surveyHeader:S,setSurveyHeader:x,surveyMessageTextArray:_,setSurveyMessageTextArray:C,surveyMessageText:k,setSurveyMessageText:T,surveyMessageType:N,setSurveyMessageType:O,surveyLookups:I,setSurveyLookups:A,surveyAccessToken:R,setSurveyAccessToken:P,surveyTenantId:L,setSurveyTenantId:D,surveyHostname:F,setSurveyHostname:j,surveyId:M,isMock:z,setIsMock:U,surveyFinalMock:B,setSurveyFinalMock:H,mockSurveyFinished:G,setMockSurveyFinished:W,menuButtonTouched:V,onAndroidChrome:q,oniOSSafari:Q,oniOSChrome:K,messageInputHeight:Y,headerHeight:X,setAgentName:Z})=>{const[ee,te]=$.useState(!1),[ne,re]=$.useState([]),[oe,ie]=$.useState(""),[ae,se]=$.useState(""),[le,ue]=$.useState(""),[ce,de]=$.useState("");$.useState(!1);const fe=e=>{const t=(new Date).getTimezoneOffset(),n=Math.floor(t/60),r=new Date(e);r.setHours(r.getHours()-n);let o=r.getUTCHours();const i=r.getUTCMinutes(),a=o>=12?"pm":"am";o%=12;return"0"==`${o}`&&(o="12"),`${o}:${i<10?"0"+i:i}${a}`};$.useEffect((()=>{window.scrollTo(0,0)}),[]);$.useEffect((()=>{const t=[];let n="";const r=(e=>{var t;for(const n of e)if(null==(t=null==n?void 0:n.authorUser)?void 0:t.firstName)return n.authorUser.firstName;return""})(e);e.forEach((e=>{var o,i,a,s,l,u;const c=!!(null==(o=null==e?void 0:e.authorUser)?void 0:o.firstName),d=(null==e?void 0:e.authorUser)?c?"agent":"unknown":"user",f={content:(null==(i=null==e?void 0:e.messageContent)?void 0:i.text)||"",type:d,id:e.id,agentName:Xd(null==(a=null==e?void 0:e.authorUser)?void 0:a.firstName,r)||"",userFirstName:(null==(s=null==e?void 0:e.authorEndUserIdentity)?void 0:s.firstName)||"",userLastName:(null==(l=null==e?void 0:e.authorEndUserIdentity)?void 0:l.lastName)||"",timestamp:null==e?void 0:e.createdAt,seen:(null==e?void 0:e.seenAt)||"",read:(null==e?void 0:e.readAt)||"",attachments:(null==e?void 0:e.attachments)||[],url:(null==(u=null==e?void 0:e.attachments[0])?void 0:u.securedPermanentUrl)||""};f.agentName&&f.agentName!==ce&&(n=f.agentName),t.push(f)})),n&&"CLOSED"!==l&&!V&&(Z(n),de(n),s(`Agent ${n} joined the chat`));const o=(e=>{const t=[],n=new Set;for(const r of e)n.has(r.id)||(t.push(r),n.add(r.id));return t})(t);re(o)}),[e,ce,a,s]),$.useEffect((()=>{const e=ne.filter((e=>"user"===e.type)),t=ne.filter((e=>"agent"===e.type)),n=e[e.length-1];ue(`${null==n?void 0:n.userFirstName} ${null==n?void 0:n.userLastName}`);const r=t[t.length-1];"CLOSED"!==l&&(null==r?void 0:r.content)&&((null==r?void 0:r.content)===oe&&(null==r?void 0:r.timestamp)===ae||(ie(null==r?void 0:r.content),se(null==r?void 0:r.timestamp),a(null==r?void 0:r.content)))}),[ne]),$.useLayoutEffect((()=>{e.length>0&&te(!0)}),[e]);const pe=()=>{const e=window.innerHeight-(Y+X+0);document.getElementById("message-container").style.height=`${e}px`};return $.useEffect((()=>{pe(),window.addEventListener("resize",pe),window.addEventListener("orientationchange",pe),pe()}),[]),J.jsxs("div",{ref:t,id:"message-container",className:"flex-auto overflow-y-auto max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[ne.map(((e,t)=>{var n;const r="user"===e.type?`(You) ${e.userFirstName} ${e.userLastName}`:`(Get Into Teaching) ${e.agentName}`,o="user"===e.type&&t===ne.reduce(((e,t,n)=>"user"===t.type?n:e),-1);return J.jsxs(J.Fragment,{children:[" ",J.jsxs("div",{className:"p-2 w-full",children:[J.jsxs("div",{className:"flex flex-row justify-between",children:[J.jsx("p",{tabIndex:0,className:`text-black text-opacity-80 ${qd} text-16px`,children:r}),J.jsx("span",{className:"text-black text-opacity-80",children:fe(e.timestamp)})]}),J.jsxs("p",{tabIndex:0,className:`message-content rounded-lg text-19px p-2 rounded-lg w-full ${qd} box-border break-words whitespace-pre-wrap ${"user"===e.type?"bg-black text-white":"bg-git-light-blue bg-opacity-20"}`,children:[e.content,(null==(n=null==e?void 0:e.attachments)?void 0:n.length)?J.jsx("span",{className:"message-attachment",children:null==e?void 0:e.attachments.map((e=>J.jsxs("span",{children:[e.fileName," uploaded"]},e.fileName)))}):null]}),o&&(null==e?void 0:e.seen)?J.jsx("div",{className:"flex flex-row w-full justify-end-override-important",children:J.jsx("span",{children:"Seen"})}):null]},e.id),0===t&&ne.length?J.jsxs("div",{className:"p-2 w-full",children:[J.jsxs("div",{className:"flex flex-row justify-between",children:[J.jsx("p",{tabIndex:0,className:`text-black text-opacity-80 ${qd} text-16px`,children:"Get Into Teaching"}),J.jsx("span",{className:"text-black text-opacity-80",children:fe(ne[0].timestamp)})]}),J.jsx("p",{tabIndex:0,className:`message-content rounded-lg text-19px p-2 rounded-lg w-full ${qd} box-border break-words whitespace-pre-wrap bg-gray-min-contrast box-border border border-black text-white`,children:"Thanks. We can now connect you to a member of our support team. Our support team are real people, so it might take a minute or two for them to reply to messages."})]},"queueMessage"):null]})})),ee?null:J.jsx("div",{className:"p-2",children:J.jsx(_N,{queuePosition:r,type:"loadingMessage"})}),n&&J.jsxs("div",{className:"typing-indicator-container",children:[J.jsx("p",{className:"typing-indicator-text",children:"Agent is typing"}),J.jsx(xN,{})]})]})},kN=({thread:e})=>{const t=$.useRef(null);return J.jsxs("div",{className:"pr-2 pl-1",children:[J.jsx("input",{type:"file",multiple:!0,onChange:async n=>{const r=n.target.files;if(r.length>0)try{await e.sendAttachments(r);t.current.value=""}catch(o){console.error("couldn't upload file",o)}else console.error("No files to send")},ref:t,style:{display:"none"}}),J.jsx("a",{href:"#",className:`mt-12 text-git-link-default visited:text-git-link-visited hover:text-git-link-hover active:text-git-link-active underline hover:decoration-4 whitespace-nowrap ${Wd} ${Vd}`,id:"upload-button",tabIndex:0,onClick:e=>{e.preventDefault(),t.current.click()},children:"Upload a file"})]})},TN=({messageText:e,setMessageText:t,handleSendMessage:n,handleSendTypingIndicator:r,thread:o,handleHeightChangeMessageInput:i})=>{const a=$.useRef(null),s=$.useRef(null),[l,u]=$.useState(0);$.useState(0);const c=r=>{r.preventDefault(),n(e),t("")},d=()=>{if(a.current){const e=a.current.offsetHeight;u(e)}};return $.useEffect((()=>{d()}),[i]),$.useEffect((()=>{window.addEventListener("resize",d),window.addEventListener("orientationchange",d)}),[]),$.useEffect((()=>{l&&i(l)}),[l]),J.jsx("div",{ref:a,className:"flex-none pb-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:J.jsxs("div",{className:"message-input-container flex flex-col",children:[J.jsx("textarea",{tabIndex:0,value:e,id:"send-message-input","aria-label":"send-message-input",onChange:e=>t(e.target.value),onKeyUp:e=>{"Enter"!==e.key?r():c(e)},placeholder:"Type your message...",className:`message-input p-2 ${qd}`}),J.jsxs("div",{className:"flex flex-row w-full h-14",children:[J.jsx(kN,{thread:o}),J.jsx("div",{className:"pl-2 pr-1 w-full",children:J.jsx(yb,{ref:s,id:"send-message-button",tabIndex:0,type:"button",onClick:c,className:"mt-3 h-full !w-full !text-19px button-git green-button-fix",children:"Send message"})})]})]})})};var NN,ON;(ON=NN||(NN={})).button="button",ON.color="color",ON.file="file",ON.image="image",ON.reset="reset",ON.submit="submit",ON.checkbox="checkbox",ON.radio="radio";const IN=Symbol("Manage ClipboardSub");function AN(e){return!!(null==e?void 0:e[IN])}const RN=globalThis;var PN,LN,DN,FN,jN,MN,zN,UN,BN,HN;"function"==typeof RN.afterEach&&RN.afterEach((()=>{var e;AN((e=globalThis.window).navigator.clipboard)&&e.navigator.clipboard[IN].resetClipboardStub()})),"function"==typeof RN.afterAll&&RN.afterAll((()=>{var e;AN((e=globalThis.window).navigator.clipboard)&&e.navigator.clipboard[IN].detachClipboardStub()})),(LN=PN||(PN={})).text="text",LN.date="date",LN["datetime-local"]="datetime-local",LN.email="email",LN.month="month",LN.number="number",LN.password="password",LN.search="search",LN.tel="tel",LN.time="time",LN.url="url",LN.week="week",(FN=DN||(DN={})).email="email",FN.password="password",FN.search="search",FN.telephone="telephone",FN.text="text",FN.url="url",(MN=jN||(jN={}))["{"]="}",MN["["]="]",(UN=zN||(zN={}))[UN.Trigger=2]="Trigger",UN[UN.Call=1]="Call",(HN=BN||(BN={}))[HN.EachTrigger=4]="EachTrigger",HN[HN.EachApiCall=2]="EachApiCall",HN[HN.EachTarget=1]="EachTarget",HN[HN.Never=0]="Never";const $N=({handleSaveTranscript:e,chatStarted:t,showCloseWindow:n,showSaveTranscript:r,showStartAgain:o,userClosedCase:i,agentClosedCase:a})=>{$.useEffect((()=>{window.scrollTo(0,0),localStorage.clear()}),[]);const[s,l]=$.useState(!1),u=()=>{window.close(),l(!0),localStorage.clear()},c=t?"":"mt-4 pt-4";return J.jsxs("div",{className:`flex flex-col items-center text-19px ${c} `,children:["true"===localStorage.getItem("noChat")||!r||a?null:J.jsx("a",{href:"#",id:"endchat-save-transcript-button",className:`text-blue-500 underline text-19px ${Wd} ${Vd}`,onClick:()=>{e()},children:"Save transcript"}),n&&!s?J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:u,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Close window"}):n&&s?J.jsx(yb,{style:{width:"100%"},onClick:u,id:"close-chat-button",className:"button-git green-button-fix",children:"Unable to close the window, please close it manually."}):null,o?J.jsx("a",{href:"#",id:"endchat-start-again-button",className:`text-blue-500 underline text-19px ${Wd} ${Vd}`,onClick:()=>{localStorage.clear(),window.location.reload()},children:"Start again"}):null]})},GN=async(e,t,n,r,o,i,a,s,l,u,c,d,f)=>{i((e=>[...e,n]));const p=await(async(e,t,n,r,o,i,a)=>{try{const s={header:t,messageBody:{userInput:n,userInputType:"STRING"}},l={headers:{Authorization:`Bearer ${e}`,tenantId:r,"content-type":"application/json"}},u=await Up.post(`https://${o}/npxapi/conversation/v1.0/reply`,s,l);return"NO_INPUT_REQUIRED"==u.data.messageBody.message.messageType&&i(!0),a((e=>e+1)),u}catch(s){console.error("error in replyToSurvey: ",s)}})(e,t,n,r,o,s,a);console.log("survey replyResponse",p),VN(p,l,i,u,c,d,f),a((e=>e+1))},WN=async(e,t,n,r,o,i,a,s,l,u,c,d,f,p)=>{const h=e.trim();await GN(n,r,h,o,i,a,s,l,u,c,d,f,p),t("")},VN=(e,t,n,r,o,i,a)=>{const s=e.data;if(s.header&&t(s.header),s.messageBody.message.messageText&&(n((e=>[...e,s.messageBody.message.messageText])),r(s.messageBody.message.messageText)),s.messageBody.message.messageType&&o(s.messageBody.message.messageType),s.messageBody.message.messageSettings.lookups){i(s.messageBody.message.messageSettings.lookups);a(s.messageBody.message.messageSettings.lookups.map((e=>e.value)))}else i([])},qN=async(e,t,n)=>{const r={tenantId:e,token:t,hostname:n},o={headers:{"Content-Type":"application/json"}};try{const e=await(async(e,t,n)=>{try{return(await Up.post(`https://ye3ijnvr9l.execute-api.eu-west-2.amazonaws.com/Production${e}`,t,n)).data}catch(r){return console.error("API request error:",r),null}})("/get-access-token",r,o);return console.log("accessToken proxy response",e),e}catch(i){console.error("error: ",i)}},QN=async(e,t,n,r,o,i,a,s,l,u,c,d,f,p)=>{let h=a||"none provided",m=s||"none provided",g=c||"none provided",v=f||"none provided",y=p||"none provided";try{const i={survey_id:o,preferred_survey_medium:"SMS",phone:"none_provided",contact_id:"none_provided",first_name:h,last_name:m,agent_name:g,caseid:"none_provided",cxone_agent_id:g,interaction_id:"none_provided",enquiry:v,situation:y},a={headers:{Authorization:`Bearer ${e}`,tenantId:n,"content-type":"application/json"}},s=await Up.post(`https://${r}/npxapi/conversation/v1.0/initiate`,i,a);return t((e=>e+1)),s}catch(b){console.error("error: ",b),console.error(b.message)}},KN=e=>{let t=e;const n=[{value:"5",displayValue:"Very satisfied"},{value:"4",displayValue:"Satisfied"},{value:"3",displayValue:"Neither satisfied nor dissatisfied"},{value:"2",displayValue:"Dissatisfied"},{value:"1",displayValue:"Very dissatisfied"},{value:"",displayValue:"No answer given"}];try{return n.length>0&&n.forEach((n=>{n.value==e&&(t=n.displayValue)})),t}catch(r){return console.error("Error mapping messages to display value: ",r),e}},YN=({tenantId:e,hostname:t,surveyId:n,token:r,handleSaveTranscript:o,messageCount:i,setMessageCount:a,surveyInProgress:s,setSurveyInProgress:l,surveyFinished:u,setSurveyFinished:c,surveyLookupValues:d,setSurveyLookupValues:f,enteredSurvey:p,setEnteredSurvey:h,surveyInputResponse:m,setSurveyInputResponse:g,surveyHeader:v,setSurveyHeader:y,surveyMessageTextArray:b,setSurveyMessageTextArray:w,surveyMessageText:E,setSurveyMessageText:S,surveyMessageType:x,setSurveyMessageType:_,surveyLookups:C,setSurveyLookups:k,surveyAccessToken:T,setSurveyAccessToken:N,surveyTenantId:O,setSurveyTenantId:I,surveyHostname:A,setSurveyHostname:R,setSurveyRefused:P,name:L,subject:D,situation:F,enquiry:j,agentName:M,agentId:z,surveyLoading:U,setSurveyLoading:B,agentClosedCase:H,surveyResponseLoading:G,setSurveyResponseLoading:W,setStage:V})=>{const[q]=$.useState(5e3),[Q,K]=$.useState(""),[Y,X]=$.useState(!0),Z=$.useRef(null),[ee,te]=$.useState(!1),ne=()=>{window.close(),te(!0),localStorage.clear()};$.useEffect((()=>{"END"===x&&c(!0)}),[x]),$.useEffect((()=>{localStorage.clear()}),[]);const re=e=>{N(e)};$.useEffect((()=>{const e=setTimeout((()=>{(G||U)&&(console.log(`Conditions were still true after ${q} milliseconds`),V("SURVEY_TIMEOUT"))}),q);return()=>{clearTimeout(e)}}),[G,U]);const oe=L.split(" "),ie=oe[0]||"",ae=oe.slice(1).join(" "),se=async o=>{console.log("setting loading states to true"),X(!1),B(!0),W(!0);try{o&&(await(async(e,t,n,r,o,i,a,s,l,u,c,d,f,p,h,m,g,v,y,b,w,E,S)=>{p(!0);const x=await qN(e,t,n);x.accessToken&&h(x.accessToken);const _=a||"no_surname_provided",C=await QN(x.accessToken,g,e,n,r,o,i,_,s,l,u,c,d,f);console.log("initiateSurveyResponse",C),VN(C,v,y,b,w,E,S),m("")})(e,r,t,n,"NO_CONTACT_ID",ie,ae,M,"NO_CASE_ID",z,"NO_INTERACTION_ID",j,F,l,re,g,a,y,w,S,_,k,f),h(!0))}catch(i){console.error(i)}finally{console.log("setting loading states to false"),B(!1),W(!1)}};return $.useEffect((()=>{a((e=>e+1))}),[b]),J.jsx("div",{ref:Z,className:"mb-2",children:J.jsxs("div",{className:"flex flex-col",children:[u?J.jsxs(J.Fragment,{children:[" ",J.jsx("p",{tabIndex:0,className:`bg-git-light-blue bg-opacity-20 p-2 mx-2 rounded-xl mt-6 text-19px ${qd}`,children:"Thank you for your feedback. If you'd like to chat with us again, we're open 8:30am to 5:30pm Monday to Friday."},999999999)]}):null,u&&ee?J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:ne,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Unable to close the window, please close it manually."}):u&&!ee?J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:ne,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Close window"}):null,J.jsx("div",{className:"mt-5",children:Y?J.jsxs("div",{className:"max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[" ",J.jsx("p",{tabIndex:0,className:`bg-git-light-blue bg-opacity-20 p-2 mx-2 rounded-lg text-19px ${qd} `,children:H?"This chat has timed out. If you need to speak with us again, refresh the chat. If you no longer need to chat with us, would you be happy to answer 2 questions about your experience today?":"We hope you found our service helpful. Would you be happy to answer 2 questions about your experience today?"},999999999),J.jsxs("div",{className:"flex flex-row my-12",children:[J.jsx(yb,{style:{width:"100%",marginRight:"12px",marginLeft:"12px"},className:"px-16 button-git green-button-fix",onClick:()=>{se(!0),localStorage.clear()},children:"Yes"}),J.jsx(yb,{style:{width:"100%",marginRight:"12px",marginLeft:"12px"},className:"px-12 button-git green-button-fix",onClick:()=>{se(!1),P(!0)},children:"No"})]})]}):null}),Q?J.jsx("p",{className:"mt-6 bg-black text-white p-2 rounded-lg",children:Q},Q):null]})})},XN=({surveyInProgress:e,setSurveyInProgress:t,surveyFinished:n,setSurveyFinished:r,surveyLookupValues:o,setSurveyLookupValues:i,enteredSurvey:a,setEnteredSurvey:s,surveyInputResponse:l,setSurveyInputResponse:u,surveyHeader:c,setSurveyHeader:d,surveyMessageTextArray:f,setSurveyMessageTextArray:p,surveyMessageText:h,setSurveyMessageText:m,surveyMessageType:g,setSurveyMessageType:v,surveyLookups:y,setSurveyLookups:b,setMessageCount:w,surveyAccessToken:E,setSurveyAccessToken:S,surveyTenantId:x,setSurveyTenantId:_,surveyHostname:C,setSurveyHostname:k,handleSaveTranscript:T,chatStarted:N,surveyLoading:O,setSurveyLoading:I,surveyResponseLoading:A,setSurveyResponseLoading:R})=>{const[P,L]=$.useState(0),D=$.useRef(null),F=$.useRef(null);$.useRef(null);const j=[$.useRef(null),$.useRef(null),$.useRef(null),$.useRef(null),$.useRef(null)],M=e=>{""===e&&j[0].current.focus();try{j[5-e].current.focus()}catch(t){console.debug("couldnt focus radio button")}},[z,U]=$.useState(!1),[B,H]=$.useState(!1),G=$.useRef(null),[W,V]=$.useState([]),[q,Q]=$.useState({currentQuestion:{touched:!1}});$.useEffect((()=>{document.querySelectorAll('[class*="ErrorText"]').forEach((e=>{e.style.fontSize="19px"}))}),[W]),$.useEffect((()=>{const e=[];for(let t in q)if(q[t].error){const n={targetName:`${t}-input`,text:q[t].error};e.push(n)}e.forEach((e=>{"name-input"==e.targetName&&(e["aria-name"]="name")})),V(e)}),[q]);$.useEffect((()=>{console.log("surveyResponseLoading",A)}),[A]);return A||O?J.jsx("p",{tabIndex:0,className:` p-2 mx-2 rounded-xl mt-6 text-19px ${qd}`,children:"Loading..."},999999999):J.jsx("div",{className:" pb-4 w-11/12 mx-2",children:e&&!n?J.jsxs(J.Fragment,{children:[J.jsx("div",{className:"survey-input-container flex flex-col items-start justify-start",children:a&&!O?(e=>{const t=[...y].reverse();return e.length>0&&y.length>0?"string"==typeof e[0]?J.jsxs(J.Fragment,{children:[W.length?J.jsx("div",{className:"prechat-row py-4 ",children:J.jsx("div",{className:"border-5 border-gds-error-red py-4 px-4",children:J.jsxs("div",{role:"alert",children:[J.jsx("h2",{tabIndex:0,ref:G,className:"govuk-error-summary__title text-19px",children:"There is a problem"}),J.jsx("div",{className:"govuk-error-summary__body",children:J.jsx("ul",{className:"govuk-list govuk-error-summary__list",children:J.jsx("ul",{children:W.map(((e,t)=>J.jsx("li",{className:"pb-2",tabIndex:0,children:J.jsx("a",{tabIndex:0,href:"#",className:"text-19px",onClick:e=>{0==l||"0"==l||l?M(l):(console.log("attempting to focus first radio"),u(5),M(5))},children:e.text})},t)))})})})]})})}):null,J.jsx("div",{className:"govuk-form-group self-start "+(W.length?"govuk-form-group--error":""),children:J.jsxs("fieldset",{className:"govuk-fieldset",children:[J.jsx("legend",{className:"govuk-fieldset__legend govuk-fieldset__legend--l",children:J.jsx("h1",{ref:F,tabIndex:0,className:"govuk-fieldset__heading",children:h})}),W.length?J.jsxs("p",{id:"whereDoYouLive-error",className:"govuk-error-message",tabIndex:0,children:[J.jsx("span",{className:"govuk-visually-hidden",children:"Error:"})," Select one of the options below"]}):null,J.jsx("div",{className:"govuk-radios flex flex-col","data-module":"govuk-radios",children:t.map(((e,t)=>J.jsxs("div",{className:"govuk-radios__item",children:[J.jsx("input",{className:"govuk-radios__input text-19px radio-git",id:`surveyOption${t}`,name:"surveyOption",ref:j[t],type:"radio",value:e.value,onChange:e=>u(e.target.value),checked:l===e.value,onFocus:()=>{0!=P||z||l?1!=P||B||l||(u(y[4].value),H(!0)):(u(y[4].value),U(!0))}}),J.jsx("label",{className:"govuk-label govuk-radios__label text-19px",htmlFor:`surveyOption${t}`,children:KN(e.value)})]},t)))})]})})]}):void 0:J.jsxs("div",{className:"govuk-form-group",children:[J.jsx("h1",{className:"govuk-label-wrapper",children:J.jsx("label",{ref:F,className:"govuk-label govuk-label--l",tabIndex:0,children:h})}),J.jsx("div",{id:"more-detail-hint",className:"govuk-hint"}),J.jsx("textarea",{className:`message-input p-2 ${qd}`,id:"more-detail",name:"moreDetail",rows:"5","aria-describedby":"more-detail-hint",onChange:e=>u(e.target.value),onKeyUp:e=>{"Enter"!==e.key||WN(l,u,E,c,x,C,p,w,r,d,m,v,b,i)}})]})})(o):null}),J.jsx("div",{className:"mt-6",children:O?null:J.jsx(yb,{disabled:O||A,ref:D,style:{width:"100%",fontSize:"19px"},className:"py-4 mt-2 button-git green-button-fix",onClick:async()=>{if(A)return void console.log("Response is already being processed");const e=(()=>{let e={currentQuestion:""};return console.log("surveyInputResponse",l),console.log("surveyStep",P),2==P&&(e.currentQuestion=""),0!=P||l||(e.currentQuestion="Select an option for how satisfied you were with our service today, based on today's chat."),1!=P||l||(e.currentQuestion="Select an option for how satisfied you were with the communication and professionalism of the person you spoke to, based on today’s chat."),e})();let t={...q};for(let r in q)e.hasOwnProperty(r)?t[r]={error:e[r],touched:!0}:t[r]={};Q(t);if(Object.keys(e).filter((t=>""!==e[t])).length>0)return console.error("Errors present on the form"),D.current.blur(),G.current.focus(),void R(!1);R(!0);try{await WN(l,u,E,c,x,C,p,w,r,d,m,v,b,i),L((e=>e+1))}catch(n){console.error("Onclick to load next survey question failed: ",n)}finally{R(!1)}D.current&&D.current.blur(),F.current&&F.current.focus()},children:"Submit response"})}),J.jsx("div",{className:"mt-4",children:J.jsx($N,{handleSaveTranscript:T,chatStarted:N,showCloseWindow:!1,showSaveTranscript:!1,showStartAgain:!1})})]}):null})},JN=({networkConnectionRestored:e})=>J.jsx(J.Fragment,{children:e?J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"Chat is offline"}),J.jsx("p",{children:"We have temporarily lost our connection to chat. Sorry for the inconvenience, please try again later."})]}):J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"Chat is back online."}),J.jsxs("p",{children:["Please"," ",J.jsx("button",{id:"websocket-refresh-button",onClick:()=>{window.location.reload()},className:"underline text-blue-600",children:"refresh"})," ","to continue talking to us."]})]})})}),ZN=({handleErrorEndChat:e})=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{className:"text-19px",children:"Something went wrong."}),J.jsxs("p",{className:"text-19px",children:["Please try refreshing the page, or"," ",J.jsx("button",{onClick:()=>{e(),localStorage.clear(),window.location.reload()},id:"error-page-start-again-button",className:"underline text-blue-600",children:"starting again"}),"."]})]})}),eO=()=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto ",children:[J.jsx("h1",{children:"Our service is busy at the moment."}),"Our open hours are X-Y."]})}),tO=()=>{const[e,t]=$.useState(!1),n=()=>{window.close(),t(!0),localStorage.clear()};return J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto ",children:[J.jsx("h1",{children:"The live chat service is now closed."}),J.jsx("h1",{className:"mb-4",children:"If you want to speak to us, we're open 8:30am to 5:30pm Monday to Friday."}),e?J.jsx(yb,{style:{width:"100%"},onClick:n,id:"close-chat-button",className:"button-git green-button-fix",children:"Unable to close the window, please close it manually."}):J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:n,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Close window"})]})})},nO=()=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"This form has timed out."}),J.jsx("p",{children:"To speak to us, refresh this form and enter your details."})]})}),rO=({email:e,setEmail:t,stage:n,setStage:r,handleEndChat:o,handleSaveTranscript:i,previousStage:a,setSR_Messages:s,setSR_chatWindowEvents:l,chatStarted:u,setAgentClosedCase:c})=>J.jsx("div",{className:"px-2 !text-19px max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:J.jsxs("div",{className:"flex flex-col",children:[u?J.jsx(J.Fragment,{children:J.jsx("p",{className:"text-19px font-bold my-6 ",children:"Would you like to download a copy of this chat before you go?"})}):null,J.jsx("button",{className:"flex justify-center !text-19px items-center h-full px-4 py-2 whitespace-nowrap text-black text-center bg-git-light-grey border-b-2 border-gray-500 hover:bg-gray-300 focus:outline-none focus:ring-4 focus:ring-yellow-300 button-git gray-button-fix focus:text-white",onClick:i,style:{paddingTop:"9px",paddingBottom:"9px"},children:J.jsx("span",{style:{lineHeight:"19px"},children:"Download chat"})}),u?J.jsx(J.Fragment,{children:J.jsx("div",{style:{marginTop:"24px"},children:J.jsx(yb,{className:"button-git green-button-fix",onClick:async()=>{c(!1);"CLOSED"!==localStorage.getItem("chatStatus")&&u&&(r("CLOSED"),await o()),l("Chat has successfully closed"),localStorage.clear()},style:{width:"100%",fontSize:"19px"},"aria-label":"confirm end chat","aria-live":"polite",children:"Confirm end chat"})})}):null,J.jsx("a",{href:"#",onClick:e=>{e.preventDefault(),r(a)},className:`mt-12 text-git-link-default visited:text-git-link-visited active:text-git-link-active underline w-fit ${Wd} ${Vd}`,"aria-label":"cancel and return to chat",id:"cancel-and-return-button",children:"Cancel and return to chat"})]})}),oO=()=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"Could not load survey."}),J.jsx("p",{children:"If you need to speak with us again, refresh the chat."})]})}),iO=({messageCategory:e,message:t,setMessage:n,ariaLive:r})=>{const o=$.useRef(null);return $.useEffect((()=>{if(t&&o.current){o.current.textContent=t;const e=setTimeout((()=>{o.current.textContent="",n("")}),500);return()=>clearTimeout(e)}}),[t]),J.jsx("div",{ref:o,role:"status","aria-live":r,style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)"}},e)},aO=({setHeaderEndChatButtonVisible:e})=>($.useEffect((()=>{console.debug("setting header button to not visible"),e(!1),localStorage.clear()}),[]),e(!1),J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto ",children:[J.jsx("h1",{tabIndex:0,className:"govuk-heading-l pt-4 mb-4 h1-fix",children:"This chat is now closed."}),J.jsx("h1",{tabIndex:0,style:{fontSize:"19px"},children:"If you need to speak with us again, refresh the chat."})]})})),sO=({sdk:e,thread:t,sdkErrors:n,queuePosition:r,setQueuePosition:o,channelIdTarget:i})=>{const[a]=$.useState(!0),s=(()=>{const[e,t]=$.useState(window.navigator.onLine);return $.useEffect((()=>{const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e),window.addEventListener("offline",n),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}),[]),e})(),[l,u]=$.useState(!1),[c]=$.useState((()=>{const e=window.navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);return t&&n&&!e.match(/CriOS/i)})()),[d]=$.useState((()=>{const e=window.navigator.userAgent;return!(!e.match(/iPad/i)&&!e.match(/iPhone/i)||!e.match(/CriOS/i))})()),[f]=$.useState((()=>{const e=window.navigator.userAgent;return!!e.match(/Android/i)&&!!e.match(/Chrome/i)})());$.useState((()=>{const e=window.navigator.userAgent,t=!!e.match(/Macintosh/i),n=!!e.match(/WebKit/i);return t&&n&&!e.match(/CriOS/i)})());const[p,h]=$.useState(""),[m,g]=$.useState(""),[v,y]=$.useState(""),[b,w]=$.useState(""),[E,S]=$.useState(!1),[x,_]=$.useState(215),[C,k]=$.useState(80),T=e=>{_(e)},N=localStorage.getItem("chatStatus"),[O,I]=$.useState("OPEN"===N||"CLOSED"===N),[A,R]=$.useState("OPEN"===N||"CLOSED"===N?N:"NEW"),[P,L]=$.useState("OPEN"===N||"CLOSED"===N?N:"NEW"),[D,F]=$.useState(!1),[j,M]=$.useState(0),[z,U]=$.useState(""),[B,H]=$.useState([]),[G]=$.useState(""),[W,V]=$.useState(""),[q,Q]=$.useState(""),[K,Y]=$.useState(""),[X,Z]=$.useState(""),[ee,te]=$.useState(""),[ne,re]=$.useState(""),[oe,ie]=$.useState(""),ae="CLOSED",[se,le]=$.useState(!1),[ue,ce]=$.useState(!1),[de,fe]=$.useState([]),[pe,he]=$.useState(!1),[me,ge]=$.useState(""),[ve,ye]=$.useState(null),[be,we]=$.useState([]),[Ee,Se]=$.useState(""),[xe,_e]=$.useState(""),[Ce,ke]=$.useState([]),[Te,Ne]=$.useState("MTIAAAAAAAAAAAAAtBI42fVlv0YjqdVDANWxxly0KvzNbthes1bceHQ53od2n1MbInl8JxXg/HZ9Ece5fzFl0smOak9xZj5fzLpLy9C53xkGZ1pGZf+btQs="),[Oe,Ie]=$.useState(""),[Ae,Re]=$.useState("TPDFE"),[Pe,Le]=$.useState("tpdfe.satmetrix.com"),[De,Fe]=$.useState("TPDFE_339"),[je,Me]=$.useState(!1),[ze,Ue]=$.useState(!1),[Be,He]=$.useState(!1),[$e,Ge]=$.useState(!1),[We,Ve]=$.useState(!0),[qe,Qe]=$.useState(!1),[Ke,Ye]=$.useState(!1),[Xe,Je]=$.useState(!1),[Ze,et]=$.useState(!0);$.useEffect((()=>{et("CLOSED"!==A&&"UNAVAILABLE"!==A&&"TIMED_OUT"!==A&&"OFFLINE"!==A&&"BUSY"!==A&&!1!==O)}),[A,O]),$.useEffect((()=>{window.scrollTo(0,0)}),[]),$.useEffect((()=>{"websocketClosed"===n&&s&&R("TIMED_OUT")}),[n]),$.useEffect((()=>{s?s&&"OFFLINE"===A&&(window.location.reload(),u(!0)):(u(!1),R("OFFLINE"))}),[s]);const tt=$.useCallback((e=>{if(!Gd.isMessageCreatedEvent(e.detail))return void console.error("Event detail is not a message created event",e);e.detail.data.message.authorEndUserIdentity||o(0);const t=e.detail.data.message;H((e=>[...e,t])),M((e=>e+1))}),[]),nt=$.useCallback((e=>{var t,n;Gd.isContactStatusChangedEvent(e.detail)&&("open"==e.detail.data.case.status?(Ye(!1),M(j+1)):"resolved"==e.detail.data.case.status?(Ye(!0),M(j+1)):"closed"==e.detail.data.case.status&&(null==(t=e.detail.data.user)?void 0:t.agentId)?(Ye(!1),localStorage.setItem("chatStatus",ae),R("CLOSED")):"closed"!=e.detail.data.case.status||(null==(n=e.detail.data.user)?void 0:n.agentId)?"escalated"==e.detail.data.case.status&&Je(!0):R("CLOSED"))}),[]);$.useEffect((()=>{t instanceof Gd.LivechatThread?(t.onThreadEvent(Gd.ChatEvent.CONTACT_STATUS_CHANGED,nt),t.onThreadEvent(Gd.ChatEvent.MESSAGE_CREATED,tt)):console.error("No thread available to end chat.")}),[t]);const rt=e=>$.useCallback((()=>{}),[]);$.useEffect((()=>{t.onThreadEvent(Gd.ChatEvent.MESSAGE_SEEN_BY_USER,rt)}),[t]);const ot=e=>{console.error("typing started"),Ge(!0)};$.useEffect((()=>{e.onChatEvent(Gd.ChatEvent.AGENT_TYPING_STARTED,ot)}),[t]);const it=e=>{console.error("typing ended"),Ge(!1)};$.useEffect((()=>{e.onChatEvent(Gd.ChatEvent.AGENT_TYPING_ENDED,it)}),[e]),$.useEffect((()=>{o(0)}),[$e]),$.useEffect((()=>{Ge(!1)}),[B]);const at=$.useCallback((async()=>{const e=localStorage.getItem("chatStatus");if("OPEN"===e||"CLOSED"===e){if(!(t instanceof Gd.LivechatThread))return void console.error("No thread available to end chat.");try{const e=await t.recover();e.messages.reverse().forEach((e=>{var t;t=e,H((e=>[...e,t]))}))}catch(n){console.error("Recovery failed:",n),et(!1),R("THREAD_CLOSED")}}}),[]);$.useEffect((()=>{at()}),[]);const st=$.useCallback((()=>t instanceof Gd.LivechatThread?new Promise((async e=>{var n,r;let o=[...B];try{let i=!0;for(;i;){const e=await t.loadMoreMessages();let a=[];if(a=(null==(r=null==(n=null==e?void 0:e.data)?void 0:n.messages)?void 0:r.reverse())??[],0===a.length){i=!1;break}o=[...a,...o]}H(o),e(o)}catch(i){console.error("Couldn't load more messages:",i),e(o)}})):(console.error("No thread available to end chat."),Promise.reject("No thread available to end chat."))),[t,H,B]),lt=e=>{var t;try{if(0===e.length)return void console.error("There are no messages to save.");let n="Department for Education - Get Into Teaching - Chat Transcript\n\n",r="";const o=e.find((e=>{var t;return(null==e?void 0:e.authorUser)&&"Shared"!=(null==(t=null==e?void 0:e.authorUser)?void 0:t.firstName)})),i=o?null==(t=null==o?void 0:o.authorUser)?void 0:t.firstName:"Get Into Teaching";let a,s=!0;e.forEach((e=>{if(e.agent_reassigned_message)return;let t=e.authorUser?`${Xd(e.authorUser.firstName,i)} (Agent)`:e.authorEndUserIdentity?`${e.authorEndUserIdentity.firstName} ${e.authorEndUserIdentity.lastName} (You)`:"",o=e.messageContent.text.trim();o||(o="Document uploaded");let l=`${t}: ${o}`;const u=e.createdAt,c=((e,t)=>{if(!e)return!0;if(e==t)return!0;const n=new Date(e);return new Date(t).getTime()>n.getTime()})(a,u);c||(s=!1),a=u;const d=`${l}\n${u?`Sent at: ${new Date(u).toLocaleString()}`:""}\n\n`;c||console.debug("timestamp mismatch fixed"),r!=d&&c&&s&&(n+=d,r=d)})),n+=`Date of Download: ${(new Date).toLocaleDateString()}\n`;const l=new Blob([n],{type:"text/plain"}),u=URL.createObjectURL(l),c=document.createElement("a");c.href=u,c.download="dfe_chat_transcript.txt",document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(u)}catch(n){console.error("Error while saving transcript",n)}},ut=async()=>{try{const e=await st();lt(e)}catch(e){console.error("Error while loading messages and saving transcript",e)}},ct=$.useCallback((()=>{t instanceof Gd.LivechatThread?t.keystroke():console.error("No thread available to get keystroke.")}),[t]),dt=$.useCallback((async()=>{try{if(!(t instanceof Gd.LivechatThread))return void console.error("No thread available to load more messages.");const e=(await t.loadMoreMessages()).data.messages.reverse()||[];H((t=>[...e,...t]))}catch(e){console.error("Couldn't load more messages:",e)}}),[]),ft=$.useRef(null);$.useEffect((()=>{const e=e=>{0===e.target.scrollTop&&dt()},t=ft.current;return t&&t.addEventListener("scroll",e),()=>{t&&t.removeEventListener("scroll",e)}}),[dt]);const pt=$.useRef(null);$.useEffect((()=>(document.body.style.overflowY="OPEN"==A?"hidden":"",()=>{document.body.style.overflowY=""})),[A]),$.useEffect((()=>{let e;return ft.current&&(e=setTimeout((()=>{const e=ft.current.scrollHeight;ft.current.scrollTop=e}),0)),()=>{clearTimeout(e)}}),[j,$e]),$.useLayoutEffect((()=>{if(ft.current){const e=ft.current.scrollHeight;ft.current.scrollTop=e}}),[j]);const ht=$.useCallback((async(n,r)=>{var o;if(t instanceof Gd.LivechatThread){try{(i=r.email)&&i.length<=240&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)&&""!==i||delete r.email,await(null==(o=e.getCustomer())?void 0:o.setName(`${r.name}`)),r.name&&delete r.name}catch(a){console.error("something went wrong setting custom fields",a)}var i;try{const e=await(null==t?void 0:t.startChat(n||"Conversation started"));if(localStorage.setItem("chatStarted","true"),void 0===e)throw new Error("startChat returned undefined:");I(!0),R("OPEN"),h("Chat has started")}catch(a){console.error("Start chat failed:",a),R("ERROR"),h("Chat failed to start")}await(async(e,n)=>{Z(e);try{await t.setCustomFields({candidate_situation:n,candidate_enquiry:e}),await t.sendCustomFields()}catch(a){console.error("couldn't set custom fields",a)}})(r.candidate_enquiry,r.candidate_situation)}else console.error("No thread available to end chat.")}),[t]),mt=$.useCallback((async()=>{if(t instanceof Gd.LivechatThread)try{o(0),await t.endChat()}catch(e){console.error("End chat failed:",e)}else console.error("No thread available to end chat.")}),[t]),gt=$.useCallback((async()=>{if(t instanceof Gd.LivechatThread)try{localStorage.setItem("chatStatus",ae),await t.endChat()}catch(e){console.error("End chat failed:",e)}else console.error("No thread available to end chat.")}),[t]),vt=$.useCallback((async e=>{if(t instanceof Gd.LivechatThread){if(""!==e.trim())try{await t.sendTextMessage(e)}catch(n){console.error("couldn't send message",n),R("ERROR")}}else console.error("No thread available to end chat.")}),[t]);return J.jsxs("div",{className:" app flex flex-col",children:[J.jsx(iO,{messageCategory:"chatWindowEvents",message:p,setMessage:h,ariaLive:"polite"}),J.jsx(iO,{messageCategory:"messages",message:m,setMessage:g,ariaLive:"polite"}),J.jsx(iO,{messageCategory:"newAgent",message:v,setMessage:y,ariaLive:"polite"}),J.jsx(iO,{messageCategory:"errorMessages",message:b,setMessage:w,ariaLive:"polite"}),J.jsx(Zd,{messages:B,handleEndChat:mt,handleSaveTranscript:ut,loadAllMessages:st,menuOpen:D,setMenuOpen:F,chatStarted:O,stage:A,setStage:R,setUserClosedCase:Qe,agentClosedCase:We,userClosedCase:qe,setPreviousStage:L,headerEndChatButtonRef:pt,surveyInProgress:se,headerEndChatButtonVisible:Ze,setMenuButtonTouched:S,handleHeaderHeight:e=>{k(e)}}),(()=>{switch(A){case"NEW":return J.jsx(J.Fragment,{children:J.jsx(SN,{name:W,setName:V,email:ee,setEmail:te,subject:q,setSubject:Q,situation:K,setSituation:Y,setStage:R,thread:t,useValidation:a,setMenuOpen:F,handleStartChat:ht,headerEndChatButtonRef:pt,setSR_errorMessages:w,setSR_chatWindowEvents:h,setPreviousStage:L,channelIdTarget:i})});case"OPEN":return J.jsxs(J.Fragment,{children:[J.jsx(CN,{chatWindowRef:ft,messages:B,agentTyping:$e,queuePosition:r,agentResolvedCase:Ke,agentEscalatedCase:Xe,setMessages:H,agentReassigned:G,setSR_messages:g,setSR_newAgentAssigned:y,stage:A,handleSaveTranscript:ut,messageCount:j,setMessageCount:M,surveyInProgress:se,setSurveyInProgress:le,surveyFinished:ue,setSurveyFinished:ce,surveyLookupValues:de,setSurveyLookupValues:fe,enteredSurvey:pe,setEnteredSurvey:he,surveyInputResponse:me,setSurveyInputResponse:ge,surveyHeader:ve,setSurveyHeader:ye,surveyMessageTextArray:be,setSurveyMessageTextArray:we,surveyMessageText:Ee,setSurveyMessageText:Se,surveyMessageType:xe,setSurveyMessageType:_e,surveyLookups:Ce,setSurveyLookups:ke,surveyAccessToken:Oe,setSurveyAccessToken:Ie,surveyTenantId:Ae,setSurveyTenantId:Re,surveyHostname:Pe,setSurveyHostname:Le,surveyId:De,menuButtonTouched:E,onAndroidChrome:f,oniOSSafari:c,oniOSChrome:d,messageInputHeight:x,headerHeight:C,setAgentName:re}),J.jsx(TN,{messageText:z,setMessageText:U,handleSendMessage:vt,handleSendTypingIndicator:ct,thread:t,handleHeightChangeMessageInput:T})]});case"CLOSED":return J.jsxs("div",{className:"flex flex-col w-11/12 px-2 items-center",children:["true"===localStorage.getItem("noChat")?J.jsx($N,{handleSaveTranscript:ut,chatStarted:O,showCloseWindow:!0,showSaveTranscript:!1,showStartAgain:!0,userClosedCase:qe,agentClosedCase:We}):J.jsxs(J.Fragment,{children:["CLOSED"===A?J.jsxs("div",{className:"w-11/12",children:[J.jsx(YN,{tenantId:Ae,hostname:Pe,surveyId:De,token:Te,handleSaveTranscript:ut,messageCount:j,setMessageCount:M,surveyInProgress:se,setSurveyInProgress:le,surveyFinished:ue,setSurveyFinished:ce,surveyLookupValues:de,setSurveyLookupValues:fe,enteredSurvey:pe,setEnteredSurvey:he,surveyInputResponse:me,setSurveyInputResponse:ge,surveyHeader:ve,setSurveyHeader:ye,surveyMessageTextArray:be,setSurveyMessageTextArray:we,surveyMessageText:Ee,setSurveyMessageText:Se,surveyMessageType:xe,setSurveyMessageType:_e,surveyLookups:Ce,setSurveyLookups:ke,setSurveyRefused:Me,setSurveyAccessToken:Ie,name:W,subject:q,situation:K,enquiry:X,agentName:ne,agentId:oe,surveyLoading:ze,setSurveyLoading:Ue,agentClosedCase:We,surveyResponseLoading:Be,setSurveyResponseLoading:He,setStage:R}),J.jsxs("div",{className:"mt-4",children:[je?(e=qe,e?J.jsx("p",{tabIndex:0,style:{border:"none",fontSize:"19px"},className:`bg-git-light-blue bg-opacity-20 p-2 rounded-lg mb-6 ${qd} max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto`,children:"Thanks for getting in touch with us today. If you need to speak with us again, we're open 8:30am to 5:30pm Monday to Friday."},888888888888888):J.jsx("p",{tabIndex:0,style:{border:"none",fontSize:"19px"},className:`bg-git-light-blue bg-opacity-20 p-2 rounded-lg mb-6 ${qd}`,children:"This chat is now closed. Thanks for getting in touch with us. If you need to speak to us again, we're open 8:30am to 5:30pm Monday to Friday."},888888888888888)):null,J.jsx($N,{handleSaveTranscript:ut,chatStarted:O,showCloseWindow:je,showSaveTranscript:!1,showStartAgain:!1,userClosedCase:qe,agentClosedCase:We})]})]}):null,J.jsx(XN,{surveyInProgress:se,setSurveyInProgress:le,surveyFinished:ue,setSurveyFinished:ce,surveyLookupValues:de,setSurveyLookupValues:fe,enteredSurvey:pe,setEnteredSurvey:he,surveyInputResponse:me,setSurveyInputResponse:ge,surveyHeader:ve,setSurveyHeader:ye,surveyMessageTextArray:be,setSurveyMessageTextArray:we,surveyMessageText:Ee,setSurveyMessageText:Se,surveyMessageType:xe,setSurveyMessageType:_e,surveyLookups:Ce,setSurveyLookups:ke,setMessageCount:M,surveyAccessToken:Oe,setSurveyAccessToken:Ie,surveyTenantId:Ae,setSurveyTenantId:Re,surveyHostname:Pe,setSurveyHostname:Le,handleSaveTranscript:ut,chatStarted:O,surveyLoading:ze,setSurveyLoading:Ue,surveyResponseLoading:Be,setSurveyResponseLoading:He})]}),J.jsx("div",{className:""+("true"===localStorage.getItem("noChat")?"mt-6":"")})]});case"END_CHAT_CONFIRMATION_PAGE":return J.jsx(J.Fragment,{children:J.jsx(rO,{email:ee,setEmail:te,stage:A,setStage:R,handleEndChat:mt,handleSaveTranscript:ut,previousStage:P,setSR_messages:g,setSR_chatWindowEvents:h,chatStarted:O,setAgentClosedCase:Ve})});case"OFFLINE":return J.jsx(JN,{networkConnectionRestored:l});case"ERROR":default:return J.jsx(ZN,{handleErrorEndChat:gt});case"TIMED_OUT":return J.jsx(nO,{});case"BUSY":return J.jsx(eO,{});case"UNAVAILABLE":return J.jsx(tO,{});case"THREAD_CLOSED":return J.jsx(aO,{setHeaderEndChatButtonVisible:et});case"SURVEY_TIMEOUT":return J.jsx(oO,{})}var e})(),J.jsx("div",{className:"max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto"})]})},lO=()=>{const[e,t]=$.useState(""),[n,r]=$.useState(null),[o,i]=$.useState(0),a={dfe_git_uat:{brandId:1354,channelId:"chat_a1c317cf-a81e-44ad-bf6b-7ccadcfd2457",environment:Gd.EnvironmentName.UK1},dfe_git_prod:{brandId:1354,channelId:"chat_268662fd-5996-416c-901b-526de5509a8d",environment:Gd.EnvironmentName.UK1},r101_dev:{brandId:1150,channelId:"chat_16aa0fd8-35c2-4030-bb21-7473f04421d1",environment:Gd.EnvironmentName.EU1}};let s="dfe_git",l="uat",u=`${s}_${l}`;try{l=window.env.CHANNEL_ID_TARGET,s=window.env.TENANT_TARGET,u=`${s}_${l}`}catch(h){console.error("couldnt retrieve the channel id target",h),l="uat"}const c=a[u]||a.dfe_git_uat;$.useEffect((()=>{try{console.log(`Chat to Get Into Teaching is targeting ${s}'s ${l} environment`)}catch(h){console.error("couldnt retrieve environment configuration")}}),[]);const d={brandId:c.brandId,channelId:c.channelId,customerId:localStorage.getItem("STORAGE_CHAT_CUSTOMER_ID")||"",environment:c.environment,onError:e=>{console.error(e);const n=null==e?void 0:e.message;n&&n.includes("WebSocketClientError")&&t("websocketClosed")}};"OPEN"!==localStorage.getItem("chatStatus")&&"CLOSED"!==localStorage.getItem("chatStatus")&&localStorage.setItem("chatStatus","NEW");const f=new Gd.ChatSdk(d);$.useEffect((()=>{(async()=>{let e=localStorage.getItem("STORAGE_CHAT_THREAD_ID");try{const e=await f.authorize();document.querySelector("body").style.visibility="visible";const t=null==e?void 0:e.consumerIdentity.idOnExternalPlatform;localStorage.setItem("STORAGE_CHAT_CUSTOMER_ID",t||"")}catch(n){console.error("AUTH ERR: ",n)}e||(e=null==crypto?void 0:crypto.randomUUID());const t=await f.getThread(e);t instanceof Gd.LivechatThread?(r(t),localStorage.setItem("STORAGE_CHAT_THREAD_ID",t.idOnExternalPlatform)):console.error("Thread is not livechat thread")})()}),[]);const p=$.useCallback((e=>{(e.detail||e.detail.data.positionInQueue)&&i(e.detail.data.positionInQueue)}),[]);return $.useEffect((()=>{f.onChatEvent(Gd.ChatEvent.SET_POSITION_IN_QUEUE,p)}),[f,p]),n||"object"!=typeof f?J.jsx(sO,{sdk:f,thread:n,sdkErrors:e,queuePosition:o,setQueuePosition:i,channelIdTarget:l}):J.jsx("div",{className:"App",children:J.jsx("div",{className:"govuk-width-container",children:J.jsx("div",{className:"govuk-!-padding-top-5 govuk-!-margin-top-0 ",children:J.jsx("p",{children:"Chat is loading..."})})})})};Z.createRoot(document.getElementById("root")).render(J.jsx(G.StrictMode,{children:J.jsx(lO,{})})); + */;var ew=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},tw=Object.prototype.hasOwnProperty,nw=Object.prototype.toString,rw=Object.defineProperty,ow=Object.getOwnPropertyDescriptor,iw=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===nw.call(e)},aw=function(e){if(!e||"[object Object]"!==nw.call(e))return!1;var t,n=tw.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&tw.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||tw.call(e,t)},sw=function(e,t){rw&&"__proto__"===t.name?rw(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},lw=function(e,t){if("__proto__"===t){if(!tw.call(e,t))return;if(ow)return ow(e,t).value}return e[t]},uw=[].slice;var cw=function(e,t){var n;return function(){var t,i=uw.call(arguments,0),a=e.length>i.length;a&&i.push(r);try{t=e.apply(null,i)}catch(s){if(a&&n)throw s;return r(s)}a||(t&&"function"==typeof t.then?t.then(o,r):t instanceof Error?r(t):o(t))};function r(){n||(n=!0,t.apply(null,arguments))}function o(e){r(null,e)}},dw=pw;pw.wrap=cw;var fw=[].slice;function pw(){var e=[],t={run:function(){var t=-1,n=fw.call(arguments,0,-1),r=arguments[arguments.length-1];if("function"!=typeof r)throw new Error("Expected function as last argument, not "+r);(function o(i){var a=e[++t],s=fw.call(arguments,0).slice(1),l=n.length,u=-1;if(i)r(i);else{for(;++ue.length){for(;n--;)if(47===e.charCodeAt(n)){if(o){a=n+1;break}}else s<0&&(o=!0,s=n+1);return s<0?"":e.slice(a,s)}if(t===e)return"";r=-1,i=t.length-1;for(;n--;)if(47===e.charCodeAt(n)){if(o){a=n+1;break}}else r<0&&(o=!0,r=n+1),i>-1&&(e.charCodeAt(n)===t.charCodeAt(i--)?i<0&&(s=n):(i=-1,s=r));a===s?s=r:s<0&&(s=e.length);return e.slice(a,s)},_w.dirname=function(e){var t,n,r;if(Cw(e),!e.length)return".";t=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(n){t=r;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},_w.extname=function(e){var t,n,r,o=-1,i=0,a=-1,s=0;Cw(e),r=e.length;for(;r--;)if(47!==(n=e.charCodeAt(r)))a<0&&(t=!0,a=r+1),46===n?o<0?o=r:1!==s&&(s=1):o>-1&&(s=-1);else if(t){i=r+1;break}if(o<0||a<0||0===s||1===s&&o===a-1&&o===i+1)return"";return e.slice(o,a)},_w.join=function(){var e,t=-1;for(;++t2){if((r=o.lastIndexOf("/"))!==o.length-1){r<0?(o="",i=0):i=(o=o.slice(0,r)).length-1-o.lastIndexOf("/"),a=l,s=0;continue}}else if(o.length){o="",i=0,a=l,s=0;continue}t&&(o=o.length?o+"/..":"..",i=2)}else o.length?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t),n.length||t||(n=".");n.length&&47===e.charCodeAt(e.length-1)&&(n+="/");return t?"/"+n:n}(e)},_w.sep="/";var kw={};kw.cwd=function(){return"/"};var Tw=_w,Nw=kw,Ow=ew,Iw=Pw,Aw={}.hasOwnProperty,Rw=["history","path","basename","stem","extname","dirname"];function Pw(e){var t,n;if(e){if("string"==typeof e||Ow(e))e={contents:e};else if("message"in e&&"messages"in e)return e}else e={};if(!(this instanceof Pw))return new Pw(e);for(this.data={},this.messages=[],this.history=[],this.cwd=Nw.cwd(),n=-1;++n-1)throw new Error("`"+t+"` cannot be a path: did not expect `"+Tw.sep+"`")}function Dw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Fw(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}Pw.prototype.toString=function(e){return(this.contents||"").toString(e)},Object.defineProperty(Pw.prototype,"path",{get:function(){return this.history[this.history.length-1]},set:function(e){Dw(e,"path"),this.path!==e&&this.history.push(e)}}),Object.defineProperty(Pw.prototype,"dirname",{get:function(){return"string"==typeof this.path?Tw.dirname(this.path):void 0},set:function(e){Fw(this.path,"dirname"),this.path=Tw.join(e||"",this.basename)}}),Object.defineProperty(Pw.prototype,"basename",{get:function(){return"string"==typeof this.path?Tw.basename(this.path):void 0},set:function(e){Dw(e,"basename"),Lw(e,"basename"),this.path=Tw.join(this.dirname||"",e)}}),Object.defineProperty(Pw.prototype,"extname",{get:function(){return"string"==typeof this.path?Tw.extname(this.path):void 0},set:function(e){if(Lw(e,"extname"),Fw(this.path,"extname"),e){if(46!==e.charCodeAt(0))throw new Error("`extname` must start with `.`");if(e.indexOf(".",1)>-1)throw new Error("`extname` cannot contain multiple dots")}this.path=Tw.join(this.dirname,this.stem+(e||""))}}),Object.defineProperty(Pw.prototype,"stem",{get:function(){return"string"==typeof this.path?Tw.basename(this.path,this.extname):void 0},set:function(e){Dw(e,"stem"),Lw(e,"stem"),this.path=Tw.join(this.dirname||"",e+(this.extname||""))}});var jw=ww,Mw=Iw,zw=Mw;Mw.prototype.message=function(e,t,n){var r=new jw(e,t,n);this.path&&(r.name=this.path+":"+r.name,r.file=this.path);return r.fatal=!1,this.messages.push(r),r},Mw.prototype.info=function(){var e=this.message.apply(this,arguments);return e.fatal=null,e},Mw.prototype.fail=function(){var e=this.message.apply(this,arguments);throw e.fatal=!0,e};var Uw=Zb,Bw=ew,Hw=function e(){var t,n,r,o,i,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l{if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},Gw=dw,Ww=zw,Vw=function e(){var t,n=[],r=Gw(),o={},i=-1;return a.data=function(e,n){if("string"==typeof e)return 2===arguments.length?(Zw("data",t),o[e]=n,a):Qw.call(o,e)&&o[e]||null;if(e)return Zw("data",t),o=e,a;return o},a.freeze=s,a.attachers=n,a.use=function(e){var r;if(Zw("use",t),null==e);else if("function"==typeof e)c.apply(null,arguments);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?u(e):i(e)}r&&(o.settings=Hw(o.settings||{},r));return a;function i(e){u(e.plugins),e.settings&&(r=Hw(r||{},e.settings))}function s(e){if("function"==typeof e)c(e);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?c.apply(null,e):i(e)}}function u(e){var t=-1;if(null==e);else{if("object"!=typeof e||!("length"in e))throw new Error("Expected a list of plugins, not `"+e+"`");for(;++t13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":uE(n)},dE={};var fE=function(e){return e<-2};var pE=function(e){return-2===e||-1===e||32===e},hE=pE;var mE=function(e,t,n,r){var o=r?r-1:1/0,i=0;return function(r){if(hE(r))return e.enter(n),a(r);return t(r)};function a(r){return hE(r)&&i++t;)o.containerState=i[s][1],i[s][0].exit.call(o,e);i.length=t}},TE={tokenize:function(e,t,n){return _E(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}},NE={tokenize:function(e,t,n){return _E(e,e.lazy(this.parser.constructs.flow,t,n),"linePrefix",this.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}};bE.tokenize=kE;var OE={};var IE=function(e){for(var t=-1,n=0;++ti?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(o=Array.from(r)).unshift(t,n),PE.apply(e,o);else for(n&&PE.apply(e,[t,n]);a-1||$E(r.events,"linePrefix")<4?e.interrupt(r.parser.constructs.flow,n,t)(o):t(o)}},partial:!0};var QE=VE;Object.defineProperty(OE,"__esModule",{value:!0});var KE=QE,YE=mE,XE=SE,JE=function(e){var t=this,n=e.attempt(XE,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,YE(e,e.attempt(this.parser.constructs.flow,r,e.attempt(KE,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}};OE.tokenize=JE;var ZE={};Object.defineProperty(ZE,"__esModule",{value:!0});var eS=iE,tS=FE,nS=iS("text"),rS=iS("string"),oS={resolveAll:aS()};function iS(e){return{tokenize:function(t){var n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){var t=r[e],o=-1;if(null===e)return!0;if(t)for(;++o-1&&(n[0]=n[0].slice(o)),a>0&&n.push(e[i].slice(0,a))),n};var NS=function(e,t,n){var r=n?kS(n):{line:1,column:1,offset:0},o={},i=[],a=[],s=[],l={consume:function(e){wS(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));u.previous=e},enter:function(e,t){var n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),s.push(n),n},exit:function(e){var t=s.pop();return t.end=f(),u.events.push(["exit",t,u]),t},attempt:g((function(e,t){v(e,t.from)})),check:g(m),interrupt:g(m,{interrupt:!0}),lazy:g(m,{lazy:!0})},u={previous:null,events:[],parser:e,sliceStream:d,sliceSerialize:function(e){return CS(d(e))},now:f,defineSkip:function(e){o[e.line]=e.column,y()},write:function(e){if(a=ES(a,e),p(),null!==a[a.length-1])return[];return v(t,0),u.events=_S(i,u.events,u),u.events}},c=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),r._index=0,r._bufferIndex=-1,u;function d(e){return TS(a,e)}function f(){return kS(r)}function p(){for(var e,t;r._index-1)return v();return e.tokenize.call(t?bS({},u,t):u,l,g,v)(n)}}function g(t){return e(d,p),o}function v(e){return p.restore(),++c1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1)>1?"strongSequence":"emphasisSequence",start:BS($S(e[n][1].end),-s),end:$S(e[n][1].end)},a={type:s>1?"strongSequence":"emphasisSequence",start:$S(e[c][1].start),end:BS($S(e[c][1].start),s)},o={type:s>1?"strongText":"emphasisText",start:$S(e[n][1].end),end:$S(e[c][1].start)},r={type:s>1?"strong":"emphasis",start:$S(i.start),end:$S(a.end)},e[n][1].end=$S(i.start),e[c][1].start=$S(a.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=MS(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=MS(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=MS(l,HS(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=MS(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,l=MS(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,zS(e,n-1,c-n+3,l),c=n+l.length-u-2;break}c=-1;for(;++c-1?void 0:4)}},exit:function(e){e.exit("blockQuote")}};var rx=nx,ox=RS(/[!-/:-@[-`{-~]/);var ix,ax={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return ox(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},sx=function(e){var t,n="&"+e+";";if((ix=ix||document.createElement("i")).innerHTML=n,59===(t=ix.textContent).charCodeAt(t.length-1)&&"semi"!==e)return!1;return t!==n&&t};var lx=RS(/\d/),ux=RS(/[\dA-Fa-f]/),cx=VS,dx=lx,fx=ux;function px(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var hx=px(sx);var mx={name:"characterReference",tokenize:function(e,t,n){var r,o,i=this,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,o=cx,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,o=fx,u):(e.enter("characterReferenceValue"),r=7,o=dx,u(t))}function u(s){var l;return 59===s&&a?(l=e.exit("characterReferenceValue"),o!==cx||hx.default(i.sliceSerialize(l))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)):o(s)&&a++-1?void 0:4);function i(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}function a(t){return t===r?(e.consume(t),o++,a):ou?n(o):(e.consume(o),h):41===o?c--?(e.consume(o),h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o)):null===o||Ax(o)?c?n(o):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o)):Ix(o)?n(o):(e.consume(o),92===o?m:h)}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}},Lx=fE,Dx=pE;var Fx=function(e,t,n,r,o,i){var a,s=this,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),u};function u(d){return null===d||91===d||93===d&&!a||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):Lx(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||Lx(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),a=a||!Dx(t),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}},jx=fE,Mx=pE,zx=mE;var Ux=function(e,t){var n;return function r(o){if(jx(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(Mx(o))return zx(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}},Bx=fE,Hx=mE;var $x=function(e,t,n,r,o,i){var a;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):Bx(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),Hx(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===a||null===t||Bx(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:u)}function c(t){return t===a||92===t?(e.consume(t),u):u(t)}},Gx=fE,Wx=IS,Vx=sE,qx=Px,Qx=Fx,Kx=mE,Yx=Ux,Xx=$x,Jx={name:"definition",tokenize:function(e,t,n){var r,o=this;return function(t){return e.enter("definition"),Qx.call(o,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function i(t){return r=Vx(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),Yx(e,qx(e,e.attempt(Zx,Kx(e,a,"whitespace"),Kx(e,a,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(t)}function a(i){return null===i||Gx(i)?(e.exit("definition"),o.parser.defined.indexOf(r)<0&&o.parser.defined.push(r),t(i)):n(i)}}},Zx={tokenize:function(e,t,n){return function(t){return Wx(t)?Yx(e,r)(t):n(t)};function r(t){return 34===t||39===t||40===t?Xx(e,Kx(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):n(t)}function o(e){return null===e||Gx(e)?t(e):n(e)}},partial:!0};var e_=Jx,t_=fE;var n_={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(t),r};function r(r){return t_(r)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(r)):n(r)}}},r_=fE,o_=IS,i_=pE,a_=LE,s_=mE;var l_={name:"headingAtx",tokenize:function(e,t,n){var r=this,o=0;return function(t){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),i(t)};function i(s){return 35===s&&o++<6?(e.consume(s),i):null===s||o_(s)?(e.exit("atxHeadingSequence"),r.interrupt?t(s):a(s)):n(s)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),s(n)):null===n||r_(n)?(e.exit("atxHeading"),t(n)):i_(n)?s_(e,a,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function s(t){return 35===t?(e.consume(t),s):(e.exit("atxHeadingSequence"),a(t))}function l(t){return null===t||35===t||o_(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),l)}},resolve:function(e,t){var n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},a_(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e}},u_=WS,c_=VS,d_=fE,f_=IS,p_=pE,h_=lE,m_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],g_=["pre","script","style","textarea"],v_=SE,y_={name:"htmlFlow",tokenize:function(e,t,n){var r,o,i,a,s,l=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u};function u(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),p):63===a?(e.consume(a),r=3,l.interrupt?t:P):u_(a)?(e.consume(a),i=h_(a),o=!0,h):n(a)}function c(o){return 45===o?(e.consume(o),r=2,d):91===o?(e.consume(o),r=5,i="CDATA[",a=0,f):u_(o)?(e.consume(o),r=4,l.interrupt?t:P):n(o)}function d(r){return 45===r?(e.consume(r),l.interrupt?t:P):n(r)}function f(r){return r===i.charCodeAt(a++)?(e.consume(r),a===i.length?l.interrupt?t:k:f):n(r)}function p(t){return u_(t)?(e.consume(t),i=h_(t),h):n(t)}function h(a){return null===a||47===a||62===a||f_(a)?47!==a&&o&&g_.indexOf(i.toLowerCase())>-1?(r=1,l.interrupt?t(a):k(a)):m_.indexOf(i.toLowerCase())>-1?(r=6,47===a?(e.consume(a),m):l.interrupt?t(a):k(a)):(r=7,l.interrupt?n(a):o?v(a):g(a)):45===a||c_(a)?(e.consume(a),i+=h_(a),h):n(a)}function m(r){return 62===r?(e.consume(r),l.interrupt?t:k):n(r)}function g(t){return p_(t)?(e.consume(t),g):_(t)}function v(t){return 47===t?(e.consume(t),_):58===t||95===t||u_(t)?(e.consume(t),y):p_(t)?(e.consume(t),v):_(t)}function y(t){return 45===t||46===t||58===t||95===t||c_(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),w):p_(t)?(e.consume(t),b):v(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,E):p_(t)?(e.consume(t),w):(s=void 0,S(t))}function E(t){return t===s?(e.consume(t),x):null===t||d_(t)?n(t):(e.consume(t),E)}function S(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||f_(t)?b(t):(e.consume(t),S)}function x(e){return 47===e||62===e||p_(e)?v(e):n(e)}function _(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return p_(t)?(e.consume(t),C):null===t||d_(t)?k(t):n(t)}function k(t){return 45===t&&2===r?(e.consume(t),O):60===t&&1===r?(e.consume(t),I):62===t&&4===r?(e.consume(t),L):63===t&&3===r?(e.consume(t),P):93===t&&5===r?(e.consume(t),R):!d_(t)||6!==r&&7!==r?null===t||d_(t)?T(t):(e.consume(t),k):e.check(b_,L,T)(t)}function T(t){return e.exit("htmlFlowData"),N(t)}function N(t){return null===t?D(t):d_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N):(e.enter("htmlFlowData"),k(t))}function O(t){return 45===t?(e.consume(t),P):k(t)}function I(t){return 47===t?(e.consume(t),i="",A):k(t)}function A(t){return 62===t&&g_.indexOf(i.toLowerCase())>-1?(e.consume(t),L):u_(t)&&i.length<8?(e.consume(t),i+=h_(t),A):k(t)}function R(t){return 93===t?(e.consume(t),P):k(t)}function P(t){return 62===t?(e.consume(t),L):k(t)}function L(t){return null===t||d_(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),L)}function D(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){var t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},b_={tokenize:function(e,t,n){return function(r){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),e.attempt(v_,t,n)}},partial:!0};var w_=y_,E_=WS,S_=VS,x_=fE,__=IS,C_=pE,k_=mE;var T_={name:"htmlText",tokenize:function(e,t,n){var r,o,i,a,s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),u):47===t?(e.consume(t),S):63===t?(e.consume(t),w):E_(t)?(e.consume(t),C):n(t)}function u(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),o="CDATA[",i=0,m):E_(t)?(e.consume(t),b):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function d(t){return null===t||62===t?n(t):45===t?(e.consume(t),f):p(t)}function f(e){return null===e||62===e?n(e):p(e)}function p(t){return null===t?n(t):45===t?(e.consume(t),h):x_(t)?(a=p,P(t)):(e.consume(t),p)}function h(t){return 45===t?(e.consume(t),D):p(t)}function m(t){return t===o.charCodeAt(i++)?(e.consume(t),i===o.length?g:m):n(t)}function g(t){return null===t?n(t):93===t?(e.consume(t),v):x_(t)?(a=g,P(t)):(e.consume(t),g)}function v(t){return 93===t?(e.consume(t),y):g(t)}function y(t){return 62===t?D(t):93===t?(e.consume(t),y):g(t)}function b(t){return null===t||62===t?D(t):x_(t)?(a=b,P(t)):(e.consume(t),b)}function w(t){return null===t?n(t):63===t?(e.consume(t),E):x_(t)?(a=w,P(t)):(e.consume(t),w)}function E(e){return 62===e?D(e):w(e)}function S(t){return E_(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||S_(t)?(e.consume(t),x):_(t)}function _(t){return x_(t)?(a=_,P(t)):C_(t)?(e.consume(t),_):D(t)}function C(t){return 45===t||S_(t)?(e.consume(t),C):47===t||62===t||__(t)?k(t):n(t)}function k(t){return 47===t?(e.consume(t),D):58===t||95===t||E_(t)?(e.consume(t),T):x_(t)?(a=k,P(t)):C_(t)?(e.consume(t),k):D(t)}function T(t){return 45===t||46===t||58===t||95===t||S_(t)?(e.consume(t),T):N(t)}function N(t){return 61===t?(e.consume(t),O):x_(t)?(a=N,P(t)):C_(t)?(e.consume(t),N):k(t)}function O(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,I):x_(t)?(a=O,P(t)):C_(t)?(e.consume(t),O):(e.consume(t),r=void 0,R)}function I(t){return t===r?(e.consume(t),A):null===t?n(t):x_(t)?(a=I,P(t)):(e.consume(t),I)}function A(e){return 62===e||47===e||__(e)?k(e):n(e)}function R(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):62===t||__(t)?k(t):(e.consume(t),R)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),k_(e,L,"linePrefix",s.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:4)}function L(t){return e.enter("htmlTextData"),a(t)}function D(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}}},N_=IS,O_=gS,I_=LE,A_=sE,R_=vS,P_=FE,L_=Px,D_=Fx,F_=$x,j_=Ux,M_={name:"labelEnd",tokenize:function(e,t,n){var r,o,i=this,a=i.events.length;for(;a--;)if(("labelImage"===i.events[a][1].type||"labelLink"===i.events[a][1].type)&&!i.events[a][1]._balanced){r=i.events[a][1];break}return function(t){if(!r)return n(t);return r._inactive?l(t):(o=i.parser.defined.indexOf(A_(i.sliceSerialize({start:r.end,end:i.now()})))>-1,e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s)};function s(n){return 40===n?e.attempt(z_,t,o?t:l)(n):91===n?e.attempt(U_,t,o?e.attempt(B_,t,l):l)(n):o?t(n):l(n)}function l(e){return r._balanced=!0,n(e)}},resolveTo:function(e,t){var n,r,o,i,a,s,l,u=e.length,c=0;for(;u--;)if(i=e[u][1],a){if("link"===i.type||"labelLink"===i.type&&i._inactive)break;"enter"===e[u][0]&&"labelLink"===i.type&&(i._inactive=!0)}else if(s){if("enter"===e[u][0]&&("labelImage"===i.type||"labelLink"===i.type)&&!i._balanced&&(a=u,"labelLink"!==i.type)){c=2;break}}else"labelEnd"===i.type&&(s=u);return n={type:"labelLink"===e[a][1].type?"link":"image",start:P_(e[a][1].start),end:P_(e[e.length-1][1].end)},r={type:"label",start:P_(e[a][1].start),end:P_(e[s][1].end)},o={type:"labelText",start:P_(e[a+c+2][1].end),end:P_(e[s-2][1].start)},l=O_(l=[["enter",n,t],["enter",r,t]],e.slice(a+1,a+c+3)),l=O_(l,[["enter",o,t]]),l=O_(l,R_(t.parser.constructs.insideSpan.null,e.slice(a+c+4,s-3),t)),l=O_(l,[["exit",o,t],e[s-2],e[s-1],["exit",r,t]]),l=O_(l,e.slice(s+1)),l=O_(l,[["exit",n,t]]),I_(e,a,e.length,l),e},resolveAll:function(e){var t,n=-1;for(;++n-1?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},iC={tokenize:function(e,t,n){var r=this;return tC(e,(function(e){return J_(e)||!Z_(r.events,"listItemPrefixWhitespace")?n(e):t(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.indexOf("codeIndented")>-1?void 0:5)},partial:!0},aC={tokenize:function(e,t,n){var r=this;return tC(e,(function(e){return Z_(r.events,"listItemIndent")===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0};var sC=oC,lC=fE,uC=FE,cC=mE;var dC={name:"setextUnderline",tokenize:function(e,t,n){var r,o,i=this,a=i.events.length;for(;a--;)if("lineEnding"!==i.events[a][1].type&&"linePrefix"!==i.events[a][1].type&&"content"!==i.events[a][1].type){o="paragraph"===i.events[a][1].type;break}return function(t){if(!i.lazy&&(i.interrupt||o))return e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),r=t,s(t);return n(t)};function s(t){return t===r?(e.consume(t),s):(e.exit("setextHeadingLineSequence"),cC(e,l,"lineSuffix")(t))}function l(r){return null===r||lC(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){var n,r,o,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),o||"definition"!==e[a][1].type||(o=a);i={type:"setextHeading",start:uC(e[r][1].start),end:uC(e[e.length-1][1].end)},e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=uC(e[o][1].end)):e[n][1]=i;return e.push(["exit",i,t]),e}};Object.defineProperty(OS,"__esModule",{value:!0});var fC={42:sC,43:sC,45:sC,48:sC,49:sC,50:sC,51:sC,52:sC,53:sC,54:sC,55:sC,56:sC,57:sC,62:rx},pC={91:e_},hC={"-2":Tx,"-1":Tx,32:Tx},mC={35:l_,42:Y_,45:[dC,Y_],60:w_,61:dC,95:Y_,96:wx,126:wx},gC={38:mx,92:ax},vC={"-5":V_,"-4":V_,"-3":V_,33:$_,38:mx,42:GS,60:[ZS,T_],91:G_,92:[n_,ax],93:H_,95:GS,96:Ox},yC={null:[GS,ZE.resolver]};OS.contentInitial=pC,OS.disable={null:[]},OS.document=fC,OS.flow=mC,OS.flowInitial=hC,OS.insideSpan=yC,OS.string=gC,OS.text=vC;var bC=dE,wC=bE,EC=OE,SC=ZE,xC=hS,_C=NS,CC=lS,kC=OS;var TC=/[\0\t\n\r]/g;var NC=BE;var OC=function(e,t,n){"string"!=typeof t&&(n=t,t=void 0);return function(e){var t=e||{},n=function(e,t){var n=-1;for(;++n-1&&(O.call(this,e),I.call(this,e))}function R(){a("atHardBreak",!0)}function P(){var e=this.resume();this.stack[this.stack.length-1].value=e}function L(){var e=this.resume();this.stack[this.stack.length-1].value=e}function D(){var e=this.resume();this.stack[this.stack.length-1].value=e}function F(){var e=this.stack[this.stack.length-1];s("inReference")?(e.type+="Reference",e.referenceType=s("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),a("referenceType")}function j(){var e=this.stack[this.stack.length-1];s("inReference")?(e.type+="Reference",e.referenceType=s("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),a("referenceType")}function M(e){this.stack[this.stack.length-2].identifier=PC(this.sliceSerialize(e)).toLowerCase()}function z(){var e=this.stack[this.stack.length-1],t=this.resume();this.stack[this.stack.length-1].label=t,a("inReference",!0),"link"===this.stack[this.stack.length-1].type?this.stack[this.stack.length-1].children=e.children:this.stack[this.stack.length-1].alt=t}function U(){var e=this.resume();this.stack[this.stack.length-1].url=e}function B(){var e=this.resume();this.stack[this.stack.length-1].title=e}function H(){a("inReference")}function $(){a("referenceType","collapsed")}function G(e){var t=this.resume();this.stack[this.stack.length-1].label=t,this.stack[this.stack.length-1].identifier=PC(this.sliceSerialize(e)).toLowerCase(),a("referenceType","full")}function W(e){a("characterReferenceType",e.type)}function V(e){var t,n,r=this.sliceSerialize(e),o=s("characterReferenceType");o?(t=LC(r,"characterReferenceMarkerNumeric"===o?10:16),a("characterReferenceType")):t=MC(r),(n=this.stack.pop()).value+=t,n.position.end=l(e.end)}function q(e){I.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function Q(e){I.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function K(){return{type:"blockquote",children:[]}}function Y(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function J(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Z(){return{type:"emphasis",children:[]}}function ee(){return{type:"heading",depth:void 0,children:[]}}function te(){return{type:"break"}}function ne(){return{type:"html",value:""}}function re(){return{type:"image",title:null,url:"",alt:null}}function oe(){return{type:"link",title:null,url:"",children:[]}}function ie(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function ae(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function se(){return{type:"paragraph",children:[]}}function le(){return{type:"strong",children:[]}}function ue(){return{type:"text",value:""}}function ce(){return{type:"thematicBreak"}}}(n)(jC(DC(n).document().write(FC()(e,t,!0))))},IC=nE,AC=iE,RC=aE,PC=sE,LC=cE,DC=function(e){var t={defined:[],constructs:xC([kC].concat(CC((e||{}).extensions))),content:n(bC),document:n(wC),flow:n(EC),string:n(SC.string),text:n(SC.text)};return t;function n(e){return function(n){return _C(t,e,n)}}},FC=function(){var e,t=!0,n=1,r="";return function(o,i,a){var s,l,u,c,d,f=[];o=r+o.toString(i),u=0,r="",t&&(65279===o.charCodeAt(0)&&u++,t=void 0);for(;u":""))+")");return d;function d(){var u,c,d=l.concat(a),f=[];if((!t||i(a,s,l[l.length-1]||null))&&(f=function(e){if(null!==e&&"object"==typeof e&&"length"in e)return e;if("number"==typeof e)return[YC,e];return[e]}(n(a,l)),f[0]===JC))return f;if(a.children&&f[0]!==XC)for(c=(r?a.children.length:-1)+o;c>-1&&c$/i,uk=/^<(\/?)([a-z]+)\s*>$/;var ck={},dk=ek,fk=[].splice;function pk(e,t){return function(e){return dk(e,n),e};function n(n,r,o){if(o&&!e(n,r,o)){var i=[r,1];return"unwrap"===t&&n.children&&(i=i.concat(n.children)),fk.apply(o.children,i),r}}}ck.ofType=function(e,t){return pk((function(t,n,r){return!e.includes(t.type)}),t)},ck.ifNotMatch=pk;var hk={exports:{}},mk={},gk="function"==typeof Symbol&&Symbol.for,vk=gk?Symbol.for("react.element"):60103,yk=gk?Symbol.for("react.portal"):60106,bk=gk?Symbol.for("react.fragment"):60107,wk=gk?Symbol.for("react.strict_mode"):60108,Ek=gk?Symbol.for("react.profiler"):60114,Sk=gk?Symbol.for("react.provider"):60109,xk=gk?Symbol.for("react.context"):60110,_k=gk?Symbol.for("react.async_mode"):60111,Ck=gk?Symbol.for("react.concurrent_mode"):60111,kk=gk?Symbol.for("react.forward_ref"):60112,Tk=gk?Symbol.for("react.suspense"):60113,Nk=gk?Symbol.for("react.suspense_list"):60120,Ok=gk?Symbol.for("react.memo"):60115,Ik=gk?Symbol.for("react.lazy"):60116,Ak=gk?Symbol.for("react.block"):60121,Rk=gk?Symbol.for("react.fundamental"):60117,Pk=gk?Symbol.for("react.responder"):60118,Lk=gk?Symbol.for("react.scope"):60119;function Dk(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case vk:switch(e=e.type){case _k:case Ck:case bk:case Ek:case wk:case Tk:return e;default:switch(e=e&&e.$$typeof){case xk:case kk:case Ik:case Ok:case Sk:return e;default:return t}}case yk:return t}}}function Fk(e){return Dk(e)===Ck}mk.AsyncMode=_k,mk.ConcurrentMode=Ck,mk.ContextConsumer=xk,mk.ContextProvider=Sk,mk.Element=vk,mk.ForwardRef=kk,mk.Fragment=bk,mk.Lazy=Ik,mk.Memo=Ok,mk.Portal=yk,mk.Profiler=Ek,mk.StrictMode=wk,mk.Suspense=Tk,mk.isAsyncMode=function(e){return Fk(e)||Dk(e)===_k},mk.isConcurrentMode=Fk,mk.isContextConsumer=function(e){return Dk(e)===xk},mk.isContextProvider=function(e){return Dk(e)===Sk},mk.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===vk},mk.isForwardRef=function(e){return Dk(e)===kk},mk.isFragment=function(e){return Dk(e)===bk},mk.isLazy=function(e){return Dk(e)===Ik},mk.isMemo=function(e){return Dk(e)===Ok},mk.isPortal=function(e){return Dk(e)===yk},mk.isProfiler=function(e){return Dk(e)===Ek},mk.isStrictMode=function(e){return Dk(e)===wk},mk.isSuspense=function(e){return Dk(e)===Tk},mk.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===bk||e===Ck||e===Ek||e===wk||e===Tk||e===Nk||"object"==typeof e&&null!==e&&(e.$$typeof===Ik||e.$$typeof===Ok||e.$$typeof===Sk||e.$$typeof===xk||e.$$typeof===kk||e.$$typeof===Rk||e.$$typeof===Pk||e.$$typeof===Lk||e.$$typeof===Ak)},mk.typeOf=Dk,hk.exports=mk;var jk=hk.exports,Mk=$,zk=Xb,Uk=jk;function Bk(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=t.renderers[e.type];e.position||(e.position={start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}});var i=e.position.start,a=[e.type,i.line,i.column,r].join("-");if(!Uk.isValidElementType(o))throw new Error("Renderer for type `".concat(e.type,"` not defined or is not renderable"));var s=function(e,t,n,r,o,i){var a={key:t},s="string"==typeof r||r===Mk.Fragment;n.sourcePos&&e.position&&(a["data-sourcepos"]=function(e){return[e.start.line,":",e.start.column,"-",e.end.line,":",e.end.column].map(String).join("")}(e.position));n.rawSourcePos&&!s&&(a.sourcePosition=e.position);n.includeNodeIndex&&o.node&&o.node.children&&!s&&(a.index=o.node.children.indexOf(e),a.parentChildCount=o.node.children.length);var l=null!==e.identifier&&void 0!==e.identifier?n.definitions[e.identifier.toUpperCase()]||{}:null;switch(e.type){case"root":Hk(a,{className:n.className});break;case"text":a.nodeKey=t,a.children=e.value;break;case"heading":a.level=e.depth;break;case"list":a.start=e.start,a.ordered=e.ordered,a.spread=e.spread,a.depth=e.depth;break;case"listItem":a.checked=e.checked,a.spread=e.spread,a.ordered=e.ordered,a.index=e.index,a.children=function(e,t){var n=t&&t.node?function(e){var t=e.children,n=e.spread,r=-1;for(;!n&&++r1:t}var Gk=Bk,Wk=ek;function Vk(e){var t=e.children;e.children=[{type:"tableHead",align:e.align,children:[t[0]],position:t[0].position}],t.length>1&&e.children.push({type:"tableBody",align:e.align,children:t.slice(1),position:{start:t[1].position.start,end:t[t.length-1].position.end}})}var qk=ek,Qk=["http","https","mailto","tel"],Kk=Xb,Yk=$,Xk=parseInt((Yk.version||"16").slice(0,2),10)>=16,Jk=Yk.createElement,Zk={break:"br",paragraph:"p",emphasis:"em",strong:"strong",thematicBreak:"hr",blockquote:"blockquote",delete:"del",link:"a",image:"img",linkReference:"a",imageReference:"img",table:eT.bind(null,"table"),tableHead:eT.bind(null,"thead"),tableBody:eT.bind(null,"tbody"),tableRow:eT.bind(null,"tr"),tableCell:function(e){var t=e.align?{textAlign:e.align}:void 0,n=tT(e);return Jk(e.isHeader?"th":"td",t?Kk({style:t},n):n,e.children)},root:function(e){var t=e.className,n=!t&&Yk.Fragment||"div";return Jk(n,t?{className:t}:null,e.children)},text:function(e){var t=e.children||"";return Xk?t:Jk("span",null,t)},list:function(e){var t=tT(e);null!==e.start&&1!==e.start&&void 0!==e.start&&(t.start=e.start.toString());return Jk(e.ordered?"ol":"ul",t,e.children)},listItem:function(e){var t=null;if(null!==e.checked&&void 0!==e.checked){var n=e.checked;t=Jk("input",{type:"checkbox",checked:n,readOnly:!0})}return Jk("li",tT(e),t,e.children)},definition:function(){return null},heading:function(e){return Jk("h".concat(e.level),tT(e),e.children)},inlineCode:function(e){return Jk("code",tT(e),e.children)},code:function(e){var t=e.language&&"language-".concat(e.language),n=Jk("code",t?{className:t}:null,e.value);return Jk("pre",tT(e),n)},html:function(e){if(e.skipHtml)return null;var t=e.allowDangerousHtml||!1===e.escapeHtml,n=e.isBlock?"div":"span";if(!t)return Jk(Yk.Fragment||n,null,e.value);var r={dangerouslySetInnerHTML:{__html:e.value}};return Jk(n,r)},virtualHtml:function(e){return Jk(e.tag,tT(e),e.children)},parsedHtml:function(e){return e["data-sourcepos"]?Yk.cloneElement(e.element,{"data-sourcepos":e["data-sourcepos"]}):e.element}};function eT(e,t){return Jk(e,tT(t),t.children)}function tT(e){var t=e["data-sourcepos"];return t?{"data-sourcepos":t}:{}}var nT={},rT="__RMD_HTML_PARSER__";nT.HtmlParser="undefined"==typeof Symbol?rT:Symbol(rT);var oT=Xb,iT=Vw,aT=BC,sT=Db,lT=GC,uT=function(e){var t,n;return ak(e,"html",(function(e,r,o){n!==o&&(t=[],n=o);var i=function(e){var t=e.value.match(lk);return!!t&&t[1]}(e);if(i)return o.children.splice(r,1,{type:sk,tag:i,position:e.position}),!0;var a=function(e){var t=e.value.match(uk);return!!t&&{tag:t[2],opening:!t[1],node:e}}(e);if(!a)return!0;var s=function(e,t){var n=e.length;for(;n--;)if(e[n].tag===t)return e.splice(n,1)[0];return!1}(t,a.tag);return s?o.children.splice(r,0,function(e,t,n){var r=n.children.indexOf(e.node),o=n.children.indexOf(t.node),i=n.children.splice(r,o-r+1),a=i.slice(1,-1);return{type:sk,children:a,tag:e.tag,position:{start:e.node.position.start,end:t.node.position.end,indent:[]}}}(a,s,o)):a.opening||t.push(a),!0}),!0),e},cT=ck,dT=Gk,fT=function(e){return Wk(e,"table",Vk),e},pT=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return qk(e,"definition",(function(e){var n=e.identifier.toUpperCase();n in t||(t[n]={href:e.url,title:e.title})})),t},hT=function(e){var t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;var r=t.indexOf(":");if(-1===r)return t;for(var o=Qk.length,i=-1;++ii||-1!==(i=t.indexOf("#"))&&r>i?t:"javascript:void(0)"},mT=Zk,gT=nT,vT=Object.keys(mT),yT=function(e){var t=e.source||e.children||"";if(e.allowedTypes&&e.disallowedTypes)throw new Error("Only one of `allowedTypes` and `disallowedTypes` should be defined");var n=oT(mT,e.renderers),r=iT().use(aT).use(e.plugins||[]),o=r.runSync(r.parse(t)),i=oT(e,{renderers:n,definitions:pT(o)});return function(e){var t=[fT,lT()],n=e.disallowedTypes;e.allowedTypes&&(n=vT.filter((function(t){return"root"!==t&&-1===e.allowedTypes.indexOf(t)})));var r=e.unwrapDisallowed?"unwrap":"remove";n&&n.length>0&&t.push(cT.ofType(n,r));e.allowNode&&t.push(cT.ifNotMatch(e.allowNode,r));var o=(e.allowDangerousHtml||!1===e.escapeHtml)&&!e.skipHtml,i=(e.astPlugins||[]).some((function(e){return e.identity===gT.HtmlParser}));o&&!i&&t.push(uT);e.astPlugins&&(t=t.concat(e.astPlugins));return t.push(dT),t}(e).forEach((function(e){o=e(o,i)})),o};yT.defaultProps={transformLinkUri:hT},yT.propTypes={className:sT.string,source:sT.string,children:sT.string,sourcePos:sT.bool,rawSourcePos:sT.bool,escapeHtml:sT.bool,allowDangerousHtml:sT.bool,skipHtml:sT.bool,allowNode:sT.func,allowedTypes:sT.arrayOf(sT.oneOf(vT)),disallowedTypes:sT.arrayOf(sT.oneOf(vT)),transformLinkUri:sT.oneOfType([sT.func,sT.bool]),linkTarget:sT.oneOfType([sT.func,sT.string]),transformImageUri:sT.func,astPlugins:sT.arrayOf(sT.func),unwrapDisallowed:sT.bool,renderers:sT.object,plugins:sT.array},yT.types=vT,yT.renderers=mT,yT.uriTransformer=hT;const bT=o(yT),wT=by("a").withConfig({shouldForwardProp:e=>!["noVisitedState","textColour","muted"].includes(e),displayName:"src__Link",componentId:"sc-1loawqx-0"})(...Lm.common(),Lm.styleDefault,Lm.printFriendly,(e=>{let{muted:t=!1}=e;return t?Lm.styleMuted:void 0}),(e=>{let{textColour:t=!1}=e;return t?Lm.styleText:void 0}),(e=>{let{noVisitedState:t=!1}=e;return t?Lm.styleNoVisitedState:void 0}));wT.displayName="Link",by(bT).withConfig({displayName:"src__StyledParagraph",componentId:"sc-sgc9po-0"})({margin:0,"> p":{margin:0},"> p > code":{padding:"0.2em 0.4em",margin:"0",fontSize:"85%",backgroundColor:"rgba(27,31,35,0.05)",borderRadius:"3px"},"> pre":{padding:"16px",overflow:"auto",fontSize:"85%",lineHeight:"1.45",backgroundColor:"#f6f8fa",borderRadius:"3px"},"> pre > code":{display:"inline",padding:"0",margin:"0",border:"0",overflow:"visible",lineHeight:"inherit",wordWrap:"normal"}},(e=>{let{supportingText:t}=e;return Nm.font({size:t?16:19})}),Sm.withWhiteSpace({marginBottom:4})),by(wT).withConfig({displayName:"src__StyledErrorText",componentId:"sc-6d0w2-0"})({fontFamily:om,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",fontWeight:700,marginBottom:Yh,textDecoration:"underline",textDecorationSkipInk:"none",textTransform:"none",cursor:"pointer",fontSize:um,lineHeight:hm,":visited":{color:`${qp}`},[rm.LARGESCREEN]:{fontSize:cm,lineHeight:mm},color:`${qp}`,paddingTop:"4px",paddingBottom:"2px"}),by("div").withConfig({displayName:"src__StyledErrorSummary",componentId:"sc-6d0w2-1"})({color:Yp,padding:Rh.mobile,border:`4px solid ${qp}`,"&:focus":{outline:`${Oh} solid ${Xp}`,outlineOffset:"0"},[rm.LARGESCREEN]:{padding:Rh.tablet,border:`${Gh} solid ${qp}`}},Sm.withWhiteSpace({marginBottom:6}));by("legend").withConfig({displayName:"legend__StyledLegend",componentId:"sc-12rap65-0"})(Sm.withWhiteSpace(),Nm.font({size:19}),Nm.textColour,{boxSizing:"border-box",display:"table",maxWidth:"100%",marginBottom:Fh[2],padding:0,whiteSpace:"normal"},(e=>{let{size:t}=e;const n=Number.isNaN(Number(t))?zh[t]:t;if(void 0!==t&&!n)throw Error(`Unknown size ${t} used for legend.`);if(n)return{...Nm.font({size:n,weight:"bold"}),...n>19?{marginBottom:Fh[3]}:void 0}})),by("h1").withConfig({displayName:"legend__StyledHeading",componentId:"sc-12rap65-1"})({margin:0,fontSize:"inherit",fontWeight:"inherit"});function ET(){return ET=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{meta:n={},children:r,hint:o,acceptedFormats:i,onChange:a,name:s,...l}=e;return $.createElement(Ab,ET({},l,{error:n.touched&&!!n.error}),$.createElement(Nb,null,r),o&&$.createElement(bb,null,o),n.touched&&n.error&&$.createElement(Ob,null,n.error),$.createElement(ST,{type:"file",accept:i,onChange:a,name:s,ref:t}))})).displayName="FileUpload";by("span").withConfig({shouldForwardProp:e=>!["important","focusable"].includes(e),displayName:"src__VisuallyHidden",componentId:"sc-nxwj55-0"}).attrs((e=>{let{focusable:t=!1,tabIndex:n}=e;return t&&void 0===n?{tabIndex:"0"}:void 0}))((e=>{let{focusable:t=!1,important:n=!0}=e;return gm({focusable:t,important:n})})).displayName="VisuallyHidden",by("div").withConfig({displayName:"width-container__WidthContainer",componentId:"sc-213f5v-0"})({maxWidth:qh,margin:`0 ${Kh}`,[rm.TABLET]:{margin:`0 ${Qh}`},[rm.MAX]:{margin:"0 auto"}},Sm.withWhiteSpace()),by("div").withConfig({displayName:"navigation__NavigationContainer",componentId:"sc-1wmnar6-0"})({display:"flex",marginRight:`-${Kh}`,marginLeft:`-${Kh}`,flexWrap:"wrap"}),by(wT).withConfig({displayName:"link__FooterLink",componentId:"sc-1vhdcoj-0"})({":link, :visited":{color:$p},":hover":{color:Hp}}),by("hr").withConfig({displayName:"section-break__SectionBreak",componentId:"sc-1i3rjvm-0"})({margin:0,border:0,borderBottom:`1px solid ${Qp}`},Sm.withWhiteSpace({marginBottom:8})),by("div").withConfig({displayName:"meta-custom__MetaCustom",componentId:"sc-1dgx5ff-0"})({marginBottom:Sm.simple(4)}),by("svg").withConfig({displayName:"licence__LicenceLogo",componentId:"sc-76bcjk-0"})({display:"inline-block",marginRight:Sm.simple(2),marginBottom:Sm.simple(3),verticalAlign:"top",[rm.DESKTOP]:{marginBottom:0}}),by("span").withConfig({displayName:"licence__LicenceDescription",componentId:"sc-76bcjk-1"})({display:"inline-block"}),by("div").withConfig({displayName:"meta__Meta",componentId:"sc-b55tvf-0"})({display:"flex",marginRight:`-${Kh}`,marginLeft:`-${Kh}`,flexWrap:"wrap",alignItems:"flex-end",justifyContent:"center"},Nm.common()),by("div").withConfig({displayName:"meta-item__MetaItem",componentId:"sc-nseoos-0"})({marginRight:Kh,marginBottom:Sm.simple(5),marginLeft:Kh},(e=>{let{grow:t=!1}=e;return t&&{flex:1,flexBasis:"320px",[rm.DESKTOP]:{flexBasis:0}}})),by(wT).withConfig({displayName:"copyright__StyledCopyright",componentId:"sc-1i22iwf-0"})({display:"inline-block",textAlign:"center",textDecoration:"none",whiteSpace:"nowrap",":link, :visited":{color:$p},":hover":{color:Hp}},(e=>{let{image:t}=e;return t&&{minWidth:t.width,paddingTop:t.height+10,backgroundImage:`url(${t.src})`,backgroundRepeat:"no-repeat",backgroundPosition:"50% 0%",backgroundSize:`${t.width}px ${t.height}px`}})),by("ul").withConfig({displayName:"unordered-list__UnorderedList",componentId:"sc-1r7pzdm-0"})((e=>{let{inline:t=!1}=e;return t?{marginTop:0,marginBottom:Sm.simple(3),padding:0}:{margin:0,padding:0,listStyle:"none",columnGap:`${Qh}`}}),(e=>{let{columns:t}=e;return t&&{[rm.DESKTOP]:{columnCount:t}}})),by("li").withConfig({displayName:"list-item__ListItem",componentId:"sc-hn98ju-0"})((e=>{let{inline:t=!1}=e;return t?{display:"inline-block",marginRight:Sm.simple(3),marginBottom:Sm.simple(1)}:Sm.withWhiteSpace({marginBottom:4})}),{"&:last-child":{marginBottom:0}}),by("div").withConfig({displayName:"section__Section",componentId:"sc-1fjqcmw-0"})({display:"inline-block",marginRight:Kh,marginBottom:Qh,marginLeft:Kh,verticalAlign:"top",flexGrow:1,flexShrink:1,flexBasis:"200px",[rm.DESKTOP]:{flexBasis:"auto","&:first-of-type":{flexGrow:2}}}),by((e=>$.createElement(Yb,Qb({as:"h2",size:Hh[2]},e)))).withConfig({displayName:"section-heading__SectionHeading",componentId:"sc-1i3z2gv-0"})({borderBottom:`1px solid ${Qp}`,paddingBottom:Sm.simple(2),marginTop:0,[rm.DESKTOP]:{paddingBottom:Sm.simple(4)}},Sm.withWhiteSpace({marginBottom:7})),by("footer").withConfig({displayName:"src__FooterContainer",componentId:"sc-1t3c5e2-0"})({borderTop:`1px solid ${Gp}`,background:`${Wp}`,color:`${Bp}`},Nm.font({size:16}),Sm.withWhiteSpace({padding:[{size:7,direction:"top"},{size:5,direction:"bottom"}]}));by("div").withConfig({displayName:"src__FormGroup",componentId:"sc-1m4431t-0"})(Sm.responsiveMargin({size:6,direction:"bottom"}),{"& &:last-of-type":{marginBottom:0}},(e=>{let{error:t=!1}=e;return t?{paddingLeft:Fh[3],borderLeft:`${Vh} solid ${qp}`,"&& &":{padding:0,border:0}}:void 0}),Sm.withWhiteSpace()).displayName="FormGroup";const xT=function(e){for(var t=[],n=1;n{let t=kT(e);if(!t){let n;Object.entries(e).forEach((e=>{let[t,r]=e;if(CT[t]&&!0===r){const e=t.replace("column","").replace(/^([A-Z][a-z]+)([A-Z])/,"$1-$2").toLocaleLowerCase();console.warn(`deprecated prop ${t} used in GridCol, please replace with setWidth="${e}"`),n=CT[t]}})),t={[rm.TABLET]:{width:n}}}t[rm.TABLET]=NT(t[rm.TABLET]);const n=TT({setWidth:e.setDesktopWidth});return n&&(n[rm.DESKTOP]=NT(n[rm.DESKTOP])),{...t,...n}}));$.forwardRef(((e,t)=>{let{columnOneQuarter:n=!1,columnOneThird:r=!1,columnOneHalf:o=!1,columnTwoThirds:i=!1,columnThreeQuarters:a=!1,columnFull:s=!1,...l}=e;return $.createElement(OT,_T({columnOneThird:r,columnOneHalf:o,columnTwoThirds:i,columnThreeQuarters:a,columnFull:s,columnOneQuarter:n},l),l.children)})).displayName="GridCol";function IT(){return IT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{meta:t={},children:n,hint:r,input:o={},...i}=e;return $.createElement(Ab,IT({},i,{error:t.touched&&!!t.error}),$.createElement(Nb,null,n),r&&$.createElement(bb,null,r),t.touched&&t.error&&$.createElement(Ob,null,t.error),$.createElement(Ib,IT({error:t.touched&&!!t.error},o)))};AT.displayName="InputField";by("div").withConfig({displayName:"src__InsetText",componentId:"sc-5ju5m4-0"})(Nm.font({size:19}),Nm.textColour,{padding:Fh[3]},Sm.withWhiteSpace({margin:{size:6,direction:["top","bottom"]}}),{clear:"both",borderLeft:`10px solid ${Qp}`,":first-child":{marginTop:0},":only-child,:last-child":{marginBottom:0}}).displayName="InsetText";by("p").withConfig({displayName:"src__LeadParagraph",componentId:"sc-1bvfkuk-0"})(Nm.textColour,Nm.font({size:24}),{marginTop:0},Sm.withWhiteSpace({marginBottom:6})).displayName="LeadParagraph";const RT="a-f\\d",PT=`#?[${RT}]{3}[${RT}]?`,LT=`#?[${RT}]{6}([${RT}]{2})?`,DT=new RegExp(`[^#${RT}]`,"gi"),FT=new RegExp(`^${PT}$|^${LT}$`,"i");const jT=o(((e,t={})=>{if("string"!=typeof e||DT.test(e)||!FT.test(e))throw new TypeError("Expected a valid hex string");let n=1;8===(e=e.replace(/^#/,"")).length&&(n=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),4===e.length&&(n=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const r=Number.parseInt(e,16),o=r>>16,i=r>>8&255,a=255&r,s="number"==typeof t.alpha?t.alpha:n;if("array"===t.format)return[o,i,a,s];if("css"===t.format){return`rgb(${o} ${i} ${a}${1===s?"":` / ${Number((100*s).toFixed(2))}%`})`}return{red:o,green:i,blue:a,alpha:s}}));function MT(){return MT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{children:t,title:n,fill:r="currentColor",width:o="100%",...i}=e;return G.createElement(zT,MT({version:"1.1",height:"100%",fill:r,width:o},i),G.createElement("title",null,n),t)},BT=e=>{let{fill:t="currentColor",title:n="Search",...r}=e;return $.createElement(UT,MT({viewBox:"0 0 57 57",title:n,fill:t},r),$.createElement("path",{d:"M55.146,51.887L41.588,37.786c3.486-4.144,5.396-9.358,5.396-14.786c0-12.682-10.318-23-23-23s-23,10.318-23,23 s10.318,23,23,23c4.761,0,9.298-1.436,13.177-4.162l13.661,14.208c0.571,0.593,1.339,0.92,2.162,0.92 c0.779,0,1.518-0.297,2.079-0.837C56.255,54.982,56.293,53.08,55.146,51.887z M23.984,6c9.374,0,17,7.626,17,17s-7.626,17-17,17 s-17-7.626-17-17S14.61,6,23.984,6z"}))},HT=function(e){for(var t=[],n=1;n83*e.animationDelay));const $T="icon-loading";function GT(){return GT=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{timeIn:t,timeOut:n,backgroundColor:r,backgroundColorOpacity:o}=e;return{position:"absolute",height:"100%",top:0,right:0,left:0,bottom:0,display:"flex",justifyContent:"center",[`& .${$T}`]:{position:"absolute",zIndex:101,opacity:1,display:"block",height:"100%",maxHeight:"calc(50vh + 100px)",transition:`opacity ${t}ms ease-in-out`,willChange:"opacity"},"& .overlay":{zIndex:100,transition:`background-color ${t}ms ease-in-out`,willChange:"background-color",backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n ${o})`},"&.fade-enter":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n 0)`,transitionDuration:`${t}ms`},[`& .${$T}`]:{opacity:0,transitionDuration:`${t}ms`,transitionDelay:t/2+"ms"}},"&.fade-enter-active":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n ${o})`,transitionDuration:`${t}ms`},[`& .${$T}`]:{opacity:1,transitionDuration:`${t}ms`,transitionDelay:t/2+"ms"}},"&.fade-exit":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n ${o})`,transitionDuration:`${n}ms`},[`& .${$T}`]:{opacity:1,transitionDuration:`${n}ms`}},"&.fade-exit-active":{"& .overlay":{backgroundColor:`rgba(\n ${jT(r).red},\n ${jT(r).blue},\n ${jT(r).green},\n 0)`,transitionDuration:`${n}ms`},[`& .${$T}`]:{opacity:0,transitionDuration:`${n}ms`}}}})),by("div").withConfig({displayName:"src__Overlay",componentId:"sc-gm1edz-2"})({position:"absolute",top:0,right:0,bottom:0,left:0,overflow:"hidden",height:"100%",width:"100%"}),by("div").withConfig({displayName:"src__OuterContainer",componentId:"sc-1lvyroj-0"})({paddingTop:em,textAlign:"center"}),by("div").withConfig({displayName:"src__InnerContainer",componentId:"sc-1lvyroj-1"})({maxWidth:qh,marginLeft:Jh,marginRight:Jh,textAlign:"left",[rm.LARGESCREEN]:{marginLeft:em,marginRight:em},"@media only screen and (min-width:1020px)":{margin:"0 auto"}}),by("div").withConfig({displayName:"src__StyledFieldset",componentId:"sc-g1up10-0"})({padding:0,margin:0,border:0,boxSizing:"border-box",width:"100%",":after":{content:"''",display:"table",clear:"both"}},(e=>{let{error:t}=e;return{borderLeft:t?`4px solid ${qp}`:void 0,marginRight:t?Jh:void 0,paddingLeft:t?Xh:void 0}}),Sm.withWhiteSpace({marginBottom:0}));const WT=by("a").withConfig({displayName:"src__StyledSkipLink",componentId:"sc-njuwuz-0"})(gm.focusable(),Lm.common(),Lm.styleText,Nm.responsive(16),{display:"block",padding:`${Fh[2]}px ${Fh[3]}px`,"@supports (padding:max(calc(0px)))":{paddingRight:`max(${Fh[3]}px, calc(${Fh[3]}px + env(safe-area-inset-right)))`,paddingLeft:`max(${Fh[3]}px, calc(${Fh[3]}px + env(safe-area-inset-left)))`}});G.forwardRef(((e,t)=>{let{children:n="Skip to main content",href:r="#content",...o}=e;return G.createElement(WT,GT({ref:t,href:r},o),n)})).displayName="SkipLink";var VT=["children","fill","title","className"];function qT(){return qT=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,VT);return G.createElement("svg",qT({version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",className:o,style:{display:"block"},fill:n},i),G.createElement("title",null,r),t)};QT.propTypes={children:Fb.node.isRequired,className:Fb.string,title:Fb.string,fill:Fb.string},QT.defaultProps={className:void 0,title:void 0,fill:"currentColor"};var KT=["fill","title"];function YT(){return YT=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,KT);return G.createElement(QT,YT({viewBox:"0 0 28 21",title:n,fill:t},r),G.createElement("path",{d:"M12.6323095,3.55271368e-15 L13.3909515,2.38583111 L13.3855375,2.39239563 C13.3171852,2.44572391 13.2556006,2.50656416 13.2034905,2.57613454 L13.1967229,2.58141323 L11.3133145,1.98532767 L11.3133145,4.76503003 L13.2007834,3.77500554 L13.204844,3.77899839 C13.2603379,3.85229093 13.3253063,3.91678566 13.3990726,3.97194117 L12.316265,7.24080185 C12.3155883,7.24486238 12.313558,7.24892291 12.3122045,7.25230668 L12.310851,7.25636721 C12.2607711,7.42014185 12.2330242,7.59271431 12.2330242,7.77205431 C12.2330242,8.65657274 12.8854157,9.38611433 13.7347429,9.51131396 C13.7476013,9.51334422 13.7597828,9.51672799 13.7726412,9.5180815 C13.8450539,9.52755607 13.9181434,9.53432362 13.99394,9.53432362 C14.068383,9.53432362 14.1435028,9.52823283 14.2159155,9.5180815 C14.2280971,9.51672799 14.2402787,9.51402098 14.2524603,9.51131396 C15.1017875,9.38611433 15.7555325,8.65657274 15.7555325,7.77205431 C15.7555325,7.59271431 15.7271088,7.42014185 15.6777057,7.25636721 L15.6763522,7.25230668 C15.6756755,7.24824615 15.674322,7.24418562 15.6722917,7.24080185 L14.5894841,3.97194117 C14.6632504,3.91678566 14.7282189,3.85235861 14.7843895,3.77899839 L14.7891268,3.77500554 L16.675919,4.76503003 L16.675919,1.98532767 L14.7904803,2.58141323 L14.785743,2.57613454 C14.7329561,2.50656416 14.672725,2.44572391 14.6030192,2.39239563 L14.5976052,2.38583111 L15.3562472,3.55271368e-15 L13.9952935,3.55271368e-15 L12.6323095,3.55271368e-15 Z M5.84513631,3.57543057 C5.26698475,3.58436374 4.7158357,3.93485501 4.48106948,4.50461481 C4.16786739,5.26068519 4.53026955,6.13227761 5.28336221,6.44087776 C6.05086975,6.75759897 6.92205611,6.39485844 7.23404003,5.63608104 C7.54873098,4.87899553 7.18937422,3.99962044 6.42125761,3.68513251 C6.2333905,3.60777945 6.03787605,3.57245285 5.84513631,3.57543057 Z M22.155602,3.57543057 C21.9627269,3.57245285 21.766468,3.60777945 21.5783302,3.68513251 C20.8108903,3.99962044 20.4515336,4.87899553 20.7655478,5.63608104 C21.0782085,6.39485844 21.9491918,6.75759897 22.7173084,6.44087776 C23.4705364,6.13227761 23.8326002,5.26068519 23.5199395,4.50461481 C23.2851056,3.93485501 22.7342273,3.58436374 22.155602,3.57543057 Z M9.61601365,4.76638354 C9.03806511,4.7753167 8.48651001,5.12553727 8.25167612,5.69556778 C7.93901543,6.45170584 8.30107921,7.32201242 9.05430722,7.63061257 C9.82174708,7.94733378 10.6927304,7.58594676 11.0053911,6.82730471 C11.3194053,6.07069293 10.9600485,5.18982897 10.1926087,4.87473197 C10.0037941,4.79744658 9.80888874,4.76333814 9.61601365,4.76638354 Z M18.3847246,4.76638354 C18.1918495,4.76333814 17.9962674,4.79744658 17.8081296,4.87473197 C17.0413665,5.18982897 16.6799795,6.07069293 16.9939937,6.82730471 C17.3073311,7.58594676 18.1783145,7.94733378 18.9464311,7.63061257 C19.6989823,7.32201242 20.0617229,6.45170584 19.7490622,5.69556778 C19.5142283,5.12553727 18.9633499,4.7753167 18.3847246,4.76638354 Z M2.4654232,5.55547955 C1.88733932,5.56461574 1.33639329,5.91483631 1.1012887,6.48486682 C0.788560341,7.24012509 1.15048877,8.11246194 1.9036491,8.42106209 C2.67156269,8.7377833 3.54335813,8.37504277 3.85588346,7.61640072 C4.17043906,6.85911218 3.80959344,5.98027849 3.04167985,5.66518149 C2.85360971,5.58796378 2.65809527,5.55243416 2.4654232,5.55547955 Z M25.5339616,5.55547955 C25.3417632,5.55243416 25.1461811,5.58796378 24.9580433,5.66518149 C24.1912802,5.98027849 23.8305699,6.85911218 24.1452609,7.61640072 C24.4579216,8.37504277 25.3282281,8.7377833 26.0963448,8.42106209 C26.848896,8.11246194 27.2123133,7.24012509 26.8996526,6.48486682 C26.6648187,5.91483631 26.1125869,5.56461574 25.5339616,5.55547955 Z M1.47668455,9.31167131 C0.898397633,9.32114588 0.347654636,9.67102807 0.11261772,10.2415323 C-0.200381341,10.9974673 0.162054653,11.8691274 0.914910448,12.1777276 C1.68302706,12.4944488 2.55421342,12.1330618 2.86721248,11.373743 C3.18149738,10.6171312 2.82200527,9.73667328 2.05429471,9.42198233 C1.86615689,9.34415554 1.66949197,9.30896429 1.47668455,9.31167131 Z M26.5240537,9.31167131 C26.3318554,9.30896429 26.1362733,9.34415554 25.9481355,9.42198233 C25.1800189,9.73667328 24.8193086,10.6171312 25.1339995,11.373743 C25.4459835,12.1330618 26.3183203,12.4944488 27.0857602,12.1777276 C27.8389882,11.8691274 28.2003752,10.9974673 27.8870378,10.2415323 C27.6528806,9.67102807 27.102679,9.32114588 26.5240537,9.31167131 Z M6.8677127,9.70824958 C5.63798169,11.343289 5.81258441,12.6934147 7.33602697,14.2134058 C6.34390454,13.6645577 4.80266333,14.2418295 5.71140957,16.0954607 C6.18642372,14.9422706 7.2040598,15.2021445 7.41656078,16.1929134 C7.56003279,16.8926778 7.13435406,17.716965 6.20977176,17.8861537 C5.45261857,18.0262419 4.28413386,17.5071711 3.34804672,15.4911187 C3.87571238,15.5039771 4.33570257,15.7706184 4.93422445,16.1827621 L3.95083215,12.9086227 C3.7029369,13.8283324 3.38702779,14.4292906 3.0520342,14.7561631 C2.82613347,14.0936202 2.85882073,13.6151546 3.05995223,12.5844572 L1.03097388,13.3065545 C2.10829973,14.7771425 3.15178785,16.8425979 4.00896538,20.4469936 C7.02878033,20.0152241 10.4172912,19.7722691 13.9978652,19.7722691 C17.5785744,19.7722691 20.9684388,20.0152241 23.9887952,20.4483471 C24.8462434,16.8425979 25.890476,14.7771425 26.9685462,13.3065545 L24.9396356,12.5844572 C25.1413085,13.6151546 25.173116,14.0936202 24.9470799,14.7561631 C24.612763,14.4292906 24.2946883,13.8283324 24.0469961,12.9086227 L23.065025,16.1827621 C23.6625994,15.7706184 24.1248229,15.5039771 24.6526916,15.4911187 C23.7167398,17.5071711 22.5473076,18.0262419 21.7893423,17.8861537 C20.8648954,17.716965 20.4392166,16.8926778 20.5826886,16.1929134 C20.7958664,15.2021445 21.8130287,14.9422706 22.2881106,16.0954607 C23.1963154,14.2418295 21.6553449,13.6645577 20.6632225,14.2134058 C22.1872741,12.6934147 22.3612001,11.343289 21.1315367,9.70824958 C19.417317,11.0184467 19.3976911,12.3151088 20.1691915,14.1403163 C19.1682713,12.9952473 17.6103819,13.6090638 18.1727651,15.4593113 C18.8941856,14.342666 19.8511168,15.0458141 19.7008772,16.1069655 C19.5743241,17.0320892 18.3534586,17.7778729 16.8327907,17.6459058 C14.6543172,17.4482934 14.5237036,15.9458979 14.4695632,14.7006692 C15.0048762,14.601863 15.9692517,15.0979242 16.7915087,16.2524678 L17.0946948,12.7800393 C16.200025,13.7132841 15.3872426,13.889917 14.483775,13.9183407 C14.7842541,12.9803587 16.1668641,11.4441255 16.1668641,11.4441255 L14.1589328,11.4441255 L14.1575793,11.4441255 L11.83225,11.4441255 C11.83225,11.4441255 13.2141832,12.9803587 13.515339,13.9183407 C12.6118715,13.889917 11.799089,13.7132841 10.9044193,12.7800393 L11.2076054,16.2524678 C12.0305392,15.0979242 12.9942379,14.601863 13.5295509,14.7006692 C13.4760873,15.9458979 13.3454736,17.4482934 11.1663234,17.6459058 C9.6456555,17.7778729 8.42614349,17.0320892 8.29959035,16.1069655 C8.1493508,15.0458141 9.10425172,14.342666 9.82634902,15.4593113 C10.3887322,13.6090638 8.83016606,12.9952473 7.82992257,14.1403163 C8.60142296,12.3151088 8.58179707,11.0184467 6.86757735,9.70824958 L6.8677127,9.70824958 Z"}))}).defaultProps={title:"GOV.UK",fill:"currentColor"},by("div").withConfig({displayName:"top-nav-wrapper__TopNavWrapper",componentId:"sc-1wnrl5k-0"})((e=>{let{bgColor:t,color:n}=e;return{display:"flex",justifyContent:"center",backgroundColor:t,color:n,fontFamily:om,fontWeight:400,fontSize:lm,lineHeight:pm,[rm.LARGESCREEN]:{fontSize:um,lineHeight:hm}}})),by("div").withConfig({displayName:"top-nav-inner__TopNavInner",componentId:"sc-15yph1v-0"})({display:"flex",flexDirection:"column",width:`calc(100% - ${em})`,maxWidth:"960px",padding:`calc(${Xh} * 0.8) ${Jh}`,boxSizing:"border-box",[rm.LARGESCREEN]:{padding:`calc(${Xh} * 0.8) 0`,flexDirection:"row",width:`calc(100% - ${tm})`}}),by("div").withConfig({displayName:"bottom-nav-wrapper__BottomNavWrapper",componentId:"sc-1334g24-0"})({borderBottom:`10px solid ${dh}`,maxWidth:"960px",margin:"0 auto",width:`calc(100% - ${em})`,[rm.LARGESCREEN]:{width:`calc(100% - ${tm})`}}),by("div").withConfig({displayName:"company__Company",componentId:"sc-fxukuq-0"})({display:"flex",fontWeight:800,alignItems:"center",justifyContent:"flex-start",fontSize:"30px"}),by("div").withConfig({displayName:"logo-search-wrapper__LogoSearchWrapper",componentId:"sc-1iq7ssu-0"})({display:"flex",justifyContent:"space-between",[rm.LARGESCREEN]:{display:"block",paddingRight:Jh,width:"33.33%"}}),by("div").withConfig({displayName:"right-hand-side__RightHandSide",componentId:"sc-1c11aed-0"})({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",marginTop:Xh,[rm.LARGESCREEN]:{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",width:"66.66%",paddingLeft:Jh,marginTop:0}}),by("div").withConfig({displayName:"search-wrapper__SearchWrapper",componentId:"sc-on0jnt-0"})({marginTop:Yh,width:"50%",minWidth:"110px",[rm.LARGESCREEN]:{width:"100%"}}),by("ul").withConfig({shouldForwardProp:e=>!["serviceTitle","open"].includes(String(e)),displayName:"unordered-list__Ul",componentId:"sc-otbf2p-0"})((e=>{let{serviceTitle:t,open:n}=e;return{display:n?"flex":"none",flexWrap:"wrap",margin:0,padding:0,marginTop:Yh,width:"100%",[rm.LARGESCREEN]:{display:"flex",paddingTop:t?0:em,width:"auto"}}})),by("li").withConfig({displayName:"list-item__Li",componentId:"sc-1kicpn1-0"})({flex:"1 0 50%",width:"100%",listStyleType:"none",margin:0,padding:"3px 0",borderBottom:`1px solid ${Vp}`,[rm.LARGESCREEN]:{borderBottom:0,flex:"none",width:"auto",paddingRight:Jh}}),by("label").withConfig({displayName:"menu-button__Button",componentId:"sc-1yd67mz-0"})({display:"flex",alignItems:"center",[rm.LARGESCREEN]:{display:"none"}}),by("div").withConfig({displayName:"menu-button__ButtonText",componentId:"sc-1yd67mz-1"})({cursor:"default",":hover":{textDecoration:"underline"}}),by("div").withConfig({displayName:"menu-button__ButtonIcon",componentId:"sc-1yd67mz-2"})((e=>{let{open:t}=e;return{content:'""',display:"inline-block",width:"0",height:"0",borderStyle:"solid",borderColor:"transparent",clipPath:t?"polygon(50% 0%, 0% 100%, 100% 100%)":"polygon(0% 0%, 50% 100%, 100% 0%)",borderWidth:t?"0 5px 8.66px 5px":"8.66px 5px 0 5px",marginLeft:"5px",borderTopColor:"inherit",borderBottomColor:"inherit"}}));by("div").withConfig({displayName:"icon-title__Container",componentId:"sc-onvli0-0"})({verticalAlign:"baseline"}),by("span").withConfig({displayName:"icon-title__IconContainer",componentId:"sc-onvli0-1"})({width:"36px",maxHeight:"27px",display:"inline-block",marginRight:"7px"}),by("span").withConfig({displayName:"icon-title__TitleContainer",componentId:"sc-onvli0-2"})({display:"inline-block",fontWeight:700});const XT=by("a").withConfig({displayName:"top-nav-anchor__TopNavAnchor",componentId:"sc-lt39h5-0"})({color:oh,textDecoration:"none",textDecorationSkipInk:"none",borderBottom:"1px solid transparent",fontWeight:700,lineHeight:1,":hover":{borderBottomColor:oh},":focus":{outline:`3px solid ${uh}`}});XT.displayName="TopNav.Anchor";by(XT).withConfig({displayName:"nav-link-anchor__NavLinkAnchor",componentId:"sc-1pr115z-0"})({display:"inline-block",":focus":{color:sh,backgroundColor:uh,outline:`3px solid ${uh}`,":hover":{borderBottomColor:sh}}}).displayName="TopNav.NavLink",by("div").withConfig({displayName:"src__ServiceTitleWrapper",componentId:"sc-140rlix-0"})(Nm.font({size:24}),{width:"50%",[rm.LARGESCREEN]:{width:"auto"}}),by("div").withConfig({displayName:"src__MenuButtonWrapper",componentId:"sc-140rlix-1"})({display:"flex",justifyContent:"flex-end",alignItems:"flex-end",width:"50%",[rm.LARGESCREEN]:{width:"auto"}}),by("input").withConfig({displayName:"src__Input",componentId:"sc-140rlix-2"})({position:"absolute",top:"-999em",":checked + ul":{display:"flex"},[rm.LARGESCREEN]:{display:"none"}}),by("main").withConfig({displayName:"main__Main",componentId:"sc-hiygwk-0"})(Sm.withWhiteSpace({padding:{size:6,direction:["top","bottom"]}}),{display:"block"}),by("div").withConfig({displayName:"width-container__WidthContainer",componentId:"sc-paw03d-0"})({maxWidth:qh,margin:`0 ${Kh}`,[rm.TABLET]:{margin:`0 ${Qh}`},[rm.MAX]:{margin:"0 auto"}},Sm.withWhiteSpace()),by("li").withConfig({displayName:"anchor__PaginationWrapper",componentId:"sc-2udijf-0"})({boxSizing:"border-box",margin:0,padding:0,listStyleType:"none",fontFamily:om,fontWeight:400,textTransform:"none",fontSize:dm,lineHeight:hm,width:"100%",[rm.LARGESCREEN]:{fontSize:fm,lineHeight:hm},"> a":{boxSizing:"border-box",color:dh,fill:"currentColor",padding:Jh,backgroundColor:oh,textDecoration:"none",outlineColor:"transparent",display:"flex",flexDirection:"column",alignItems:"center",width:"100%",":hover":{backgroundColor:ih},":focus":{outline:`3px solid ${uh}`},":visited":{color:ch}}},(e=>{let{previousPage:t}=e;return{marginRight:t?"3px":void 0," > a":{alignItems:t?"flex-start":void 0}," > a div":{justifyContent:t?"flex-start":void 0," > svg":{height:t?"13px":void 0,width:t?"17px":void 0,marginRight:t?"10px":void 0}}}}),(e=>{let{nextPage:t}=e;return{" > a":{alignItems:t?"flex-end":void 0}," > a div":{justifyContent:t?"flex-end":void 0," > svg":{height:t?"13px":void 0,width:t?"17px":void 0,marginLeft:t?"10px":void 0}}}})),by("div").withConfig({displayName:"anchor__InnerWrap",componentId:"sc-2udijf-1"})({display:"flex",alignItems:"center",width:"100%"}),by("span").withConfig({displayName:"anchor__PageTitle",componentId:"sc-2udijf-2"})({fontSize:lm,lineHeight:pm,textDecoration:"underline",[rm.LARGESCREEN]:{fontSize:um,lineHeight:hm}}),by("a").withConfig({displayName:"anchor__Anchor",componentId:"sc-2udijf-3"})({}),by("ul").withConfig({displayName:"src__StyledList",componentId:"sc-elluw3-0"})(Nm.font({size:19}),{boxSizing:"border-box",display:"flex",flexDirection:"column",marginTop:Fh[5],padding:Fh[2],justifyContent:"space-between",width:"100%",[rm.LARGESCREEN]:{flexDirection:"row"}},Sm.withWhiteSpace({marginBottom:6}));const JT=Number(Ay(Gh));by("div").withConfig({displayName:"src__StyledPanel",componentId:"sc-12tinr5-0"})(Nm.font({size:19}),{boxSizing:"border-box",marginBottom:Fh[3],padding:Fh[6]-JT,border:`${Gh} solid transparent`,textAlign:"center",[rm.TABLET]:{padding:Fh[7]-JT},color:oh,background:"#00703c"},Sm.withWhiteSpace()),by("h1").withConfig({displayName:"src__StyledTitle",componentId:"sc-12tinr5-1"})({marginTop:0,marginBottom:Fh[6],":last-child":{marginBottom:0}},Nm.font({size:48,weight:"bold"})),by("div").withConfig({displayName:"src__StyledBody",componentId:"sc-12tinr5-2"})(Nm.font({size:36}));const ZT={SOLID:{background:dh,text:oh},GREY:{background:"#eeefef",text:"#383f43"},GREEN:{background:"#cce2d8",text:"#005a30"},TURQUOISE:{background:"#bfe3e0",text:"#10403c"},BLUE:{background:"#d2e2f1",text:"#144e81"},PURPLE:{background:"#dbd5e9",text:"#3d2375"},PINK:{background:"#f7d7e6",text:"#80224d"},RED:{background:"#f6d7d2",text:"#942514"},ORANGE:{background:"#fcd6c3",text:"#6e3619"},YELLOW:{background:"#fff7bf",text:"#594d00"}},eN=by("strong").withConfig({displayName:"src__Tag",componentId:"sc-10wvgvx-0"})(Nm.font({size:16,weight:"bold",lineHeight:1}),{display:"inline-block",paddingTop:"5px",paddingRight:"8px",paddingBottom:"4px",paddingLeft:"8px",outline:"2px solid transparent",outlineOffset:-2,letterSpacing:1,textDecoration:"none",textTransform:"uppercase"},(e=>{let{tint:t="SOLID"}=e;return{backgroundColor:ZT[t].background,color:ZT[t].text}}),(e=>{let{inactive:t=!1}=e;return t?{backgroundColor:ZT.GREY.background,color:ZT.GREY.text}:void 0}),(e=>{let{backgroundColor:t}=e;return t?{backgroundColor:t}:void 0}),(e=>{let{color:t}=e;return t?{color:t}:void 0}));function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{inline:t}=e;return t&&{[rm.LARGESCREEN]:{float:"left",clear:"none",marginRight:Fh[4]}}}),(e=>{let{sizeVariant:t}=e;return"SMALL"===t&&{span:{padding:"12px 15px 13px 0",fontSize:um,[rm.LARGESCREEN]:{fontSize:cm,padding:"10px 15px 10px 1px"},":after":{top:15,left:7,borderWidth:5},":before":{top:8,width:24,height:24}}}}),Sm.withWhiteSpace({marginBottom:2})),iN=by("input").withConfig({displayName:"src__Input",componentId:"sc-9fy7us-1"})({position:"absolute",zIndex:1,top:0,left:0,width:nN,height:nN,cursor:"pointer",opacity:0,":checked + span::after":{opacity:1},":focus + span::before":{outline:`${Oh} solid transparent`,outlineOffset:Oh,boxShadow:`0 0 0 4px ${Xp}`}},(e=>{let{disabled:t}=e;return{cursor:t?"auto":"pointer"," + span":{opacity:t?".5":"1",pointerEvents:t?"none":"auto"}}})),aN=by("span").withConfig({displayName:"src__LabelText",componentId:"sc-9fy7us-2"})({display:"inline-block",marginBottom:0,padding:`8px ${rN}px ${Fh[1]}px`,cursor:"pointer",MsTouchAction:"manipulation",touchAction:"manipulation",":before":{content:"''",boxSizing:"border-box",position:"absolute",top:0,left:0,width:nN,height:nN,border:`${Wh} solid black`,borderRadius:"50%",background:"transparent"},":after":{content:"''",position:"absolute",top:Fh[2],left:Fh[2],width:0,height:0,border:`${Fh[2]}px solid`,borderRadius:"50%",background:"currentColor",opacity:0}}),sN=by(bb).withConfig({displayName:"src__StyledRadioHint",componentId:"sc-9fy7us-3"})({display:"block",paddingLeft:rN,paddingRight:rN});$.forwardRef(((e,t)=>{let{inline:n=!1,children:r,className:o,hint:i,sizeVariant:a="MEDIUM",...s}=e;return $.createElement(oN,{inline:n,className:o,sizeVariant:a},$.createElement(iN,tN({type:"radio",ref:t},s)),$.createElement(aN,null,r),i&&$.createElement(sN,null,i))})).displayName="Radio";function lN(){return lN=Object.assign?Object.assign.bind():function(e){for(var t=1;t h3":{marginBottom:Xh},"> ul":{marginBottom:Zh,"> li":{marginBottom:`calc(${Xh} + 2px)`}}},Sm.withWhiteSpace({marginBottom:0})).displayName="RelatedItems";const uN=by.input.attrs((e=>{let{type:t="search"}=e;return{type:t}})).withConfig({displayName:"src__Input",componentId:"sc-bgtefr-0"})({width:"100%",height:"40px",padding:"6px",margin:0,border:`solid 1px ${ah}`,borderRight:0,boxSizing:"border-box",fontFamily:om,fontWeight:400,textTransform:"none",fontSize:"16px",lineHeight:"1.75",background:oh,borderRadius:0,WebkitAppearance:"none",":focus":{marginRight:"3px",outline:`3px solid ${uh}`,outlineOffset:0," ~ button":{width:"46px"}}}),cN=by("button").withConfig({displayName:"src__SearchButton",componentId:"sc-bgtefr-1"})({backgroundColor:lh,border:0,display:"block",color:oh,position:"relative",padding:"10px",width:"45px",height:"40px",backgroundRepeat:"no-repeat",backgroundPosition:"2px 50%",textIndent:"-999em",overflow:"hidden",":focus":{outline:`3px solid ${uh}`,outlineOffset:0}}),dN=by("div").withConfig({displayName:"src__StyledSearchBox",componentId:"sc-bgtefr-2"})({boxSizing:"border-box",display:"flex",width:"100%",background:oh},Sm.withWhiteSpace({marginBottom:0})),fN=$.forwardRef(((e,t)=>$.createElement(dN,lN({},e,{ref:t}))));fN.Input=uN,fN.Button=e=>$.createElement(cN,lN({title:"Search"},e),$.createElement(BT,{fill:oh})),fN.displayName="SearchBox",fN.Input.displayName="SearchBox.Input",fN.Button.displayName="SearchBox.Button";const pN={XL:8,XLARGE:8,L:6,LARGE:6,M:4,MEDIUM:4};function hN(){return hN=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{level:t}=e;const n=pN[t];return n?Sm.withWhiteSpace({margin:{size:n,direction:["top","bottom"]}}):Sm.withWhiteSpace()}),(e=>{let{visible:t}=e;return t?{borderBottom:`1px solid ${Qp}`}:void 0})).displayName="SectionBreak";const mN=by("select").withConfig({displayName:"src__StyledSelect",componentId:"sc-sgud4a-0"})(Nm.font({size:19}),{boxSizing:"border-box",width:"100%",height:"33px",padding:"5px 4px 4px",border:`2px solid ${sh}`,[rm.LARGESCREEN]:{width:"50%",height:"38px"},":focus":{outline:`3px solid ${uh}`,outlineOffset:0}},(e=>{let{error:t}=e;return{border:t?`4px solid ${qp}`:void 0}})),gN=e=>{let{children:t,hint:n,label:r,meta:o={},input:i={},...a}=e;return $.createElement(Ab,hN({},a,{error:o.touched&&!!o.error}),$.createElement(Nb,null,r),n&&$.createElement(bb,null,n),o.touched&&o.error&&$.createElement(Ob,null,o.error),$.createElement(mN,hN({error:o.touched&&!!o.error},i),t))};gN.displayName="Select",mN.displayName="SelectInput",by("thead").withConfig({displayName:"TableHeader",componentId:"sc-1n1nw4b-0"})({}),by("tbody").withConfig({displayName:"TableBody",componentId:"sc-1qqarm8-0"})({}),by("caption").withConfig({displayName:"Caption",componentId:"sc-pvwfz5-0"})({fontWeight:Number($h.bold),display:"table-caption",textAlign:"left"}),by("td").withConfig({displayName:"Cell",componentId:"sc-msv0l6-0"})((e=>{let{numeric:t,alignRight:n=t,bold:r}=e;return{padding:`${Fh[2]}px ${Fh[4]}px ${Fh[2]}px 0`,borderBottom:`1px solid ${Qp}`,textAlign:n?"right":"left",fontWeight:r?Number($h.bold):void 0,":last-child":{paddingRight:0}}}),(e=>{let{numeric:t,isHeader:n}=e;return t&&!n?Nm.font({tabular:!0}):void 0}),Sm.withWidth()),by("tr").withConfig({displayName:"Row",componentId:"sc-1y8eqfp-0"})({}),by("table").withConfig({displayName:"src__StyledTable",componentId:"sc-16s660v-0"})(Nm.font({size:19}),Nm.textColour,{width:"100%",borderSpacing:0,borderCollapse:"collapse"},Sm.withWhiteSpace({marginBottom:6})),by("ul").withConfig({displayName:"list__TabList",componentId:"sc-srtuwr-0"})({margin:0},Sm.responsive({size:6,property:"margin",direction:"bottom"}),{padding:0,listStyle:"none",[rm.TABLET]:{borderBottom:`1px solid ${Qp}`,marginBottom:0,"::after":{content:"''",display:"block",clear:"both"}}}),by("section").withConfig({displayName:"panel__TabPanel",componentId:"sc-1c8lkp4-0"})(Sm.responsiveMargin({size:8,direction:"bottom"}),{[rm.TABLET]:{marginBottom:Sm.simple(0),paddingTop:Sm.simple(6),paddingRight:Sm.simple(4),paddingBottom:Sm.simple(6),paddingLeft:Sm.simple(4),border:`1px solid ${Qp}`,borderTop:0,"& > :last-child":{marginBottom:0}}},(e=>{let{selected:t}=e;return{display:"block",[rm.TABLET]:{display:!t&&"none"}}}));const vN=Sm.simple(1),yN=Sm.simple(2),bN=Sm.simple(3),wN=Sm.simple(4),EN=Sm.simple(5);by("li").withConfig({displayName:"tab__StyledListItem",componentId:"sc-1e33m29-0"})({marginLeft:EN,":before":{content:"'\\2014 '",marginLeft:-EN,paddingRight:vN},[rm.TABLET]:{marginLeft:0,":before":{content:"none"}}}),by("a").withConfig({displayName:"tab__StyledHyperLink",componentId:"sc-1e33m29-1"})(Nm.font({size:19}),Lm.common(),Lm.styleDefault,{display:"inline-block",paddingTop:yN,paddingBottom:yN},(e=>{let{selected:t}=e;return{color:t&&sh,textDecoration:t?"none":void 0,[rm.TABLET]:{marginRight:vN,float:"left",textAlign:"center",textDecoration:"none",color:sh,":link,:visited":{color:sh},marginTop:t?-vN:void 0,marginBottom:t?-1:void 0,paddingTop:t?bN-1:void 0,paddingRight:t?wN-1:wN,paddingBottom:t?bN+1:void 0,paddingLeft:t?wN-1:wN,border:t&&`1px solid ${Qp}`,borderBottom:t?0:1,backgroundColor:t?oh:ih,":focus":{backgroundColor:t?"transparent":ih}}}})),by("h2").withConfig({displayName:"title__StyledTabsTitle",componentId:"sc-5azs4d-0"})(Nm.font({size:19}),{marginBottom:Sm.simple(1),[rm.TABLET]:{display:"none"}}),by("div").withConfig({displayName:"src__TabsContainer",componentId:"sc-k251l1-0"})(Nm.font({size:19}),Nm.textColour,Sm.responsiveMargin({size:1,direction:"top"}),Sm.responsiveMargin({size:6,direction:"bottom"}),Sm.withWhiteSpace()),by("textarea").withConfig({displayName:"src__TextAreaField",componentId:"sc-z0ua7p-0"})({boxSizing:"border-box",fontFamily:om,fontWeight:400,textTransform:"none",fontSize:um,lineHeight:hm,[rm.LARGESCREEN]:{fontSize:cm,lineHeight:mm,width:"75%"},width:"100%",padding:"5px 4px 4px",border:`2px solid ${sh}`,":focus":{outline:`3px solid ${uh}`,outlineOffset:0}},(e=>{let{error:t}=e;return{border:t?`4px solid ${qp}`:void 0}})),by("div").withConfig({displayName:"src__StyledWarningText",componentId:"sc-14ghfbq-0"})({alignItems:"center",boxSizing:"border-box",display:"flex",width:"100%"},Sm.withWhiteSpace({marginBottom:0})),by("div").withConfig({displayName:"src__IconImportantWrapper",componentId:"sc-14ghfbq-1"})({flex:"none",height:35,marginRight:Fh[3],width:35}),by("strong").withConfig({displayName:"src__WarningTextWrapper",componentId:"sc-14ghfbq-2"})(Nm.font({size:19,weight:"bold"}));const SN=({setName:e,name:t,subject:n,setSubject:r,situation:o,setSituation:i,setStage:a,useValidation:s,setMenuOpen:l,handleStartChat:u,headerEndChatButtonRef:c,setSR_errorMessages:d,setSR_chatWindowEvents:f,setPreviousStage:p,channelIdTarget:h})=>{const m=$.useRef(null),[g,v]=$.useState({name:{touched:!1},subject:{touched:!1},situation:{touched:!1}}),[y,b]=$.useState([]);$.useEffect((()=>{document.querySelectorAll('[class*="ErrorText"]').forEach((e=>{e.style.fontSize="19px"}))}),[y]);const w=()=>{try{const e=(e=>({skillId:123456,available:e,status_age:3}))(!0);return!!(null==e?void 0:e.available)||(a("BUSY"),!1)}catch(e){console.error("Error processing availability",e)}};$.useEffect((()=>{p("NEW"),w()}),[]);const E=(e,t)=>{t(e.target.value)};$.useEffect((()=>{const e=[];for(let t in g)if(g[t].error){const n={targetName:`${t}-input`,text:g[t].error};e.push(n)}e.forEach((e=>{"name-input"==e.targetName?e["aria-name"]="name":"subject-input"==e.targetName?e["aria-name"]="subject":"situation-input"==e.targetName&&(e["aria-name"]="situation")})),b(e)}),[g]),$.useEffect((()=>{document.querySelectorAll("[class^='src__LabelText']").forEach((e=>{e.classList.add("!font-bold")}))}),[]);$.useEffect((()=>{y.length>0&&m.current&&m.current.focus()}),[y]);return J.jsxs("div",{className:"prechat-container px-2 !text-19px max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsxs("div",{children:[J.jsx("h1",{tabIndex:0,className:"govuk-heading-l pt-4 mb-4 h1-fix",children:"Tell us about yourself"}),y.length?J.jsx("div",{className:"prechat-row py-4 ",children:J.jsx("div",{className:"border-5 border-gds-error-red py-4 px-4",children:J.jsxs("div",{role:"alert",children:[J.jsx("h2",{tabIndex:0,ref:m,className:"govuk-error-summary__title text-19px",children:"There is a problem"}),J.jsx("div",{className:"govuk-error-summary__body",children:J.jsx("ul",{className:"govuk-list govuk-error-summary__list",children:J.jsx("ul",{children:y.map(((e,t)=>J.jsx("li",{className:"pb-2",children:J.jsx("a",{href:"#",className:"text-19px",onClick:t=>{switch(e.targetName){case"name-input":const e=document.getElementById("name-input");e&&e.focus();break;case"subject-input":const t=document.getElementById("subject-input");t&&t.focus();break;case"situation-input":const n=document.getElementById("situation-input");n&&n.focus()}},children:e.text})},t)))})})})]})})}):null,J.jsx("div",{className:"py-4",style:{fontSize:"19px"},children:J.jsx(AT,{"aria-label":"name-input",style:Yd,htmlFor:"name-input",input:{style:Qd,className:"text-input-git",id:"name-input",name:"name",value:t,onChange:t=>e(t.target.value),"aria-invalid":y.some((e=>"name-input"===e.targetName))?"true":"false"},meta:g.name,children:J.jsx("span",{style:{fontSize:"19px"},children:"Name"})})}),J.jsxs("div",{className:"py-4",children:[J.jsx(Nb,{style:Yd,as:"label",htmlFor:"subject-input",children:J.jsx("span",{style:Yd,children:"What do you need help with?"})}),J.jsxs(gN,{className:"!text-19px",input:{id:"subject-input",style:Kd,className:"govuk-select-fix select-git",name:"subject-select",onChange:e=>E(e,r),value:n,"aria-invalid":y.some((e=>"subject-input"===e.targetName))?"true":"false"},meta:g.subject,children:[J.jsx("option",{value:"",children:"Choose an option"}),J.jsx("option",{value:"Routes into teaching",children:"Routes into teaching"}),J.jsx("option",{value:"Entry requirements for teacher training",children:"Entry requirements for teacher training"}),J.jsx("option",{value:"Support available to get into teaching",children:"Support available to get into teaching"}),J.jsx("option",{value:"Applying for teacher training",children:"Applying for teacher training"}),J.jsx("option",{value:"Funding teacher training",children:"Funding teacher training"}),J.jsx("option",{value:"Getting classroom experience",children:"Getting classroom experience"}),J.jsx("option",{value:"Training to teach in England as non-UK citizen",children:"Training to teach in England as non-UK citizen"}),J.jsx("option",{value:"Teaching in England as a qualified teacher from outside the UK",children:"Teaching in England as a qualified teacher from outside the UK"}),J.jsx("option",{value:"Returning to teaching",children:"Returning to teaching"}),J.jsx("option",{value:"Other",children:"Other"})]})]}),J.jsxs("div",{className:"py-4",children:[J.jsx(Nb,{style:Yd,as:"label",htmlFor:"situation-input",children:J.jsx("span",{style:Yd,children:"What best describes your current situation?"})}),J.jsxs(gN,{style:Yd,htmlFor:"situation-input",input:{style:Kd,id:"situation-input",className:"govuk-select-fix select-git",name:"situation-select",onChange:e=>E(e,i),value:o,"aria-invalid":y.some((e=>"situation-input"===e.targetName))?"true":"false"},meta:g.situation,children:[J.jsx("option",{value:"",children:"Choose an option"}),J.jsx("option",{value:"I am a UK citizen living in the UK",children:"I am a UK citizen living in the UK"}),J.jsx("option",{value:"I am a UK citizen living outside of the UK",children:"I am a UK citizen living outside of the UK"}),J.jsx("option",{value:"I am a non-UK citizen living in the UK",children:"I am a non-UK citizen living in the UK"}),J.jsx("option",{value:"I am a non-UK citizen living outside of the UK",children:"I am a non-UK citizen living outside of the UK"})]})]})]}),J.jsx("div",{className:"prechat-row py-4",children:J.jsxs("p",{tabIndex:0,className:"text-19px",children:["Your details are protected under the terms of our"," ",J.jsx("a",{tabIndex:0,"aria-label":"privacy notice opens in a new tab",href:"https://getintoteaching.education.gov.uk/privacy-policy",className:`text-git-link-default underline visited:text-git-link-visited active:text-git-link-active ${Wd} focus:text-git-link-focus active:text-git-link-active underline focus:decoration-4 focus:text-white focus:bg-black focus:decoration-pink-500 ${Vd}`,target:"_blank",rel:"noopener noreferrer",children:"privacy notice (opens in a new tab)"}),". This explains how we use your personal data."]})}),J.jsx("div",{className:"prechat-row py-4",children:J.jsx(yb,{tabIndex:0,id:"continue-button","aria-label":"start-chat",type:"button",onClick:async()=>{if(!(await(async e=>{let t="",n=!1;t="prod"==e?"https://d3ercbmn7thtar.cloudfront.net/PROD/availability/23062371":"https://d3ercbmn7thtar.cloudfront.net/UAT/availability/23062370";try{n=!!(await Up.get(t)).data.available}catch(r){console.error("couldn't get open hours",r)}finally{return n}})(h)))return console.error("chat operations are unavailable"),a("UNAVAILABLE"),void localStorage.clear();if(s){const e=(()=>{let e={name:"",subject:"",situation:""};return n||(e.subject="Tell us what you need help with"),o||(e.situation="Tell us what best describes your current situation"),t&&t.trim()?t.length>30&&(e.name="First name must be 30 characters or less"):e.name="Enter your name",e})();let r={...g};for(let t in g)e.hasOwnProperty(t)?r[t]={error:e[t],touched:!0}:r[t]={};v(r);if(Object.keys(e).filter((t=>""!==e[t])).length>0)return console.error("errors present on the form"),void m.current.focus()}const e={name:t,candidate_enquiry:n,candidate_situation:o};l(!1);if(!w())return;a("OPEN"),localStorage.setItem("firstLoad","false"),localStorage.setItem("chatStatus","OPEN");const r=`I need help with ${n.charAt(0).toLowerCase()+n.slice(1)}.\n${o}.`;await u(r,e);try{c.current.focus()}catch(i){console.error(i)}},className:"govuk-!-static-margin-top-3 button-git",style:{width:"100%",fontSize:"19px"},children:"Start chat"})})]})},xN=()=>J.jsxs("div",{className:"typing-indicator",children:[J.jsx("div",{}),J.jsx("div",{}),J.jsx("div",{})]}),_N=({type:e,queuePosition:t,name:n})=>{switch(e){case"queuePosition":return J.jsx(J.Fragment,{children:J.jsxs("div",{className:"govuk-grid-column-full govuk-!-static-padding-0",children:[J.jsx("div",{className:"force-pl-0 pl-0 pr-2 pt-2 pb-2 w-full message-header",children:J.jsx("p",{tabIndex:0,className:`govuk-body-s govuk-!-static-padding-bottom-0 govuk-!-static-margin-bottom-0 text-16px ${qd}`,children:"Get Into Teaching"})}),J.jsx("p",{tabIndex:0,className:`p-2 border border-black rounded-lg w-full bg-gray-min-contrast text-white box-border break-words whitespace-pre-wrap ${qd} rounded-lg text-19px`,children:"Thanks. We can now connect you to a member of our support team. Our support team are real people, so it might take a minute or two for them to reply to messages."})]})});case"loadingMessage":return J.jsx(J.Fragment,{children:J.jsxs("div",{className:"govuk-grid-column-full govuk-!-static-padding-0",children:[J.jsx("div",{className:"force-pl-0 pl-0 pr-2 pt-2 pb-2 w-full message-header",children:J.jsx("p",{tabIndex:0,className:"govuk-body-s govuk-!-static-padding-bottom-0 govuk-!-static-margin-bottom-0 text-16px",children:"Get Into Teaching"})}),J.jsx("div",{className:"p-2 border border-black rounded-lg w-full bg-gray-min-contrast text-white box-border break-words whitespace-pre-wrap",children:"Messages loading..."})]})});case"agentJoined":return J.jsx("div",{className:"line-through",children:J.jsxs("p",{className:"agent-joined",children:["Agent ",n," joined the conversation"]})},n);default:return null}},CN=({messages:e,chatWindowRef:t,agentTyping:n,queuePosition:r,agentResolvedCase:o,agentEscalatedCase:i,setSR_messages:a,setSR_newAgentAssigned:s,stage:l,handleSaveTranscript:u,messageCount:c,setMessageCount:d,surveyInProgress:f,setSurveyInProgress:p,surveyFinished:h,setSurveyFinished:m,surveyLookupValues:g,setSurveyLookupValues:v,enteredSurvey:y,setEnteredSurvey:b,surveyInputResponse:w,setSurveyInputResponse:E,surveyHeader:S,setSurveyHeader:x,surveyMessageTextArray:_,setSurveyMessageTextArray:C,surveyMessageText:k,setSurveyMessageText:T,surveyMessageType:N,setSurveyMessageType:O,surveyLookups:I,setSurveyLookups:A,surveyAccessToken:R,setSurveyAccessToken:P,surveyTenantId:L,setSurveyTenantId:D,surveyHostname:F,setSurveyHostname:j,surveyId:M,isMock:z,setIsMock:U,surveyFinalMock:B,setSurveyFinalMock:H,mockSurveyFinished:G,setMockSurveyFinished:W,menuButtonTouched:V,onAndroidChrome:q,oniOSSafari:Q,oniOSChrome:K,messageInputHeight:Y,headerHeight:X,setAgentName:Z})=>{const[ee,te]=$.useState(!1),[ne,re]=$.useState([]),[oe,ie]=$.useState(""),[ae,se]=$.useState(""),[le,ue]=$.useState(""),[ce,de]=$.useState("");$.useState(!1);const fe=e=>{const t=(new Date).getTimezoneOffset(),n=Math.floor(t/60),r=new Date(e);r.setHours(r.getHours()-n);let o=r.getUTCHours();const i=r.getUTCMinutes(),a=o>=12?"pm":"am";o%=12;return"0"==`${o}`&&(o="12"),`${o}:${i<10?"0"+i:i}${a}`};$.useEffect((()=>{window.scrollTo(0,0)}),[]);$.useEffect((()=>{const t=[];let n="";const r=(e=>{var t;for(const n of e)if(null==(t=null==n?void 0:n.authorUser)?void 0:t.firstName)return n.authorUser.firstName;return""})(e);e.forEach((e=>{var o,i,a,s,l,u;const c=!!(null==(o=null==e?void 0:e.authorUser)?void 0:o.firstName),d=(null==e?void 0:e.authorUser)?c?"agent":"unknown":"user",f={content:(null==(i=null==e?void 0:e.messageContent)?void 0:i.text)||"",type:d,id:e.id,agentName:Xd(null==(a=null==e?void 0:e.authorUser)?void 0:a.firstName,r)||"",userFirstName:(null==(s=null==e?void 0:e.authorEndUserIdentity)?void 0:s.firstName)||"",userLastName:(null==(l=null==e?void 0:e.authorEndUserIdentity)?void 0:l.lastName)||"",timestamp:null==e?void 0:e.createdAt,seen:(null==e?void 0:e.seenAt)||"",read:(null==e?void 0:e.readAt)||"",attachments:(null==e?void 0:e.attachments)||[],url:(null==(u=null==e?void 0:e.attachments[0])?void 0:u.securedPermanentUrl)||""};f.agentName&&f.agentName!==ce&&(n=f.agentName),t.push(f)})),n&&"CLOSED"!==l&&!V&&(Z(n),de(n),"Get Into Teaching"!==n&&s(`Agent ${n} joined the chat`),a("Thanks. We can now connect you to a member of our support team. Our support team are real people, so it might take a minute or two for them to reply to messages."));const o=(e=>{const t=[],n=new Set;for(const r of e)n.has(r.id)||(t.push(r),n.add(r.id));return t})(t);re(o)}),[e,ce,a,s]),$.useEffect((()=>{const e=ne.filter((e=>"user"===e.type)),t=ne.filter((e=>"agent"===e.type)),n=e[e.length-1];ue(`${null==n?void 0:n.userFirstName} ${null==n?void 0:n.userLastName}`);const r=t[t.length-1];"CLOSED"!==l&&(null==r?void 0:r.content)&&((null==r?void 0:r.content)===oe&&(null==r?void 0:r.timestamp)===ae||(ie(null==r?void 0:r.content),se(null==r?void 0:r.timestamp),a(null==r?void 0:r.content)))}),[ne]),$.useLayoutEffect((()=>{e.length>0&&te(!0)}),[e]);const pe=()=>{const e=window.innerHeight-(Y+X+0);document.getElementById("message-container").style.height=`${e}px`};return $.useEffect((()=>{pe(),window.addEventListener("resize",pe),window.addEventListener("orientationchange",pe),pe()}),[]),J.jsxs("div",{ref:t,id:"message-container",className:"flex-auto overflow-y-auto max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[ne.map(((e,t)=>{var n;const r="user"===e.type?`(You) ${e.userFirstName} ${e.userLastName}`:`(Get Into Teaching) ${e.agentName}`,o="user"===e.type&&t===ne.reduce(((e,t,n)=>"user"===t.type?n:e),-1);return J.jsxs(J.Fragment,{children:[" ",J.jsxs("div",{className:"p-2 w-full",children:[J.jsxs("div",{className:"flex flex-row justify-between",children:[J.jsx("p",{tabIndex:0,className:`text-black text-opacity-80 ${qd} text-16px`,children:r}),J.jsx("span",{className:"text-black text-opacity-80",children:fe(e.timestamp)})]}),J.jsxs("p",{tabIndex:0,className:`message-content rounded-lg text-19px p-2 rounded-lg w-full ${qd} box-border break-words whitespace-pre-wrap ${"user"===e.type?"bg-black text-white":"bg-git-light-blue bg-opacity-20"}`,children:[e.content,(null==(n=null==e?void 0:e.attachments)?void 0:n.length)?J.jsx("span",{className:"message-attachment",children:null==e?void 0:e.attachments.map((e=>J.jsxs("span",{children:[e.fileName," uploaded"]},e.fileName)))}):null]}),o&&(null==e?void 0:e.seen)?J.jsx("div",{className:"flex flex-row w-full justify-end-override-important",children:J.jsx("span",{children:"Seen"})}):null]},e.id),0===t&&ne.length?J.jsxs("div",{className:"p-2 w-full",children:[J.jsxs("div",{className:"flex flex-row justify-between",children:[J.jsx("p",{tabIndex:0,className:`text-black text-opacity-80 ${qd} text-16px`,children:"Get Into Teaching"}),J.jsx("span",{className:"text-black text-opacity-80",children:fe(ne[0].timestamp)})]}),J.jsx("p",{tabIndex:0,className:`message-content rounded-lg text-19px p-2 rounded-lg w-full ${qd} box-border break-words whitespace-pre-wrap bg-gray-min-contrast box-border border border-black text-white`,children:"Thanks. We can now connect you to a member of our support team. Our support team are real people, so it might take a minute or two for them to reply to messages."})]},"queueMessage"):null]})})),ee?null:J.jsx("div",{className:"p-2",children:J.jsx(_N,{queuePosition:r,type:"loadingMessage"})}),n&&J.jsxs("div",{className:"typing-indicator-container",children:[J.jsx("p",{className:"typing-indicator-text",children:"Agent is typing"}),J.jsx(xN,{})]})]})},kN=({thread:e})=>{const t=$.useRef(null);return J.jsxs("div",{className:"pr-2 pl-1",children:[J.jsx("input",{type:"file",multiple:!0,onChange:async n=>{const r=n.target.files;if(r.length>0)try{await e.sendAttachments(r);t.current.value=""}catch(o){console.error("couldn't upload file",o)}else console.error("No files to send")},ref:t,style:{display:"none"}}),J.jsx("a",{href:"#",className:`mt-12 text-git-link-default visited:text-git-link-visited hover:text-git-link-hover active:text-git-link-active underline hover:decoration-4 whitespace-nowrap ${Wd} ${Vd}`,id:"upload-button",tabIndex:0,onClick:e=>{e.preventDefault(),t.current.click()},children:"Upload a file"})]})},TN=({messageText:e,setMessageText:t,handleSendMessage:n,handleSendTypingIndicator:r,thread:o,handleHeightChangeMessageInput:i})=>{const a=$.useRef(null),s=$.useRef(null),[l,u]=$.useState(0);$.useState(0);const c=r=>{r.preventDefault(),n(e),t("")},d=()=>{if(a.current){const e=a.current.offsetHeight;u(e)}};return $.useEffect((()=>{d()}),[i]),$.useEffect((()=>{window.addEventListener("resize",d),window.addEventListener("orientationchange",d)}),[]),$.useEffect((()=>{l&&i(l)}),[l]),J.jsx("div",{ref:a,className:"flex-none pb-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:J.jsxs("div",{className:"message-input-container flex flex-col",children:[J.jsx("textarea",{tabIndex:0,value:e,id:"send-message-input","aria-label":"send-message-input",onChange:e=>t(e.target.value),onKeyUp:e=>{"Enter"!==e.key?r():c(e)},placeholder:"Type your message...",className:`message-input p-2 ${qd}`}),J.jsxs("div",{className:"flex flex-row w-full h-14",children:[J.jsx(kN,{thread:o}),J.jsx("div",{className:"pl-2 pr-1 w-full",children:J.jsx(yb,{ref:s,id:"send-message-button",tabIndex:0,type:"button",onClick:c,className:"mt-3 h-full !w-full !text-19px button-git green-button-fix",children:"Send message"})})]})]})})};var NN,ON;(ON=NN||(NN={})).button="button",ON.color="color",ON.file="file",ON.image="image",ON.reset="reset",ON.submit="submit",ON.checkbox="checkbox",ON.radio="radio";const IN=Symbol("Manage ClipboardSub");function AN(e){return!!(null==e?void 0:e[IN])}const RN=globalThis;var PN,LN,DN,FN,jN,MN,zN,UN,BN,HN;"function"==typeof RN.afterEach&&RN.afterEach((()=>{var e;AN((e=globalThis.window).navigator.clipboard)&&e.navigator.clipboard[IN].resetClipboardStub()})),"function"==typeof RN.afterAll&&RN.afterAll((()=>{var e;AN((e=globalThis.window).navigator.clipboard)&&e.navigator.clipboard[IN].detachClipboardStub()})),(LN=PN||(PN={})).text="text",LN.date="date",LN["datetime-local"]="datetime-local",LN.email="email",LN.month="month",LN.number="number",LN.password="password",LN.search="search",LN.tel="tel",LN.time="time",LN.url="url",LN.week="week",(FN=DN||(DN={})).email="email",FN.password="password",FN.search="search",FN.telephone="telephone",FN.text="text",FN.url="url",(MN=jN||(jN={}))["{"]="}",MN["["]="]",(UN=zN||(zN={}))[UN.Trigger=2]="Trigger",UN[UN.Call=1]="Call",(HN=BN||(BN={}))[HN.EachTrigger=4]="EachTrigger",HN[HN.EachApiCall=2]="EachApiCall",HN[HN.EachTarget=1]="EachTarget",HN[HN.Never=0]="Never";const $N=({handleSaveTranscript:e,chatStarted:t,showCloseWindow:n,showSaveTranscript:r,showStartAgain:o,userClosedCase:i,agentClosedCase:a})=>{$.useEffect((()=>{window.scrollTo(0,0),localStorage.clear()}),[]);const[s,l]=$.useState(!1),u=()=>{window.close(),l(!0),localStorage.clear()},c=t?"":"mt-4 pt-4";return J.jsxs("div",{className:`flex flex-col items-center text-19px ${c} `,children:["true"===localStorage.getItem("noChat")||!r||a?null:J.jsx("a",{href:"#",id:"endchat-save-transcript-button",className:`text-blue-500 underline text-19px ${Wd} ${Vd}`,onClick:()=>{e()},children:"Save transcript"}),n&&!s?J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:u,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Close window"}):n&&s?J.jsx(yb,{style:{width:"100%"},onClick:u,id:"close-chat-button",className:"button-git green-button-fix",children:"Unable to close the window, please close it manually."}):null,o?J.jsx("a",{href:"#",id:"endchat-start-again-button",className:`text-blue-500 underline text-19px ${Wd} ${Vd}`,onClick:()=>{localStorage.clear(),window.location.reload()},children:"Start again"}):null]})},GN=async(e,t,n,r,o,i,a,s,l,u,c,d,f)=>{i((e=>[...e,n]));const p=await(async(e,t,n,r,o,i,a)=>{try{const s={header:t,messageBody:{userInput:n,userInputType:"STRING"}},l={headers:{Authorization:`Bearer ${e}`,tenantId:r,"content-type":"application/json"}},u=await Up.post(`https://${o}/npxapi/conversation/v1.0/reply`,s,l);return"NO_INPUT_REQUIRED"==u.data.messageBody.message.messageType&&i(!0),a((e=>e+1)),u}catch(s){console.error("error in replyToSurvey: ",s)}})(e,t,n,r,o,s,a);VN(p,l,i,u,c,d,f),a((e=>e+1))},WN=async(e,t,n,r,o,i,a,s,l,u,c,d,f,p)=>{const h=e.trim();await GN(n,r,h,o,i,a,s,l,u,c,d,f,p),t("")},VN=(e,t,n,r,o,i,a)=>{const s=e.data;if(s.header&&t(s.header),s.messageBody.message.messageText&&(n((e=>[...e,s.messageBody.message.messageText])),r(s.messageBody.message.messageText)),s.messageBody.message.messageType&&o(s.messageBody.message.messageType),s.messageBody.message.messageSettings.lookups){i(s.messageBody.message.messageSettings.lookups);a(s.messageBody.message.messageSettings.lookups.map((e=>e.value)))}else i([])},qN=async(e,t,n)=>{const r={tenantId:e,token:t,hostname:n},o={headers:{"Content-Type":"application/json"}};try{const e=await(async(e,t,n)=>{try{return(await Up.post(`https://ye3ijnvr9l.execute-api.eu-west-2.amazonaws.com/Production${e}`,t,n)).data}catch(r){return console.error("API request error:",r),null}})("/get-access-token",r,o);return e}catch(i){console.error("error: ",i)}},QN=async(e,t,n,r,o,i,a,s,l,u,c,d,f,p)=>{let h=a||"none provided",m=s||"none provided",g=l||"none provided",v=c||"none provided",y=f||"none provided",b=p||"none provided";try{const i={survey_id:o,preferred_survey_medium:"SMS",phone:"none_provided",contact_id:"none_provided",first_name:h,last_name:m,agent_name:g,caseid:"none_provided",cxone_agent_id:v,interaction_id:"none_provided",enquiry:y,situation:b},a={headers:{Authorization:`Bearer ${e}`,tenantId:n,"content-type":"application/json"}},s=await Up.post(`https://${r}/npxapi/conversation/v1.0/initiate`,i,a);return t((e=>e+1)),s}catch(w){console.error("error: ",w),console.error(w.message)}},KN=e=>{let t=e;const n=[{value:"5",displayValue:"Very satisfied"},{value:"4",displayValue:"Satisfied"},{value:"3",displayValue:"Neither satisfied nor dissatisfied"},{value:"2",displayValue:"Dissatisfied"},{value:"1",displayValue:"Very dissatisfied"},{value:"",displayValue:"No answer given"}];try{return n.length>0&&n.forEach((n=>{n.value==e&&(t=n.displayValue)})),t}catch(r){return console.error("Error mapping messages to display value: ",r),e}},YN=({tenantId:e,hostname:t,surveyId:n,token:r,handleSaveTranscript:o,messageCount:i,setMessageCount:a,surveyInProgress:s,setSurveyInProgress:l,surveyFinished:u,setSurveyFinished:c,surveyLookupValues:d,setSurveyLookupValues:f,enteredSurvey:p,setEnteredSurvey:h,surveyInputResponse:m,setSurveyInputResponse:g,surveyHeader:v,setSurveyHeader:y,surveyMessageTextArray:b,setSurveyMessageTextArray:w,surveyMessageText:E,setSurveyMessageText:S,surveyMessageType:x,setSurveyMessageType:_,surveyLookups:C,setSurveyLookups:k,surveyAccessToken:T,setSurveyAccessToken:N,surveyTenantId:O,setSurveyTenantId:I,surveyHostname:A,setSurveyHostname:R,setSurveyRefused:P,name:L,subject:D,situation:F,enquiry:j,agentName:M,agentId:z,surveyLoading:U,setSurveyLoading:B,agentClosedCase:H,surveyResponseLoading:G,setSurveyResponseLoading:W,setStage:V,fbmAgentFirstName:q,fbmAgentLastName:Q,fbmAgentId:K,setSR_surveyMessages:Y})=>{const[X]=$.useState(5e3),[Z,ee]=$.useState(""),[te,ne]=$.useState(!0),re=$.useRef(null),[oe,ie]=$.useState(!1),ae=()=>{window.close(),ie(!0),localStorage.clear()};$.useEffect((()=>{"END"===x&&c(!0)}),[x]),$.useEffect((()=>{localStorage.clear()}),[]);const se=e=>{N(e)};$.useEffect((()=>{const e=setTimeout((()=>{(G||U)&&V("SURVEY_TIMEOUT")}),X);return()=>{clearTimeout(e)}}),[G,U]);const le=L.split(" "),ue=le[0]||"",ce=le.slice(1).join(" "),de=async o=>{ne(!1),B(!0),W(!0);try{o&&(await(async(e,t,n,r,o,i,a,s,l,u,c,d,f,p,h,m,g,v,y,b,w,E,S)=>{p(!0);const x=await qN(e,t,n);x.accessToken&&h(x.accessToken);const _=a||"no_surname_provided",C=await QN(x.accessToken,g,e,n,r,o,i,_,s,l,u,c,d,f);VN(C,v,y,b,w,E,S),m("")})(e,r,t,n,"NO_CONTACT_ID",ue,ce,`${q} ${Q}`,"NO_CASE_ID",K,"NO_INTERACTION_ID",j,F,l,se,g,a,y,w,S,_,k,f),h(!0))}catch(i){console.error(i)}finally{B(!1),W(!1)}},fe=$.useRef(null);$.useEffect((()=>{fe.current&&fe.current.focus()}),[]);return $.useEffect((()=>{a((e=>e+1))}),[b]),J.jsx("div",{ref:re,className:"mb-2",children:J.jsxs("div",{className:"flex flex-col",children:[u?J.jsxs(J.Fragment,{children:[" ",J.jsx("p",{tabIndex:0,className:`bg-git-light-blue bg-opacity-20 p-2 mx-2 rounded-xl mt-6 text-19px ${qd}`,children:"Thank you for your feedback. If you'd like to chat with us again, we're open 8:30am to 5:30pm Monday to Friday."},999999999)]}):null,u&&oe?J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:ae,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Unable to close the window, please close it manually."}):u&&!oe?J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:ae,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Close window"}):null,J.jsx("div",{className:"mt-5",children:te?J.jsxs("div",{className:"max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[" ",J.jsx("p",{ref:fe,tabIndex:0,className:`bg-git-light-blue bg-opacity-20 p-2 mx-2 rounded-lg text-19px ${qd} `,children:H?"This chat has timed out. If you need to speak with us again, refresh the chat. If you no longer need to chat with us, would you be happy to answer 2 questions about your experience today?":"We hope you found our service helpful. Would you be happy to answer 2 questions about your experience today?"},999999999),J.jsxs("div",{className:"flex flex-row my-12",children:[J.jsx(yb,{style:{width:"100%",marginRight:"12px",marginLeft:"12px"},className:"px-16 button-git green-button-fix",onClick:()=>{de(!0),localStorage.clear()},children:"Yes"}),J.jsx(yb,{style:{width:"100%",marginRight:"12px",marginLeft:"12px"},className:"px-12 button-git green-button-fix",onClick:()=>{de(!1),P(!0)},children:"No"})]})]}):null}),Z?J.jsx("p",{className:"mt-6 bg-black text-white p-2 rounded-lg",children:Z},Z):null]})})},XN=({surveyInProgress:e,setSurveyInProgress:t,surveyFinished:n,setSurveyFinished:r,surveyLookupValues:o,setSurveyLookupValues:i,enteredSurvey:a,setEnteredSurvey:s,surveyInputResponse:l,setSurveyInputResponse:u,surveyHeader:c,setSurveyHeader:d,surveyMessageTextArray:f,setSurveyMessageTextArray:p,surveyMessageText:h,setSurveyMessageText:m,surveyMessageType:g,setSurveyMessageType:v,surveyLookups:y,setSurveyLookups:b,setMessageCount:w,surveyAccessToken:E,setSurveyAccessToken:S,surveyTenantId:x,setSurveyTenantId:_,surveyHostname:C,setSurveyHostname:k,handleSaveTranscript:T,chatStarted:N,surveyLoading:O,setSurveyLoading:I,surveyResponseLoading:A,setSurveyResponseLoading:R,setSR_surveyMessages:P})=>{const[L,D]=$.useState(0),F=$.useRef(null),j=$.useRef(null);$.useRef(null);const M=[$.useRef(null),$.useRef(null),$.useRef(null),$.useRef(null),$.useRef(null)],z=e=>{""===e&&M[0].current.focus();try{M[5-e].current.focus()}catch(t){console.debug("couldnt focus radio button")}},[U,B]=$.useState(!1),[H,G]=$.useState(!1),W=$.useRef(null),[V,q]=$.useState([]),[Q,K]=$.useState({currentQuestion:{touched:!1}});$.useEffect((()=>{document.querySelectorAll('[class*="ErrorText"]').forEach((e=>{e.style.fontSize="19px"}))}),[V]),$.useEffect((()=>{const e=[];for(let t in Q)if(Q[t].error){const n={targetName:`${t}-input`,text:Q[t].error};e.push(n)}e.forEach((e=>{"name-input"==e.targetName&&(e["aria-name"]="name")})),q(e)}),[Q]);const Y=async()=>{if(A)return;const e=(()=>{let e={currentQuestion:""};return 2==L&&(e.currentQuestion=""),0!=L||l||(e.currentQuestion="Select an option for how satisfied you were with our service today, based on today's chat"),1!=L||l||(e.currentQuestion="Select an option for how satisfied you were with the communication and professionalism of the person you spoke to, based on today’s chat"),e})();let t={...Q};for(let r in Q)e.hasOwnProperty(r)?t[r]={error:e[r],touched:!0}:t[r]={};K(t);if(Object.keys(e).filter((t=>""!==e[t])).length>0)return console.error("Errors present on the form"),F.current.blur(),W.current.focus(),void R(!1);R(!0);try{await WN(l,u,E,c,x,C,p,w,r,d,m,v,b,i),D((e=>e+1))}catch(n){console.error("Onclick to load next survey question failed: ",n)}finally{R(!1)}F.current&&F.current.blur(),j.current&&j.current.focus()};$.useEffect((()=>{j.current&&j.current.focus()}),[L,h]);return A||O?J.jsx("p",{tabIndex:0,className:` p-2 mx-2 rounded-xl mt-6 text-19px ${qd}`,children:"Loading..."},999999999):J.jsx("div",{className:" pb-4 w-11/12 mx-2 self-center",children:e&&!n?J.jsxs(J.Fragment,{children:[J.jsx("div",{className:"survey-input-container flex flex-col items-start justify-start",children:a&&!O?(e=>{const t=[...y].reverse();return e.length>0&&y.length>0?"string"==typeof e[0]?J.jsxs(J.Fragment,{children:[V.length?J.jsx("div",{className:"prechat-row py-4 ",children:J.jsx("div",{className:"border-5 border-gds-error-red py-4 px-4",children:J.jsxs("div",{role:"alert",children:[J.jsx("h2",{tabIndex:0,ref:W,className:"govuk-error-summary__title text-19px",children:"There is a problem"}),J.jsx("div",{className:"govuk-error-summary__body",children:J.jsx("ul",{className:"govuk-list govuk-error-summary__list",children:J.jsx("ul",{children:V.map(((e,t)=>J.jsx("li",{className:"pb-2",tabIndex:0,children:J.jsx("a",{tabIndex:0,href:"#",className:"text-19px",onClick:e=>{0==l||"0"==l||l?z(l):(u(5),z(5))},children:e.text})},t)))})})})]})})}):null,J.jsx("div",{className:"govuk-form-group self-start "+(V.length?"govuk-form-group--error":""),children:J.jsxs("fieldset",{className:"govuk-fieldset",children:[J.jsx("legend",{className:"govuk-fieldset__legend govuk-fieldset__legend--l",children:J.jsx("h1",{ref:j,tabIndex:0,className:"govuk-fieldset__heading",style:{lineHeight:"1.2"},children:h})}),V.length?J.jsxs("p",{id:"whereDoYouLive-error",className:"govuk-error-message",tabIndex:0,children:[J.jsx("span",{className:"govuk-visually-hidden",children:"Error:"})," Select one of the options below"]}):null,J.jsx("div",{className:"govuk-radios flex flex-col","data-module":"govuk-radios",children:t.map(((e,t)=>J.jsxs("div",{className:"govuk-radios__item",children:[J.jsx("input",{className:"govuk-radios__input text-19px radio-git",id:`surveyOption${t}`,name:"surveyOption",ref:M[t],type:"radio",value:e.value,onChange:e=>u(e.target.value),checked:l===e.value,onFocus:()=>{0!=L||U||l?1!=L||H||l||G(!0):B(!0)}}),J.jsx("label",{className:"govuk-label govuk-radios__label text-19px",htmlFor:`surveyOption${t}`,children:KN(e.value)})]},t)))})]})})]}):void 0:J.jsxs("div",{className:"govuk-form-group",children:[J.jsx("h1",{className:"govuk-label-wrapper",children:J.jsx("label",{ref:j,className:"govuk-label govuk-label--l",tabIndex:0,children:h})}),J.jsx("div",{id:"more-detail-hint",className:"govuk-hint"}),J.jsx("textarea",{className:`message-input p-2 ${qd}`,id:"more-detail",name:"moreDetail",rows:"5","aria-describedby":"more-detail-hint",onChange:e=>u(e.target.value),onKeyUp:e=>{"Enter"!==e.key||WN(l,u,E,c,x,C,p,w,r,d,m,v,b,i)}})]})})(o):null}),J.jsx("div",{className:"mt-6",children:O||2===L?O||2!=L?null:J.jsx(yb,{disabled:O||A,ref:F,style:{width:"100%",fontSize:"19px"},className:"py-4 mt-2 button-git green-button-fix",onClick:Y,children:"Complete feedback"}):J.jsx(yb,{disabled:O||A,ref:F,style:{width:"100%",fontSize:"19px"},className:"py-4 mt-2 button-git green-button-fix",onClick:Y,children:"Submit response"})}),J.jsx("div",{className:"mt-4",children:J.jsx($N,{handleSaveTranscript:T,chatStarted:N,showCloseWindow:!1,showSaveTranscript:!1,showStartAgain:!1})})]}):null})},JN=({networkConnectionRestored:e})=>J.jsx(J.Fragment,{children:e?J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"Chat is offline"}),J.jsx("p",{children:"We have temporarily lost our connection to chat. Sorry for the inconvenience, please try again later."})]}):J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"Chat is back online."}),J.jsxs("p",{children:["Please"," ",J.jsx("button",{id:"websocket-refresh-button",onClick:()=>{window.location.reload()},className:"underline text-blue-600",children:"refresh"})," ","to continue talking to us."]})]})})}),ZN=({handleErrorEndChat:e})=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{className:"text-19px",children:"Something went wrong."}),J.jsxs("p",{className:"text-19px",children:["Please try refreshing the page, or"," ",J.jsx("button",{onClick:()=>{e(),localStorage.clear(),window.location.reload()},id:"error-page-start-again-button",className:"underline text-blue-600",children:"starting again"}),"."]})]})}),eO=()=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto ",children:[J.jsx("h1",{children:"Our service is busy at the moment."}),"Our open hours are X-Y."]})}),tO=()=>{const[e,t]=$.useState(!1),n=()=>{window.close(),t(!0),localStorage.clear()};return J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto ",children:[J.jsx("h1",{children:"The live chat service is now closed."}),J.jsx("h1",{className:"mb-4",children:"If you want to speak to us, we're open 8:30am to 5:30pm Monday to Friday."}),e?J.jsx(yb,{style:{width:"100%"},onClick:n,id:"close-chat-button",className:"button-git green-button-fix",children:"Unable to close the window, please close it manually."}):J.jsx(yb,{style:{width:"90%",marginTop:"1rem",fontSize:"19px"},onClick:n,id:"close-chat-button",className:"button-git green-button-fix mt-4 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:"Close window"})]})})},nO=()=>J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"This form has timed out."}),J.jsx("p",{children:"To speak to us, refresh this form and enter your details."})]})}),rO=({email:e,setEmail:t,stage:n,setStage:r,handleEndChat:o,handleSaveTranscript:i,previousStage:a,setSR_Messages:s,setSR_chatWindowEvents:l,chatStarted:u,setAgentClosedCase:c})=>J.jsx("div",{className:"px-2 !text-19px max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:J.jsxs("div",{className:"flex flex-col",children:[u?J.jsx(J.Fragment,{children:J.jsx("p",{className:"text-19px font-bold my-6 ",children:"Would you like to download a copy of this chat before you go?"})}):null,J.jsx("button",{className:"flex justify-center !text-19px items-center h-full px-4 py-2 whitespace-nowrap text-black text-center bg-git-light-grey border-b-2 border-gray-500 hover:bg-gray-300 focus:outline-none focus:ring-4 focus:ring-yellow-300 button-git gray-button-fix focus:text-white",onClick:i,style:{paddingTop:"9px",paddingBottom:"9px"},children:J.jsx("span",{style:{lineHeight:"19px"},children:"Download chat"})}),u?J.jsx(J.Fragment,{children:J.jsx("div",{style:{marginTop:"24px"},children:J.jsx(yb,{className:"button-git green-button-fix",onClick:async()=>{c(!1);"CLOSED"!==localStorage.getItem("chatStatus")&&u&&(r("CLOSED"),await o()),l("Chat has successfully closed"),localStorage.clear()},style:{width:"100%",fontSize:"19px"},"aria-label":"confirm end chat","aria-live":"polite",children:"Confirm end chat"})})}):null,J.jsx("a",{href:"#",onClick:e=>{e.preventDefault(),r(a)},className:`mt-12 text-git-link-default visited:text-git-link-visited active:text-git-link-active underline w-fit ${Wd} ${Vd}`,"aria-label":"cancel and return to chat",id:"cancel-and-return-button",children:"Cancel and return to chat"})]})}),oO=({setHeaderEndChatButtonVisible:e})=>(useEffect((()=>{console.debug("setting header button to not visible"),e(!1),localStorage.clear()}),[]),e(!1),J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto",children:[J.jsx("h1",{children:"Sorry, there is a problem with the service."}),J.jsx("p",{children:"Refresh the page to go back to the chat."})]})})),iO=({messageCategory:e,message:t,setMessage:n,ariaLive:r})=>{const o=$.useRef(null);return $.useEffect((()=>{if(t&&o.current){o.current.textContent=t;const e=setTimeout((()=>{o.current.textContent="",n("")}),500);return()=>clearTimeout(e)}}),[t]),J.jsx("div",{ref:o,role:"status","aria-live":r,style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0, 0, 0, 0)"}},e)},aO=({setHeaderEndChatButtonVisible:e})=>($.useEffect((()=>{console.debug("setting header button to not visible"),e(!1),localStorage.clear()}),[]),e(!1),J.jsx(J.Fragment,{children:J.jsxs("div",{className:"pt-8 max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto ",children:[J.jsx("h1",{tabIndex:0,className:"govuk-heading-l pt-4 mb-4 h1-fix",children:"This chat is now closed."}),J.jsx("h1",{tabIndex:0,style:{fontSize:"19px"},children:"If you need to speak with us again, refresh the chat."})]})})),sO=({sdk:e,thread:t,sdkErrors:n,queuePosition:r,setQueuePosition:o,channelIdTarget:i})=>{const[a]=$.useState(!0),s=(()=>{const[e,t]=$.useState(window.navigator.onLine);return $.useEffect((()=>{const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e),window.addEventListener("offline",n),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}),[]),e})(),[l,u]=$.useState(!1),[c]=$.useState((()=>{const e=window.navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);return t&&n&&!e.match(/CriOS/i)})()),[d]=$.useState((()=>{const e=window.navigator.userAgent;return!(!e.match(/iPad/i)&&!e.match(/iPhone/i)||!e.match(/CriOS/i))})()),[f]=$.useState((()=>{const e=window.navigator.userAgent;return!!e.match(/Android/i)&&!!e.match(/Chrome/i)})());$.useState((()=>{const e=window.navigator.userAgent,t=!!e.match(/Macintosh/i),n=!!e.match(/WebKit/i);return t&&n&&!e.match(/CriOS/i)})());const[p,h]=$.useState(""),[m,g]=$.useState(""),[v,y]=$.useState(""),[b,w]=$.useState(""),[E,S]=$.useState(""),[x,_]=$.useState(!1),[C,k]=$.useState(""),[T,N]=$.useState(""),[O,I]=$.useState(""),[A,R]=$.useState(215),[P,L]=$.useState(80),D=e=>{R(e)},F=localStorage.getItem("chatStatus"),[j,M]=$.useState("OPEN"===F||"CLOSED"===F),[z,U]=$.useState("OPEN"===F||"CLOSED"===F?F:"NEW"),[B,H]=$.useState("OPEN"===F||"CLOSED"===F?F:"NEW"),[G,W]=$.useState(!1),[V,q]=$.useState(0),[Q,K]=$.useState(""),[Y,X]=$.useState([]),[Z]=$.useState(""),[ee,te]=$.useState(""),[ne,re]=$.useState(""),[oe,ie]=$.useState(""),[ae,se]=$.useState(""),[le,ue]=$.useState(""),[ce,de]=$.useState(""),[fe,pe]=$.useState(""),he="CLOSED",[me,ge]=$.useState(!1),[ve,ye]=$.useState(!1),[be,we]=$.useState([]),[Ee,Se]=$.useState(!1),[xe,_e]=$.useState(""),[Ce,ke]=$.useState(null),[Te,Ne]=$.useState([]),[Oe,Ie]=$.useState(""),[Ae,Re]=$.useState(""),[Pe,Le]=$.useState([]),[De,Fe]=$.useState("MTIAAAAAAAAAAAAAtBI42fVlv0YjqdVDANWxxly0KvzNbthes1bceHQ53od2n1MbInl8JxXg/HZ9Ece5fzFl0smOak9xZj5fzLpLy9C53xkGZ1pGZf+btQs="),[je,Me]=$.useState(""),[ze,Ue]=$.useState("TPDFE"),[Be,He]=$.useState("tpdfe.satmetrix.com"),[$e,Ge]=$.useState("TPDFE_339"),[We,Ve]=$.useState(!1),[qe,Qe]=$.useState(!1),[Ke,Ye]=$.useState(!1),[Xe,Je]=$.useState(!1),[Ze,et]=$.useState(!0),[tt,nt]=$.useState(!1),[rt,ot]=$.useState(!1),[it,at]=$.useState(!1),[st,lt]=$.useState(!0);$.useEffect((()=>{lt("CLOSED"!==z&&"UNAVAILABLE"!==z&&"TIMED_OUT"!==z&&"OFFLINE"!==z&&"BUSY"!==z&&!1!==j)}),[z,j]),$.useEffect((()=>{window.scrollTo(0,0)}),[]),$.useEffect((()=>{"websocketClosed"===n&&s&&U("TIMED_OUT")}),[n]),$.useEffect((()=>{s?s&&"OFFLINE"===z&&(window.location.reload(),u(!0)):(u(!1),U("OFFLINE"))}),[s]);const ut=$.useCallback((e=>{var t,n,r,i,a,s,l,u,c,d,f,p,h,m,g,v;if(!Gd.isMessageCreatedEvent(e.detail))return void console.error("Event detail is not a message created event",e);e.detail.data.message.authorEndUserIdentity||(C||k(null==(i=null==(r=null==(n=null==(t=null==e?void 0:e.detail)?void 0:t.data)?void 0:n.message)?void 0:r.authorUser)?void 0:i.firstName),T||N(null==(u=null==(l=null==(s=null==(a=null==e?void 0:e.detail)?void 0:a.data)?void 0:s.message)?void 0:l.authorUser)?void 0:u.surname),O||I(null==(p=null==(f=null==(d=null==(c=null==e?void 0:e.detail)?void 0:c.data)?void 0:d.message)?void 0:f.authorUser)?void 0:p.id),o(0),y(`${null==(v=null==(g=null==(m=null==(h=null==e?void 0:e.detail)?void 0:h.data)?void 0:m.message)?void 0:g.authorUser)?void 0:v.firstName}`));const b=e.detail.data.message;X((e=>[...e,b])),q((e=>e+1))}),[]),ct=$.useCallback((e=>{var t,n;Gd.isContactStatusChangedEvent(e.detail)&&("open"==e.detail.data.case.status?(ot(!1),q(V+1)):"resolved"==e.detail.data.case.status?(ot(!0),q(V+1)):"closed"==e.detail.data.case.status&&(null==(t=e.detail.data.user)?void 0:t.agentId)?(ot(!1),localStorage.setItem("chatStatus",he),U("CLOSED")):"closed"!=e.detail.data.case.status||(null==(n=e.detail.data.user)?void 0:n.agentId)?"escalated"==e.detail.data.case.status&&at(!0):U("CLOSED"))}),[]);$.useEffect((()=>{t instanceof Gd.LivechatThread?(t.onThreadEvent(Gd.ChatEvent.CONTACT_STATUS_CHANGED,ct),t.onThreadEvent(Gd.ChatEvent.MESSAGE_CREATED,ut)):console.error("No thread available to end chat.")}),[t]);const dt=e=>$.useCallback((()=>{}),[]);$.useEffect((()=>{t.onThreadEvent(Gd.ChatEvent.MESSAGE_SEEN_BY_USER,dt)}),[t]);const ft=e=>{console.error("typing started"),Je(!0)};$.useEffect((()=>{e.onChatEvent(Gd.ChatEvent.AGENT_TYPING_STARTED,ft)}),[t]);const pt=e=>{console.error("typing ended"),Je(!1)};$.useEffect((()=>{e.onChatEvent(Gd.ChatEvent.AGENT_TYPING_ENDED,pt)}),[e]),$.useEffect((()=>{o(0)}),[Xe]),$.useEffect((()=>{Je(!1)}),[Y]);const ht=$.useCallback((async()=>{const e=localStorage.getItem("chatStatus");if("OPEN"===e||"CLOSED"===e){if(!(t instanceof Gd.LivechatThread))return void console.error("No thread available to end chat.");try{const e=await t.recover();e.messages.reverse().forEach((e=>{var t;t=e,X((e=>[...e,t]))}))}catch(n){console.error("Recovery failed:",n),lt(!1),U("THREAD_CLOSED")}}}),[]);$.useEffect((()=>{ht()}),[]);const mt=$.useCallback((()=>t instanceof Gd.LivechatThread?new Promise((async e=>{var n,r;let o=[...Y];try{let i=!0;for(;i;){const e=await t.loadMoreMessages();let a=[];if(a=(null==(r=null==(n=null==e?void 0:e.data)?void 0:n.messages)?void 0:r.reverse())??[],0===a.length){i=!1;break}o=[...a,...o]}X(o),e(o)}catch(i){console.error("Couldn't load more messages:",i),e(o)}})):(console.error("No thread available to end chat."),Promise.reject("No thread available to end chat."))),[t,X,Y]),gt=e=>{var t;try{if(0===e.length)return void console.error("There are no messages to save.");let n="Department for Education - Get Into Teaching - Chat Transcript\n\n",r="";const o=e.find((e=>{var t;return(null==e?void 0:e.authorUser)&&"Shared"!=(null==(t=null==e?void 0:e.authorUser)?void 0:t.firstName)})),i=o?null==(t=null==o?void 0:o.authorUser)?void 0:t.firstName:"Get Into Teaching";let a,s=!0;e.forEach((e=>{if(e.agent_reassigned_message)return;let t=e.authorUser?`${Xd(e.authorUser.firstName,i)} (Agent)`:e.authorEndUserIdentity?`${e.authorEndUserIdentity.firstName} ${e.authorEndUserIdentity.lastName} (You)`:"",o=e.messageContent.text.trim();o||(o="Document uploaded");let l=`${t}: ${o}`;const u=e.createdAt,c=((e,t)=>{if(!e)return!0;if(e==t)return!0;const n=new Date(e);return new Date(t).getTime()>n.getTime()})(a,u);c||(s=!1),a=u;const d=`${l}\n${u?`Sent at: ${new Date(u).toLocaleString()}`:""}\n\n`;c||console.debug("timestamp mismatch fixed"),r!=d&&c&&s&&(n+=d,r=d)})),n+=`Date of Download: ${(new Date).toLocaleDateString()}\n`;const l=new Blob([n],{type:"text/plain"}),u=URL.createObjectURL(l),c=document.createElement("a");c.href=u,c.download="dfe_chat_transcript.txt",document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(u)}catch(n){console.error("Error while saving transcript",n)}},vt=async()=>{try{const e=await mt();gt(e)}catch(e){console.error("Error while loading messages and saving transcript",e)}},yt=$.useCallback((()=>{t instanceof Gd.LivechatThread?t.keystroke():console.error("No thread available to get keystroke.")}),[t]),bt=$.useCallback((async()=>{try{if(!(t instanceof Gd.LivechatThread))return void console.error("No thread available to load more messages.");const e=(await t.loadMoreMessages()).data.messages.reverse()||[];X((t=>[...e,...t]))}catch(e){console.error("Couldn't load more messages:",e)}}),[]),wt=$.useRef(null);$.useEffect((()=>{const e=e=>{0===e.target.scrollTop&&bt()},t=wt.current;return t&&t.addEventListener("scroll",e),()=>{t&&t.removeEventListener("scroll",e)}}),[bt]);const Et=$.useRef(null);$.useEffect((()=>(document.body.style.overflowY="OPEN"==z?"hidden":"",()=>{document.body.style.overflowY=""})),[z]),$.useEffect((()=>{let e;return wt.current&&(e=setTimeout((()=>{const e=wt.current.scrollHeight;wt.current.scrollTop=e}),0)),()=>{clearTimeout(e)}}),[V,Xe]),$.useLayoutEffect((()=>{if(wt.current){const e=wt.current.scrollHeight;wt.current.scrollTop=e}}),[V]);const St=$.useCallback((async(n,r)=>{var o;if(t instanceof Gd.LivechatThread){try{(i=r.email)&&i.length<=240&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)&&""!==i||delete r.email,await(null==(o=e.getCustomer())?void 0:o.setName(`${r.name}`)),r.name&&delete r.name}catch(a){console.error("something went wrong setting custom fields",a)}var i;try{const e=await(null==t?void 0:t.startChat(n||"Conversation started"));if(localStorage.setItem("chatStarted","true"),void 0===e)throw new Error("startChat returned undefined:");M(!0),U("OPEN"),h("Chat has started")}catch(a){console.error("Start chat failed:",a),U("ERROR"),h("Chat failed to start")}await(async(e,n)=>{se(e);try{await t.setCustomFields({candidate_situation:n,candidate_enquiry:e}),await t.sendCustomFields()}catch(a){console.error("couldn't set custom fields",a)}})(r.candidate_enquiry,r.candidate_situation)}else console.error("No thread available to end chat.")}),[t]),xt=$.useCallback((async()=>{if(t instanceof Gd.LivechatThread)try{o(0),await t.endChat()}catch(e){console.error("End chat failed:",e)}else console.error("No thread available to end chat.")}),[t]),_t=$.useCallback((async()=>{if(t instanceof Gd.LivechatThread)try{localStorage.setItem("chatStatus",he),await t.endChat()}catch(e){console.error("End chat failed:",e)}else console.error("No thread available to end chat.")}),[t]),Ct=$.useCallback((async e=>{if(t instanceof Gd.LivechatThread){if(""!==e.trim())try{await t.sendTextMessage(e),y("message sent")}catch(n){console.error("couldn't send message",n),U("ERROR")}}else console.error("No thread available to end chat.")}),[t]);return J.jsxs("div",{className:" app flex flex-col",children:[J.jsx(iO,{messageCategory:"chatWindowEvents",message:p,setMessage:h,ariaLive:"polite"}),J.jsx(iO,{messageCategory:"messages",message:m,setMessage:g,ariaLive:"polite"}),J.jsx(iO,{messageCategory:"newAgent",message:v,setMessage:y,ariaLive:"polite"}),J.jsx(iO,{messageCategory:"surveyMessages",message:E,setMessage:S,ariaLive:"assertive"}),J.jsx(iO,{messageCategory:"errorMessages",message:b,setMessage:w,ariaLive:"polite"}),J.jsx(Zd,{messages:Y,handleEndChat:xt,handleSaveTranscript:vt,loadAllMessages:mt,menuOpen:G,setMenuOpen:W,chatStarted:j,stage:z,setStage:U,setUserClosedCase:nt,agentClosedCase:Ze,userClosedCase:tt,setPreviousStage:H,headerEndChatButtonRef:Et,surveyInProgress:me,headerEndChatButtonVisible:st,setMenuButtonTouched:_,handleHeaderHeight:e=>{L(e)}}),(()=>{switch(z){case"NEW":return J.jsx(J.Fragment,{children:J.jsx(SN,{name:ee,setName:te,email:le,setEmail:ue,subject:ne,setSubject:re,situation:oe,setSituation:ie,setStage:U,thread:t,useValidation:a,setMenuOpen:W,handleStartChat:St,headerEndChatButtonRef:Et,setSR_errorMessages:w,setSR_chatWindowEvents:h,setPreviousStage:H,channelIdTarget:i})});case"OPEN":return J.jsxs(J.Fragment,{children:[J.jsx(CN,{chatWindowRef:wt,messages:Y,agentTyping:Xe,queuePosition:r,agentResolvedCase:rt,agentEscalatedCase:it,setMessages:X,agentReassigned:Z,setSR_messages:g,setSR_newAgentAssigned:y,stage:z,handleSaveTranscript:vt,messageCount:V,setMessageCount:q,surveyInProgress:me,setSurveyInProgress:ge,surveyFinished:ve,setSurveyFinished:ye,surveyLookupValues:be,setSurveyLookupValues:we,enteredSurvey:Ee,setEnteredSurvey:Se,surveyInputResponse:xe,setSurveyInputResponse:_e,surveyHeader:Ce,setSurveyHeader:ke,surveyMessageTextArray:Te,setSurveyMessageTextArray:Ne,surveyMessageText:Oe,setSurveyMessageText:Ie,surveyMessageType:Ae,setSurveyMessageType:Re,surveyLookups:Pe,setSurveyLookups:Le,surveyAccessToken:je,setSurveyAccessToken:Me,surveyTenantId:ze,setSurveyTenantId:Ue,surveyHostname:Be,setSurveyHostname:He,surveyId:$e,menuButtonTouched:x,onAndroidChrome:f,oniOSSafari:c,oniOSChrome:d,messageInputHeight:A,headerHeight:P,setAgentName:de}),J.jsx(TN,{messageText:Q,setMessageText:K,handleSendMessage:Ct,handleSendTypingIndicator:yt,thread:t,handleHeightChangeMessageInput:D})]});case"CLOSED":return J.jsxs("div",{className:"flex flex-col px-2 items-center self-center",children:["true"===localStorage.getItem("noChat")?J.jsx($N,{handleSaveTranscript:vt,chatStarted:j,showCloseWindow:!0,showSaveTranscript:!1,showStartAgain:!0,userClosedCase:tt,agentClosedCase:Ze}):J.jsxs(J.Fragment,{children:["CLOSED"===z?J.jsxs("div",{className:"w-11/12",children:[J.jsx(YN,{tenantId:ze,hostname:Be,surveyId:$e,token:De,handleSaveTranscript:vt,messageCount:V,setMessageCount:q,surveyInProgress:me,setSurveyInProgress:ge,surveyFinished:ve,setSurveyFinished:ye,surveyLookupValues:be,setSurveyLookupValues:we,enteredSurvey:Ee,setEnteredSurvey:Se,surveyInputResponse:xe,setSurveyInputResponse:_e,surveyHeader:Ce,setSurveyHeader:ke,surveyMessageTextArray:Te,setSurveyMessageTextArray:Ne,surveyMessageText:Oe,setSurveyMessageText:Ie,surveyMessageType:Ae,setSurveyMessageType:Re,surveyLookups:Pe,setSurveyLookups:Le,setSurveyRefused:Ve,setSurveyAccessToken:Me,name:ee,subject:ne,situation:oe,enquiry:ae,agentName:ce,agentId:fe,surveyLoading:qe,setSurveyLoading:Qe,agentClosedCase:Ze,surveyResponseLoading:Ke,setSurveyResponseLoading:Ye,setStage:U,fbmAgentFirstName:C,fbmAgentLastName:T,fbmAgentId:O,setSR_surveyMessages:S}),J.jsxs("div",{className:"mt-4",children:[We?(e=tt,e?J.jsx("p",{tabIndex:0,style:{border:"none",fontSize:"19px"},className:`bg-git-light-blue bg-opacity-20 p-2 rounded-lg mb-6 ${qd} max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto`,children:"Thanks for getting in touch with us today. If you need to speak with us again, we're open 8:30am to 5:30pm Monday to Friday."},888888888888888):J.jsx("p",{tabIndex:0,style:{border:"none",fontSize:"19px"},className:`bg-git-light-blue bg-opacity-20 p-2 rounded-lg mb-6 ${qd}`,children:"This chat is now closed. Thanks for getting in touch with us. If you need to speak to us again, we're open 8:30am to 5:30pm Monday to Friday."},888888888888888)):null,J.jsx($N,{handleSaveTranscript:vt,chatStarted:j,showCloseWindow:We,showSaveTranscript:!1,showStartAgain:!1,userClosedCase:tt,agentClosedCase:Ze})]})]}):null,J.jsx(XN,{surveyInProgress:me,setSurveyInProgress:ge,surveyFinished:ve,setSurveyFinished:ye,surveyLookupValues:be,setSurveyLookupValues:we,enteredSurvey:Ee,setEnteredSurvey:Se,surveyInputResponse:xe,setSurveyInputResponse:_e,surveyHeader:Ce,setSurveyHeader:ke,surveyMessageTextArray:Te,setSurveyMessageTextArray:Ne,surveyMessageText:Oe,setSurveyMessageText:Ie,surveyMessageType:Ae,setSurveyMessageType:Re,surveyLookups:Pe,setSurveyLookups:Le,setMessageCount:q,surveyAccessToken:je,setSurveyAccessToken:Me,surveyTenantId:ze,setSurveyTenantId:Ue,surveyHostname:Be,setSurveyHostname:He,handleSaveTranscript:vt,chatStarted:j,surveyLoading:qe,setSurveyLoading:Qe,surveyResponseLoading:Ke,setSurveyResponseLoading:Ye,setSR_surveyMessages:S})]}),J.jsx("div",{className:""+("true"===localStorage.getItem("noChat")?"mt-6":"")})]});case"END_CHAT_CONFIRMATION_PAGE":return J.jsx(J.Fragment,{children:J.jsx(rO,{email:le,setEmail:ue,stage:z,setStage:U,handleEndChat:xt,handleSaveTranscript:vt,previousStage:B,setSR_messages:g,setSR_chatWindowEvents:h,chatStarted:j,setAgentClosedCase:et})});case"OFFLINE":return J.jsx(JN,{networkConnectionRestored:l});case"ERROR":default:return J.jsx(ZN,{handleErrorEndChat:_t});case"TIMED_OUT":return J.jsx(nO,{});case"BUSY":return J.jsx(eO,{});case"UNAVAILABLE":return J.jsx(tO,{});case"THREAD_CLOSED":return J.jsx(aO,{setHeaderEndChatButtonVisible:lt});case"SURVEY_TIMEOUT":return J.jsx(oO,{setHeaderEndChatButtonVisible:lt})}var e})(),J.jsx("div",{className:"max-w-custom-960 w-11/12 md:w-11/12 sm:w-11/12 mx-auto"})]})},lO=()=>{const[e,t]=$.useState(""),[n,r]=$.useState(null),[o,i]=$.useState(0),a={dfe_git_uat:{brandId:1354,channelId:"chat_a1c317cf-a81e-44ad-bf6b-7ccadcfd2457",environment:Gd.EnvironmentName.UK1},dfe_git_prod:{brandId:1354,channelId:"chat_268662fd-5996-416c-901b-526de5509a8d",environment:Gd.EnvironmentName.UK1},r101_dev:{brandId:1150,channelId:"chat_16aa0fd8-35c2-4030-bb21-7473f04421d1",environment:Gd.EnvironmentName.EU1}};let s="dfe_git",l="uat",u=`${s}_${l}`;try{l=window.env.CHANNEL_ID_TARGET,s=window.env.TENANT_TARGET,u=`${s}_${l}`}catch(h){console.error("couldnt retrieve the channel id target",h),l="uat"}const c=a[u]||a.dfe_git_uat;$.useEffect((()=>{try{console.debug(`Chat to Get Into Teaching is targeting ${s}'s ${l} environment`)}catch(h){console.error("couldnt retrieve environment configuration")}}),[]);const d={brandId:c.brandId,channelId:c.channelId,customerId:localStorage.getItem("STORAGE_CHAT_CUSTOMER_ID")||"",environment:c.environment,onError:e=>{console.error(e);const n=null==e?void 0:e.message;n&&n.includes("WebSocketClientError")&&t("websocketClosed")}};"OPEN"!==localStorage.getItem("chatStatus")&&"CLOSED"!==localStorage.getItem("chatStatus")&&localStorage.setItem("chatStatus","NEW");const f=new Gd.ChatSdk(d);$.useEffect((()=>{(async()=>{let e=localStorage.getItem("STORAGE_CHAT_THREAD_ID");try{const e=await f.authorize();document.querySelector("body").style.visibility="visible";const t=null==e?void 0:e.consumerIdentity.idOnExternalPlatform;localStorage.setItem("STORAGE_CHAT_CUSTOMER_ID",t||"")}catch(n){console.error("AUTH ERR: ",n)}e||(e=null==crypto?void 0:crypto.randomUUID());const t=await f.getThread(e);t instanceof Gd.LivechatThread?(r(t),localStorage.setItem("STORAGE_CHAT_THREAD_ID",t.idOnExternalPlatform)):console.error("Thread is not livechat thread")})()}),[]);const p=$.useCallback((e=>{(e.detail||e.detail.data.positionInQueue)&&i(e.detail.data.positionInQueue)}),[]);return $.useEffect((()=>{f.onChatEvent(Gd.ChatEvent.SET_POSITION_IN_QUEUE,p)}),[f,p]),n||"object"!=typeof f?J.jsx(sO,{sdk:f,thread:n,sdkErrors:e,queuePosition:o,setQueuePosition:i,channelIdTarget:l}):J.jsx("div",{className:"App",children:J.jsx("div",{className:"govuk-width-container",children:J.jsx("div",{className:"govuk-!-padding-top-5 govuk-!-margin-top-0 ",children:J.jsx("p",{children:"Chat is loading..."})})})})};Z.createRoot(document.getElementById("root")).render(J.jsx(G.StrictMode,{children:J.jsx(lO,{})})); diff --git a/app/webpacker/packs/chat.js b/app/webpacker/packs/chat.js index 0227315569..9a07ee66e0 100644 --- a/app/webpacker/packs/chat.js +++ b/app/webpacker/packs/chat.js @@ -1 +1 @@ -require('../javascript/index-c4b64105.js'); +require('../javascript/index-24235727.js');