index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
presto-player
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/presto-player/dist/982.js
"use strict";(self.webpackChunk_presto_player_presto_player=self.webpackChunk_presto_player_presto_player||[]).push([[982],{5643:function(e,t,i){if(i.d(t,{X:function(){return h},w:function(){return u}}),571==i.j)var n=i(6485);if(571==i.j)var r=i(8120);if(571==i.j)var o=i(5383);if(571==i.j)var s=i(9892);if(571==i.j)var a=i(4790);if(571==i.j)var l=i(9119);if(571==i.j)var c=i(8519);var h=function(e){void 0===e&&(e={});var{crosshairCursor:t=!1}=e,i=[];!1!==e.closeBracketsKeymap&&(i=i.concat(a.GA)),!1!==e.defaultKeymap&&(i=i.concat(o.wQ)),!1!==e.searchKeymap&&(i=i.concat(s.Lp)),!1!==e.historyKeymap&&(i=i.concat(o.f$)),!1!==e.foldKeymap&&(i=i.concat(l.e7)),!1!==e.completionKeymap&&(i=i.concat(a.B1)),!1!==e.lintKeymap&&(i=i.concat(c.Fv));var h=[];return!1!==e.lineNumbers&&h.push((0,n.Eu)()),!1!==e.highlightActiveLineGutter&&h.push((0,n.HQ)()),!1!==e.highlightSpecialChars&&h.push((0,n.AE)()),!1!==e.history&&h.push((0,o.m8)()),!1!==e.foldGutter&&h.push((0,l.mi)()),!1!==e.drawSelection&&h.push((0,n.Uw)()),!1!==e.dropCursor&&h.push((0,n.qr)()),!1!==e.allowMultipleSelections&&h.push(r.yy.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&h.push((0,l.nY)()),!1!==e.syntaxHighlighting&&h.push((0,l.nF)(l.R_,{fallback:!0})),!1!==e.bracketMatching&&h.push((0,l.n$)()),!1!==e.closeBrackets&&h.push((0,a.vQ)()),!1!==e.autocompletion&&h.push((0,a.ys)()),!1!==e.rectangularSelection&&h.push((0,n.Zs)()),!1!==t&&h.push((0,n.S2)()),!1!==e.highlightActiveLine&&h.push((0,n.ZO)()),!1!==e.highlightSelectionMatches&&h.push((0,s.sW)()),e.tabSize&&"number"==typeof e.tabSize&&h.push(l.c.of(" ".repeat(e.tabSize))),h.concat([n.$f.of(i.flat())]).filter(Boolean)},u=function(e){void 0===e&&(e={});var t=[];!1!==e.defaultKeymap&&(t=t.concat(o.wQ)),!1!==e.historyKeymap&&(t=t.concat(o.f$));var i=[];return!1!==e.highlightSpecialChars&&i.push((0,n.AE)()),!1!==e.history&&i.push((0,o.m8)()),!1!==e.drawSelection&&i.push((0,n.Uw)()),!1!==e.syntaxHighlighting&&i.push((0,l.nF)(l.R_,{fallback:!0})),i.concat([n.$f.of(t.flat())]).filter(Boolean)}},4848:function(e,t,i){function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},n.apply(null,arguments)}i.r(t),i.d(t,{Annotation:function(){return o.q6},AnnotationType:function(){return o.JJ},BidiSpan:function(){return s.CZ},BlockInfo:function(){return s.td},BlockType:function(){return s.kH},ChangeDesc:function(){return o.n0},ChangeSet:function(){return o.as},CharCategory:function(){return o.D0},Compartment:function(){return o.F6},Decoration:function(){return s.p},Direction:function(){return s.Nm},EditorSelection:function(){return o.jT},EditorState:function(){return o.yy},EditorView:function(){return s.tk},Facet:function(){return o.r$},GutterMarker:function(){return s.SJ},Line:function(){return o.x1},MapMode:function(){return o.gc},MatchDecorator:function(){return s.Y1},Prec:function(){return o.Wl},Range:function(){return o.e6},RangeSet:function(){return o.Xs},RangeSetBuilder:function(){return o.f_},RangeValue:function(){return o.uU},RectangleMarker:function(){return s.dc},SelectionRange:function(){return o.xm},StateEffect:function(){return o.Py},StateEffectType:function(){return o.D6},StateField:function(){return o.QQ},Text:function(){return o.xv},Transaction:function(){return o.YW},ViewPlugin:function(){return s.lg},ViewUpdate:function(){return s.TB},WidgetType:function(){return s.l9},__test:function(){return s.$X},basicSetup:function(){return l.X},closeHoverTooltips:function(){return s.E8},codePointAt:function(){return o.gm},codePointSize:function(){return o.nZ},color:function(){return c.$_},combineConfig:function(){return o.BO},countColumn:function(){return o.IS},crosshairCursor:function(){return s.S2},default:function(){return b},defaultLightThemeOption:function(){return h},drawSelection:function(){return s.Uw},dropCursor:function(){return s.qr},findClusterBreak:function(){return o.cp},findColumn:function(){return o.Gz},fromCodePoint:function(){return o.bg},getDefaultExtensions:function(){return u},getDrawSelectionConfig:function(){return s.HM},getPanel:function(){return s.Sd},getStatistics:function(){return d.a},getTooltip:function(){return s.gB},gutter:function(){return s.v5},gutterLineClass:function(){return s.v7},gutterWidgetClass:function(){return s.NO},gutters:function(){return s.lc},hasHoverTooltips:function(){return s.Dm},highlightActiveLine:function(){return s.ZO},highlightActiveLineGutter:function(){return s.HQ},highlightSpecialChars:function(){return s.AE},highlightTrailingWhitespace:function(){return s.pk},highlightWhitespace:function(){return s.DF},hoverTooltip:function(){return s.bF},keymap:function(){return s.$f},layer:function(){return s.EY},lineNumberMarkers:function(){return s.p2},lineNumberWidgetMarker:function(){return s.Bf},lineNumbers:function(){return s.Eu},logException:function(){return s.OO},minimalSetup:function(){return l.w},oneDark:function(){return c.vk},oneDarkHighlightStyle:function(){return c.VE},oneDarkTheme:function(){return c.pD},panels:function(){return s.h0},placeholder:function(){return s.W$},rectangularSelection:function(){return s.Zs},repositionTooltips:function(){return s.E2},runScopeHandlers:function(){return s.$1},scrollPastEnd:function(){return s.CT},showPanel:function(){return s.mH},showTooltip:function(){return s.hJ},tooltips:function(){return s.jH},useCodeMirror:function(){return m}});var r=i(9196),o=i(8120),s=i(6485),a=i(5383),l=i(5643),c=i(3732),h=s.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),u=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:i=!0,readOnly:n=!1,theme:r="light",placeholder:u="",basicSetup:d=!0}=e,p=[];switch(t&&p.unshift(s.$f.of([a.oc])),d&&("boolean"==typeof d?p.unshift((0,l.X)()):p.unshift((0,l.X)(d))),u&&p.unshift((0,s.W$)(u)),r){case"light":p.push(h);break;case"dark":p.push(c.vk);break;case"none":break;default:p.push(r)}return!1===i&&p.push(s.tk.editable.of(!1)),n&&p.push(o.yy.readOnly.of(!0)),[...p]},d=i(4241),p=o.q6.define(),f=[];function m(e){var{value:t,selection:i,onChange:n,onStatistics:a,onCreateEditor:l,onUpdate:c,extensions:h=f,autoFocus:m,theme:g="light",height:v=null,minHeight:y=null,maxHeight:b=null,width:w=null,minWidth:k=null,maxWidth:x=null,placeholder:_="",editable:S=!0,readOnly:O=!1,indentWithTab:C=!0,basicSetup:T=!0,root:A,initialState:P}=e,[M,E]=(0,r.useState)(),[D,L]=(0,r.useState)(),[R,I]=(0,r.useState)(),N=s.tk.theme({"&":{height:v,minHeight:y,maxHeight:b,width:w,minWidth:k,maxWidth:x},"& .cm-scroller":{height:"100% !important"}}),z=[s.tk.updateListener.of((e=>{if(e.docChanged&&"function"==typeof n&&!e.transactions.some((e=>e.annotation(p)))){var t=e.state.doc.toString();n(t,e)}a&&a((0,d.a)(e))})),N,...u({theme:g,editable:S,readOnly:O,placeholder:_,indentWithTab:C,basicSetup:T})];return c&&"function"==typeof c&&z.push(s.tk.updateListener.of(c)),z=z.concat(h),(0,r.useEffect)((()=>{if(M&&!R){var e={doc:t,selection:i,extensions:z},n=P?o.yy.fromJSON(P.json,e,P.fields):o.yy.create(e);if(I(n),!D){var r=new s.tk({state:n,parent:M,root:A});L(r),l&&l(r,n)}}return()=>{D&&(I(void 0),L(void 0))}}),[M,R]),(0,r.useEffect)((()=>E(e.container)),[e.container]),(0,r.useEffect)((()=>()=>{D&&(D.destroy(),L(void 0))}),[D]),(0,r.useEffect)((()=>{m&&D&&D.focus()}),[m,D]),(0,r.useEffect)((()=>{D&&D.dispatch({effects:o.Py.reconfigure.of(z)})}),[g,h,v,y,b,w,k,x,_,S,O,C,T,n,c]),(0,r.useEffect)((()=>{if(void 0!==t){var e=D?D.state.doc.toString():"";D&&t!==e&&D.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[p.of(!0)]})}}),[t,D]),{state:R,setState:I,view:D,setView:L,container:M,setContainer:E}}var g=i(5893),v=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],y=(0,r.forwardRef)(((e,t)=>{var{className:i,value:o="",selection:s,extensions:a=[],onChange:l,onStatistics:c,onCreateEditor:h,onUpdate:u,autoFocus:d,theme:p="light",height:f,minHeight:y,maxHeight:b,width:w,minWidth:k,maxWidth:x,basicSetup:_,placeholder:S,indentWithTab:O,editable:C,readOnly:T,root:A,initialState:P}=e,M=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;i[n]=e[n]}return i}(e,v),E=(0,r.useRef)(null),{state:D,view:L,container:R}=m({container:E.current,root:A,value:o,autoFocus:d,theme:p,height:f,minHeight:y,maxHeight:b,width:w,minWidth:k,maxWidth:x,basicSetup:_,placeholder:S,indentWithTab:O,editable:C,readOnly:T,selection:s,onChange:l,onStatistics:c,onCreateEditor:h,onUpdate:u,extensions:a,initialState:P});if((0,r.useImperativeHandle)(t,(()=>({editor:E.current,state:D,view:L})),[E,R,D,L]),"string"!=typeof o)throw new Error("value must be typeof string but got "+typeof o);var I="string"==typeof p?"cm-theme-"+p:"cm-theme";return(0,g.jsx)("div",n({ref:E,className:I+(i?" "+i:"")},M))}));y.displayName="CodeMirror";var b=y},4241:function(e,t,i){i.d(t,{a:function(){return n}});var n=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map((t=>e.state.sliceDoc(t.from,t.to))),selectedText:e.state.selection.ranges.some((e=>!e.empty))})},2136:function(e,t,i){if(i.d(t,{a:function(){return b},b:function(){return v},c:function(){return Fe},d:function(){return je},e:function(){return x},f:function(){return w},g:function(){return Re},i:function(){return Le},l:function(){return g},p:function(){return k},r:function(){return Be},s:function(){return ze},t:function(){return m}}),571!=i.j)var n=i(3324);var r=i(136),o=i(2963),s=i(1120),a=i(2982),l=i(4942),c=i(5671),h=i(3144),u=i(1002);function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=(0,s.Z)(e);if(t){var r=(0,s.Z)(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return(0,o.Z)(this,i)}}function p(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function f(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?p(Object(i),!0).forEach((function(t){(0,l.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):p(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function m(e){var t=e.current,i=e.duration,n=e.showAfter,r=void 0===n?null:n;if(0===r)return!0;if(null===r||!i)return!1;if(t===r)return!0;var o=t/i*100;return 99.9<o&&(o=100),o>=r}function g(e){if(e){var t,i,n;if(e.match(/^rgb/)){var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);t=r[1],i=r[2],n=r[3]}else{var o=+("0x"+e.slice(1).replace(e.length<5&&/./g,"$&$&"));t=o>>16,i=o>>8&255,n=255&o}return Math.sqrt(t*t*.299+i*i*.587+n*n*.114)>127.5?"light":"dark"}}function v(e){var t,i=e.split(":");return i.length>1&&(t=60*parseInt(i[0])),parseInt(i[1])+parseInt(t)}function y(){var e=navigator.userAgent||navigator.vendor;return/windows phone/i.test(e)?"Windows Phone":/android/i.test(e)?"Android":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)?"iOS":"unknown"}function b(){return"iOS"===y()}function w(){return"Android"===y()&&(e=window.navigator.standalone,t=window.navigator.userAgent.toLowerCase(),i=/safari/.test(t),!(/iphone|ipod|ipad/.test(t)?!e&&i||e||i:!t.includes("wv")));var e,t,i}function k(e){var t=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);return t?[t[1],t[2],t[3],"1"]:(t=e.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((0.)?\d+)\s*\)$/i))?[t[1],t[2],t[3],t[4]]:void 0}function x(e){var t,i,n,r,o;if("unknown"!==y()&&!(null===(i=null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.blockAttributes)||void 0===i?void 0:i.playsInline)&&("function"==typeof(null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.webkitExitFullScreen)&&(null==e||e.media.webkitExitFullScreen()),"function"==typeof(null===(r=null==e?void 0:e.embed)||void 0===r?void 0:r.exitFullscreen)&&(null===(o=null==e?void 0:e.embed)||void 0===o||o.exitFullscreen()),"youtube"===e.provider)){var s=e.currentTime;e.currentTime=e.duration,e.once("playing",(function(){e.currentTime=s}))}}var _=function(e){return null!=e?e.constructor:null},S=function(e){return null==e},O=function(e){return _(e)===Object},C=function(e){return _(e)===String},T=S,A=O,P=C,M=function(e){return S(e)||(C(e)||function(e){return Array.isArray(e)}(e)||function(e){return function(e,t){return Boolean(e&&t&&e instanceof t)}(e,NodeList)}(e))&&!e.length||O(e)&&!Object.keys(e).length};function E(e){return Array.isArray?Array.isArray(e):"[object Array]"===z(e)}function D(e){return"string"==typeof e}function L(e){return"number"==typeof e}function R(e){return"object"===(0,u.Z)(e)}function I(e){return null!=e}function N(e){return!e.trim().length}function z(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var B=function(e){return"Invalid value for key ".concat(e)},j=function(e){return"Pattern length exceeds max of ".concat(e,".")},F=Object.prototype.hasOwnProperty,V=function(){function e(t){var i=this;(0,c.Z)(this,e),this._keys=[],this._keyMap={};var n=0;t.forEach((function(e){var t=W(e);n+=t.weight,i._keys.push(t),i._keyMap[t.id]=t,n+=t.weight})),this._keys.forEach((function(e){e.weight/=n}))}return(0,h.Z)(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function W(e){var t=null,i=null,n=null,r=1,o=null;if(D(e)||E(e))n=e,t=$(e),i=Q(e);else{if(!F.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));var s=e.name;if(n=s,F.call(e,"weight")&&(r=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(s));t=$(s),i=Q(s),o=e.getFn}return{path:t,id:i,weight:r,src:n,getFn:o}}function $(e){return E(e)?e:e.split(".")}function Q(e){return E(e)?e.join("."):e}var H={useExtendedSearch:!1,getFn:function(e,t){var i=[],n=!1;return function e(t,r,o){if(I(t))if(r[o]){var s=t[r[o]];if(!I(s))return;if(o===r.length-1&&(D(s)||L(s)||function(e){return!0===e||!1===e||function(e){return R(e)&&null!==e}(e)&&"[object Boolean]"==z(e)}(s)))i.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(s));else if(E(s)){n=!0;for(var a=0,l=s.length;a<l;a+=1)e(s[a],r,o+1)}else r.length&&e(s,r,o+1)}else i.push(t)}(e,D(t)?t.split("."):t,0),n?i:i[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},q=f(f(f(f({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}}),{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1}),{location:0,threshold:.6,distance:100}),H),Z=/[^ ]+/g;function U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,i=new Map,n=Math.pow(10,t);return{get:function(t){var r=t.match(Z).length;if(i.has(r))return i.get(r);var o=1/Math.pow(r,.5*e),s=parseFloat(Math.round(o*n)/n);return i.set(r,s),s},clear:function(){i.clear()}}}var X=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.getFn,n=void 0===i?q.getFn:i,r=t.fieldNormWeight,o=void 0===r?q.fieldNormWeight:r;(0,c.Z)(this,e),this.norm=U(o,3),this.getFn=n,this.isCreated=!1,this.setIndexRecords()}return(0,h.Z)(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,i){e._keysMap[t.id]=i}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,D(this.docs[0])?this.docs.forEach((function(t,i){e._addString(t,i)})):this.docs.forEach((function(t,i){e._addObject(t,i)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();D(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,i=this.size();t<i;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(I(e)&&!N(e)){var i={v:e,i:t,n:this.norm.get(e)};this.records.push(i)}}},{key:"_addObject",value:function(e,t){var i=this,n={i:t,$:{}};this.keys.forEach((function(t,r){var o=t.getFn?t.getFn(e):i.getFn(e,t.path);if(I(o))if(E(o)){for(var s=[],a=[{nestedArrIndex:-1,value:o}];a.length;){var l=a.pop(),c=l.nestedArrIndex,h=l.value;if(I(h))if(D(h)&&!N(h)){var u={v:h,i:c,n:i.norm.get(h)};s.push(u)}else E(h)&&h.forEach((function(e,t){a.push({nestedArrIndex:t,value:e})}))}n.$[r]=s}else if(D(o)&&!N(o)){var d={v:o,n:i.norm.get(o)};n.$[r]=d}})),this.records.push(n)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function J(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.getFn,r=void 0===n?q.getFn:n,o=i.fieldNormWeight,s=void 0===o?q.fieldNormWeight:o,a=new X({getFn:r,fieldNormWeight:s});return a.setKeys(e.map(W)),a.setSources(t),a.create(),a}function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.errors,n=void 0===i?0:i,r=t.currentLocation,o=void 0===r?0:r,s=t.expectedLocation,a=void 0===s?0:s,l=t.distance,c=void 0===l?q.distance:l,h=t.ignoreLocation,u=void 0===h?q.ignoreLocation:h,d=n/e.length;if(u)return d;var p=Math.abs(a-o);return c?d+p/c:p?1:d}function K(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q.minMatchCharLength,i=[],n=-1,r=-1,o=0,s=e.length;o<s;o+=1){var a=e[o];a&&-1===n?n=o:a||-1===n||((r=o-1)-n+1>=t&&i.push([n,r]),n=-1)}return e[o-1]&&o-n>=t&&i.push([n,o-1]),i}var G=32;function ee(e){for(var t={},i=0,n=e.length;i<n;i+=1){var r=e.charAt(i);t[r]=(t[r]||0)|1<<n-i-1}return t}var te=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.location,o=void 0===r?q.location:r,s=n.threshold,a=void 0===s?q.threshold:s,l=n.distance,h=void 0===l?q.distance:l,u=n.includeMatches,d=void 0===u?q.includeMatches:u,p=n.findAllMatches,f=void 0===p?q.findAllMatches:p,m=n.minMatchCharLength,g=void 0===m?q.minMatchCharLength:m,v=n.isCaseSensitive,y=void 0===v?q.isCaseSensitive:v,b=n.ignoreLocation,w=void 0===b?q.ignoreLocation:b;if((0,c.Z)(this,e),this.options={location:o,threshold:a,distance:h,includeMatches:d,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:y,ignoreLocation:w},this.pattern=y?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var k=function(e,t){i.chunks.push({pattern:e,alphabet:ee(e),startIndex:t})},x=this.pattern.length;if(x>G){for(var _=0,S=x%G,O=x-S;_<O;)k(this.pattern.substr(_,G),_),_+=G;if(S){var C=x-G;k(this.pattern.substr(C),C)}}else k(this.pattern,0)}}return(0,h.Z)(e,[{key:"searchIn",value:function(e){var t=this.options,i=t.isCaseSensitive,n=t.includeMatches;if(i||(e=e.toLowerCase()),this.pattern===e){var r={isMatch:!0,score:0};return n&&(r.indices=[[0,e.length-1]]),r}var o=this.options,s=o.location,l=o.distance,c=o.threshold,h=o.findAllMatches,u=o.minMatchCharLength,d=o.ignoreLocation,p=[],f=0,m=!1;this.chunks.forEach((function(t){var i=t.pattern,r=t.alphabet,o=t.startIndex,g=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.location,o=void 0===r?q.location:r,s=n.distance,a=void 0===s?q.distance:s,l=n.threshold,c=void 0===l?q.threshold:l,h=n.findAllMatches,u=void 0===h?q.findAllMatches:h,d=n.minMatchCharLength,p=void 0===d?q.minMatchCharLength:d,f=n.includeMatches,m=void 0===f?q.includeMatches:f,g=n.ignoreLocation,v=void 0===g?q.ignoreLocation:g;if(t.length>G)throw new Error(j(G));for(var y,b=t.length,w=e.length,k=Math.max(0,Math.min(o,w)),x=c,_=k,S=p>1||m,O=S?Array(w):[];(y=e.indexOf(t,_))>-1;){var C=Y(t,{currentLocation:y,expectedLocation:k,distance:a,ignoreLocation:v});if(x=Math.min(C,x),_=y+b,S)for(var T=0;T<b;)O[y+T]=1,T+=1}_=-1;for(var A=[],P=1,M=b+w,E=1<<b-1,D=0;D<b;D+=1){for(var L=0,R=M;L<R;)Y(t,{errors:D,currentLocation:k+R,expectedLocation:k,distance:a,ignoreLocation:v})<=x?L=R:M=R,R=Math.floor((M-L)/2+L);M=R;var I=Math.max(1,k-R+1),N=u?w:Math.min(k+R,w)+b,z=Array(N+2);z[N+1]=(1<<D)-1;for(var B=N;B>=I;B-=1){var F=B-1,V=i[e.charAt(F)];if(S&&(O[F]=+!!V),z[B]=(z[B+1]<<1|1)&V,D&&(z[B]|=(A[B+1]|A[B])<<1|1|A[B+1]),z[B]&E&&(P=Y(t,{errors:D,currentLocation:F,expectedLocation:k,distance:a,ignoreLocation:v}))<=x){if(x=P,(_=F)<=k)break;I=Math.max(1,2*k-_)}}if(Y(t,{errors:D+1,currentLocation:k,expectedLocation:k,distance:a,ignoreLocation:v})>x)break;A=z}var W={isMatch:_>=0,score:Math.max(.001,P)};if(S){var $=K(O,p);$.length?m&&(W.indices=$):W.isMatch=!1}return W}(e,i,r,{location:s+o,distance:l,threshold:c,findAllMatches:h,minMatchCharLength:u,includeMatches:n,ignoreLocation:d}),v=g.isMatch,y=g.score,b=g.indices;v&&(m=!0),f+=y,v&&b&&(p=[].concat((0,a.Z)(p),(0,a.Z)(b)))}));var g={isMatch:m,score:m?f/this.chunks.length:1};return m&&n&&(g.indices=p),g}}]),e}(),ie=function(){function e(t){(0,c.Z)(this,e),this.pattern=t}return(0,h.Z)(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return ne(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return ne(e,this.singleRegex)}}]),e}();function ne(e,t){var i=e.match(t);return i?i[1]:null}var re=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),i}(ie),oe=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),i}(ie),se=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),i}(ie),ae=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),i}(ie),le=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),i}(ie),ce=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),i}(ie),he=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.location,s=void 0===o?q.location:o,a=r.threshold,l=void 0===a?q.threshold:a,h=r.distance,u=void 0===h?q.distance:h,d=r.includeMatches,p=void 0===d?q.includeMatches:d,f=r.findAllMatches,m=void 0===f?q.findAllMatches:f,g=r.minMatchCharLength,v=void 0===g?q.minMatchCharLength:g,y=r.isCaseSensitive,b=void 0===y?q.isCaseSensitive:y,w=r.ignoreLocation,k=void 0===w?q.ignoreLocation:w;return(0,c.Z)(this,i),(n=t.call(this,e))._bitapSearch=new te(e,{location:s,threshold:l,distance:u,includeMatches:p,findAllMatches:m,minMatchCharLength:v,isCaseSensitive:b,ignoreLocation:k}),n}return(0,h.Z)(i,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),i}(ie),ue=function(e){(0,r.Z)(i,e);var t=d(i);function i(e){return(0,c.Z)(this,i),t.call(this,e)}return(0,h.Z)(i,[{key:"search",value:function(e){for(var t,i=0,n=[],r=this.pattern.length;(t=e.indexOf(this.pattern,i))>-1;)i=t+r,n.push([t,i-1]);var o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),i}(ie),de=[re,ue,se,ae,ce,le,oe,he],pe=de.length,fe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;function me(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var i=e.trim().split(fe).filter((function(e){return e&&!!e.trim()})),n=[],r=0,o=i.length;r<o;r+=1){for(var s=i[r],a=!1,l=-1;!a&&++l<pe;){var c=de[l],h=c.isMultiMatch(s);h&&(n.push(new c(h,t)),a=!0)}if(!a)for(l=-1;++l<pe;){var u=de[l],d=u.isSingleMatch(s);if(d){n.push(new u(d,t));break}}}return n}))}var ge=new Set([he.type,ue.type]),ve=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.isCaseSensitive,r=void 0===n?q.isCaseSensitive:n,o=i.includeMatches,s=void 0===o?q.includeMatches:o,a=i.minMatchCharLength,l=void 0===a?q.minMatchCharLength:a,h=i.ignoreLocation,u=void 0===h?q.ignoreLocation:h,d=i.findAllMatches,p=void 0===d?q.findAllMatches:d,f=i.location,m=void 0===f?q.location:f,g=i.threshold,v=void 0===g?q.threshold:g,y=i.distance,b=void 0===y?q.distance:y;(0,c.Z)(this,e),this.query=null,this.options={isCaseSensitive:r,includeMatches:s,minMatchCharLength:l,findAllMatches:p,ignoreLocation:u,location:m,threshold:v,distance:b},this.pattern=r?t:t.toLowerCase(),this.query=me(this.pattern,this.options)}return(0,h.Z)(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var i=this.options,n=i.includeMatches;e=i.isCaseSensitive?e:e.toLowerCase();for(var r=0,o=[],s=0,l=0,c=t.length;l<c;l+=1){var h=t[l];o.length=0,r=0;for(var u=0,d=h.length;u<d;u+=1){var p=h[u],f=p.search(e),m=f.isMatch,g=f.indices,v=f.score;if(!m){s=0,r=0,o.length=0;break}if(r+=1,s+=v,n){var y=p.constructor.type;ge.has(y)?o=[].concat((0,a.Z)(o),(0,a.Z)(g)):o.push(g)}}if(r){var b={isMatch:!0,score:s/r};return n&&(b.indices=o),b}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),ye=[];function be(e,t){for(var i=0,n=ye.length;i<n;i+=1){var r=ye[i];if(r.condition(e,t))return new r(e,t)}return new te(e,t)}var we="$and",ke="$path",xe="$val",_e=function(e){return!(!e[we]&&!e.$or)},Se=function(e){return!!e[ke]},Oe=function(e){return!E(e)&&R(e)&&!_e(e)},Ce=function(e){return(0,l.Z)({},we,Object.keys(e).map((function(t){return(0,l.Z)({},t,e[t])})))};function Te(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.auto,r=void 0===n||n,o=function e(i){var n=Object.keys(i),o=Se(i);if(!o&&n.length>1&&!_e(i))return e(Ce(i));if(Oe(i)){var s=o?i[ke]:n[0],a=o?i[xe]:i[s];if(!D(a))throw new Error(B(s));var l={keyId:Q(s),pattern:a};return r&&(l.searcher=be(a,t)),l}var c={children:[],operator:n[0]};return n.forEach((function(t){var n=i[t];E(n)&&n.forEach((function(t){c.children.push(e(t))}))})),c};return _e(e)||(e=Ce(e)),o(e)}function Ae(e,t){var i=t.ignoreFieldNorm,n=void 0===i?q.ignoreFieldNorm:i;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var i=e.key,r=e.norm,o=e.score,s=i?i.weight:null;t*=Math.pow(0===o&&s?Number.EPSILON:o,(s||1)*(n?1:r))})),e.score=t}))}function Pe(e,t){var i=e.matches;t.matches=[],I(i)&&i.forEach((function(e){if(I(e.indices)&&e.indices.length){var i={indices:e.indices,value:e.value};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}}))}function Me(e,t){t.score=e.score}function Ee(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=i.includeMatches,r=void 0===n?q.includeMatches:n,o=i.includeScore,s=void 0===o?q.includeScore:o,a=[];return r&&a.push(Pe),s&&a.push(Me),e.map((function(e){var i=e.idx,n={item:t[i],refIndex:i};return a.length&&a.forEach((function(t){t(e,n)})),n}))}var De=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;(0,c.Z)(this,e),this.options=f(f({},q),i),this.options.useExtendedSearch,this._keyStore=new V(this.options.keys),this.setCollection(t,n)}return(0,h.Z)(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof X))throw new Error("Incorrect 'index' type");this._myIndex=t||J(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){I(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],i=0,n=this._docs.length;i<n;i+=1){var r=this._docs[i];e(r,i)&&(this.removeAt(i),i-=1,n-=1,t.push(r))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.limit,n=void 0===i?-1:i,r=this.options,o=r.includeMatches,s=r.includeScore,a=r.shouldSort,l=r.sortFn,c=r.ignoreFieldNorm,h=D(e)?D(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Ae(h,{ignoreFieldNorm:c}),a&&h.sort(l),L(n)&&n>-1&&(h=h.slice(0,n)),Ee(h,this._docs,{includeMatches:o,includeScore:s})}},{key:"_searchStringList",value:function(e){var t=be(e,this.options),i=this._myIndex.records,n=[];return i.forEach((function(e){var i=e.v,r=e.i,o=e.n;if(I(i)){var s=t.searchIn(i),a=s.isMatch,l=s.score,c=s.indices;a&&n.push({item:i,idx:r,matches:[{score:l,value:i,norm:o,indices:c}]})}})),n}},{key:"_searchLogical",value:function(e){var t=this,i=Te(e,this.options),n=function e(i,n,r){if(!i.children){var o=i.keyId,s=i.searcher,l=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(n,o),searcher:s});return l&&l.length?[{idx:r,item:n,matches:l}]:[]}for(var c=[],h=0,u=i.children.length;h<u;h+=1){var d=e(i.children[h],n,r);if(d.length)c.push.apply(c,(0,a.Z)(d));else if(i.operator===we)return[]}return c},r=this._myIndex.records,o={},s=[];return r.forEach((function(e){var t=e.$,r=e.i;if(I(t)){var l=n(i,t,r);l.length&&(o[r]||(o[r]={idx:r,item:t,matches:[]},s.push(o[r])),l.forEach((function(e){var t,i=e.matches;(t=o[r].matches).push.apply(t,(0,a.Z)(i))})))}})),s}},{key:"_searchObjectList",value:function(e){var t=this,i=be(e,this.options),n=this._myIndex,r=n.keys,o=n.records,s=[];return o.forEach((function(e){var n=e.$,o=e.i;if(I(n)){var l=[];r.forEach((function(e,r){l.push.apply(l,(0,a.Z)(t._findMatches({key:e,value:n[r],searcher:i})))})),l.length&&s.push({idx:o,item:n,matches:l})}})),s}},{key:"_findMatches",value:function(e){var t=e.key,i=e.value,n=e.searcher;if(!I(i))return[];var r=[];if(E(i))i.forEach((function(e){var i=e.v,o=e.i,s=e.n;if(I(i)){var a=n.searchIn(i),l=a.isMatch,c=a.score,h=a.indices;l&&r.push({score:c,key:t,value:i,idx:o,norm:s,indices:h})}}));else{var o=i.v,s=i.n,a=n.searchIn(o),l=a.isMatch,c=a.score,h=a.indices;l&&r.push({score:c,key:t,value:o,norm:s,indices:h})}return r}}]),e}();function Le(e){return"string"==typeof e&&e.includes(".m3u8")}function Re(e){for(var t=[];e.parentNode&&"body"!=e.parentNode.nodeName.toLowerCase();)e=e.parentNode,t.push(e);return t}function Ie(e,t,i){var r=document.createElement(e);return A(t)&&function(e,t){var i;null!==(i=e)&&"object"===(0,u.Z)(i)&&1===i.nodeType&&"object"===(0,u.Z)(i.style)&&"object"===(0,u.Z)(i.ownerDocument)&&!M(t)&&Object.entries(t).filter((function(e){var t=(0,n.Z)(e,2)[1];return!T(t)})).forEach((function(t){var i=(0,n.Z)(t,2),r=i[0],o=i[1];return e.setAttribute(r,o)}))}(r,t),P(i)&&(r.innerText=i),r}De.version="6.6.2",De.createIndex=J,De.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.getFn,n=void 0===i?q.getFn:i,r=t.fieldNormWeight,o=void 0===r?q.fieldNormWeight:r,s=e.keys,a=e.records,l=new X({getFn:n,fieldNormWeight:o});return l.setKeys(s),l.setIndexRecords(a),l},De.config=q,De.parseQuery=Te,function(){ye.push.apply(ye,arguments)}(ve);var Ne=function(e){return e?["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((function(t,i){return e[i]&&(t[i]=e[i]),t}),{cues:e.cues&&Array.prototype.map.call(e.cues,(function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}}))}):null};function ze(e,t){var i,n,r,o;if(e&&(null===(i=null==e?void 0:e.media)||void 0===i?void 0:i.textTracks)&&0!==(null===(r=null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.textTracks)||void 0===r?void 0:r.length)){var s,a=e.media.textTracks,l=(null===(o=e.config.preset)||void 0===o?void 0:o.search)||"";if(s=-1===e.captions.currentTrack?function(e){if(e){var t=localStorage.getItem("presto-player-"+e.id+"-cues");return M(t)?"":JSON.parse(t)}}(e):a[e.captions.currentTrack],M(s))return[];var c=Ne(s);return M(c)?[]:function(e,t,i){if(!P(e))return[];if(M(t))return[];if(M(i))return[];var n=function(e,t,i){if(M(t))return[];if(M(i))return[];if(!P(e))return[];var n=Object.assign(Object.assign(Object.assign({},null==i?void 0:i.minMatchCharLength),null==i?void 0:i.threshold),{shouldSort:!1,includeMatches:!0,threshold:.3,keys:["text"]});return null!==t&&t&&0!==t.length?new De(t,n).search(e):[]}(e,t,i);return n&&Array.prototype.map.call(n,(function(e){return{time:Math.ceil(e.item.startTime),label:""}}))}(t,null==c?void 0:c.cues,l)}}function Be(e){var t;if(e&&(null==e?void 0:e.elements)&&(null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.progress)){var i=e.elements.progress.querySelectorAll(".plyr__progress__marker");if(!M(i))for(var n=0;n<i.length;n++)i[n].remove()}}function je(e,t){if(e&&(Be(e),null==t?void 0:t.length)){var i=document.createDocumentFragment(),n=document.createDocumentFragment();t.forEach((function(t){var i=Ie("span",{class:"plyr__progress__marker"},""),r="".concat(t.time/e.duration*100,"%");i.addEventListener("click",(function(){e.currentTime=t.time})),i.style.left=r,n.appendChild(i)})),i.appendChild(n),e.elements.markers={points:n,tip:null},e.elements.progress.appendChild(i)}}function Fe(e){var t,i,n,r,o,s;if((null===(i=null===(t=null==e?void 0:e.config.preset)||void 0===t?void 0:t.search)||void 0===i?void 0:i.enabled)&&(null===(r=null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.textTracks)||void 0===r?void 0:r.length)&&0!==(null===(s=null===(o=null==e?void 0:e.media)||void 0===o?void 0:o.textTracks)||void 0===s?void 0:s.length)&&-1===(null==e?void 0:e.currentTrack)){e.toggleCaptions(!0);var a=setInterval((function(){var t,i=null===(t=e.media.textTracks[0])||void 0===t?void 0:t.cues;(null==i?void 0:i.length)>0&&(function(e){var t,i,n,r,o;if(e&&(null===(t=null==e?void 0:e.media)||void 0===t?void 0:t.textTracks)&&0!==(null===(n=null===(i=null==e?void 0:e.media)||void 0===i?void 0:i.textTracks)||void 0===n?void 0:n.length)){var s=(null===(o=null===(r=null==e?void 0:e.media)||void 0===r?void 0:r.textTracks)||void 0===o?void 0:o[0])?Ne(e.media.textTracks[0]):{};M(s)||localStorage.setItem("presto-player-"+e.id+"-cues",JSON.stringify(s))}}(e),e.toggleCaptions(!1),clearInterval(a))}),200)}}},8116:function(e,t,i){i.d(t,{f:function(){return n}});var n=function(e,t,n){var r=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}({minFontSize:-1/0,maxFontSize:1/0,container:e},n),o=function(e){var n=t||1,o=function(){var t;e.style.fontSize=Math.max(Math.min(((null==r||null===(t=r.container)||void 0===t?void 0:t.clientWidth)||0)/(10*n),parseFloat(r.maxFontSize)),parseFloat(r.minFontSize))+"px"};if(o(),"ResizeObserver"in window==0)var s=i.e(982).then(i.bind(i,4723)).then((function(){window.ResizeObserver=s.ResizeObserver,new ResizeObserver(o).observe(r.container)}));else new ResizeObserver(o).observe(r.container)};if(e.length)for(var s=0;s<e.length;s++)o(e[s]);else o(e);return e}},1786:function(e,t,i){if(i.r(t),i.d(t,{default:function(){return h}}),571!=i.j)var n=i(4942);if(571!=i.j)var r=i(5861);var o=i(1284),s=i.n(o),a=i(2566);function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach((function(t){(0,n.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}i(1368),i(2136);var h=function(e){var t=e.config,i=e.selector,n=e.src,o=e.preload;return new Promise(function(){var e=(0,r.Z)(s().mark((function e(r,l){var h,u,d,p,f,m,g;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.Hls){e.next=6;break}case 1:if(window.hasOwnProperty("Hls")){e.next=6;break}return e.next=4,new Promise((function(e){return setTimeout(e,50)}));case 4:e.next=1;break;case 6:if(!window.Hls.isSupported()){e.next=16;break}return m=!["metadata","none"].includes(o),null!==(h=wp)&&void 0!==h&&h.blocks&&(m=!0),(g=new window.Hls(null===(u=window)||void 0===u||null===(d=u.wp)||void 0===d||null===(p=d.hooks)||void 0===p||null===(f=p.applyFilters)||void 0===f?void 0:f.call(p,"presto.hlsSettings",{autoStartLoad:m,capLevelToPlayerSize:!0}))).loadSource(n),g.on(window.Hls.Events.LEVEL_SWITCHED,(function(e,t){var n=i.closest(".presto-player__wrapper").querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span");g.autoLevelEnabled?n.innerHTML="AUTO (".concat(g.levels[t.level].height,"p)"):n.innerHTML="AUTO"})),g.on(window.Hls.Events.MANIFEST_PARSED,(function(e,n){var o=g.levels.map((function(e){return e.height}));o.unshift(0);var s=(o||[]).findIndex((function(e){var t,i;return e===parseInt(null===(t=window)||void 0===t||null===(i=t.prestoPlayer)||void 0===i?void 0:i.hls_start_level)}));g.startLevel=s?s-1:2,t.quality={default:0,options:o,forced:!0,onChange:function(e){0===e?prestoHLS.currentLevel=-1:prestoHLS.levels.forEach((function(t,i){t.height===e&&(console.log("Found quality match with "+e),prestoHLS.currentLevel=i)}))}},g.attachMedia(i),window.prestoHLS=g;var l=new a.P(i,c({},t));return l.hls=g,l.on("waiting",(function e(){g.startLoad(-1),l.off("waiting",e)})),l.on("languagechange",(function(){setTimeout((function(){return g.subtitleTrack=l.currentTrack}),50)})),r(l)})),e.abrupt("return");case 16:if(!i.canPlayType("application/vnd.apple.mpegurl")){e.next=18;break}return e.abrupt("return",r(new a.P(i,c({},t))));case 18:return e.abrupt("return",r(new a.P(i,c({},t))));case 19:case"end":return e.stop()}}),e)})));return function(_x,t){return e.apply(this,arguments)}}())}},7727:function(e,t,i){i.r(t),i.d(t,{default:function(){return r}});var n=i(2566),r=(i(1368),i(2136),function(e){var t,i,r,o,s,a,l,c,h,u;"undefined"!=typeof learndash_video_data&&"presto"===(null===(t=learndash_video_data)||void 0===t?void 0:t.videos_found_provider)&&((0,n.r)(e,!0),window.learndash_video_data.videos_auto_complete="on"===(null===(i=prestoPlayer)||void 0===i||null===(r=i.learndash)||void 0===r?void 0:r.lesson_video_auto_complete),window.learndash_video_data.videos_hide_complete_button="AFTER"===(null===(o=learndash_video_data)||void 0===o?void 0:o.videos_shown)&&"on"===(null===(s=prestoPlayer)||void 0===s||null===(a=s.learndash)||void 0===a?void 0:a.lesson_video_hide_complete_button),window.learndash_video_data.videos_auto_complete_delay=null===(l=prestoPlayer)||void 0===l||null===(c=l.learndash)||void 0===c?void 0:c.lesson_video_auto_complete_delay,window.learndash_video_data.videos_auto_complete_delay_message=null===(h=prestoPlayer)||void 0===h||null===(u=h.learndash)||void 0===u?void 0:u.videos_auto_complete_delay_message,window.learndash_video_data.video_track_path="/",jQuery((function(){"1"===learndash_video_data.video_debug&&console.log("PRESTO: init"),document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="'+learndash_video_data.videos_found_provider+'"]').length&&("1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(true)"),LearnDash_disable_assets(!0),LearnDash_watchPlayers(),document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="'+learndash_video_data.videos_found_provider+'"]').forEach((function(e,t){console.log({element:e});var i="presto-player__wrapper-player-"+t,n=e.getAttribute("id");void 0!==n&&""!=n||(n=i,e.setAttribute("id",n)),ld_video_players[i]={},ld_video_players[i].player_key=i,ld_video_players[i].player_type=learndash_video_data.videos_found_provider,ld_video_players[i].player_id=n,ld_video_players[i].player_wrapper=e.closest("presto-player"),void 0!==ld_video_players[i].player_wrapper?ld_video_players[i].player_cookie_key=ld_video_players[i].player_wrapper.getAttribute("data-video-cookie-key"):ld_video_players[i].player_cookie_key="",ld_video_players[i].player_cookie_values=LearnDash_Video_Progress_initSettings(ld_video_players[i]),"complete"===LearnDash_Video_Progress_getSetting(ld_video_players[i],"video_state")?(LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd()):(wp.hooks.addAction("presto.playerTimeUpdate","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is playing"),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_duration",e.duration),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_time",e.currentTime),e.duration&&e.duration===e.currentTime&&(LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_state","complete"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(false)"),LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd())})),wp.hooks.addAction("presto.playerPlaying","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is playing"),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_duration",e.duration),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_time",e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_state","play")})),wp.hooks.addAction("presto.playerPause","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is paused"),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_time",e.currentTime),console.log(e.duration),console.log(e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_state","pause")})),wp.hooks.addAction("presto.playerEnded","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: video ended"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: setting 'video_state' to 'complete'"),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_time",e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[i],"video_state","complete"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(false)"),LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd()})))})))})))})},9097:function(e,t,i){i.r(t),i.d(t,{default:function(){return h},onEndedVideo:function(){return c},onPauseVideo:function(){return a},onPlayingVideo:function(){return l}});var n=function(e){e.preventDefault()};function r(e){var t=jQuery(".llms-complete-lesson-form"),i=jQuery('.llms-complete-lesson-form button[type="submit"]'),r=jQuery("#llms_start_quiz, #llms-start-assignment");!0===e?(t.off("submit",n),i.removeAttr("disabled"),r.removeClass("llms-av-disabled").off("click",n)):(t.on("submit",n),i.attr("disabled","disabled"),r.addClass("llms-av-disabled").on("click",n))}var o=function(e){return{ts:e.currentTime,duration:e.duration,url:e.source,provider:e.provider,id:e.config.id}},s=function(e,t){llms.tracking.addEvent("video."+e,{meta:t})};var a=function(e){var t=e.detail.plyr,i=o(t);s("paused",i)},l=function(e){var t=e.detail.plyr,i=o(t),n=i.ts<1?"started":"played";s(n,i)},c=function(e,t,i){var n=e.detail.plyr,a=o(n);s("ended",a),function(e,t){LLMS.Ajax.call({data:{action:"llms_av_video_ended",id:t.post_id,nonce:t.nonce},beforeSend:function(){LLMS.Spinner.start(e)},error:function(t,i,n){LLMS.Spinner.stop(e),console.error(t.responseText+" ("+n+" "+i+")"),console.log(t)},success:function(t){LLMS.Spinner.stop(e),null!=t&&t.html&&(e.append(t.html),function(e){var t,i=e.find(".llms-av-pv--seconds");setInterval((function(){1==(t=1*i.text()-1)&&i.closest("a")[0].click(),t>=0&&i.text(t)}),1e3)}(e))}})}(t,i),r(!0)};function h(e){var t,i,n={},o=(null===(t=llms)||void 0===t||null===(i=t.tracking)||void 0===i?void 0:i.getSettings())||null;null!=o&&o.av&&(n=o.av),n.require_video_completion&&!n.video_completed&&r(!1);var s=jQuery(".presto-block-video");e.on("pause",a),e.on("playing",l),e.on("ended",(function(e){return c(e,s,n)}))}},578:function(e,t,i){i.r(t),i.d(t,{presto_action_bar_ui:function(){return s},presto_youtube_subscribe_button:function(){return a}});var n=i(5671),r=i(3144),o=i(1368),s=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.open=void 0}return(0,r.Z)(e,[{key:"render",value:function(){return(0,o.h)("div",{key:"b45af8959832ecc2f240622497174cd70f17015d",class:{bar:!0,"bar--open":this.open}},(0,o.h)("span",{key:"96010998372b90e5afba2316b9b71b3efb0e7502",part:"content",class:"bar__content"},(0,o.h)("slot",{key:"c166254469403bf9b24479697f11fda494246dcb"})),(0,o.h)("span",{key:"94a877081d27b5b19dd68419ca1b0694ef25053c",part:"button",class:"bar__button"},(0,o.h)("slot",{key:"de591a41e84782ef5b9dcdc06c5ee06e22e1b024",name:"button"})))}}]),e}();s.style=":host{display:block;overflow:hidden}.bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;background:var(--presto-action-bar-background, #1d1d1d);color:#fff;padding:0 var(--presto-action-bar-padding, 6px);line-height:1em;font-size:16px;margin-top:-100%;transition:margin var(--presto-action-bar-animation-speed, 0.5s) ease-in-out;transform:translate3d(0);border-radius:0px 0px var(--presto-player-border-radius) var(--presto-player-border-radius)}.bar.bar--open{margin-top:0}.bar__button{margin:var(--presto-action-bar-padding, 6px);display:flex;align-items:center}.bar__content{margin:var(--presto-action-bar-padding, 6px);width:100%;text-align:center}@media screen and (min-width: 480px){.bar__content{width:auto}}";var a=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.channel=void 0,this.layout="default",this.showCount=void 0}return(0,r.Z)(e,[{key:"waitForApi",value:function(e){var t=setInterval((function(){var i;(null===(i=null===window||void 0===window?void 0:window.gapi)||void 0===i?void 0:i.ytsubscribe)&&(clearInterval(t),e())}),50)}},{key:"componentDidLoad",value:function(){var e=this,t=document.createElement("script");t.type="text/javascript",t.async=!1,t.src="https://apis.google.com/js/platform.js";var i=document.getElementsByTagName("script")[0];i&&i.parentNode.insertBefore(t,i),this.waitForApi((function(){window.gapi.ytsubscribe.render(e.textInput,{channelId:e.channel,layout:e.layout,count:e.showCount?"default":"hidden"})}))}},{key:"render",value:function(){var e=this;return(0,o.h)("div",{key:"5891adca82eb9dfda8db90ca5b11dac0cfdc58ed",class:"g-ytsubscribe",ref:function(t){return e.textInput=t}})}}]),e}();a.style=":host{display:block}"},2626:function(e,t,i){i.r(t),i.d(t,{presto_action_bar:function(){return g},presto_action_bar_controller:function(){return v},presto_audio:function(){return y},presto_bunny:function(){return b},presto_business_skin:function(){return w},presto_cta_overlay:function(){return k},presto_cta_overlay_controller:function(){return x},presto_dynamic_overlay_ui:function(){return _},presto_dynamic_overlays:function(){return S},presto_email_overlay:function(){return O},presto_email_overlay_controller:function(){return C},presto_modern_skin:function(){return T},presto_muted_overlay:function(){return A},presto_search_bar:function(){return P},presto_stacked_skin:function(){return M},presto_vimeo:function(){return E},presto_youtube:function(){return D}});var n=i(1002),r=i(136),o=i(9611),s=i(5861),a=i(4942),l=i(5671),c=i(3144),h=i(1284),u=i.n(h),d=i(1368),p=i(2136),f=i(8116);function m(){m=function(e,t){return new i(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function i(e,n,r){var s=new RegExp(e,n);return t.set(s,r||t.get(e)),(0,o.Z)(s,i.prototype)}function s(e,i){var n=t.get(i);return Object.keys(n).reduce((function(t,i){var r=n[i];if("number"==typeof r)t[i]=e[r];else{for(var o=0;void 0===e[r[o]]&&o+1<r.length;)o++;t[i]=e[r[o]]}return t}),Object.create(null))}return(0,r.Z)(i,RegExp),i.prototype.exec=function(t){var i=e.exec.call(this,t);if(i){i.groups=s(i,this);var n=i.indices;n&&(n.groups=s(n,this))}return i},i.prototype[Symbol.replace]=function(i,r){if("string"==typeof r){var o=t.get(this);return e[Symbol.replace].call(this,i,r.replace(/\$<([^>]+)>/g,(function(e,t){var i=o[t];return"$"+(Array.isArray(i)?i.join("$"):i)})))}if("function"==typeof r){var a=this;return e[Symbol.replace].call(this,i,(function(){var e=arguments;return"object"!=(0,n.Z)(e[e.length-1])&&(e=[].slice.call(e)).push(s(e,a)),r.apply(this,e)}))}return e[Symbol.replace].call(this,i,r)},m.apply(this,arguments)}var g=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.player=void 0,this.config=void 0,this.direction=void 0,this.youtube=void 0,this.currentTime=void 0,this.duration=void 0,this.ended=void 0}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){var e=this;this.player&&(this.player.on("ended",(function(){return e.setEnded()})),this.player.on("timeupdate",(function(t){return e.setCurrentTime(t)})))}},{key:"setEnded",value:function(){this.ended=!0}},{key:"setCurrentTime",value:function(e){var t,i;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.plyr.duration}},{key:"disconnectedCallback",value:function(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}},{key:"render",value:function(){return(0,d.h)("presto-action-bar-controller",{key:"68bb051b0412e81363952dffec787ffceeff0899",ended:this.ended,config:this.config,currentTime:this.currentTime,duration:this.duration,direction:this.direction,youtube:this.youtube})}},{key:"el",get:function(){return(0,d.g)(this)}}]),e}();g.style=":host{display:block}";var v=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.actionBarStateChange=(0,d.c)(this,"actionBarStateChange",7),this.ended=void 0,this.config=void 0,this.currentTime=void 0,this.duration=void 0,this.direction=void 0,this.youtube=void 0,this.show=!1,this.youtubeRenderKey=1,this.percentagePassed=0}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){this.handleDuration()}},{key:"handleDuration",value:function(){this.handleTime()}},{key:"handleEnded",value:function(e){var t;if(e){if(100!==(null===(t=null==this?void 0:this.config)||void 0===t?void 0:t.percentage_start))return;this.show=!0}}},{key:"handlePercentagePassed",value:function(){this.percentagePassed=this.currentTime/this.duration*100}},{key:"handleTime",value:function(){this.checkTime()}},{key:"checkTime",value:function(){var e,t;(null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.blocks)?this.show=!0:this.show=(0,p.t)({current:this.currentTime,duration:this.duration,showAfter:null===(t=this.config)||void 0===t?void 0:t.percentage_start})}},{key:"handleButtonCountChange",value:function(e,t){(null==e?void 0:e.button_count)!==(null==t?void 0:t.button_count)&&this.youtubeRenderKey++,(null==e?void 0:e.enabled)&&this.handleDuration()}},{key:"youtubeButton",value:function(){var e,t,i,n;if("youtube"===(null===(e=this.config)||void 0===e?void 0:e.button_type)&&(null===(t=this.youtube)||void 0===t?void 0:t.channelId))return(0,d.h)("presto-youtube-subscribe-button",{key:this.youtubeRenderKey,channel:null===(i=this.youtube)||void 0===i?void 0:i.channelId,showCount:null===(n=this.config)||void 0===n?void 0:n.button_count})}},{key:"customButton",value:function(){var e,t,i,n,r,o,s,a,l,c,h;if("custom"===(null===(e=this.config)||void 0===e?void 0:e.button_type))return(0,d.h)("presto-player-button",{type:"primary",size:"small",href:null===(i=null===(t=this.config)||void 0===t?void 0:t.button_link)||void 0===i?void 0:i.url,target:(null===(r=null===(n=this.config)||void 0===n?void 0:n.button_link)||void 0===r?void 0:r.opensInNewTab)?"_blank":"_self",style:Object.assign(Object.assign({"--presto-player-button-border-radius":"".concat(null===(o=this.config)||void 0===o?void 0:o.button_radius,"px")},(null===(s=this.config)||void 0===s?void 0:s.button_color)?{"--presto-player-button-color":"".concat(null===(a=this.config)||void 0===a?void 0:a.button_color)}:{}),(null===(l=this.config)||void 0===l?void 0:l.button_text_color)?{"--presto-player-button-text":"".concat(null===(c=this.config)||void 0===c?void 0:c.button_text_color)}:{})},null===(h=this.config)||void 0===h?void 0:h.button_text)}},{key:"handleCtaStateChange",value:function(e){this.actionBarStateChange.emit(e)}},{key:"render",value:function(){var e,t;return(0,d.h)("presto-action-bar-ui",{key:"843046d7ae74eb23df6f6bafa018987c12f61df7",open:this.show,style:{"--presto-action-bar-background":(null===(e=this.config)||void 0===e?void 0:e.background_color)||"#1d1d1d"}},null===(t=this.config)||void 0===t?void 0:t.text,(0,d.h)("div",{key:"3dd88ff01aeb1df74303758c5b640d29e48fe1a2",slot:"button"},this.youtubeButton(),this.customButton()))}},{key:"el",get:function(){return(0,d.g)(this)}}],[{key:"watchers",get:function(){return{duration:["handleDuration","handlePercentagePassed"],ended:["handleEnded"],currentTime:["handlePercentagePassed","handleTime"],config:["handleButtonCountChange"],show:["handleCtaStateChange"]}}}]),e}();v.style=":host{display:block}";var y=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.playVideo=(0,d.c)(this,"playVideo",7),this.pauseVideo=(0,d.c)(this,"pauseVideo",7),this.getRef=void 0,this.autoplay=void 0,this.src=void 0,this.preload=void 0,this.poster=void 0,this.player=void 0,this.preset=void 0,this.tracks=void 0,this.provider=void 0,this.mediaTitle=void 0,this.audioAttributes=void 0,this.width=void 0}return(0,c.Z)(e,[{key:"renderPosterImage",value:function(){if(this.poster)return(0,d.h)("div",{class:"presto-audio__poster"},(0,d.h)("img",{src:this.poster}))}},{key:"hasPosterArea",value:function(){var e;return!!this.poster||!!(null===(e=this.preset)||void 0===e?void 0:e["play-large"])}},{key:"renderMobilePoster",value:function(){var e;return(0,d.h)("div",{class:"presto-audio__poster-wrapper-mobile"},!!(null===(e=this.preset)||void 0===e?void 0:e["play-large"])&&this.renderLargePlay("presto-audio__large-play-button is-relative"),(0,d.h)("div",{class:"presto-audio__mobile-title"},this.mediaTitle))}},{key:"renderLargePlay",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"presto-audio__large-play-button";return(0,d.h)("div",{class:t,onClick:function(){e.player.playing?e.pauseVideo.emit():e.playVideo.emit()}},(0,d.h)("svg",{class:"presto-audio__icon-play",width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,d.h)("path",{d:"M15.5588 9.00005L0.117662 17.915L0.117662 0.0850823L15.5588 9.00005Z"})),(0,d.h)("svg",{class:"presto-audio__icon-pause",width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,d.h)("rect",{width:"5",height:"17"}),(0,d.h)("rect",{x:"12",width:"5",height:"17"})))}},{key:"componentDidLoad",value:function(){var e=this;"ResizeObserver"in window&&new ResizeObserver((function(t){t.forEach((function(t){return e.width=t.contentRect.width}))})).observe(this.el)}},{key:"render",value:function(){var e,t,i,n,r,o=this;return(0,d.h)("div",{key:"b9d4dc94569cc875faa3ca027f261435c5f16176",ref:function(e){return o.el=e},class:{"presto-audio__wrapper":!0,"has-poster":!!this.poster,"has-play-large":!!(null===(e=this.preset)||void 0===e?void 0:e["play-large"]),"is-playing":null===(t=this.player)||void 0===t?void 0:t.playing,"has-light-background":"light"===(0,p.l)(null===(i=this.preset)||void 0===i?void 0:i.background_color),"has-dark-background":"dark"===(0,p.l)(null===(n=this.preset)||void 0===n?void 0:n.background_color),"breakpoint-small":this.width<520,"skin-stacked":this.width<520,"breakpoint-large":this.width>=520}},this.hasPosterArea()&&(0,d.h)("div",{key:"c44d629e4005fefe173117449ca46fd38d668f37",class:"presto-audio__poster-wrapper"},!!(null===(r=this.preset)||void 0===r?void 0:r["play-large"])&&(0,d.h)("div",{key:"d5e7bcf6adaf2d1682a637a51a7e5927dfdfeba5",class:"presto-audio__large-play-wrapper"},this.renderLargePlay()),this.renderPosterImage()),this.hasPosterArea()&&this.renderMobilePoster(),(0,d.h)("div",{key:"8cd1d93e0847b492b9bd4bfbcc6f79489531f64a",class:"presto-audio__controls-wrapper"},(0,d.h)("div",{key:"c20d37014383c5a7897d504168697043a5e52385",class:"presto-audio__title"},this.mediaTitle),(0,d.h)("audio",Object.assign({key:"c17bc3d36bcda183e46e8a0a1c44a4c5ce35a4df",part:"audio-player",ref:this.getRef,autoplay:this.autoplay,preload:this.preload,"data-poster":this.poster},this.audioAttributes),(0,d.h)("source",{key:"9d69389fe7894d6f6823d55ce0a433c9d0d39952",src:this.src}),!!this.tracks&&!!this.tracks.length&&this.tracks.map((function(e){return(0,d.h)("track",{kind:"captions",label:(null==e?void 0:e.label)?e.label:"Captions",src:null==e?void 0:e.src,srclang:(null==e?void 0:e.srcLang)?null==e?void 0:e.srcLang:"en"})})))))}}]),e}();y.style=":host{display:block}.presto-audio__wrapper{border-radius:var(--presto-player-border-radius, 0px)}.presto-audio__wrapper .plyr--audio .plyr__controls{padding:0}.presto-audio__wrapper .plyr--audio .plyr__control.plyr__tab-focus,.presto-audio__wrapper .plyr--audio .plyr__control:hover,.presto-audio__wrapper .plyr--audio .plyr__control[aria-expanded=true]{background:var(--plyr-audio-controls-background);color:var(--plyr-audio-control-color)}.presto-audio__wrapper{display:flex;background:var(--plyr-audio-controls-background, #fff)}.presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 2);flex:1;display:flex;flex-direction:column;justify-content:center;min-width:0}.has-poster .presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 3)}.has-play-large:not(.has-poster) .presto-audio__controls-wrapper{padding-left:0}.presto-audio__title,.presto-audio__mobile-title{font-size:18px;font-weight:500;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--plyr-audio-control-color)}.presto-audio__title{margin:calc(var(--plyr-control-spacing, 10px) / 2);margin-top:0;text-wrap:wrap}.presto-audio__poster-wrapper{position:relative;width:100px;min-height:100px;flex:0 0 100px}.presto-audio__poster-wrapper img{border-radius:var(--presto-player-border-radius, 0px) 0 0 var(--presto-player-border-radius, 0px);width:100%;height:100%;object-fit:cover;aspect-ratio:1;display:block}.has-poster .presto-audio__poster-wrapper{width:140px;height:140px;flex:0 0 140px}.presto-audio__poster{width:100%;height:100%}.presto-audio__large-play-button{user-select:none;cursor:pointer;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%, -50%);width:50px;height:50px;color:white;border-radius:100%;background:var(--plyr-audio-control-color);color:var(--plyr-audio-controls-background)}.presto-audio__large-play-button.is-relative{position:relative;top:auto;left:auto;transform:none}.has-light-background.has-poster .presto-audio__large-play-button{background:var(--plyr-audio-controls-background);color:var(--plyr-audio-control-color)}.has-dark-background.has-poster .presto-audio__large-play-button{background:var(--plyr-audio-control-color);color:var(--plyr-audio-controls-background)}.presto-audio__icon-play,.presto-audio__icon-pause{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);fill:currentColor;display:block;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;margin:0 auto;text-align:center}.presto-audio__icon-pause{opacity:0;visibility:hidden}.presto-audio__wrapper.is-playing .presto-audio__icon-pause{opacity:1;visibility:visible}.presto-audio__icon-play{margin-left:2px;opacity:1;visibility:visible}.presto-audio__wrapper.is-playing .presto-audio__icon-play{opacity:0;visibility:hidden}.presto-audio__poster-wrapper-mobile{display:none;min-width:0}.presto-audio__poster-wrapper-mobile .presto-audio__large-play-button{flex:0 0 50px}.presto-audio__wrapper.breakpoint-small{flex-direction:column}.presto-audio__wrapper.breakpoint-small .presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 2)}.presto-audio__wrapper.breakpoint-small.has-poster .presto-audio__title{text-align:center;margin:calc(var(--plyr-control-spacing, 10px) * 1.5)}.presto-audio__wrapper.breakpoint-small.has-poster .presto-audio__poster-wrapper{margin:30px auto auto auto;overflow:hidden;border-radius:var(--presto-player-border-radius, 0px);width:225px;height:225px;flex:0 0 225px}.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__poster-wrapper,.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__title{display:none}.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__poster-wrapper-mobile{display:flex;align-items:center;gap:1em;margin-bottom:calc(var(--plyr-control-spacing, 10px) * -1);padding:calc(var(--plyr-control-spacing, 10px) * 2) calc(var(--plyr-control-spacing, 10px) * 2) 0 calc(var(--plyr-control-spacing, 10px) * 2)}.skin-stacked.presto-sticky-audio .presto-audio__wrapper{height:115px}.skin-stacked.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:20px}.skin-stacked.presto-sticky-audio .has-poster .presto-audio__poster-wrapper{width:115px;height:115px;flex:0 0 115px}.presto-sticky-audio .presto-audio__wrapper{height:100px}.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:20px}.presto-sticky-audio .has-poster .presto-audio__poster-wrapper{width:100px;height:100px;flex:0 0 100px}.action-bar-active .presto-audio__wrapper{border-radius:var(--presto-player-border-radius) var(--presto-player-border-radius) 0px 0px}@media screen and (max-width: 782px){.presto-sticky-audio .presto-audio__poster-wrapper-mobile{display:flex;align-items:center;gap:1em;margin-bottom:calc(var(--plyr-control-spacing, 10px) * -1);padding:calc(var(--plyr-control-spacing, 10px) * 2) calc(var(--plyr-control-spacing, 10px) * 2) 0 calc(var(--plyr-control-spacing, 10px) * 2)}.presto-sticky-audio .presto-audio__poster-wrapper,.presto-sticky-audio .presto-audio__title{display:none}.presto-sticky-audio .presto-audio__wrapper{height:140px}.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:0px}.presto-sticky-audio .presto-audio__poster-wrapper-mobile .presto-audio__large-play-button{flex:0 0 40px;height:40px}}";var b=571!=i.j?function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.getRef=void 0,this.autoplay=void 0,this.src=void 0,this.preload=void 0,this.poster=void 0,this.player=void 0,this.tracks=void 0,this.playsinline=void 0,this.provider=void 0,this.thumbnail=void 0,this.previewUrl=void 0,this.videoAttributes=void 0}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){this.poster=this.poster||this.thumbnail}},{key:"render",value:function(){return(0,d.h)("presto-video",{key:"082574ecb3f6ba1e4de1adfa13483c49acb20aff",getRef:this.getRef,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes})}}]),e}():null,w=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t)}return(0,c.Z)(e,[{key:"render",value:function(){return(0,d.h)(d.H,{key:"43b7781a757d117be4457ee9fec35756fe48d025"},(0,d.h)("slot",{key:"39cd2e2e479e5959ba8980ba74c72faa006ed867"}))}}]),e}();w.style='.skin-business.presto-player__wrapper.rewind-inactive .plyr__controls .plyr__controls__item:nth-child(2)::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 16px) * -4))}.skin-business.presto-player__wrapper .presto-player-progress__marker{border-radius:0;width:15px;height:15px;border-width:1px}.skin-business.presto-player__wrapper .plyr__control[data-plyr]:hover:not([role*=menuitem]):not(.plyr__control--back),.skin-business.presto-player__wrapper .plyr__control[data-plyr]:focus:not([role*=menuitem]):not(.plyr__control--back),.skin-business.presto-player__wrapper .plyr__control[data-plyr]:active:not([role*=menuitem]):not(.plyr__control--back){background-color:transparent;color:var(--plyr-color-main)}.skin-business.presto-player__wrapper .plyr__control[data-plyr]:hover:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play],.skin-business.presto-player__wrapper .plyr__control[data-plyr]:focus:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play],.skin-business.presto-player__wrapper .plyr__control[data-plyr]:active:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play]{background-color:var(--plyr-color-main);color:white}.skin-business.presto-player__wrapper .plyr__control--overlaid[data-plyr=play]{border-radius:4px;background:#000000;opacity:75%}.skin-business.presto-player__wrapper .plyr__control--overlaid[data-plyr=play]:hover{background-color:var(--plyr-color-main);color:white;opacity:100%}.skin-business.presto-player__wrapper .plyr__volume input[type=range]{cursor:pointer}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fast-forward]{border-radius:0px}.skin-business.presto-player__wrapper .plyr__progress{margin:0px 20px 0 5px}.skin-business.presto-player__wrapper .plyr__progress input[type=range]{height:32px;border-radius:0px;cursor:pointer}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker):first-child::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker):last-child::before{border-radius:0px var(--plyr-control-radius, 3px) var(--plyr-control-radius, 3px) 0px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__control[data-plyr=play]{order:-1;margin-right:5px;padding:11px 20px 11px 20px;top:-4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__control[data-plyr=play]::before{border-radius:4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=rewind]::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not([data-plyr=play]){margin:0}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen]{padding:4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{height:24px;width:24px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker){position:relative}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker).plyr__time{height:32px;padding-top:4.5px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker)::before{content:"";background:#000000;position:absolute;top:0px;left:0;right:0;bottom:0px;opacity:0.76;z-index:-1}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-runnable-track{box-shadow:none;color:var(--plyr-color-main);height:9px;outline:1px solid rgba(135, 135, 135, 0.6509803922);outline-offset:2px;border-radius:0px}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb{visibility:hidden}.skin-business.presto-player__wrapper .plyr__progress__buffer::-webkit-progress-value{position:relative;border-radius:0px;height:9px;top:-2px}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background-color:transparent}@media screen and (max-width: 480px){.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__time{padding:1.5%}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=play]{padding:8px;top:0px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{width:22px}}';var k=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.player=void 0,this.direction=void 0,this.preset=void 0,this.i18n=void 0,this.provider=void 0,this.currentTime=void 0,this.duration=void 0,this.ended=void 0}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){var e=this;this.player&&(this.player.on("ended",(function(){return e.setEnded()})),this.player.on("timeupdate",(function(t){return e.setCurrentTime(t)})))}},{key:"setEnded",value:function(){this.ended=!0}},{key:"setCurrentTime",value:function(e){var t,i;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.plyr.duration}},{key:"disconnectedCallback",value:function(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}},{key:"render",value:function(){var e;return(0,d.h)("presto-cta-overlay-controller",{key:"8ee64dc818a0256e6674c9c2b0f33916374c89fa",ended:this.ended,currentTime:this.currentTime,duration:this.duration,direction:this.direction,cta:null===(e=this.preset)||void 0===e?void 0:e.cta,i18n:this.i18n,provider:this.provider})}}]),e}();k.style=":host{display:block}";var x=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.playVideo=(0,d.c)(this,"playVideo",7),this.pauseVideo=(0,d.c)(this,"pauseVideo",7),this.restartVideo=(0,d.c)(this,"restartVideo",7),this.ctaStateChange=(0,d.c)(this,"ctaStateChange",7),this.ended=void 0,this.currentTime=void 0,this.duration=void 0,this.direction=void 0,this.cta=void 0,this.i18n=void 0,this.provider=void 0,this.enabled=void 0,this.show=void 0,this.loading=void 0,this.error=void 0,this.skipped=void 0,this.percentagePassed=0}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){this.handleDuration()}},{key:"handleEnded",value:function(e){var t;if(e){if(100!==(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.percentage))return;this.show=!0}}},{key:"handleDuration",value:function(){var e;this.enabled=!this.skipped&&(null===(e=null==this?void 0:this.cta)||void 0===e?void 0:e.enabled),this.handleTime()}},{key:"handlePercentagePassed",value:function(){this.percentagePassed=this.currentTime/this.duration*100}},{key:"handleEnabled",value:function(){this.show&&(this.skipped||this.pauseVideo.emit(!0))}},{key:"handleTime",value:function(){var e;this.enabled&&(this.skipped||100!==(null===(e=null==this?void 0:this.cta)||void 0===e?void 0:e.percentage)&&this.checkTime())}},{key:"checkTime",value:function(){var e;this.show=(0,p.t)({current:this.currentTime,duration:this.duration,showAfter:(null===(e=null==this?void 0:this.cta)||void 0===e?void 0:e.percentage)||0})}},{key:"skip",value:function(){this.skipped=!0,this.show=!1,this.playVideo.emit()}},{key:"rewatch",value:function(){this.ended=!1,this.show=!1,this.restartVideo.emit()}},{key:"handleCtaStateChange",value:function(e){this.ctaStateChange.emit(e)}},{key:"render",value:function(){var e,t,i,n,r,o,s,a,l,c,h,u,p,f,m=this;if(this.show)return(0,d.h)("presto-cta-overlay-ui",{style:Object.assign(Object.assign(Object.assign({"--presto-player-button-border-radius":"".concat(null===(e=null==this?void 0:this.cta)||void 0===e?void 0:e.button_radius,"px")},(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.background_opacity)?{"--presto-player-cta-background-opacity":"".concat((null===(i=null==this?void 0:this.cta)||void 0===i?void 0:i.background_opacity)/100)}:{}),(null===(n=null==this?void 0:this.cta)||void 0===n?void 0:n.button_color)?{"--presto-player-button-color":"".concat(null===(r=null==this?void 0:this.cta)||void 0===r?void 0:r.button_color)}:{}),(null===(o=null==this?void 0:this.cta)||void 0===o?void 0:o.button_text_color)?{"--presto-player-button-text":"".concat(null===(s=null==this?void 0:this.cta)||void 0===s?void 0:s.button_text_color)}:{}),direction:this.direction,class:"cta-overlay",i18n:this.i18n,headline:null===(a=null==this?void 0:this.cta)||void 0===a?void 0:a.headline,"bottom-text":null===(l=null==this?void 0:this.cta)||void 0===l?void 0:l.bottom_text,"show-button":null===(c=null==this?void 0:this.cta)||void 0===c?void 0:c.show_button,buttonLink:null===(h=null==this?void 0:this.cta)||void 0===h?void 0:h.button_link,allowSkip:!this.ended&&(null===(u=null==this?void 0:this.cta)||void 0===u?void 0:u.show_skip),allowRewatch:this.ended&&(null===(p=null==this?void 0:this.cta)||void 0===p?void 0:p.show_rewatch),"button-text":null===(f=null==this?void 0:this.cta)||void 0===f?void 0:f.button_text,onSkip:function(){return m.skip()},onRewatch:function(){return m.rewatch()},provider:this.provider})}}],[{key:"watchers",get:function(){return{ended:["handleEnded"],duration:["handleDuration","handlePercentagePassed"],currentTime:["handlePercentagePassed","handleEnabled","handleTime"],show:["handleCtaStateChange"]}}}]),e}();x.style=":host{display:block}";var _=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.href=void 0,this.target=void 0,this.position="top-right"}return(0,c.Z)(e,[{key:"closestElement",value:function(e,t){return t&&t!=document&&t!=window&&t.closest(e)||t&&this.closestElement(e,t.getRootNode().host)}},{key:"componentDidLoad",value:function(){var e=this.closestElement("presto-player",this.el);(0,f.f)(this.text,3,{maxFontSize:16,minFontSize:10,container:e})}},{key:"render",value:function(){var e=this,t=this.href?"a":"span";return(0,d.h)(t,{key:"aba93930fd5449cfccd632ecd9983841c5333d9f",class:{"overlay-text":!0,"overlay--top-left":"top-left"===this.position,"overlay--top-right":"top-right"===this.position},href:this.href,target:this.target,part:"overlay-text",ref:function(t){return e.text=t}},(0,d.h)("slot",{key:"be2b2aa9b5c71e613ccef9e62f828451964649fe"}))}},{key:"el",get:function(){return(0,d.g)(this)}}]),e}();_.style=":host{display:block}.overlay-text{text-decoration:none;display:inline-block;user-select:none;line-height:1;opacity:var(--presto-dynamic-overlay-opacity, 1);font-size:var(--presto-dynamic-overlay-font-size, 18px);padding:var(--presto-dynamic-overlay-padding, 0.65em 0.85em);font-weight:var(--presto-dynamic-overlay-font-weight, 500);border-radius:var(--presto-dynamic-overlay-radius, 0.25em);background:var(--presto-dynamic-overlay-background, rgba(0, 0, 0, 0.8));color:var(--presto-dynamic-overlay-color, #fff);opacity:var(--presto-dynamic-overlay-opacity, 1);word-break:break-word}a.overlay-text{cursor:pointer}";var S=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.reloadComponent=(0,d.c)(this,"reloadComponent",7),this.watermarkRef={left:null,right:null},this.refs={},this.overlays=void 0,this.player=void 0,this.preset=void 0,this.enabled=void 0,this.currentTime=void 0,this.destroy=!1}return(0,c.Z)(e,[{key:"componentDidLoad",value:function(){var e=this;this.player&&this.player.on("timeupdate",(function(t){e.currentTime=t.detail.plyr.currentTime,e.checkValidity()}))}},{key:"checkValidity",value:function(){var e,t,i,n,r,o,s,a,l,c,h=this;this.player.playing&&((null===(e=null==this?void 0:this.overlays)||void 0===e?void 0:e.length)||(null===(i=null===(t=this.preset)||void 0===t?void 0:t.watermark)||void 0===i?void 0:i.enabled))&&((null===(n=this.container)||void 0===n?void 0:n.offsetParent)&&(null===(r=this.topLeft)||void 0===r?void 0:r.offsetParent)&&(null===(o=this.topRight)||void 0===o?void 0:o.offsetParent)||this.reloadComponent.emit(),Object.keys(this.refs||{}).forEach((function(e){var t=h.refs[e],i=t.overlay,n=t.component;h.checkComponent(n,i.text,(function(){return h.reloadComponent.emit()}))})),this.shouldShowWatermark("top-left")&&this.watermarkRef.left&&this.checkComponent(this.watermarkRef.left,null===(a=null===(s=this.preset)||void 0===s?void 0:s.watermark)||void 0===a?void 0:a.text,(function(){return h.reloadComponent.emit()})),this.shouldShowWatermark("top-right")&&this.watermarkRef.right&&this.checkComponent(this.watermarkRef.right,null===(c=null===(l=this.preset)||void 0===l?void 0:l.watermark)||void 0===c?void 0:c.text,(function(){return h.reloadComponent.emit()})))}},{key:"checkComponent",value:function(e,t,i){if(!(null==e?void 0:e.offsetParent))return i();if(!e.shadowRoot.querySelector("slot"))return i();if(this.player&&this.player.playing){var n=e.shadowRoot.querySelector("slot").assignedNodes()[0];if(n){if(n.parentElement.innerHTML!=t)return i();var r=getComputedStyle(n.parentElement.shadowRoot.querySelector(".overlay-text"));if(parseInt(r.fontSize,10)<10)return i();var o=(0,p.p)(r.color);if("1"!==(null==o?void 0:o[3]))return i()}}}},{key:"shouldShowOverlay",value:function(e){if(void 0!==this.currentTime)return!(this.currentTime<(0,p.b)(null==e?void 0:e.startTime)||this.currentTime>(0,p.b)(null==e?void 0:e.endTime))}},{key:"renderOverlay",value:function(e){var t,i,n=this;return(0,d.h)("presto-dynamic-overlay-ui",{class:{visible:this.shouldShowOverlay(e)},ref:function(t){return n.refs[e.id]={overlay:e,component:t}},key:e.id,position:e.position,href:null===(t=null==e?void 0:e.link)||void 0===t?void 0:t.url,target:(null===(i=null==e?void 0:e.link)||void 0===i?void 0:i.opensInNewTab)?"_blank":"_self",innerHTML:this.shouldShowOverlay(e)?e.text:"",style:{"--presto-dynamic-overlay-color":(null==e?void 0:e.color)||"#fff","--presto-dynamic-overlay-background":(null==e?void 0:e.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null==e?void 0:e.opacity)?(e.opacity/100).toString():"1"}})}},{key:"shouldShowWatermark",value:function(e){var t,i,n;if(!(null===(i=null===(t=this.preset)||void 0===t?void 0:t.watermark)||void 0===i?void 0:i.enabled))return!1;var r=null===(n=this.preset)||void 0===n?void 0:n.watermark;return"randomize"===r.position?Math.floor((this.player.currentTime||0)/10)%2==0?"top-left"===e:"top-right"===e:r.position===e||!r.position&&"top-right"===e}},{key:"render",value:function(){var e,t,i,n,r,o,s,a,l,c,h,u=this;if(this.enabled&&((null===(e=null==this?void 0:this.overlays)||void 0===e?void 0:e.length)||(null===(i=null===(t=this.preset)||void 0===t?void 0:t.watermark)||void 0===i?void 0:i.enabled)))return(0,d.h)("div",{class:"overlays",ref:function(e){return u.container=e}},(0,d.h)("div",{class:"top-left",ref:function(e){return u.topLeft=e}},!!this.shouldShowWatermark("top-left")&&(0,d.h)("presto-dynamic-overlay-ui",{ref:function(e){return u.watermarkRef.left=e},style:{"--presto-dynamic-overlay-color":(null===(n=this.preset.watermark)||void 0===n?void 0:n.color)||"#fff","--presto-dynamic-overlay-background":(null===(r=this.preset.watermark)||void 0===r?void 0:r.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null===(o=this.preset.watermark)||void 0===o?void 0:o.opacity)?(this.preset.watermark.opacity/100).toString():"1"},class:"visible",position:"top-left",innerHTML:this.preset.watermark.text}),!!(null===(s=null==this?void 0:this.overlays)||void 0===s?void 0:s.length)&&this.overlays.map((function(e){return"top-left"!==e.position?"":u.renderOverlay(e)}))),(0,d.h)("div",{class:"top-right",ref:function(e){return u.topRight=e}},!!this.shouldShowWatermark("top-right")&&(0,d.h)("presto-dynamic-overlay-ui",{ref:function(e){return u.watermarkRef.right=e},style:{"--presto-dynamic-overlay-color":(null===(a=this.preset.watermark)||void 0===a?void 0:a.color)||"#fff","--presto-dynamic-overlay-background":(null===(l=this.preset.watermark)||void 0===l?void 0:l.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null===(c=this.preset.watermark)||void 0===c?void 0:c.opacity)?(this.preset.watermark.opacity/100).toString():"1"},class:"visible",position:"top-right",innerHTML:this.preset.watermark.text}),!!(null===(h=null==this?void 0:this.overlays)||void 0===h?void 0:h.length)&&this.overlays.map((function(e){return"top-right"!==e.position?"":u.renderOverlay(e)}))))}},{key:"el",get:function(){return(0,d.g)(this)}}]),e}();S.style=".top-left,.top-right{position:absolute;display:block;padding:20px;max-width:45%;z-index:20;display:flex;flex-direction:column;flex-wrap:wrap}.top-left{top:0;left:0}.top-right{top:0;right:0;align-items:flex-end}presto-dynamic-overlay-ui{overflow:hidden;height:0;opacity:0;transition:height 0ms 400ms, opacity 400ms 0ms}presto-dynamic-overlay-ui.visible{margin-bottom:10px;height:auto;opacity:1;transition:height 0ms 0ms, opacity 500ms 0ms}";var O=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.player=void 0,this.direction=void 0,this.preset=void 0,this.videoId=void 0,this.i18n=void 0,this.provider=void 0,this.currentTime=void 0,this.duration=void 0,this.ended=void 0}return(0,c.Z)(e,[{key:"componentWillLoad",value:function(){var e=this;this.player&&(this.player.on("ended",(function(){return e.setEnded()})),this.player.on("timeupdate",(function(t){return e.setCurrentTime(t)})))}},{key:"setEnded",value:function(){this.ended=!0}},{key:"setCurrentTime",value:function(e){var t,i;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.plyr.duration}},{key:"disconnectedCallback",value:function(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}},{key:"render",value:function(){var e,t;return(0,d.h)("presto-email-overlay-controller",{key:"ccdb3335179aced53bfe8ba1c0f4594e5aa6051c",ended:this.ended,currentTime:this.currentTime,videoId:this.videoId,duration:this.duration,direction:this.direction,presetId:null===(e=this.preset)||void 0===e?void 0:e.id,emailCollection:null===(t=this.preset)||void 0===t?void 0:t.email_collection,i18n:this.i18n,provider:this.provider})}}]),e}();O.style=":host{display:block}";var C=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.playVideo=(0,d.c)(this,"playVideo",7),this.pauseVideo=(0,d.c)(this,"pauseVideo",7),this.restartVideo=(0,d.c)(this,"restartVideo",7),this.emailStateChange=(0,d.c)(this,"emailStateChange",7),this.ended=void 0,this.currentTime=void 0,this.duration=void 0,this.direction=void 0,this.emailCollection=void 0,this.i18n=void 0,this.videoId=void 0,this.presetId=void 0,this.provider=void 0,this.enabled=void 0,this.show=void 0,this.loading=void 0,this.error=void 0,this.percentagePassed=0}var t,i;return(0,c.Z)(e,[{key:"setStorage",value:function(e){window.localStorage.setItem("presto.videos.email_collection",JSON.stringify((0,a.Z)({},this.videoId,e)))}},{key:"getStorage",value:function(){return window.localStorage.getItem("presto.videos.email_collection")}},{key:"componentWillLoad",value:function(){this.handleDuration()}},{key:"handleDuration",value:function(){var e;this.enabled=!this.getStorage()&&(null===(e=null==this?void 0:this.emailCollection)||void 0===e?void 0:e.enabled),this.handleTimeCheck()}},{key:"handleTimeCheck",value:function(){this.enabled&&(this.getStorage()||this.checkTime())}},{key:"handleShowChange",value:function(){this.show&&this.pauseVideo.emit(!0)}},{key:"checkTime",value:function(){var e;this.show=(0,p.t)({current:this.currentTime,duration:this.duration,showAfter:(null===(e=null==this?void 0:this.emailCollection)||void 0===e?void 0:e.percentage)||0})}},{key:"getNonce",value:(i=(0,s.Z)(u().mark((function e(){var t;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",fetch("".concat(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.ajaxurl,"?action=presto_refresh_progress_nonce")));case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"submit",value:(t=(0,s.Z)(u().mark((function e(t){var i,n,r,o,s,a,l,c,h;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loading=!0,this.error="",e.next=4,this.getNonce();case 4:return n=e.sent,e.next=7,n.json();case 7:return r=e.sent,o=r.data,e.prev=9,e.next=12,fetch(null===(i=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===i?void 0:i.ajaxurl,{method:"post",body:new URLSearchParams(Object.assign({action:"presto_player_email_submit",nonce:o,preset_id:this.presetId,video_id:this.videoId,provider:this.provider},(null==t?void 0:t.detail)||{}))});case 12:return s=e.sent,e.next=15,s.json();case 15:if(a=e.sent,l=a.success,c=a.data,!l){e.next=24;break}this.setStorage("collected"),this.show=!1,this.playVideo.emit(),e.next=25;break;case 24:throw c;case 25:e.next=31;break;case 27:e.prev=27,e.t0=e.catch(9),(h=null===e.t0||void 0===e.t0?void 0:e.t0[0])&&"string"==typeof h&&(this.error=h);case 31:return e.prev=31,this.loading=!1,e.finish(31);case 34:case"end":return e.stop()}}),e,this,[[9,27,31,34]])}))),function(_x){return t.apply(this,arguments)})},{key:"skip",value:function(){this.setStorage("skipped"),this.show=!1,this.playVideo.emit()}},{key:"handleEmailStateChange",value:function(e){this.emailStateChange.emit(e)}},{key:"render",value:function(){var e,t,i,n,r,o,s,a,l=this;if(this.show)return(0,d.h)("presto-email-overlay-ui",{style:Object.assign(Object.assign({},(null===(e=null==this?void 0:this.emailCollection)||void 0===e?void 0:e.button_color)?{"--presto-player-button-color":"".concat(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.button_color)}:{}),(null===(i=null==this?void 0:this.emailCollection)||void 0===i?void 0:i.button_text_color)?{"--presto-player-button-text":"".concat(null===(n=null==this?void 0:this.emailCollection)||void 0===n?void 0:n.button_text_color)}:{}),direction:this.direction,class:"email-overlay",headline:null===(r=null==this?void 0:this.emailCollection)||void 0===r?void 0:r.headline,bottomText:null===(o=null==this?void 0:this.emailCollection)||void 0===o?void 0:o.bottom_text,allowSkip:null===(s=null==this?void 0:this.emailCollection)||void 0===s?void 0:s.allow_skip,buttonText:null===(a=null==this?void 0:this.emailCollection)||void 0===a?void 0:a.button_text,isLoading:this.loading,errorMessage:this.error,onSubmitForm:function(e){return l.submit(e)},onSkip:function(){return l.skip()},i18n:this.i18n,provider:this.provider})}}],[{key:"watchers",get:function(){return{duration:["handleDuration"],currentTime:["handleTimeCheck","handleShowChange"],show:["handleEmailStateChange"]}}}]),e}();C.style=":host{display:block}";var T=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t)}return(0,c.Z)(e,[{key:"render",value:function(){return(0,d.h)(d.H,{key:"b14a9f10f17e2032587add142c35e83a09362b9b"},(0,d.h)("slot",{key:"190b1db447aede7bf8822a363c90d2ed0e98e0f1"}))}}]),e}();T.style='.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid{border-radius:2px;padding:3% 5%;max-width:135px;max-height:90px;box-sizing:content-box;position:absolute !important;top:50% !important;opacity:100%}.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid svg{height:31px;width:37px}.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid:hover,.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid:focus{opacity:0.8;background:var(--plyr-color-main)}.skin-modern.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 9px) * -4))}.skin-modern.presto-player__wrapper .plyr--video .plyr__controls{padding:0px}.skin-modern.presto-player__wrapper .plyr--video .plyr__controls::before{content:"";background:var(--plyr-color-main);position:absolute;top:0;left:0;right:0;bottom:0;opacity:0.75}.skin-modern.presto-player__wrapper .plyr__controls__item{z-index:1}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__control:not(.presto-player-progress__marker):not([role*=menuitem]):not(.plyr__control--back){height:36px;border-radius:0px}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__control:not(.presto-player-progress__marker):not([role*=menuitem]):not(.plyr__control--back):focus{background-color:transparent;color:white}.skin-modern.presto-player__wrapper .plyr__controls__item.presto-player-progress__marker{z-index:2}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__menu{height:36px}.skin-modern.presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{height:2px;color:white}.skin-modern.presto-player__wrapper .presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{height:2px}.skin-modern.presto-player__wrapper .plyr--video .plyr__progress__buffer{height:2px;top:11px}.skin-modern.presto-player__wrapper .plyr__progress input[type=range]{cursor:pointer}.skin-modern.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb{top:1px;height:var(--plyr-range-thumb-height, 8px);width:var(--plyr-range-thumb-height, 8px);box-shadow:0px 0px 5px white}.skin-modern.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.5)}.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item{margin:0px}.skin-modern.presto-player__wrapper .plyr__volume{width:auto}.skin-modern.presto-player__wrapper .plyr__volume input[type=range]{width:55px}.skin-modern.presto-player__wrapper .plyr__volume input[type=range]{cursor:pointer}.skin-modern.presto-player__wrapper .presto-player__muted-overlay .plyr__control.plyr__control--overlaid{border-radius:2px}.skin-modern.presto-player__wrapper .presto-player__muted-overlay .plyr__control.plyr__control--overlaid svg{height:40px;width:50px}.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=rewind] svg,.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fast-forward] svg,.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{width:22px;height:22px}@media screen and (max-width: 480px){.skin-modern.presto-player__wrapper .plyr__control--overlaid svg{height:18px;width:16px}}';var A=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.playVideo=(0,d.c)(this,"playVideo",7),this.mutedPreview=void 0,this.mutedOverlay=void 0,this.preset=void 0}return(0,c.Z)(e,[{key:"render",value:function(){var e,t,i,n,r,o,s,a,l,c=this;return(0,d.h)("div",{key:"d65899750134c7f2e369720c2d035c27825e1ce4",class:"presto-player__muted-overlay",onClick:function(){c.mutedPreview=!1,c.playVideo.emit()}},(null===(e=this.preset)||void 0===e?void 0:e["play-large"])&&(0,d.h)("div",{key:"231db6abba50bbe06312e3c6a162c651cb1408a8",class:"plyr__control plyr__control--overlaid","data-plyr":"play","aria-label":"Play",part:"muted-overlay-play"},(0,d.h)("svg",{key:"4bd21f713381abfafbcab0e26e7af9fefd3c10de",id:"plyr-play",viewBox:"0 0 18 18"},(0,d.h)("path",{key:"6ffa3046759503f5a46a7f6fcaef328494868811",d:"M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"})),(0,d.h)("span",{key:"c00867bba01ae310176b7609bcb3cfb4218ef125",class:"plyr__sr-only"},"Play")),(null===(t=this.mutedOverlay)||void 0===t?void 0:t.enabled)&&(null===(i=this.mutedOverlay)||void 0===i?void 0:i.src)?(0,d.h)("div",{class:"presto-player__overlay is-image",part:"muted-overlay-image",style:{width:"".concat((null===(n=this.mutedOverlay)||void 0===n?void 0:n.width)||50,"%"),left:"".concat(100*((null===(o=null===(r=this.mutedOverlay)||void 0===r?void 0:r.focalPoint)||void 0===o?void 0:o.x)||.5),"%"),top:"".concat(100*((null===(a=null===(s=this.mutedOverlay)||void 0===s?void 0:s.focalPoint)||void 0===a?void 0:a.y)||.5),"%")}},(0,d.h)("img",{src:null===(l=this.mutedOverlay)||void 0===l?void 0:l.src,style:{transform:"translateX(-50%) translateY(-50%)"}})):"")}}]),e}();A.style=":host{display:block}";var P=571!=i.j?function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.value=void 0,this.player=void 0,this.markers=void 0,this.currentMarkerLocation=-1}return(0,c.Z)(e,[{key:"onSearch",value:function(e){if(this.value=e.detail,""===this.value)(0,p.r)(this.player),this.markers=[];else{var t=(0,p.s)(this.player,this.value);this.player.config.markers={enabled:!0,points:t},this.markers=t,(0,p.d)(this.player,t)}}},{key:"onPreviousNav",value:function(){this.currentMarkerLocation-1<0?this.currentMarkerLocation=this.markers.length-1:this.currentMarkerLocation--,this.player.currentTime=this.markers[this.currentMarkerLocation].time}},{key:"onFocusChange",value:function(e){var t,i;!0===(null==e?void 0:e.detail)?this.player.config.hideControls=!1:this.player.config.hideControls=(null===(i=null===(t=this.player.config)||void 0===t?void 0:t.preset)||void 0===i?void 0:i.auto_hide)||!1}},{key:"onNextNav",value:function(){this.currentMarkerLocation+1>this.markers.length-1?this.currentMarkerLocation=0:this.currentMarkerLocation++,this.player.currentTime=this.markers[this.currentMarkerLocation].time}},{key:"render",value:function(){var e,t,i,n,r,o,s,a,l=this;if(!this.player)return"";if(!(null===(i=null===(t=null===(e=this.player)||void 0===e?void 0:e.media)||void 0===t?void 0:t.textTracks)||void 0===i?void 0:i.length)||0===(null===(o=null===(r=null===(n=this.player)||void 0===n?void 0:n.media)||void 0===r?void 0:r.textTracks)||void 0===o?void 0:o.length))return"";var c=null===(s=this.player.config.preset.search)||void 0===s?void 0:s.placeholder;return(0,d.h)("presto-search-bar-ui",{value:this.value,hasNavigation:(null===(a=this.markers)||void 0===a?void 0:a.length)>1,placeholder:c,onNextNav:function(){return l.onNextNav()},onPreviousNav:function(){return l.onPreviousNav()},onSearch:function(e){return l.onSearch(e)},onFocusChange:function(e){return l.onFocusChange(e)}})}}]),e}():null,M=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t)}return(0,c.Z)(e,[{key:"render",value:function(){return(0,d.h)(d.H,{key:"1f879dbd91a7b1b49bcdc94b3299000023a9f914"},(0,d.h)("slot",{key:"69281f1405ff6ffdad92b63969811c0a6ac8be1f"}))}}]),e}();M.style=".skin-stacked .plyr__controls{flex-wrap:wrap}.skin-stacked .presto-player-progress__marker{transform:scale(0.75)}.skin-stacked .plyr__controls{justify-content:flex-start}.skin-stacked .plyr__controls__item.plyr__progress__container{order:-1;flex:1 0 100%}.skin-stacked .plyr__controls__item.plyr__progress__container+:not(.plyr__time),.skin-stacked .plyr__controls__item.plyr__progress__container+.plyr__time+*{margin-left:auto}.skin-stacked .plyr__controls .plyr__controls__item:first-child{margin:0}.skin-stacked .plyr__progress{height:19px;display:flex;align-items:center}.skin-stacked .plyr__progress .plyr__progress__buffer{height:3px;transition:all 0.25s ease;position:absolute;top:calc(50% + 1px)}.skin-stacked .plyr__progress input[type=range]::-moz-range-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-webkit-slider-runnable-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-fill-upper{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-fill-lower{height:3px;transition:height 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-webkit-slider-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-moz-range-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress__container:hover .presto-player-progress__marker{transform:scale(1)}.skin-stacked .plyr__progress__container:hover .plyr__progress .plyr__progress__buffer{height:5px;top:50%}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]{overflow:visible}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-moz-range-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-webkit-slider-runnable-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-fill-upper{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-fill-lower{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-webkit-slider-thumb{visibility:visible;opacity:1}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-moz-range-thumb{visibility:visible;opacity:1}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-thumb{visibility:visible;opacity:1}";var E=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.src=void 0,this.poster=void 0,this.player=void 0,this.getRef=void 0}return(0,c.Z)(e,[{key:"getId",value:function(e){var t=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(e||"");return(null==t?void 0:t[5])||""}},{key:"parseHash",value:function(e){var t=m(/^.*(?:vimeo.com\/|video\/)(?:\d+)(?:\?.*&*h=|\/)+([\d,a-f]+)/,{hash:1}),i=e.match(t);return i?i.groups.hash:null}},{key:"render",value:function(){if(this.src)return(0,p.f)()?(0,d.h)("div",{class:"presto-iframe-fallback-container"},(0,d.h)("iframe",{src:"https://player.vimeo.com/video/".concat(this.getId(this.src),"?h=").concat(this.parseHash(this.src),"&loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media"),allowFullScreen:!0,allowTransparency:!0,allow:"autoplay",style:{width:"100%"},class:"presto-fallback-iframe"})):(0,d.h)("div",{class:"plyr__video-embed",part:"embed",ref:this.getRef,"data-plyr-provider":"vimeo","data-plyr-embed-id":this.getId(this.src),"data-plyr-embed-hash":this.parseHash(this.src)})}}]),e}();E.style=":host{display:block}";var D=function(){function e(t){(0,l.Z)(this,e),(0,d.r)(this,t),this.reload=(0,d.c)(this,"reload",7),this.src=void 0,this.poster=void 0,this.lazyLoad=void 0,this.player=void 0,this.getRef=void 0,this.reloadPlayer=void 0,this.isWebView=void 0}return(0,c.Z)(e,[{key:"handlePlayerChange",value:function(){this.player&&(this.fixes(),this.setPoster())}},{key:"fixes",value:function(){var e=this;this.player.once("statechange",(function(t){var i,n,r,o,s;1===t.detail.code&&((null===(s=null===(o=null===(r=null===(n=null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.plyr)||void 0===n?void 0:n.config)||void 0===r?void 0:r.blockAttributes)||void 0===o?void 0:o.mutedPreview)||void 0===s?void 0:s.enabled)||(e.player.muted=!1))}))}},{key:"getId",value:function(e){var t,i=(e||"").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return i&&11===(null===(t=null==i?void 0:i[2])||void 0===t?void 0:t.length)?i[2]:null}},{key:"loadPlayer",value:function(){this.lazyLoad=!1,this.reloadPlayer=!0}},{key:"componentDidRender",value:function(){this.reloadPlayer&&(this.reloadPlayer=!1,this.reload.emit("play"))}},{key:"setWebView",value:function(){var e,t=null===(e=window.navigator)||void 0===e?void 0:e.standalone,i=window.navigator.userAgent.toLowerCase(),n=/safari/.test(i),r=/iphone|ipod|ipad/.test(i);this.isWebView=r?!t&&!n:i.includes("wv")}},{key:"loadImage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(i,n){var r=new Image,o=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?i:n)(e)};Object.assign(r,{onload:o,onerror:o,src:e})}))}},{key:"setPoster",value:function(){var e=this;if(!this.player.poster){var t=function(t){return"https://i.ytimg.com/vi/".concat(e.getId(e.src),"/").concat(t,"default.jpg")};this.loadImage(t("maxres"),121).catch((function(){return e.loadImage(t("sd"),121)})).catch((function(){return e.loadImage(t("hq"),121)})).then((function(t){return e.player.poster=t})).catch((function(){}))}}},{key:"componentWillLoad",value:function(){this.setWebView(),this.lazyLoad&&(0,p.a)()&&(this.lazyLoad=!1)}},{key:"render",value:function(){var e=this;return this.isWebView?(0,d.h)("div",{class:"fallback-container"},(0,d.h)("iframe",{src:this.src,allowFullScreen:!0,allowtransparency:!0,allow:"autoplay"})):this.lazyLoad?(0,d.h)("div",null,(0,d.h)("presto-video",{part:"video",getRef:this.getRef,src:"",provider:"youtube"}),(0,d.h)("div",{class:"presto-player__play-cover",onClick:function(){return e.loadPlayer()}})):(0,d.h)("div",{class:"plyr__video-embed",part:"embed",ref:this.getRef,"data-plyr-provider":"youtube","data-plyr-embed-id":this.getId(this.src)})}}],[{key:"watchers",get:function(){return{player:["handlePlayerChange"]}}}]),e}();D.style=":host{display:block}.fallback-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.fallback-container iframe,.fallback-container object,.fallback-container embed{position:absolute;top:0;left:0;width:100%;height:100%}@supports not (aspect-ratio: 16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0 !important;padding-bottom:56.25%;position:relative}}"},3285:function(e,t,i){i.r(t),i.d(t,{presto_cta_overlay_ui:function(){return a}});var n=i(5671),r=i(3144),o=i(1368),s=i(8116),a=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.skip=(0,o.c)(this,"skip",7),this.rewatch=(0,o.c)(this,"rewatch",7),this.headline=void 0,this.defaultHeadline=void 0,this.bottomText=void 0,this.showButton=void 0,this.buttonText=void 0,this.buttonType=void 0,this.buttonLink=void 0,this.allowRewatch=void 0,this.allowSkip=void 0,this.direction=void 0,this.i18n=void 0,this.provider=void 0,this.type=void 0,this.isAudioProvider=void 0}return(0,r.Z)(e,[{key:"componentDidLoad",value:function(){var e=this.type||this.provider;this.isAudioProvider="audio"===e,(0,s.f)(this.textInput,3,{maxFontSize:!0===this.isAudioProvider?15:20,minFontSize:8})}},{key:"handleCTAClick",value:function(e){var t;(null===(t=this.buttonLink)||void 0===t?void 0:t.url)&&(e.preventDefault(),e.stopPropagation(),this.handleLink())}},{key:"handleLink",value:function(){var e,t,i;(null===(e=this.buttonLink)||void 0===e?void 0:e.opensInNewTab)?window.open(null===(t=this.buttonLink)||void 0===t?void 0:t.url,"_blank"):window.location.href=null===(i=this.buttonLink)||void 0===i?void 0:i.url}},{key:"render",value:function(){var e,t,i,n,r,s=this;return(0,o.h)("div",{key:"a1e3d863a9dd9e85626e1667edf27f2ade3c253a",class:"wrapper",ref:function(e){return s.textInput=e}},(0,o.h)("div",{key:"1f432dff813e53ab62d24b587dea40c8d0b734fa",onClick:function(e){return s.handleCTAClick(e)},class:"overlay ".concat("rtl"===this.direction?"rtl":""," ").concat((null===(e=this.buttonLink)||void 0===e?void 0:e.url)?"has-link":"")},(0,o.h)("div",{key:"46a7df3774e82c9175b55c97b993f24ff07ccdb1",class:this.isAudioProvider?"content is-centered":"content"},(0,o.h)("h1",{key:"e94d920c1dc24ab999de23778b8176e0305d3731",part:"cta-headline"},this.headline||this.defaultHeadline),this.bottomText&&(0,o.h)("p",{key:"ff14def8afc4a67741ea33b0c3b31bcbc86be73a",class:this.isAudioProvider&&"is-small",part:"cta-bottom-text",innerHTML:this.bottomText}),this.showButton&&(0,o.h)("presto-player-button",{key:"842dc763f9cc56bccead8b26233f8417116c99ec",full:!0,onClick:function(e){return s.handleCTAClick(e)},part:"cta-button",href:null===(t=null==this?void 0:this.buttonLink)||void 0===t?void 0:t.url,target:(null===(i=null==this?void 0:this.buttonLink)||void 0===i?void 0:i.opensInNewTab)?"_blank":"_self",class:"button",type:"primary"},this.buttonText))),!!this.allowRewatch&&(0,o.h)("div",{key:"5a62eb399fe702af41a0cf1cf1c8d5b5312d752e",class:"rewatch",onClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),s.rewatch.emit()}},(0,o.h)("svg",{key:"48686a3db77f770638bcb6158c8b2259ba917428",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-corner-up-left"},(0,o.h)("polyline",{key:"ede217473eecc81dde6497ef51f39d6b82608fbc",points:"9 14 4 9 9 4"}),(0,o.h)("path",{key:"bbdd7a09ee2c18cef2a48dda546965b7a3a55f33",d:"M20 20v-7a4 4 0 0 0-4-4H4"})),null===(n=null==this?void 0:this.i18n)||void 0===n?void 0:n.rewatch),!!this.allowSkip&&(0,o.h)("div",{key:"56eb1ebc96960b37d63c75cef159bf1bba291006",class:"skip",onClick:function(e){e.preventDefault(),s.skip.emit()}},null===(r=null==this?void 0:this.i18n)||void 0===r?void 0:r.skip," →"))}}]),e}();a.style=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999;user-select:none}*{box-sizing:border-box}a{color:#fff}.wrapper{height:100%;position:relative;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif)}.overlay{position:relative;display:flex;align-items:center;justify-content:center;padding:48px;height:100%}.overlay.has-link{cursor:pointer}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-cta-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-cta-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.content{width:80%;max-width:600px}.content *~*{margin-top:22px}button{background:var(--plyr-color-main, #000);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;color:#fff;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-cta-border-radius, 0) var(--presto-player-cta-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:rgb(255, 255, 255) 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}h1{font-size:1.5em;font-weight:500;margin:0;line-height:1.1em}.skip,.rewatch{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}.rewatch{display:inline-flex;align-items:center;right:auto;left:0}.rewatch .icon{margin-right:5px}p{font-size:0.85em;margin:0;margin-top:1.5em;line-height:1.4em;opacity:0.75}p.is-small{font-size:0.85em;margin:1.5em 0px 0px;line-height:0.1em;opacity:0.75}.is-centered{text-align:center}'},1871:function(e,t,i){i.r(t),i.d(t,{presto_email_overlay_ui:function(){return a},presto_player_spinner:function(){return l}});var n=i(5671),r=i(3144),o=i(1368),s=i(8116),a=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.submitForm=(0,o.c)(this,"submitForm",7),this.skip=(0,o.c)(this,"skip",7),this.headline=void 0,this.bottomText=void 0,this.buttonText=void 0,this.allowSkip=void 0,this.borderRadius=void 0,this.isLoading=void 0,this.errorMessage=void 0,this.direction=void 0,this.i18n=void 0,this.provider=void 0,this.type=void 0,this.email=void 0,this.isAudioProvider=void 0}return(0,r.Z)(e,[{key:"handleSubmit",value:function(e){this.submitForm.emit({email:this.email}),e.preventDefault()}},{key:"componentDidLoad",value:function(){var e=this.type||this.provider;this.isAudioProvider="audio"===e,(0,s.f)(this.textInput,3,{maxFontSize:this.isAudioProvider?15:20,minFontSize:8})}},{key:"handleChange",value:function(e){this.email=e.target.value}},{key:"render",value:function(){var e,t,i,n,r=this;return(0,o.h)("div",{key:"b8e118c613aa8700448994aed04447b6464a119b",class:"overlay ".concat("rtl"===this.direction?"rtl":""),ref:function(e){return r.textInput=e}},(0,o.h)("div",{key:"5a14ca9fa2b25515cea4da5466a933912ad9a9ed",class:"content"},(0,o.h)("h1",{key:"bd756aebf1015cdd0b4efd84f81f282edd9d93ba",class:this.isAudioProvider&&"is-small"},this.headline||(null===(e=null==this?void 0:this.i18n)||void 0===e?void 0:e.emailDefaultHeadline)),this.isLoading?(0,o.h)("presto-player-spinner",null):(0,o.h)("form",{onSubmit:function(e){return r.handleSubmit(e)}},(0,o.h)("input",{type:"email",placeholder:null===(t=null==this?void 0:this.i18n)||void 0===t?void 0:t.emailPlaceholder,value:this.email,onInput:function(e){return r.handleChange(e)},required:!0}),(0,o.h)("button",{type:"submit"},this.buttonText||(null===(i=null==this?void 0:this.i18n)||void 0===i?void 0:i.play))),this.errorMessage&&(0,o.h)("p",{key:"6c5bbc81394175cda1efcc160b170159cc079c74",class:"error"},this.errorMessage),this.bottomText&&(0,o.h)("p",{key:"47891a20de1cb0c9ac22339348d683394a3529bd",innerHTML:this.bottomText,class:this.isAudioProvider&&"is-small"}),!!this.allowSkip&&(0,o.h)("div",{key:"338e4db6407a69a42f5a7b6ae03baa50646cd23b",class:"skip",onClick:function(){r.skip.emit()}},null===(n=null==this?void 0:this.i18n)||void 0===n?void 0:n.skip," →")))}}]),e}();a.style=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999}*{box-sizing:border-box}a{color:#fff}.overlay{position:relative;display:flex;align-items:center;text-align:center;justify-content:center;padding:48px;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif);height:100%}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-email-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-email-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.overlay.rtl form{flex-direction:row-reverse}.content{width:20em}form{display:flex;align-items:stretch;justify-content:center}input{background:#fff;border:none;font-size:0.8em;line-height:20px;padding:6px 8px;border-radius:0;border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--presto-player-email-border-radius, 0) 0 0 var(--presto-player-email-border-radius);flex:1}@media screen and (min-width: 700px){input{padding:10px 14px}}input:focus{border-color:var(--plyr-color-main, #000);z-index:1}input:focus,input:hover{outline:none}.rtl input{border-radius:0 var(--presto-player-email-border-radius, 0) var(--presto-player-email-border-radius) 0}button{background-color:var(--presto-player-button-color, var(--plyr-color-main));border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-text, #fff);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-email-border-radius, 0) var(--presto-player-email-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:rgb(255, 255, 255) 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}.rtl button{border-radius:var(--presto-player-email-border-radius, 0) 0 0 var(--presto-player-email-border-radius)}h1{font-size:1.5em;font-weight:500;margin:0 0 22px 0;max-width:600px;line-height:1.1em}h1.is-small{margin-bottom:1em;font-size:1.1em}.skip{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}p{font-size:0.7em;margin:0;margin-top:1.5em}p.is-small{font-size:0.9em;margin-top:1em}';var l=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t)}return(0,r.Z)(e,[{key:"render",value:function(){return(0,o.h)("span",{key:"159a7d02b47ee7031c1848d0a2c050127e9a584b",part:"base",class:"spinner","aria-busy":"true","aria-live":"polite"})}}]),e}();l.style=":host{position:relative;box-sizing:border-box;--track-color:#0d131e20;--indicator-color:var(--plyr-color-main);--stroke-width:2px;display:inline-flex}:host *,:host *:before,:host *:after{box-sizing:inherit}.spinner{display:inline-block;width:1em;height:1em;border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}"},5657:function(e,t,i){i.r(t),i.d(t,{presto_player_button:function(){return l}});var n=i(5671),r=i(3144),o=i(2982),s=i(1368),a=function(e,t){return(0,o.Z)(t)},l=function(){function e(t){(0,n.Z)(this,e),(0,s.r)(this,t),this.prestoBlur=(0,s.c)(this,"prestoBlur",7),this.prestoFocus=(0,s.c)(this,"prestoFocus",7),this.hasFocus=!1,this.hasLabel=!1,this.hasPrefix=!1,this.hasSuffix=!1,this.type="default",this.size="medium",this.full=!1,this.disabled=!1,this.submit=!1,this.name=void 0,this.value=void 0,this.href=void 0,this.target=void 0,this.download=void 0}return(0,r.Z)(e,[{key:"componentWillLoad",value:function(){this.handleSlotChange()}},{key:"click",value:function(){this.button.click()}},{key:"focus",value:function(e){this.button.focus(e)}},{key:"blur",value:function(){this.button.blur()}},{key:"handleSlotChange",value:function(){this.hasLabel=!!this.button.children,this.hasPrefix=!!this.button.querySelector('[slot="prefix"]'),this.hasSuffix=!!this.button.querySelector('[slot="suffix"]')}},{key:"handleBlur",value:function(){this.hasFocus=!1,this.prestoBlur.emit()}},{key:"handleFocus",value:function(){this.hasFocus=!0,this.prestoFocus.emit()}},{key:"handleClick",value:function(e){this.disabled&&(e.preventDefault(),e.stopPropagation())}},{key:"render",value:function(){var e=this,t=!!this.href,i=(0,s.h)(a,{key:"a1223d99990109dd0933f199264bb4be616ae461"},(0,s.h)("span",{key:"0dc42065359f05c51e7df754df60b7fe99140ebf",part:"prefix",class:"button__prefix"},(0,s.h)("slot",{key:"f5746b73fe41e5206a172a07e759b72bd9887d17",onSlotchange:function(){return e.handleSlotChange()},name:"prefix"})),(0,s.h)("span",{key:"217de38a9136f490d087aa39b19bc9c3f2f03bb3",part:"label",class:"button__label"},(0,s.h)("slot",{key:"c9d812d8ad49baae33d56cb1eba668b9fda4eae9",onSlotchange:function(){return e.handleSlotChange()}})),(0,s.h)("span",{key:"c79032d5bb75c350326aaa585a7a7d57e8e86a33",part:"suffix",class:"button__suffix"},(0,s.h)("slot",{key:"985a53a6db25e20d71a54ca7fa23ad14f0d6ec14",onSlotchange:function(){return e.handleSlotChange()},name:"suffix"}))),n=(0,s.h)("button",{key:"d36e8cf5ea37ce43ee6bd73c1aebae7e21629395",part:"base",class:{button:!0,"button--default":"default"===this.type,"button--primary":"primary"===this.type,"button--success":"success"===this.type,"button--info":"info"===this.type,"button--warning":"warning"===this.type,"button--danger":"danger"===this.type,"button--text":"text"===this.type,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasLabel,"button--has-prefix":this.hasPrefix,"button--has-suffix":this.hasSuffix},disabled:this.disabled,type:this.submit?"submit":"button",name:this.name,value:this.value,onBlur:function(){return e.handleBlur},onFocus:function(){return e.handleFocus},onClick:function(){return e.handleClick}},i),r=(0,s.h)("a",{key:"047c56c16ad4d62f5f57227b0842c8b28001953c",part:"base",class:{button:!0,"button--default":"default"===this.type,"button--primary":"primary"===this.type,"button--success":"success"===this.type,"button--info":"info"===this.type,"button--warning":"warning"===this.type,"button--danger":"danger"===this.type,"button--text":"text"===this.type,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasLabel,"button--has-prefix":this.hasPrefix,"button--has-suffix":this.hasSuffix},href:this.href,target:this.target,download:this.download,rel:this.target?"noreferrer noopener":void 0,role:"button","aria-disabled":this.disabled?"true":"false",tabindex:this.disabled?"-1":"0",onBlur:function(){return e.handleBlur},onFocus:function(){return e.handleFocus},onClick:function(){return e.handleClick}},i);return t?r:n}},{key:"button",get:function(){return(0,s.g)(this)}}]),e}();l.style=":host{display:inline-block;width:auto;cursor:pointer}:host([full]){display:block}.button{display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--presto-player-button-border-width);font-family:var(--plyr-font-family, inherit);font-weight:var(--presto-player-button-font-weight, 500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition:var(--presto--player-transition-fast, 150ms) background-color, var(--presto-player-transition-fast, 150ms) color, var(--presto-player-transition-fast, 150ms) border, var(--presto--player-transition-fast, 150ms) box-shadow;cursor:inherit;border-radius:var(--presto-player-button-border-radius, 0.25em)}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button.button--disabled{opacity:0.5;cursor:not-allowed}.button.button--disabled *{pointer-events:none}.button ::slotted(.presto--icon){pointer-events:none}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button__label{display:flex;align-items:center}.button__label ::slotted(presto-icon){vertical-align:-2px}.button.button--default{background-color:var(--presto-player-color-white, #fff);border-color:var(--presto-player-color-gray-300, #d1d5db);color:var(--presto-player-color-gray-600, #4b5563)}.button.button--default:hover:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:0.75}.button.button--default:focus:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:1}.button.button--default:active:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:1}.button.button--primary{background-color:var(--presto-player-button-color, var(--plyr-color-main));border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-text, #fff)}.button.button--primary:hover:not(.button--disabled){opacity:0.9}.button.button--primary:focus:not(.button--disabled){opacity:1}.button.button--primary:active:not(.button--disabled){opacity:1}.button--text{background-color:transparent;border-color:transparent;color:var(--presto-player-button-color, var(--plyr-color-main))}.button--text:hover:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.8}.button--text:focus:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.7}.button--text:active:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.7}.button--small{font-size:var(--presto-player-button-font-size-small, 0.875em);height:var(--presto-player-button-height-small, 1.875em);line-height:calc(var(--presto-player-button-height-small, 1.875em) - var(--presto-player-button-border-width, 1px) * 2)}.button--medium{font-size:var(--presto-player-button-font-size-medium, 1em);height:var(--presto-player-button-height-medium, 2.5em);line-height:calc(var(--presto-player-button-height-medium, 2.5em) - var(--presto-player-button-border-width, 1px) * 2)}.button--large{font-size:var(--presto-player-button-font-size-large, 1.25em);height:var(--presto-player-button-height-large, 3.125em);line-height:calc(var(--presto-player-button-height-large, 3.125em) - var(--presto-player-button-border-width, 1px) * 2)}.button--full{display:block}.button--has-label.button--small .button__label{padding:0 var(--presto-player-button-spacing-small, 0.75em)}.button--has-label.button--medium .button__label{padding:0 var(--presto-player-button-spacing-medium, 1em)}.button--has-label.button--large .button__label{padding:0 var(--presto-player-button-spacing-large, 1.25em)}.button--has-prefix.button--small{padding-left:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-prefix.button--small .button__label{padding-left:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-prefix.button--medium{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--medium .button__label{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--large{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--large .button__label{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--small,.button--caret.button--small{padding-right:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-suffix.button--small .button__label,.button--caret.button--small .button__label{padding-right:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-suffix.button--medium,.button--caret.button--medium{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--medium .button__label,.button--caret.button--medium .button__label{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--large,.button--caret.button--large{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--large .button__label,.button--caret.button--large .button__label{padding-right:var(--presto-player-button-spacing-small, 0.75em)}"},4992:function(e,t,i){i.r(t),i.d(t,{presto_player_skeleton:function(){return s}});var n=i(5671),r=i(3144),o=i(1368),s=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.effect="sheen"}return(0,r.Z)(e,[{key:"render",value:function(){return(0,o.h)("div",{key:"0216868b617cb29e8d330467d6e53b7e951b433f",part:"base",class:{skeleton:!0,"skeleton--pulse":"pulse"===this.effect,"skeleton--sheen":"sheen"===this.effect},"aria-busy":"true","aria-live":"polite"},(0,o.h)("div",{key:"16d4cc096efc3652130b78a59a4f42df139e094f",part:"indicator",class:"skeleton__indicator"}))}}]),e}();s.style=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--presto-player-border-radius-pill);--color:#e5e7eb;--sheen-color:#f3f4f6;display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 8s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}"},2566:function(e,t,i){i.d(t,{P:function(){return ye},a:function(){return xe},b:function(){return Oe},c:function(){return Ce},d:function(){return Te},r:function(){return R}});var n,r,o,s,a,l,c,h,u,d=i(5861),p=i(4925),f=i(2982),m=i(5671),g=i(3144),v=i(3324),y=i(4942),b=i(1002),w=i(1284),k=i.n(w),x=i(1368),_=i(2136),S=["premium","referrerPolicy"];function O(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return C(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function T(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?T(Object(i),!0).forEach((function(t){(0,y.Z)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):T(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var P,M={exports:{}};P=M,"object"==("undefined"==typeof navigator?"undefined":(0,b.Z)(navigator))&&(P.exports=function(){function e(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=(0,b.Z)(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,"string");if("object"!=(0,b.Z)(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,b.Z)(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var o={addCSS:!0,thumbWidth:15,watch:!0};function s(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var a=function(e){return null!=e?e.constructor:null},l=function(e,t){return!!(e&&t&&e instanceof t)},c=function(e){return a(e)===String},h=function(e){return Array.isArray(e)},u=function(e){return l(e,NodeList)},d=c,w=h,k=u,x=function(e){return l(e,Element)},_=function(e){return l(e,Event)},O=function(e){return function(e){return null==e}(e)||(c(e)||h(e)||u(e))&&!e.length||function(e){return a(e)===Object}(e)&&!Object.keys(e).length};var C=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),x(t)?this.element=t:d(t)&&(this.element=document.querySelector(t)),x(this.element)&&O(this.element.rangeTouch)&&(this.config=r({},o,{},i),this.init())}return function(e,i,n){i&&t(e.prototype,i),n&&t(e,n)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!_(t))return null;var i,n=t.target,r=t.changedTouches[0],o=parseFloat(n.getAttribute("min"))||0,s=parseFloat(n.getAttribute("max"))||100,a=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(r.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),o+function(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(s-o),a)}},{key:"set",value:function(t){e.enabled&&_(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=null;if(O(t)||d(t)?n=Array.from(document.querySelectorAll(d(t)?t:'input[type="range"]')):x(t)?n=[t]:k(t)?n=Array.from(t):w(t)&&(n=t.filter(x)),O(n))return null;var a=r({},o,{},i);if(d(t)&&a.watch){var l=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){x(i)&&s(i,t)&&new e(i,a)}))}))}));l.observe(document.body,{childList:!0,subtree:!0})}return n.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}(),T=function(e){return null!=e?e.constructor:null},P=function(e,t){return Boolean(e&&t&&e instanceof t)},M=function(e){return null==e},E=function(e){return T(e)===Object},D=function(e){return T(e)===String},L=function(e){return"function"==typeof e},R=function(e){return Array.isArray(e)},I=function(e){return P(e,NodeList)},N=function(e){return M(e)||(D(e)||R(e)||I(e))&&!e.length||E(e)&&!Object.keys(e).length},z=M,B=E,j=function(e){return T(e)===Number&&!Number.isNaN(e)},F=D,V=function(e){return T(e)===Boolean},W=L,$=R,Q=I,H=function(e){return null!==e&&"object"==(0,b.Z)(e)&&1===e.nodeType&&"object"==(0,b.Z)(e.style)&&"object"==(0,b.Z)(e.ownerDocument)},q=function(e){return P(e,Event)},Z=function(e){return P(e,KeyboardEvent)},U=function(e){return P(e,TextTrack)||!M(e)&&D(e.kind)},X=function(e){if(P(e,window.URL))return!0;if(!D(e))return!1;var t=e;e.startsWith("http://")&&e.startsWith("https://")||(t="http://".concat(e));try{return!N(new URL(t).hostname)}catch(e){return!1}},J=N,Y=function(){var e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((function(t){return void 0!==e.style[t]}));return!!F(i)&&t[i]}();function K(e,t){setTimeout((function(){try{e.hidden=!0,e.hidden=!1}catch(e){}}),t)}var G={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function ee(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function te(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(!i.length)return e;var r=i.shift();return B(r)?(Object.keys(r).forEach((function(t){B(r[t])?(Object.keys(e).includes(t)||Object.assign(e,(0,y.Z)({},t,{})),te(e[t],r[t])):Object.assign(e,(0,y.Z)({},t,r[t]))})),te.apply(void 0,[e].concat(i))):e}function ie(e,t){var i=e.length?e:[e];Array.from(i).reverse().forEach((function(e,i){var n=i>0?t.cloneNode(!0):t,r=e.parentNode,o=e.nextSibling;n.appendChild(e),o?r.insertBefore(n,o):r.appendChild(n)}))}function ne(e,t){H(e)&&!J(t)&&Object.entries(t).filter((function(e){var t=(0,v.Z)(e,2)[1];return!z(t)})).forEach((function(t){var i=(0,v.Z)(t,2),n=i[0],r=i[1];return e.setAttribute(n,r)}))}function re(e,t,i){var n=document.createElement(e);return B(t)&&ne(n,t),F(i)&&(n.innerText=i),n}function oe(e,t,i,n){H(t)&&t.appendChild(re(e,i,n))}function se(e){Q(e)||$(e)?Array.from(e).forEach(se):H(e)&&H(e.parentNode)&&e.parentNode.removeChild(e)}function ae(e){if(H(e))for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1}function le(e,t){return H(t)&&H(t.parentNode)&&H(e)?(t.parentNode.replaceChild(e,t),e):null}function ce(e,t){if(!F(e)||J(e))return{};var i={},n=te({},t);return e.split(",").forEach((function(e){var t=e.trim(),r=t.replace(".",""),o=t.replace(/[[\]]/g,"").split("="),s=(0,v.Z)(o,1)[0],a=o.length>1?o[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":F(n.class)?i.class="".concat(n.class," ").concat(r):i.class=r;break;case"#":i.id=t.replace("#","");break;case"[":i[s]=a}})),te(n,i)}function he(e,t){if(H(e)){var i=t;V(i)||(i=!e.hidden),e.hidden=i}}function ue(e,t,i){if(Q(e))return Array.from(e).map((function(e){return ue(e,t,i)}));if(H(e)){var n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function de(e,t){return H(e)&&e.classList.contains(t)}function pe(e,t){var i=Element.prototype;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function fe(e){return this.elements.container.querySelectorAll(e)}function me(e){return this.elements.container.querySelector(e)}function ge(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];H(e)&&(e.focus({preventScroll:!0}),t&&ue(e,this.config.classNames.tabFocus))}var ve={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ye={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,i){var n=G.isIPhone&&i&&ye.playsinline,r=ye[e]||"html5"!==t;return{api:r,ui:r&&ye.rangeInput&&("video"!==e||!G.isIPhone||n)}},pip:!(G.isIPhone||!W(re("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||re("video").disablePictureInPicture)),airplay:W(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(e){if(J(e))return!1;var t=e.split("/"),i=(0,v.Z)(t,1)[0],n=e;if(!this.isHTML5||i!==this.type)return!1;Object.keys(ve).includes(n)&&(n+='; codecs="'.concat(ve[e],'"'));try{return Boolean(n&&this.media.canPlayType(n).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:function(){var e=document.createElement("input");return e.type="range","range"===e.type}(),touch:"ontouchstart"in document.documentElement,transitions:!1!==Y,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},be=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e}();function we(e,t,i){var n=this,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e&&"addEventListener"in e&&!J(t)&&W(i)){var a=t.split(" "),l=s;be&&(l={passive:o,capture:s}),a.forEach((function(t){n&&n.eventListeners&&r&&n.eventListeners.push({element:e,type:t,callback:i,options:l}),e[r?"addEventListener":"removeEventListener"](t,i,l)}))}}function ke(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];we.call(this,e,t,i,!0,n,r)}function xe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];we.call(this,e,t,i,!1,n,r)}function _e(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=function s(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];xe(e,i,s,r,o),n.apply(t,l)};we.call(this,e,i,s,!0,r,o)}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(H(e)&&!J(t)){var r=new CustomEvent(t,{bubbles:i,detail:A(A({},n),{},{plyr:this})});e.dispatchEvent(r)}}function Oe(){this&&this.eventListeners&&(this.eventListeners.forEach((function(e){var t=e.element,i=e.type,n=e.callback,r=e.options;t.removeEventListener(i,n,r)})),this.eventListeners=[])}function Ce(){var e=this;return new Promise((function(t){return e.ready?setTimeout(t,0):ke.call(e,e.elements.container,"ready",t)})).then((function(){}))}function Te(e){(function(e){return P(e,Promise)&&L(e.then)})(e)&&e.then(null,(function(){}))}function Ae(e){return $(e)?e.filter((function(t,i){return e.indexOf(t)===i})):e}function Pe(e,t){return $(e)&&e.length?e.reduce((function(e,i){return Math.abs(i-t)<Math.abs(e-t)?i:e})):null}function Me(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}var Ee=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((function(e,t){var i=(0,v.Z)(t,2),n=i[0],r=i[1];return A(A({},e),{},(0,y.Z)({},n/r,[n,r]))}),{});function De(e){return!!($(e)||F(e)&&e.includes(":"))&&($(e)?e:e.split(":")).map(Number).every(j)}function Le(e){if(!$(e)||!e.every(j))return null;var t=(0,v.Z)(e,2),i=t[0],n=t[1],r=function e(t,i){return 0===i?t:e(i,t%i)}(i,n);return[i/r,n/r]}function Re(e){var t=function(e){return De(e)?e.split(":").map(Number):null},i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!J(this.embed)&&$(this.embed.ratio)&&(i=this.embed.ratio),null===i&&this.isHTML5){var n=this.media;i=[n.videoWidth,n.videoHeight]}return Le(i)}function Ie(e){if(!this.isVideo)return{};var t=this.elements.wrapper,i=Re.call(this,e);if(!$(i))return{};var n=Le(i),r=(0,v.Z)(n,2),o=r[0],s=r[1],a=100/o*s;if(Me("aspect-ratio: ".concat(o,"/").concat(s))?t.style.aspectRatio="".concat(o,"/").concat(s):t.style.paddingBottom="".concat(a,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var l=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),c=(l-a)/(l/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform="translateY(-".concat(c,"%)")}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function Ne(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.05,n=e/t,r=Pe(Object.keys(Ee),n);return Math.abs(r-n)<=i?Ee[r]:[e,t]}var ze={getSources:function(){var e=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(t){var i=t.getAttribute("type");return!!J(i)||ye.mime.call(e,i)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:ze.getSources.call(this).map((function(e){return Number(e.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var e=this;e.options.speed=e.config.speed.options,J(this.config.ratio)||Ie.call(e),Object.defineProperty(e.media,"quality",{get:function(){var t=ze.getSources.call(e).find((function(t){return t.getAttribute("src")===e.source}));return t&&Number(t.getAttribute("size"))},set:function(t){if(e.quality!==t){if(e.config.quality.forced&&W(e.config.quality.onChange))e.config.quality.onChange(t);else{var i=ze.getSources.call(e).find((function(e){return Number(e.getAttribute("size"))===t}));if(!i)return;var n=e.media,r=n.currentTime,_n=n.paused,o=n.preload,s=n.readyState,a=n.playbackRate;e.media.src=i.getAttribute("src"),("none"!==o||s)&&(e.once("loadedmetadata",(function(){e.speed=a,e.currentTime=r,_n||Te(e.play())})),e.media.load())}Se.call(e,e.media,"qualitychange",!1,{quality:t})}}})}},cancelRequests:function(){this.isHTML5&&(se(ze.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Be(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return J(e)?e:e.toString().replace(/{(\d+)}/g,(function(e,t){return i[t].toString()}))}var je=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(new RegExp(e.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),t.toString())},Fe=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}))};function Ve(e){var t=document.createElement("div");return t.appendChild(e),t.innerHTML}var We={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},$e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(J(e)||J(t))return"";var i=ee(t.i18n,e);if(J(i))return Object.keys(We).includes(e)?We[e]:"";var n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((function(e){var t=(0,v.Z)(e,2),n=t[0],r=t[1];i=je(i,n,r)})),i},Qe=function(){function t(i){var n=this;(0,m.Z)(this,t),e(this,"get",(function(e){if(!t.supported||!n.enabled)return null;var i=window.localStorage.getItem(n.key);if(J(i))return null;var r=JSON.parse(i);return F(e)&&e.length?r[e]:r})),e(this,"set",(function(e){if(t.supported&&n.enabled&&B(e)){var i=n.get();J(i)&&(i={}),te(i,e);try{window.localStorage.setItem(n.key,JSON.stringify(i))}catch(e){}}})),this.enabled=i.config.storage.enabled,this.key=i.config.storage.key}return(0,g.Z)(t,null,[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;var e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}]),t}();function He(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(i,n){try{var r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",(function(){if("text"===t)try{i(JSON.parse(r.responseText))}catch(e){i(r.responseText)}else i(r.response)})),r.addEventListener("error",(function(){throw new Error(r.status)})),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){n(e)}}))}function qe(e,t,i){if(F(e)){var n="cache",r=F(t),o=function(){return null!==document.getElementById(t)},s=function(e,t){e.innerHTML=t,r&&o()||i.appendChild(e)};if(!r||!o()){var a=Qe.supported,l=document.createElement("div");if(l.setAttribute("hidden",""),r&&l.setAttribute("id",t),a){var c=window.localStorage.getItem("".concat(n,"-").concat(t));if(null!==c){var h=JSON.parse(c);s(l,h.content)}}He(e).then((function(e){if(!J(e)){if(a)try{window.localStorage.setItem("".concat(n,"-").concat(t),JSON.stringify({content:e}))}catch(e){}s(l,e)}})).catch((function(){}))}}}var Ze=function(e){return Math.trunc(e/60/60%60,10)};function Ue(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!j(e))return Ue(void 0,t,i);var n,r=function(e){return"0".concat(e).slice(-2)},o=Ze(e),s=(n=e,Math.trunc(n/60%60,10)),a=function(e){return Math.trunc(e%60,10)}(e);return o=t||o>0?"".concat(o,":"):"","".concat(i&&e>0?"-":"").concat(o).concat(r(s),":").concat(r(a))}var Xe={getIconUrl:function(){var e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||G.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements:function(){try{return this.elements.controls=me.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:fe.call(this,this.config.selectors.buttons.play),pause:me.call(this,this.config.selectors.buttons.pause),restart:me.call(this,this.config.selectors.buttons.restart),rewind:me.call(this,this.config.selectors.buttons.rewind),fastForward:me.call(this,this.config.selectors.buttons.fastForward),mute:me.call(this,this.config.selectors.buttons.mute),pip:me.call(this,this.config.selectors.buttons.pip),airplay:me.call(this,this.config.selectors.buttons.airplay),settings:me.call(this,this.config.selectors.buttons.settings),captions:me.call(this,this.config.selectors.buttons.captions),fullscreen:me.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=me.call(this,this.config.selectors.progress),this.elements.inputs={seek:me.call(this,this.config.selectors.inputs.seek),volume:me.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:me.call(this,this.config.selectors.display.buffer),currentTime:me.call(this,this.config.selectors.display.currentTime),duration:me.call(this,this.config.selectors.display.duration)},H(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon:function(e,t){var i="http://www.w3.org/2000/svg",n=Xe.getIconUrl.call(this),r="".concat(n.cors?"":n.url,"#").concat(this.config.iconPrefix),o=document.createElementNS(i,"svg");ne(o,te(t,{"aria-hidden":"true",focusable:"false"}));var s=document.createElementNS(i,"use"),a="".concat(r,"-").concat(e);return"href"in s&&s.setAttributeNS("http://www.w3.org/1999/xlink","href",a),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),o.appendChild(s),o},createLabel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=$e(e,this.config);return re("span",A(A({},t),{},{class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),i)},createBadge:function(e){if(J(e))return null;var t=re("span",{class:this.config.classNames.menu.value});return t.appendChild(re("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var i=this,n=te({},t),r=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e=je(e,"-"," "),e=je(e,"_"," "),e=Fe(e),je(e," ","")}(e),e.charAt(0).toLowerCase()+e.slice(1)}(e),o={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(e){Object.keys(n).includes(e)&&(o[e]=n[e],delete n[e])})),"button"!==o.element||Object.keys(n).includes("type")||(n.type="button"),Object.keys(n).includes("class")?n.class.split(" ").some((function(e){return e===i.config.classNames.control}))||te(n,{class:"".concat(n.class," ").concat(this.config.classNames.control)}):n.class=this.config.classNames.control,e){case"play":o.toggle=!0,o.label="play",o.labelPressed="pause",o.icon="play",o.iconPressed="pause";break;case"mute":o.toggle=!0,o.label="mute",o.labelPressed="unmute",o.icon="volume",o.iconPressed="muted";break;case"captions":o.toggle=!0,o.label="enableCaptions",o.labelPressed="disableCaptions",o.icon="captions-off",o.iconPressed="captions-on";break;case"fullscreen":o.toggle=!0,o.label="enterFullscreen",o.labelPressed="exitFullscreen",o.icon="enter-fullscreen",o.iconPressed="exit-fullscreen";break;case"play-large":n.class+=" ".concat(this.config.classNames.control,"--overlaid"),r="play",o.label="play",o.icon="play";break;default:J(o.label)&&(o.label=r),J(o.icon)&&(o.icon=e)}var s=re(o.element);return o.toggle?(s.appendChild(Xe.createIcon.call(this,o.iconPressed,{class:"icon--pressed"})),s.appendChild(Xe.createIcon.call(this,o.icon,{class:"icon--not-pressed"})),s.appendChild(Xe.createLabel.call(this,o.labelPressed,{class:"label--pressed"})),s.appendChild(Xe.createLabel.call(this,o.label,{class:"label--not-pressed"}))):(s.appendChild(Xe.createIcon.call(this,o.icon)),s.appendChild(Xe.createLabel.call(this,o.label))),te(n,ce(this.config.selectors.buttons[r],n)),ne(s,n),"play"===r?($(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(s)):this.elements.buttons[r]=s,s},createRange:function(e,t){var i=re("input",te(ce(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":$e(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Xe.updateRangeFill.call(this,i),C.setup(i),i},createProgress:function(e,t){var i=re("progress",te(ce(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(re("span",null,"0"));var n={played:"played",buffer:"buffered"}[e],r=n?$e(n,this.config):"";i.innerText="% ".concat(r.toLowerCase())}return this.elements.display[e]=i,i},createTime:function(e,t){var i=ce(this.config.selectors.display[e],t),n=re("div",te(i,{class:"".concat(i.class?i.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":$e(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts:function(e,t){var i=this;ke.call(this,e,"keydown keyup",(function(n){if(["Space","ArrowUp","ArrowDown","ArrowRight"].includes(n.key)&&(n.preventDefault(),n.stopPropagation(),"keydown"!==n.type)){var r,o=pe(e,'[role="menuitemradio"]');!o&&["Space","ArrowRight"].includes(n.key)?Xe.showMenuPanel.call(i,t,!0):"Space"!==n.key&&("ArrowDown"===n.key||o&&"ArrowRight"===n.key?(r=e.nextElementSibling,H(r)||(r=e.parentNode.firstElementChild)):(r=e.previousElementSibling,H(r)||(r=e.parentNode.lastElementChild)),ge.call(i,r,!0))}}),!1),ke.call(this,e,"keyup",(function(e){"Return"===e.key&&Xe.focusFirstMenuItem.call(i,null,!0)}))},createMenuItem:function(e){var t=this,i=e.value,n=e.list,r=e.type,o=e.title,s=e.badge,a=void 0===s?null:s,l=e.checked,c=void 0!==l&&l,h=ce(this.config.selectors.inputs[r]),u=re("button",te(h,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(h.class?h.class:"").trim(),"aria-checked":c,value:i})),d=re("span");d.innerHTML=o,H(a)&&d.appendChild(a),u.appendChild(d),Object.defineProperty(u,"checked",{enumerable:!0,get:function(){return"true"===u.getAttribute("aria-checked")},set:function(e){e&&Array.from(u.parentNode.children).filter((function(e){return pe(e,'[role="menuitemradio"]')})).forEach((function(e){return e.setAttribute("aria-checked","false")})),u.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(u,"click keyup",(function(e){if(!Z(e)||"Space"===e.key){switch(e.preventDefault(),e.stopPropagation(),u.checked=!0,r){case"language":t.currentTrack=Number(i);break;case"quality":t.quality=i;break;case"speed":t.speed=parseFloat(i)}Xe.showMenuPanel.call(t,"home",Z(e))}}),r,!1),Xe.bindMenuItemShortcuts.call(this,u,r),n.appendChild(u)},formatTime:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return j(e)?Ue(e,Ze(this.duration)>0,t):e},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];H(e)&&j(t)&&(e.innerText=Xe.formatTime(t,i))},updateVolume:function(){this.supported.ui&&(H(this.elements.inputs.volume)&&Xe.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),H(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;H(e)&&(e.value=t,Xe.updateRangeFill.call(this,e))},updateProgress:function(e){var t=this;if(this.supported.ui&&q(e)){var i,n,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":i=this.currentTime,n=this.duration,r=0===i||0===n||Number.isNaN(i)||Number.isNaN(n)?0:(i/n*100).toFixed(2),"timeupdate"===e.type&&Xe.setRange.call(this,this.elements.inputs.seek,r);break;case"playing":case"progress":!function(e,i){var n=j(i)?i:0,r=H(e)?e:t.elements.display.buffer;if(H(r)){r.value=n;var o=r.getElementsByTagName("span")[0];H(o)&&(o.childNodes[0].nodeValue=n)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(e){var t=q(e)?e.target:e;if(H(t)&&"range"===t.getAttribute("type")){if(pe(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);var i=Xe.formatTime(this.currentTime),n=Xe.formatTime(this.duration),r=$e("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",i).replace("{duration}",n))}else if(pe(t,this.config.selectors.inputs.volume)){var o=100*t.value;t.setAttribute("aria-valuenow",o),t.setAttribute("aria-valuetext","".concat(o.toFixed(1),"%"))}else t.setAttribute("aria-valuenow",t.value);G.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip:function(e){var t,i;if(this.config.tooltips.seek&&H(this.elements.inputs.seek)&&H(this.elements.display.seekTooltip)&&0!==this.duration){var n=this.elements.display.seekTooltip,r="".concat(this.config.classNames.tooltip,"--visible"),o=function(e){return ue(n,r,e)};if(this.touch)o(!1);else{var s=0,a=this.elements.progress.getBoundingClientRect();if(q(e))s=100/a.width*(e.pageX-a.left);else{if(!de(n,r))return;s=parseFloat(n.style.left,10)}s<0?s=0:s>100&&(s=100);var l=this.duration/100*s;n.innerText=Xe.formatTime(l);var c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((function(e){return e.time===Math.round(l)}));c?(n.insertAdjacentHTML("afterbegin","".concat(c.label,"<br>")),n.classList.add("plyr__tooltip--label")):n.classList.remove("plyr__tooltip--label"),n.style.left="".concat(s,"%"),q(e)&&["mouseenter","mouseleave"].includes(e.type)&&o("mouseenter"===e.type)}}},timeUpdate:function(e){var t=!H(this.elements.display.duration)&&this.config.invertTime;Xe.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Xe.updateProgress.call(this,e)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return he(this.elements.display.currentTime,!0),void he(this.elements.progress,!0);H(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var e=H(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Xe.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Xe.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Xe.setMarkers.call(this),Xe.updateSeekTooltip.call(this)}},toggleMenuButton:function(e,t){he(this.elements.settings.buttons[e],!t)},updateSetting:function(e,t,i){var n=this.elements.settings.panels[e],r=null,o=t;if("captions"===e)r=this.currentTrack;else{if(r=J(i)?this[e]:i,J(r)&&(r=this.config[e].default),!J(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn("Unsupported value of '".concat(r,"' for ").concat(e));if(!this.config[e].options.includes(r))return void this.debug.warn("Disabled value of '".concat(r,"' for ").concat(e))}if(H(o)||(o=n&&n.querySelector('[role="menu"]')),H(o)){this.elements.settings.buttons[e].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Xe.getLabel.call(this,e,r);var s=o&&o.querySelector('[value="'.concat(r,'"]'));H(s)&&(s.checked=!0)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?$e("normal",this.config):"".concat(t,"×");case"quality":if(j(t)){if(0===t)return $e("auto",this.config);var i=$e("qualityLabel.".concat(t),this.config);return i.length?i:"".concat(t,"p")}return Fe(t);case"captions":return Ke.getLabel.call(this);default:return null}},setQualityMenu:function(e){var t=this;if(H(this.elements.settings.panels.quality)){var i="quality",n=this.elements.settings.panels.quality.querySelector('[role="menu"]');$(e)&&(this.options.quality=Ae(e).filter((function(e){return t.config.quality.options.includes(e)})));var r=!J(this.options.quality)&&this.options.quality.length>1;if(Xe.toggleMenuButton.call(this,i,r),ae(n),Xe.checkMenu.call(this),r){var o=function(e){var i=$e("qualityBadge.".concat(e),t.config);return i.length?Xe.createBadge.call(t,i):null};this.options.quality.sort((function(e,i){var n=t.config.quality.options;return n.indexOf(e)>n.indexOf(i)?1:-1})).forEach((function(e){Xe.createMenuItem.call(t,{value:e,list:n,type:i,title:Xe.getLabel.call(t,"quality",e),badge:o(e)})})),Xe.updateSetting.call(this,i,n)}}},setCaptionsMenu:function(){var e=this;if(H(this.elements.settings.panels.captions)){var t="captions",i=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=Ke.getTracks.call(this),r=Boolean(n.length);if(Xe.toggleMenuButton.call(this,t,r),ae(i),Xe.checkMenu.call(this),r){var o=n.map((function(t,n){return{value:n,checked:e.captions.toggled&&e.currentTrack===n,title:Ke.getLabel.call(e,t),badge:t.language&&Xe.createBadge.call(e,t.language.toUpperCase()),list:i,type:"language"}}));o.unshift({value:-1,checked:!this.captions.toggled,title:$e("disabled",this.config),list:i,type:"language"}),o.forEach(Xe.createMenuItem.bind(this)),Xe.updateSetting.call(this,t,i)}}},setSpeedMenu:function(){var e=this;if(H(this.elements.settings.panels.speed)){var t="speed",i=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(t){return t>=e.minimumSpeed&&t<=e.maximumSpeed}));var n=!J(this.options.speed)&&this.options.speed.length>1;Xe.toggleMenuButton.call(this,t,n),ae(i),Xe.checkMenu.call(this),n&&(this.options.speed.forEach((function(n){Xe.createMenuItem.call(e,{value:n,list:i,type:t,title:Xe.getLabel.call(e,"speed",n)})})),Xe.updateSetting.call(this,t,i))}},checkMenu:function(){var e=this.elements.settings.buttons,t=!J(e)&&Object.values(e).some((function(e){return!e.hidden}));he(this.elements.settings.menu,!t)},focusFirstMenuItem:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var i=e;H(i)||(i=Object.values(this.elements.settings.panels).find((function(e){return!e.hidden})));var n=i.querySelector('[role^="menuitem"]');ge.call(this,n,t)}},toggleMenu:function(e){var t=this.elements.settings.popup,i=this.elements.buttons.settings;if(H(t)&&H(i)){var n=t.hidden,r=n;if(V(e))r=e;else if(Z(e)&&"Escape"===e.key)r=!1;else if(q(e)){var o=W(e.composedPath)?e.composedPath()[0]:e.target,s=t.contains(o);if(s||!s&&e.target!==i&&r)return}i.setAttribute("aria-expanded",r),he(t,!r),ue(this.elements.container,this.config.classNames.menu.open,r),r&&Z(e)?Xe.focusFirstMenuItem.call(this,null,!0):r||n||ge.call(this,i,Z(e))}},getMenuSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);var i=t.scrollWidth,n=t.scrollHeight;return se(t),{width:i,height:n}},showMenuPanel:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(t));if(H(n)){var r=n.parentNode,o=Array.from(r.children).find((function(e){return!e.hidden}));if(ye.transitions&&!ye.reducedMotion){r.style.width="".concat(o.scrollWidth,"px"),r.style.height="".concat(o.scrollHeight,"px");var s=Xe.getMenuSize.call(this,n),a=function t(i){i.target===r&&["width","height"].includes(i.propertyName)&&(r.style.width="",r.style.height="",xe.call(e,r,Y,t))};ke.call(this,r,Y,a),r.style.width="".concat(s.width,"px"),r.style.height="".concat(s.height,"px")}he(o,!0),he(n,!1),Xe.focusFirstMenuItem.call(this,n,i)}},setDownloadUrl:function(){var e=this.elements.buttons.download;H(e)&&e.setAttribute("href",this.download)},create:function(e){var t=this,i=Xe.bindMenuItemShortcuts,n=Xe.createButton,r=Xe.createProgress,o=Xe.createRange,s=Xe.createTime,a=Xe.setQualityMenu,l=Xe.setSpeedMenu,c=Xe.showMenuPanel;this.elements.controls=null,$(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(n.call(this,"play-large"));var h=re("div",ce(this.config.selectors.controls.wrapper));this.elements.controls=h;var u={class:"plyr__controls__item"};return Ae($(this.config.controls)?this.config.controls:[]).forEach((function(a){if("restart"===a&&h.appendChild(n.call(t,"restart",u)),"rewind"===a&&h.appendChild(n.call(t,"rewind",u)),"play"===a&&h.appendChild(n.call(t,"play",u)),"fast-forward"===a&&h.appendChild(n.call(t,"fast-forward",u)),"progress"===a){var l=re("div",{class:"".concat(u.class," plyr__progress__container")}),d=re("div",ce(t.config.selectors.progress));if(d.appendChild(o.call(t,"seek",{id:"plyr-seek-".concat(e.id)})),d.appendChild(r.call(t,"buffer")),t.config.tooltips.seek){var p=re("span",{class:t.config.classNames.tooltip},"00:00");d.appendChild(p),t.elements.display.seekTooltip=p}t.elements.progress=d,l.appendChild(t.elements.progress),h.appendChild(l)}if("current-time"===a&&h.appendChild(s.call(t,"currentTime",u)),"duration"===a&&h.appendChild(s.call(t,"duration",u)),"mute"===a||"volume"===a){var f=t.elements.volume;if(H(f)&&h.contains(f)||(f=re("div",te({},u,{class:"".concat(u.class," plyr__volume").trim()})),t.elements.volume=f,h.appendChild(f)),"mute"===a&&f.appendChild(n.call(t,"mute")),"volume"===a&&!G.isIos){var m={max:1,step:.05,value:t.config.volume};f.appendChild(o.call(t,"volume",te(m,{id:"plyr-volume-".concat(e.id)})))}}if("captions"===a&&h.appendChild(n.call(t,"captions",u)),"settings"===a&&!J(t.config.settings)){var g=re("div",te({},u,{class:"".concat(u.class," plyr__menu").trim(),hidden:""}));g.appendChild(n.call(t,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(e.id),"aria-expanded":!1}));var v=re("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(e.id),hidden:""}),y=re("div"),b=re("div",{id:"plyr-settings-".concat(e.id,"-home")}),w=re("div",{role:"menu"});b.appendChild(w),y.appendChild(b),t.elements.settings.panels.home=b,t.config.settings.forEach((function(n){var r=re("button",te(ce(t.config.selectors.buttons.settings),{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));i.call(t,r,n),ke.call(t,r,"click",(function(){c.call(t,n,!1)}));var o=re("span",null,$e(n,t.config)),s=re("span",{class:t.config.classNames.menu.value});s.innerHTML=e[n],o.appendChild(s),r.appendChild(o),w.appendChild(r);var a=re("div",{id:"plyr-settings-".concat(e.id,"-").concat(n),hidden:""}),l=re("button",{type:"button",class:"".concat(t.config.classNames.control," ").concat(t.config.classNames.control,"--back")});l.appendChild(re("span",{"aria-hidden":!0},$e(n,t.config))),l.appendChild(re("span",{class:t.config.classNames.hidden},$e("menuBack",t.config))),ke.call(t,a,"keydown",(function(e){"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),c.call(t,"home",!0))}),!1),ke.call(t,l,"click",(function(){c.call(t,"home",!1)})),a.appendChild(l),a.appendChild(re("div",{role:"menu"})),y.appendChild(a),t.elements.settings.buttons[n]=r,t.elements.settings.panels[n]=a})),v.appendChild(y),g.appendChild(v),h.appendChild(g),t.elements.settings.popup=v,t.elements.settings.menu=g}if("pip"===a&&ye.pip&&h.appendChild(n.call(t,"pip",u)),"airplay"===a&&ye.airplay&&h.appendChild(n.call(t,"airplay",u)),"download"===a){var k=te({},u,{element:"a",href:t.download,target:"_blank"});t.isHTML5&&(k.download="");var x=t.config.urls.download;!X(x)&&t.isEmbed&&te(k,{icon:"logo-".concat(t.provider),label:t.provider}),h.appendChild(n.call(t,"download",k))}"fullscreen"===a&&h.appendChild(n.call(t,"fullscreen",u))})),this.isHTML5&&a.call(this,ze.getQualityOptions.call(this)),l.call(this),h},inject:function(){var e=this;if(this.config.loadSprite){var t=Xe.getIconUrl.call(this);t.cors&&qe(t.url,"sprite-plyr",this.elements.container)}this.id=Math.floor(1e4*Math.random());var i=null;this.elements.controls=null;var n,r={id:this.id,seektime:this.config.seekTime,title:this.config.title},o=!0;if(W(this.config.controls)&&(this.config.controls=this.config.controls.call(this,r)),this.config.controls||(this.config.controls=[]),H(this.config.controls)||F(this.config.controls)?i=this.config.controls:(i=Xe.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ke.getLabel.call(this)}),o=!1),o&&F(this.config.controls)&&(i=function(e){var t=e;return Object.entries(r).forEach((function(e){var i=(0,v.Z)(e,2),n=i[0],r=i[1];t=je(t,"{".concat(n,"}"),r)})),t}(i)),F(this.config.selectors.controls.container)&&(n=document.querySelector(this.config.selectors.controls.container)),H(n)||(n=this.elements.container),n[H(i)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",i),H(this.elements.controls)||Xe.findElements.call(this),!J(this.elements.buttons)){var s=function(t){var i=e.config.classNames.controlPressed;t.setAttribute("aria-pressed","false"),Object.defineProperty(t,"pressed",{configurable:!0,enumerable:!0,get:function(){return de(t,i)},set:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ue(t,i,e),t.setAttribute("aria-pressed",e?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(e){$(e)||Q(e)?Array.from(e).filter(Boolean).forEach(s):s(e)}))}if(G.isEdge&&K(n),this.config.tooltips.controls){var a=this.config,l=a.classNames,c=a.selectors,h="".concat(c.controls.wrapper," ").concat(c.labels," .").concat(l.hidden),u=fe.call(this,h);Array.from(u).forEach((function(t){ue(t,e.config.classNames.hidden,!1),ue(t,e.config.classNames.tooltip,!0)}))}},setMediaMetadata:function(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers:function(){var e,t,i=this;if(this.duration&&!this.elements.markers){var n=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((function(e){var t=e.time;return t>0&&t<i.duration}));if(null!=n&&n.length){var r=document.createDocumentFragment(),o=document.createDocumentFragment(),s=null,a="".concat(this.config.classNames.tooltip,"--visible"),l=function(e){return ue(s,a,e)};n.forEach((function(e){var t=re("span",{class:i.config.classNames.marker},""),n=e.time/i.duration*100+"%";s&&(t.addEventListener("mouseenter",(function(){e.label||(s.style.left=n,s.innerHTML=e.label,l(!0))})),t.addEventListener("mouseleave",(function(){l(!1)}))),t.addEventListener("click",(function(){i.currentTime=e.time})),t.style.left=n,o.appendChild(t)})),r.appendChild(o),this.config.tooltips.seek||(s=re("span",{class:this.config.classNames.tooltip},""),r.appendChild(s)),this.elements.markers={points:o,tip:s},this.elements.progress.appendChild(r)}}}};function Je(e){var t=e;if(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]){var i=document.createElement("a");i.href=t,t=i.href}try{return new URL(t)}catch(e){return null}}function Ye(e){var t=new URLSearchParams;return B(e)&&Object.entries(e).forEach((function(e){var i=(0,v.Z)(e,2),n=i[0],r=i[1];t.set(n,r)})),t}var Ke={setup:function(){var e;if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!ye.textTracks)$(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Xe.setCaptionsMenu.call(this);else{var t,i;if(H(this.elements.captions)||(this.elements.captions=re("div",ce(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),t=this.elements.captions,i=this.elements.wrapper,H(t)&&H(i)&&i.parentNode.insertBefore(t,i.nextSibling)),G.isIE&&window.URL){var n=this.media.querySelectorAll("track");Array.from(n).forEach((function(e){var t=e.getAttribute("src"),i=Je(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&He(t,"blob").then((function(t){e.setAttribute("src",window.URL.createObjectURL(t))})).catch((function(){se(e)}))}))}var r=Ae((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(e){return e.split("-")[0]}))),o=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===o&&(e=r,o=(0,v.Z)(e,1)[0]);var s=this.storage.get("captions");if(V(s)||(s=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:s,language:o,languages:r}),this.isHTML5){var a=this.config.captions.update?"addtrack removetrack":"removetrack";ke.call(this,this.media.textTracks,a,Ke.update.bind(this))}setTimeout(Ke.update.bind(this),0)}},update:function(){var e=this,t=Ke.getTracks.call(this,!0),i=this.captions,n=i.active,r=i.language,o=i.meta,s=i.currentTrackNode,a=Boolean(t.find((function(e){return e.language===r})));this.isHTML5&&this.isVideo&&t.filter((function(e){return!o.get(e)})).forEach((function(t){e.debug.log("Track added",t),o.set(t,{default:"showing"===t.mode}),"showing"===t.mode&&(t.mode="hidden"),ke.call(e,t,"cuechange",(function(){return Ke.updateCues.call(e)}))})),(a&&this.language!==r||!t.includes(s))&&(Ke.setLanguage.call(this,r),Ke.toggle.call(this,n&&a)),this.elements&&ue(this.elements.container,this.config.classNames.captions.enabled,!J(t)),$(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Xe.setCaptionsMenu.call(this)},toggle:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var n=this.captions.toggled,r=this.config.classNames.captions.active,o=z(e)?!n:e;if(o!==n){if(i||(this.captions.active=o,this.storage.set({captions:o})),!this.language&&o&&!i){var s=Ke.getTracks.call(this),a=Ke.findTrack.call(this,[this.captions.language].concat((0,f.Z)(this.captions.languages)),!0);return this.captions.language=a.language,void Ke.set.call(this,s.indexOf(a))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=o),ue(this.elements.container,r,o),this.captions.toggled=o,Xe.updateSetting.call(this,"captions"),Se.call(this,this.media,o?"captionsenabled":"captionsdisabled")}setTimeout((function(){o&&t.captions.toggled&&t.captions.currentTrackNode&&(t.captions.currentTrackNode.mode="hidden")}))}},set:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=Ke.getTracks.call(this);if(-1!==e)if(j(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;var n=i[e],r=(n||{}).language;this.captions.currentTrackNode=n,Xe.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),Se.call(this,this.media,"languagechange")}Ke.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ke.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ke.toggle.call(this,!1,t)},setLanguage:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(F(e)){var i=e.toLowerCase();this.captions.language=i;var n=Ke.getTracks.call(this),r=Ke.findTrack.call(this,[i]);Ke.set.call(this,n.indexOf(r),t)}else this.debug.warn("Invalid language argument",e)},getTracks:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter((function(i){return!e.isHTML5||t||e.captions.meta.has(i)})).filter((function(e){return["captions","subtitles"].includes(e.kind)}))},findTrack:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Ke.getTracks.call(this),o=function(e){return Number((i.captions.meta.get(e)||{}).default)},s=Array.from(r).sort((function(e,t){return o(t)-o(e)}));return e.every((function(e){return t=s.find((function(t){return t.language===e})),!t})),t||(n?s[0]:void 0)},getCurrentTrack:function(){return Ke.getTracks.call(this)[this.currentTrack]},getLabel:function(e){var t=e;return!U(t)&&ye.textTracks&&this.captions.toggled&&(t=Ke.getCurrentTrack.call(this)),U(t)?J(t.label)?J(t.language)?$e("enabled",this.config):e.language.toUpperCase():t.label:$e("disabled",this.config)},updateCues:function(e){if(this.supported.ui)if(H(this.elements.captions))if(z(e)||Array.isArray(e)){var t=e;if(!t){var i=Ke.getCurrentTrack.call(this);t=Array.from((i||{}).activeCues||[]).map((function(e){return e.getCueAsHTML()})).map(Ve)}var n=t.map((function(e){return e.trim()})).join("\n");if(n!==this.elements.captions.innerHTML){ae(this.elements.captions);var r=re("span",ce(this.config.selectors.caption));r.innerHTML=n,this.elements.captions.appendChild(r),Se.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",e);else this.debug.warn("No captions element to render to")}},Ge={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"},auto:"AUTO"},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},et="picture-in-picture",tt={html5:"html5",youtube:"youtube",vimeo:"vimeo"},it="video",nt=function(){},rt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,m.Z)(this,e),this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}return(0,g.Z)(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):nt}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):nt}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):nt}}]),e}(),ot=function(){function t(i){var n=this;(0,m.Z)(this,t),e(this,"onChange",(function(){if(n.enabled){var e=n.player.elements.buttons.fullscreen;H(e)&&(e.pressed=n.active);var t=n.target===n.player.media?n.target:n.player.elements.container;Se.call(n.player,t,n.active?"enterfullscreen":"exitfullscreen",!0)}})),e(this,"toggleFallback",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e?n.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(n.scrollPosition.x,n.scrollPosition.y),document.body.style.overflow=e?"hidden":"",ue(n.target,n.player.config.classNames.fullscreen.fallback,e),G.isIos){var t=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";t||(t=document.createElement("meta")).setAttribute("name","viewport");var r=F(t.content)&&t.content.includes(i);e?(n.cleanupViewport=!r,r||(t.content+=",".concat(i))):n.cleanupViewport&&(t.content=t.content.split(",").filter((function(e){return e.trim()!==i})).join(","))}n.onChange()})),e(this,"trapFocus",(function(e){if(!G.isIos&&n.active&&"Tab"===e.key){var t=document.activeElement,i=fe.call(n.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),r=(0,v.Z)(i,1)[0],o=i[i.length-1];t!==o||e.shiftKey?t===r&&e.shiftKey&&(o.focus(),e.preventDefault()):(r.focus(),e.preventDefault())}})),e(this,"update",(function(){var e;n.enabled?(e=n.forceFallback?"Fallback (forced)":t.native?"Native":"Fallback",n.player.debug.log("".concat(e," fullscreen enabled"))):n.player.debug.log("Fullscreen not supported and fallback disabled"),ue(n.player.elements.container,n.player.config.classNames.fullscreen.enabled,n.enabled)})),e(this,"enter",(function(){n.enabled&&(G.isIos&&n.player.config.fullscreen.iosNative?n.player.isVimeo?n.player.embed.requestFullscreen():n.target.webkitEnterFullscreen():!t.native||n.forceFallback?n.toggleFallback(!0):n.prefix?J(n.prefix)||n.target["".concat(n.prefix,"Request").concat(n.property)]():n.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(function(){if(n.enabled)if(G.isIos&&n.player.config.fullscreen.iosNative)n.target.webkitExitFullscreen(),Te(n.player.play());else if(!t.native||n.forceFallback)n.toggleFallback(!1);else if(n.prefix){if(!J(n.prefix)){var e="moz"===n.prefix?"Cancel":"Exit";document["".concat(n.prefix).concat(e).concat(n.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(function(){n.active?n.exit():n.enter()})),this.player=i,this.prefix=t.prefix,this.property=t.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===i.config.fullscreen.fallback,this.player.elements.fullscreen=i.config.fullscreen.container&&function(e,t){return(Element.prototype.closest||function(){var e=this;do{if(pe.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,i.config.fullscreen.container),ke.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){n.onChange()})),ke.call(this.player,this.player.elements.container,"dblclick",(function(e){if(!H(n.player.elements.controls)||!n.player.elements.controls.contains(e.target)){var t=n.player.elements.container.querySelector("presto-search-bar-ui");H(t)&&t.contains(e.target)||n.player.listeners.proxy(e,n.toggle,"fullscreen")}})),ke.call(this,this.player.elements.container,"keydown",(function(e){return n.trapFocus(e)})),this.update()}return(0,g.Z)(t,[{key:"usingNative",get:function(){return t.native&&!this.forceFallback}},{key:"enabled",get:function(){return(t.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!t.native||this.forceFallback)return de(this.target,this.player.config.classNames.fullscreen.fallback);var e=this.prefix?this.target.getRootNode()["".concat(this.prefix).concat(this.property,"Element")]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}},{key:"target",get:function(){return G.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(W(document.exitFullscreen))return"";var e="";return["webkit","moz","ms"].some((function(t){return!(!W(document["".concat(t,"ExitFullscreen")])&&!W(document["".concat(t,"CancelFullScreen")])||(e=t,0))})),e}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),t}();function st(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(i,n){var r=new Image,o=function(){delete r.onload,delete r.onerror,(r.naturalWidth>=t?i:n)(r)};Object.assign(r,{onload:o,onerror:o,src:e})}))}var at={addStyleHook:function(){ue(this.elements.container,this.config.selectors.container.replace(".",""),!0),ue(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var e=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void at.toggleNativeControls.call(this,!0);H(this.elements.controls)||(Xe.inject.call(this),this.listeners.controls()),at.toggleNativeControls.call(this),this.isHTML5&&Ke.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Xe.updateVolume.call(this),Xe.timeUpdate.call(this),Xe.durationUpdate.call(this),at.checkPlaying.call(this),ue(this.elements.container,this.config.classNames.pip.supported,ye.pip&&this.isHTML5&&this.isVideo),ue(this.elements.container,this.config.classNames.airplay.supported,ye.airplay&&this.isHTML5),ue(this.elements.container,this.config.classNames.isIos,G.isIos),ue(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){Se.call(e,e.media,"ready")}),0),at.setTitle.call(this),this.poster&&at.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&Xe.durationUpdate.call(this),this.config.mediaMetadata&&Xe.setMediaMetadata.call(this)},setTitle:function(){var e=$e("play",this.config);if(F(this.config.title)&&!J(this.config.title)&&(e+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(t){t.setAttribute("aria-label",e)})),this.isEmbed){var t=me.call(this,"iframe");if(!H(t))return;var i=J(this.config.title)?"video":this.config.title,n=$e("frameTitle",this.config);t.setAttribute("title",n.replace("{title}",i))}},togglePoster:function(e){ue(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster:function(e){var t=this;return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]||!this.poster?(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Ce.call(this).then((function(){return st(e)})).catch((function(i){throw e===t.poster&&at.togglePoster.call(t,!1),i})).then((function(){if(e!==t.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(t.elements.poster.style,{backgroundImage:"url('".concat(e,"')"),backgroundSize:""}),at.togglePoster.call(t,!0),e}))):Promise.reject(new Error("Poster already set"))},checkPlaying:function(e){var t=this;ue(this.elements.container,this.config.classNames.playing,this.playing),ue(this.elements.container,this.config.classNames.paused,this.paused),ue(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(e){Object.assign(e,{pressed:t.playing}),e.setAttribute("aria-label",$e(t.playing?"pause":"play",t.config))})),q(e)&&"timeupdate"===e.type||at.toggleControls.call(this)},checkLoading:function(e){var t=this;this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){ue(t.elements.container,t.config.classNames.loading,t.loading),at.toggleControls.call(t)}),this.loading?250:0)},toggleControls:function(e){var t=this.elements.controls;if(t&&this.config.hideControls){var i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles:function(){var e=this;Object.values(A({},this.media.style)).filter((function(e){return!J(e)&&F(e)&&e.startsWith("--plyr")})).forEach((function(t){e.elements.container.style.setProperty(t,e.media.style.getPropertyValue(t)),e.media.style.removeProperty(t)})),J(this.media.style)&&this.media.removeAttribute("style")}},lt=function(){function t(i){var n=this;(0,m.Z)(this,t),e(this,"firstTouch",(function(){var e=n.player,t=e.elements;e.touch=!0,ue(t.container,e.config.classNames.isTouch,!0)})),e(this,"setTabFocus",(function(e){var t=n.player,i=t.elements,r=e.key,o=e.type,s=e.timeStamp;if(clearTimeout(n.focusTimer),"keydown"!==o||"Tab"===r){"keydown"===o&&(n.lastKeyDown=s);var a=s-n.lastKeyDown<=20;("focus"!==o||a)&&(function(){var e=t.config.classNames.tabFocus;ue(fe.call(t,".".concat(e)),e,!1)}(),"focusout"!==o&&(n.focusTimer=setTimeout((function(){var e=document.activeElement;i.container.contains(e)&&ue(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))}})),e(this,"global",(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=n.player;t.config.keyboard.global&&we.call(t,window,"keydown keyup",n.handleKey,e,!1),we.call(t,document.body,"click",n.toggleMenu,e),_e.call(t,document.body,"touchstart",n.firstTouch),we.call(t,document.body,"keydown focus blur focusout",n.setTabFocus,e,!1,!0)})),e(this,"container",(function(){var e=n.player,t=e.config,i=e.elements,r=e.timers;!t.keyboard.global&&t.keyboard.focused&&ke.call(e,i.container,"keydown keyup",n.handleKey,!1),ke.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(t){var n=i.controls;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);var o=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(at.toggleControls.call(e,!0),o=e.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout((function(){return at.toggleControls.call(e,!1)}),o)}));var o=function(){if(e.isVimeo&&!e.config.vimeo.premium){var t=i.wrapper,n=e.fullscreen.active,r=Re.call(e),o=(0,v.Z)(r,2),s=o[0],a=o[1],l=Me("aspect-ratio: ".concat(s," / ").concat(a));if(n){var c=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],h=c[1],u=c[0]/h>s/a;l?(t.style.width=u?"auto":"100%",t.style.height=u?"100%":"auto"):(t.style.maxWidth=u?h/a*s+"px":null,t.style.margin=u?"0 auto":null)}else l?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null)}},s=function(){clearTimeout(r.resized),r.resized=setTimeout(o,50)};ke.call(e,i.container,"enterfullscreen exitfullscreen",(function(t){e.fullscreen.target===i.container&&(!e.isEmbed&&J(e.config.ratio)||(o(),("enterfullscreen"===t.type?ke:xe).call(e,window,"resize",s)))}))})),e(this,"media",(function(){var e=n.player,t=e.elements;if(ke.call(e,e.media,"timeupdate seeking seeked",(function(t){return Xe.timeUpdate.call(e,t)})),ke.call(e,e.media,"durationchange loadeddata loadedmetadata",(function(t){return Xe.durationUpdate.call(e,t)})),ke.call(e,e.media,"ended",(function(){e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),ke.call(e,e.media,"progress playing seeking seeked",(function(t){return Xe.updateProgress.call(e,t)})),ke.call(e,e.media,"volumechange",(function(t){return Xe.updateVolume.call(e,t)})),ke.call(e,e.media,"playing play pause ended emptied timeupdate",(function(t){return at.checkPlaying.call(e,t)})),ke.call(e,e.media,"waiting canplay seeked playing",(function(t){return at.checkLoading.call(e,t)})),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){var i=me.call(e,".".concat(e.config.classNames.video));if(!H(i))return;ke.call(e,t.container,"click",(function(r){([t.container,i].includes(r.target)||i.contains(r.target))&&(e.touch&&e.config.hideControls||(e.ended?(n.proxy(r,e.restart,"restart"),n.proxy(r,(function(){Te(e.play())}),"play")):n.proxy(r,(function(){Te(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&ke.call(e,t.wrapper,"contextmenu",(function(e){e.preventDefault()}),!1),ke.call(e,e.media,"volumechange",(function(){e.storage.set({volume:e.volume,muted:e.muted})})),ke.call(e,e.media,"ratechange",(function(){Xe.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),ke.call(e,e.media,"qualitychange",(function(t){Xe.updateSetting.call(e,"quality",null,t.detail.quality)})),ke.call(e,e.media,"ready qualitychange",(function(){Xe.setDownloadUrl.call(e)}));var r=e.config.events.concat(["keyup","keydown"]).join(" ");ke.call(e,e.media,r,(function(i){var n=i.detail,r=void 0===n?{}:n;"error"===i.type&&(r=e.media.error),Se.call(e,t.container,i.type,!0,r)}))})),e(this,"proxy",(function(e,t,i){var r=n.player,o=r.config.listeners[i],s=!0;W(o)&&(s=o.call(r,e)),!1!==s&&W(t)&&t.call(r,e)})),e(this,"bind",(function(e,t,i,r){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=n.player,a=s.config.listeners[r],l=W(a);ke.call(s,e,t,(function(e){return n.proxy(e,i,r)}),o&&!l)})),e(this,"controls",(function(){var e=n.player,t=e.elements,i=G.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((function(t){n.bind(t,"click",(function(){Te(e.togglePlay())}),"play")})),n.bind(t.buttons.restart,"click",e.restart,"restart"),n.bind(t.buttons.rewind,"click",(function(){e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),n.bind(t.buttons.fastForward,"click",(function(){e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),n.bind(t.buttons.mute,"click",(function(){e.muted=!e.muted}),"mute"),n.bind(t.buttons.captions,"click",(function(){return e.toggleCaptions()})),n.bind(t.buttons.download,"click",(function(){Se.call(e,e.media,"download")}),"download"),n.bind(t.buttons.fullscreen,"click",(function(){e.fullscreen.toggle()}),"fullscreen"),n.bind(t.buttons.pip,"click",(function(){e.pip="toggle"}),"pip"),n.bind(t.buttons.airplay,"click",e.airplay,"airplay"),n.bind(t.buttons.settings,"click",(function(t){t.stopPropagation(),t.preventDefault(),Xe.toggleMenu.call(e,t)}),null,!1),n.bind(t.buttons.settings,"keyup",(function(t){["Space","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Xe.toggleMenu.call(e,t)):Xe.focusFirstMenuItem.call(e,null,!0))}),null,!1),n.bind(t.settings.menu,"keydown",(function(t){"Escape"===t.key&&Xe.toggleMenu.call(e,t)})),n.bind(t.inputs.seek,"mousedown mousemove",(function(e){var i=t.progress.getBoundingClientRect(),n=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",n)})),n.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(t){var i=t.currentTarget,n="play-on-seeked";if(!Z(t)||["ArrowLeft","ArrowRight"].includes(t.key)){e.lastSeekTime=Date.now();var r=i.hasAttribute(n),o=["mouseup","touchend","keyup"].includes(t.type);r&&o?(i.removeAttribute(n),Te(e.play())):!o&&e.playing&&(i.setAttribute(n,""),e.pause())}})),G.isIos){var r=fe.call(e,'input[type="range"]');Array.from(r).forEach((function(e){return n.bind(e,i,(function(e){return K(e.target)}))}))}n.bind(t.inputs.seek,i,(function(t){var i=t.currentTarget,n=i.getAttribute("seek-value");J(n)&&(n=i.value),i.removeAttribute("seek-value"),e.currentTime=n/i.max*e.duration}),"seek"),n.bind(t.progress,"mouseenter mouseleave mousemove",(function(t){return Xe.updateSeekTooltip.call(e,t)})),n.bind(t.progress,"mousemove touchmove",(function(t){var i=e.previewThumbnails;i&&i.loaded&&i.startMove(t)})),n.bind(t.progress,"mouseleave touchend click",(function(){var t=e.previewThumbnails;t&&t.loaded&&t.endMove(!1,!0)})),n.bind(t.progress,"mousedown touchstart",(function(t){var i=e.previewThumbnails;i&&i.loaded&&i.startScrubbing(t)})),n.bind(t.progress,"mouseup touchend",(function(t){var i=e.previewThumbnails;i&&i.loaded&&i.endScrubbing(t)})),G.isWebkit&&Array.from(fe.call(e,'input[type="range"]')).forEach((function(t){n.bind(t,"input",(function(t){return Xe.updateRangeFill.call(e,t.target)}))})),e.config.toggleInvert&&!H(t.display.duration)&&n.bind(t.display.currentTime,"click",(function(){0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Xe.timeUpdate.call(e))})),n.bind(t.inputs.volume,i,(function(t){e.volume=t.target.value}),"volume"),n.bind(t.controls,"mouseenter mouseleave",(function(i){t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((function(e){return!e.contains(t.container)})).forEach((function(i){n.bind(i,"mouseenter mouseleave",(function(i){t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),n.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(function(e){t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),n.bind(t.controls,"focusin",(function(){var i=e.config,r=e.timers;ue(t.controls,i.classNames.noTransition,!0),at.toggleControls.call(e,!0),setTimeout((function(){ue(t.controls,i.classNames.noTransition,!1)}),0);var o=n.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout((function(){return at.toggleControls.call(e,!1)}),o)})),n.bind(t.inputs.volume,"wheel",(function(t){var i=t.webkitDirectionInvertedFromDevice,n=[t.deltaX,-t.deltaY].map((function(e){return i?-e:e})),r=(0,v.Z)(n,2),o=r[0],s=r[1],a=Math.sign(Math.abs(o)>Math.abs(s)?o:s);e.increaseVolume(a/50);var l=e.media.volume;(1===a&&l<1||-1===a&&l>0)&&t.preventDefault()}),"volume",!1)})),this.player=i,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return(0,g.Z)(t,[{key:"handleKey",value:function(e){var t,i=this.player,n=i.elements,r=e.key,o=e.type,s=e.altKey,a=e.ctrlKey,l=e.metaKey,c=e.shiftKey,h="keydown"===o,u=h&&r===this.lastKey;if(!(s||a||l||c)&&r)if(h){var d=document.activeElement;if(H(d)){var p=i.config.selectors.editable;if(d!==n.inputs.seek&&pe(d,p))return;if("Space"===e.key&&pe(d,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(r)&&(e.preventDefault(),e.stopPropagation()),r){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(t=parseInt(r,10),i.currentTime=i.duration/10*t);break;case"Space":case"k":u||Te(i.togglePlay());break;case"ArrowUp":i.increaseVolume(.1);break;case"ArrowDown":i.decreaseVolume(.1);break;case"m":u||(i.muted=!i.muted);break;case"ArrowRight":i.forward();break;case"ArrowLeft":i.rewind();break;case"f":i.fullscreen.toggle();break;case"c":u||i.toggleCaptions();break;case"l":i.loop=!i.loop}"Escape"===r&&!i.fullscreen.usingNative&&i.fullscreen.active&&i.fullscreen.toggle(),this.lastKey=r}else this.lastKey=null}},{key:"toggleMenu",value:function(e){Xe.toggleMenu.call(this.player,e)}}]),t}(),ct=function(e,t){return function(e,t){e.exports=function(){var e=function(){},t={},i={},n={};function r(e,t){e=e.push?e:[e];var r,o,s,a=[],l=e.length,c=l;for(r=function(e,i){i.length&&a.push(e),--c||t(a)};l--;)o=e[l],(s=i[o])?r(o,s):(n[o]=n[o]||[]).push(r)}function o(e,t){if(e){var r=n[e];if(i[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function s(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function a(t,i,n,r){var o,s,l=document,c=n.async,h=(n.numRetries||0)+1,u=n.before||e,d=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(d)?((s=l.createElement("link")).rel="stylesheet",s.href=p,(o="hideFocus"in s)&&s.relList&&(o=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(d)?(s=l.createElement("img")).src=p:((s=l.createElement("script")).src=t,s.async=void 0===c||c),s.onload=s.onerror=s.onbeforeload=function(e){var l=e.type[0];if(o)try{s.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((r+=1)<h)return a(t,i,n,r)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==u(t,s)&&l.head.appendChild(s)}function l(e,t,i){var n,r,o=(e=e.push?e:[e]).length,s=o,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--o||t(l)},r=0;r<s;r++)a(e[r],n,i)}function c(e,i,n){var r,a;if(i&&i.trim&&(r=i),a=(r?n:i)||{},r){if(r in t)throw"LoadJS";t[r]=!0}function c(t,i){l(e,(function(e){s(a,e),t&&s({success:t,error:i},e),o(r,e)}),a)}if(a.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return r(e,(function(e){s(t,e)})),c},c.done=function(e){o(e,[])},c.reset=function(){t={},i={},n={}},c.isDefined=function(e){return e in t},c}()}(t={exports:{}}),t.exports}();function ht(e){return new Promise((function(t,i){ct(e,{success:t,error:i})}))}function ut(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Se.call(this,this.media,e?"play":"pause"))}var dt={setup:function(){var e=this;ue(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Ie.call(e),B(window.Vimeo)?dt.ready.call(e):ht(e.config.urls.vimeo.sdk).then((function(){dt.ready.call(e)})).catch((function(t){e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready:function(){var e=this,t=this,i=t.config.vimeo,n=i.premium,r=i.referrerPolicy,o=(0,p.Z)(i,S),s=t.media.getAttribute("src"),a="";J(s)?(s=t.media.getAttribute(t.config.attributes.embed.id),a=t.media.getAttribute(t.config.attributes.embed.hash)):a=function(e){var t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(s);var l=a?{h:a}:{};n&&Object.assign(o,{controls:!1,sidedock:!1});var c,h=Ye(A(A({loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},l),o)),u=J(c=s)?null:j(Number(c))?c:c.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:c,d=re("iframe"),f=Be(t.config.urls.vimeo.iframe,u,h);if(d.setAttribute("src",f),d.setAttribute("allowfullscreen",""),d.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),J(r)||d.setAttribute("referrerPolicy",r),n||!i.customControls)d.setAttribute("data-poster",t.poster),t.media=le(d,t.media);else{var m=re("div",{class:t.config.classNames.embedContainer,"data-poster":t.poster});m.appendChild(d),t.media=le(m,t.media)}i.customControls||He(Be(t.config.urls.vimeo.api,f)).then((function(e){!J(e)&&e.thumbnail_url&&at.setPoster.call(t,e.thumbnail_url).catch((function(){}))})),t.embed=new window.Vimeo.Player(d,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=function(){return ut.call(t,!0),t.embed.play()},t.media.pause=function(){return ut.call(t,!1),t.embed.pause()},t.media.stop=function(){t.pause(),t.currentTime=0};var g=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return g},set:function(e){var i=t.embed,n=t.media,r=t.paused,o=t.volume,s=r&&!i.hasPlayed;n.seeking=!0,Se.call(t,n,"seeking"),Promise.resolve(s&&i.setVolume(0)).then((function(){return i.setCurrentTime(e)})).then((function(){return s&&i.pause()})).then((function(){return s&&i.setVolume(o)})).catch((function(){}))}});var y=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return y},set:function(e){t.embed.setPlaybackRate(e).then((function(){y=e,Se.call(t,t.media,"ratechange")})).catch((function(){t.options.speed=[1]}))}});var b=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return b},set:function(e){t.embed.setVolume(e).then((function(){b=e,Se.call(t,t.media,"volumechange")}))}});var w=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return w},set:function(e){var i=!!V(e)&&e;t.embed.setVolume(i?0:t.config.volume).then((function(){w=i,Se.call(t,t.media,"volumechange")}))}});var k,x=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return x},set:function(e){var i=V(e)?e:t.config.loop.active;t.embed.setLoop(i).then((function(){x=i}))}}),t.embed.getVideoUrl().then((function(e){k=e,Xe.setDownloadUrl.call(t)})).catch((function(t){e.debug.warn(t)})),Object.defineProperty(t.media,"currentSrc",{get:function(){return k}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then((function(i){var n=(0,v.Z)(i,2),r=n[0],o=n[1];t.embed.ratio=Ne(r,o),Ie.call(e)})),t.embed.setAutopause(t.config.autopause).then((function(e){t.config.autopause=e})),t.embed.getVideoTitle().then((function(i){t.config.title=i,at.setTitle.call(e)})),t.embed.getCurrentTime().then((function(e){g=e,Se.call(t,t.media,"timeupdate")})),t.embed.getDuration().then((function(e){t.media.duration=e,Se.call(t,t.media,"durationchange")})),t.embed.on("loaded",(function(){t.embed.getPaused().then((function(e){ut.call(t,!e),e||Se.call(t,t.media,"playing")})),H(t.embed.element)&&t.supported.ui&&t.embed.element.setAttribute("tabindex",-1)})),t.embed.on("bufferstart",(function(){Se.call(t,t.media,"waiting")})),t.embed.on("bufferend",(function(){Se.call(t,t.media,"playing")})),t.embed.on("play",(function(){ut.call(t,!0),Se.call(t,t.media,"playing")})),t.embed.on("pause",(function(){ut.call(t,!1)})),t.embed.on("timeupdate",(function(e){t.media.seeking=!1,g=e.seconds,Se.call(t,t.media,"timeupdate")})),t.embed.on("progress",(function(e){t.media.buffered=e.percent,Se.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&Se.call(t,t.media,"canplaythrough"),t.embed.getDuration().then((function(e){e!==t.media.duration&&(t.media.duration=e,Se.call(t,t.media,"durationchange"))}))})),t.embed.on("seeked",(function(){t.media.seeking=!1,Se.call(t,t.media,"seeked")})),t.embed.on("ended",(function(){t.media.paused=!0,Se.call(t,t.media,"ended")})),t.embed.on("error",(function(e){t.media.error=e,Se.call(t,t.media,"error")})),i.customControls&&setTimeout((function(){return at.build.call(t)}),0)}};function pt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Se.call(this,this.media,e?"play":"pause"))}function ft(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var mt={setup:function(){var e=this;if(ue(this.elements.wrapper,this.config.classNames.embed,!0),B(window.YT)&&W(window.YT.Player))mt.ready.call(this);else{var t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){W(t)&&t(),mt.ready.call(e)},ht(this.config.urls.youtube.sdk).catch((function(t){e.debug.warn("YouTube API failed to load",t)}))}},getTitle:function(e){var t=this;He(Be(this.config.urls.youtube.api,e)).then((function(e){if(B(e)){var i=e.title,n=e.height,r=e.width;t.config.title=i,at.setTitle.call(t),t.embed.ratio=Ne(r,n)}Ie.call(t)})).catch((function(){Ie.call(t)}))},ready:function(){var e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(J(i)||!i.startsWith("youtube-")){var n=e.media.getAttribute("src");J(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));var r,o=J(r=n)?null:r.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:r,s=re("div",{id:"".concat(e.provider,"-").concat(Math.floor(1e4*Math.random())),"data-poster":t.customControls?e.poster:void 0});if(e.media=le(s,e.media),t.customControls){var a=function(e){return"https://i.ytimg.com/vi/".concat(o,"/").concat(e,"default.jpg")};st(a("maxres"),121).catch((function(){return st(a("sd"),121)})).catch((function(){return st(a("hq"))})).then((function(t){return at.setPoster.call(e,t.src)})).then((function(t){t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((function(){}))}e.embed=new window.YT.Player(e.media,{videoId:o,host:ft(t),playerVars:te({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError:function(t){if(!e.media.error){var i=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:n},Se.call(e,e.media,"error")}},onPlaybackRateChange:function(t){var i=t.target;e.media.playbackRate=i.getPlaybackRate(),Se.call(e,e.media,"ratechange")},onReady:function(i){if(!W(e.media.play)){var n=i.target;mt.getTitle.call(e,o),e.media.play=function(){pt.call(e,!0),n.playVideo()},e.media.pause=function(){pt.call(e,!1),n.pauseVideo()},e.media.stop=function(){n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:function(){return Number(n.getCurrentTime())},set:function(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Se.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:function(){return n.getPlaybackRate()},set:function(e){n.setPlaybackRate(e)}});var r=e.config.volume;Object.defineProperty(e.media,"volume",{get:function(){return r},set:function(t){r=t,n.setVolume(100*r),Se.call(e,e.media,"volumechange")}});var s=e.config.muted;Object.defineProperty(e.media,"muted",{get:function(){return s},set:function(t){var i=V(t)?t:s;s=i,n[i?"mute":"unMute"](),n.setVolume(100*r),Se.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:function(){return n.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get:function(){return e.currentTime===e.duration}});var a=n.getAvailablePlaybackRates();e.options.speed=a.filter((function(t){return e.config.speed.options.includes(t)})),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),Se.call(e,e.media,"timeupdate"),Se.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((function(){e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&Se.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),Se.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((function(){return at.build.call(e)}),50)}},onStateChange:function(i){var n=i.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,Se.call(e,e.media,"seeked")),i.data){case-1:Se.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),Se.call(e,e.media,"progress");break;case 0:pt.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):Se.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(pt.call(e,!0),Se.call(e,e.media,"playing"),e.timers.playing=setInterval((function(){Se.call(e,e.media,"timeupdate")}),50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),Se.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),pt.call(e,!1);break;case 3:Se.call(e,e.media,"waiting")}Se.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}}},gt={setup:function(){this.media?(ue(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),ue(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&ue(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=re("div",{class:this.config.classNames.video}),ie(this.media,this.elements.wrapper),this.elements.poster=re("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?ze.setup.call(this):this.isYouTube?mt.setup.call(this):this.isVimeo&&dt.setup.call(this)):this.debug.warn("No media element found!")}},vt=function(){function t(i){var n=this;(0,m.Z)(this,t),e(this,"load",(function(){n.enabled&&(B(window.google)&&B(window.google.ima)?n.ready():ht(n.player.config.urls.googleIMA.sdk).then((function(){n.ready()})).catch((function(){n.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(function(){var e;n.enabled||((e=n).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),n.startSafetyTimer(12e3,"ready()"),n.managerPromise.then((function(){n.clearSafetyTimer("onAdsManagerLoaded()")})),n.listeners(),n.setupIMA()})),e(this,"setupIMA",(function(){n.elements.container=re("div",{class:n.player.config.classNames.ads}),n.player.elements.container.appendChild(n.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(n.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(n.player.config.playsinline),n.elements.displayContainer=new google.ima.AdDisplayContainer(n.elements.container,n.player.media),n.loader=new google.ima.AdsLoader(n.elements.displayContainer),n.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(e){return n.onAdsManagerLoaded(e)}),!1),n.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return n.onAdError(e)}),!1),n.requestAds()})),e(this,"requestAds",(function(){var e=n.player.elements.container;try{var t=new google.ima.AdsRequest;t.adTagUrl=n.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!n.player.muted),n.loader.requestAds(t)}catch(e){n.onAdError(e)}})),e(this,"pollCountdown",(function(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))return clearInterval(n.countdownTimer),void n.elements.container.removeAttribute("data-badge-text");n.countdownTimer=setInterval((function(){var e=Ue(Math.max(n.manager.getRemainingTime(),0)),t="".concat($e("advertisement",n.player.config)," - ").concat(e);n.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(function(e){if(n.enabled){var t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,n.manager=e.getAdsManager(n.player,t),n.cuePoints=n.manager.getCuePoints(),n.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(e){return n.onAdError(e)})),Object.keys(google.ima.AdEvent.Type).forEach((function(e){n.manager.addEventListener(google.ima.AdEvent.Type[e],(function(e){return n.onAdEvent(e)}))})),n.trigger("loaded")}})),e(this,"addCuePoints",(function(){J(n.cuePoints)||n.cuePoints.forEach((function(e){if(0!==e&&-1!==e&&e<n.player.duration){var t=n.player.elements.progress;if(H(t)){var i=100/n.player.duration*e,r=re("span",{class:n.player.config.classNames.cues});r.style.left="".concat(i.toString(),"%"),t.appendChild(r)}}}))})),e(this,"onAdEvent",(function(e){var t=n.player.elements.container,i=e.getAd(),r=e.getAdData();switch(function(e){Se.call(n.player,n.player.media,"ads".concat(e.replace(/_/g,"").toLowerCase()))}(e.type),e.type){case google.ima.AdEvent.Type.LOADED:n.trigger("loaded"),n.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:n.manager.setVolume(n.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:n.player.ended?n.loadAds():n.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:n.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:n.pollCountdown(),n.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&n.player.debug.warn("Non-fatal ad error: ".concat(r.adError.getMessage()))}})),e(this,"onAdError",(function(e){n.cancel(),n.player.debug.warn("Ads error",e)})),e(this,"listeners",(function(){var e,t=n.player.elements.container;n.player.on("canplay",(function(){n.addCuePoints()})),n.player.on("ended",(function(){n.loader.contentComplete()})),n.player.on("timeupdate",(function(){e=n.player.currentTime})),n.player.on("seeked",(function(){var t=n.player.currentTime;J(n.cuePoints)||n.cuePoints.forEach((function(i,r){e<i&&i<t&&(n.manager.discardAdBreak(),n.cuePoints.splice(r,1))}))})),window.addEventListener("resize",(function(){n.manager&&n.manager.resize(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(function(){var e=n.player.elements.container;n.managerPromise||n.resumeContent(),n.managerPromise.then((function(){n.manager.setVolume(n.player.volume),n.elements.displayContainer.initialize();try{n.initialized||(n.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),n.manager.start()),n.initialized=!0}catch(e){n.onAdError(e)}})).catch((function(){}))})),e(this,"resumeContent",(function(){n.elements.container.style.zIndex="",n.playing=!1,Te(n.player.media.play())})),e(this,"pauseContent",(function(){n.elements.container.style.zIndex=3,n.playing=!0,n.player.media.pause()})),e(this,"cancel",(function(){n.initialized&&n.resumeContent(),n.trigger("error"),n.loadAds()})),e(this,"loadAds",(function(){n.managerPromise.then((function(){n.manager&&n.manager.destroy(),n.managerPromise=new Promise((function(e){n.on("loaded",e),n.player.debug.log(n.manager)})),n.initialized=!1,n.requestAds()})).catch((function(){}))})),e(this,"trigger",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];var o=n.events[e];$(o)&&o.forEach((function(e){W(e)&&e.apply(n,i)}))})),e(this,"on",(function(e,t){return $(n.events[e])||(n.events[e]=[]),n.events[e].push(t),n})),e(this,"startSafetyTimer",(function(e,t){n.player.debug.log("Safety timer invoked from: ".concat(t)),n.safetyTimer=setTimeout((function(){n.cancel(),n.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(function(e){z(n.safetyTimer)||(n.player.debug.log("Safety timer cleared from: ".concat(e)),clearTimeout(n.safetyTimer),n.safetyTimer=null)})),this.player=i,this.config=i.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(e,t){n.on("loaded",e),n.on("error",t)})),this.load()}return(0,g.Z)(t,[{key:"enabled",get:function(){var e=this.config;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!J(e.publisherId)||X(e.tagUrl))}},{key:"tagUrl",get:function(){var e=this.config;return X(e.tagUrl)?e.tagUrl:"https://go.aniview.com/api/adserver6/vast/?".concat(Ye({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId}))}}]),t}();function yt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(e,t),i)}var bt,wt=function(e){var t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(e){var i={};e.split(/\r\n|\n|\r/).forEach((function(e){if(j(i.startTime)){if(!J(e.trim())&&J(i.text)){var t,n,r,o=e.trim().split("#xywh=");t=(0,v.Z)(o,1),i.text=t[0],o[1]&&(n=o[1].split(","),r=(0,v.Z)(n,4),i.x=r[0],i.y=r[1],i.w=r[2],i.h=r[3])}}else{var s=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);s&&(i.startTime=60*Number(s[1]||0)*60+60*Number(s[2])+Number(s[3])+Number("0.".concat(s[4])),i.endTime=60*Number(s[6]||0)*60+60*Number(s[7])+Number(s[8])+Number("0.".concat(s[9])))}})),i.text&&t.push(i)})),t},kt=function(e,t){var i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i},xt=function(){function t(i){var n=this;(0,m.Z)(this,t),e(this,"load",(function(){n.player.elements.display.seekTooltip&&(n.player.elements.display.seekTooltip.hidden=n.enabled),n.enabled&&n.getThumbnails().then((function(){n.enabled&&(n.render(),n.determineContainerAutoSizing(),n.loaded=!0)}))})),e(this,"getThumbnails",(function(){return new Promise((function(e){var t=n.player.config.previewThumbnails.src;if(J(t))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){n.thumbnails.sort((function(e,t){return e.height-t.height})),n.player.debug.log("Preview thumbnails",n.thumbnails),e()};if(W(t))t((function(e){n.thumbnails=e,i()}));else{var r=(F(t)?[t]:t).map((function(e){return n.getThumbnail(e)}));Promise.all(r).then(i)}}))})),e(this,"getThumbnail",(function(e){return new Promise((function(t){He(e).then((function(i){var r={frames:wt(i),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));var o=new Image;o.onload=function(){r.height=o.naturalHeight,r.width=o.naturalWidth,n.thumbnails.push(r),t()},o.src=r.urlPrefix+r.frames[0].text}))}))})),e(this,"startMove",(function(e){if(n.loaded&&q(e)&&["touchmove","mousemove"].includes(e.type)&&n.player.media.duration){if("touchmove"===e.type)n.seekTime=n.player.media.duration*(n.player.elements.inputs.seek.value/100);else{var t,i,r=n.player.elements.progress.getBoundingClientRect(),o=100/r.width*(e.pageX-r.left);n.seekTime=n.player.media.duration*(o/100),n.seekTime<0&&(n.seekTime=0),n.seekTime>n.player.media.duration-1&&(n.seekTime=n.player.media.duration-1),n.mousePosX=e.pageX,n.elements.thumb.time.innerText=Ue(n.seekTime);var s=null===(t=n.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((function(e){return e.time===Math.round(n.seekTime)}));s&&n.elements.thumb.time.insertAdjacentHTML("afterbegin","".concat(s.label,"<br>"))}n.showImageAtCurrentTime()}})),e(this,"endMove",(function(){n.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(function(e){(z(e.button)||!1===e.button||0===e.button)&&(n.mouseDown=!0,n.player.media.duration&&(n.toggleScrubbingContainer(!0),n.toggleThumbContainer(!1,!0),n.showImageAtCurrentTime()))})),e(this,"endScrubbing",(function(){n.mouseDown=!1,Math.ceil(n.lastTime)===Math.ceil(n.player.media.currentTime)?n.toggleScrubbingContainer(!1):_e.call(n.player,n.player.media,"timeupdate",(function(){n.mouseDown||n.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(function(){n.player.on("play",(function(){n.toggleThumbContainer(!1,!0)})),n.player.on("seeked",(function(){n.toggleThumbContainer(!1)})),n.player.on("timeupdate",(function(){n.lastTime=n.player.media.currentTime}))})),e(this,"render",(function(){n.elements.thumb.container=re("div",{class:n.player.config.classNames.previewThumbnails.thumbContainer}),n.elements.thumb.imageContainer=re("div",{class:n.player.config.classNames.previewThumbnails.imageContainer}),n.elements.thumb.container.appendChild(n.elements.thumb.imageContainer);var e=re("div",{class:n.player.config.classNames.previewThumbnails.timeContainer});n.elements.thumb.time=re("span",{},"00:00"),e.appendChild(n.elements.thumb.time),n.elements.thumb.imageContainer.appendChild(e),H(n.player.elements.progress)&&n.player.elements.progress.appendChild(n.elements.thumb.container),n.elements.scrubbing.container=re("div",{class:n.player.config.classNames.previewThumbnails.scrubbingContainer}),n.player.elements.wrapper.appendChild(n.elements.scrubbing.container)})),e(this,"destroy",(function(){n.elements.thumb.container&&n.elements.thumb.container.remove(),n.elements.scrubbing.container&&n.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(function(){n.mouseDown?n.setScrubbingContainerSize():n.setThumbContainerSizeAndPos();var e=n.thumbnails[0].frames.findIndex((function(e){return n.seekTime>=e.startTime&&n.seekTime<=e.endTime})),t=e>=0,i=0;n.mouseDown||n.toggleThumbContainer(t),t&&(n.thumbnails.forEach((function(t,r){n.loadedImages.includes(t.frames[e].text)&&(i=r)})),e!==n.showingThumb&&(n.showingThumb=e,n.loadImage(i)))})),e(this,"loadImage",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=n.showingThumb,i=n.thumbnails[e],r=i.urlPrefix,o=i.frames[t],s=i.frames[t].text,a=r+s;if(n.currentImageElement&&n.currentImageElement.dataset.filename===s)n.showImage(n.currentImageElement,o,e,t,s,!1),n.currentImageElement.dataset.index=t,n.removeOldImages(n.currentImageElement);else{n.loadingImage&&n.usingSprites&&(n.loadingImage.onload=null);var l=new Image;l.src=a,l.dataset.index=t,l.dataset.filename=s,n.showingThumbFilename=s,n.player.debug.log("Loading image: ".concat(a)),l.onload=function(){return n.showImage(l,o,e,t,s,!0)},n.loadingImage=l,n.removeOldImages(l)}})),e(this,"showImage",(function(e,t,i,r,o){var s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];n.player.debug.log("Showing thumb: ".concat(o,". num: ").concat(r,". qual: ").concat(i,". newimg: ").concat(s)),n.setImageSizeAndOffset(e,t),s&&(n.currentImageContainer.appendChild(e),n.currentImageElement=e,n.loadedImages.includes(o)||n.loadedImages.push(o)),n.preloadNearby(r,!0).then(n.preloadNearby(r,!1)).then(n.getHigherQuality(i,e,t,o))})),e(this,"removeOldImages",(function(e){Array.from(n.currentImageContainer.children).forEach((function(t){if("img"===t.tagName.toLowerCase()){var i=n.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;var r=n.currentImageContainer;setTimeout((function(){r.removeChild(t),n.player.debug.log("Removing thumb: ".concat(t.dataset.filename))}),i)}}}))})),e(this,"preloadNearby",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var r=n.thumbnails[0].frames[e].text;if(n.showingThumbFilename===r){var o;o=t?n.thumbnails[0].frames.slice(e):n.thumbnails[0].frames.slice(0,e).reverse();var s=!1;o.forEach((function(e){var t=e.text;if(t!==r&&!n.loadedImages.includes(t)){s=!0,n.player.debug.log("Preloading thumb filename: ".concat(t));var o=n.thumbnails[0].urlPrefix+t,a=new Image;a.src=o,a.onload=function(){n.player.debug.log("Preloaded thumb filename: ".concat(t)),n.loadedImages.includes(t)||n.loadedImages.push(t),i()}}})),s||i()}}),300)}))})),e(this,"getHigherQuality",(function(e,t,i,r){if(e<n.thumbnails.length-1){var o=t.naturalHeight;n.usingSprites&&(o=i.h),o<n.thumbContainerHeight&&setTimeout((function(){n.showingThumbFilename===r&&(n.player.debug.log("Showing higher quality thumb for: ".concat(r)),n.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=n.player.config.classNames.previewThumbnails.thumbContainerShown;n.elements.thumb.container.classList.toggle(i,e),!e&&t&&(n.showingThumb=null,n.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",(function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=n.player.config.classNames.previewThumbnails.scrubbingContainerShown;n.elements.scrubbing.container.classList.toggle(t,e),e||(n.showingThumb=null,n.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(function(){(n.elements.thumb.imageContainer.clientHeight>20||n.elements.thumb.imageContainer.clientWidth>20)&&(n.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(function(){var e=n.elements.thumb.imageContainer;if(n.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){var t=Math.floor(e.clientHeight*n.thumbAspectRatio);e.style.width="".concat(t,"px")}else if(e.clientHeight<20&&e.clientWidth>20){var i=Math.floor(e.clientWidth/n.thumbAspectRatio);e.style.height="".concat(i,"px")}}else{var r=Math.floor(n.thumbContainerHeight*n.thumbAspectRatio);e.style.height="".concat(n.thumbContainerHeight,"px"),e.style.width="".concat(r,"px")}n.setThumbContainerPos()})),e(this,"setThumbContainerPos",(function(){var e=n.player.elements.progress.getBoundingClientRect(),t=n.player.elements.container.getBoundingClientRect(),i=n.elements.thumb.container,r=t.left-e.left+10,o=t.right-e.left-i.clientWidth-10,s=n.mousePosX-e.left-i.clientWidth/2,a=yt(s,r,o);i.style.left="".concat(a,"px"),i.style.setProperty("--preview-arrow-offset",s-a+"px")})),e(this,"setScrubbingContainerSize",(function(){var e=kt(n.thumbAspectRatio,{width:n.player.media.clientWidth,height:n.player.media.clientHeight}),t=e.width,i=e.height;n.elements.scrubbing.container.style.width="".concat(t,"px"),n.elements.scrubbing.container.style.height="".concat(i,"px")})),e(this,"setImageSizeAndOffset",(function(e,t){if(n.usingSprites){var i=n.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left="-".concat(t.x*i,"px"),e.style.top="-".concat(t.y*i,"px")}})),this.player=i,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return(0,g.Z)(t,[{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?kt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}]),t}(),_t={insertElements:function(e,t){var i=this;F(t)?oe(e,this.media,{src:t}):$(t)&&t.forEach((function(t){oe(e,i.media,t)}))},change:function(e){var t=this;ee(e,"sources.length")?(ze.cancelRequests.call(this),this.destroy.call(this,(function(){t.options.quality=[],se(t.media),t.media=null,H(t.elements.container)&&t.elements.container.removeAttribute("class");var i=e.sources,n=e.type,r=(0,v.Z)(i,1)[0],o=r.provider,s=void 0===o?tt.html5:o,a=r.src,l="html5"===s?n:"div",c="html5"===s?{}:{src:a};Object.assign(t,{provider:s,type:n,supported:ye.check(n,s,t.config.playsinline),media:re(l,c)}),t.elements.container.appendChild(t.media),V(e.autoplay)&&(t.config.autoplay=e.autoplay),t.isHTML5&&(t.config.crossorigin&&t.media.setAttribute("crossorigin",""),t.config.autoplay&&t.media.setAttribute("autoplay",""),J(e.poster)||(t.poster=e.poster),t.config.loop.active&&t.media.setAttribute("loop",""),t.config.muted&&t.media.setAttribute("muted",""),t.config.playsinline&&t.media.setAttribute("playsinline","")),at.addStyleHook.call(t),t.isHTML5&&_t.insertElements.call(t,"source",i),t.config.title=e.title,gt.setup.call(t),t.isHTML5&&Object.keys(e).includes("tracks")&&_t.insertElements.call(t,"track",e.tracks),(t.isHTML5||t.isEmbed&&!t.supported.ui)&&at.build.call(t),t.isHTML5&&t.media.load(),J(e.previewThumbnails)||(Object.assign(t.config.previewThumbnails,e.previewThumbnails),t.previewThumbnails&&t.previewThumbnails.loaded&&(t.previewThumbnails.destroy(),t.previewThumbnails=null),t.config.previewThumbnails.enabled&&(t.previewThumbnails=new xt(t))),t.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}},St=function(){function t(i,n){var r=this;if((0,m.Z)(this,t),e(this,"play",(function(){return W(r.media.play)?(r.ads&&r.ads.enabled&&r.ads.managerPromise.then((function(){return r.ads.play()})).catch((function(){return Te(r.media.play())})),r.media.play()):null})),e(this,"pause",(function(){return r.playing&&W(r.media.pause)?r.media.pause():null})),e(this,"togglePlay",(function(e){return(V(e)?e:!r.playing)?r.play():r.pause()})),e(this,"stop",(function(){r.isHTML5?(r.pause(),r.restart()):W(r.media.stop)&&r.media.stop()})),e(this,"restart",(function(){r.currentTime=0})),e(this,"rewind",(function(e){r.currentTime-=j(e)?e:r.config.seekTime})),e(this,"forward",(function(e){r.currentTime+=j(e)?e:r.config.seekTime})),e(this,"increaseVolume",(function(e){var t=r.media.muted?0:r.volume;r.volume=t+(j(e)?e:0)})),e(this,"decreaseVolume",(function(e){r.increaseVolume(-e)})),e(this,"airplay",(function(){ye.airplay&&r.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(function(e){if(r.supported.ui&&!r.isAudio){var t=de(r.elements.container,r.config.classNames.hideControls),i=void 0===e?void 0:!e,n=ue(r.elements.container,r.config.classNames.hideControls,i);if(n&&$(r.config.controls)&&r.config.controls.includes("settings")&&!J(r.config.settings)&&Xe.toggleMenu.call(r,!1),n!==t){var o=n?"controlshidden":"controlsshown";Se.call(r,r.media,o)}return!n}return!1})),e(this,"on",(function(e,t){ke.call(r,r.elements.container,e,t)})),e(this,"once",(function(e,t){_e.call(r,r.elements.container,e,t)})),e(this,"off",(function(e,t){xe(r.elements.container,e,t)})),e(this,"destroy",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r.ready){var i=function(){document.body.style.overflow="",r.embed=null,t?(Object.keys(r.elements).length&&(se(r.elements.buttons.play),se(r.elements.captions),se(r.elements.controls),se(r.elements.wrapper),r.elements.buttons.play=null,r.elements.captions=null,r.elements.controls=null,r.elements.wrapper=null),W(e)&&e()):(Oe.call(r),ze.cancelRequests.call(r),le(r.elements.original,r.elements.container),Se.call(r,r.elements.original,"destroyed",!0),W(e)&&e.call(r.elements.original),r.ready=!1,setTimeout((function(){r.elements=null,r.media=null}),200))};r.stop(),clearTimeout(r.timers.loading),clearTimeout(r.timers.controls),clearTimeout(r.timers.resized),r.isHTML5?(at.toggleNativeControls.call(r,!0),i()):r.isYouTube?(clearInterval(r.timers.buffering),clearInterval(r.timers.playing),null!==r.embed&&W(r.embed.destroy)&&r.embed.destroy(),i()):r.isVimeo&&(null!==r.embed&&r.embed.unload().then(i),setTimeout(i,200))}})),e(this,"supports",(function(e){return ye.mime.call(r,e)})),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ye.touch,this.media=i,F(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||Q(this.media)||$(this.media))&&(this.media=this.media[0]),this.config=te({},Ge,t.defaults,n||{},function(){try{return JSON.parse(r.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new rt(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ye),!z(this.media)&&H(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(ye.check().api){var o=this.media.cloneNode(!0);o.autoplay=!1,this.elements.original=o;var s=this.media.tagName.toLowerCase(),a=null,l=null;switch(s){case"div":if(a=this.media.querySelector("iframe"),H(a)){if(l=Je(a.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?tt.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?tt.vimeo:null}(l.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",l.search.length){var c=["1","true"];c.includes(l.searchParams.get("autoplay"))&&(this.config.autoplay=!0),c.includes(l.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=c.includes(l.searchParams.get("playsinline")),this.config.youtube.hl=l.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(J(this.provider)||!Object.values(tt).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=it;break;case"video":case"audio":this.type=s,this.provider=tt.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=ye.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new lt(this),this.storage=new Qe(this),this.media.plyr=this,H(this.elements.container)||(this.elements.container=re("div",{tabindex:0}),ie(this.media,this.elements.container)),at.migrateStyles.call(this),at.addStyleHook.call(this),gt.setup.call(this),this.config.debug&&ke.call(this,this.elements.container,this.config.events.join(" "),(function(e){r.debug.log("event: ".concat(e.type))})),this.fullscreen=new ot(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&at.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new vt(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(function(){return Te(r.play())})),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new xt(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return(0,g.Z)(t,[{key:"isHTML5",get:function(){return this.provider===tt.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===tt.youtube}},{key:"isVimeo",get:function(){return this.provider===tt.vimeo}},{key:"isVideo",get:function(){return this.type===it}},{key:"isAudio",get:function(){return"audio"===this.type}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",get:function(){return Number(this.media.currentTime)},set:function(e){if(this.duration){var t=j(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}}},{key:"buffered",get:function(){var e=this.media.buffered;return j(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=j(t)&&t!==1/0?t:0;return e||i}},{key:"volume",get:function(){return Number(this.media.volume)},set:function(e){var t=e;F(t)&&(t=Number(t)),j(t)||(t=this.storage.get("volume")),j(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!J(e)&&this.muted&&t>0&&(this.muted=!1)}},{key:"muted",get:function(){return Boolean(this.media.muted)},set:function(e){var t=e;V(t)||(t=this.storage.get("muted")),V(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}},{key:"hasAudio",get:function(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}},{key:"speed",get:function(){return Number(this.media.playbackRate)},set:function(e){var t=this,i=null;j(e)&&(i=e),j(i)||(i=this.storage.get("speed")),j(i)||(i=this.config.speed.selected);var n=this.minimumSpeed,r=this.maximumSpeed;i=yt(i,n,r),this.config.speed.selected=i,setTimeout((function(){t.media&&(t.media.playbackRate=i)}),0)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,(0,f.Z)(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,(0,f.Z)(this.options.speed)):this.isVimeo?2:16}},{key:"quality",get:function(){return this.media.quality},set:function(e){var t=this.config.quality,i=this.options.quality;if(i.length){var n=[!J(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(j),r=!0;if(!i.includes(n)){var o=Pe(i,n);this.debug.warn("Unsupported quality option: ".concat(n,", using ").concat(o," instead")),n=o,r=!1}t.selected=n,this.media.quality=n,r&&this.storage.set({quality:n})}}},{key:"loop",get:function(){return Boolean(this.media.loop)},set:function(e){var t=V(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}},{key:"source",get:function(){return this.media.currentSrc},set:function(e){_t.change.call(this,e)}},{key:"download",get:function(){var e=this.config.urls.download;return X(e)?e:this.source},set:function(e){X(e)&&(this.config.urls.download=e,Xe.setDownloadUrl.call(this))}},{key:"poster",get:function(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null},set:function(e){this.isVideo?at.setPoster.call(this,e,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")}},{key:"ratio",get:function(){if(!this.isVideo)return null;var e=Le(Re.call(this));return $(e)?e.join(":"):e},set:function(e){this.isVideo?F(e)&&De(e)?(this.config.ratio=Le(e),Ie.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(e,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",get:function(){return Boolean(this.config.autoplay)},set:function(e){this.config.autoplay=V(e)?e:this.config.autoplay}},{key:"toggleCaptions",value:function(e){Ke.toggle.call(this,e,!1)}},{key:"currentTrack",get:function(){var e=this.captions,t=e.toggled,i=e.currentTrack;return t?i:-1},set:function(e){Ke.set.call(this,e,!1),Ke.setup.call(this)}},{key:"language",get:function(){return(Ke.getCurrentTrack.call(this)||{}).language},set:function(e){Ke.setLanguage.call(this,e,!1)}},{key:"pip",get:function(){return ye.pip?J(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===et:null},set:function(e){if(ye.pip){var t=V(e)?e:!this.pip;W(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?et:"inline"),W(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}}},{key:"setPreviewThumbnails",value:function(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new xt(this))}}],[{key:"supported",value:function(e,t,i){return ye.check(e,t,i)}},{key:"loadSprite",value:function(e,t){return qe(e,t)}},{key:"setup",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null;return F(e)?n=Array.from(document.querySelectorAll(e)):Q(e)?n=Array.from(e):$(e)&&(n=e.filter(H)),J(n)?null:n.map((function(e){return new t(e,i)}))}}]),t}();return St.defaults=(bt=Ge,JSON.parse(JSON.stringify(bt))),St}());var E=M.exports;function D(e){e.on("timeupdate",(function(){return function(e){var t,i;null!=e&&null!==(t=e.config)&&void 0!==t&&null!==(i=t.mutedPreview)&&void 0!==i&&i.enabled||function(e){var t;0!==e.currentTime&&null!=e&&null!==(t=e.config)&&void 0!==t&&t.save_player_position&&localStorage.setItem("player-progress-".concat(L(e)),e.currentTime)}(e)}(e)})),e.on("ready",(function(){return R(e)})),e.on("loadeddata",(function(){return R(e)})),e.on("ended",(function(){return function(e){localStorage.removeItem("player-progress-".concat(L(e)))}(e)}))}function L(e){var t,i;return null==e||null===(t=e.config)||void 0===t||null===(i=t.blockAttributes)||void 0===i?void 0:i.id}function R(e){var t,i,n;if(null!=e&&null!==(t=e.config)&&void 0!==t&&t.save_player_position&&(null==e||null===(i=e.config)||void 0===i||null===(n=i.mutedPreview)||void 0===n||!n.enabled)){var r=function(e){return parseFloat(localStorage.getItem("player-progress-".concat(L(e))))}(e);return e.hls&&r>=0&&e.hls.startLoad(r),e.duration&&(r=Math.min(r,e.duration)),!r||r<1?0:(e.currentTime=r,null!=e&&e.isVimeo&&setTimeout((function(){e.embed.setCurrentTime(r||0)}),0),r)}}var I,N=(null===(n=window)||void 0===n||null===(r=n.prestoPlayer)||void 0===r||null===(o=r.i18n)||void 0===o?void 0:o.hide_chapters)||"Hide Chapters",z=(null===(s=window)||void 0===s||null===(a=s.prestoPlayer)||void 0===a||null===(l=a.i18n)||void 0===l?void 0:l.show_chapters)||"Show Chapters",B='<button class="plyr__controls__item plyr__control" type="button" data-plyr="chapters">\n<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list">\n <line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line>\n <line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line>\n <line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line>\n</svg>\n<span class="label--pressed plyr__tooltip" role="tooltip">'.concat(N,'</span>\n<span class="label--not-pressed plyr__tooltip" role="tooltip">').concat(z,"</span>\n</button>\n"),j='\n<div class="presto-player-toc__wrapper">\n <div class="presto-player-toc__cover" data-player-toc-cover></div>\n <div class="presto-player-toc">\n <div class="presto-player-toc__title">'.concat((null===(c=window)||void 0===c||null===(h=c.prestoPlayer)||void 0===h||null===(u=h.i18n)||void 0===u?void 0:u.chapters)||"Chapters",'</div>\n <div class="presto-player-toc__list" data-player-toc></div>\n </div>\n</div>');function F(e){var t,i,n,r,o,s,a,l,c,h,u,d,p,m=0,g={},v={},y=null,w=0;if("undefined"!=typeof jQuery)if(r=e.detail.plyr,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!e.length)return e;var t={};return e.forEach((function(e){var i,n=e.time.split(":");n.length>1&&(i=60*parseInt(n[0]));var r=parseInt(n[1])+parseInt(i);t[r]=e})),t}((null===(t=r)||void 0===t||null===(i=t.config)||void 0===i?void 0:i.chapters)||[]),"html5"!==r.provider||r.duration){if(n&&Object.keys(n).length){o=jQuery(r.elements.container).closest(".presto-player__wrapper").find(".plyr");var k=(p=jQuery(r.elements.controls)).find(".plyr__time");k=k.length?k:p.find(".plyr__progress__container"),(c=o.find('[data-plyr="chapters"]')).length||(c=jQuery(B).insertAfter(k)),(a=o.find(".presto-player-toc__wrapper")).length||(a=jQuery(j).appendTo(o)),h=a.find("[data-player-toc-cover]"),l=a.find("[data-player-toc]"),s=o.find(".plyr__progress__container");var x,_=jQuery('<div class="presto-player__chapters"></div>').appendTo(s);u=jQuery('<div class="presto-player__chapter-markers"></div>').appendTo(_),x=0,l.find(".presto-player-toc__chapter").length||(Object.keys(n).forEach((function(e){x++;var t=n[e],i=jQuery(function(e){var t=e.name,i=void 0===t?"Untitled":t,n=e.order,r=void 0===n?1:n,o=e.highlight;return'<div class="presto-player-toc__chapter '.concat(void 0!==o&&o?"is-highlighted":"",'" data-chapter-item>\n \n <span class="presto-player-toc__order">\n ').concat(r,'\n </span>\n <span class="presto-player-toc__name">\n ').concat(i,"\n </div>\n</div>")}({name:t.title,order:x})).appendTo(l);i.data("presto-player-timestamp",e),g[e]=i,i.on("click",(function(){r.currentTime=parseFloat(e),r.playing||(r.play(),r.once("playing",(function(){setTimeout((function(){r.pause()}),50)}))),C(!1)}))})),d=a.find("[data-chapter-item]")),O(),c.off("click"),c.on("click",C),S(),r.off("timeupdate"),r.on("timeupdate",S),y=window.setInterval((function(){w++,r.duration&&(O(),window.clearInterval(y)),w>50&&window.clearInterval(y)}),100),h.off("click"),h.on("click",(function(){return C(!1)})),l.off("mouseleave"),l.on("mouseleave",(function e(){if(r.playing){var t=setTimeout((function(){C(!1),l.off("mouseleave",e)}),2e3);l.on("mouseenter",(function(){clearTimeout(t)}))}}))}}else r.on("loadedmetadata",F);function S(){m=r.currentTime;var e=Object.keys(n).filter((function(e){return e<=m})).map((function(e){return parseInt(e,10)})),t=Math.max.apply(Math,(0,f.Z)(e));d&&d.removeClass("is-highlighted"),jQuery(g[t||0]).addClass("is-highlighted")}function O(){r.duration&&(Object.keys(n).forEach((function(e){if(parseInt(e)&&!u.find("[data-timestamp=".concat(e,"]")).length){var t=n[e],i=parseInt(e)/r.duration*100,o=jQuery((s={position:i,name:"".concat(t.title)},a=s.position,l=s.name,c=void 0===l?"":l,'<div class="presto-player-progress__marker plyr__controls__item plyr__control" style="left: '.concat(void 0===a?0:a,'%" data-timeline-marker>\n <span class="label--not-pressed plyr__tooltip" role="tooltip">').concat(c,"</span>\n </div>"))).prependTo(u);o.attr("data-timestamp",e),o.data("timestamp",e),v[e]=o,o.on("click",(function(t){r.currentTime=parseInt(e),r.play()}))}var s,a,l,c})),a.find("[data-timeline-marker]"))}function C(e){void 0!==(0,b.Z)(e)?a.toggleClass("is-showing",e):a.toggleClass("is-showing")}}function V(e){"undefined"!=typeof jQuery&&(I=e,jQuery(I.elements.container).closest(".presto-player__wrapper"),I.on("ready",F),I.on("controlshidden",W),I.on("controlsshown",$))}function W(e){var t,i,n;"undefined"!=typeof jQuery&&jQuery(null==e||null===(t=e.detail)||void 0===t||null===(i=t.plyr)||void 0===i||null===(n=i.elements)||void 0===n?void 0:n.container).closest(".presto-player__wrapper").addClass("presto-player--hide-controls")}function $(e){var t,i,n;"undefined"!=typeof jQuery&&jQuery(null==e||null===(t=e.detail)||void 0===t||null===(i=t.plyr)||void 0===i||null===(n=i.elements)||void 0===n?void 0:n.container).closest(".presto-player__wrapper").removeClass("presto-player--hide-controls")}function Q(e){var t,i;return A(A(A({video_current_time:parseInt((null==e?void 0:e.currentTime)||0),video_provider:(null==e?void 0:e.provider)||"html5"},null!=e&&e.duration?{video_duration:parseInt(null==e?void 0:e.duration)}:{}),null!=e&&e.source?{video_url:null==e?void 0:e.source}:{}),null!=e&&null!==(t=e.config)&&void 0!==t&&t.title?{video_title:null==e||null===(i=e.config)||void 0===i?void 0:i.title}:{})}function H(e){var t,i;null!=e&&null!==(t=e.config)&&void 0!==t&&t.hasPlayed||(e.config.hasPlayed=!0,null===(i=window)||void 0===i||i.gtag("event","Play",Q(e)))}function q(e){var t;null===(t=window)||void 0===t||t.gtag("event","Pause",Q(e))}function Z(e){var t,i;null!=e&&null!==(t=e.config)&&void 0!==t&&t.hasLoaded||(e.config.hasLoaded=!0,null===(i=window)||void 0===i||i.gtag("event","Player Load",Q(e)))}var U,X={25:!1,50:!1,75:!1,100:!1};function J(e){if(e.currentTime){var t=parseFloat(e.currentTime)/parseFloat(e.duration)*100;Object.keys(X).forEach((function(i){var n;!X[i]&&t>=parseInt(i)&&(X[i]=!0,null===(n=window)||void 0===n||n.gtag("event","".concat(i," Percent Played"),Q(e)))}))}}var Y="presto-player.analytics",K="",G=0;function ee(e){var t,i;(U=e).config.analytics&&null!==(t=window)&&void 0!==t&&null!==(i=t.wp)&&void 0!==i&&i.hooks&&(wp.hooks.hasAction("presto.nonceRefreshed",Y)||wp.hooks.addAction("presto.nonceRefreshed",Y,(function(e){K=e})),wp.hooks.hasAction("presto.playerPlay",Y)||wp.hooks.addAction("presto.playerPlay",Y,te),wp.hooks.hasAction("presto.playerEnded",Y)||wp.hooks.addAction("presto.playerEnded",Y,te),wp.hooks.hasAction("presto.playerHidden",Y)||wp.hooks.addAction("presto.playerHidden",Y,te),wp.hooks.hasAction("presto.playerPause",Y)||wp.hooks.addAction("presto.playerPause",Y,te),wp.hooks.hasAction("presto.playerSeeked",Y)||wp.hooks.addAction("presto.playerSeeked",Y,te))}function te(e){isNaN(null==e?void 0:e.currentTime)||ie(function(e){var t,i;return e.currentTime>G&&(G=e.currentTime),e.currentTime>=e.duration&&(G=e.duration),A(A(A({video_current_time:parseInt(G),video_provider:(null==e?void 0:e.provider)||"html5"},null!=e&&e.duration?{video_duration:parseInt(null==e?void 0:e.duration)}:{}),null!=e&&e.source?{video_url:null==e?void 0:e.source}:{}),null!=e&&null!==(t=e.config)&&void 0!==t&&t.title?{video_title:null==e||null===(i=e.config)||void 0===i?void 0:i.title}:{})}(e))}function ie(e){var t,i,n,r,o,s,a,l;if(K){var c,h,u=new FormData;u.append("action","presto_player_progress"),u.append("duration",null==e?void 0:e.video_current_time),u.append("video_id",null===(t=U)||void 0===t||null===(i=t.config)||void 0===i?void 0:i.id),u.append("nonce",K),null!==(n=window)&&void 0!==n&&null!==(r=n.prestoPlayer)&&void 0!==r&&r.debug_navigator?"undefined"!=typeof jQuery&&jQuery.ajax({type:"POST",url:null===(o=window)||void 0===o||null===(s=o.prestoPlayer)||void 0===s?void 0:s.ajaxurl,dataType:"json",cache:!1,data:{action:"presto_player_progress",duration:null==e?void 0:e.video_current_time,video_id:null===(a=U)||void 0===a||null===(l=a.config)||void 0===l?void 0:l.id,nonce:K}}):navigator.sendBeacon(null===(c=window)||void 0===c||null===(h=c.prestoPlayer)||void 0===h?void 0:h.ajaxurl,u)}}function ne(e){var t,i,n;null!==(t=window)&&void 0!==t&&null!==(i=t.prestoPlayer)&&void 0!==i&&i.isPremium&&(null!==(n=window)&&void 0!==n&&n.gtag&&(wp.hooks.addAction("presto.playerPlay","presto-player",H),wp.hooks.addAction("presto.playerPause","presto-player",q),wp.hooks.addAction("presto.playerReady","presto-player",Z),wp.hooks.addAction("presto.playerTimeUpdate","presto-player",J)),ee(e))}var re=function(e){e.on("ready",(function(){var t,i,n,r;null==e||null===(t=e.config)||void 0===t||!t.logo||null!=e&&null!==(i=e.config)&&void 0!==i&&i.logo_added||"undefined"!=typeof jQuery&&(e.isAudio||(jQuery('<img src="'.concat(null==e||null===(n=e.config)||void 0===n?void 0:n.logo,'" class="presto-player__logo is-bottom-right" part="logo">')).insertBefore(null==e||null===(r=e.elements)||void 0===r?void 0:r.controls),e.config.logo_added=!0))}))};function oe(e){var t;null!=e&&null!==(t=e.config)&&void 0!==t&&t.poster&&(e.poster=e.config.poster)}var se=function(e){var t,i;null!==(t=window)&&void 0!==t&&null!==(i=t.wp)&&void 0!==i&&i.hooks&&(e.on("ready",(function(){ae("Ready",e)})),e.on("play",(function(){ae("Play",e)})),e.on("playing",(function(){ae("Playing",e)})),e.on("pause",(function(){ae("Pause",e)})),e.on("ended",(function(){ae("Ended",e)})),e.on("seeked",(function(){ae("Seeked",e)})),e.on("timeupdate",(function(){ae("TimeUpdate",e)})),e.on("enterfullscreen",(function(){ae("EnterFullScreen",e)})),e.on("exitfullscreen",(function(){ae("ExitFullScreen",e)})),document.addEventListener("visibilitychange",(function(){ae("hidden"===document.visibilityState?"Hidden":"Visible",e)})),e.on("statechange",(function(t){var i;switch(null==t||null===(i=t.detail)||void 0===i?void 0:i.code){case 0:ae("Ended",e);break;case 1:ae("Play",e);break;case 2:ae("Pause",e)}})))};function ae(e,t){window.wp.hooks.doAction("presto.player".concat(e),t)}var le,ce="presto-player.progress",he=Date.now(),ue=function(e){var t,i;if(e.automations){(null===(i=null===(t=null===window||void 0===window?void 0:window.wp)||void 0===t?void 0:t.hooks)||void 0===i?void 0:i.hasAction("presto.nonceRefreshed",ce))||window.wp.hooks.addAction("presto.nonceRefreshed",ce,(function(e){le=e})),null===window||void 0===window||window.wp.hooks.addAction("presto.playerTimeUpdate","presto-player",r),null===window||void 0===window||window.wp.hooks.addAction("presto.playerEnded","presto-player",(function(e){return r(e,100)}));var n={0:!1,10:!1,20:!1,30:!1,40:!1,50:!1,60:!1,70:!1,80:!1,90:!1,100:!1}}function r(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;le&&(null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.ajaxProgress)&&(i||(i=parseFloat(e.currentTime)/parseFloat(e.duration)*100),e.watched=e.watched||{},Object.keys(n).forEach((function(t){var n,r,o,s,a,l,c,h,u,d=parseInt(t);if(!e.watched[d]&&i>=d){e.watched[d]=!0;var p=new FormData;if(p.append("action","presto_player_progress_percent"),p.append("id",null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.id),p.append("percent",d.toString()),p.append("visit_time",he.toString()),p.append("nonce",le),(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.debug)&&console.log("".concat(d," percent watched.")),null===(o=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===o?void 0:o.debug_navigator)window.jQuery.ajax({type:"POST",url:null===(h=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===h?void 0:h.ajaxurl,dataType:"json",cache:!1,data:{action:"presto_player_progress_percent",id:null===(u=null==e?void 0:e.config)||void 0===u?void 0:u.id,visit_time:he,percent:d,nonce:le}});else{var f=navigator.sendBeacon(null===(s=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===s?void 0:s.ajaxurl,p);(null===(a=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===a?void 0:a.debug)&&(f?console.log("Successfully queued progress:",{id:null===(l=null==e?void 0:e.config)||void 0===l?void 0:l.id,percent:d,visit_time:he,nonce:le}):console.log("Failed to queue progress",{id:null===(c=null==e?void 0:e.config)||void 0===c?void 0:c.id,percent:d,visit_time:he,nonce:le}))}}})))}},de=!1,pe=!1;function fe(e){return e.status>=200&&e.status<300?Promise.resolve(e):Promise.reject(new Error(e.statusText))}var me=function(e){var t,i;(e.config.analytics||e.config.automations)&&(null===(i=null===(t=null===window||void 0===window?void 0:window.wp)||void 0===t?void 0:t.hooks)||void 0===i||i.addAction("presto.playerPlaying","presto-player",(function(){null===window||void 0===window||window.wp.hooks.doAction("presto.playerGetNonce")})),null===window||void 0===window||window.wp.hooks.addAction("presto.playerGetNonce","presto-player",(function(){var e;de||pe||(pe=!0,fetch("".concat(null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.ajaxurl,"?action=presto_refresh_progress_nonce")).then(fe).then((function(e){return e.json()})).then((function(e){var t=e.data;null===window||void 0===window||window.wp.hooks.doAction("presto.nonceRefreshed",t),de=!0})).catch((function(e){console.log("Request failed",e)})).finally((function(){pe=!1})))})))},ge=function(e){var t=window.navigator.userAgent;if(t.match(/iPad/i)||t.match(/iPhone/i)){var i=function(e,t){for(var i,n,r,o=null==e||null===(i=e.elements)||void 0===i||null===(n=i.container)||void 0===n||null===(r=n.getRootNode())||void 0===r?void 0:r.host;(null!=o?o.nodeType:void 0)===Node.ELEMENT_NODE&&"BODY"!==o.tagName&&"HTML"!==o.tagName;)t?o.classList.add("presto-player-fullscreen-open"):o.classList.remove("presto-player-fullscreen-open"),o=o.parentNode};wp.hooks.addAction("presto.playerEnterFullScreen","presto-player",(function(){var t;null!=e&&null!==(t=e.fullscreen)&&void 0!==t&&t.active&&i(e,!0)})),wp.hooks.addAction("presto.playerExitFullScreen","presto-player",(function(){var t;null!=e&&null!==(t=e.fullscreen)&&void 0!==t&&t.active||i(e,!1)}))}},ve=function(){var e=(0,d.Z)(k().mark((function e(t){var n,r,o,s,a,l,c,h;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"!=typeof jQuery){e.next=2;break}return e.abrupt("return");case 2:if("ResizeObserver"in window!=0){e.next=7;break}return e.next=5,i.e(982).then(i.bind(i,4723));case 5:c=e.sent,window.ResizeObserver=c.ResizeObserver;case 7:if(h=new ResizeObserver((function(e){var t,i=O(e);try{for(i.s();!(t=i.n()).done;){var n=t.value,r=n.contentRect;jQuery(n.target).find(".plyr__menu__container").css({maxHeight:"".concat(Math.max(r.height-48,200),"px")})}}catch(e){i.e(e)}finally{i.f()}})),null!=t&&null!==(n=t.elements)&&void 0!==n&&null!==(r=n.container)&&void 0!==r&&null!==(o=r.getRootNode())&&void 0!==o&&o.firstChild){e.next=10;break}return e.abrupt("return");case 10:if(h.observe(null==t||null===(s=t.elements)||void 0===s||null===(a=s.container)||void 0===a||null===(l=a.getRootNode())||void 0===l?void 0:l.firstChild),t){e.next=13;break}return e.abrupt("return");case 13:t.on("playing",(function(){var e,i,n,r,o=null==t||null===(e=t.elements)||void 0===e||null===(i=e.container)||void 0===i?void 0:i.getRootNode().firstChild.getBoundingClientRect();jQuery(null==t||null===(n=t.elements)||void 0===n||null===(r=n.container)||void 0===r?void 0:r.getRootNode()).find(".plyr__menu__container").css({maxHeight:"".concat(Math.max(o.height-48,200),"px")})}));case 14:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();function ye(e){var t,n,r,o,s,a,l,c,h,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},p=(null===(t=window)||void 0===t||null===(n=t.parent)||void 0===n||null===(r=n.prestoPlayer)||void 0===r?void 0:r.plugin_url)||(null===(o=window)||void 0===o||null===(s=o.prestoPlayer)||void 0===s?void 0:s.plugin_url),f=A(A(A({},d),p?{iconUrl:"".concat(p,"img/")+"".concat(null!=d&&null!==(a=d.preset)&&void 0!==a&&a.skin?d.preset.skin:"default")+".svg"}:{}),{chapters:(null==d?void 0:d.chapters)||[],controls:(null==d?void 0:d.controls)||[],settings:Object.keys((null==d?void 0:d.settings)||{}).length?d.settings:{}}),m=new E(e,f);return"undefined"!=typeof learndash_video_data&&i.e(982).then(i.bind(i,7727)).then((function(e){(0,e.default)(m)})),"undefined"!=typeof _tutorobject&&i.e(982).then(i.bind(i,6578)).then((function(e){(0,e.default)(m)})),void 0!==window.llms&&!0===(null===(h=prestoPlayer)||void 0===h||null===(u=h.lifter)||void 0===u?void 0:u.isLesson)&&i.e(982).then(i.bind(i,9097)).then((function(e){(0,e.default)(m)})),se(m),ge(m),ve(m),re(m),oe(m),V(m),null!==(l=window)&&void 0!==l&&null!==(c=l.prestoPlayer)&&void 0!==c&&c.isAdmin||(me(m),ue(f),D(m),ne(m)),m}var be=function(e){var t=e.config,n=e.selector,r=e.src,o=e.preload;return r&&(0,_.i)(r)?n&&n.canPlayType("application/vnd.apple.mpegurl")&&(0,_.a)()?we({config:t,selector:n}):i.e(982).then(i.bind(i,1786)).then((function(e){return(0,e.default)({config:t,selector:n,src:r,preload:o})})):we({config:t,selector:n})},we=function(e){var t=e.config,i=e.selector;return new Promise((function(e){return e(new ye(i,A({},t)))}))},ke=function(e,t){if(t){var i=document.createElement("style");e.shadowRoot.append(i),i.appendChild(document.createTextNode(t))}},xe=function(){function e(t){(0,m.Z)(this,e),(0,x.r)(this,t),this.loaded=(0,x.c)(this,"loaded",7),this.currentMediaPlayer=(0,x.c)(this,"currentMediaPlayer",7),this.playerReady=(0,x.c)(this,"playerReady",7),this.playedMedia=(0,x.c)(this,"playedMedia",7),this.pausedMedia=(0,x.c)(this,"pausedMedia",7),this.endedMedia=(0,x.c)(this,"endedMedia",7),this.components={cta:null,email:null,overlays:null,search:null},this.video_id=void 0,this.iconUrl=void 0,this.src=void 0,this.bunny=void 0,this.branding=void 0,this.config=void 0,this.preset=void 0,this.chapters=void 0,this.overlays=void 0,this.blockAttributes=void 0,this.tracks=void 0,this.analytics=void 0,this.automations=void 0,this.provider=void 0,this.provider_video_id=void 0,this.actionBar=void 0,this.youtube=void 0,this.type=void 0,this.autoplay=void 0,this.preload=void 0,this.poster=void 0,this.playsinline=void 0,this.isAdmin=!1,this.direction=void 0,this.css=void 0,this.currentTime=void 0,this.mediaTitle=void 0,this.classes=void 0,this.videoAttributes=void 0,this.audioAttributes=void 0,this.search=void 0,this.markers=void 0,this.player=void 0,this.playerEl=void 0,this.shouldLazyLoad=void 0,this.mutedPreview=void 0,this.duration=void 0,this.isSticky=void 0,this.videoHeight=void 0,this.playClass=void 0,this.previouslyPlaying=!1,this.ctaActive=!1,this.emailActive=!1,this.actionBarActive=!1,this.ready=void 0}var t,i,n,r,o,s,a,l,c,h,u,p,v,y,b;return(0,g.Z)(e,[{key:"play",value:(b=(0,d.Z)(k().mark((function e(){var t,i=arguments;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=i.length>0&&void 0!==i[0]&&i[0],this.shouldLazyLoad=!1,t&&(this.mutedPreview=!1),this.player.play();case 4:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"goToAndPlay",value:(y=(0,d.Z)(k().mark((function e(t){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.player.play(),this.player.currentTime=t;case 2:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"handleScroll",value:function(e){e.detail.id!==this.player.id&&(this.mutedPreview||this.pause())}},{key:"restart",value:(v=(0,d.Z)(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.shouldLazyLoad=!1,e.abrupt("return",this.player.restart());case 2:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"pause",value:(p=(0,d.Z)(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.player.pause());case 1:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"stop",value:(u=(0,d.Z)(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.player.stop());case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"fullscreenToggle",value:(h=(0,d.Z)(k().mark((function e(t){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.player.fullscreen.toggle(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"on",value:(c=(0,d.Z)(k().mark((function e(t,i){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.player.on(t,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"once",value:(l=(0,d.Z)(k().mark((function e(t,i){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.player.once(t,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"off",value:(a=(0,d.Z)(k().mark((function e(t,i){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.player.off(t,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return a.apply(this,arguments)})},{key:"handleCurrentTimeChange",value:(s=(0,d.Z)(k().mark((function e(t){var i=this;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.player||!Number.isInteger(t)){e.next=7;break}if(this.player.duration&&(this.player.currentTime=Math.min(this.player.currentTime,this.player.duration)),!this.shouldLazyLoad){e.next=6;break}return this.shouldLazyLoad=!1,e.next=6,new Promise((function(e){setTimeout((0,d.Z)(k().mark((function t(){return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.initialize();case 2:e();case 3:case"end":return t.stop()}}),t)}))),50)}));case 6:this.player.embed&&!this.player.playing?(this.player.currentTime=t,this.player.muted=!0,this.player.play(),this.player.once("timeupdate",(function(){i.player.pause(),i.player.currentTime=t,i.player.muted=!1}))):this.player.currentTime=t;case 7:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"handleStickyChange",value:function(){var e=this;(0,_.g)(this.el).forEach((function(t){var i;null===(i=null==t?void 0:t.classList)||void 0===i||i.toggle("presto-sticky-parent",e.isSticky)}))}},{key:"getConfig",value:function(){return Object.assign(Object.assign(Object.assign({},function(e){var t,i,n,r=e.preset,o=void 0===r?{}:r,s=e.chapters,a=e.branding,l=e.src,c=e.analytics,h=e.automations,u=e.autoplay,d=e.blockAttributes,p=void 0===d?{}:d,m=e.provider,g=void 0===m?"":m,v=e.provider_video_id,y=void 0===v?"":v,b=e.youtube,w=e.type,k=e.i18n,x=e.storage,_=void 0===x?{enabled:!e.isAdmin,key:"presto-player-".concat(o.id)}:x,S=["settings"],O=(0,f.Z)(["youtube","vimeo"].includes(g)?["pip"]:[]),C=["play-large","rewind","play","fast-forward","progress","current-time","mute","volume","captions","settings","pip","fullscreen"].filter((function(e){return((null==o?void 0:o[e])||S.includes(e))&&!O.includes(e)})),T=Object.assign(Object.assign(Object.assign(Object.assign({id:null==p?void 0:p.id,title:(null==p?void 0:p.title)||"",blockAttributes:Object.assign(Object.assign({},p),{type:w}),src:l,ajaxProgress:!0,analytics:c,preset:o,automations:h,mutedPreview:{enabled:null===(t=null==p?void 0:p.mutedPreview)||void 0===t?void 0:t.enabled},loop:{active:"loop"===(null==o?void 0:o.on_video_end)},chapters:s,controls:C,settings:["captions","quality","loop"].concat((0,f.Z)((null==o?void 0:o.speed)?["speed"]:[])),hideControls:null==o?void 0:o.auto_hide,captions:{active:null==o?void 0:o.captions_enabled,language:"auto",update:!1},logo:null==a?void 0:a.logo,logo_width:null==a?void 0:a.logo_width,hide_logo:null==o?void 0:o.hide_logo,lazy_load_youtube:null==o?void 0:o.lazy_load_youtube,save_player_position:!!(null==o?void 0:o.save_player_position),sticky_scroll:null==o?void 0:o.sticky_scroll,play_video_viewport:null==o?void 0:o.play_video_viewport,autoplay:!(!u||(null===(i=window.wp)||void 0===i?void 0:i.blocks))},g?{provider:g}:{}),y?{provider_video_id:y}:{}),(null==p?void 0:p.poster)?{poster:p.poster}:{}),{invertTime:!(null==o?void 0:o.show_time_elapsed),storage:_,keyboard:{focused:!1,global:!1},resetOnEnd:!!(null==o?void 0:o.reset_on_end),vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,premium:!1,playsinline:!!(null==p?void 0:p.playsInline)},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!!(null==b?void 0:b.noCookie),playsinline:!!(null==p?void 0:p.playsInline)},tooltips:{controls:!0,seek:!0},i18n:k});return(null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)&&(T=window.wp.hooks.applyFilters("presto.playerSettings",T)),T}({preset:this.preset,chapters:this.chapters,branding:this.branding,analytics:!!this.analytics,automations:!!this.automations,autoplay:!this.isAdmin&&!!this.autoplay,blockAttributes:this.blockAttributes,provider:this.provider,youtube:this.youtube,provider_video_id:this.provider_video_id,i18n:this.i18n,search:this.search})),{markers:{enabled:!0,points:[]}}),this.iconUrl?{iconUrl:this.iconUrl}:{})}},{key:"getPlayerData",value:function(){return{selector:this.playerEl,src:this.src||"",preload:this.preload,provider:this.provider,config:this.getConfig(),isAdmin:this.isAdmin}}},{key:"createPlayer",value:(o=(0,d.Z)(k().mark((function e(){return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,be(this.getPlayerData());case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"handlePlayerElementChange",value:function(){var e;!function(e){var t=e.src,i=e.el,n=e.preload,r=e.currentTime;if((!i||!i.getAttribute("hls_loaded"))&&["metadata","none"].includes(n)&&(0,_.i)(t)){if(r>0)return i.style.height=null,i.style.paddingBottom=null,void i.setAttribute("hls_loaded","1");i.style.height="0px",i.style.paddingBottom="56.25%"}}({src:this.src,el:this.playerEl,preload:this.preload,currentTime:null===(e=null==this?void 0:this.player)||void 0===e?void 0:e.currentTime})}},{key:"handleMutedPreview",value:function(e,t){var i,n,r,o,s,a,l,c=this;this.player&&!this.isAdmin&&(!e&&t&&this.player.once("timeupdate",(function(){var e,t;c.player.loop="loop"===(null===(e=c.preset)||void 0===e?void 0:e.on_video_end),c.player.toggleCaptions(null===(t=null==c?void 0:c.preset)||void 0===t?void 0:t.captions_enabled)})),(null===(r=null===(n=null===(i=this.originalConfig)||void 0===i?void 0:i.blockAttributes)||void 0===n?void 0:n.mutedPreview)||void 0===r?void 0:r.enabled)&&function(e){var t=e.player,i=e.mutedPreview,n=e.captions,r=e.progress,o=e.savePosition,s=e.onPlay,a=window.navigator.userAgent;if(!a.match(/iPad/i)&&!a.match(/iPhone/i)){t.config.mutedPreview.enabled=i,t.muted=i,t.loop=i,t.config.ajaxProgress=!i&&r,t.config.save_player_position=!i&&o;try{t.toggleCaptions(!!i&&!!n)}catch(e){}return setTimeout((function(){R(t)||t.restart(),setTimeout((function(){t.muted=i,s()}),50)}),0),t}console.log("ios device, do not do muted autoplay")}({player:this.player,mutedPreview:this.mutedPreview,captions:!!(null===(s=null===(o=this.blockAttributes)||void 0===o?void 0:o.mutedPreview)||void 0===s?void 0:s.captions),progress:null===(a=this.originalConfig)||void 0===a?void 0:a.ajaxProgress,savePosition:null===(l=this.originalConfig)||void 0===l?void 0:l.save_player_position,onPlay:function(){return c.play()}}))}},{key:"onPlayerReady",value:function(){var e,t,i,n=this;this.observer&&(this.observer.disconnect(),this.observer.observe(this.el)),this.duration=this.player.duration;var r=window.navigator.userAgent;!!r.match(/iPad/i)||!!r.match(/iPhone/i)||(this.mutedPreview=null===(t=null===(e=this.blockAttributes)||void 0===e?void 0:e.mutedPreview)||void 0===t?void 0:t.enabled),this.renderDynamicOverlays(),this.renderVideoCTA(),this.renderEmailOverlay(),this.renderSearchBar(),this.player.on("timeupdate loadedmetadata",(function(){n.duration=n.player.duration,n.renderDynamicOverlays()})),(0,_.i)(this.src)&&this.player.once("playing",(function(){n.playerEl.style.height=null,n.playerEl.style.paddingBottom=null,n.playerEl.setAttribute("hls_loaded","1")})),this.player.on("playing",(function(){return n.playClass="presto-player--playing"})),this.player.on("pause",(function(){return n.playClass="presto-player--paused"})),this.player.on("ended",(function(){return n.playClass="presto-player--ended"})),this.player.on("playing",(function(e){return!n.mutedPreview&&n.currentMediaPlayer.emit(e.detail.plyr)})),this.player.on("playing",(function(e){return n.playedMedia.emit(e.detail.plyr)})),this.player.on("pause",(function(e){return n.pausedMedia.emit(e.detail.plyr)})),this.player.on("ended",(function(e){return n.endedMedia.emit(e.detail.plyr)})),"go-to-start"===(null===(i=this.preset)||void 0===i?void 0:i.on_video_end)&&this.player.on("ended",(function(){n.restart(),"youtube"===n.provider&&n.stop()})),(0,_.c)(this.player),setTimeout((function(){n.playerReady.emit(n.player),n.ready=!0}),100)}},{key:"handlePlayerEvents",value:function(e){var t=this;e.on("ready",(function(e){t.player=e.detail.plyr,t.onPlayerReady()}))}},{key:"handleLazyLoadChange",value:function(){var e=this;"youtube"!==this.provider||this.shouldLazyLoad||this.isAdmin||setTimeout((function(){e.onReload("play")}),50)}},{key:"shouldLazyLoadVideo",value:function(){var e,t,i;return"youtube"===this.provider&&!this.autoplay&&!(null===(t=null===(e=this.blockAttributes)||void 0===e?void 0:e.mutedPreview)||void 0===t?void 0:t.enabled)&&!!(null===(i=this.preset)||void 0===i?void 0:i.lazy_load_youtube)}},{key:"componentWillLoad",value:function(){var e,t,i,n=null===(e=this.el.children)||void 0===e?void 0:e[0];n&&n.classList&&n.classList.contains("presto-iframe-fallback-container")&&n.remove(),this.shouldLazyLoad=this.shouldLazyLoadVideo(),this.i18n=(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.i18n)||(null===(i=null===window||void 0===window?void 0:window.prestoPlayerAdmin)||void 0===i?void 0:i.i18n),this.originalConfig||(this.originalConfig=this.getConfig()),this.trackIntersection()}},{key:"componentDidLoad",value:(r=(0,d.Z)(k().mark((function e(){var t=this;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:setTimeout((function(){t.initialize(),t.loaded.emit(!0)}),0);case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"initialize",value:(n=(0,d.Z)(k().mark((function e(){var t;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createPlayer();case 2:return t=e.sent,this.handlePlayerEvents(t),this.syncVideoHeight(),ke(this.el,this.css),e.abrupt("return",t);case 7:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"renderSkins",value:function(){var e,t,i;return"modern"===(null===(e=this.preset)||void 0===e?void 0:e.skin)?(0,x.h)("presto-modern-skin",null):"business"===(null===(t=this.preset)||void 0===t?void 0:t.skin)?(0,x.h)("presto-business-skin",null):"stacked"===(null===(i=this.preset)||void 0===i?void 0:i.skin)?(0,x.h)("presto-stacked-skin",null):void 0}},{key:"onReload",value:(i=(0,d.Z)(k().mark((function e(t){var i,n=this;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initialize();case 2:i=e.sent,"play"==t&&i.on("ready",(function(){n.play(),i.muted=!0,i.muted=!1,i.off("ready",n.play)}));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"syncVideoHeight",value:(t=(0,d.Z)(k().mark((function e(){var t=this;return k().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:new ResizeObserver((function(){t.isSticky||(t.videoHeight=t.el.getBoundingClientRect().height)})).observe(this.el);case 2:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"handleRestartVideo",value:function(){var e=this;this.player.once("timeupdate",(function(){setTimeout((function(){return e.play()}),500)})),this.player.restart()}},{key:"handlePlayVideo",value:function(){this.play()}},{key:"handlePauseVideo",value:function(e){this.pause(),e.detail&&(0,_.e)(this.player)}},{key:"playVideoOnlyInViewport",value:function(){var e;!this.isAdmin&&(null===(e=this.preset)||void 0===e?void 0:e.play_video_viewport)&&this.player&&("visible"===document.visibilityState?this.observer.observe(this.el):(this.player.playing&&(this.previouslyPlaying=!0),this.pause(),this.observer.disconnect()))}},{key:"trackIntersection",value:function(){var e=this;this.observer=new IntersectionObserver((function(t){e.handleVisibilityIntersection(null==t?void 0:t[0])})),this.observer.observe(this.el)}},{key:"handleVisibilityIntersection",value:function(e){e&&(this.handleStickyScroll(e),this.handleVisibilityPlayChange(e))}},{key:"handleStickyScroll",value:function(e){var t,i,n=this;if(null===(t=this.preset)||void 0===t?void 0:t.sticky_scroll)if(this.isAdmin||this.mutedPreview||!(null===(i=null==this?void 0:this.player)||void 0===i?void 0:i.playing))this.isSticky=!1;else{var r=e.boundingClientRect;if(this.isSticky=r.height<-r.top,"visible"===document.visibilityState&&this.isSticky&&this.player){var o=function e(){window.removeEventListener("scroll",e),n.player.paused&&(n.isSticky=!1)};this.player.once("pause",(function(){window.addEventListener("scroll",o)}))}}}},{key:"handleVisibilityPlayChange",value:function(e){var t,i,n,r=this;if(!this.isAdmin&&(null===(t=this.preset)||void 0===t?void 0:t.play_video_viewport)&&(!this.player&&this.originalConfig.autoplay&&(this.previouslyPlaying=!0,this.autoplay=!!(null==e?void 0:e.isIntersecting)),this.player)){if(null==e?void 0:e.isIntersecting)return this.originalConfig.autoplay&&(this.autoplay=!0),this.previouslyPlaying&&this.play(),void(this.previouslyPlaying=!1);if("visible"!==document.visibilityState||!this.isSticky){if(null===(n=null===(i=this.blockAttributes)||void 0===i?void 0:i.mutedPreview)||void 0===n?void 0:n.enabled)return this.previouslyPlaying=!0,this.pause(),void this.player.once("playing",(function(){r.previouslyPlaying=!0,r.pause()}));this.player.playing&&(this.previouslyPlaying=!0),this.pause()}}}},{key:"renderMutedOverlay",value:function(){var e,t=this;if(this.player&&this.mutedPreview&&!this.isAdmin)return(0,x.h)("presto-muted-overlay",{mutedOverlay:null===(e=this.player.config.blockAttributes)||void 0===e?void 0:e.mutedOverlay,preset:this.preset,onPlayVideo:function(){t.mutedPreview=!1,t.play()}})}},{key:"renderVideo",value:function(){var e,t=this;switch(this.provider){case"vimeo":return(0,x.h)("presto-vimeo",{player:this.player,getRef:function(e){return t.playerEl=e},poster:this.poster,src:this.src});case"youtube":return(0,x.h)("presto-youtube",{onReload:function(e){return t.onReload(null==e?void 0:e.detail)},player:this.player,getRef:function(e){return t.playerEl=e},lazyLoad:this.shouldLazyLoad,poster:this.poster,src:this.src});case"bunny":return(0,x.h)("presto-bunny",{thumbnail:null===(e=null==this?void 0:this.bunny)||void 0===e?void 0:e.thumbnail,getRef:function(e){return t.playerEl=e},player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes});case"audio":return(0,x.h)("presto-audio",{getRef:function(e){return t.playerEl=e},player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,preset:this.preset,src:this.src,tracks:this.tracks,mediaTitle:this.mediaTitle,audioAttributes:this.audioAttributes});default:return(0,x.h)("presto-video",{getRef:function(e){return t.playerEl=e},player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes})}}},{key:"renderVideoCTA",value:function(){var e,t,i,n;(null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.isPremium)&&(this.isAdmin||(null===(i=null===(t=this.preset)||void 0===t?void 0:t.cta)||void 0===i?void 0:i.enabled)&&((null===(n=this.components.cta)||void 0===n?void 0:n.offsetParent)||"audio"!==this.provider&&(this.components.cta=document.createElement("presto-cta-overlay"),this.components.cta.direction=this.direction,this.components.cta.player=this.player,this.components.cta.preset=this.preset,this.components.cta.i18n=this.i18n,this.player.elements.container.append(this.components.cta))))}},{key:"renderAudioCTA",value:function(){var e,t;if("audio"===this.provider&&this.player&&(null===(t=null===(e=this.preset)||void 0===e?void 0:e.cta)||void 0===t?void 0:t.enabled))return(0,x.h)("presto-cta-overlay",{direction:this.direction,player:this.player,preset:this.preset,i18n:this.i18n,provider:this.provider})}},{key:"renderEmailOverlay",value:function(){var e,t,i;!(null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.isPremium)||this.isAdmin||(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.logged_in)||(null===(i=this.components.email)||void 0===i?void 0:i.offsetParent)||"audio"!==this.provider&&(this.components.email=document.createElement("presto-email-overlay"),this.components.email.direction=this.direction,this.components.email.player=this.player,this.components.email.preset=this.preset,this.components.email.i18n=this.i18n,this.components.email.videoId=this.video_id,this.player.elements.container.append(this.components.email))}},{key:"renderAudioEmail",value:function(){var e,t;if("audio"===this.provider&&this.player&&(null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.isPremium)&&!this.isAdmin&&!(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.logged_in))return(0,x.h)("presto-email-overlay",{direction:this.direction,player:this.player,preset:this.preset,i18n:this.i18n,provider:this.provider})}},{key:"renderActionBar",value:function(){var e,t;if((null===(t=null===(e=this.preset)||void 0===e?void 0:e.action_bar)||void 0===t?void 0:t.enabled)&&this.player)return(0,x.h)("presto-action-bar",{config:this.preset.action_bar,player:null==this?void 0:this.player,youtube:this.youtube})}},{key:"renderSearchBar",value:function(){var e,t;(null===(t=null===(e=this.preset)||void 0===e?void 0:e.search)||void 0===t?void 0:t.enabled)&&(this.components.search=document.createElement("presto-search-bar"),this.components.search.player=this.player,this.player.elements.container.append(this.components.search))}},{key:"stickyPositionClass",value:function(){var e,t;return this.isSticky?(null===(e=this.preset)||void 0===e?void 0:e.sticky_scroll_position)?"presto-sticky--".concat(null===(t=this.preset)||void 0===t?void 0:t.sticky_scroll_position.replace(/\s+/g,"-")):"presto-sticky--bottom-right":""}},{key:"renderDynamicOverlays",value:function(){var e,t,i,n,r,o,s,a=this;this.player&&((null===(e=null==this?void 0:this.overlaysComponent)||void 0===e?void 0:e.offsetParent)||(this.overlaysComponent=document.createElement("presto-dynamic-overlays"),this.overlaysComponent.addEventListener("reloadComponent",(function(){a.overlaysComponent.remove(),a.overlaysComponent=document.createElement("presto-dynamic-overlays")}),{once:!0})),this.overlaysComponent.style.cssText="display: block !important; opacity: 1 !important; visibility: visible !important;",this.overlaysComponent.overlays=this.overlays,this.overlaysComponent.preset=this.preset,this.overlaysComponent.player=this.player,this.overlaysComponent.enabled=!(null===(n=null===(i=null===(t=this.player)||void 0===t?void 0:t.config)||void 0===i?void 0:i.mutedPreview)||void 0===n?void 0:n.enabled),(null===(r=null==this?void 0:this.overlaysComponent)||void 0===r?void 0:r.offsetParent)||null===(s=null===(o=this.player.elements)||void 0===o?void 0:o.wrapper)||void 0===s||s.append(this.overlaysComponent))}},{key:"handleCtaStateChange",value:function(e){this.ctaActive=e.detail}},{key:"handleEmailStateChange",value:function(e){this.emailActive=e.detail}},{key:"handleActionBarStateChange",value:function(e){this.actionBarActive=e.detail}},{key:"render",value:function(){var e,t,i,n,r,o,s,a;return(0,x.h)(x.H,{key:"34c7815fe160d80b5d6e099c8342909f7210bd7f",style:{height:this.isSticky?"".concat(this.videoHeight,"px"):"auto"},class:{ready:this.ready}},(0,x.h)("div",{key:"2a92320b9593bddaf4c0469d30f5b4b304c426cf",part:"wrapper",dir:this.direction,class:"presto-player__wrapper fitvidsignore\n presto-video-id-".concat(this.video_id,"\n ").concat(this.isSticky?"audio"===this.provider?"presto-sticky-audio":"presto-sticky":"","\n ").concat("audio"!==this.provider?this.stickyPositionClass():"","\n ").concat("rtl"===this.direction?"rtl":"","\n ").concat(!0===this.ctaActive?"cta-active":"","\n ").concat(!0===this.emailActive?"email-active":"","\n ").concat(!0===this.actionBarActive&&(null===(t=null===(e=this.preset)||void 0===e?void 0:e.action_bar)||void 0===t?void 0:t.enabled)?"action-bar-active":"","\n ").concat(!!(null===(i=this.preset)||void 0===i?void 0:i.skin)&&"skin-".concat(null===(n=this.preset)||void 0===n?void 0:n.skin),"\n ").concat((null===(r=this.preset)||void 0===r?void 0:r.hide_youtube)?"hide-youtube-ui":"","\n ").concat((null===(o=this.preset)||void 0===o?void 0:o.caption_style)?"caption-style-".concat(null===(s=this.preset)||void 0===s?void 0:s.caption_style):"","\n ").concat(this.mutedPreview?"is-muted-overlay":"","\n ").concat(this.playClass?this.playClass:"","\n ").concat((null===(a=this.preset)||void 0===a?void 0:a.play)&&!this.preset.rewind?"rewind-inactive":"","\n ").concat(this.classes||"")},(0,x.h)("div",{key:"e0210d49bfe357e8bae2e8ad5681edb23d12e63a"},(0,x.h)("slot",{key:"40251660b6d31d09a4fa3da602b277b186c25577",name:"player-start"}),(0,x.h)("slot",{key:"474eafa7fb0c589b17094ee113cdb82671295800",name:"player-before-video"}),this.renderVideo(),(0,x.h)("slot",{key:"c44be1f518b25590885ad72bfe8d99a53b73da82",name:"player-after-video"}),this.renderActionBar(),this.renderMutedOverlay(),this.renderAudioCTA(),this.renderAudioEmail(),this.renderSkins(),(0,x.h)("slot",{key:"7b25e6d1aa444ff3fed746564823f2cde77f17f2",name:"player-end"}))))}},{key:"el",get:function(){return(0,x.g)(this)}}],[{key:"watchers",get:function(){return{currentTime:["handleCurrentTimeChange"],isSticky:["handleStickyChange"],playerEl:["handlePlayerElementChange"],player:["handlePlayerElementChange"],mutedPreview:["handleMutedPreview"],shouldLazyLoad:["handleLazyLoadChange"],overlays:["renderDynamicOverlays"],preset:["renderDynamicOverlays"]}}}]),e}();xe.style='@charset "UTF-8";@keyframes plyr-progress{to{background-position:var(--plyr-progress-loading-size, 25px) 0}}@keyframes plyr-popup{0%{opacity:0.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{from{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:var(--plyr-font-family, inherit);font-variant-numeric:tabular-nums;font-weight:var(--plyr-font-weight-regular, 400);line-height:var(--plyr-line-height, 1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow 0.3s ease;z-index:0}.plyr video,.plyr audio,.plyr iframe{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui *::after,.plyr--full-ui *::before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:var(--plyr-badge-background, hsl(216, 15%, 34%));border-radius:var(--plyr-badge-border-radius, 2px);color:var(--plyr-badge-text-color, #fff);font-size:var(--plyr-font-size-badge, 9px);line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in 0.3s ease;bottom:0;display:none;font-size:var(--plyr-font-size-small, 13px);left:0;padding:var(--plyr-control-spacing, 10px);position:absolute;text-align:center;transition:transform 0.4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width: 480px){.plyr__captions{font-size:var(--plyr-font-size-base, 15px);padding:calc(var(--plyr-control-spacing, 10px) * 2)}}@media (min-width: 768px){.plyr__captions{font-size:var(--plyr-font-size-large, 18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 10px) * -4))}.plyr__caption{background:var(--plyr-captions-background, rgba(0, 0, 0, 0.8));border-radius:2px;box-decoration-break:clone;color:var(--plyr-captions-text-color, #fff);line-height:185%;padding:0.2em 0.5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:transparent;border:0;border-radius:var(--plyr-control-radius, 3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:calc(var(--plyr-control-spacing, 10px) * 0.7);position:relative;transition:all 0.3s ease}.plyr__control svg{display:block;fill:currentColor;height:var(--plyr-control-icon-size, 18px);pointer-events:none;width:var(--plyr-control-icon-size, 18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%)))) dotted 3px;outline-offset:2px}a.plyr__control{text-decoration:none}a.plyr__control::after,a.plyr__control::before{display:none}.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,.plyr__control.plyr__control--pressed .label--not-pressed{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:calc(var(--plyr-control-spacing, 10px) / 4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:calc(var(--plyr-control-spacing, 10px) / 4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 calc(var(--plyr-control-spacing, 10px) / 2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time{padding-left:0}.plyr__controls:empty{display:none}.plyr [data-plyr=captions],.plyr [data-plyr=pip],.plyr [data-plyr=airplay],.plyr [data-plyr=fullscreen]{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--pip-supported [data-plyr=pip],.plyr--airplay-supported [data-plyr=airplay],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform 0.3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup 0.2s ease;background:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-menu-radius, 4px);bottom:100%;box-shadow:var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:var(--plyr-menu-color, hsl(216, 15%, 34%));font-size:var(--plyr-font-size-base, 15px);margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1)}.plyr__menu__container::after{border:var(--plyr-menu-arrow-size, 4px) solid transparent;border-top-color:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));content:"";height:0;position:absolute;right:calc(((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7)) - (var(--plyr-menu-arrow-size, 4px) / 2));top:100%;width:0}.plyr__menu__container [role=menu]{padding:calc(var(--plyr-control-spacing, 10px) * 0.7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:var(--plyr-menu-color, hsl(216, 15%, 34%));display:flex;font-size:var(--plyr-font-size-menu, var(--plyr-font-size-small, 13px));padding:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 1.5) calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control::after{border:var(--plyr-menu-item-arrow-size, 4px) solid transparent;content:"";position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 4)}.plyr__menu__container .plyr__control--forward::after{border-left-color:var(--plyr-menu-arrow-color, hsl(216, 15%, 52%));right:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5) - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--forward.plyr__tab-focus::after,.plyr__menu__container .plyr__control--forward:hover::after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:var(--plyr-font-weight-regular, 400);margin:calc(var(--plyr-control-spacing, 10px) * 0.7);margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 2);padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 4);position:relative;width:calc(100% - (calc(var(--plyr-control-spacing, 10px) * 0.7) * 2))}.plyr__menu__container .plyr__control--back::after{border-right-color:var(--plyr-menu-arrow-color, hsl(216, 15%, 52%));left:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5) - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back::before{background:var(--plyr-menu-back-border-color, hsl(216, 15%, 88%));box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color, #fff);content:"";height:1px;left:0;margin-top:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus::after,.plyr__menu__container .plyr__control--back:hover::after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:calc(var(--plyr-control-spacing, 10px) * 0.7)}.plyr__menu__container .plyr__control[role=menuitemradio]::before,.plyr__menu__container .plyr__control[role=menuitemradio]::after{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]::before{background:rgba(0, 0, 0, 0.1);content:"";display:block;flex-shrink:0;height:16px;margin-right:var(--plyr-control-spacing, 10px);transition:all 0.3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]::after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform 0.3s ease, opacity 0.3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before{background:var(--plyr-control-toggle-checked-background, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%))))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus::before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover::before{background:rgba(35, 40, 47, 0.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) - 2px) * -1);overflow:hidden;padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 3.5);pointer-events:none}.plyr--full-ui input[type=range]{appearance:none;background:transparent;border:0;border-radius:calc(var(--plyr-range-thumb-height, 13px) * 2);color:var(--plyr-range-fill-background, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%))));display:block;height:calc((var(--plyr-range-thumb-active-shadow-width, 3px) * 2) + var(--plyr-range-thumb-height, 13px));margin:0;min-width:0;padding:0;transition:box-shadow 0.3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;background-image:linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%))}.plyr--full-ui input[type=range]::-webkit-slider-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px);appearance:none;margin-top:calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px)) / 2 * -1)}.plyr--full-ui input[type=range]::-moz-range-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px)}.plyr--full-ui input[type=range]::-ms-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;background:currentColor}.plyr--full-ui input[type=range]::-ms-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px);margin-top:0}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%)))) dotted 3px;outline-offset:2px}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%)))) dotted 3px;outline-offset:2px}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%)))) dotted 3px;outline-offset:2px}.plyr__poster{background-color:var(--plyr-video-background, var(--plyr-video-background, rgb(0, 0, 0)));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity 0.2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:var(--plyr-font-size-time, var(--plyr-font-size-small, 13px))}.plyr__time+.plyr__time::before{content:"⁄";margin-right:var(--plyr-control-spacing, 10px)}@media (max-width: 767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-tooltip-radius, 5px);bottom:100%;box-shadow:var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:var(--plyr-tooltip-color, hsl(216, 15%, 34%));font-size:var(--plyr-font-size-small, 13px);font-weight:var(--plyr-font-weight-regular, 400);left:50%;line-height:1.3;margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);opacity:0;padding:calc(var(--plyr-control-spacing, 10px) / 2) calc(calc(var(--plyr-control-spacing, 10px) / 2) * 1.5);pointer-events:none;position:absolute;transform:translate(-50%, 10px) scale(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;white-space:nowrap;z-index:2}.plyr__tooltip::before{border-left:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-right:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-top:var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));bottom:calc(var(--plyr-tooltip-arrow-size, 4px) * -1);content:"";height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr .plyr__control:hover .plyr__tooltip,.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%, 0) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translate(0, 10px) scale(0.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip::before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip::before{left:calc((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7))}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translate(0, 10px) scale(0.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip::before{left:auto;right:calc((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7));transform:translateX(50%)}.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible{transform:translate(0, 0) scale(1)}.plyr__progress{left:calc(var(--plyr-range-thumb-height, 13px) * 0.5);margin-right:var(--plyr-range-thumb-height, 13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:calc(var(--plyr-range-thumb-height, 13px) * -0.5);margin-right:calc(var(--plyr-range-thumb-height, 13px) * -0.5);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:120px;overflow-wrap:break-word}.plyr__progress__buffer{-webkit-appearance:none;background:transparent;border:0;border-radius:100px;height:var(--plyr-range-track-height, 5px);left:0;margin-top:calc((var(--plyr-range-track-height, 5px) / 2) * -1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:transparent}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:var(--plyr-range-track-height, 5px);transition:width 0.2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:var(--plyr-range-track-height, 5px);transition:width 0.2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;transition:width 0.2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 25%, transparent 25%, transparent 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 75%, transparent 75%, transparent);background-repeat:repeat-x;background-size:var(--plyr-progress-loading-size, 25px) var(--plyr-progress-loading-size, 25px);color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6))}.plyr__progress__marker{background-color:var(--plyr-progress-marker-background, #fff);border-radius:1px;height:var(--plyr-range-track-height, 5px);position:absolute;top:50%;transform:translate(-50%, -50%);width:var(--plyr-progress-marker-width, 3px);z-index:3}.plyr__volume{align-items:center;display:flex;max-width:110px;min-width:80px;position:relative;width:20%}.plyr__volume input[type=range]{margin-left:calc(var(--plyr-control-spacing, 10px) / 2);margin-right:calc(var(--plyr-control-spacing, 10px) / 2);position:relative;z-index:2}.plyr--is-ios .plyr__volume{min-width:0;width:auto}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:var(--plyr-audio-controls-background, #fff);border-radius:inherit;color:var(--plyr-audio-control-color, hsl(216, 15%, 34%));padding:var(--plyr-control-spacing, 10px)}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:var(--plyr-audio-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%))));color:var(--plyr-audio-control-color-hover, #fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--audio .plyr__progress__buffer{color:var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6))}.plyr--video{background:var(--plyr-video-background, var(--plyr-video-background, rgb(0, 0, 0)));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:var(--plyr-video-background, var(--plyr-video-background, rgb(0, 0, 0)));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio: 16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:var(--plyr-video-control-color, #fff);left:0;padding:calc(var(--plyr-control-spacing, 10px) / 2);padding-top:calc(var(--plyr-control-spacing, 10px) * 2);position:absolute;right:0;transition:opacity 0.4s ease-in-out, transform 0.4s ease-in-out;z-index:3}@media (min-width: 480px){.plyr--video .plyr__controls{padding:var(--plyr-control-spacing, 10px);padding-top:calc(var(--plyr-control-spacing, 10px) * 3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%))));color:var(--plyr-video-control-color-hover, #fff)}.plyr__control--overlaid{background:var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, hsl(198, 100%, 50%))));border:0;border-radius:100%;color:var(--plyr-video-control-color, #fff);display:none;left:50%;opacity:0.9;padding:calc(var(--plyr-control-spacing, 10px) * 1.5);position:absolute;top:50%;transform:translate(-50%, -50%);transition:0.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:hover,.plyr__control--overlaid:focus{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--video .plyr__progress__buffer{color:var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25))}.plyr:fullscreen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.plyr:fullscreen video{height:100%}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width: 1024px){.plyr:fullscreen .plyr__captions{font-size:var(--plyr-font-size-xlarge, 21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%;bottom:0;display:block;left:0;position:fixed;right:0;top:0;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width: 1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:var(--plyr-font-size-xlarge, 21px)}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads::after{background:hsl(216, 15%, 16%);border-radius:2px;bottom:var(--plyr-control-spacing, 10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:var(--plyr-control-spacing, 10px);z-index:3}.plyr__ads:empty::after{display:none}.plyr__cues{background:currentColor;display:block;height:var(--plyr-range-track-height, 5px);left:0;opacity:0.8;position:absolute;top:50%;transform:translateY(-50%);width:3px;z-index:3}.plyr__preview-thumb{background-color:var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-tooltip-radius, 5px);bottom:100%;box-shadow:var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);opacity:0;padding:3px;pointer-events:none;position:absolute;transform:translate(0, 10px) scale(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0, 0) scale(1)}.plyr__preview-thumb::before{border-left:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-right:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-top:var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));bottom:calc(var(--plyr-tooltip-arrow-size, 4px) * -1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:hsl(216, 15%, 79%);border-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container::after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container::after{border-radius:inherit;box-shadow:inset 0 0 0 1px rgba(0, 0, 0, 0.15);content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)));border-bottom-left-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);border-bottom-right-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);bottom:0;left:0;line-height:1.1;padding:20px 6px 6px;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:var(--plyr-font-size-time, var(--plyr-font-size-small, 13px))}.plyr__preview-scrubbing{bottom:0;filter:blur(1px);height:100%;left:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transition:opacity 0.3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none !important}.plyr__sr-only{clip:rect(1px, 1px, 1px, 1px);overflow:hidden;border:0 !important;height:1px !important;padding:0 !important;position:absolute !important;width:1px !important}.plyr [hidden]{display:none !important}video,iframe{max-width:100%}:host{position:relative;display:flex}*:focus-visible{outline:2px solid var(--presto-player-focus-outline, white) !important}.plyr--html5 .plyr__video-wrapper,.plyr--youtube .plyr__video-wrapper{height:100%}.plyr__video-wrapper{z-index:1}.presto-player__wrapper{position:relative;flex:1;display:flex;flex-direction:column;justify-content:center;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";width:100%}.presto-player__wrapper.rtl{direction:rtl}.presto-player__wrapper .plyr__progress__marker{height:14px}.presto-player__wrapper img{max-width:100%}.presto-player__wrapper .plyr{border-radius:var(--presto-player-border-radius)}.presto-player__wrapper .plyr.plyr--video.plyr--menu-open{overflow:hidden}.presto-player__wrapper .plyr--fullscreen-fallback.plyr--vimeo .plyr__video-wrapper{top:50%;transform:translateY(-50%)}.presto-player__wrapper .plyr--fullscreen-fallback.plyr{border-radius:0 !important}.presto-player__wrapper .plyr--fullscreen-fallback.plyr iframe{border-radius:0 !important}.presto-player__wrapper .plyr__menu__container{overflow:auto}.presto-player__wrapper .plyr__menu__container:after{display:none}.presto-player__wrapper img{border:none}.presto-player__wrapper video{margin:auto}.presto-player__wrapper iframe{height:100%}.presto-player__wrapper .plyr--video .plyr__control:active,.presto-player__wrapper .plyr--video .plyr__control:focus{background:#00b3ff;background:var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));color:#fff;color:var(--plyr-video-control-color-hover, #fff)}.presto-player__wrapper .plyr__poster{background-size:cover;z-index:2}.presto-player__wrapper .plyr__tooltip--label br{display:none}.presto-player__wrapper .presto-player__logo{margin:0;display:block;position:absolute;z-index:3;opacity:0.5;object-fit:contain;transition:bottom 0.4s ease-in-out;max-width:var(--presto-player-logo-width, 75px)}.presto-player__wrapper .presto-player__logo.is-bottom-right{left:auto;right:20px;top:auto;bottom:60px}.presto-player__wrapper .presto-player__logo.is-bottom-left{left:20px;right:auto;top:auto;bottom:60px}@media screen and (min-width: 380px){.presto-player__wrapper.presto-player--hide-controls .presto-player__logo.is-bottom-right,.presto-player__wrapper.presto-player--hide-controls .presto-player__logo.is-bottom-left,.presto-player__wrapper .plyr--hide-controls .presto-player__logo.is-bottom-right,.presto-player__wrapper .plyr--hide-controls .presto-player__logo.is-bottom-left{bottom:20px}}.presto-player__wrapper presto-search-bar{transition:opacity 0.3s ease, transform 0.3s ease}.presto-player__wrapper.presto-player--hide-controls presto-search-bar{opacity:0;transform:translateY(-100%)}.presto-player__wrapper .presto-player-progress__marker{width:16px;height:16px;padding:0;border:2px solid rgba(255, 255, 255, 0.5);position:absolute;border-radius:9999px;bottom:calc(50% - 8px);z-index:9;margin-left:-8px !important}.presto-player__wrapper.presto-player--ended .plyr--youtube .plyr__poster{display:none}.presto-player__wrapper.presto-player--ended .plyr--youtube .plyr__control.plyr__control--overlaid{display:none}.presto-player__wrapper .presto-player__wrapper .plyr__control--overlaid{z-index:4}.presto-player__wrapper button.plyr__control.plyr__control--overlaid:focus{background:inherit;border:none;outline:0;position:absolute;top:50%;transform:translate(-50%, -50%)}.presto-player__wrapper .plyr__controls__item.plyr__progress__container{position:relative}.presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{box-shadow:none}.presto-player__wrapper .plyr--video .plyr__controls{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.75)))}.presto-player__wrapper .plyr--fullscreen-fallback.plyr--video .plyr__controls{padding-bottom:calc(var(--plyr-control-spacing, 10px) + env(safe-area-inset-bottom))}.presto-player__wrapper .presto-player-toc{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";line-height:1.4;position:absolute;top:auto;right:0;left:0;bottom:0;max-height:100%;max-width:100%;background:rgba(255, 255, 255, 0.9);background:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));left:auto;padding:20px 15px;border-radius:4px;width:100%;z-index:9;box-shadow:0 1px 2px rgba(0, 0, 0, 0.15);box-shadow:var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:#4a5464;color:var(--plyr-menu-color, #4a5464);font-size:15px;font-size:var(--plyr-font-size-base, 15px);white-space:nowrap;z-index:3;display:flex;flex-direction:column;transition:bottom 0.25s ease}@media screen and (min-width: 380px){.presto-player__wrapper .presto-player-toc{right:20px;bottom:60px;width:300px;max-height:calc(100% - 80px);max-width:calc(100vw - 70px)}}.presto-player__wrapper .presto-player-toc__wrapper{position:absolute;top:0;left:0;bottom:0;right:0;z-index:3;visibility:hidden;opacity:0;transition:opacity 0.3s ease-in-out, visibility 0.3s ease-in-out}.presto-player__wrapper .presto-player-toc__wrapper.is-showing{visibility:visible;opacity:1}.presto-player__wrapper .presto-player-toc__cover{position:absolute;top:0;left:0;bottom:0;right:0;z-index:3}.presto-player__wrapper .presto-player-toc__list{flex:1;overflow:auto}.presto-player__wrapper .presto-player-toc__title{font-size:12px;font-weight:bold;margin-bottom:10px;margin-left:10px;margin-right:10px;display:none}@media screen and (min-width: 380px){.presto-player__wrapper .presto-player-toc__title{display:block}}.presto-player__wrapper .presto-player-toc__name{white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis}.presto-player__wrapper .presto-player-toc__chapter{padding:12px;border-radius:3px;cursor:pointer;line-height:1;display:flex;align-items:center;transition:background-color 0.4s ease, color 0.4s ease;margin-bottom:2px;position:relative}.presto-player__wrapper .presto-player-toc__chapter:last-child{margin-bottom:0}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted,.presto-player__wrapper .presto-player-toc__chapter:hover{background:#00b3ff;background:var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));color:#fff;color:var(--plyr-video-control-color-hover, #fff)}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted{padding-right:30px}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted:after{background:rgba(255, 255, 255, 0.5);content:"";display:block;flex-shrink:0;height:8px;width:8px;margin-right:10px;margin-right:var(--plyr-control-spacing, 10px);transition:all 0.3s ease;border-radius:9999px;position:absolute;right:7px}.presto-player__wrapper .presto-player-toc__order{margin-right:12px;opacity:0.5}.presto-player__wrapper.rtl{direction:rtl}.presto-player__wrapper.rtl .presto-player-toc__order{order:2;margin-left:12px;margin-right:0}.presto-player__wrapper.rtl .presto-player-toc__name{direction:rtl}.presto-player__wrapper.action-bar-active .presto-audio__poster img{border-bottom-left-radius:0px}.presto-player__wrapper .presto-player-error{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(0, 0, 0, 0.9);color:#fff;display:flex;align-items:center;justify-content:center;z-index:10;text-align:center}.presto-player__wrapper .presto-player-error__title{font-size:18px;font-weight:bold;margin-bottom:8px}.presto-player__wrapper .presto-player-error__description{opacity:0.75}.presto-player__wrapper.hide-youtube-ui .plyr__video-embed iframe{top:-50%;height:200%}.presto-player__wrapper .plyr--vimeo.plyr--playing .plyr__video-embed__container{pointer-events:none}.presto-player__wrapper .plyr__control--overlaid{border-radius:6px;padding-left:26px;padding-right:26px;position:absolute !important;top:50% !important}.presto-player__wrapper.presto-player--hide-scrim .plyr__controls{background:transparent}.presto-player__wrapper presto-audio .presto-player-toc{max-height:350px}.presto-player__wrapper presto-action-bar{position:relative;z-index:1}.presto-sticky-parent{z-index:99998}.presto-sticky-audio{position:fixed;z-index:3000;width:100vw;bottom:0px;right:0px;left:0px}@media screen and (min-width: 960px){.presto-sticky{--presto-sticky-space:15px;position:fixed;z-index:3000;max-width:var(--presto-sticky-width, 380px);width:100vw}.presto-sticky .plyr__controls,.presto-sticky .presto-player-toc__wrapper,.presto-sticky presto-action-bar,.presto-sticky .presto-player__logo{display:none}.presto-sticky--top-left{top:var(--presto-sticky-space);left:var(--presto-sticky-space)}.presto-sticky--top-center{top:var(--presto-sticky-space);left:0;right:0;margin:0 auto}.presto-sticky--top-right{top:var(--presto-sticky-space);right:var(--presto-sticky-space)}.presto-sticky--center-left{top:0;bottom:0;margin:auto 0;left:var(--presto-sticky-space);display:flex;align-items:center}.presto-sticky--center-center{top:0;bottom:0;right:0;left:0;margin:auto;display:flex;align-items:center}.presto-sticky--center-right{top:0;bottom:0;margin:auto 0;right:var(--presto-sticky-space);display:flex;align-items:center}.presto-sticky--bottom-left{bottom:var(--presto-sticky-space);left:var(--presto-sticky-space)}.presto-sticky--bottom-center{bottom:var(--presto-sticky-space);left:0;right:0;margin:0 auto}.presto-sticky--bottom-right{bottom:var(--presto-sticky-space);right:var(--presto-sticky-space)}}.presto-player__overlay{position:absolute;top:50%;left:50%;z-index:3}.presto-player__muted-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:none;align-items:center;justify-content:center}.presto-player__muted-overlay .plyr__control--overlaid{display:block;opacity:1;visibility:visible}.presto-player__wrapper.is-muted-overlay{cursor:pointer}.presto-player__wrapper.is-muted-overlay.presto-player--playing .presto-player__muted-overlay{display:flex}.presto-player__wrapper.is-muted-overlay .plyr--playing .presto-player__muted-overlay .plyr__control--overlaid{opacity:1;visibility:visible}.presto-player__wrapper.is-muted-overlay .presto-player__logo{display:none}.presto-player__wrapper.is-muted-overlay .plyr__controls{display:none}.presto-player__wrapper.is-muted-overlay .plyr .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(0) !important}.presto-player__wrapper.rtl .plyr__captions{direction:rtl}.presto-player__wrapper .plyr__captions{z-index:1}.presto-player__wrapper.caption-style-full .plyr__captions{background:var(--plyr-captions-background, rgba(0, 0, 0, 0.8));padding-top:0;padding-bottom:0}.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 13px) * -4))}.presto-player__wrapper.caption-style-full.skin-stacked .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 17px) * -4))}.presto-player__play-cover{cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}.presto-player__chapters{width:100%;position:absolute;top:0;height:100%}.presto-player__chapter-markers{margin:0 8px;height:100%;position:relative}.presto-player-progress__marker.plyr__controls__item.plyr__control:hover{border:0;background:#fff}.presto-iframe-fallback-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.presto-iframe-fallback-container embed,.presto-iframe-fallback-container iframe,.presto-iframe-fallback-container object{position:absolute;top:0;left:0;width:100%;height:100%}@media (min-aspect-ratio: 16/9){.hide-youtube-ui presto-youtube .plyr:fullscreen .plyr__video-wrapper{width:177.7777777778vh}}.cta-email-active,.cta-email-active .presto-audio__wrapper{min-height:140px}.cta-active,.email-active,.cta-active .presto-audio__wrapper,.email-active .presto-audio__wrapper{min-height:140px}.action-bar-active .plyr{border-radius:var(--presto-player-border-radius) var(--presto-player-border-radius) 0px 0px}presto-search-bar{position:absolute;top:0;left:0;right:0;height:70px;background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)));z-index:1}presto-search-bar-ui{position:absolute;top:15px;right:23px}';var _e=function(){return(0,x.h)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",class:"presto-icon-pause"},(0,x.h)("path",{d:"M5 16v-12h3v12h-3zM12 4h3v12h-3v-12z"}))},Se=function(){return(0,x.h)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",class:"presto-icon-play"},(0,x.h)("path",{d:"M5 4l10 6-10 6v-12z"}))},Oe=function(){function e(t){(0,m.Z)(this,e),(0,x.r)(this,t),this.triggerPlay=(0,x.c)(this,"triggerPlay",7),this.triggerPause=(0,x.c)(this,"triggerPause",7),this.active=!1,this.playing=!1}return(0,g.Z)(e,[{key:"render",value:function(){var e=this;return(0,x.h)("div",{key:"49e846bdd8e8032f874150021aaef59755817bfb",class:{playlist__item:!0,"playlist__item-is--active":this.active,"playlist__item-is--playing":this.playing},onClick:function(){e.playing?e.triggerPause.emit():e.triggerPlay.emit()}},(0,x.h)("div",{key:"030b3f66de76f741178b03447486563ced819381",class:"playlist__title-wrap"},(0,x.h)("div",{key:"4b1a2c717681406314c607871dee8113bd247ddc",class:"playlist__play-icon"},this.playing?(0,x.h)(_e,null):(0,x.h)(Se,null)),(0,x.h)("slot",{key:"b7b5d6369aa926ec829952f25e4007496367a993",name:"item-title"})),(0,x.h)("div",{key:"d515ddcb7caae30569b4669cb8880cb3e410ebc6",class:"playlist__time"},(0,x.h)("slot",{key:"ff8aceb7144b46b5f762e8b22bb3a3c51a40571f",name:"item-duration"})))}}]),e}();Oe.style=":host{display:block;cursor:pointer}::slotted(*){font-size:14px}.playlist__item{display:flex;justify-content:space-between;align-items:center;padding:6px;transition:background-color 0.25s ease;color:var(--presto-playlist-text-color, var(--plyr-audio-control-color, #4a5464));user-select:none;border-radius:8px}.playlist__item:hover{background-color:rgba(0, 0, 0, 0.05)}.playlist__item.playlist__item-is--active{background-color:var(--presto-playlist-highlight-color, var(--plyr-color-main, #2e4cd9));padding:6px;color:var(--playlist-highlight-text-color, #fff);border-radius:8px}.playlist__item.playlist__item-is--active .playlist__title-wrap>div{background-color:var(--playlist-highlight-text-color, #fff)}.playlist__item.playlist__item-is--active svg{fill:var(--presto-playlist-highlight-color, var(--plyr-color-main, #2e4cd9))}.playlist__item svg{fill:currentColor}.playlist__item .presto-icon-play path{transform:translateX(1px)}.playlist__title-wrap{display:flex;justify-content:center;align-items:center;gap:14px}.playlist__play-icon{display:flex;padding:2px;border-radius:50%;background:rgba(180, 184, 199, 0.25)}.playlist__time{opacity:0.8;font-size:12px;padding:0 4px}";var Ce=function(){function e(t){(0,m.Z)(this,e),(0,x.r)(this,t),this.rewatch=(0,x.c)(this,"rewatch",7),this.next=(0,x.c)(this,"next",7),this.nextItemTitle=void 0,this.nextItemString=void 0,this.transitionDuration=5,this.isLastItem=!1,this.animating=!1,this.show=!1}return(0,g.Z)(e,[{key:"handleShow",value:function(){var e=this;this.show&&!this.isLastItem?(setTimeout((function(){e.animating=!0}),200),this.timeout=setTimeout((function(){e.show&&e.handleNext()}),1e3*(this.transitionDuration||5)+200)):this.animating=!1}},{key:"handleRewatch",value:function(){this.rewatch.emit()}},{key:"handleNext",value:function(){this.next.emit()}},{key:"disconnectedCallback",value:function(){clearTimeout(this.timeout)}},{key:"handleAnimatingChange",value:function(e){e||clearTimeout(this.timeout)}},{key:"render",value:function(){var e,t,i,n,r,o,s=this;if(!this.show)return(0,x.h)(x.H,null,(0,x.h)("div",{style:{display:"none"}}));var a=(null===(t=null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.i18n)||void 0===t?void 0:t.upNext)||"Up Nexts",l=(null===(n=null===(i=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===i?void 0:i.i18n)||void 0===n?void 0:n.startOver)||"Start Over",c=(null===(o=null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.i18n)||void 0===o?void 0:o.rewatch)||"Rewatch";return(0,x.h)("div",{class:"playlist__overlay",onClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),s.animating=!1}},(0,x.h)("div",{class:"playlist__overlay-wrap"},this.isLastItem?(0,x.h)("p",null,l,":"):(0,x.h)("p",null,a,":"),(0,x.h)("h2",null,this.nextItemTitle),(0,x.h)("div",{class:"playlist__overlay-buttons"},(0,x.h)("button",{class:"previous",onClick:function(){return s.handleRewatch()}},(0,x.h)("svg",{width:"15",height:"9",viewBox:"0 0 15 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,x.h)("path",{d:"M15 0V9L8 4.5L15 0Z",fill:"white"}),(0,x.h)("path",{d:"M7 0V9L0 4.5L7 0Z",fill:"white"})),c),(0,x.h)("button",{class:{next:!0,"fill-button":this.animating},onClick:function(e){e.preventDefault(),e.stopImmediatePropagation(),s.handleNext()}},(0,x.h)("svg",{width:"10",height:"12",viewBox:"0 0 10 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,x.h)("path",{d:"M0 0V12L9.5 6L0 0Z",fill:"black"})),this.isLastItem?l:"Next "+((null==this?void 0:this.nextItemString)||"Video")))))}}],[{key:"watchers",get:function(){return{show:["handleShow"],animating:["handleAnimatingChange"]}}}]),e}();Ce.style=":host{display:block;cursor:pointer}.playlist__overlay{color:#fff;position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);z-index:999}.playlist__overlay h2,.playlist__overlay p{margin:0;padding:0;line-height:1}.playlist__overlay h2{margin-bottom:0.4em}.playlist__overlay .playlist__overlay-wrap{top:0;position:absolute;padding:25px;left:0;display:grid;gap:1em}.playlist__overlay .playlist__overlay-buttons{display:flex;gap:13px}.playlist__overlay .playlist__overlay-buttons button{background:rgba(255, 255, 255, 0.8);border-radius:5px;padding:10px 12px;border:1px solid #ffffff;font-weight:500;font-size:13px;line-height:15px;display:flex;justify-content:space-between;align-items:center;gap:16px;cursor:pointer}.playlist__overlay .playlist__overlay-buttons button.previous{background-color:transparent;border:1px solid #ffffff;margin-right:10px;color:#ffffff}.playlist__overlay .playlist__overlay-buttons button.next{background:linear-gradient(to right, rgb(255, 255, 255) 50%, rgba(255, 255, 255, 0.8) 50%);background-size:200% 100%;background-position:right bottom}.playlist__overlay .playlist__overlay-buttons button.next.fill-button{transition:all var(--playlist-transition-duration, 5s) ease-out;background-position:left bottom}.playlist__overlay .playlist__overlay-buttons button.next.disabled{background-color:transparent;border:1px solid #ffffff;color:#ffffff;background:none}";var Te=function(){function e(t){(0,m.Z)(this,e),(0,x.r)(this,t)}return(0,g.Z)(e,[{key:"render",value:function(){return(0,x.h)("div",{key:"e491b728a12bbe88b47ab93e76eaea8237dd3cea",class:"playlist__base",part:"base"},(0,x.h)("div",{key:"672c71c6e0b425ea093c4395cb86f106cc4f2785",class:"playlist"},(0,x.h)("div",{key:"f785f31695ada6ffa3cc62413d8f739605ceb9e7",class:"playlist__preview"},(0,x.h)("slot",{key:"636b6374490405d59b2c6d1f226942e1d75056dc",name:"preview"})),(0,x.h)("div",{key:"f3b0fac78923018568c53b7d8dd753a012f86332",class:"playlist__info"},(0,x.h)("div",{key:"d343092dda7a695530dee464a9f72fcd0f4a2738",class:"playlist__heading"},(0,x.h)("div",{key:"70cd1f9a9d8f0b4ad972e9886dbced212492b52f",class:"playlist__heading-title"},(0,x.h)("slot",{key:"949df1a54f703e886e8204407b3b651088bfcc01",name:"title"})),(0,x.h)("div",{key:"c1969328b820129132fdb0045864440c568d24fe",class:"playlist__heading-count"},(0,x.h)("slot",{key:"47a163b788d1619ad130bd6ef62855681699d914",name:"count"}))),(0,x.h)("div",{key:"e368d3e86d468053bdb754f326c6b2386f12e568",class:"playlist__info--inner"},(0,x.h)("div",{key:"42976f9e474ec11c7dce1664449f380791a4995a",class:"playlist__list"},(0,x.h)("slot",{key:"f3265b3ed5c8e08ed1e796cbce1b17fb165ce545",name:"list"}))))))}}]),e}();Te.style=":host {\n display: block;\n background: transparent !important;\n}\n\n.playlist__base {\n container-type: inline-size;\n}\n\n::slotted([provider=audio]) {\n flex: 1;\n box-sizing: border-box;\n flex: 0 0 100%;\n min-height: 300px;\n}\n\n.playlist {\n display: flex;\n justify-content: stretch;\n align-items: stretch;\n border-radius: var(--presto-playlist-border-radius, 8px);\n overflow: hidden;\n border-width: var(--presto-playlist-border-width, 1px);\n border-style: solid;\n border-color: var(--presto-playlist-border-color, #ddd);\n background: var(--presto-playlist-background-color, #fff);\n position: relative;\n}\n.playlist__base {\n user-select: none;\n}\n.playlist__preview {\n position: relative;\n flex: 1;\n}\n.playlist__info {\n border-radius: 8px;\n overflow-y: scroll;\n min-width: 300px;\n max-width: 350px;\n width: 30%;\n display: flex;\n flex-direction: column;\n overflow: auto;\n}\n.playlist__info--inner {\n flex: 1 1 1px;\n overflow: auto;\n margin: 30px;\n margin-top: 0;\n margin-right: 15px;\n padding-right: 15px;\n height: fit-content;\n min-height: 175px;\n /* Track */\n /* Handle */\n /* Handle on hover */\n}\n.playlist__info--inner .playlist__list {\n gap: var(--presto-playlist-gap, 10px);\n display: flex;\n flex-direction: column;\n}\n.playlist__info--inner::-webkit-scrollbar {\n width: 6px;\n}\n.playlist__info--inner::-webkit-scrollbar-track {\n background: #ddd;\n border-radius: 5px;\n}\n.playlist__info--inner::-webkit-scrollbar-thumb {\n background: #888;\n border-radius: 5px;\n}\n.playlist__info--inner::-webkit-scrollbar-thumb:hover {\n background: #aaa;\n border-radius: 5px;\n}\n.playlist__heading {\n display: flex;\n justify-content: space-between;\n padding: 25px 30px 16px;\n}\n.playlist__heading-title {\n font-size: 16px;\n font-weight: 500;\n color: var(--presto-playlist-text-color);\n}\n.playlist__heading-count {\n color: var(--presto-playlist-text-color, var(--plyr-audio-control-color, #b1b1b1));\n font-size: 12px;\n}\n\n/** Container query! */\n@container (max-width: 782px) {\n .playlist {\n flex-direction: column;\n }\n .playlist__info {\n max-width: none;\n min-height: none;\n width: 100%;\n }\n .playlist__info--inner {\n flex: 1;\n height: fit-content;\n max-height: 200px;\n min-height: min-content;\n }\n .playlist__preview {\n min-height: 200px;\n }\n ::slotted([provider=audio]) {\n padding: 30px;\n min-height: 200px;\n padding-bottom: 0;\n flex: 1;\n }\n}\n/** Older browsers fallback */\n@media (max-width: 782px) {\n .playlist {\n flex-direction: column;\n }\n .playlist__info {\n max-width: none;\n min-height: none;\n width: 100%;\n }\n .playlist__info--inner {\n flex: 1;\n height: fit-content;\n max-height: 200px;\n min-height: min-content;\n }\n}"},2361:function(e,t,i){i.r(t),i.d(t,{presto_player:function(){return n.a},presto_playlist_item:function(){return n.b},presto_playlist_overlay:function(){return n.c},presto_playlist_ui:function(){return n.d}});var n=i(2566);i(1368),i(2136)},1928:function(e,t,i){i.r(t),i.d(t,{presto_playlist:function(){return s}});var n=i(5671),r=i(3144),o=i(1368),s=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.items=void 0,this.heading=void 0,this.listTextSingular=void 0,this.listTextPlural=void 0,this.transitionDuration=5,this.currentPlaylistItem=void 0,this.currentPlyr=void 0,this.playing=!1}return(0,r.Z)(e,[{key:"rewatch",value:function(){this.handlePlay()}},{key:"next",value:function(){this.handleNext()}},{key:"handleCurrentPlay",value:function(e,t){var i;e&&(this.addOverlay(),this.currentPlyr.elements.container.getRootNode().host.style=this.currentPlaylistItem.config.styles,void 0!==t&&("youtube"===this.currentPlyr.provider&&!this.currentPlyr.muted&&(null===(i=this.currentPlyr)||void 0===i?void 0:i.embed)&&this.currentPlyr.embed.unMute(),this.currentPlyr.play()))}},{key:"addOverlay",value:function(){var e,t;this.overlay=document.createElement("presto-playlist-overlay"),this.overlay.nextItemTitle=this.getNextItemTitle(),this.overlay.isLastItem=this.isLastItem(),this.overlay.nextItemString=(null==this?void 0:this.listTextSingular)||"Video",this.overlay.transitionDuration=this.transitionDuration,null===(t=null===(e=this.currentPlyr.elements)||void 0===e?void 0:e.container)||void 0===t||t.closest(".presto-player__wrapper").append(this.overlay)}},{key:"componentWillLoad",value:function(){var e;this.currentPlaylistItem=(null===(e=null==this?void 0:this.items)||void 0===e?void 0:e[0])||null}},{key:"handleItemClick",value:function(e){this.overlay&&(this.overlay.show=!1),this.el.style.height=this.el.offsetHeight+"px",this.el.style.width=this.el.offsetWidth+"px",this.currentPlaylistItem=e}},{key:"handleNext",value:function(){this.overlay.show=!1,this.currentPlaylistItem=this.getNextItem()||this.currentPlaylistItem}},{key:"handlePlay",value:function(){this.overlay&&(this.overlay.show=!1),this.currentPlyr.play()}},{key:"handlePause",value:function(){this.overlay.show=!1,this.currentPlyr.pause()}},{key:"getNextItem",value:function(){var e,t,i,n,r;if(this.isLastItem())return this.items[0];for(var o=0;o<(null===(e=this.items)||void 0===e?void 0:e.length);o++)if((null===(t=this.items[o])||void 0===t?void 0:t.id)===(null===(i=this.currentPlaylistItem)||void 0===i?void 0:i.id)&&(null===(n=this.items)||void 0===n?void 0:n.length)!==o+1){r=this.items[o+1];break}return r}},{key:"isLastItem",value:function(){var e,t,i,n=(null===(e=this.items)||void 0===e?void 0:e.length)-1;return(null===(t=this.items[n])||void 0===t?void 0:t.id)===(null===(i=this.currentPlaylistItem)||void 0===i?void 0:i.id)}},{key:"getNextItemTitle",value:function(){var e,t=this.getNextItem();return void 0!==t?(null==t?void 0:t.title)||(null===(e=null==t?void 0:t.config)||void 0===e?void 0:e.title):""}},{key:"render",value:function(){var e,t,i,n,r,s,a,l,c,h=this;if(!(null===(e=this.items)||void 0===e?void 0:e.length))return"";var u=this.listTextSingular?this.listTextSingular:"Video",d=this.listTextPlural?this.listTextPlural:"Videos";return(0,o.h)("presto-playlist-ui",null,(null===(t=this.currentPlaylistItem.config)||void 0===t?void 0:t.src)?(0,o.h)("presto-player",Object.assign({slot:"preview",src:null===(i=this.currentPlaylistItem.config)||void 0===i?void 0:i.src},this.currentPlaylistItem.config,{video_id:null===(n=this.currentPlaylistItem.config)||void 0===n?void 0:n.id,id:"presto-player-".concat(null===(r=this.currentPlaylistItem.config)||void 0===r?void 0:r.id),"media-title":null===(s=this.currentPlaylistItem.config)||void 0===s?void 0:s.title,class:null===(a=this.currentPlaylistItem.config)||void 0===a?void 0:a.playerClass,key:null===(l=this.currentPlaylistItem.config)||void 0===l?void 0:l.id,provider:null===(c=this.currentPlaylistItem.config)||void 0===c?void 0:c.provider,onPlayerReady:function(e){h.currentPlyr=e.detail,h.el.style.height=null,h.el.style.width=null},onPlayedMedia:function(){return h.playing=!0},onPausedMedia:function(){return h.playing=!1},onEndedMedia:function(){return h.overlay.show=!0}})):(0,o.h)("slot",{name:"unauthorized",slot:"preview"}),(0,o.h)("div",{slot:"title"},this.heading||"Playlist"),(0,o.h)("div",{slot:"count"},this.items.length," ",this.items.length>1?d:u),this.items.map((function(e){var t,i,n,r;return(0,o.h)("presto-playlist-item",{slot:"list",onClick:function(){return h.handleItemClick(e)},active:(null===(t=h.currentPlaylistItem)||void 0===t?void 0:t.id)===(null==e?void 0:e.id),playing:(null===(i=h.currentPlaylistItem)||void 0===i?void 0:i.id)===(null==e?void 0:e.id)&&h.playing,class:(null===(n=h.currentPlaylistItem)||void 0===n?void 0:n.id)===(null==e?void 0:e.id)?"active":"",key:null==e?void 0:e.id,onTriggerPause:function(){return h.handlePause()},onTriggerPlay:function(){return h.handlePlay()}},(0,o.h)("span",{slot:"item-title"},(0,o.h)("span",null,(null==e?void 0:e.title)||(null===(r=null==e?void 0:e.config)||void 0===r?void 0:r.title))),(0,o.h)("span",{slot:"item-duration"},(0,o.h)("span",null,null==e?void 0:e.duration)))})))}},{key:"el",get:function(){return(0,o.g)(this)}}],[{key:"watchers",get:function(){return{currentPlyr:["handleCurrentPlay"]}}}]),e}();s.style=":host{display:block;overflow:hidden}presto-player{opacity:0;visibility:hidden;transition:0.35s opacity, 0.35s visibility}presto-player.ready{opacity:1;visibility:visible}"},9458:function(e,t,i){i.r(t),i.d(t,{presto_search_bar_ui:function(){return h}});var n=i(5671),r=i(3144),o=i(1368),s=function(){return(0,o.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},(0,o.h)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,o.h)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))},a=function(){return(0,o.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},(0,o.h)("polyline",{points:"9 18 15 12 9 6"}))},l=function(){return(0,o.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},(0,o.h)("polyline",{points:"15 18 9 12 15 6"}))},c=function(){return(0,o.h)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"search-bar-icon"},(0,o.h)("circle",{cx:"11",cy:"11",r:"8"}),(0,o.h)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))},h=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.previousNav=(0,o.c)(this,"previousNav",7),this.nextNav=(0,o.c)(this,"nextNav",7),this.search=(0,o.c)(this,"search",7),this.focusChange=(0,o.c)(this,"focusChange",7),this.value=void 0,this.placeholder=void 0,this.hasNavigation=void 0,this.focused=void 0,this.placeholderWidth=void 0}return(0,r.Z)(e,[{key:"handleSearch",value:function(e){e.preventDefault(),this.value=e.target.value}},{key:"handleFocus",value:function(){this.focused=!0}},{key:"handleBlur",value:function(){this.value||(this.focused=!1)}},{key:"componentDidLoad",value:function(){this.handlePlaceholderSize()}},{key:"handlePlaceholderSize",value:function(){var e=this;setTimeout((function(){e.placeholderWidth=e.placeholderElement.offsetWidth}),50)}},{key:"handleValueChange",value:function(){this.search.emit(this.value)}},{key:"watchPropHandler",value:function(e){this.focusChange.emit(e)}},{key:"handleClick",value:function(){var e=this;this.focused=!0,setTimeout((function(){e.input.focus()}),50)}},{key:"handleClear",value:function(e){return e.preventDefault(),e.stopImmediatePropagation(),this.value="",this.focused=!1,!1}},{key:"handleNext",value:function(e){e.stopImmediatePropagation(),e.preventDefault(),this.nextNav.emit()}},{key:"handlePrevious",value:function(e){e.stopImmediatePropagation(),e.preventDefault(),this.previousNav.emit()}},{key:"render",value:function(){var e=this;return(0,o.h)("div",{key:"d7b960d71649846a8f0e27257ee80e0b6800d94e",class:{"search-bar":!0,"search-bar--is-active":this.focused||!!this.value,"search-bar--has-navigation":this.hasNavigation},onClick:function(){return e.handleClick()}},(0,o.h)("span",{key:"b1944c3644e89bc074bdafaa560cfac3dd4a8281",class:"search-bar__search-icon search-bar__icon"},(0,o.h)(c,{key:"8028bc5c605cfd0eae9cbfe811ffcada85768ab6"})),(0,o.h)("div",{key:"e7524109687bfa22fd10cdecd6a71ed8432d7671",class:"search-bar__placeholder",ref:function(t){return e.placeholderElement=t},"aria-hidden":!0},this.placeholder),(0,o.h)("input",{key:"1b0da4f3908d2129c7b28214b0fcc5422c4db607",type:"text",value:this.value,placeholder:this.placeholder,ref:function(t){return e.input=t},style:{width:(this.placeholderWidth||0)+"px"},onInput:function(t){return e.handleSearch(t)},onFocus:function(){return e.handleFocus()},onBlur:function(){return e.handleBlur()}}),(0,o.h)("span",{key:"89db2bd52d7672558f3f8b30c0e6c52d834eb4d9",class:"search-bar__controls"},(0,o.h)("span",{key:"c4187fee0a2268d95dfbaa27507cb76236b28c97",class:"search-bar__control-prev",onClick:function(t){return e.handlePrevious(t)}},(0,o.h)(l,{key:"5ba6a4a8a221e43842ced26e9c2f0b61075a1aac"})),(0,o.h)("span",{key:"76aa40f03ee80a7a486b88d7e3a55ecb3cbb62cb",class:"search-bar__control-next",onClick:function(t){return e.handleNext(t)}},(0,o.h)(a,{key:"b8bc259fdcc0e3c06c0b0dafad7512d2897c9b22"})),(0,o.h)("div",{key:"e64666fb5be8412a8dead167c5b0c28fa02c8b1f",class:"search-bar__control-clear",onClick:function(t){return e.handleClear(t)}},(0,o.h)(s,{key:"e871f7e8b626e28500368cf46faf05ee4a4aed93"}))))}}],[{key:"watchers",get:function(){return{placeholder:["handlePlaceholderSize"],value:["handleValueChange"],focused:["watchPropHandler"]}}}]),e}();h.style=':host{display:block}.search-bar{position:relative;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif);font-size:16px;color:#ddd;z-index:1;display:flex;align-items:center;gap:10px}.search-bar>*{height:41px}.search-bar__controls{display:flex;align-items:stretch;position:absolute;right:0}.search-bar__controls svg{display:block;width:25px;height:25px}.search-bar__placeholder{height:0;font-weight:bold;visibility:hidden;position:absolute;transition:none;white-space:nowrap}.search-bar input{z-index:1;box-sizing:border-box;background:transparent;border:none;color:#fff;font-size:16px;transition:width 0.25s ease;outline:none;padding:0}.search-bar input::placeholder{color:#fff}.search-bar__control-prev,.search-bar__control-next,.search-bar__control-clear{opacity:0;visibility:hidden;transition:0.3s cubic-bezier(0.165, 0.84, 0.44, 1);transform-origin:center center;padding:0;border:0;background:0;cursor:pointer;display:flex;flex-direction:column;justify-content:center;z-index:1}.search-bar__control-clear{transform:scale(0.5)}.search-bar--is-active input{width:300px !important;padding-right:26px}.search-bar--is-active.search-bar--has-navigation .search-bar__control-prev,.search-bar--is-active.search-bar--has-navigation .search-bar__control-next{opacity:1;visibility:visible}.search-bar--is-active.search-bar--has-navigation input{padding-right:80px}.search-bar--is-active .search-bar__control-clear{transform:scale(1);opacity:1;visibility:visible;cursor:pointer}.search-bar__icon{width:20px;height:20px;flex-grow:0;flex-shrink:0;cursor:pointer}.search-bar__icon svg{width:20px;height:20px}'},4317:function(e,t,i){i.r(t),i.d(t,{presto_timestamp:function(){return s}});var n=i(5671),r=i(3144),o=i(1368),s=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.time=void 0}return(0,r.Z)(e,[{key:"handleClick",value:function(e){e.preventDefault();var t=document.body.querySelector("presto-player");t&&t.goToAndPlay(this.timeToSeconds(this.time))}},{key:"timeToSeconds",value:function(e){var t,i=e.split(":");return i.length>1&&(t=60*parseInt(i[0])),parseInt(i[1])+parseInt(t)}},{key:"render",value:function(){var e=this;return(0,o.h)("a",{key:"643d2582416f86c927486f331bbb21fa631fc59b",href:"#",class:"presto-timestamp",onClick:function(t){return e.handleClick(t)}},(0,o.h)("slot",{key:"6367df80d3a83fdc2acf7d1b7af9eca0525495f5"},this.time))}}]),e}();s.style=":host{display:inline}"},5704:function(e,t,i){i.r(t),i.d(t,{presto_video_curtain_ui:function(){return s}});var n=i(5671),r=i(3144),o=i(1368),s=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.actionUrl=void 0}return(0,r.Z)(e,[{key:"render",value:function(){return(0,o.h)("div",{key:"214b7d2ff86907b338e86701b16faad9796309c8",class:"curtain",part:"base"},(0,o.h)("div",{key:"dc88fa462b01a7290e428562f6a6ee960d0b4c09",class:"content",part:"curtain-content"},(0,o.h)("slot",{key:"aa77802be0eac039a9f5cc6c3ebf6200c0896937"})))}}]),e}();s.style=':host{font-size:16px}.curtain{position:relative;font-family:var(--presto-curtain-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");background-color:var(--presto-curtain-background-color, #000);text-align:var(--presto-curtain-text-align, center);color:var(--presto-curtain-text-color, #fff);padding-bottom:var(--presto-curtain-size, 56.25%);font-size:var(--presto-curtain-font-size, 1.5em)}::slotted(:not(:first-child)){margin-top:14px}.content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:48px}'},4178:function(e,t,i){i.r(t),i.d(t,{presto_video:function(){return s}});var n=i(5671),r=i(3144),o=i(1368),s=function(){function e(t){(0,n.Z)(this,e),(0,o.r)(this,t),this.getRef=void 0,this.autoplay=void 0,this.src=void 0,this.preload=void 0,this.poster=void 0,this.player=void 0,this.tracks=void 0,this.playsinline=void 0,this.provider=void 0,this.videoAttributes=void 0}return(0,r.Z)(e,[{key:"render",value:function(){return(0,o.h)("video",Object.assign({key:"f8942eef52dd555ddaaad75cdff70dea9e18488a",class:{"presto-player__player":!0,"plyr__video-embed":["youtube","vimeo"].includes(this.provider)},part:"video",ref:this.getRef,autoplay:this.autoplay,preload:this.preload,"data-poster":this.poster,playsinline:this.playsinline},this.videoAttributes),(0,o.h)("source",{key:"ab9be0a15b7d9a4df81e19b6518eb60d074ff580",src:this.src}),!!this.tracks&&!!this.tracks.length&&this.tracks.map((function(e){return(0,o.h)("track",{kind:"captions",label:(null==e?void 0:e.label)?e.label:"Captions",src:null==e?void 0:e.src,srclang:(null==e?void 0:e.srcLang)?null==e?void 0:e.srcLang:"en"})})))}}]),e}();s.style=":host{display:block}"},4723:function(e,t,i){i.r(t),i.d(t,{ResizeObserver:function(){return F},ResizeObserverEntry:function(){return _},ResizeObserverSize:function(){return l}});var n,r=[],o="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(n||(n={}));var s,a=function(e){return Object.freeze(e)},l=function(e,t){this.inlineSize=e,this.blockSize=t,a(this)},c=function(){function e(e,t,i,n){return this.x=e,this.y=t,this.width=i,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,a(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),h=function(e){return e instanceof SVGElement&&"getBBox"in e},u=function(e){if(h(e)){var t=e.getBBox(),i=t.width,n=t.height;return!i&&!n}var r=e,o=r.offsetWidth,s=r.offsetHeight;return!(o||s||e.getClientRects().length)},d=function(e){var t;if(e instanceof Element)return!0;var i=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(i&&e instanceof i.Element)},p="undefined"!=typeof window?window:{},f=new WeakMap,m=/auto|scroll/,g=/^tb|vertical/,v=/msie|trident/i.test(p.navigator&&p.navigator.userAgent),y=function(e){return parseFloat(e||"0")},b=function(e,t,i){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===i&&(i=!1),new l((i?t:e)||0,(i?e:t)||0)},w=a({devicePixelContentBoxSize:b(),borderBoxSize:b(),contentBoxSize:b(),contentRect:new c(0,0,0,0)}),k=function(e,t){if(void 0===t&&(t=!1),f.has(e)&&!t)return f.get(e);if(u(e))return f.set(e,w),w;var i=getComputedStyle(e),n=h(e)&&e.ownerSVGElement&&e.getBBox(),r=!v&&"border-box"===i.boxSizing,o=g.test(i.writingMode||""),s=!n&&m.test(i.overflowY||""),l=!n&&m.test(i.overflowX||""),d=n?0:y(i.paddingTop),p=n?0:y(i.paddingRight),k=n?0:y(i.paddingBottom),x=n?0:y(i.paddingLeft),_=n?0:y(i.borderTopWidth),S=n?0:y(i.borderRightWidth),O=n?0:y(i.borderBottomWidth),C=x+p,T=d+k,A=(n?0:y(i.borderLeftWidth))+S,P=_+O,M=l?e.offsetHeight-P-e.clientHeight:0,E=s?e.offsetWidth-A-e.clientWidth:0,D=r?C+A:0,L=r?T+P:0,R=n?n.width:y(i.width)-D-E,I=n?n.height:y(i.height)-L-M,N=R+C+E+A,z=I+T+M+P,B=a({devicePixelContentBoxSize:b(Math.round(R*devicePixelRatio),Math.round(I*devicePixelRatio),o),borderBoxSize:b(N,z,o),contentBoxSize:b(R,I,o),contentRect:new c(x,d,R,I)});return f.set(e,B),B},x=function(e,t,i){var r=k(e,i),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case n.DEVICE_PIXEL_CONTENT_BOX:return a;case n.BORDER_BOX:return o;default:return s}},_=function(e){var t=k(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=a([t.borderBoxSize]),this.contentBoxSize=a([t.contentBoxSize]),this.devicePixelContentBoxSize=a([t.devicePixelContentBoxSize])},S=function(e){if(u(e))return 1/0;for(var t=0,i=e.parentNode;i;)t+=1,i=i.parentNode;return t},O=function(){var e=1/0,t=[];r.forEach((function(i){if(0!==i.activeTargets.length){var n=[];i.activeTargets.forEach((function(t){var i=new _(t.target),r=S(t.target);n.push(i),t.lastReportedSize=x(t.target,t.observedBox),r<e&&(e=r)})),t.push((function(){i.callback.call(i.observer,n,i.observer)})),i.activeTargets.splice(0,i.activeTargets.length)}}));for(var i=0,n=t;i<n.length;i++)(0,n[i])();return e},C=function(e){r.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(i){i.isActive()&&(S(i.target)>e?t.activeTargets.push(i):t.skippedTargets.push(i))}))}))},T=[],A=0,P={attributes:!0,characterData:!0,childList:!0,subtree:!0},M=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],E=function(e){return void 0===e&&(e=0),Date.now()+e},D=!1,L=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!D){D=!0;var i,n=E(e);i=function(){var i=!1;try{i=function(){var e,t=0;for(C(t);r.some((function(e){return e.activeTargets.length>0}));)t=O(),C(t);return r.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:o}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=o),window.dispatchEvent(e)),t>0}()}finally{if(D=!1,e=n-E(),!A)return;i?t.run(1e3):e>0?t.run(e):t.start()}},function(e){if(!s){var t=0,i=document.createTextNode("");new MutationObserver((function(){return T.splice(0).forEach((function(e){return e()}))})).observe(i,{characterData:!0}),s=function(){i.textContent="".concat(t?t--:t++)}}T.push(e),s()}((function(){requestAnimationFrame(i)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,P)};document.body?t():p.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),M.forEach((function(t){return p.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),M.forEach((function(t){return p.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),R=function(e){!A&&e>0&&L.start(),!(A+=e)&&L.stop()},I=function(){function e(e,t){this.target=e,this.observedBox=t||n.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=x(this.target,this.observedBox,!0);return e=this.target,h(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),N=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},z=new WeakMap,B=function(e,t){for(var i=0;i<e.length;i+=1)if(e[i].target===t)return i;return-1},j=function(){function e(){}return e.connect=function(e,t){var i=new N(e,t);z.set(e,i)},e.observe=function(e,t,i){var n=z.get(e),o=0===n.observationTargets.length;B(n.observationTargets,t)<0&&(o&&r.push(n),n.observationTargets.push(new I(t,i&&i.box)),R(1),L.schedule())},e.unobserve=function(e,t){var i=z.get(e),n=B(i.observationTargets,t),o=1===i.observationTargets.length;n>=0&&(o&&r.splice(r.indexOf(i),1),i.observationTargets.splice(n,1),R(-1))},e.disconnect=function(e){var t=this,i=z.get(e);i.observationTargets.slice().forEach((function(i){return t.unobserve(e,i.target)})),i.activeTargets.splice(0,i.activeTargets.length)},e}(),F=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");j.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!d(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");j.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!d(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");j.unobserve(this,e)},e.prototype.disconnect=function(){j.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}()},6578:function(e,t,i){function n(e){var t=function(e,t){var n,r=i().post_id,o={action:"sync_video_playback",currentTime:e.currentTime,duration:e.duration,post_id:r};o[_tutorobject.nonce_key]=_tutorobject[_tutorobject.nonce_key];var s=o;t&&(s=Object.assign(o,t)),jQuery.post(null===(n=_tutorobject)||void 0===n?void 0:n.ajaxurl,s)},i=function(){var e=jQuery("#tutor_video_tracking_information").val();return e?JSON.parse(e):{}},n=0;e.on("timeupdate",(function(e){var i=e.detail.plyr;n/4>=30&&(t(i),n=0),n++})),e.on("ended",(function(e){var n=i(),r=e.detail.plyr;t(r,{is_ended:!0}),n.autoload_next_course_content&&function(){var e,t;if(_tutorobject.nonce_key&&null!==(e=_tutorobject)&&void 0!==e&&e.ajaxurl){var n={action:"autoload_next_course_content",post_id:i().post_id};n[_tutorobject.nonce_key]=_tutorobject[_tutorobject.nonce_key],jQuery.post(null===(t=_tutorobject)||void 0===t?void 0:t.ajaxurl,n).done((function(e){var t;null!=e&&e.success&&null!=e&&null!==(t=e.data)&&void 0!==t&&t.next_url&&(location.href=e.data.next_url)}))}}()}))}i.r(t),i.d(t,{default:function(){return n}})},3878:function(e,t,i){function n(e){if(Array.isArray(e))return e}i.d(t,{Z:function(){return n}})},7326:function(e,t,i){function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i.d(t,{Z:function(){return n}})},5861:function(e,t,i){function n(e,t,i,n,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function r(e){return function(){var t=this,i=arguments;return new Promise((function(r,o){var s=e.apply(t,i);function a(e){n(s,r,o,a,l,"next",e)}function l(e){n(s,r,o,a,l,"throw",e)}a(void 0)}))}}i.d(t,{Z:function(){return r}})},5671:function(e,t,i){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i.d(t,{Z:function(){return n}})},3144:function(e,t,i){i.d(t,{Z:function(){return o}});var n=i(7343);function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,n.Z)(r.key),r)}}function o(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}},4942:function(e,t,i){i.d(t,{Z:function(){return r}});var n=i(7343);function r(e,t,i){return(t=(0,n.Z)(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}},1120:function(e,t,i){function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}i.d(t,{Z:function(){return n}})},136:function(e,t,i){i.d(t,{Z:function(){return r}});var n=i(9611);function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,n.Z)(e,t)}},1902:function(e,t,i){function n(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,_x,o,s=[],_n=!0,a=!1;try{if(_x=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;_n=!1}else for(;!(_n=(n=_x.call(i)).done)&&(s.push(n.value),s.length!==t);_n=!0);}catch(e){a=!0,r=e}finally{try{if(!_n&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(a)throw r}}return s}}i.d(t,{Z:function(){return n}})},5267:function(e,t,i){function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}i.d(t,{Z:function(){return n}})},4925:function(e,t,i){function n(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}i.d(t,{Z:function(){return n}})},2963:function(e,t,i){i.d(t,{Z:function(){return o}});var n=i(1002),r=i(7326);function o(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,r.Z)(e)}},9611:function(e,t,i){function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}i.d(t,{Z:function(){return n}})},3324:function(e,t,i){i.d(t,{Z:function(){return a}});var n=i(3878),r=i(1902),o=i(181),s=i(5267);function a(e,t){return(0,n.Z)(e)||(0,r.Z)(e,t)||(0,o.Z)(e,t)||(0,s.Z)()}},5512:function(e,t,i){i.d(t,{Z:function(){return r}});var n=i(1002);function r(e,t){if("object"!==(0,n.Z)(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==(0,n.Z)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},7343:function(e,t,i){i.d(t,{Z:function(){return o}});var n=i(1002),r=i(5512);function o(e){var t=(0,r.Z)(e,"string");return"symbol"===(0,n.Z)(t)?t:String(t)}},4790:function(e,t,i){i.d(t,{B1:function(){return he},GA:function(){return te},vQ:function(){return X},ys:function(){return ce}});var n=i(8120),r=i(6485),o=i(9119);class s{constructor(e,t,i,n){this.state=e,this.pos=t,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=(0,o.qz)(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),r=n.search(h(e,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t,i){"abort"==e&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function a(e){let t=Object.keys(e).join(""),i=/\w/.test(t);return i&&(t=t.replace(/\w/g,"")),`[${i?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}class l{constructor(e,t,i,n){this.completion=e,this.source=t,this.match=i,this.score=n}}function c(e){return e.selection.main.from}function h(e,t){var i;let{source:n}=e,r=t&&"^"!=n[0],o="$"!=n[n.length-1];return r||o?new RegExp(`${r?"^":""}(?:${n})${o?"$":""}`,null!==(i=e.flags)&&void 0!==i?i:e.ignoreCase?"i":""):e}const u=n.q6.define(),d=new WeakMap;function p(e){if(!Array.isArray(e))return e;let t=d.get(e);return t||d.set(e,t=function(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[i,n]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),i=Object.create(null);for(let{label:n}of e){t[n[0]]=!0;for(let e=1;e<n.length;e++)i[n[e]]=!0}let n=a(t)+a(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}(t);return e=>{let r=e.matchBefore(n);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:i}:null}}(e)),t}const f=n.Py.define(),m=n.Py.define();class g{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=(0,n.gm)(e,t),r=(0,n.nZ)(i);this.chars.push(i);let o=e.slice(t,t+r),s=o.toUpperCase();this.folded.push((0,n.gm)(s==o?o.toLowerCase():s,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:r,precise:o,byWord:s}=this;if(1==t.length){let r=(0,n.gm)(e,0),o=(0,n.nZ)(r),s=o==e.length?0:-100;if(r==t[0]);else{if(r!=i[0])return null;s+=-200}return this.ret(s,[0,o])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let o=0,s=Math.min(e.length,200);o<s&&c<l;){let s=(0,n.gm)(e,o);s!=t[c]&&s!=i[c]||(r[c++]=o),o+=(0,n.nZ)(s)}if(c<l)return null}let h=0,u=0,d=!1,p=0,f=-1,m=-1,g=/[a-z]/.test(e),v=!0;for(let r=0,c=Math.min(e.length,200),y=0;r<c&&u<l;){let c=(0,n.gm)(e,r);a<0&&(h<l&&c==t[h]&&(o[h++]=r),p<l&&(c==t[p]||c==i[p]?(0==p&&(f=r),m=r+1,p++):p=0));let b,w=c<255?c>=48&&c<=57||c>=97&&c<=122?2:c>=65&&c<=90?1:0:(b=(0,n.bg)(c))!=b.toLowerCase()?1:b!=b.toUpperCase()?2:0;(!r||1==w&&g||0==y&&0!=w)&&(t[u]==c||i[u]==c&&(d=!0)?s[u++]=r:s.length&&(v=!1)),y=w,r+=(0,n.nZ)(c)}return u==l&&0==s[0]&&v?this.result((d?-200:0)-100,s,e):p==l&&0==f?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==l?this.ret(-900-e.length,[f,m]):u==l?this.result((d?-200:0)-100-700+(v?0:-1100),s,e):2==t.length?null:this.result((r[0]?-700:0)-200-1100,r,e)}result(e,t,i){let r=[],o=0;for(let e of t){let t=e+(this.astral?(0,n.nZ)((0,n.gm)(i,e)):1);o&&r[o-1]==e?r[o-1]=t:(r[o++]=e,r[o++]=t)}return this.ret(e-i.length,r)}}class v{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const y=n.r$.define({combine(e){return(0,n.BO)(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:w,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>b(e(i),t(i)),optionClass:(e,t)=>i=>b(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function b(e,t){return e?t?e+" "+t:e:t}function w(e,t,i,n,o,s){let a,l,c=e.textDirection==r.Nm.RTL,h=c,u=!1,d="top",p=t.left-o.left,f=o.right-t.right,m=n.right-n.left,g=n.bottom-n.top;if(h&&p<Math.min(m,f)?h=!1:!h&&f<Math.min(m,p)&&(h=!0),m<=(h?p:f))a=Math.max(o.top,Math.min(i.top,o.bottom-g))-t.top,l=Math.min(400,h?p:f);else{u=!0,l=Math.min(400,(c?t.right:o.right-t.left)-30);let e=o.bottom-t.bottom;e>=g||e>t.top?a=i.bottom-t.top:(d="bottom",a=t.bottom-i.top)}return{style:`${d}: ${a/((t.bottom-t.top)/s.offsetHeight)}px; max-width: ${l/((t.right-t.left)/s.offsetWidth)}px`,class:"cm-completionInfo-"+(u?c?"left-narrow":"right-narrow":h?"left":"right")}}function k(e,t,i){if(e<=i)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/i);return{from:e*i,to:(e+1)*i}}let n=Math.floor((e-t)/i);return{from:e-(n+1)*i,to:e-n*i}}class x{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let n=e.state.field(t),{options:r,selected:o}=n.open,s=e.state.facet(y);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,i,n){let r=document.createElement("span");r.className="cm-completionLabel";let o=e.displayLabel||e.label,s=0;for(let e=0;e<n.length;){let t=n[e++],i=n[e++];t>s&&r.appendChild(document.createTextNode(o.slice(s,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(t,i))),a.className="cm-completionMatchedText",s=i}return s<o.length&&r.appendChild(document.createTextNode(o.slice(s))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),t.sort(((e,t)=>e.position-t.position)).map((e=>e.render))}(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=k(r.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(i=>{let{options:n}=e.state.field(t).open;for(let t,r=i.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]<n.length)return this.applyCompletion(e,n[+t[1]]),void i.preventDefault()})),this.dom.addEventListener("focusout",(t=>{let i=e.state.field(this.stateField,!1);i&&i.tooltip&&e.state.facet(y).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:m.of(null)})})),this.showOptions(r,n.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(e){var t;let i=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=n){let{options:r,selected:o,disabled:s}=i.open;n.open&&n.open.options==r||(this.range=k(r.length,o,e.state.facet(y).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),s!=(null===(t=n.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=k(t.options.length,t.selected,this.view.state.facet(y).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:n}=i;if(!n)return;let o="string"==typeof n?document.createTextNode(n):n(i);if(!o)return;"then"in o?o.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,i)})).catch((e=>(0,r.OO)(this.view.state,e,"completion info"))):this.addInfoPane(o,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=e.nodeType)i.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:n}=e;i.appendChild(t),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return t&&function(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect(),r=i.height/e.offsetHeight;n.top<i.top?e.scrollTop-=(i.top-n.top)/r:n.bottom>i.bottom&&(e.scrollTop+=(n.bottom-i.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return n.top>Math.min(r.bottom,t.bottom)-10||n.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(y).positionInfo(this.view,t,n,i,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const n=document.createElement("ul");n.id=t,n.setAttribute("role","listbox"),n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let o=i.from;o<i.to;o++){let{completion:s,match:a}=e[o],{section:l}=s;if(l){let e="string"==typeof l?l:l.name;e!=r&&(o>i.from||0==i.from)&&(r=e,"string"!=typeof l&&l.header?n.appendChild(l.header(l)):n.appendChild(document.createElement("completion-section")).textContent=e)}const c=n.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let h=this.optionClass(s);h&&(c.className=h);for(let e of this.optionContent){let t=e(s,this.view.state,this.view,a);t&&c.appendChild(t)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&n.classList.add("cm-completionListIncompleteBottom"),n}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function _(e,t){return i=>new x(i,e,t)}function S(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class O{constructor(e,t,i,n,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new O(this.options,P(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,n,r){let o=function(e,t){let i=[],n=null,r=e=>{i.push(e);let{section:t}=e.completion;if(t){n||(n=[]);let e="string"==typeof t?t:t.name;n.some((t=>t.name==e))||n.push("string"==typeof t?{name:e}:t)}},o=t.facet(y);for(let n of e)if(n.hasResult()){let e=n.result.getMatch;if(!1===n.result.filter)for(let t of n.result.options)r(new l(t,n.source,e?e(t):[],1e9-i.length));else{let i,s=t.sliceDoc(n.from,n.to),a=o.filterStrict?new v(s):new g(s);for(let t of n.result.options)if(i=a.match(t.label)){let o=t.displayLabel?e?e(t,i.matched):[]:i.matched;r(new l(t,n.source,o,i.score+(t.boost||0)))}}}if(n){let e=Object.create(null),t=0,r=(e,t)=>{var i,n;return(null!==(i=e.rank)&&void 0!==i?i:1e9)-(null!==(n=t.rank)&&void 0!==n?n:1e9)||(e.name<t.name?-1:1)};for(let i of n.sort(r))t-=1e5,e[i.name]=t;for(let t of i){let{section:i}=t.completion;i&&(t.score+=e["string"==typeof i?i:i.name])}}let s=[],a=null,c=o.compareCompletions;for(let e of i.sort(((e,t)=>t.score-e.score||c(e.completion,t.completion)))){let t=e.completion;!a||a.label!=t.label||a.detail!=t.detail||null!=a.type&&null!=t.type&&a.type!=t.type||a.apply!=t.apply||a.boost!=t.boost?s.push(e):S(e.completion)>S(a)&&(s[s.length-1]=e),a=e.completion}return s}(e,t);if(!o.length)return n&&e.some((e=>1==e.state))?new O(n.options,n.attrs,n.tooltip,n.timestamp,n.selected,!0):null;let s=t.facet(y).selectOnOpen?0:-1;if(n&&n.selected!=s&&-1!=n.selected){let e=n.options[n.selected].completion;for(let t=0;t<o.length;t++)if(o[t].completion==e){s=t;break}}return new O(o,P(i,s),{pos:e.reduce(((e,t)=>t.hasResult()?Math.min(e,t.from):e),1e8),create:B,above:r.aboveCursor},n?n.timestamp:Date.now(),s,!1)}map(e){return new O(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class C{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new C(M,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,i=t.facet(y),n=(i.override||t.languageDataAt("autocomplete",c(t)).map(p)).map((t=>(this.active.find((e=>e.source==t))||new D(t,this.active.some((e=>0!=e.state))?1:0)).update(e,i)));n.length==this.active.length&&n.every(((e,t)=>e==this.active[t]))&&(n=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||n.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let i=0,n=0;;){for(;i<e.length&&!e[i].hasResult;)i++;for(;n<t.length&&!t[n].hasResult;)n++;let r=i==e.length,o=n==t.length;if(r||o)return r==o;if(e[i++].result!=t[n++].result)return!1}}(n,this.active)?r=O.build(n,t,this.id,r,i):r&&r.disabled&&!n.some((e=>1==e.state))&&(r=null),!r&&n.every((e=>1!=e.state))&&n.some((e=>e.hasResult()))&&(n=n.map((e=>e.hasResult()?new D(e.source,0):e)));for(let t of e.effects)t.is(I)&&(r=r&&r.setSelected(t.value,this.id));return n==this.active&&r==this.open?this:new C(n,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?T:A}}const T={"aria-autocomplete":"list"},A={};function P(e,t){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(i["aria-activedescendant"]=e+"-"+t),i}const M=[];function E(e,t){if(e.isUserEvent("input.complete")){let i=e.annotation(u);if(i&&t.activateOnCompletion(i))return 12}let i=e.isUserEvent("input.type");return i&&t.activateOnTyping?5:i?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class D{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=E(e,t),n=this;(8&i||16&i&&this.touches(e))&&(n=new D(n.source,0)),4&i&&0==n.state&&(n=new D(this.source,1)),n=n.updateFor(e,i);for(let t of e.effects)if(t.is(f))n=new D(n.source,1,t.value?c(e.state):-1);else if(t.is(m))n=new D(n.source,0);else if(t.is(R))for(let e of t.value)e.source==n.source&&(n=e);return n}updateFor(e,t){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new D(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(c(e.state))}}class L extends D{constructor(e,t,i,n,r){super(e,2,t),this.result=i,this.from=n,this.to=r}hasResult(){return!0}updateFor(e,t){var i;if(!(3&t))return this.map(e.changes);let n=this.result;n.map&&!e.changes.empty&&(n=n.map(n,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=c(e.state);if((this.explicitPos<0?a<=r:a<this.from)||a>o||!n||2&t&&c(e.startState)==this.from)return new D(this.source,4&t?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,i,n){if(!e)return!1;let r=t.sliceDoc(i,n);return"function"==typeof e?e(r,i,n,t):h(e,!0).test(r)}(n.validFor,e.state,r,o)?new L(this.source,l,n,r,o):n.update&&(n=n.update(n,r,o,new s(e.state,a,l>=0)))?new L(this.source,l,n,n.from,null!==(i=n.to)&&void 0!==i?i:c(e.state)):new D(this.source,1,l)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new L(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new D(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}const R=n.Py.define({map(e,t){return e.map((e=>e.map(t)))}}),I=n.Py.define(),N=n.QQ.define({create(){return C.start()},update(e,t){return e.update(t)},provide:e=>[r.hJ.from(e,(e=>e.tooltip)),r.tk.contentAttributes.from(e,(e=>e.attrs))]});function z(e,t){const i=t.completion.apply||t.completion.label;let r=e.state.field(N).active.find((e=>e.source==t.source));return r instanceof L&&("string"==typeof i?e.dispatch(Object.assign(Object.assign({},function(e,t,i,r){let{main:o}=e.selection,s=i-o.from,a=r-o.from;return Object.assign(Object.assign({},e.changeByRange((l=>l!=o&&i!=r&&e.sliceDoc(l.from+s,l.from+a)!=e.sliceDoc(i,r)?{range:l}:{changes:{from:l.from+s,to:r==o.from?l.to:l.from+a,insert:t},range:n.jT.cursor(l.from+s+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,i,r.from,r.to)),{annotations:u.of(t.completion)})):i(e,t.completion,r.from,r.to),!0)}const B=_(N,z);function j(e,t="option"){return i=>{let n=i.state.field(N,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(y).interactionDelay)return!1;let o,s=1;"page"==t&&(o=(0,r.gB)(i,n.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=n.open.options,l=n.open.selected>-1?n.open.selected+s*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),i.dispatch({effects:I.of(l)}),!0}}class F{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const V=r.lg.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(N).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(N),i=e.state.facet(y);if(!e.selectionSet&&!e.docChanged&&e.startState.field(N)==t)return;let n=e.transactions.some((e=>{let t=E(e,i);return 8&t||(e.selection||e.docChanged)&&!(3&t)}));for(let t=0;t<this.running.length;t++){let i=this.running[t];if(n||i.context.abortOnDocChange&&e.docChanged||i.updates.length+e.transactions.length>50&&Date.now()-i.time>1e3){for(let e of i.context.abortListeners)try{e()}catch(e){(0,r.OO)(this.view.state,e)}i.context.abortListeners=null,this.running.splice(t--,1)}else i.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some((e=>e.effects.some((e=>e.is(f)))))&&(this.pendingStart=!0);let o=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),o):-1,0!=this.composing)for(let t of e.transactions)t.isUserEvent("input.type")?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(N);for(let e of t.active)1!=e.state||this.running.some((t=>t.active.source==e.source))||this.startQuery(e)}startQuery(e){let{state:t}=this.view,i=c(t),n=new s(t,i,e.explicitPos==i,this.view),o=new F(e,n);this.running.push(o),Promise.resolve(e.source(n)).then((e=>{o.context.aborted||(o.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:m.of(null)}),(0,r.OO)(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(y).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],i=this.view.state.facet(y);for(let n=0;n<this.running.length;n++){let r=this.running[n];if(void 0===r.done)continue;if(this.running.splice(n--,1),r.done){let n=new L(r.active.source,r.active.explicitPos,r.done,r.done.from,null!==(e=r.done.to)&&void 0!==e?e:c(r.updates.length?r.updates[0].startState:this.view.state));for(let e of r.updates)n=n.update(e,i);if(n.hasResult()){t.push(n);continue}}let o=this.view.state.field(N).active.find((e=>e.source==r.active.source));if(o&&1==o.state)if(null==r.done){let e=new D(r.active.source,0);for(let t of r.updates)e=e.update(t,i);1!=e.state&&t.push(e)}else this.startQuery(o)}t.length&&this.view.dispatch({effects:R.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(N,!1);if(t&&t.tooltip&&this.view.state.facet(y).closeOnBlur){let i=t.open&&(0,r.gB)(this.view,t.open.tooltip);i&&i.dom.contains(e.relatedTarget)||setTimeout((()=>this.view.dispatch({effects:m.of(null)})),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:f.of(!1)})),20),this.composing=0}}}),W="object"==typeof navigator&&/Win/.test(navigator.platform),$=n.Wl.highest(r.tk.domEventHandlers({keydown(e,t){let i=t.state.field(N,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||e.key.length>1||e.ctrlKey&&(!W||!e.altKey)||e.metaKey)return!1;let n=i.open.options[i.open.selected],r=i.active.find((e=>e.source==n.source)),o=n.completion.commitCharacters||r.result.commitCharacters;return o&&o.indexOf(e.key)>-1&&z(t,n),!1}})),Q=r.tk.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),H={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},q=n.Py.define({map(e,t){let i=t.mapPos(e,-1,n.gc.TrackAfter);return null==i?void 0:i}}),Z=new class extends n.uU{};Z.startSide=1,Z.endSide=-1;const U=n.QQ.define({create(){return n.Xs.empty},update(e,t){if(e=e.map(t.changes),t.selection){let i=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=i.from&&e<=i.to})}for(let i of t.effects)i.is(q)&&(e=e.update({add:[Z.range(i.value,i.value+1)]}));return e}});function X(){return[ee,U]}const J="()[]{}<>";function Y(e){for(let t=0;t<J.length;t+=2)if(J.charCodeAt(t)==e)return J.charAt(t+1);return(0,n.bg)(e<128?e:e+1)}function K(e,t){return e.languageDataAt("closeBrackets",t)[0]||H}const G="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ee=571==i.j?r.tk.inputHandler.of(((e,t,i,r)=>{if((G?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==(0,n.nZ)((0,n.gm)(r,0))||t!=o.from||i!=o.to)return!1;let s=function(e,t){let i=K(e,e.selection.main.head),r=i.brackets||H.brackets;for(let o of r){let s=Y((0,n.gm)(o,0));if(t==o)return s==o?se(e,o,r.indexOf(o+o+o)>-1,i):re(e,o,s,i.before||H.before);if(t==s&&ie(e,e.selection.main.from))return oe(e,0,s)}return null}(e.state,r);return!!s&&(e.dispatch(s),!0)})):null,te=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=K(e,e.selection.main.head).brackets||H.brackets,r=null,o=e.changeByRange((t=>{if(t.empty){let r=function(e,t){let i=e.sliceString(t-2,t);return(0,n.nZ)((0,n.gm)(i,0))==i.length?i:i.slice(1)}(e.doc,t.head);for(let o of i)if(o==r&&ne(e.doc,t.head)==Y((0,n.gm)(o,0)))return{changes:{from:t.head-o.length,to:t.head+o.length},range:n.jT.cursor(t.head-o.length)}}return{range:r=t}}));return r||t(e.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function ie(e,t){let i=!1;return e.field(U).between(0,e.doc.length,(e=>{e==t&&(i=!0)})),i}function ne(e,t){let i=e.sliceString(t,t+2);return i.slice(0,(0,n.nZ)((0,n.gm)(i,0)))}function re(e,t,i,r){let o=null,s=e.changeByRange((s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:i,from:s.to}],effects:q.of(s.to+t.length),range:n.jT.range(s.anchor+t.length,s.head+t.length)};let a=ne(e.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+i,from:s.head},effects:q.of(s.head+t.length),range:n.jT.cursor(s.head+t.length)}:{range:o=s}}));return o?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function oe(e,t,i){let r=null,o=e.changeByRange((t=>t.empty&&ne(e.doc,t.head)==i?{changes:{from:t.head,to:t.head+i.length,insert:i},range:n.jT.cursor(t.head+i.length)}:r={range:t}));return r?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function se(e,t,i,r){let s=r.stringPrefixes||H.stringPrefixes,a=null,l=e.changeByRange((r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:q.of(r.to+t.length),range:n.jT.range(r.anchor+t.length,r.head+t.length)};let l,c=r.head,h=ne(e.doc,c);if(h==t){if(ae(e,c))return{changes:{insert:t+t,from:c},effects:q.of(c+t.length),range:n.jT.cursor(c+t.length)};if(ie(e,c)){let r=i&&e.sliceDoc(c,c+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+r.length,insert:r},range:n.jT.cursor(c+r.length)}}}else{if(i&&e.sliceDoc(c-2*t.length,c)==t+t&&(l=le(e,c-2*t.length,s))>-1&&ae(e,l))return{changes:{insert:t+t+t+t,from:c},effects:q.of(c+t.length),range:n.jT.cursor(c+t.length)};if(e.charCategorizer(c)(h)!=n.D0.Word&&le(e,c,s)>-1&&!function(e,t,i,n){let r=(0,o.qz)(e).resolveInner(t,-1),s=n.reduce(((e,t)=>Math.max(e,t.length)),0);for(let o=0;o<5;o++){let o=e.sliceDoc(r.from,Math.min(r.to,r.from+i.length+s)),a=o.indexOf(i);if(!a||a>-1&&n.indexOf(o.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>i.length+a;){if(e.sliceDoc(t.to-i.length,t.to)==i)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,c,t,s))return{changes:{insert:t+t,from:c},effects:q.of(c+t.length),range:n.jT.cursor(c+t.length)}}return{range:a=r}}));return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function ae(e,t){let i=(0,o.qz)(e).resolveInner(t+1);return i.parent&&i.from==t}function le(e,t,i){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=n.D0.Word)return t;for(let o of i){let i=t-o.length;if(e.sliceDoc(i,t)==o&&r(e.sliceDoc(i-1,i))!=n.D0.Word)return i}return-1}function ce(e={}){return[$,N,y.of(e),V,ue,Q]}const he=[{key:"Ctrl-Space",run:e=>!!e.state.field(N,!1)&&(e.dispatch({effects:f.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(N,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:m.of(null)}),0))}},{key:"ArrowDown",run:j(!0)},{key:"ArrowUp",run:j(!1)},{key:"PageDown",run:j(!0,"page")},{key:"PageUp",run:j(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(N,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(y).interactionDelay)&&z(e,t.open.options[t.open.selected])}}],ue=n.Wl.highest(r.$f.computeN([y],(e=>e.facet(y).defaultKeymap?[he]:[])))},5383:function(e,t,i){i.d(t,{f$:function(){return R},m8:function(){return y},oc:function(){return Re},wQ:function(){return Le}});var n=i(8120),r=i(6485),o=i(9119),s=i(1113);function a(e,t){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=e(t,i);return!!r&&(n(i.update(r)),!0)}}const l=571==i.j?a((function(e,t,i=t.selection.ranges){let n=[],r=-1;for(let{from:e,to:o}of i){let i=n.length,s=1e9,a=u(t,e).line;if(a){for(let i=e;i<=o;){let l=t.doc.lineAt(i);if(l.from>r&&(e==o||o>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,i=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<s&&(s=e),n.push({line:l,comment:i,token:a,indent:e,empty:t,single:!1})}i=l.to+1}if(s<1e9)for(let e=i;e<n.length;e++)n[e].indent<n[e].line.text.length&&(n[e].indent=s);n.length==i+1&&(n[i].single=!0)}}if(2!=e&&n.some((e=>e.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:i,indent:r,empty:o,single:s}of n)!s&&o||e.push({from:t.from+r,insert:i+" "});let i=t.changes(e);return{changes:i,selection:t.selection.map(i,1)}}if(1!=e&&n.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:i,token:r}of n)if(i>=0){let n=t.from+i,o=n+r.length;" "==t.text[o-t.from]&&o++,e.push({from:n,to:o})}return{changes:e}}return null}),0):null,c=571==i.j?a(d,0):null,h=571==i.j?a(((e,t)=>d(e,t,function(e){let t=[];for(let i of e.selection.ranges){let n=e.doc.lineAt(i.from),r=i.to<=n.to?n:e.doc.lineAt(i.to),o=t.length-1;o>=0&&t[o].to>n.from?t[o].to=r.to:t.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return t}(t))),0):null;function u(e,t){let i=e.languageDataAt("commentTokens",t);return i.length?i[0]:{}}function d(e,t,i=t.selection.ranges){let n=i.map((e=>u(t,e.from).block));if(!n.every((e=>e)))return null;let r=i.map(((e,i)=>function(e,{open:t,close:i},n,r){let o,s,a=e.sliceDoc(n-50,n),l=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,h=/^\s*/.exec(l)[0].length,u=a.length-c;if(a.slice(u-t.length,u)==t&&l.slice(h,h+i.length)==i)return{open:{pos:n-c,margin:c&&1},close:{pos:r+h,margin:h&&1}};r-n<=100?o=s=e.sliceDoc(n,r):(o=e.sliceDoc(n,n+50),s=e.sliceDoc(r-50,r));let d=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(s)[0].length,f=s.length-p-i.length;return o.slice(d,d+t.length)==t&&s.slice(f,f+i.length)==i?{open:{pos:n+d+t.length,margin:/\s/.test(o.charAt(d+t.length))?1:0},close:{pos:r-p-i.length,margin:/\s/.test(s.charAt(f-1))?1:0}}:null}(t,n[i],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(i.map(((e,t)=>r[t]?[]:[{from:e.from,insert:n[t].open+" "},{from:e.to,insert:" "+n[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,i=0;i<r.length;i++)if(t=r[i]){let r=n[i],{open:o,close:s}=t;e.push({from:o.pos-r.open.length,to:o.pos+o.margin},{from:s.pos-s.margin,to:s.pos+r.close.length})}return{changes:e}}return null}const p=n.q6.define(),f=n.q6.define(),m=n.r$.define(),g=n.r$.define({combine(e){return(0,n.BO)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),v=n.QQ.define({create(){return L.empty},update(e,t){let i=t.state.facet(g),r=t.annotation(p);if(r){let n=S.fromTransaction(t,r.selection),o=r.side,s=0==o?e.undone:e.done;return s=n?O(s,s.length,i.minDepth,n):A(s,t.startState.selection),new L(0==o?r.rest:s,0==o?s:r.rest)}let o=t.annotation(f);if("full"!=o&&"before"!=o||(e=e.isolate()),!1===t.annotation(n.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=S.fromTransaction(t),a=t.annotation(n.YW.time),l=t.annotation(n.YW.userEvent);return s?e=e.addChanges(s,a,l,i,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,i.newGroupDelay)),"full"!=o&&"after"!=o||(e=e.isolate()),e},toJSON(e){return{done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}},fromJSON(e){return new L(e.done.map(S.fromJSON),e.undone.map(S.fromJSON))}});function y(e={}){return[v,g.of(e),r.tk.domEventHandlers({beforeinput(e,t){let i="historyUndo"==e.inputType?w:"historyRedo"==e.inputType?k:null;return!!i&&(e.preventDefault(),i(t))}})]}function b(e,t){return function({state:i,dispatch:n}){if(!t&&i.readOnly)return!1;let r=i.field(v,!1);if(!r)return!1;let o=r.pop(e,i,t);return!!o&&(n(o),!0)}}const w=b(0,!1),k=b(1,!1),x=b(0,!0),_=b(1,!0);class S{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new S(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new S(e.changes&&n.as.fromJSON(e.changes),[],e.mapped&&n.n0.fromJSON(e.mapped),e.startSelection&&n.jT.fromJSON(e.startSelection),e.selectionsAfter.map(n.jT.fromJSON))}static fromTransaction(e,t){let i=T;for(let t of e.startState.facet(m)){let n=t(e);n.length&&(i=i.concat(n))}return!i.length&&e.changes.empty?null:new S(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,T)}static selection(e){return new S(void 0,T,void 0,void 0,e)}}function O(e,t,i,n){let r=t+1>i+20?t-i-1:0,o=e.slice(r,t);return o.push(n),o}function C(e,t){return e.length?t.length?e.concat(t):e:t}const T=[];function A(e,t){if(e.length){let i=e[e.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-200));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),O(e,e.length-1,1e9,i.setSelAfter(n)))}return[S.selection([t])]}function P(e){let t=e[e.length-1],i=e.slice();return i[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),i}function M(e,t){if(!e.length)return e;let i=e.length,n=T;for(;i;){let r=E(e[i-1],t,n);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,i);return t[i-1]=r,t}t=r.mapped,i--,n=r.selectionsAfter}return n.length?[S.selection(n)]:T}function E(e,t,i){let r=C(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):T,i);if(!e.changes)return S.selection(r);let o=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new S(o,n.Py.mapEffects(e.effects,t),a,e.startSelection.map(s),r)}const D=/^(input\.type|delete)($|\.)/;class L{constructor(e,t,i=0,n){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new L(this.done,this.undone):this}addChanges(e,t,i,r,o){let s=this.done,a=s[s.length-1];return s=a&&a.changes&&!a.changes.empty&&e.changes&&(!i||D.test(i))&&(!a.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,function(e,t){let i=[],n=!1;return e.iterChangedRanges(((e,t)=>i.push(e,t))),t.iterChangedRanges(((e,t,r,o)=>{for(let e=0;e<i.length;){let t=i[e++],s=i[e++];o>=t&&r<=s&&(n=!0)}})),n}(a.changes,e.changes))||"input.type.compose"==i)?O(s,s.length-1,r.minDepth,new S(e.changes.compose(a.changes),C(n.Py.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,T)):O(s,s.length,r.minDepth,e),new L(s,T,t,i)}addSelection(e,t,i,n){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:T;return r.length>0&&t-this.prevTime<n&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&(o=r[r.length-1],s=e,o.ranges.length==s.ranges.length&&0===o.ranges.filter(((e,t)=>e.empty!=s.ranges[t].empty)).length)?this:new L(A(this.done,e),this.undone,t,i);var o,s}addMapping(e){return new L(M(this.done,e),M(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let n=0==e?this.done:this.undone;if(0==n.length)return null;let r=n[n.length-1],o=r.selectionsAfter[0]||t.selection;if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:p.of({side:e,rest:P(n),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let i=1==n.length?T:n.slice(0,n.length-1);return r.mapped&&(i=M(i,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:p.of({side:e,rest:i,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}L.empty=new L(T,T);const R=[{key:"Mod-z",run:w,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:k,preventDefault:!0},{linux:"Ctrl-Shift-z",run:k,preventDefault:!0},{key:"Mod-u",run:x,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:_,preventDefault:!0}];function I(e,t){return n.jT.create(e.ranges.map(t),e.mainIndex)}function N(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function z({state:e,dispatch:t},i){let n=I(e.selection,i);return!n.eq(e.selection,!0)&&(t(N(e,n)),!0)}function B(e,t){return n.jT.cursor(t?e.to:e.from)}function j(e,t){return z(e,(i=>i.empty?e.moveByChar(i,t):B(i,t)))}function F(e){return e.textDirectionAt(e.state.selection.main.head)==r.Nm.LTR}const V=e=>j(e,!F(e)),W=e=>j(e,F(e));function $(e,t){return z(e,(i=>i.empty?e.moveByGroup(i,t):B(i,t)))}function Q(e,t,i){if(t.type.prop(i))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function H(e,t,i){let r,a,l=(0,o.qz)(e).resolveInner(t.head),c=i?s.md.closedBy:s.md.openedBy;for(let n=t.head;;){let t=i?l.childAfter(n):l.childBefore(n);if(!t)break;Q(e,t,c)?l=t:n=i?t.to:t.from}return a=l.type.prop(c)&&(r=i?(0,o.Um)(e,l.from,1):(0,o.Um)(e,l.to,-1))&&r.matched?i?r.end.to:r.end.from:i?l.to:l.from,n.jT.cursor(a,i?-1:1)}function q(e,t){return z(e,(i=>{if(!i.empty)return B(i,t);let n=e.moveVertically(i,t);return n.head!=i.head?n:e.moveToLineBoundary(i,t)}))}"undefined"!=typeof Intl&&Intl.Segmenter;const Z=e=>q(e,!1),U=e=>q(e,!0);function X(e){let t,i=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,o=0;if(i){for(let t of e.state.facet(r.tk.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(o=Math.max(null==i?void 0:i.bottom,o))}t=e.scrollDOM.clientHeight-n-o}else t=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:i,height:Math.max(e.defaultLineHeight,t-5)}}function J(e,t){let i,n=X(e),{state:o}=e,s=I(o.selection,(i=>i.empty?e.moveVertically(i,t,n.height):B(i,t)));if(s.eq(o.selection))return!1;if(n.selfScroll){let t=e.coordsAtPos(o.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;t&&t.top>l&&t.bottom<c&&(i=r.tk.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(N(o,s),{effects:i}),!0}const Y=e=>J(e,!1),K=e=>J(e,!0);function G(e,t,i){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,i);if(o.head==t.head&&o.head!=(i?r.to:r.from)&&(o=e.moveToLineBoundary(t,i,!1)),!i&&o.head==r.from&&r.length){let i=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;i&&t.head!=r.from+i&&(o=n.jT.cursor(r.from+i))}return o}function ee(e,t){let i=I(e.state.selection,(e=>{let i=t(e);return n.jT.range(e.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)}));return!i.eq(e.state.selection)&&(e.dispatch(N(e.state,i)),!0)}function te(e,t){return ee(e,(i=>e.moveByChar(i,t)))}const ie=e=>te(e,!F(e)),ne=e=>te(e,F(e));function re(e,t){return ee(e,(i=>e.moveByGroup(i,t)))}function oe(e,t){return ee(e,(i=>e.moveVertically(i,t)))}const se=e=>oe(e,!1),ae=e=>oe(e,!0);function le(e,t){return ee(e,(i=>e.moveVertically(i,t,X(e).height)))}const ce=e=>le(e,!1),he=e=>le(e,!0),ue=({state:e,dispatch:t})=>(t(N(e,{anchor:0})),!0),de=({state:e,dispatch:t})=>(t(N(e,{anchor:e.doc.length})),!0),pe=({state:e,dispatch:t})=>(t(N(e,{anchor:e.selection.main.anchor,head:0})),!0),fe=({state:e,dispatch:t})=>(t(N(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function me(e,t){if(e.state.readOnly)return!1;let i="delete.selection",{state:o}=e,s=o.changeByRange((r=>{let{from:o,to:s}=r;if(o==s){let n=t(r);n<o?(i="delete.backward",n=ge(e,n,!1)):n>o&&(i="delete.forward",n=ge(e,n,!0)),o=Math.min(o,n),s=Math.max(s,n)}else o=ge(e,o,!1),s=ge(e,s,!0);return o==s?{range:r}:{changes:{from:o,to:s},range:n.jT.cursor(o,o<r.head?-1:1)}}));return!s.changes.empty&&(e.dispatch(o.update(s,{scrollIntoView:!0,userEvent:i,effects:"delete.selection"==i?r.tk.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function ge(e,t,i){if(e instanceof r.tk)for(let n of e.state.facet(r.tk.atomicRanges).map((t=>t(e))))n.between(t,t,((e,n)=>{e<t&&n>t&&(t=i?n:e)}));return t}const ve=(e,t,i)=>me(e,(r=>{let s,a,l=r.from,{state:c}=e,h=c.doc.lineAt(l);if(i&&!t&&l>h.from&&l<h.from+200&&!/[^ \t]/.test(s=h.text.slice(0,l-h.from))){if("\t"==s[s.length-1])return l-1;let e=(0,n.IS)(s,c.tabSize)%(0,o.y1)(c)||(0,o.y1)(c);for(let t=0;t<e&&" "==s[s.length-1-t];t++)l--;a=l}else a=(0,n.cp)(h.text,l-h.from,t,t)+h.from,a==l&&h.number!=(t?c.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(h.text.slice(a-h.from,l-h.from))&&(a=(0,n.cp)(h.text,a-h.from,!1,!1)+h.from);return a})),ye=e=>ve(e,!1,!0),be=e=>ve(e,!0,!1),we=(e,t)=>me(e,(i=>{let r=i.head,{state:o}=e,s=o.doc.lineAt(r),a=o.charCategorizer(r);for(let e=null;;){if(r==(t?s.to:s.from)){r==i.head&&s.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let l=(0,n.cp)(s.text,r-s.from,t)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),h=a(c);if(null!=e&&h!=e)break;" "==c&&r==i.head||(e=h),r=l}return r})),ke=e=>we(e,!1);function xe(e){let t=[],i=-1;for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=e.doc.lineAt(n.to);if(n.empty||n.to!=o.from||(o=e.doc.lineAt(n.to-1)),i>=r.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(n)}else t.push({from:r.from,to:o.to,ranges:[n]});i=o.number+1}return t}function _e(e,t,i){if(e.readOnly)return!1;let r=[],o=[];for(let t of xe(e)){if(i?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(i?t.to+1:t.from-1),a=s.length+1;if(i){r.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak});for(let i of t.ranges)o.push(n.jT.range(Math.min(e.doc.length,i.anchor+a),Math.min(e.doc.length,i.head+a)))}else{r.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text});for(let e of t.ranges)o.push(n.jT.range(e.anchor-a,e.head-a))}}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:n.jT.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Se(e,t,i){if(e.readOnly)return!1;let n=[];for(let t of xe(e))i?n.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):n.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Oe=571==i.j?Te(!1):null,Ce=571==i.j?Te(!0):null;function Te(e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=t.changeByRange((i=>{let{from:r,to:a}=i,l=t.doc.lineAt(r),c=!e&&r==a&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let i,n=(0,o.qz)(e).resolveInner(t),r=n.childBefore(t),a=n.childAfter(t);return r&&a&&r.to<=t&&a.from>=t&&(i=r.type.prop(s.md.closedBy))&&i.indexOf(a.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(a.from).from&&!/\S/.test(e.sliceDoc(r.to,a.from))?{from:r.to,to:a.from}:null}(t,r);e&&(r=a=(a<=l.to?l:t.doc.lineAt(a)).to);let h=new o.Gn(t,{simulateBreak:r,simulateDoubleBreak:!!c}),u=(0,o.K0)(h,r);for(null==u&&(u=(0,n.IS)(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));a<l.to&&/\s/.test(l.text[a-l.from]);)a++;c?({from:r,to:a}=c):r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let d=["",(0,o.SS)(t,u)];return c&&d.push((0,o.SS)(t,h.lineIndent(l.from,-1))),{changes:{from:r,to:a,insert:n.xv.of(d)},range:n.jT.cursor(r+1+d[1].length)}}));return i(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ae(e,t){let i=-1;return e.changeByRange((r=>{let o=[];for(let n=r.from;n<=r.to;){let s=e.doc.lineAt(n);s.number>i&&(r.empty||r.to>s.from)&&(t(s,o,r),i=s.number),n=s.to+1}let s=e.changes(o);return{changes:o,range:n.jT.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}}))}const Pe=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ae(e,((t,i)=>{i.push({from:t.from,insert:e.facet(o.c)})})),{userEvent:"input.indent"})),!0),Me=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ae(e,((t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=(0,n.IS)(r,e.tabSize),a=0,l=(0,o.SS)(e,Math.max(0,s-(0,o.y1)(e)));for(;a<r.length&&a<l.length&&r.charCodeAt(a)==l.charCodeAt(a);)a++;i.push({from:t.from+a,to:t.from+r.length,insert:l.slice(a)})})),{userEvent:"delete.dedent"})),!0),Ee=[{key:"Ctrl-b",run:V,shift:ie,preventDefault:!0},{key:"Ctrl-f",run:W,shift:ne},{key:"Ctrl-p",run:Z,shift:se},{key:"Ctrl-n",run:U,shift:ae},{key:"Ctrl-a",run:e=>z(e,(t=>n.jT.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>ee(e,(t=>n.jT.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>z(e,(t=>n.jT.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>ee(e,(t=>n.jT.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:be},{key:"Ctrl-h",run:ye},{key:"Ctrl-k",run:e=>me(e,(t=>{let i=e.lineBlockAt(t.head).to;return t.head<i?i:Math.min(e.state.doc.length,t.head+1)}))},{key:"Ctrl-Alt-h",run:ke},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:n.xv.of(["",""])},range:n.jT.cursor(e.from)})));return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let i=t.from,r=e.doc.lineAt(i),o=i==r.from?i-1:(0,n.cp)(r.text,i-r.from,!1)+r.from,s=i==r.to?i+1:(0,n.cp)(r.text,i-r.from,!0)+r.from;return{changes:{from:o,to:s,insert:e.doc.slice(i,s).append(e.doc.slice(o,i))},range:n.jT.cursor(s)}}));return!i.changes.empty&&(t(e.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:K}],De=571==i.j?[{key:"ArrowLeft",run:V,shift:ie,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>$(e,!F(e)),shift:e=>re(e,!F(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>z(e,(t=>G(e,t,!F(e)))),shift:e=>ee(e,(t=>G(e,t,!F(e)))),preventDefault:!0},{key:"ArrowRight",run:W,shift:ne,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>$(e,F(e)),shift:e=>re(e,F(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>z(e,(t=>G(e,t,F(e)))),shift:e=>ee(e,(t=>G(e,t,F(e)))),preventDefault:!0},{key:"ArrowUp",run:Z,shift:se,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ue,shift:pe},{mac:"Ctrl-ArrowUp",run:Y,shift:ce},{key:"ArrowDown",run:U,shift:ae,preventDefault:!0},{mac:"Cmd-ArrowDown",run:de,shift:fe},{mac:"Ctrl-ArrowDown",run:K,shift:he},{key:"PageUp",run:Y,shift:ce},{key:"PageDown",run:K,shift:he},{key:"Home",run:e=>z(e,(t=>G(e,t,!1))),shift:e=>ee(e,(t=>G(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:ue,shift:pe},{key:"End",run:e=>z(e,(t=>G(e,t,!0))),shift:e=>ee(e,(t=>G(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:de,shift:fe},{key:"Enter",run:Oe},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ye,shift:ye},{key:"Delete",run:be},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ke},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>we(e,!0)},{mac:"Mod-Backspace",run:e=>me(e,(t=>{let i=e.moveToLineBoundary(t,!1).head;return t.head>i?i:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>me(e,(t=>{let i=e.moveToLineBoundary(t,!0).head;return t.head<i?i:Math.min(e.state.doc.length,t.head+1)}))}].concat(Ee.map((e=>({mac:e.key,run:e.run,shift:e.shift})))):null,Le=571==i.j?[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>z(e,(t=>H(e.state,t,!F(e)))),shift:e=>ee(e,(t=>H(e.state,t,!F(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>z(e,(t=>H(e.state,t,F(e)))),shift:e=>ee(e,(t=>H(e.state,t,F(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>_e(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Se(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>_e(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Se(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let i=e.selection,r=null;return i.ranges.length>1?r=n.jT.create([i.main]):i.main.empty||(r=n.jT.create([n.jT.cursor(i.main.head)])),!!r&&(t(N(e,r)),!0)}},{key:"Mod-Enter",run:Ce},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let i=xe(e).map((({from:t,to:i})=>n.jT.range(t,Math.min(i+1,e.doc.length))));return t(e.update({selection:n.jT.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let i=I(e.selection,(t=>{var i;for(let r=(0,o.qz)(e).resolveStack(t.from,1);r;r=r.next){let{node:e}=r;if((e.from<t.from&&e.to>=t.to||e.to>t.to&&e.from<=t.from)&&(null===(i=e.parent)||void 0===i?void 0:i.parent))return n.jT.range(e.to,e.from)}return t}));return t(N(e,i)),!0},preventDefault:!0},{key:"Mod-[",run:Me},{key:"Mod-]",run:Pe},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Object.create(null),n=new o.Gn(e,{overrideIndentation:e=>{let t=i[e];return null==t?-1:t}}),r=Ae(e,((t,r,s)=>{let a=(0,o.K0)(n,t.from);if(null==a)return;/\S/.test(t.text)||(a=0);let l=/^\s*/.exec(t.text)[0],c=(0,o.SS)(e,a);(l!=c||s.from<t.from+l.length)&&(i[t.from]=a,r.push({from:t.from,to:t.from+l.length,insert:c}))}));return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,i=t.changes(xe(t).map((({from:e,to:i})=>(e>0?e--:i<t.doc.length&&i++,{from:e,to:i})))),n=I(t.selection,(t=>{let i;if(e.lineWrapping){let n=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(i=n.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,i)})).map(i);return e.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,i){let r=!1,s=I(e.selection,(t=>{let s=(0,o.Um)(e,t.head,-1)||(0,o.Um)(e,t.head,1)||t.head>0&&(0,o.Um)(e,t.head-1,1)||t.head<e.doc.length&&(0,o.Um)(e,t.head+1,-1);if(!s||!s.end)return t;r=!0;let a=s.start.from==t.head?s.end.to:s.end.from;return i?n.jT.range(t.anchor,a):n.jT.cursor(a)}));return!!r&&(t(N(e,s)),!0)}(e,t,!1)},{key:"Mod-/",run:e=>{let{state:t}=e,i=t.doc.lineAt(t.selection.main.from),n=u(e.state,i.from);return n.line?l(e):!!n.block&&h(e)}},{key:"Alt-A",run:c},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat(De):null,Re={key:"Tab",run:Pe,shift:Me}},8723:function(e,t,i){i.r(t),i.d(t,{css:function(){return ne},cssCompletionSource:function(){return te},cssLanguage:function(){return ie},defineCSSCompletionSource:function(){return ee}});var n=i(1113);class r{constructor(e,t,i,n,r,o,s,a,l,c=0,h){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=o,this.buffer=s,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new r(e,[],t,i,i,0,[],0,n?new o(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,n=65535&e,{parser:r}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let s=r.dynamicPrecedence(n);if(s&&(this.score+=s),0==i)return this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,o?8:4,!0),void this.reduceContext(n,this.reducePos);let a=this.stack.length-3*(i-1)-(262144&e?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(null===(t=this.p.parser.nodeSet.types[n])||void 0===t?void 0:t.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=l,this.p.lastBigReductionSize=c));let h=a?this.stack[a-1]:0,u=this.bufferBase+this.buffer.length-h;if(n<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,l,e,u+4,!0)}if(262144&e)this.state=this.stack[a];else{let e=this.stack[a-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(n,l)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,n=this.buffer.length;if(0==n&&e.parent&&(n=e.bufferBase-e.parent.bufferBase,e=e.parent),n>0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4]){let e=!1;for(let t=r;t>0&&this.buffer[t-2]>i;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4)}this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i,n){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:o}=this.p;(n>this.pos||t<=o.maxNode)&&(this.pos=n,o.stateFlag(r,1)||(this.reducePos=n)),this.pushState(r,i),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,n,4)}else this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4)}apply(e,t,i,n){65536&e?this.reduce(e):this.shift(e,t,i,n)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new r(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new s(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==i)return!1;if(0==(65536&i))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r<t.length;r+=2)(n=t[r+1])!=this.state&&this.p.parser.hasAction(n,e)&&i.push(t[r],n);if(this.stack.length<120)for(let e=0;i.length<8&&e<t.length;e+=2){let n=t[e+1];i.some(((e,t)=>1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e<t.length&&i.length<4;e+=2){let n=t[e+1];if(n==this.state)continue;let r=this.split();r.pushState(n,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,i.push(r)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(0==(65536&t))return!1;if(!e.validAction(this.state,t)){let i=t>>19,n=65535&t,r=this.stack.length-3*i;if(r<0||e.getGoto(this.stack[r],n,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(n,r)=>{if(!t.includes(n))return t.push(n),e.allActions(n,(t=>{if(393216&t);else if(65536&t){let i=(t>>19)-r;if(i>1){let n=65535&t,r=this.stack.length-3*i;if(r>=0&&e.getGoto(this.stack[r],n,!1)>=0)return i<<19|65536|n}}else{let e=i(t,r+1);if(null!=e)return e}}))};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new o(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class o{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class s{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class a{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new a(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new a(this.stack,this.pos,this.index)}}function l(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n<e.length;){let o=0;for(;;){let t=e.charCodeAt(n++),i=!1;if(126==t){o=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),o+=r,i)break;o*=46}i?i[r++]=o:i=new t(o)}return i}class c{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const h=new c;class u{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=h,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;r<i.from;){if(!n)return null;let e=this.ranges[--n];r-=i.from-e.to,i=e}for(;t<0?r>i.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n<this.chunk.length)t=this.pos+e,i=this.chunk.charCodeAt(n);else{let n=this.resolveOffset(e,1);if(null==n)return-1;if(t=n,t>=this.chunk2Pos&&t<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(t-this.chunk2Pos);else{let e=this.rangeIndex,n=this.range;for(;n.to<=t;)n=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=t),t+this.chunk2.length>n.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=h,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class d{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;m(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}d.prototype.contextual=d.prototype.fallback=d.prototype.extend=!1;class p{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data="string"==typeof e?l(e):e}token(e,t){let i=e.pos,n=0;for(;;){let i=e.next<0,r=e.resolveOffset(1,1);if(m(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(i||n++,null==r)break;e.reset(r,e.token)}n&&(e.reset(i,e.token),e.acceptToken(this.elseToken,n))}}p.prototype.contextual=d.prototype.fallback=d.prototype.extend=!1;class f{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function m(e,t,i,n,r,o){let s=0,a=1<<n,{dialect:l}=i.p.parser;e:for(;0!=(a&e[s]);){let i=e[s+1];for(let n=s+3;n<i;n+=2)if((e[n+1]&a)>0){let i=e[n];if(l.allows(i)&&(-1==t.token.value||t.token.value==i||v(i,t.token.value,r,o))){t.acceptToken(i);break}}let n=t.next,c=0,h=e[s+2];if(!(t.next<0&&h>c&&65535==e[i+3*h-3])){for(;c<h;){let r=c+h>>1,o=i+r+(r<<1),a=e[o],l=e[o+1]||65536;if(n<a)h=r;else{if(!(n>=l)){s=e[o+2],t.advance();continue e}c=r+1}}break}s=e[i+3*h-1]}}function g(e,t,i){for(let n,r=t;65535!=(n=e[r]);r++)if(n==i)return r-t;return-1}function v(e,t,i,n){let r=g(i,n,t);return r<0||g(i,n,e)<r}const y="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let b=null;function w(e,t,i){let r=e.cursor(n.vj.IncludeAnonymous);for(r.moveTo(t);;)if(!(i<0?r.childBefore(t):r.childAfter(t)))for(;;){if((i<0?r.to<t:r.from>t)&&!r.type.isError)return i<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(i<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return i<0?0:e.length}}class k{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?w(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?w(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],r=this.index[t];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=i.children[r],s=this.start[t]+i.positions[r];if(s>e)return this.nextStart=s,null;if(o instanceof n.mp){if(s==e){if(s<this.safeFrom)return null;let e=s+o.length;if(e<=this.safeTo){let t=o.prop(n.md.lookAhead);if(!t||e+t<this.fragment.to)return o}}this.index[t]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+o.length}}}class x{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new c))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,o=n.stateSlot(e.state,3),s=e.curContext?e.curContext.hash:0,a=0;for(let n=0;n<r.length;n++){if(0==(1<<n&o))continue;let l=r[n],c=this.tokens[n];if((!i||l.fallback)&&((l.contextual||c.start!=e.pos||c.mask!=o||c.context!=s)&&(this.updateCachedToken(c,l,e),c.mask=o,c.context=s),c.lookAhead>c.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new c,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new c,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){let n=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(n,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n<t.specialized.length;n++)if(t.specialized[n]==e.value){let r=t.specializers[n](this.stream.read(e.start,e.end),i);if(r>=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,i,n){for(let t=0;t<n;t+=3)if(this.actions[t]==e)return n;return this.actions[n++]=e,this.actions[n++]=t,this.actions[n++]=i,n}addActions(e,t,i,n){let{state:r}=e,{parser:o}=e.p,{data:s}=o;for(let e=0;e<2;e++)for(let a=o.stateSlot(r,e?2:1);;a+=3){if(65535==s[a]){if(1!=s[a+1]){0==n&&2==s[a+1]&&(n=this.putAction(T(s,a+2),t,i,n));break}a=T(s,a+2)}s[a]==t&&(n=this.putAction(T(s,a+1),t,i,n))}return n}}class _{constructor(e,t,i,n){this.parser=e,this.input=t,this.ranges=n,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new u(t,n),this.tokens=new x(e,this.stream),this.topTerm=e.top[1];let{from:o}=n[0];this.stacks=[r.start(this,e.top[0],o)],this.fragments=i.length&&this.stream.end-o>4*e.bufferLength?new k(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[e]=i;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<i.length;o++){let s=i[o];for(;;){if(this.tokens.mainToken=null,s.pos>n)r.push(s);else{if(this.advanceStack(s,r,i))continue;{e||(e=[],t=[]),e.push(s);let i=this.tokens.getMainToken(s);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.score<i.score)&&(t=i)}return t}(e);if(t)return y&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw y&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&e){let i=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return y&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1){e:for(let e=0;e<r.length-1;e++){let t=r[e];for(let i=e+1;i<r.length;i++){let n=r[i];if(t.sameState(n)||t.buffer.length>500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let r=e.pos,{parser:o}=this,s=y?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let a=this.fragments.nodeAt(r);a;){let r=this.parser.nodeSet.types[a.type.id]==a.type?o.getGoto(e.state,a.type.id):-1;if(r>-1&&a.length&&(!t||(a.prop(n.md.contextHash)||0)==i))return e.useNode(a,r),y&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(a.type.id)})`),!0;if(!(a instanceof n.mp)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof n.mp&&0==a.positions[0]))break;a=l}}let a=o.stateSlot(e.state,4);if(a>0)return e.reduce(a),y&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(65535&a)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let n=0;n<l.length;){let a=l[n++],c=l[n++],h=l[n++],u=n==l.length||!i,d=u?e:e.split(),p=this.tokens.mainToken;if(d.apply(a,c,p?p.start:d.pos,h),y&&console.log(s+this.stackID(d)+` (via ${0==(65536&a)?"shift":`reduce of ${o.getName(65535&a)}`} for ${o.getName(c)} @ ${r}${d==e?"":", split"})`),u)return!0;d.pos>r?t.push(d):i.push(d)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return S(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let o=0;o<e.length;o++){let s=e[o],a=t[o<<1],l=t[1+(o<<1)],c=y?this.stackID(s)+" -> ":"";if(s.deadEnd){if(r)continue;if(r=!0,s.restart(),y&&console.log(c+this.stackID(s)+" (restarted)"),this.advanceFully(s,i))continue}let h=s.split(),u=c;for(let e=0;h.forceReduce()&&e<10&&(y&&console.log(u+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,i));e++)y&&(u=this.stackID(h)+" -> ");for(let e of s.recoverByInsert(a))y&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>s.pos?(l==s.pos&&(l++,a=0),s.recoverByDelete(a,l),y&&console.log(c+this.stackID(s)+` (via recover-delete ${this.parser.getName(a)})`),S(s,i)):(!n||n.score<s.score)&&(n=s)}return n}stackToTree(e){return e.close(),n.mp.build({buffer:a.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(b||(b=new WeakMap)).get(e);return t||b.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function S(e,t){for(let i=0;i<t.length;i++){let n=t[i];if(n.pos==e.pos&&n.sameState(e))return void(t[i].score<e.score&&(t[i]=e))}t.push(e)}class O{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||0==this.disabled[e]}}class C extends n._b{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let i=0;i<e.repeatNodeCount;i++)t.push("");let i=Object.keys(e.topRules).map((t=>e.topRules[t][1])),r=[];for(let e=0;e<t.length;e++)r.push([]);function o(e,t,i){r[e].push([t,t.deserialize(String(i))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=n.md[e]);for(let i=1;i<t.length;){let n=t[i++];if(n>=0)o(n,e,t[i++]);else{let r=t[i+-n];for(let s=-n;s>0;s--)o(t[i++],e,r);i++}}}this.nodeSet=new n.Lj(t.map(((t,o)=>n.Jq.define({name:o>=this.minRepeatTerm?void 0:t,id:o,props:r[o],top:i.indexOf(o)>-1,error:0==o,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=n.L3;let s=l(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(A),this.states=l(e.states,Uint32Array),this.data=l(e.stateData),this.goto=l(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map((e=>"number"==typeof e?new d(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new _(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],o=1&t,s=n[r++];if(o&&i)return s;for(let i=r+(t>>1);r<i;r++)if(n[r]==e)return s;if(o)return-1}}hasAction(e,t){let i=this.data;for(let n=0;n<2;n++)for(let r,o=this.stateSlot(e,n?2:1);;o+=3){if(65535==(r=i[o])){if(1!=i[o+1]){if(2==i[o+1])return T(i,o+2);break}r=i[o=T(i,o+2)]}if(r==t||0==r)return T(i,o+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let i=this.stateSlot(e,4),n=i?t(i):void 0;for(let i=this.stateSlot(e,1);null==n;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=T(this.data,i+2)}n=t(T(this.data,i+1))}return n}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=T(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}configure(e){let t=Object.assign(Object.create(C.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((i,n)=>{let r=e.specializers.find((e=>e.from==i.external));if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[n]=A(o),o}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e<t.length;e++)if(!i[e])for(let i,r=this.dialects[t[e]];65535!=(i=this.data[r++]);)(n||(n=new Uint8Array(this.maxTerm+1)))[i]=1;return new O(e,i,n)}static deserialize(e){return new C(e)}}function T(e,t){return e[t]|e[t+1]<<16}function A(e){if(e.external){let t=e.extend?1:0;return(i,n)=>e.external(i,n)<<1|t}return e.get}var P=i(5524);const M=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function E(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function D(e){return e>=48&&e<=57}const L=new f(((e,t)=>{for(let i=!1,n=0,r=0;;r++){let{next:o}=e;if(E(o)||45==o||95==o||i&&D(o))!i&&(45!=o||r>0)&&(i=!0),n===r&&45==o&&n++,e.advance();else{if(92!=o||10==e.peek(1)){i&&e.acceptToken(40==o?100:2==n&&t.canShift(2)?2:101);break}e.advance(),e.next>-1&&e.advance(),i=!0}}})),R=new f((e=>{if(M.includes(e.peek(-1))){let{next:t}=e;(E(t)||95==t||35==t||46==t||91==t||58==t&&E(e.peek(1))||45==t||38==t)&&e.acceptToken(99)}})),I=new f((e=>{if(!M.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),E(t)){do{e.advance()}while(E(e.next)||D(e.next));e.acceptToken(1)}}})),N=(0,P.Gv)({"AtKeyword import charset namespace keyframes media supports":P.pJ.definitionKeyword,"from to selector":P.pJ.keyword,NamespaceName:P.pJ.namespace,KeyframeName:P.pJ.labelName,KeyframeRangeName:P.pJ.operatorKeyword,TagName:P.pJ.tagName,ClassName:P.pJ.className,PseudoClassName:P.pJ.constant(P.pJ.className),IdName:P.pJ.labelName,"FeatureName PropertyName":P.pJ.propertyName,AttributeName:P.pJ.attributeName,NumberLiteral:P.pJ.number,KeywordQuery:P.pJ.keyword,UnaryQueryOp:P.pJ.operatorKeyword,"CallTag ValueName":P.pJ.atom,VariableName:P.pJ.variableName,Callee:P.pJ.operatorKeyword,Unit:P.pJ.unit,"UniversalSelector NestingSelector":P.pJ.definitionOperator,MatchOp:P.pJ.compareOperator,"ChildOp SiblingOp, LogicOp":P.pJ.logicOperator,BinOp:P.pJ.arithmeticOperator,Important:P.pJ.modifier,Comment:P.pJ.blockComment,ColorLiteral:P.pJ.color,"ParenthesizedContent StringLiteral":P.pJ.string,":":P.pJ.punctuation,"PseudoOp #":P.pJ.derefOperator,"; ,":P.pJ.separator,"( )":P.pJ.paren,"[ ]":P.pJ.squareBracket,"{ }":P.pJ.brace}),z={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},B={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},j={__proto__:null,not:132,only:132},F=C.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<<HdO9`QWO,5;^OOQP1G/Y1G/YOOQS-E8V-E8VO${QdO'#EZO9hQWO,5;ZOOQT1G.u1G.uOOQP<<Hd<<HdOOQS7+$k7+$kO9pQdO7+%]OOQO7+%d7+%dOOQO,5:k,5:kO3hQdO'#EaO7_QWO,5:zOOQS,5:z,5:zOOQS-E8^-E8^OOQS1G0U1G0UO9wQtO,5:wOOQS-E8Z-E8ZOOQO<<Ho<<HoOOQPAN>OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<<Hw<<HwOOQO,5:{,5:{OOQO-E8_-E8_OOQS1G0f1G0f",stateData:";[~O#ZOS#[QQ~OUYOXYO]VO^VOqXOxWO![aO!]ZO!i[O!k]O!m^O!p_O!v`O#XRO#bTO~OQfOUYOXYO]VO^VOqXOxWO![aO!]ZO!i[O!k]O!m^O!p_O!v`O#XeO#bTO~O#U#gP~P!ZO#[jO~O#XlO~O]qO^qOqsOtoOxrO!OtO!RvO#VuO#bnO~O!TwO~P#pO`}O#WzO#XyO~O#X!OO~O#X!QO~OQ![Ob!TOf![Oh![On!YOq!ZO#W!WO#X!SO#e!UO~Ob!^O!d!`O!g!aO#X!]O!T#hP~Oh!fOn!YO#X!eO~Oh!hO#X!hO~Ob!^O!d!`O!g!aO#X!]O~O!Y#hP~P%jO]WX]!WX^WXqWXtWXxWX!OWX!RWX!TWX#VWX#bWX~O]!mO~O!Y!nO#U#gX!S#gX~O#U#gX!S#gX~P!ZO#]!qO#^!qO#_!sO~OUYOXYO]VO^VOqXOxWO#XRO#bTO~OtoO!TwO~O`!zO#WzO#XyO~O!S#gP~P!ZOb#RO~Ob#SO~Op#TO|#UO~OP#WObgXjgX!YgX!dgX!ggX#XgXagXQgXfgXhgXngXqgXtgX!XgX#UgX#WgX#egXpgX!SgX~Ob!^Oj#XO!d!`O!g!aO#X!]O!Y#hP~Ob#[O~Op#`O#X#]O~Ob!^O!d!`O!g!aO#X#aO~Ot#eO!b#dO!T#hX!Y#hX~Ob#hO~Oj#XO!Y#jO~O!Y#kO~Oh#lOn!YO~O!T#mO~O!TwO!b#dO~O!TwO!Y#pO~O!Y#QX#U#QX!S#QX~P!ZO!Y!nO#U#ga!S#ga~O#]!qO#^!qO#_#wO~O]qO^qOqsOxrO!OtO!RvO#VuO#bnO~Ot#Oa!T#Oaa#Oa~P.`Op#yO|#zO~O]qO^qOqsOxrO#bnO~Ot}i!O}i!R}i!T}i#V}ia}i~P/aOt!Pi!O!Pi!R!Pi!T!Pi#V!Pia!Pi~P/aOt!Qi!O!Qi!R!Qi!T!Qi#V!Qia!Qi~P/aO!S#{O~Oa#fP~P(aOa#cP~P${Oa$SOj#XO~O!Y$UO~Oh$VOo$VO~Op$XO#X#]O~O]!`Xa!^X!b!^X~O]$YO~Oa$ZO!b#dO~Ot#eO!T#ha!Y#ha~O!b#dOt!ca!T!ca!Y!caa!ca~O!Y$`O~O!S$gO#X$bO#e$aO~Oj#XOt$iO!X$kO!Y!Vi#U!Vi!S!Vi~P${O!Y#Qa#U#Qa!S#Qa~P!ZO!Y!nO#U#gi!S#gi~Oa#fX~P#pOa$oO~Oj#XOQ!{Xa!{Xb!{Xf!{Xh!{Xn!{Xq!{Xt!{X#W!{X#X!{X#e!{X~Ot$qOa#cX~P${Oa$sO~Oj#XOp$tO~Oa$uO~O!b#dOt#Ra!T#Ra!Y#Ra~Oa$wO~P.`OP#WOtgX!TgX~O#e$aOt!sX!T!sX~Ot$yO!TwO~O!S$}O#X$bO#e$aO~Oj#XOQ#PXb#PXf#PXh#PXn#PXq#PXt#PX!X#PX!Y#PX#U#PX#W#PX#X#PX#e#PX!S#PX~Ot$iO!X%QO!Y!Vq#U!Vq!S!Vq~P${Oj#XOp%RO~OtoOa#fa~Ot$qOa#ca~Oa%UO~P${Oj#XOQ#Pab#Paf#Pah#Pan#Paq#Pat#Pa!X#Pa!Y#Pa#U#Pa#W#Pa#X#Pa#e#Pa!S#Pa~Oa!}at!}a~P${O#Zo#[#ej!R#e~",goto:"-g#jPPP#kP#nP#w$WP#w$g#wPP$mPPP$s$|$|P%`P$|P$|%z&^PPPP$|&vP&z'Q#wP'W#w'^P#wP#w#wPPP'd'y(WPP#nPP(_(_(i(_P(_P(_(_P#nP#nP#nP(l#nP(o(r(u(|#nP#nP)R)X)h)v)|*S*^*d*n*t*zPPPPPPPPPP+Q+ZP+v+yP,o,r,x-RRkQ_bOPdhw!n#skYOPdhotuvw!n#R#h#skSOPdhotuvw!n#R#h#sQmTR!tnQ{VR!xqQ!x}Q#Z!XR#x!zq![Z]!T!m#S#U#X#q#z$P$Y$i$j$q$v%Sp![Z]!T!m#S#U#X#q#z$P$Y$i$j$q$v%SU$d#m$f$yR$x$cq!XZ]!T!m#S#U#X#q#z$P$Y$i$j$q$v%Sp![Z]!T!m#S#U#X#q#z$P$Y$i$j$q$v%SQ!f^R#l!gT#^!Z#_Q|VR!yqQ!x|R#x!yQ!PWR!{rQ!RXR!|sQxUQ!wpQ#i!cQ#o!jQ#p!kQ${$eR%X$zSgPwQ!phQ#r!nR$l#sZfPhw!n#sa!b[`a!V!^!`#d#eR#b!^R!g^R!i_R#n!iS$e#m$fR%V$yV$c#m$f$yQ!rjR#v!rQdOShPwU!ldh#sR#s!nQ$P#SU$p$P$v%SQ$v$YR%S$qQ#_!ZR$W#_Q$r$PR%T$rQpUS!vp$nR$n#|Q$j#qR%P$jQ!ogS#t!o#uR#u!pQ#f!_R$^#fQ$f#mR$|$fQ$z$eR%W$z_cOPdhw!n#s^UOPdhw!n#sQ!uoQ!}tQ#OuQ#PvQ#|#RR$_#hR$Q#SQ!VZQ!d]Q#V!TQ#q!m[$O#S$P$Y$q$v%SQ$R#UQ$T#XS$h#q$jQ$m#zR%O$iR#}#RQiPR#QwQ!c[Q!kaR#Y!VU!_[a!VQ!j`Q#c!^Q#g!`Q$[#dR$]#e",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:117,nodeProps:[["isolate",-2,3,24,""],["openedBy",17,"(",32,"[",50,"{"],["closedBy",18,")",33,"]",51,"}"]],propSources:[N],skippedNodes:[0,3,87],repeatNodeCount:11,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#Z~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#Z~o`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^l)[UOy%^z#]%^#]#^)n#^;'S%^;'S;=`%o<%lO%^l)sUo`Oy%^z#a%^#a#b*V#b;'S%^;'S;=`%o<%lO%^l*[Uo`Oy%^z#d%^#d#e*n#e;'S%^;'S;=`%o<%lO%^l*sUo`Oy%^z#c%^#c#d+V#d;'S%^;'S;=`%o<%lO%^l+[Uo`Oy%^z#f%^#f#g+n#g;'S%^;'S;=`%o<%lO%^l+sUo`Oy%^z#h%^#h#i,V#i;'S%^;'S;=`%o<%lO%^l,[Uo`Oy%^z#T%^#T#U,n#U;'S%^;'S;=`%o<%lO%^l,sUo`Oy%^z#b%^#b#c-V#c;'S%^;'S;=`%o<%lO%^l-[Uo`Oy%^z#h%^#h#i-n#i;'S%^;'S;=`%o<%lO%^l-uS!X[o`Oy%^z;'S%^;'S;=`%o<%lO%^~.UWOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o<%lO.R~.sOh~~.vRO;'S.R;'S;=`/P;=`O.R~/SXOY.RZr.Rrs.ns#O.R#O#P.s#P;'S.R;'S;=`/o;=`<%l.R<%lO.R~/rP;=`<%l.Rn/zYxQOy%^z!Q%^!Q![0j![!c%^!c!i0j!i#T%^#T#Z0j#Z;'S%^;'S;=`%o<%lO%^l0oYo`Oy%^z!Q%^!Q![1_![!c%^!c!i1_!i#T%^#T#Z1_#Z;'S%^;'S;=`%o<%lO%^l1dYo`Oy%^z!Q%^!Q![2S![!c%^!c!i2S!i#T%^#T#Z2S#Z;'S%^;'S;=`%o<%lO%^l2ZYf[o`Oy%^z!Q%^!Q![2y![!c%^!c!i2y!i#T%^#T#Z2y#Z;'S%^;'S;=`%o<%lO%^l3QYf[o`Oy%^z!Q%^!Q![3p![!c%^!c!i3p!i#T%^#T#Z3p#Z;'S%^;'S;=`%o<%lO%^l3uYo`Oy%^z!Q%^!Q![4e![!c%^!c!i4e!i#T%^#T#Z4e#Z;'S%^;'S;=`%o<%lO%^l4lYf[o`Oy%^z!Q%^!Q![5[![!c%^!c!i5[!i#T%^#T#Z5[#Z;'S%^;'S;=`%o<%lO%^l5aYo`Oy%^z!Q%^!Q![6P![!c%^!c!i6P!i#T%^#T#Z6P#Z;'S%^;'S;=`%o<%lO%^l6WSf[o`Oy%^z;'S%^;'S;=`%o<%lO%^d6gUOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^d7QS|So`Oy%^z;'S%^;'S;=`%o<%lO%^b7cSXQOy%^z;'S%^;'S;=`%o<%lO%^~7rWOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W<%lO7o~8_RO;'S7o;'S;=`8h;=`O7o~8kXOY7oZw7owx.nx#O7o#O#P8[#P;'S7o;'S;=`9W;=`<%l7o<%lO7o~9ZP;=`<%l7on9cSb^Oy%^z;'S%^;'S;=`%o<%lO%^~9tOa~n9{UUQjWOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^n:fWjW!RQOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l<cYo`Oy%^z{%^{|=R|}%^}!O=R!O!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=WUo`Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l=qUo`#e[Oy%^z!Q%^!Q![=j![;'S%^;'S;=`%o<%lO%^l>[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[R,I,L,1,2,3,4,new p("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>z[e]||-1},{term:58,get:e=>B[e]||-1},{term:101,get:e=>j[e]||-1}],tokenPrec:1200});var V=i(9119);let W=null;function $(){if(!W&&"object"==typeof document&&document.body){let{style:e}=document.body,t=[],i=new Set;for(let n in e)"cssText"!=n&&"cssFloat"!=n&&"string"==typeof e[n]&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))),i.has(n)||(t.push(n),i.add(n)));W=t.sort().map((e=>({type:"property",label:e})))}return W||[]}const Q=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((e=>({type:"class",label:e}))),H=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((e=>({type:"keyword",label:e}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((e=>({type:"constant",label:e})))),q=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((e=>({type:"type",label:e}))),Z=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map((e=>({type:"keyword",label:e}))),U=/^(\w[\w-]*|-\w[\w-]*|)$/,X=/^-(-[\w-]*)?$/,J=new n.hr,Y=["Declaration"];function K(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function G(e,t,i){if(t.to-t.from>4096){let r=J.get(t);if(r)return r;let o=[],s=new Set,a=t.cursor(n.vj.IncludeAnonymous);if(a.firstChild())do{for(let t of G(e,a.node,i))s.has(t.label)||(s.add(t.label),o.push(t))}while(a.nextSibling());return J.set(t,o),o}{let n=[],r=new Set;return t.cursor().iterate((t=>{var o;if(i(t)&&t.matchContext(Y)&&":"==(null===(o=t.node.nextSibling)||void 0===o?void 0:o.name)){let i=e.sliceString(t.from,t.to);r.has(i)||(r.add(i),n.push({label:i,type:"variable"}))}})),n}}const ee=e=>t=>{let{state:i,pos:n}=t,r=(0,V.qz)(i).resolveInner(n,-1),o=r.type.isError&&r.from==r.to-1&&"-"==i.doc.sliceString(r.from,r.to);if("PropertyName"==r.name||(o||"TagName"==r.name)&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:$(),validFor:U};if("ValueName"==r.name)return{from:r.from,options:H,validFor:U};if("PseudoClassName"==r.name)return{from:r.from,options:Q,validFor:U};if(e(r)||(t.explicit||o)&&function(e,t){var i;if(("("==e.name||e.type.isError)&&(e=e.parent||e),"ArgList"!=e.name)return!1;let n=null===(i=e.parent)||void 0===i?void 0:i.firstChild;return"Callee"==(null==n?void 0:n.name)&&"var"==t.sliceString(n.from,n.to)}(r,i.doc))return{from:e(r)||o?r.from:n,options:G(i.doc,K(r),e),validFor:X};if("TagName"==r.name){for(let{parent:e}=r;e;e=e.parent)if("Block"==e.name)return{from:r.from,options:$(),validFor:U};return{from:r.from,options:q,validFor:U}}if("AtKeyword"==r.name)return{from:r.from,options:Z,validFor:U};if(!t.explicit)return null;let s=r.resolve(n),a=s.childBefore(n);return a&&":"==a.name&&"PseudoClassSelector"==s.name?{from:n,options:Q,validFor:U}:a&&":"==a.name&&"Declaration"==s.name||"ArgList"==s.name?{from:n,options:H,validFor:U}:"Block"==s.name||"Styles"==s.name?{from:n,options:$(),validFor:U}:null},te=ee((e=>"VariableName"==e.name)),ie=V.qp.define({name:"css",parser:F.configure({props:[V.uj.add({Declaration:(0,V.tC)()}),V.x0.add({"Block KeyframeList":V.Dv})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function ne(){return new V.ri(ie,ie.data.of({autocomplete:te}))}},9119:function(e,t,i){i.d(t,{Dv:function(){return V},Gn:function(){return M},K0:function(){return P},Qf:function(){return he},R_:function(){return ve},SS:function(){return A},Um:function(){return Pe},c:function(){return C},e7:function(){return G},mi:function(){return le},n$:function(){return Oe},nF:function(){return fe},nY:function(){return B},qp:function(){return p},qz:function(){return f},ri:function(){return S},tC:function(){return z},uj:function(){return E},x0:function(){return F},y1:function(){return T}});var n,r=i(1113),o=i(8120),s=i(6485),a=i(5524),l=i(8699);const c=new r.md;const h=new r.md;class u{constructor(e,t,i=[],n=""){this.data=e,this.name=n,o.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(o.yy.prototype,"tree",{get(){return f(this)}}),this.parser=t,this.extension=[_.of(this),o.yy.languageData.of(((e,t,i)=>{let n=d(e,t,i),r=n.type.prop(c);if(!r)return[];let o=e.facet(r),s=n.type.prop(h);if(s){let r=n.resolve(t-n.from,i);for(let t of s)if(t.test(r,e)){let i=e.facet(t.facet);return"replace"==t.type?i:i.concat(o)}}return o}))].concat(i)}isActiveAt(e,t,i=-1){return d(e,t,i).type.prop(c)==this.data}findRegions(e){let t=e.facet(_);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(e,t)=>{if(e.prop(c)==this.data)return void i.push({from:t,to:t+e.length});let o=e.prop(r.md.mounted);if(o){if(o.tree.prop(c)==this.data){if(o.overlay)for(let e of o.overlay)i.push({from:e.from+t,to:e.to+t});else i.push({from:t,to:t+e.length});return}if(o.overlay){let e=i.length;if(n(o.tree,o.overlay[0].from+t),i.length>e)return}}for(let i=0;i<e.children.length;i++){let o=e.children[i];o instanceof r.mp&&n(o,e.positions[i]+t)}};return n(f(e),0),i}get allowsNesting(){return!0}}function d(e,t,i){let n=e.facet(_),o=f(e).topNode;if(!n||n.allowsNesting)for(let e=o;e;e=e.enter(t,i,r.vj.ExcludeBuffers))e.type.isTop&&(o=e);return o}u.setState=o.Py.define();class p extends(571==i.j?u:null){constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=(i=e.languageData,o.r$.define({combine:i?e=>e.concat(i):void 0}));var i;return new p(t,e.parser.configure({props:[c.add((e=>e.isTop?t:void 0))]}),e.name)}configure(e,t){return new p(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function f(e){let t=e.field(u.state,!1);return t?t.tree:r.mp.empty}class m{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let g=null;class v{constructor(e,t,i=[],n,r,o,s,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=s,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new v(e,t,[],r.mp.empty,0,i,[],null)}startParse(){return this.parser.startParse(new m(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=r.mp.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(r.i9.addTree(n,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(i=this.parse.stoppedAt)&&void 0!==i?i:this.state.doc.length,this.tree=n,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}}))}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=g;g=this;try{return e()}finally{g=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=y(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,i,n,r)=>t.push({fromA:e,toA:i,fromB:n,toB:r}))),i=r.i9.applyChanges(i,t),n=r.mp.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let t of this.skipped){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);i<n&&a.push({from:i,to:n})}}}return new v(this.parser,t,i,n,o,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:i,to:n}=this.skipped[t];i<e.to&&n>e.from&&(this.fragments=y(this.fragments,i,n),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends r._b{createParse(t,i,n){let o=n[0].from,s=n[n.length-1].to;return{parsedPos:o,advance(){let t=g;if(t){for(let e of n)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new r.mp(r.Jq.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return g}}function y(e,t,i){return r.i9.applyChanges(e,[{fromA:t,toA:i,fromB:t,toB:i}])}class b{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new b(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=v.create(e.facet(_).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new b(i)}}u.state=o.QQ.define({create:b.init,update(e,t){for(let e of t.effects)if(e.is(u.setState))return e.value;return t.startState.facet(_)!=t.state.facet(_)?b.init(t.state):e.apply(t)}});let w=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(w=e=>{let t=-1,i=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(i):cancelIdleCallback(t)});const k="undefined"!=typeof navigator&&(null===(n=navigator.scheduling)||void 0===n?void 0:n.isInputPending)?()=>navigator.scheduling.isInputPending():null,x=s.lg.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(u.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(u.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=w(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,r=i.field(u.state);if(r.tree==r.context.tree&&r.context.isDone(n+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!k?Math.max(25,e.timeRemaining()-5):1e9),s=r.context.treeLen<n&&i.doc.length>n+1e3,a=r.context.work((()=>k&&k()||Date.now()>o),n+(s?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:u.setState.of(new b(r.context))})),this.chunkBudget>0&&(!a||s)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>(0,s.OO)(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_=o.r$.define({combine(e){return e.length?e[0]:null},enables:e=>[u.state,x,s.tk.contentAttributes.compute([e],(t=>{let i=t.facet(e);return i&&i.name?{"data-language":i.name}:{}}))]});class S{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const O=571==i.j?o.r$.define():null,C=o.r$.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function T(e){let t=e.facet(C);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function A(e,t){let i="",n=e.tabSize,r=e.facet(C)[0];if("\t"==r){for(;t>=n;)i+="\t",t-=n;r=" "}for(let e=0;e<t;e++)i+=r;return i}function P(e,t){e instanceof o.yy&&(e=new M(e));for(let i of e.state.facet(O)){let n=i(e,t);if(void 0!==n)return n}let i=f(e.state);return i.length>=t?function(e,t,i){let n=t.resolveStack(i),r=n.node.enterUnfinishedNodesBefore(i);if(r!=n.node){let e=[];for(let t=r;t!=n.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)n={node:e[t],next:n}}return D(n,e,i)}(e,i,t):null}class M{constructor(e,t={}){this.state=e,this.options=t,this.unit=T(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return null!=n&&n>=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n<e:n<=e)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(e,t);return i.slice(e-n,Math.min(i.length,e+100-n))}column(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.countColumn(i,e-n),o=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return(0,o.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(n);if(e>-1)return e}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const E=new r.md;function D(e,t,i){for(let n=e;n;n=n.next){let e=L(n.node);if(e)return e(I.create(t,i,n))}return 0}function L(e){let t=e.type.prop(E);if(t)return t;let i,n=e.firstChild;if(n&&(i=n.type.prop(r.md.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>function(e,t,i,n,r){let o=e.textAfter,s=o.match(/^\s*/)[0].length,a=n&&o.slice(s,s+n.length)==n||r==e.pos+s,l=t?function(e){let t=e.node,i=t.childAfter(t.from),n=t.lastChild;if(!i)return null;let r=e.options.simulateBreak,o=e.state.doc.lineAt(i.from),s=null==r||r<=o.from?o.to:Math.min(o.to,r);for(let e=i.to;;){let r=t.childAfter(e);if(!r||r==n)return null;if(!r.type.isSkipped)return r.from<s?i:null;e=r.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*i)}(e,!0,1,void 0,n&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?R:null}function R(){return 0}class I extends(571==i.j?M:null){constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new I(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(N(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return D(this.context.next,this.base,this.pos)}}function N(e,t){for(let i=t;i;i=i.parent)if(e==i)return!0;return!1}function z({except:e,units:t=1}={}){return i=>{let n=e&&e.test(i.textAfter);return i.baseIndent+(n?0:t*i.unit)}}function B(){return o.yy.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let i=e.newDoc,{head:n}=e.newSelection.main,r=i.lineAt(n);if(n>r.from+200)return e;let o=i.sliceString(r.from,n);if(!t.some((e=>e.test(o))))return e;let{state:s}=e,a=-1,l=[];for(let{head:e}of s.selection.ranges){let t=s.doc.lineAt(e);if(t.from==a)continue;a=t.from;let i=P(s,t.from);if(null==i)continue;let n=/^\s*/.exec(t.text)[0],r=A(s,i);n!=r&&l.push({from:t.from,to:t.from+n.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e}))}const j=o.r$.define(),F=new r.md;function V(e){let t=e.firstChild,i=e.lastChild;return t&&t.to<i.from?{from:t.to,to:i.type.isError?e.to:i.from}:null}function W(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function $(e,t,i){for(let n of e.facet(j)){let r=n(e,t,i);if(r)return r}return function(e,t,i){let n=f(e);if(n.length<i)return null;let r=null;for(let o=n.resolveStack(i,1);o;o=o.next){let s=o.node;if(s.to<=i||s.from>i)continue;if(r&&s.from<t)break;let a=s.type.prop(F);if(a&&(s.to<n.length-50||n.length==e.doc.length||!W(s))){let n=a(s,e);n&&n.from<=i&&n.from>=t&&n.to>i&&(r=n)}}return r}(e,t,i)}function Q(e,t){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);return i>=n?void 0:{from:i,to:n}}const H=o.Py.define({map:Q}),q=o.Py.define({map:Q});function Z(e){let t=[];for(let{head:i}of e.state.selection.ranges)t.some((e=>e.from<=i&&e.to>=i))||t.push(e.lineBlockAt(i));return t}const U=o.QQ.define({create(){return s.p.none},update(e,t){e=e.map(t.changes);for(let i of t.effects)if(i.is(H)&&!J(e,i.value.from,i.value.to)){let{preparePlaceholder:n}=t.state.facet(te),r=n?s.p.replace({widget:new oe(n(t.state,i.value))}):re;e=e.update({add:[r.range(i.value.from,i.value.to)]})}else i.is(q)&&(e=e.update({filter:(e,t)=>i.value.from!=e||i.value.to!=t,filterFrom:i.value.from,filterTo:i.value.to}));if(t.selection){let i=!1,{head:n}=t.selection.main;e.between(n,n,((e,t)=>{e<n&&t>n&&(i=!0)})),i&&(e=e.update({filterFrom:n,filterTo:n,filter:(e,t)=>t<=n||e>=n}))}return e},provide:e=>s.tk.decorations.from(e),toJSON(e,t){let i=[];return e.between(0,t.doc.length,((e,t)=>{i.push(e,t)})),i},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let i=0;i<e.length;){let n=e[i++],r=e[i++];if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid JSON for fold state");t.push(re.range(n,r))}return s.p.set(t,!0)}});function X(e,t,i){var n;let r=null;return null===(n=e.field(U,!1))||void 0===n||n.between(t,i,((e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})})),r}function J(e,t,i){let n=!1;return e.between(t,t,((e,r)=>{e==t&&r==i&&(n=!0)})),n}function Y(e,t){return e.field(U,!1)?t:t.concat(o.Py.appendConfig.of(ie()))}function K(e,t,i=!0){let n=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return s.tk.announce.of(`${e.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${e.state.phrase("to")} ${r}.`)}const G=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Z(e)){let i=$(e.state,t.from,t.to);if(i)return e.dispatch({effects:Y(e.state,[H.of(i),K(e,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(U,!1))return!1;let t=[];for(let i of Z(e)){let n=X(e.state,i.from,i.to);n&&t.push(q.of(n),K(e,n,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,i=[];for(let n=0;n<t.doc.length;){let r=e.lineBlockAt(n),o=$(t,r.from,r.to);o&&i.push(H.of(o)),n=(o?e.lineBlockAt(o.to):r).to+1}return i.length&&e.dispatch({effects:Y(e.state,i)}),!!i.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(U,!1);if(!t||!t.size)return!1;let i=[];return t.between(0,e.state.doc.length,((e,t)=>{i.push(q.of({from:e,to:t}))})),e.dispatch({effects:i}),!0}}],ee={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},te=o.r$.define({combine(e){return(0,o.BO)(e,ee)}});function ie(e){let t=[U,ce];return e&&t.push(te.of(e)),t}function ne(e,t){let{state:i}=e,n=i.facet(te),r=t=>{let i=e.lineBlockAt(e.posAtDOM(t.target)),n=X(e.state,i.from,i.to);n&&e.dispatch({effects:q.of(n)}),t.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(e,r,t);let o=document.createElement("span");return o.textContent=n.placeholderText,o.setAttribute("aria-label",i.phrase("folded code")),o.title=i.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=r,o}const re=s.p.replace({widget:new class extends s.l9{toDOM(e){return ne(e,null)}}});class oe extends s.l9{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ne(e,this.value)}}const se={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ae extends(571==i.j?s.SJ:null){constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function le(e={}){let t=Object.assign(Object.assign({},se),e),i=new ae(t,!0),n=new ae(t,!1),r=s.lg.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(_)!=e.state.facet(_)||e.startState.field(U,!1)!=e.state.field(U,!1)||f(e.startState)!=f(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new o.f_;for(let r of e.viewportLineBlocks){let o=X(e.state,r.from,r.to)?n:$(e.state,r.from,r.to)?i:null;o&&t.add(r.from,r.from,o)}return t.finish()}}),{domEventHandlers:a}=t;return[r,(0,s.v5)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||o.Xs.empty},initialSpacer(){return new ae(t,!1)},domEventHandlers:Object.assign(Object.assign({},a),{click:(e,t,i)=>{if(a.click&&a.click(e,t,i))return!0;let n=X(e.state,t.from,t.to);if(n)return e.dispatch({effects:q.of(n)}),!0;let r=$(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:H.of(r)}),!0)}})}),ie()]}const ce=s.tk.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class he{constructor(e,t){let i;function n(e){let t=l.V.newName();return(i||(i=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?n(t.all):void 0,o=t.scope;this.scope=o instanceof u?e=>e.prop(c)==o.data:o?e=>e==o:void 0,this.style=(0,a.QR)(e.map((e=>({tag:e.tag,class:e.class||n(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=i?new l.V(i):null,this.themeType=t.themeType}static define(e,t){return new he(e,t||{})}}const ue=o.r$.define(),de=o.r$.define({combine(e){return e.length?[e[0]]:null}});function pe(e){let t=e.facet(ue);return t.length?t:e.facet(de)}function fe(e,t){let i,n=[ge];return e instanceof he&&(e.module&&n.push(s.tk.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(de.of(e)):i?n.push(ue.computeN([s.tk.darkTheme],(t=>t.facet(s.tk.darkTheme)==("dark"==i)?[e]:[]))):n.push(ue.of(e)),n}class me{constructor(e){this.markCache=Object.create(null),this.tree=f(e.state),this.decorations=this.buildDeco(e,pe(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=f(e.state),i=pe(e.state),n=i!=pe(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!n&&t.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return s.p.none;let i=new o.f_;for(let{from:n,to:r}of e.visibleRanges)(0,a.bW)(this.tree,t,((e,t,n)=>{i.add(e,t,this.markCache[n]||(this.markCache[n]=s.p.mark({class:n})))}),n,r);return i.finish()}}const ge=o.Wl.high(s.lg.fromClass(me,{decorations:e=>e.decorations})),ve=he.define([{tag:a.pJ.meta,color:"#404740"},{tag:a.pJ.link,textDecoration:"underline"},{tag:a.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.pJ.emphasis,fontStyle:"italic"},{tag:a.pJ.strong,fontWeight:"bold"},{tag:a.pJ.strikethrough,textDecoration:"line-through"},{tag:a.pJ.keyword,color:"#708"},{tag:[a.pJ.atom,a.pJ.bool,a.pJ.url,a.pJ.contentSeparator,a.pJ.labelName],color:"#219"},{tag:[a.pJ.literal,a.pJ.inserted],color:"#164"},{tag:[a.pJ.string,a.pJ.deleted],color:"#a11"},{tag:[a.pJ.regexp,a.pJ.escape,a.pJ.special(a.pJ.string)],color:"#e40"},{tag:a.pJ.definition(a.pJ.variableName),color:"#00f"},{tag:a.pJ.local(a.pJ.variableName),color:"#30a"},{tag:[a.pJ.typeName,a.pJ.namespace],color:"#085"},{tag:a.pJ.className,color:"#167"},{tag:[a.pJ.special(a.pJ.variableName),a.pJ.macroName],color:"#256"},{tag:a.pJ.definition(a.pJ.propertyName),color:"#00c"},{tag:a.pJ.comment,color:"#940"},{tag:a.pJ.invalid,color:"#f00"}]),ye=s.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),be="()[]{}",we=o.r$.define({combine(e){return(0,o.BO)(e,{afterCursor:!0,brackets:be,maxScanDistance:1e4,renderMatch:_e})}}),ke=s.p.mark({class:"cm-matchingBracket"}),xe=s.p.mark({class:"cm-nonmatchingBracket"});function _e(e){let t=[],i=e.matched?ke:xe;return t.push(i.range(e.start.from,e.start.to)),e.end&&t.push(i.range(e.end.from,e.end.to)),t}const Se=[o.QQ.define({create(){return s.p.none},update(e,t){if(!t.docChanged&&!t.selection)return e;let i=[],n=t.state.facet(we);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=Pe(t.state,e.head,-1,n)||e.head>0&&Pe(t.state,e.head-1,1,n)||n.afterCursor&&(Pe(t.state,e.head,1,n)||e.head<t.state.doc.length&&Pe(t.state,e.head+1,-1,n));r&&(i=i.concat(n.renderMatch(r,t.state)))}return s.p.set(i,!0)},provide:e=>s.tk.decorations.from(e)}),ye];function Oe(e={}){return[we.of(e),Se]}const Ce=new r.md;function Te(e,t,i){let n=e.prop(t<0?r.md.openedBy:r.md.closedBy);if(n)return n;if(1==e.name.length){let n=i.indexOf(e.name);if(n>-1&&n%2==(t<0?1:0))return[i[n+t]]}return null}function Ae(e){let t=e.type.prop(Ce);return t?t(e.node):e}function Pe(e,t,i,n={}){let r=n.maxScanDistance||1e4,o=n.brackets||be,s=f(e),a=s.resolveInner(t,i);for(let e=a;e;e=e.parent){let n=Te(e.type,i,o);if(n&&e.from<e.to){let r=Ae(e);if(r&&(i>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return Me(0,0,i,e,r,n,o)}}return function(e,t,i,n,r,o,s){let a=i<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=s.indexOf(a);if(l<0||l%2==0!=i>0)return null;let c={from:i<0?t-1:t,to:i>0?t+1:t},h=e.doc.iterRange(t,i>0?e.doc.length:0),u=0;for(let e=0;!h.next().done&&e<=o;){let o=h.value;i<0&&(e+=o.length);let a=t+e*i;for(let e=i>0?0:o.length-1,t=i>0?o.length:-1;e!=t;e+=i){let t=s.indexOf(o[e]);if(!(t<0||n.resolveInner(a+e,1).type!=r))if(t%2==0==i>0)u++;else{if(1==u)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};u--}}i>0&&(e+=o.length)}return h.done?{start:c,matched:!1}:null}(e,t,i,s,a.type,r,o)}function Me(e,t,i,n,r,o,s){let a=n.parent,l={from:r.from,to:r.to},c=0,h=null==a?void 0:a.cursor();if(h&&(i<0?h.childBefore(n.from):h.childAfter(n.to)))do{if(i<0?h.to<=n.from:h.from>=n.to){if(0==c&&o.indexOf(h.type.name)>-1&&h.from<h.to){let e=Ae(h);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(Te(h.type,i,s))c++;else if(Te(h.type,-i,s)){if(0==c){let e=Ae(h);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}c--}}}while(i<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}const Ee=Object.create(null),De=[r.Jq.none],Le=[],Re=Object.create(null),Ie=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Ie[e]=ze(Ee,t);function Ne(e,t){Le.indexOf(e)>-1||(Le.push(e),console.warn(t))}function ze(e,t){let i=[];for(let n of t.split(" ")){let t=[];for(let i of n.split(".")){let n=e[i]||a.pJ[i];n?"function"==typeof n?t.length?t=t.map(n):Ne(i,`Modifier ${i} used at start of tag`):t.length?Ne(i,`Tag ${i} used as modifier`):t=Array.isArray(n)?n:[n]:Ne(i,`Unknown highlighting tag ${i}`)}for(let e of t)i.push(e)}if(!i.length)return 0;let n=t.replace(/ /g,"_"),o=n+" "+i.map((e=>e.id)),s=Re[o];if(s)return s.id;let l=Re[o]=r.Jq.define({id:De.length,name:n,props:[(0,a.Gv)({[n]:i})]});return De.push(l),l.id}s.Nm.RTL,s.Nm.LTR},8519:function(e,t,i){i.d(t,{Fv:function(){return v}});var n=i(6485),r=i(8120),o=i(8580);class s{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class a{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=e,o=i.facet(y).markerFilter;o&&(r=o(r,i));let s=n.p.set(r.map((e=>e.from==e.to||e.from==e.to-1&&i.doc.lineAt(e.from).to==e.from?n.p.widget({widget:new k(e),diagnostic:e}).range(e.from):n.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new a(s,t,l(s))}}function l(e,t=null,i=0){let n=null;return e.between(i,1e9,((e,i,{spec:r})=>{if(!t||r.diagnostic==t)return n=new s(e,i,r.diagnostic),!1})),n}const c=r.Py.define(),h=r.Py.define(),u=r.Py.define(),d=r.QQ.define({create(){return new a(n.p.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let i=e.diagnostics.map(t.changes),n=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);n=l(i,e.selected.diagnostic,r)||l(i,null,r)}!i.size&&r&&t.state.facet(y).autoPanel&&(r=null),e=new a(i,r,n)}for(let i of t.effects)if(i.is(c)){let n=t.state.facet(y).autoPanel?i.value.length?_.open:null:e.panel;e=a.init(i.value,n,t.state)}else i.is(h)?e=new a(e.diagnostics,i.value?_.open:null,e.selected):i.is(u)&&(e=new a(e.diagnostics,e.panel,i.value));return e},provide:e=>[n.mH.from(e,(e=>e.panel)),n.tk.decorations.from(e,(e=>e.diagnostics))]}),p=n.p.mark({class:"cm-lintRange cm-lintRange-active"});function f(e,t,i){let{diagnostics:n}=e.state.field(d),r=[],o=2e8,s=0;n.between(t-(i<0?1:0),t+(i>0?1:0),((e,n,{spec:a})=>{t>=e&&t<=n&&(e==n||(t>e||i>0)&&(t<n||i<0))&&(r.push(a.diagnostic),o=Math.min(e,o),s=Math.max(n,s))}));let a=e.state.facet(y).tooltipFilter;return a&&(r=a(r,e.state)),r.length?{pos:o,end:s,above:e.state.doc.lineAt(o).to<s,create(){return{dom:m(e,r)}}}:null}function m(e,t){return(0,o.Z)("ul",{class:"cm-tooltip-lint"},t.map((t=>w(e,t,!1))))}const g=e=>{let t=e.state.field(d,!1);return!(!t||!t.panel||(e.dispatch({effects:h.of(!1)}),0))},v=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(d,!1);var i,o;t&&t.panel||e.dispatch({effects:(i=e.state,o=[h.of(!0)],i.field(d,!1)?o:o.concat(r.Py.appendConfig.of(T)))});let s=(0,n.Sd)(e,_.open);return s&&s.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(d,!1);if(!t)return!1;let i=e.state.selection.main,n=t.diagnostics.iter(i.to+1);return!(!n.value&&(n=t.diagnostics.iter(0),!n.value||n.from==i.from&&n.to==i.to)||(e.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),0))}}],y=r.r$.define({combine(e){return Object.assign({sources:e.map((e=>e.source)).filter((e=>null!=e))},(0,r.BO)(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function b(e){let t=[];if(e)e:for(let{name:i}of e){for(let e=0;e<i.length;e++){let n=i[e];if(/[a-zA-Z]/.test(n)&&!t.some((e=>e.toLowerCase()==n.toLowerCase()))){t.push(n);continue e}}t.push("")}return t}function w(e,t,i){var n;let r=i?b(t.actions):[];return(0,o.Z)("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},(0,o.Z)("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(n=t.actions)||void 0===n?void 0:n.map(((i,n)=>{let s=!1,a=n=>{if(n.preventDefault(),s)return;s=!0;let r=l(e.state.field(d).diagnostics,t);r&&i.apply(e,r.from,r.to)},{name:c}=i,h=r[n]?c.indexOf(r[n]):-1,u=h<0?c:[c.slice(0,h),(0,o.Z)("u",c.slice(h,h+1)),c.slice(h+1)];return(0,o.Z)("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${r[n]})"`}.`},u)})),t.source&&(0,o.Z)("div",{class:"cm-diagnosticSource"},t.source))}class k extends n.l9{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return(0,o.Z)("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class x{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=w(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _{constructor(e){this.view=e,this.items=[],this.list=(0,o.Z)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)g(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],n=b(i.actions);for(let r=0;r<n.length;r++)if(n[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=l(this.view.state.field(d).diagnostics,i);t&&i.actions[r].apply(e,t.from,t.to)}}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=(0,o.Z)("div",{class:"cm-panel-lint"},this.list,(0,o.Z)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>g(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(d).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(d),i=0,n=!1,r=null;for(e.between(0,this.view.state.doc.length,((e,o,{spec:s})=>{let a,l=-1;for(let e=i;e<this.items.length;e++)if(this.items[e].diagnostic==s.diagnostic){l=e;break}l<0?(a=new x(this.view,s.diagnostic),this.items.splice(i,0,a),n=!0):(a=this.items[l],l>i&&(this.items.splice(i,l-i),n=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),i++}));i<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)n=!0,this.items.pop();0==this.items.length&&(this.items.push(new x(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),n=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let i=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/i:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=l(this.view.state.field(d).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:u.of(t)})}static open(e){return new _(e)}}function S(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const O=n.tk.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:S("#d11")},".cm-lintRange-warning":{backgroundImage:S("orange")},".cm-lintRange-info":{backgroundImage:S("#999")},".cm-lintRange-hint":{backgroundImage:S("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});class C extends n.SJ{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>severityWeight(e)<severityWeight(t.severity)?t.severity:e),"hint")}toDOM(e){let t=document.createElement("div");t.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,n=e.state.facet(lintGutterConfig).tooltipFilter;return n&&n(i,e.state),i.length&&(t.onmouseover=()=>function(e,t,i){function n(){let n=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(n.from)&&e.dispatch({effects:setLintGutterTooltip.of({pos:n.from,above:!1,create(){return{dom:m(e,i),getCoords:()=>t.getBoundingClientRect()}}})}),t.onmouseout=t.onmousemove=null,function(e,t){let i=n=>{let r=t.getBoundingClientRect();if(!(n.clientX>r.left-10&&n.clientX<r.right+10&&n.clientY>r.top-10&&n.clientY<r.bottom+10)){for(let e=n.target;e;e.parentNode)if(1==e.nodeType&&e.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",i),e.state.field(lintGutterTooltip)&&e.dispatch({effects:setLintGutterTooltip.of(null)})}};window.addEventListener("mousemove",i)}(e,t)}let{hoverTime:r}=e.state.facet(lintGutterConfig),o=setTimeout(n,r);t.onmouseout=()=>{clearTimeout(o),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(o),setTimeout(n,r)}}(e,t,i)),t}}const T=[d,n.tk.decorations.compute([d],(e=>{let{selected:t,panel:i}=e.field(d);return t&&i&&t.from!=t.to?n.p.set([p.range(t.from,t.to)]):n.p.none})),(0,n.bF)(f,{hideOn:function(e,t){let i=t.pos,n=t.end||i,r=e.state.facet(y).hideOn(e,i,n);if(null!=r)return r;let o=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(c)))&&!e.changes.touchesRange(o.from,Math.max(o.to,n)))}}),O]},9892:function(e,t,i){i.d(t,{Lp:function(){return te},sW:function(){return k}});var n=i(6485),r=i(8120),o=i(8580);const s="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class a{constructor(e,t,i=0,n=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?e=>r(s(e)):s,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return(0,r.gm)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,r.bg)(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=(0,r.nZ)(e);let n=this.normalize(t);for(let e=0,r=i;;e++){let o=n.charCodeAt(e),s=this.match(o,r,this.bufferPos+this.bufferStart);if(e==n.length-1){if(s)return this.value=s,this;break}r==i&&e<t.length&&t.charCodeAt(e)==o&&r++}}}match(e,t,i){let n=null;for(let t=0;t<this.matches.length;t+=2){let r=this.matches[t],o=!1;this.query.charCodeAt(r)==e&&(r==this.query.length-1?n={from:this.matches[t+1],to:i}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?n={from:t,to:i}:this.matches.push(1,t)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}}"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=function(){return this});const l={from:-1,to:-1,match:/.*/.exec("")},c="gm"+(null==/x/.unicode?"":"u");class h{constructor(e,t,i,n=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=l,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new p(e,t,i,n,r);this.re=new RegExp(t,c+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=e.iter();let o=e.lineAt(n);this.curLineStart=o.from,this.matchPos=f(e,n),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=f(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<n||i>this.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const u=new WeakMap;class d{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let n=u.get(e);if(!n||n.from>=i||n.to<=t){let n=new d(t,e.sliceString(t,i));return u.set(e,n),n}if(n.from==t&&n.to==i)return n;let{text:r,from:o}=n;return o>t&&(r=e.sliceString(t,o)+r,o=t),n.to<i&&(r+=e.sliceString(n.to,i)),u.set(e,new d(o,r)),new d(t,r.slice(t-o,i-o))}}class p{constructor(e,t,i,n,r){this.text=e,this.to=r,this.done=!1,this.value=l,this.matchPos=f(e,n),this.re=new RegExp(t,c+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=d.get(e,n,this.chunkEnd(n+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,i=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,i,t)))return this.value={from:e,to:i,match:t},this.matchPos=f(this.text,i+(e==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=d.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function f(e,t){if(t>=e.length)return t;let i,n=e.lineAt(t);for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}function m(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),i=(0,o.Z)("input",{class:"cm-textfield",name:"line",value:t});function s(){let t=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(i.value);if(!t)return;let{state:o}=e,s=o.doc.lineAt(o.selection.main.head),[,a,l,c,h]=t,u=c?+c.slice(1):0,d=l?+l:s.number;if(l&&h){let e=d/100;a&&(e=e*("-"==a?-1:1)+s.number/o.doc.lines),d=Math.round(o.doc.lines*e)}else l&&a&&(d=d*("-"==a?-1:1)+s.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),f=r.jT.cursor(p.from+Math.max(0,Math.min(u,p.length)));e.dispatch({effects:[g.of(!1),n.tk.scrollIntoView(f.from,{y:"center"})],selection:f}),e.focus()}return{dom:(0,o.Z)("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:g.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),s())},onsubmit:e=>{e.preventDefault(),s()}},(0,o.Z)("label",e.state.phrase("Go to line"),": ",i)," ",(0,o.Z)("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(h.prototype[Symbol.iterator]=p.prototype[Symbol.iterator]=function(){return this});const g=r.Py.define(),v=r.QQ.define({create(){return!0},update(e,t){for(let i of t.effects)i.is(g)&&(e=i.value);return e},provide:e=>n.mH.from(e,(e=>e?m:null))}),y=n.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),b={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},w=r.r$.define({combine(e){return(0,r.BO)(e,b,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function k(e){let t=[C,O];return e&&t.push(w.of(e)),t}const x=n.p.mark({class:"cm-selectionMatch"}),_=n.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function S(e,t,i,n){return!(0!=i&&e(t.sliceDoc(i-1,i))==r.D0.Word||n!=t.doc.length&&e(t.sliceDoc(n,n+1))==r.D0.Word)}const O=n.lg.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(w),{state:i}=e,o=i.selection;if(o.ranges.length>1)return n.p.none;let s,l=o.main,c=null;if(l.empty){if(!t.highlightWordAroundCursor)return n.p.none;let e=i.wordAt(l.head);if(!e)return n.p.none;c=i.charCategorizer(l.head),s=i.sliceDoc(e.from,e.to)}else{let e=l.to-l.from;if(e<t.minSelectionLength||e>200)return n.p.none;if(t.wholeWords){if(s=i.sliceDoc(l.from,l.to),c=i.charCategorizer(l.head),!S(c,i,l.from,l.to)||!function(e,t,i,n){return e(t.sliceDoc(i,i+1))==r.D0.Word&&e(t.sliceDoc(n-1,n))==r.D0.Word}(c,i,l.from,l.to))return n.p.none}else if(s=i.sliceDoc(l.from,l.to),!s)return n.p.none}let h=[];for(let r of e.visibleRanges){let e=new a(i.doc,s,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!c||S(c,i,r,o))&&(l.empty&&r<=l.from&&o>=l.to?h.push(_.range(r,o)):(r>=l.to||o<=l.from)&&h.push(x.range(r,o)),h.length>t.maxMatches))return n.p.none}}return n.p.set(h)}},{decorations:e=>e.decorations}),C=n.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),T=r.r$.define({combine(e){return(0,r.BO)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ie(e),scrollToMatch:e=>n.tk.scrollIntoView(e)})}});class A{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,c),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new I(this):new E(this)}getCursor(e,t=0,i){let n=e.doc?e:r.yy.create({doc:e});return null==i&&(i=n.doc.length),this.regexp?D(this,n,t,i):M(this,n,t,i)}}class P{constructor(e){this.spec=e}}function M(e,t,i,n){return new a(t.doc,e.unquoted,i,n,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(o=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,i,n)=>((n>e||n+i.length<t)&&(n=Math.max(0,e-2),i=o.sliceString(n,Math.min(o.length,t+2))),!(s(L(i,e-n))==r.D0.Word&&s(R(i,e-n))==r.D0.Word||s(R(i,t-n))==r.D0.Word&&s(L(i,t-n))==r.D0.Word))):void 0);var o,s}class E extends P{constructor(e){super(e)}nextMatch(e,t,i){let n=M(this.spec,e,i,e.doc.length).nextOverlapping();return n.done&&(n=M(this.spec,e,0,t).nextOverlapping()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=i;;){let i=Math.max(t,n-1e4-this.spec.unquoted.length),r=M(this.spec,e,i,n),o=null;for(;!r.nextOverlapping().done;)o=r.value;if(o)return o;if(i==t)return null;n-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=M(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=M(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function D(e,t,i,n){return new h(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(o=t.charCategorizer(t.selection.main.head),(e,t,i)=>!i[0].length||(o(L(i.input,i.index))!=r.D0.Word||o(R(i.input,i.index))!=r.D0.Word)&&(o(R(i.input,i.index+i[0].length))!=r.D0.Word||o(L(i.input,i.index+i[0].length))!=r.D0.Word)):void 0},i,n);var o}function L(e,t){return e.slice((0,r.cp)(e,t,!1),t)}function R(e,t){return e.slice(t,(0,r.cp)(e,t))}class I extends P{nextMatch(e,t,i){let n=D(this.spec,e,i,e.doc.length).next();return n.done&&(n=D(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-1e4*n),o=D(this.spec,e,r,i),s=null;for(;!o.next().done;)s=o.value;if(s&&(r==t||s.from>r+10))return s;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,i)=>"$"==i?"$":"&"==i?e.match[0]:"0"!=i&&+i<e.match.length?e.match[i]:t))}matchAll(e,t){let i=D(this.spec,e,0,e.doc.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=D(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const N=r.Py.define(),z=r.Py.define(),B=r.QQ.define({create(e){return new j(J(e).create(),null)},update(e,t){for(let i of t.effects)i.is(N)?e=new j(i.value.create(),e.panel):i.is(z)&&(e=new j(e.query,i.value?X:null));return e},provide:e=>n.mH.from(e,(e=>e.panel))});class j{constructor(e,t){this.query=e,this.panel=t}}const F=n.p.mark({class:"cm-searchMatch"}),V=n.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),W=n.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(B))}update(e){let t=e.state.field(B);(t!=e.startState.field(B)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return n.p.none;let{view:i}=this,o=new r.f_;for(let t=0,n=i.visibleRanges,r=n.length;t<r;t++){let{from:s,to:a}=n[t];for(;t<r-1&&a>n[t+1].from-500;)a=n[++t].to;e.highlight(i.state,s,a,((e,t)=>{let n=i.state.selection.ranges.some((i=>i.from==e&&i.to==t));o.add(e,t,n?V:F)}))}return o.finish()}},{decorations:e=>e.decorations});function $(e){return t=>{let i=t.state.field(B,!1);return i&&i.query.spec.valid?e(t,i):G(t)}}const Q=$(((e,{query:t})=>{let{to:i}=e.state.selection.main,n=t.nextMatch(e.state,i,i);if(!n)return!1;let o=r.jT.single(n.from,n.to),s=e.state.facet(T);return e.dispatch({selection:o,effects:[oe(e,n),s.scrollToMatch(o.main,e)],userEvent:"select.search"}),K(e),!0})),H=$(((e,{query:t})=>{let{state:i}=e,{from:n}=i.selection.main,o=t.prevMatch(i,n,n);if(!o)return!1;let s=r.jT.single(o.from,o.to),a=e.state.facet(T);return e.dispatch({selection:s,effects:[oe(e,o),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),K(e),!0})),q=$(((e,{query:t})=>{let i=t.matchAll(e.state,1e3);return!(!i||!i.length||(e.dispatch({selection:r.jT.create(i.map((e=>r.jT.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Z=$(((e,{query:t})=>{let{state:i}=e,{from:o,to:s}=i.selection.main;if(i.readOnly)return!1;let a=t.nextMatch(i,o,o);if(!a)return!1;let l,c,h=[],u=[];if(a.from==o&&a.to==s&&(c=i.toText(t.getReplacement(a)),h.push({from:a.from,to:a.to,insert:c}),a=t.nextMatch(i,a.from,a.to),u.push(n.tk.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(o).number)+"."))),a){let t=0==h.length||h[0].from>=a.to?0:a.to-a.from-c.length;l=r.jT.single(a.from-t,a.to-t),u.push(oe(e,a)),u.push(i.facet(T).scrollToMatch(l.main,e))}return e.dispatch({changes:h,selection:l,effects:u,userEvent:"input.replace"}),!0})),U=$(((e,{query:t})=>{if(e.state.readOnly)return!1;let i=t.matchAll(e.state,1e9).map((e=>{let{from:i,to:n}=e;return{from:i,to:n,insert:t.getReplacement(e)}}));if(!i.length)return!1;let r=e.state.phrase("replaced $ matches",i.length)+".";return e.dispatch({changes:i,effects:n.tk.announce.of(r),userEvent:"input.replace.all"}),!0}));function X(e){return e.state.facet(T).createPanel(e)}function J(e,t){var i,n,r,o,s;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let c=e.facet(T);return new A({search:(null!==(i=null==t?void 0:t.literal)&&void 0!==i?i:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(n=null==t?void 0:t.caseSensitive)&&void 0!==n?n:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(o=null==t?void 0:t.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(s=null==t?void 0:t.wholeWord)&&void 0!==s?s:c.wholeWord})}function Y(e){let t=(0,n.Sd)(e,X);return t&&t.dom.querySelector("[main-field]")}function K(e){let t=Y(e);t&&t==e.root.activeElement&&t.select()}const G=e=>{let t=e.state.field(B,!1);if(t&&t.panel){let i=Y(e);if(i&&i!=e.root.activeElement){let n=J(e.state,t.query.spec);n.valid&&e.dispatch({effects:N.of(n)}),i.focus(),i.select()}}else e.dispatch({effects:[z.of(!0),t?N.of(J(e.state,t.query.spec)):r.Py.appendConfig.of(ae)]});return!0},ee=e=>{let t=e.state.field(B,!1);if(!t||!t.panel)return!1;let i=(0,n.Sd)(e,X);return i&&i.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:z.of(!1)}),!0},te=[{key:"Mod-f",run:G,scope:"editor search-panel"},{key:"F3",run:Q,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Q,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ee,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let i=e.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:o}=i.main,s=[],l=0;for(let t=new a(e.doc,e.sliceDoc(n,o));!t.next().done;){if(s.length>1e3)return!1;t.value.from==n&&(l=s.length),s.push(r.jT.range(t.value.from,t.value.to))}return t(e.update({selection:r.jT.create(s,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=(0,n.Sd)(e,m);if(!t){let i=[g.of(!0)];null==e.state.field(v,!1)&&i.push(r.Py.appendConfig.of([v,y])),e.dispatch({effects:i}),t=(0,n.Sd)(e,m)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:i}=e.selection;if(i.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:i}=e,n=r.jT.create(i.ranges.map((t=>e.wordAt(t.head)||r.jT.cursor(t.head))),i.mainIndex);return!n.eq(i)&&(t(e.update({selection:n})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(i[0].from,i[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let s=function(e,t){let{main:i,ranges:n}=e.selection,r=e.wordAt(i.head),o=r&&r.from==i.from&&r.to==i.to;for(let i=!1,r=new a(e.doc,t,n[n.length-1].to);;){if(r.next(),!r.done){if(i&&n.some((e=>e.from==r.value.from)))continue;if(o){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}if(i)return null;r=new a(e.doc,t,0,Math.max(0,n[n.length-1].from-1)),i=!0}}(e,o);return!!s&&(t(e.update({selection:e.selection.addRange(r.jT.range(s.from,s.to),!1),effects:n.tk.scrollIntoView(s.to)})),!0)},preventDefault:!0}];class ie{constructor(e){this.view=e;let t=this.query=e.state.field(B).query.spec;function i(e,t,i){return(0,o.Z)("button",{class:"cm-button",name:e,onclick:t,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=(0,o.Z)("input",{value:t.search,placeholder:ne(e,"Find"),"aria-label":ne(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,o.Z)("input",{value:t.replace,placeholder:ne(e,"Replace"),"aria-label":ne(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,o.Z)("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=(0,o.Z)("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=(0,o.Z)("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=(0,o.Z)("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,i("next",(()=>Q(e)),[ne(e,"next")]),i("prev",(()=>H(e)),[ne(e,"previous")]),i("select",(()=>q(e)),[ne(e,"all")]),(0,o.Z)("label",null,[this.caseField,ne(e,"match case")]),(0,o.Z)("label",null,[this.reField,ne(e,"regexp")]),(0,o.Z)("label",null,[this.wordField,ne(e,"by word")]),...e.state.readOnly?[]:[(0,o.Z)("br"),this.replaceField,i("replace",(()=>Z(e)),[ne(e,"replace")]),i("replaceAll",(()=>U(e)),[ne(e,"replace all")])],(0,o.Z)("button",{name:"close",onclick:()=>ee(e),"aria-label":ne(e,"close"),type:"button"},["×"])])}commit(){let e=new A({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:N.of(e)}))}keydown(e){(0,n.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?H:Q)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Z(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(N)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(T).top}}function ne(e,t){return e.state.phrase(t)}const re=/[\s\.,:;?!]/;function oe(e,{from:t,to:i}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(i).to,s=Math.max(r.from,t-30),a=Math.min(o,i+30),l=e.state.sliceDoc(s,a);if(s!=r.from)for(let e=0;e<30;e++)if(!re.test(l[e+1])&&re.test(l[e])){l=l.slice(e);break}if(a!=o)for(let e=l.length-1;e>l.length-30;e--)if(!re.test(l[e-1])&&re.test(l[e])){l=l.slice(0,e);break}return n.tk.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${r.number}.`)}const se=n.tk.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ae=[B,r.Wl.low(W),se]},8120:function(e,t,i){i.d(t,{BO:function(){return xe},D0:function(){return ye},D6:function(){return ce},F6:function(){return X},Gz:function(){return Fe},IS:function(){return je},JJ:function(){return le},Py:function(){return he},QQ:function(){return H},Wl:function(){return Z},Xs:function(){return Te},YW:function(){return ue},as:function(){return T},bg:function(){return x},cp:function(){return g},e6:function(){return Se},f_:function(){return Ae},gc:function(){return O},gm:function(){return k},jT:function(){return I},n0:function(){return C},nZ:function(){return _},q6:function(){return ae},r$:function(){return B},uU:function(){return _e},x1:function(){return u},xm:function(){return R},xv:function(){return n},yy:function(){return ke}});class n{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=d(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),o.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=d(this,e,t);let i=[];return this.decompose(e,t,i,0),o.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new l(this),r=new l(e);for(let e=t,o=t;;){if(n.next(e),r.next(e),e=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(e=1){return new l(this,e)}iterRange(e,t=this.length){return new c(this,e,t)}iterLines(e,t){let i;if(null==e)i=this.iter();else{null==t&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new h(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new r(e):o.from(r.split(e,[])):n.empty}}class r extends n{constructor(e,t=function(e){let t=-1;for(let i of e)t+=i.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let o=this.text[r],s=n+o.length;if((t?i:s)>=e)return new u(n,s,i,o);n=s+1,i++}}decompose(e,t,i,n){let o=e<=0&&t>=this.length?this:new r(a(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&n){let e=i.pop(),t=s(o.text,e.text.slice(),0,o.length);if(t.length<=32)i.push(new r(t,e.length+o.length));else{let e=t.length>>1;i.push(new r(t.slice(0,e)),new r(t.slice(e)))}}else i.push(o)}replace(e,t,i){if(!(i instanceof r))return super.replace(e,t,i);[e,t]=d(this,e,t);let n=s(this.text,s(i.text,a(this.text,0,e)),t),l=this.length+i.length-(t-e);return n.length<=32?new r(n,l):o.from(r.split(n,[]),l)}sliceString(e,t=this.length,i="\n"){[e,t]=d(this,e,t);let n="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let s=this.text[o],a=r+s.length;r>e&&o&&(n+=i),e<a&&t>r&&(n+=s.slice(Math.max(0,e-r),t-r)),r=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let o of e)i.push(o),n+=o.length+1,32==i.length&&(t.push(new r(i,n)),i=[],n=-1);return n>-1&&t.push(new r(i,n)),t}}class o extends n{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,i,n){for(let r=0;;r++){let o=this.children[r],s=n+o.length,a=i+o.lines-1;if((t?a:s)>=e)return o.lineInner(e,t,i,n);n=s+1,i=a+1}}decompose(e,t,i,n){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let s=this.children[r],a=o+s.length;if(e<=a&&t>=o){let r=n&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!r?i.push(s):s.decompose(e-o,t-o,i,r)}o=a+1}}replace(e,t,i){if([e,t]=d(this,e,t),i.lines<this.lines)for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],a=r+s.length;if(e>=r&&t<=a){let l=s.replace(e-r,t-r,i),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let r=this.children.slice();return r[n]=l,new o(r,this.length-(t-e)+i.length)}return super.replace(r,a,l)}r=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){[e,t]=d(this,e,t);let n="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let s=this.children[r],a=o+s.length;o>e&&r&&(n+=i),e<a&&t>o&&(n+=s.sliceString(e-o,t-o,i)),o=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof o))return 0;let i=0,[n,r,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==s||r==a)return i;let o=this.children[n],l=e.children[r];if(o!=l)return i+o.scanIdentical(l,t);i+=o.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let i=0;for(let t of e)i+=t.lines;if(i<32){let i=[];for(let t of e)t.flatten(i);return new r(i,t)}let n=Math.max(32,i>>5),s=n<<1,a=n>>1,l=[],c=0,h=-1,u=[];function d(e){let t;if(e.lines>s&&e instanceof o)for(let t of e.children)d(t);else e.lines>a&&(c>a||!c)?(p(),l.push(e)):e instanceof r&&c&&(t=u[u.length-1])instanceof r&&e.lines+t.lines<=32?(c+=e.lines,h+=e.length+1,u[u.length-1]=new r(t.text.concat(e.text),t.length+1+e.length)):(c+e.lines>n&&p(),c+=e.lines,h+=e.length+1,u.push(e))}function p(){0!=c&&(l.push(1==u.length?u[0]:o.from(u,h)),h=-1,c=u.length=0)}for(let t of e)d(t);return p(),1==l.length?l[0]:new o(l,t)}}function s(e,t,i=0,n=1e9){for(let r=0,o=0,s=!0;o<e.length&&r<=n;o++){let a=e[o],l=r+a.length;l>=i&&(l>n&&(a=a.slice(0,n-r)),r<i&&(a=a.slice(i-r)),s?(t[t.length-1]+=a,s=!1):t.push(a)),r=l+1}return t}function a(e,t,i){return s(e,[""],t,i)}n.empty=new r([""],0);class l{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof r?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],o=this.offsets[i],s=o>>1,a=n instanceof r?n.text.length:n.children.length;if(s==(t>0?a:0)){if(0==i)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(t>0?0:1)){if(this.offsets[i]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(n instanceof r){let r=n.text[s+(t<0?-1:0)];if(this.offsets[i]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let o=n.children[s+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof r?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class c{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new l(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class h{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(n.prototype[Symbol.iterator]=function(){return this.iter()},l.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=h.prototype[Symbol.iterator]=function(){return this});class u{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function d(e,t,i){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,i))]}let p="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let e=1;e<p.length;e++)p[e]+=p[e-1];function f(e){for(let t=1;t<p.length;t+=2)if(p[t]>e)return p[t-1]<=e;return!1}function m(e){return e>=127462&&e<=127487}function g(e,t,i=!0,n=!0){return(i?v:y)(e,t,n)}function v(e,t,i){if(t==e.length)return t;t&&b(e.charCodeAt(t))&&w(e.charCodeAt(t-1))&&t--;let n=k(e,t);for(t+=_(n);t<e.length;){let r=k(e,t);if(8205==n||8205==r||i&&f(r))t+=_(r),n=r;else{if(!m(r))break;{let i=0,n=t-2;for(;n>=0&&m(k(e,n));)i++,n-=2;if(i%2==0)break;t+=2}}}return t}function y(e,t,i){for(;t>0;){let n=v(e,t-2,i);if(n<t)return n;t--}return 0}function b(e){return e>=56320&&e<57344}function w(e){return e>=55296&&e<56320}function k(e,t){let i=e.charCodeAt(t);if(!w(i)||t+1==e.length)return i;let n=e.charCodeAt(t+1);return b(n)?n-56320+(i-55296<<10)+65536:i}function x(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function _(e){return e<65536?1:2}const S=/\r\n?|\n/;var O=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(O||(O={}));class C{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,n,r),n+=r):n+=o,i+=r}}iterChangedRanges(e,t=!1){M(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new C(e)}composeDesc(e){return this.empty?e:e.empty?this:D(this,e)}mapDesc(e,t=!1){return e.empty?this:E(this,e,t)}mapPos(e,t=-1,i=O.Simple){let n=0,r=0;for(let o=0;o<this.sections.length;){let s=this.sections[o++],a=this.sections[o++],l=n+s;if(a<0){if(l>e)return r+(e-n);r+=s}else{if(i!=O.Simple&&l>=e&&(i==O.TrackDel&&n<e&&l>e||i==O.TrackBefore&&n<e||i==O.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!s)return e==n||t<0?r:r+a;r+=a}n=l}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i<this.sections.length&&n<=t;){let r=n+this.sections[i++];if(this.sections[i++]>=0&&n<=t&&r>=e)return!(n<e&&r>t)||"cover";n=r}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new C(e)}static create(e){return new C(e)}}class T extends C{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return M(this,((t,i,n,r,o)=>e=e.replace(n,n+(i-t),o)),!1),e}mapDesc(e,t=!1){return E(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,o=0;r<t.length;r+=2){let s=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=s;let l=r>>1;for(;i.length<l;)i.push(n.empty);i.push(s?e.slice(o,o+s):n.empty)}o+=s}return new T(t,i)}compose(e){return this.empty?e:e.empty?this:D(this,e,!0)}map(e,t=!1){return e.empty?this:E(this,e,t,!0)}iterChanges(e,t=!1){M(this,e,t)}get desc(){return C.create(this.sections)}filter(e){let t=[],i=[],n=[],r=new L(this);e:for(let o=0,s=0;;){let a=o==e.length?1e9:e[o++];for(;s<a||s==a&&0==r.len;){if(r.done)break e;let e=Math.min(r.len,a-s);A(n,e,-1);let o=-1==r.ins?-1:0==r.off?r.ins:0;A(t,e,o),o>0&&P(i,t,r.text),r.forward(e),s+=e}let l=e[o++];for(;s<l;){if(r.done)break e;let e=Math.min(r.len,l-s);A(t,e,-1),A(n,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),s+=e}}return{changes:new T(t,i),filtered:C.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],n=this.sections[t+1];n<0?e.push(i):0==n?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],o=[],s=0,a=null;function l(e=!1){if(!e&&!r.length)return;s<t&&A(r,t-s,-1);let i=new T(r,o);a=a?a.compose(i.map(a)):i,r=[],o=[],s=0}return function e(c){if(Array.isArray(c))for(let t of c)e(t);else if(c instanceof T){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);l(),a=a?a.compose(c.map(a)):c}else{let{from:e,to:a=e,insert:h}=c;if(e>a||e<0||a>t)throw new RangeError(`Invalid change range ${e} to ${a} (in doc of length ${t})`);let u=h?"string"==typeof h?n.of(h.split(i||S)):h:n.empty,d=u.length;if(e==a&&0==d)return;e<s&&l(),e>s&&A(r,e-s,-1),A(r,a-e,d),P(o,r,u),s=a}}(e),l(!a),a}static empty(e){return new T(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let o=e[r];if("number"==typeof o)t.push(o,-1);else{if(!Array.isArray(o)||"number"!=typeof o[0]||o.some(((e,t)=>t&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==o.length)t.push(o[0],0);else{for(;i.length<r;)i.push(n.empty);i[r]=n.of(o.slice(1)),t.push(o[0],i[r].length)}}}return new T(t,i)}static createSet(e,t){return new T(e,t)}}function A(e,t,i,n=!1){if(0==t&&i<=0)return;let r=e.length-2;r>=0&&i<=0&&i==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=i:n?(e[r]+=t,e[r+1]+=i):e.push(t,i)}function P(e,t,i){if(0==i.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(i);else{for(;e.length<r;)e.push(n.empty);e.push(i)}}function M(e,t,i){let r=e.inserted;for(let o=0,s=0,a=0;a<e.sections.length;){let l=e.sections[a++],c=e.sections[a++];if(c<0)o+=l,s+=l;else{let h=o,u=s,d=n.empty;for(;h+=l,u+=c,c&&r&&(d=d.append(r[a-2>>1])),!(i||a==e.sections.length||e.sections[a+1]<0);)l=e.sections[a++],c=e.sections[a++];t(o,h,s,u,d),o=h,s=u}}}function E(e,t,i,n=!1){let r=[],o=n?[]:null,s=new L(e),a=new L(t);for(let e=-1;;)if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);A(r,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||e==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!i))){let t=a.len;for(A(r,a.ins,-1);t;){let i=Math.min(s.len,t);s.ins>=0&&e<s.i&&s.len<=i&&(A(r,0,s.ins),o&&P(o,r,s.text),e=s.i),s.forward(i),t-=i}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return o?T.createSet(r,o):C.create(r);throw new Error("Mismatched change set lengths")}{let t=0,i=s.len;for(;i;)if(-1==a.ins){let e=Math.min(i,a.len);t+=e,i-=e,a.forward(e)}else{if(!(0==a.ins&&a.len<i))break;i-=a.len,a.next()}A(r,t,e<s.i?s.ins:0),o&&e<s.i&&P(o,r,s.text),e=s.i,s.forward(s.len-i)}}}function D(e,t,i=!1){let n=[],r=i?[]:null,o=new L(e),s=new L(t);for(let e=!1;;){if(o.done&&s.done)return r?T.createSet(n,r):C.create(n);if(0==o.ins)A(n,o.len,0,e),o.next();else if(0!=s.len||s.done){if(o.done||s.done)throw new Error("Mismatched change set lengths");{let t=Math.min(o.len2,s.len),i=n.length;if(-1==o.ins){let i=-1==s.ins?-1:s.off?0:s.ins;A(n,t,i,e),r&&i&&P(r,n,s.text)}else-1==s.ins?(A(n,o.off?0:o.len,t,e),r&&P(r,n,o.textBit(t))):(A(n,o.off?0:o.len,s.off?0:s.ins,e),r&&!s.off&&P(r,n,s.text));e=(o.ins>t||s.ins>=0&&s.len>t)&&(e||n.length>i),o.forward2(t),s.forward(t)}}else A(n,0,s.ins,e),r&&P(r,n,s.text),s.next()}}class L{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return-2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?n.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?n.empty:t[i].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class R{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new R(i,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return I.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return I.range(this.anchor,i)}eq(e,t=!1){return!(this.anchor!=e.anchor||this.head!=e.head||t&&this.empty&&this.assoc!=e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return I.range(e.anchor,e.head)}static create(e,t,i){return new R(e,t,i)}}class I{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:I.create(this.ranges.map((i=>i.map(e,t))),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new I([this.main],0)}addRange(e,t=!0){return I.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,I.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map((e=>e.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new I(e.ranges.map((e=>R.fromJSON(e))),e.main)}static single(e,t=e){return new I([I.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<e.length;n++){let r=e[n];if(r.empty?r.from<=i:r.from<i)return I.normalized(e.slice(),t);i=r.to}return new I(e,t)}static cursor(e,t=0,i,n){return R.create(e,e,(0==t?0:t<0?8:16)|(null==i?7:Math.min(6,i))|(null!=n?n:16777215)<<6)}static range(e,t,i,n){let r=(null!=i?i:16777215)<<6|(null==n?7:Math.min(6,n));return t<e?R.create(t,e,48|r):R.create(e,t,(t>e?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(i);for(let i=1;i<e.length;i++){let n=e[i],r=e[i-1];if(n.empty?n.from<=r.to:n.from<r.to){let o=r.from,s=Math.max(n.to,r.to);i<=t&&t--,e.splice(--i,2,n.anchor>n.head?I.range(s,o):I.range(o,s))}}return new I(e,t)}}function N(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}let z=0;class B{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=z++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new B(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:j),!!e.static,e.enables)}of(e){return new F([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new F(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(i=>t(i.field(e))))}}function j(e,t){return e==t||e.length==t.length&&e.every(((e,i)=>e===t[i]))}class F{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=z++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,o=e[r]>>1,s=2==this.type,a=!1,l=!1,c=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:0==(1&(null!==(t=e[i.id])&&void 0!==t?t:1))&&c.push(e[i.id]);return{create(e){return e.values[o]=i(e),1},update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||W(e,c)){let t=i(e);if(s?!V(t,e.values[o],n):!n(t,e.values[o]))return e.values[o]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[r];if(null!=l){let r=G(t,l);if(this.dependencies.every((i=>i instanceof B?t.facet(i)===e.facet(i):!(i instanceof H)||t.field(i,!1)==e.field(i,!1)))||(s?V(a=i(e),r,n):n(a=i(e),r)))return e.values[o]=r,0}else a=i(e);return e.values[o]=a,1}}}}function V(e,t,i){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1;return!0}function W(e,t){let i=!1;for(let n of t)1&K(e,n)&&(i=!0);return i}function $(e,t,i){let n=i.map((t=>e[t.id])),r=i.map((e=>e.type)),o=n.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let i=[];for(let t=0;t<n.length;t++){let o=G(e,n[t]);if(2==r[t])for(let e of o)i.push(e);else i.push(o)}return t.combine(i)}return{create(e){for(let t of n)K(e,t);return e.values[s]=a(e),1},update(e,i){if(!W(e,o))return 0;let n=a(e);return t.compare(n,e.values[s])?0:(e.values[s]=n,1)},reconfigure(e,r){let o=W(e,n),l=r.config.facets[t.id],c=r.facet(t);if(l&&!o&&j(i,l))return e.values[s]=c,0;let h=a(e);return t.compare(h,c)?(e.values[s]=c,0):(e.values[s]=h,1)}}}const Q=B.define({static:!0});class H{constructor(e,t,i,n,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(e){let t=new H(z++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Q).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,i)=>{let n=e.values[t],r=this.updateF(n,i);return this.compareF(n,r)?0:(e.values[t]=r,1)},reconfigure:(e,i)=>null!=i.config.address[this.id]?(e.values[t]=i.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,Q.of({field:this,create:e})]}get extension(){return this}}function q(e){return t=>new U(t,e)}const Z={highest:q(0),high:q(1),default:q(2),low:q(3),lowest:q(4)};class U{constructor(e,t){this.inner=e,this.prec=t}}class X{of(e){return new J(this,e)}reconfigure(e){return X.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class J{constructor(e,t){this.compartment=e,this.inner=t}}class Y{constructor(e,t,i,n,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let n=[],r=Object.create(null),o=new Map;for(let i of function(e,t,i){let n=[[],[],[],[],[]],r=new Map;return function e(o,s){let a=r.get(o);if(null!=a){if(a<=s)return;let e=n[a].indexOf(o);e>-1&&n[a].splice(e,1),o instanceof J&&i.delete(o.compartment)}if(r.set(o,s),Array.isArray(o))for(let t of o)e(t,s);else if(o instanceof J){if(i.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=t.get(o.compartment)||o.inner;i.set(o.compartment,n),e(n,s)}else if(o instanceof U)e(o.inner,o.prec);else if(o instanceof H)n[s].push(o),o.provides&&e(o.provides,s);else if(o instanceof F)n[s].push(o),o.facet.extensions&&e(o.facet.extensions,2);else{let t=o.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,2),n.reduce(((e,t)=>e.concat(t)))}(e,t,o))i instanceof H?n.push(i):(r[i.facet.id]||(r[i.facet.id]=[])).push(i);let s=Object.create(null),a=[],l=[];for(let e of n)s[e.id]=l.length<<1,l.push((t=>e.slot(t)));let c=null==i?void 0:i.config.facets;for(let e in r){let t=r[e],n=t[0].facet,o=c&&c[e]||[];if(t.every((e=>0==e.type)))if(s[n.id]=a.length<<1|1,j(o,t))a.push(i.facet(n));else{let e=n.combine(t.map((e=>e.value)));a.push(i&&n.compare(e,i.facet(n))?i.facet(n):e)}else{for(let e of t)0==e.type?(s[e.id]=a.length<<1|1,a.push(e.value)):(s[e.id]=l.length<<1,l.push((t=>e.dynamicSlot(t))));s[n.id]=l.length<<1,l.push((e=>$(e,n,t)))}}let h=l.map((e=>e(s)));return new Y(e,o,h,s,a,r)}}function K(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let r=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|r}function G(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const ee=B.define(),te=B.define({combine:e=>e.some((e=>e)),static:!0}),ie=B.define({combine:e=>e.length?e[0]:void 0,static:!0}),ne=B.define(),re=B.define(),oe=B.define(),se=B.define({combine:e=>!!e.length&&e[0]});class ae{constructor(e,t){this.type=e,this.value=t}static define(){return new le}}class le{of(e){return new ae(this,e)}}class ce{constructor(e){this.map=e}of(e){return new he(this,e)}}class he{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new he(this.type,t)}is(e){return this.type==e}static define(e={}){return new ce(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let e=n.map(t);e&&i.push(e)}return i}}he.reconfigure=he.define(),he.appendConfig=he.define();class ue{constructor(e,t,i,n,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&N(i,t.newLength),r.some((e=>e.type==ue.time))||(this.annotations=r.concat(ue.time.of(Date.now())))}static create(e,t,i,n,r,o){return new ue(e,t,i,n,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ue.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function de(e,t){let i=[];for(let n=0,r=0;;){let o,s;if(n<e.length&&(r==t.length||t[r]>=e[n]))o=e[n++],s=e[n++];else{if(!(r<t.length))return i;o=t[r++],s=t[r++]}!i.length||i[i.length-1]<o?i.push(o,s):i[i.length-1]<s&&(i[i.length-1]=s)}}function pe(e,t,i){var n;let r,o,s;return i?(r=t.changes,o=T.empty(t.changes.length),s=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),o=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(r)),{changes:s,selection:t.selection?t.selection.map(o):null===(n=e.selection)||void 0===n?void 0:n.map(r),effects:he.mapEffects(e.effects,r).concat(he.mapEffects(t.effects,o)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function fe(e,t,i){let n=t.selection,r=ve(t.annotations);return t.userEvent&&(r=r.concat(ue.userEvent.of(t.userEvent))),{changes:t.changes instanceof T?t.changes:T.of(t.changes||[],i,e.facet(ie)),selection:n&&(n instanceof I?n:I.single(n.anchor,n.head)),effects:ve(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}function me(e,t,i){let n=fe(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(i=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(i=!1);let o=!!t[r].sequential;n=pe(n,fe(e,t[r],o?n.changes.newLength:e.doc.length),o)}let r=ue.create(e,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(e){let t=e.startState,i=t.facet(oe),n=e;for(let r=i.length-1;r>=0;r--){let o=i[r](e);o&&Object.keys(o).length&&(n=pe(n,fe(t,o,e.changes.newLength),!0))}return n==e?e:ue.create(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let n of t.facet(ne)){let t=n(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:de(i,t))}if(!0!==i){let n,r;if(!1===i)r=e.changes.invertedDesc,n=T.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=ue.create(t,n,e.selection&&e.selection.map(r),he.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let n=t.facet(re);for(let i=n.length-1;i>=0;i--){let r=n[i](e);e=r instanceof ue?r:Array.isArray(r)&&1==r.length&&r[0]instanceof ue?r[0]:me(t,ve(r),!1)}return e}(r):r)}ue.time=ae.define(),ue.userEvent=ae.define(),ue.addToHistory=ae.define(),ue.remote=ae.define();const ge=[];function ve(e){return null==e?ge:Array.isArray(e)?e:[e]}var ye=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(ye||(ye={}));const be=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let we;try{we=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class ke{constructor(e,t,i,n,r,o){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)K(this,e<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(null!=i)return K(this,i),G(this,i);if(t)throw new RangeError("Field is not present in this state")}update(...e){return me(this,e,!0)}applyTransaction(e){let t,i=this.config,{base:n,compartments:r}=i;for(let t of e.effects)t.is(X.reconfigure)?(i&&(r=new Map,i.compartments.forEach(((e,t)=>r.set(t,e))),i=null),r.set(t.value.compartment,t.value.extension)):t.is(he.reconfigure)?(i=null,n=t.value):t.is(he.appendConfig)&&(i=null,n=ve(n).concat(t.value));i?t=e.startState.values.slice():(i=Y.resolve(n,r,this),t=new ke(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let o=e.startState.facet(te)?e.newSelection:e.newSelection.asSingle();new ke(i,e.newDoc,o,t,((t,i)=>i.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:I.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],o=ve(i.effects);for(let i=1;i<t.ranges.length;i++){let s=e(t.ranges[i]),a=this.changes(s.changes),l=a.map(n);for(let e=0;e<i;e++)r[e]=r[e].map(l);let c=n.mapDesc(a,!0);r.push(s.range.map(c)),n=n.compose(l),o=he.mapEffects(o,l).concat(he.mapEffects(ve(s.effects),c))}return{changes:n,selection:I.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof T?e:T.of(e,this.doc.length,this.facet(ke.lineSeparator))}toText(e){return n.of(e.split(this.facet(ke.lineSeparator)||S))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(K(this,t),G(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let n=e[i];n instanceof H&&null!=this.config.address[n.id]&&(t[i]=n.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||"string"!=typeof e.doc)throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i)for(let t in i)if(Object.prototype.hasOwnProperty.call(e,t)){let r=i[t],o=e[t];n.push(r.init((e=>r.spec.fromJSON(o,e))))}return ke.create({doc:e.doc,selection:I.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=Y.resolve(e.extensions||[],new Map),i=e.doc instanceof n?e.doc:n.of((e.doc||"").split(t.staticFacet(ke.lineSeparator)||S)),r=e.selection?e.selection instanceof I?e.selection:I.single(e.selection.anchor,e.selection.head):I.single(0);return N(r,i.length),t.staticFacet(te)||(r=r.asSingle()),new ke(t,i,r,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(ke.tabSize)}get lineBreak(){return this.facet(ke.lineSeparator)||"\n"}get readOnly(){return this.facet(se)}phrase(e,...t){for(let t of this.facet(ke.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>t.length?e:t[n-1]}))),e}languageDataAt(e,t,i=-1){let n=[];for(let r of this.facet(ee))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return ye.Space;if(function(e){if(we)return we.test(e);for(let t=0;t<e.length;t++){let i=e[t];if(/\w/.test(i)||i>""&&(i.toUpperCase()!=i.toLowerCase()||be.test(i)))return!0}return!1}(e))return ye.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return ye.Word;return ye.Other};var t}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,s=e-i;for(;o>0;){let e=g(t,o,!1);if(r(t.slice(e,o))!=ye.Word)break;o=e}for(;s<n;){let e=g(t,s);if(r(t.slice(s,e))!=ye.Word)break;s=e}return o==s?null:I.range(o+i,s+i)}}function xe(e,t,i={}){let n={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],o=n[e];if(void 0===o)n[e]=r;else if(o===r||void 0===r);else{if(!Object.hasOwnProperty.call(i,e))throw new Error("Config merge conflict for field "+e);n[e]=i[e](o,r)}}for(let e in t)void 0===n[e]&&(n[e]=t[e]);return n}ke.allowMultipleSelections=te,ke.tabSize=B.define({combine:e=>e.length?e[0]:4}),ke.lineSeparator=ie,ke.readOnly=se,ke.phrases=B.define({compare(e,t){let i=Object.keys(e),n=Object.keys(t);return i.length==n.length&&i.every((i=>e[i]==t[i]))}}),ke.languageData=ee,ke.changeFilter=ne,ke.transactionFilter=re,ke.transactionExtender=oe,X.reconfigure=he.define();class _e{eq(e){return this==e}range(e,t=e){return Se.create(e,t,this)}}_e.prototype.startSide=_e.prototype.endSide=0,_e.prototype.point=!1,_e.prototype.mapMode=O.TrackDel;class Se{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Se(e,t,i)}}function Oe(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Ce{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let r=i?this.to:this.from;for(let o=n,s=r.length;;){if(o==s)return o;let n=o+s>>1,a=r[n]-e||(i?this.value[n].endSide:this.value[n].startSide)-t;if(n==o)return a>=0?o:s;a>=0?s=n:o=n+1}}between(e,t,i,n){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(!1===n(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let i=[],n=[],r=[],o=-1,s=-1;for(let a=0;a<this.value.length;a++){let l,c,h=this.value[a],u=this.from[a]+e,d=this.to[a]+e;if(u==d){let e=t.mapPos(u,h.startSide,h.mapMode);if(null==e)continue;if(l=c=e,h.startSide!=h.endSide&&(c=t.mapPos(u,h.endSide),c<l))continue}else if(l=t.mapPos(u,h.startSide),c=t.mapPos(d,h.endSide),l>c||l==c&&h.startSide>0&&h.endSide<=0)continue;(c-l||h.endSide-h.startSide)<0||(o<0&&(o=l),h.point&&(s=Math.max(s,c-l)),i.push(h),n.push(l-o),r.push(c-o))}return{mapped:i.length?new Ce(n,r,i,s):null,pos:o}}}class Te{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new Te(e,t,i,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=e,o=e.filter;if(0==t.length&&!o)return this;if(i&&(t=t.slice().sort(Oe)),this.isEmpty)return t.length?Te.of(t):this;let s=new Me(this,null,-1).goto(0),a=0,l=[],c=new Ae;for(;s.value||a<t.length;)if(a<t.length&&(s.from-t[a].from||s.startSide-t[a].value.startSide)>=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==s.rangeIndex&&s.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(s.chunkIndex)<t[a].from)&&(!o||n>this.chunkEnd(s.chunkIndex)||r<this.chunkPos[s.chunkIndex])&&c.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||n>s.to||r<s.from||o(s.from,s.to,s.value))&&(c.addInner(s.from,s.to,s.value)||l.push(Se.create(s.from,s.to,s.value))),s.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?Te.empty:this.nextLayer.update({add:l,filter:o,filterFrom:n,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],n=-1;for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],s=this.chunk[r],a=e.touchesRange(o,o+s.length);if(!1===a)n=Math.max(n,s.maxPoint),t.push(s),i.push(e.mapPos(o));else if(!0===a){let{mapped:r,pos:a}=s.map(o,e);r&&(n=Math.max(n,r.maxPoint),t.push(r),i.push(a))}}let r=this.nextLayer.map(e);return 0==t.length?r:new Te(i,t,r||Te.empty,n)}between(e,t,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let r=this.chunkPos[n],o=this.chunk[n];if(t>=r&&e<=r+o.length&&!1===o.between(r,e-r,t-r,i))return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ee.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ee.from(e).goto(t)}static compare(e,t,i,n,r=-1){let o=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),s=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=Pe(o,s,i),l=new Le(o,a,r),c=new Le(s,a,r);i.iterGaps(((e,t,i)=>Re(l,e,c,t,i,n))),i.empty&&0==i.length&&Re(l,0,c,0,0,n)}static eq(e,t,i=0,n){null==n&&(n=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),o=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=o.length)return!1;if(!r.length)return!0;let s=Pe(r,o),a=new Le(r,s,0).goto(i),l=new Le(o,s,0).goto(i);for(;;){if(a.to!=l.to||!Ie(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(e,t,i,n,r=-1){let o=new Le(e,null,r).goto(t),s=t,a=o.openStart;for(;;){let e=Math.min(o.to,i);if(o.point){let i=o.activeForPoint(o.to),r=o.pointFrom<t?i.length+1:o.point.startSide<0?i.length:Math.min(i.length,a);n.point(s,e,o.point,i,r,o.pointRank),a=Math.min(o.openEnd(e),i.length)}else e>s&&(n.span(s,e,o.active,a),a=o.openEnd(e));if(o.to>i)return a+(o.point&&o.to>i?1:0);s=o.to,o.next()}}static of(e,t=!1){let i=new Ae;for(let n of e instanceof Se?[e]:t?function(e){if(e.length>1)for(let t=e[0],i=1;i<e.length;i++){let n=e[i];if(Oe(t,n)>0)return e.slice().sort(Oe);t=n}return e}(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return Te.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=Te.empty;n=n.nextLayer)t=new Te(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}Te.empty=new Te([],[],null,-1),Te.empty.nextLayer=Te.empty;class Ae{finishChunk(e){this.chunks.push(new Ce(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Ae)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Te.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=Te.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Pe(e,t,i){let n=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&n.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let o=n.get(e.chunk[t]);null==o||(i?i.mapPos(o):o)!=e.chunkPos[t]||(null==i?void 0:i.touchesRange(o,o+e.chunk[t].length))||r.add(e.chunk[t])}return r}class Me{constructor(e,t,i,n=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Ee{constructor(e){this.heap=e}static from(e,t=null,i=-1){let n=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&n.push(new Me(o,t,i,r));return 1==n.length?n[0]:new Ee(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)De(this.heap,e);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)De(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),De(this.heap,0)}}}function De(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let r=e[n];if(n+1<e.length&&r.compare(e[n+1])>=0&&(r=e[n+1],n++),i.compare(r)<0)break;e[n]=i,e[t]=r,t=n}}class Le{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ee.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ne(this.active,e),Ne(this.activeTo,e),Ne(this.activeRank,e),this.minActive=Be(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||n-this.activeTo[t])>0;)t++;ze(this.active,t,i),ze(this.activeTo,t,n),ze(this.activeRank,t,r),e&&ze(e,t,this.cursor.from),this.minActive=Be(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Ne(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}}if(i){this.openStart=0;for(let t=i.length-1;t>=0&&i[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Re(e,t,i,n,r,o){e.goto(t),i.goto(n);let s=n+r,a=n,l=n-t;for(;;){let t=e.to+l-i.to||e.endSide-i.endSide,n=t<0?e.to+l:i.to,r=Math.min(n,s);if(e.point||i.point?e.point&&i.point&&(e.point==i.point||e.point.eq(i.point))&&Ie(e.activeForPoint(e.to),i.activeForPoint(i.to))||o.comparePoint(a,r,e.point,i.point):r>a&&!Ie(e.active,i.active)&&o.compareRange(a,r,e.active,i.active),n>s)break;a=n,t<=0&&e.next(),t>=0&&i.next()}}function Ie(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=t[i]&&!e[i].eq(t[i]))return!1;return!0}function Ne(e,t){for(let i=t,n=e.length-1;i<n;i++)e[i]=e[i+1];e.pop()}function ze(e,t,i){for(let i=e.length-1;i>=t;i--)e[i+1]=e[i];e[t]=i}function Be(e,t){let i=-1,n=1e9;for(let r=0;r<t.length;r++)(t[r]-n||e[r].endSide-e[i].endSide)<0&&(i=r,n=t[r]);return i}function je(e,t,i=e.length){let n=0;for(let r=0;r<i;)9==e.charCodeAt(r)?(n+=t-n%t,r++):(n++,r=g(e,r));return n}function Fe(e,t,i,n){for(let n=0,r=0;;){if(r>=t)return n;if(n==e.length)break;r+=9==e.charCodeAt(n)?i-r%i:1,n=g(e,n)}return!0===n?-1:e.length}},3732:function(e,t,i){i.d(t,{$_:function(){return x},VE:function(){return S},pD:function(){return _},vk:function(){return O}});var n=i(6485),r=i(9119),o=i(5524);const s="#e5c07b",a="#e06c75",l="#56b6c2",c="#ffffff",h="#abb2bf",u="#7d8799",d="#61afef",p="#98c379",f="#d19a66",m="#c678dd",g="#21252b",v="#2c313a",y="#282c34",b="#353a42",w="#3E4451",k="#528bff",x={chalky:s,coral:a,cyan:l,invalid:c,ivory:h,stone:u,malibu:d,sage:p,whiskey:f,violet:m,darkBackground:g,highlightBackground:v,background:y,tooltipBackground:b,selection:w,cursor:k},_=n.tk.theme({"&":{color:h,backgroundColor:y},".cm-content":{caretColor:k},".cm-cursor, .cm-dropCursor":{borderLeftColor:k},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:w},".cm-panels":{backgroundColor:g,color:h},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:y,color:u,border:"none"},".cm-activeLineGutter":{backgroundColor:v},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:b},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:b,borderBottomColor:b},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:v,color:h}}},{dark:!0}),S=r.Qf.define([{tag:o.pJ.keyword,color:m},{tag:[o.pJ.name,o.pJ.deleted,o.pJ.character,o.pJ.propertyName,o.pJ.macroName],color:a},{tag:[o.pJ.function(o.pJ.variableName),o.pJ.labelName],color:d},{tag:[o.pJ.color,o.pJ.constant(o.pJ.name),o.pJ.standard(o.pJ.name)],color:f},{tag:[o.pJ.definition(o.pJ.name),o.pJ.separator],color:h},{tag:[o.pJ.typeName,o.pJ.className,o.pJ.number,o.pJ.changed,o.pJ.annotation,o.pJ.modifier,o.pJ.self,o.pJ.namespace],color:s},{tag:[o.pJ.operator,o.pJ.operatorKeyword,o.pJ.url,o.pJ.escape,o.pJ.regexp,o.pJ.link,o.pJ.special(o.pJ.string)],color:l},{tag:[o.pJ.meta,o.pJ.comment],color:u},{tag:o.pJ.strong,fontWeight:"bold"},{tag:o.pJ.emphasis,fontStyle:"italic"},{tag:o.pJ.strikethrough,textDecoration:"line-through"},{tag:o.pJ.link,color:u,textDecoration:"underline"},{tag:o.pJ.heading,fontWeight:"bold",color:a},{tag:[o.pJ.atom,o.pJ.bool,o.pJ.special(o.pJ.variableName)],color:f},{tag:[o.pJ.processingInstruction,o.pJ.string,o.pJ.inserted],color:p},{tag:o.pJ.invalid,color:c}]),O=[_,(0,r.nF)(S)]},6485:function(e,t,i){i.d(t,{CZ:function(){return Re},td:function(){return Si},kH:function(){return ue},p:function(){return de},Nm:function(){return Se},tk:function(){return ln},SJ:function(){return Vr},Y1:function(){return Hn},dc:function(){return Sn},lg:function(){return ct},TB:function(){return xt},l9:function(){return he},$X:function(){return bo},E8:function(){return Dr},S2:function(){return pr},Uw:function(){return Dn},qr:function(){return $n},HM:function(){return Ln},Sd:function(){return Nr},gB:function(){return Pr},v5:function(){return qr},v7:function(){return Wr},NO:function(){return $r},lc:function(){return Ur},Dm:function(){return Mr},ZO:function(){return nr},HQ:function(){return uo},AE:function(){return Yn},pk:function(){return yo},DF:function(){return go},bF:function(){return Ar},$f:function(){return gn},EY:function(){return Pn},p2:function(){return to},Bf:function(){return io},Eu:function(){return ao},OO:function(){return ot},h0:function(){return Ir},W$:function(){return ar},Zs:function(){return hr},E2:function(){return Lr},$1:function(){return bn},CT:function(){return ir},mH:function(){return Fr},hJ:function(){return _r},jH:function(){return gr}});for(var n=i(8120),r=i(8699),o={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),l="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),c=0;c<10;c++)o[48+c]=o[96+c]=String(c);for(c=1;c<=24;c++)o[c+111]="F"+c;for(c=65;c<=90;c++)o[c]=String.fromCharCode(c+32),s[c]=String.fromCharCode(c);for(var h in o)s.hasOwnProperty(h)||(s[h]=o[h]);function u(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function d(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function p(e,t){if(!t.anchorNode)return!1;try{return d(e,t.anchorNode)}catch(e){return!1}}function f(e){return 3==e.nodeType?T(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function m(e,t,i,n){return!!i&&(y(e,t,i,n,-1)||y(e,t,i,n,1))}function g(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function v(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function y(e,t,i,n,r){for(;;){if(e==i&&t==n)return!0;if(t==(r<0?0:b(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||1!=i.nodeType)return!1;t=g(e)+(r<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?b(e):0}}}function b(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function w(e,t){let i=t?e.left:e.right;return{left:i,right:i,top:e.top,bottom:e.bottom}}function k(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function x(e,t){let i=t.width/e.offsetWidth,n=t.height/e.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.width-e.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.height-e.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class _{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?b(t):0),i,Math.min(e.focusOffset,i?b(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let S,O=null;function C(e){if(e.setActive)return e.setActive();if(O)return e.focus(O);let t=[];for(let i=e;i&&(t.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(e.focus(null==O?{get preventScroll(){return O={preventScroll:!0},!0}}:void 0),!O){O=!1;for(let e=0;e<t.length;){let i=t[e++],n=t[e++],r=t[e++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=r&&(i.scrollLeft=r)}}}function T(e,t,i=t){let n=S||(S=document.createRange());return n.setEnd(e,i),n.setStart(e,t),n}function A(e,t,i,n){let r={key:t,code:t,keyCode:i,which:i,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,e.dispatchEvent(o);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,e.dispatchEvent(s),o.defaultPrevented||s.defaultPrevented}function P(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}function M(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function E(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n>0)return{node:i,offset:n};if(1==i.nodeType&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=b(i)}else{if(!i.parentNode||v(i))return null;n=g(i),i=i.parentNode}}}function D(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n<i.nodeValue.length)return{node:i,offset:n};if(1==i.nodeType&&n<i.childNodes.length){if("false"==i.contentEditable)return null;i=i.childNodes[n],n=0}else{if(!i.parentNode||v(i))return null;n=g(i)+1,i=i.parentNode}}}class L{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new L(e.parentNode,g(e),t)}static after(e,t){return new L(e.parentNode,g(e)+1,t)}}const R=[];class I{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let i,n=this.dom,r=null;for(let o of this.children){if(7&o.flags){if(!o.dom&&(i=r?r.nextSibling:n.firstChild)){let e=I.get(i);(!e||!e.parent&&e.canReuseDOM(o))&&o.reuseDOM(i)}o.sync(e,t),o.flags&=-8}if(i=r?r.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&i!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;i&&i!=o.dom;)i=N(i);else n.insertBefore(o.dom,i);r=o.dom}for(i=r?r.nextSibling:n.firstChild,i&&t&&t.node==n&&(t.written=!0);i;)i=N(i)}else if(1&this.flags)for(let i of this.children)7&i.flags&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let n=0==b(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==n&&t.firstChild!=t.lastChild&&(n=e==t.firstChild?-1:1),e=t}i=n<0?e:e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!I.get(i);)i=i.nextSibling;if(!i)return this.length;for(let e=0,t=0;;e++){let n=this.children[e];if(n.dom==i)return t;t+=n.length+n.breakAfter}}domBoundsAround(e,t,i=0){let n=-1,r=-1,o=-1,s=-1;for(let a=0,l=i,c=i;a<this.children.length;a++){let i=this.children[a],h=l+i.length;if(l<e&&h>t)return i.domBoundsAround(e,t,l);if(h>=e&&-1==n&&(n=a,r=l),l>t&&i.dom.parentNode==this.dom){o=a,s=c;break}c=h,l=h+i.breakAfter}return{from:r,to:s<0?i+this.length:s,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=R){this.markDirty();for(let n=e;n<t;n++){let e=this.children[n];e.parent==this&&i.indexOf(e)<0&&e.destroy()}this.children.splice(e,t-e,...i);for(let e=0;e<i.length;e++)i[e].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new z(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==e?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,i,n,r,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!(8&(this.flags|e.flags))}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}function N(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}I.prototype.breakAfter=0;class z{constructor(e,t,i){this.children=e,this.pos=t,this.i=i,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function B(e,t,i,n,r,o,s,a,l){let{children:c}=e,h=c.length?c[t]:null,u=o.length?o[o.length-1]:null,d=u?u.breakAfter:s;if(!(t==n&&h&&!s&&!d&&o.length<2&&h.merge(i,r,o.length?u:null,0==i,a,l))){if(n<c.length){let e=c[n];e&&(r<e.length||e.breakAfter&&(null==u?void 0:u.breakAfter))?(t==n&&(e=e.split(r),r=0),!d&&u&&e.merge(0,r,u,!0,0,l)?o[o.length-1]=e:((r||e.children.length&&!e.children[0].length)&&e.merge(0,r,null,!1,0,l),o.push(e))):(null==e?void 0:e.breakAfter)&&(u?u.breakAfter=1:s=1),n++}for(h&&(h.breakAfter=s,i>0&&(!s&&o.length&&h.merge(i,h.length,o[0],!1,a,0)?h.breakAfter=o.shift().breakAfter:(i<h.length||h.children.length&&0==h.children[h.children.length-1].length)&&h.merge(i,h.length,null,!1,a,0),t++));t<n&&o.length;)if(c[n-1].become(o[o.length-1]))n--,o.pop(),l=o.length?0:a;else{if(!c[t].become(o[0]))break;t++,o.shift(),a=o.length?0:l}!o.length&&t&&n<c.length&&!c[t-1].breakAfter&&c[n].merge(0,0,c[t-1],!1,a,l)&&t--,(t<n||o.length)&&e.replaceChildren(t,n,o)}}function j(e,t,i,n,r,o){let s=e.childCursor(),{i:a,off:l}=s.findPos(i,1),{i:c,off:h}=s.findPos(t,-1),u=t-i;for(let e of n)u+=e.length;e.length+=u,B(e,c,h,a,l,n,0,r,o)}let F="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},V="undefined"!=typeof document?document:{documentElement:{style:{}}};const W=/Edge\/(\d+)/.exec(F.userAgent),$=/MSIE \d/.test(F.userAgent),Q=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F.userAgent),H=!!($||Q||W),q=!H&&/gecko\/(\d+)/i.test(F.userAgent),Z=!H&&/Chrome\/(\d+)/.exec(F.userAgent),U="webkitFontSmoothing"in V.documentElement.style,X=!H&&/Apple Computer/.test(F.vendor),J=X&&(/Mobile\/\w+/.test(F.userAgent)||F.maxTouchPoints>2);var Y={mac:J||/Mac/.test(F.platform),windows:/Win/.test(F.platform),linux:/Linux|X11/.test(F.platform),ie:H,ie_version:$?V.documentMode||6:Q?+Q[1]:W?+W[1]:0,gecko:q,gecko_version:q?+(/Firefox\/(\d+)/.exec(F.userAgent)||[0,0])[1]:0,chrome:!!Z,chrome_version:Z?+Z[1]:0,ios:J,android:/Android\b/.test(F.userAgent),webkit:U,safari:X,webkit_version:U?+(/\bAppleWebKit\/(\d+)/.exec(F.userAgent)||[0,0])[1]:0,tabSize:null!=V.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class K extends I{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,i){return!(8&this.flags||i&&(!(i instanceof K)||this.length-(t-e)+i.length>256||8&i.flags)||(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new K(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new L(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,i){let n=e.nodeValue.length;t>n&&(t=n);let r=t,o=t,s=0;0==t&&i<0||t==n&&i>=0?Y.chrome||Y.gecko||(t?(r--,s=1):o<n&&(o++,s=-1)):i<0?r--:o<n&&o++;let a=T(e,r,o).getClientRects();if(!a.length)return null;let l=a[(s?s<0:i>=0)?0:a.length-1];return Y.safari&&!s&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l),s?w(l,s<0):l||null}(this.dom,e,t)}}class G extends I{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let e of t)e.setParent(this)}setAttrs(e){if(P(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,n,r,o){return!(i&&(!(i instanceof G&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)||(j(this,e,t,i?i.children.slice():[],r-1,o-1),this.markDirty(),0))}split(e){let t=[],i=0,n=-1,r=0;for(let o of this.children){let s=i+o.length;s>e&&t.push(i<e?o.split(e-i):o),n<0&&i>=e&&(n=r),i=s,r++}let o=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new G(this.mark,t,o)}domAtPos(e){return ie(this,e)}coordsAt(e,t){return re(this,e,t)}}class ee extends I{static create(e,t,i){return new ee(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ee.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,n,r,o){return!(i&&(!(i instanceof ee&&this.widget.compare(i.widget))||e>0&&r<=0||t<this.length&&o<=0)||(this.length=e+(i?i.length:0)+(this.length-t),0))}become(e){return e instanceof ee&&e.side==this.side&&this.widget.constructor==e.widget.constructor&&(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(0==this.length)return n.xv.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,i=t&&t.state.doc,r=this.posAtStart;return i?i.slice(r,r+this.length):n.xv.empty}domAtPos(e){return(this.length?0==e:this.side>0)?L.before(this.dom):L.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:e>0;for(let t=o?n.length-1:0;r=n[t],!(e>0?0==t:t==n.length-1||r.top<r.bottom);t+=o?-1:1);return w(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class te extends I{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof te&&e.side==this.side}split(){return new te(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?L.before(this.dom):L.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return n.xv.empty}get isHidden(){return!0}}function ie(e,t){let i=e.dom,{children:n}=e,r=0;for(let e=0;r<n.length;r++){let o=n[r],s=e+o.length;if(!(s==e&&o.getSide()<=0)){if(t>e&&t<s&&o.dom.parentNode==i)return o.domAtPos(t-e);if(t<=e)break;e=s}}for(let e=r;e>0;e--){let t=n[e-1];if(t.dom.parentNode==i)return t.domAtPos(t.length)}for(let e=r;e<n.length;e++){let t=n[e];if(t.dom.parentNode==i)return t.domAtPos(0)}return new L(i,0)}function ne(e,t,i){let n,{children:r}=e;i>0&&t instanceof G&&r.length&&(n=r[r.length-1])instanceof G&&n.mark.eq(t.mark)?ne(n,t.children[0],i-1):(r.push(t),t.setParent(e)),e.length+=t.length}function re(e,t,i){let n=null,r=-1,o=null,s=-1;!function e(t,a){for(let l=0,c=0;l<t.children.length&&c<=a;l++){let h=t.children[l],u=c+h.length;u>=a&&(h.children.length?e(h,a-c):(!o||o.isHidden&&i>0)&&(u>a||c==u&&h.getSide()>0)?(o=h,s=a-c):(c<a||c==u&&h.getSide()<0&&!h.isHidden)&&(n=h,r=a-c)),c=u}}(e,t);let a=(i<0?n:o)||n||o;return a?a.coordsAt(Math.max(0,a==n?r:s),i):function(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let i=f(t);return i[i.length-1]||null}(e)}function oe(e,t){for(let i in e)"class"==i&&t.class?t.class+=" "+e.class:"style"==i&&t.style?t.style+=";"+e.style:t[i]=e[i];return t}K.prototype.children=ee.prototype.children=te.prototype.children=R;const se=Object.create(null);function ae(e,t,i){if(e==t)return!0;e||(e=se),t||(t=se);let n=Object.keys(e),r=Object.keys(t);if(n.length-(i&&n.indexOf(i)>-1?1:0)!=r.length-(i&&r.indexOf(i)>-1?1:0))return!1;for(let o of n)if(o!=i&&(-1==r.indexOf(o)||e[o]!==t[o]))return!1;return!0}function le(e,t,i){let n=!1;if(t)for(let r in t)i&&r in i||(n=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(i)for(let r in i)t&&t[r]==i[r]||(n=!0,"style"==r?e.style.cssText=i[r]:e.setAttribute(r,i[r]));return n}function ce(e){let t=Object.create(null);for(let i=0;i<e.attributes.length;i++){let n=e.attributes[i];t[n.name]=n.value}return t}class he{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ue=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(ue||(ue={}));class de extends n.uU{constructor(e,t,i,n){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(e){return new pe(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new me(e,t,t,i,e.widget||null,!1)}static replace(e){let t,i,n=!!e.block;if(e.isBlockGap)t=-5e8,i=4e8;else{let{start:r,end:o}=ge(e,n);t=(r?n?-3e8:-1:5e8)-1,i=1+(o?n?2e8:1:-6e8)}return new me(e,t,i,n,e.widget||null,!0)}static line(e){return new fe(e)}static set(e,t=!1){return n.Xs.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}de.none=n.Xs.empty;class pe extends de{constructor(e){let{start:t,end:i}=ge(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof pe&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(i=e.attrs)||void 0===i?void 0:i.class))&&ae(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}pe.prototype.point=!1;class fe extends de{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof fe&&this.spec.class==e.spec.class&&ae(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}fe.prototype.mapMode=n.gc.TrackBefore,fe.prototype.point=!0;class me extends de{constructor(e,t,i,r,o,s){super(t,i,o,e),this.block=r,this.isReplace=s,this.mapMode=r?t<=0?n.gc.TrackBefore:n.gc.TrackAfter:n.gc.TrackDel}get type(){return this.startSide!=this.endSide?ue.WidgetRange:this.startSide<=0?ue.WidgetBefore:ue.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof me&&((t=this.widget)==(i=e.widget)||!!(t&&i&&t.compare(i)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,i}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function ge(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function ve(e,t,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=e?i[r]=Math.max(i[r],t):i.push(e,t)}me.prototype.point=!0;class ye extends I{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,n,r,o){if(i){if(!(i instanceof ye))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),j(this,e,t,i?i.children.slice():[],r,o),!0}split(e){let t=new ye;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:i,off:n}=this.childPos(e);n&&(t.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let e=i;e<this.children.length;e++)t.append(this.children[e],0);for(;i>0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){ae(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){ne(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=oe(t,this.attrs||{})),i&&(this.attrs=oe({class:i},this.attrs||{}))}domAtPos(e){return ie(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?4&this.flags&&(P(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(le(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let n=this.dom.lastChild;for(;n&&I.get(n)instanceof G;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=I.get(n))||void 0===i?void 0:i.isEditable)||Y.ios&&this.children.some((e=>e instanceof K))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let i of this.children){if(!(i instanceof K)||/[^ -~]/.test(i.text))return null;let n=f(i.dom);if(1!=n.length)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let i=re(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=i.bottom-i.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight<t){let n=(t-e.textHeight)/2;return{top:i.top+n,bottom:i.bottom-n,left:i.left,right:i.left}}}return i}become(e){return e instanceof ye&&0==this.children.length&&0==e.children.length&&ae(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let i=0,n=0;i<e.children.length;i++){let r=e.children[i],o=n+r.length;if(o>=t){if(r instanceof ye)return r;if(o>t)break}n=o+r.breakAfter}return null}}class be extends I{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,n,r,o){return!(i&&(!(i instanceof be&&this.widget.compare(i.widget))||e>0&&r<=0||t<this.length&&o<=0)||(this.length=e+(i?i.length:0)+(this.length-t),0))}domAtPos(e){return 0==e?L.before(this.dom):L.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new be(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return R}sync(e){this.dom&&this.widget.updateDOM(this.dom,e)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):n.xv.empty}domBoundsAround(){return null}become(e){return e instanceof be&&e.widget.constructor==this.widget.constructor&&(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){return this.widget.coordsAt(this.dom,e,t)||(this.widget instanceof we?null:w(this.dom.getBoundingClientRect(),this.length?0==e:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:i}=this.deco;return t!=i&&(e<0?t<0:i>0)}}class we extends he{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ke{constructor(e,t,i,n){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof be&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ye),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(xe(new te(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||e&&this.content.length&&this.content[this.content.length-1]instanceof be||this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}this.text=t,this.textOff=0}let n=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(xe(new K(this.text.slice(this.textOff,this.textOff+n)),t),i),this.atCursorPos=!0,this.textOff+=n,e-=n,i=0}}span(e,t,i,n){this.buildText(t-e,i,n),this.pos=t,this.openStart<0&&(this.openStart=n)}point(e,t,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof me){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let s=t-e;if(i instanceof me)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new be(i.widget||_e.block,s,i));else{let o=ee.create(i.widget||_e.inline,s,s?0:i.startSide),a=this.atCursorPos&&!o.isEditable&&r<=n.length&&(e<t||i.startSide>0),l=!o.isEditable&&(e<t||r>n.length||i.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(c.append(xe(new te(1),n),r),r=n.length+Math.max(0,r-n.length)),c.append(xe(o,n),r),this.atCursorPos=l,this.pendingBuffer=l?e<t||r>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,r,o){let s=new ke(e,t,i,o);return s.openEnd=n.Xs.spans(r,t,i,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function xe(e,t){for(let i of t)e=new G(i,[e],e.length);return e}class _e extends he{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}_e.inline=new _e("span"),_e.block=new _e("div");var Se=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Se||(Se={}));const Oe=Se.LTR,Ce=Se.RTL;function Te(e){let t=[];for(let i=0;i<e.length;i++)t.push(1<<+e[i]);return t}const Ae=Te("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Pe=Te("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Me=Object.create(null),Ee=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),i=e.charCodeAt(1);Me[t]=i,Me[i]=-t}function De(e){return e<=247?Ae[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?Pe[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const Le=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Re{get dir(){return this.level%2?Ce:Oe}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,n){let r=-1;for(let o=0;o<e.length;o++){let s=e[o];if(s.from<=t&&s.to>=t){if(s.level==i)return o;(r<0||(0!=n?n<0?s.from<t:s.to>t:e[r].level>s.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function Ie(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],r=t[i];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!Ie(n.inner,r.inner))return!1}return!0}const Ne=[];function ze(e,t,i,n,r,o,s){let a=n%2?2:1;if(n%2==r%2)for(let l=t,c=0;l<i;){let t=!0,h=!1;if(c==o.length||l<o[c].from){let e=Ne[l];e!=a&&(t=!1,h=16==e)}let u=t||1!=a?null:[],d=t?n:n+1,p=l;e:for(;;)if(c<o.length&&p==o[c].from){if(h)break e;let f=o[c];if(!t)for(let e=f.to,t=c+1;;){if(e==i)break e;if(!(t<o.length&&o[t].from==e)){if(Ne[e]==a)break e;break}e=o[t++].to}c++,u?u.push(f):(f.from>l&&s.push(new Re(l,f.from,d)),Be(e,f.direction==Oe!=!(d%2)?n+1:n,r,f.inner,f.from,f.to,s),l=f.to),p=f.to}else{if(p==i||(t?Ne[p]!=a:Ne[p]==a))break;p++}u?ze(e,l,p,n+1,r,u,s):l<p&&s.push(new Re(l,p,d)),l=p}else for(let l=i,c=o.length;l>t;){let i=!0,h=!1;if(!c||l>o[c-1].to){let e=Ne[l-1];e!=a&&(i=!1,h=16==e)}let u=i||1!=a?null:[],d=i?n:n+1,p=l;e:for(;;)if(c&&p==o[c-1].to){if(h)break e;let f=o[--c];if(!i)for(let e=f.from,i=c;;){if(e==t)break e;if(!i||o[i-1].to!=e){if(Ne[e-1]==a)break e;break}e=o[--i].from}u?u.push(f):(f.to<l&&s.push(new Re(f.to,l,d)),Be(e,f.direction==Oe!=!(d%2)?n+1:n,r,f.inner,f.from,f.to,s),l=f.from),p=f.from}else{if(p==t||(i?Ne[p-1]!=a:Ne[p-1]==a))break;p--}u?ze(e,p,l,n+1,r,u,s):p<l&&s.push(new Re(p,l,d)),l=p}}function Be(e,t,i,n,r,o,s){let a=t%2?2:1;!function(e,t,i,n,r){for(let o=0;o<=n.length;o++){let s=o?n[o-1].to:t,a=o<n.length?n[o].from:i,l=o?256:r;for(let t=s,i=l,n=l;t<a;t++){let r=De(e.charCodeAt(t));512==r?r=i:8==r&&4==n&&(r=16),Ne[t]=4==r?2:r,7&r&&(n=r),i=r}for(let e=s,t=l,n=l;e<a;e++){let r=Ne[e];if(128==r)e<a-1&&t==Ne[e+1]&&24&t?r=Ne[e]=t:Ne[e]=256;else if(64==r){let r=e+1;for(;r<a&&64==Ne[r];)r++;let o=e&&8==t||r<i&&8==Ne[r]?1==n?1:8:256;for(let t=e;t<r;t++)Ne[t]=o;e=r-1}else 8==r&&1==n&&(Ne[e]=1);t=r,7&r&&(n=r)}}}(e,r,o,n,a),function(e,t,i,n,r){let o=1==r?2:1;for(let s=0,a=0,l=0;s<=n.length;s++){let c=s?n[s-1].to:t,h=s<n.length?n[s].from:i;for(let t,i,n,s=c;s<h;s++)if(i=Me[t=e.charCodeAt(s)])if(i<0){for(let e=a-3;e>=0;e-=3)if(Ee[e+1]==-i){let t=Ee[e+2],i=2&t?r:4&t?1&t?o:r:0;i&&(Ne[s]=Ne[Ee[e]]=i),a=e;break}}else{if(189==Ee.length)break;Ee[a++]=s,Ee[a++]=t,Ee[a++]=l}else if(2==(n=Ne[s])||1==n){let e=n==r;l=e?0:1;for(let t=a-3;t>=0;t-=3){let i=Ee[t+2];if(2&i)break;if(e)Ee[t+2]|=2;else{if(4&i)break;Ee[t+2]|=4}}}}}(e,r,o,n,a),function(e,t,i,n){for(let r=0,o=n;r<=i.length;r++){let s=r?i[r-1].to:e,a=r<i.length?i[r].from:t;for(let l=s;l<a;){let s=Ne[l];if(256==s){let s=l+1;for(;;)if(s==a){if(r==i.length)break;s=i[r++].to,a=r<i.length?i[r].from:t}else{if(256!=Ne[s])break;s++}let c=1==o,h=c==(1==(s<t?Ne[s]:n))?c?1:2:n;for(let t=s,n=r,o=n?i[n-1].to:e;t>l;)t==o&&(t=i[--n].from,o=n?i[n-1].to:e),Ne[--t]=h;l=s}else o=s,l++}}}(r,o,n,a),ze(e,r,o,t,i,n,s)}function je(e,t,i){if(!e)return[new Re(0,0,t==Ce?1:0)];if(t==Oe&&!i.length&&!Le.test(e))return Fe(e.length);if(i.length)for(;e.length>Ne.length;)Ne[Ne.length]=256;let n=[],r=t==Oe?0:1;return Be(e,r,r,i,0,e.length,n),n}function Fe(e){return[new Re(0,e,0)]}let Ve="";function We(e,t,i,r,o){var s;let a=r.head-e.from,l=Re.find(t,a,null!==(s=r.bidiLevel)&&void 0!==s?s:-1,r.assoc),c=t[l],h=c.side(o,i);if(a==h){let e=l+=o?1:-1;if(e<0||e>=t.length)return null;c=t[l=e],a=c.side(!o,i),h=c.side(o,i)}let u=(0,n.cp)(e.text,a,c.forward(o,i));(u<c.from||u>c.to)&&(u=h),Ve=e.text.slice(Math.min(a,u),Math.max(a,u));let d=l==(o?t.length-1:0)?null:t[l+(o?1:-1)];return d&&u==h&&d.level+(o?0:1)<c.level?n.jT.cursor(d.side(!o,i)+e.from,d.forward(o,i)?1:-1,d.level):n.jT.cursor(u+e.from,c.forward(o,i)?-1:1,c.level)}function $e(e,t,i){for(let n=t;n<i;n++){let t=De(e.charCodeAt(n));if(1==t)return Oe;if(2==t||4==t)return Ce}return Oe}const Qe=n.r$.define(),He=n.r$.define(),qe=n.r$.define(),Ze=n.r$.define(),Ue=n.r$.define(),Xe=n.r$.define(),Je=n.r$.define(),Ye=n.r$.define(),Ke=n.r$.define(),Ge=n.r$.define({combine:e=>e.some((e=>e))}),et=n.r$.define({combine:e=>e.some((e=>e))}),tt=n.r$.define();class it{constructor(e,t="nearest",i="nearest",n=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new it(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new it(n.jT.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const nt=n.Py.define({map:(e,t)=>e.map(t)}),rt=n.Py.define();function ot(e,t,i){let n=e.facet(Ze);n.length?n[0](t):window.onerror?window.onerror(String(t),i,void 0,void 0,t):i?console.error(i+":",t):console.error(t)}const st=n.r$.define({combine:e=>!e.length||e[0]});let at=0;const lt=n.r$.define();class ct{constructor(e,t,i,n,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=t||{};return new ct(at++,e,i,n,(e=>{let t=[lt.of(e)];return o&&t.push(pt.of((t=>{let i=t.plugin(e);return i?o(i):de.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return ct.define((t=>new e(t)),t)}}class ht{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(ot(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){ot(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){ot(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ut=n.r$.define(),dt=n.r$.define(),pt=n.r$.define(),ft=n.r$.define(),mt=n.r$.define(),gt=n.r$.define();function vt(e,t){let i=e.state.facet(gt);if(!i.length)return i;let r=i.map((t=>t instanceof Function?t(e):t)),o=[];return n.Xs.spans(r,t.from,t.to,{point(){},span(e,i,n,r){let s=e-t.from,a=i-t.from,l=o;for(let e=n.length-1;e>=0;e--,r--){let i,o=n[e].spec.bidiIsolate;if(null==o&&(o=$e(t.text,s,a)),r>0&&l.length&&(i=l[l.length-1]).to==s&&i.direction==o)i.to=a,l=i.inner;else{let e={from:s,to:a,direction:o,inner:[]};l.push(e),l=e.inner}}}}),o}const yt=n.r$.define();function bt(e){let t=0,i=0,n=0,r=0;for(let o of e.state.facet(yt)){let s=o(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(i=Math.max(i,s.right)),null!=s.top&&(n=Math.max(n,s.top)),null!=s.bottom&&(r=Math.max(r,s.bottom)))}return{left:t,right:i,top:n,bottom:r}}const wt=n.r$.define();class kt{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new kt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(0==t.length)return e;let i=[];for(let n=0,r=0,o=0,s=0;;n++){let a=n==e.length?null:e[n],l=o-s,c=a?a.fromB:1e9;for(;r<t.length&&t[r]<c;){let e=t[r],n=t[r+1],o=Math.max(s,e),a=Math.min(c,n);if(o<=a&&new kt(o+l,a+l,o,a).addToSet(i),n>c)break;r+=2}if(!a)return i;new kt(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,s=a.toB}}}class xt{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=n.as.empty(this.startState.doc.length);for(let e of i)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges(((e,t,i,n)=>r.push(new kt(e,t,i,n)))),this.changedRanges=r}static create(e,t,i){return new xt(e,t,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class _t extends I{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=de.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ye],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new kt(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every((({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?r=this.domChanged.newSel.head:function(e,t){let i=!1;return t&&e.iterChangedRanges(((e,n)=>{e<t.to&&n>t.from&&(i=!0)})),i}(e.changes,this.hasComposition)||e.selectionSet||(r=e.state.selection.main.head));let o=r>-1?function(e,t,i){let n=St(e,i);if(!n)return null;let{node:r,from:o,to:s}=n,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(n.from,n.to)!=a)return null;let l=t.invertedDesc,c=new kt(l.mapPos(o),l.mapPos(s),o,s),h=[];for(let t=r.parentNode;;t=t.parentNode){let i=I.get(t);if(i instanceof G)h.push({node:t,deco:i.mark});else{if(i instanceof ye||"DIV"==t.nodeName&&t.parentNode==e.contentDOM)return{range:c,text:r,marks:h,line:t};if(t==e.contentDOM)return null;h.push({node:t,deco:new pe({inclusive:!0,attributes:ce(t),tagName:t.tagName.toLowerCase()})})}}}(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:n}=this.hasComposition;i=new kt(t,n,e.changes.mapPos(t,-1),e.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Y.ie||Y.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=function(e,t,i){let r=new class{constructor(){this.changes=[]}compareRange(e,t){ve(e,t,this.changes)}comparePoint(e,t){ve(e,t,this.changes)}};return n.Xs.compare(e,t,i,r),r.changes}(this.decorations,this.updateDeco(),e.changes);return i=kt.extendWithRanges(i,s),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:n}=this.view;n.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=Y.chrome||Y.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||n.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.children)e instanceof be&&e.widget instanceof we&&r.push(e.dom);n.updateGaps(r)}updateChildren(e,t,i){let n=i?i.range.addToSet(e.slice()):e,r=this.childCursor(t);for(let e=n.length-1;;e--){let t=e>=0?n[e]:null;if(!t)break;let o,s,a,l,{fromA:c,toA:h,fromB:u,toB:d}=t;if(i&&i.range.fromB<d&&i.range.toB>u){let e=ke.build(this.view.state.doc,u,i.range.fromB,this.decorations,this.dynamicDecorationMap),t=ke.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);s=e.breakAtStart,a=e.openStart,l=t.openEnd;let n=this.compositionView(i);t.breakAtStart?n.breakAfter=1:t.content.length&&n.merge(n.length,n.length,t.content[0],!1,t.openStart,0)&&(n.breakAfter=t.content[0].breakAfter,t.content.shift()),e.content.length&&n.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),o=e.content.concat(n).concat(t.content)}else({content:o,breakAtStart:s,openStart:a,openEnd:l}=ke.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:p,off:f}=r.findPos(h,1),{i:m,off:g}=r.findPos(c,-1);B(this,m,g,p,f,o,s,a,l)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(rt)&&(this.editContextFormatting=e.value)}compositionView(e){let t=new K(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new G(i,[t],t.length);let i=new ye;return i.append(t,0),i}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let i=I.get(e);i&&i!=t&&(i.dom=null),t.setDOM(e)},i=this.childPos(e.range.fromB,1),n=this.children[i.i];t(e.line,n);for(let r=e.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],t(r>=0?e.marks[r].node:e.text,n)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&p(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(s.anchor)),l=s.empty?a:this.moveToLine(this.domAtPos(s.head));if(Y.gecko&&s.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=l=new L(e,0),o=!0}var c;let h=this.view.observer.selectionRange;!o&&h.focusNode&&(m(a.node,a.offset,h.anchorNode,h.anchorOffset)&&m(l.node,l.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,s))||(this.view.observer.ignore((()=>{Y.android&&Y.chrome&&this.dom.contains(h.focusNode)&&function(e,t){for(let i=e;i&&i!=t;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=u(this.view.root);if(e)if(s.empty){if(Y.gecko){let e=(t=a.node,n=a.offset,1!=t.nodeType?0:(n&&"false"==t.childNodes[n-1].contentEditable?1:0)|(n<t.childNodes.length&&"false"==t.childNodes[n].contentEditable?2:0));if(e&&3!=e){let t=(1==e?E:D)(a.node,a.offset);t&&(a=new L(t.node,t.offset))}}e.collapse(a.node,a.offset),null!=s.bidiLevel&&void 0!==e.caretBidiLevel&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(a.node,a.offset);try{e.extend(l.node,l.offset)}catch(e){}}else{let t=document.createRange();s.anchor>s.head&&([a,l]=[l,a]),t.setEnd(l.node,l.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,n;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new L(h.anchorNode,h.anchorOffset),this.impreciseHead=l.precise?null:new L(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&m(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=u(e.root),{anchorNode:n,anchorOffset:r}=e.observer.selectionRange;if(!(i&&t.empty&&t.assoc&&i.modify))return;let o=ye.find(this,t.head);if(!o)return;let s=o.posAtStart;if(t.head==s||t.head==s+o.length)return;let a=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&i.collapse(n,r)}moveToLine(e){let t,i=this.dom;if(e.node!=i)return e;for(let n=e.offset;!t&&n<i.childNodes.length;n++){let e=I.get(i.childNodes[n]);e instanceof ye&&(t=e.domAtPos(0))}for(let n=e.offset-1;!t&&n>=0;n--){let e=I.get(i.childNodes[n]);e instanceof ye&&(t=e.domAtPos(e.length))}return t?new L(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=I.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let e=this.children[t];if(i<e.length||e instanceof ye)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,n=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let s=this.children[o],a=r-s.breakAfter,l=a-s.length;if(a<e)break;if(l<=e&&(l<e||s.covers(-1))&&(a>e||s.covers(1))&&(!i||s instanceof ye&&!(i instanceof ye&&t>=0)))i=s,n=l;else if(i&&l==e&&a==e&&s instanceof be&&Math.abs(t)<2){if(s.deco.startSide<0)break;o&&(i=null)}r=l}return i?i.coordsAt(e-n,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),r=this.children[t];if(!(r instanceof ye))return null;for(;r.children.length;){let{i:e,off:t}=r.childPos(i,1);for(;;e++){if(e==r.children.length)return null;if((r=r.children[e]).length)break}i=t}if(!(r instanceof K))return null;let o=(0,n.cp)(r.text,i);if(o==i)return null;let s=T(r.dom,i,o).getClientRects();for(let e=0;e<s.length;e++){let t=s[e];if(e==s.length-1||t.top<t.bottom&&t.left<t.right)return t}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:n}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,a=this.view.textDirection==Se.LTR;for(let e=0,l=0;l<this.children.length;l++){let c=this.children[l],h=e+c.length;if(h>n)break;if(e>=i){let i=c.dom.getBoundingClientRect();if(t.push(i.height),o){let t=c.dom.lastChild,n=t?f(t):[];if(n.length){let t=n[n.length-1],o=a?t.right-i.left:i.right-t.left;o>s&&(s=o,this.minWidth=r,this.minWidthFrom=e,this.minWidthTo=h)}}}e=h+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?Se.RTL:Se.LTR}measureTextSize(){for(let e of this.children)if(e instanceof ye){let t=e.measureTextSize();if(t)return t}let e,t,i,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let r=f(n.firstChild)[0];e=n.getBoundingClientRect().height,t=r?r.width/27:7,i=r?r.height:e,n.remove()})),{lineHeight:e,charWidth:t,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new z(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],o=r?r.from-1:this.length;if(o>i){let n=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(de.replace({widget:new we(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return de.set(e)}updateDeco(){let e=1,t=this.view.state.facet(pt).map((t=>(this.dynamicDecorationMap[e++]="function"==typeof t)?t(this.view):t)),i=!1,r=this.view.state.facet(ft).map(((e,t)=>{let n="function"==typeof e;return n&&(i=!0),n?e(this.view):e}));for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(n.Xs.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);return this.view.scrollDOM.scrollTop=t.top-e.yMargin,void(this.view.scrollDOM.scrollLeft=e.xMargin)}for(let t of this.view.state.facet(tt))try{if(t(this.view,e.range,e))return!0}catch(e){ot(this.view.state,e,"scroll handler")}let t,{range:i}=e,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!n)return;!i.empty&&(t=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});let r=bt(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:s,offsetHeight:a}=this.view.scrollDOM;!function(e,t,i,n,r,o,s,a){let l=e.ownerDocument,c=l.defaultView||window;for(let h=e,u=!1;h&&!u;)if(1==h.nodeType){let e,d=h==l.body,p=1,f=1;if(d)e=k(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let t=h.getBoundingClientRect();({scaleX:p,scaleY:f}=x(h,t)),e={left:t.left,right:t.left+h.clientWidth*p,top:t.top,bottom:t.top+h.clientHeight*f}}let m=0,g=0;if("nearest"==r)t.top<e.top?(g=-(e.top-t.top+s),i>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+g+s)):t.bottom>e.bottom&&(g=t.bottom-e.bottom+s,i<0&&t.top-g<e.top&&(g=-(e.top+g-t.top+s)));else{let n=t.bottom-t.top,o=e.bottom-e.top;g=("center"==r&&n<=o?t.top+n/2-o/2:"start"==r||"center"==r&&i<0?t.top-s:t.bottom-o+s)-e.top}if("nearest"==n?t.left<e.left?(m=-(e.left-t.left+o),i>0&&t.right>e.right+m&&(m=t.right-e.right+m+o)):t.right>e.right&&(m=t.right-e.right+o,i<0&&t.left<e.left+m&&(m=-(e.left+m-t.left+o))):m=("center"==n?t.left+(t.right-t.left)/2-(e.right-e.left)/2:"start"==n==a?t.left-o:t.right-(e.right-e.left)+o)-e.left,m||g)if(d)c.scrollBy(m,g);else{let e=0,i=0;if(g){let e=h.scrollTop;h.scrollTop+=g/f,i=(h.scrollTop-e)*f}if(m){let t=h.scrollLeft;h.scrollLeft+=m/p,e=(h.scrollLeft-t)*p}t={left:t.left-e,top:t.top-i,right:t.right-e,bottom:t.bottom-i},e&&Math.abs(e-m)<1&&(n="nearest"),i&&Math.abs(i-g)<1&&(r="nearest")}if(d)break;h=h.assignedSlot||h.parentNode}else{if(11!=h.nodeType)break;h=h.host}}(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,s),-s),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Se.LTR)}}function St(e,t){let i=e.observer.selectionRange;if(!i.focusNode)return null;let n=E(i.focusNode,i.focusOffset),r=D(i.focusNode,i.focusOffset),o=n||r;if(r&&n&&r.node!=n.node){let t=I.get(r.node);if(!t||t instanceof K&&t.text!=r.node.nodeValue)o=r;else if(e.docView.lastCompositionAfterCursor){let e=I.get(n.node);!e||e instanceof K&&e.text!=n.node.nodeValue||(o=r)}}if(e.docView.lastCompositionAfterCursor=o!=n,!o)return null;let s=t-o.offset;return{from:s,to:s+o.node.nodeValue.length,node:o.node}}function Ot(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function Ct(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function Tt(e,t){return e.top<t.bottom-1&&e.bottom>t.top+1}function At(e,t){return t<e.top?{top:t,left:e.left,right:e.right,bottom:e.bottom}:e}function Pt(e,t){return t>e.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Mt(e,t,i){let n,r,o,s,a,l,c,h,u=!1;for(let d=e.firstChild;d;d=d.nextSibling){let e=f(d);for(let p=0;p<e.length;p++){let f=e[p];r&&Tt(r,f)&&(f=At(Pt(f,r.bottom),r.top));let m=Ot(t,f),g=Ct(i,f);if(0==m&&0==g)return 3==d.nodeType?Et(d,t,i):Mt(d,t,i);if(!n||s>g||s==g&&o>m){n=d,r=f,o=m,s=g;let a=g?i<f.top?-1:1:m?t<f.left?-1:1:0;u=!a||(a>0?p<e.length-1:p>0)}0==m?i>f.bottom&&(!c||c.bottom<f.bottom)?(a=d,c=f):i<f.top&&(!h||h.top>f.top)&&(l=d,h=f):c&&Tt(c,f)?c=Pt(c,f.bottom):h&&Tt(h,f)&&(h=At(h,f.top))}}if(c&&c.bottom>=i?(n=a,r=c):h&&h.top<=i&&(n=l,r=h),!n)return{node:e,offset:0};let d=Math.max(r.left,Math.min(r.right,t));return 3==n.nodeType?Et(n,d,i):u&&"false"!=n.contentEditable?Mt(n,d,i):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,n)+(t>=(r.left+r.right)/2?1:0)}}function Et(e,t,i){let n=e.nodeValue.length,r=-1,o=1e9,s=0;for(let a=0;a<n;a++){let n=T(e,a,a+1).getClientRects();for(let l=0;l<n.length;l++){let c=n[l];if(c.top==c.bottom)continue;s||(s=t-c.left);let h=(c.top>i?c.top-i:i-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&h<o){let i=t>=(c.left+c.right)/2,n=i;if((Y.chrome||Y.gecko)&&T(e,a).getBoundingClientRect().left==c.right&&(n=!i),h<=0)return{node:e,offset:a+(n?1:0)};r=a+(n?1:0),o=h}}}return{node:e,offset:r>-1?r:s>0?e.nodeValue.length:0}}function Dt(e,t,i,n=-1){var r,o;let s,a=e.contentDOM.getBoundingClientRect(),l=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:h,y:u}=t,d=u-l;if(d<0)return 0;if(d>c)return e.state.doc.length;for(let t=e.viewState.heightOracle.textHeight/2,r=!1;s=e.elementAtHeight(d),s.type!=ue.Text;)for(;d=n>0?s.bottom+t:s.top-t,!(d>=0&&d<=c);){if(r)return i?null:0;r=!0,n=-n}u=l+d;let p=s.from;if(p<e.viewport.from)return 0==e.viewport.from?0:i?null:Lt(e,a,s,h,u);if(p>e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:i?null:Lt(e,a,s,h,u);let f=e.dom.ownerDocument,m=e.root.elementFromPoint?e.root:f,g=m.elementFromPoint(h,u);g&&!e.contentDOM.contains(g)&&(g=null),g||(h=Math.max(a.left+1,Math.min(a.right-1,h)),g=m.elementFromPoint(h,u),g&&!e.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&0!=(null===(r=e.docView.nearest(g))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(h,u);e&&({offsetNode:v,offset:y}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(h,u);t&&(({startContainer:v,startOffset:y}=t),(!e.contentDOM.contains(v)||Y.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return T(e,n-1,n).getBoundingClientRect().left>i}(v,y,h)||Y.chrome&&function(e,t,i){if(0!=t)return!1;for(let t=e;;){let e=t.parentNode;if(!e||1!=e.nodeType||e.firstChild!=t)return!1;if(e.classList.contains("cm-line"))break;t=e}return i-(1==e.nodeType?e.getBoundingClientRect():T(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect()).left>5}(v,y,h))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=ye.find(e.docView,p);if(!t)return d>s.top+s.height/2?s.to:s.from;({node:v,offset:y}=Mt(t.dom,h,u))}let b=e.docView.nearest(v);if(!b)return null;if(b.isWidget&&1==(null===(o=b.dom)||void 0===o?void 0:o.nodeType)){let e=b.dom.getBoundingClientRect();return t.y<e.top||t.y<=e.bottom&&t.x<=(e.left+e.right)/2?b.posAtStart:b.posAtEnd}return b.localPosFromDOM(v,y)+b.posAtStart}function Lt(e,t,i,r,o){let s=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&i.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;s+=Math.floor((o-i.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let a=e.state.sliceDoc(i.from,i.to);return i.from+(0,n.Gz)(a,s,e.state.tabSize)}function Rt(e,t){let i=e.lineBlockAt(t);if(Array.isArray(i.type))for(let e of i.type)if(e.to>t||e.to==t&&(e.to==i.to||e.type==ue.Text))return e;return i}function It(e,t,i,n){let r=e.state.doc.lineAt(t.head),o=e.bidiSpans(r),s=e.textDirectionAt(r.from);for(let a=t,l=null;;){let t=We(r,o,s,a,i),c=Ve;if(!t){if(r.number==(i?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(i?1:-1)),o=e.bidiSpans(r),t=e.visualLineSide(r,!i)}if(l){if(!l(c))return a}else{if(!n)return t;l=n(c)}a=t}}function Nt(e,t,i){for(;;){let n=0;for(let r of e)r.between(t-1,t+1,((e,r,o)=>{if(t>e&&t<r){let o=n||i||(t-e<r-t?-1:1);t=o<0?e:r,n=o}}));if(!n)return t}}function zt(e,t,i){let r=Nt(e.state.facet(mt).map((t=>t(e))),i.from,t.head>i.from?-1:1);return r==i.from?i:n.jT.cursor(r,r<i.from?1:-1)}const Bt="";class jt{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(n.yy.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Bt}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let e=this.text.length;this.readNode(n);let r=n.nextSibling;if(r==t)break;let o=I.get(n),s=I.get(r);(o&&s?o.breakAfter:(o?o.breakAfter:v(n))||v(r)&&("BR"!=n.nodeName||n.cmIgnore)&&this.text.length>e)&&this.lineBreak(),n=r}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r,o=-1,s=1;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,i),s=this.lineSeparator.length):(r=n.exec(t))&&(o=r.index,s=r[0].length),this.append(t.slice(i,o<0?t.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=s-1);i=o+s}}readNode(e){if(e.cmIgnore)return;let t=I.get(e),i=t&&t.overrideDOMText;if(null!=i){this.findPointInside(e,i.length);for(let e=i.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(3==e.nodeType?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Ft(e,i.node,i.offset)?t:0))}}function Ft(e,t,i){for(;;){if(!t||i<b(t))return!1;if(t==e)return!0;i=g(t)+1,t=t.parentNode}}class Vt{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Wt{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let t=o||s?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:o}=e.observer.selectionRange;return i&&(t.push(new Vt(i,n)),r==i&&o==n||t.push(new Vt(r,o))),t}(e),i=new jt(t,e.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(e,t){if(0==e.length)return null;let i=e[0].pos,r=2==e.length?e[1].pos:i;return i>-1&&r>-1?n.jT.single(i+t,r+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,i=o&&o.node==t.focusNode&&o.offset==t.focusOffset||!d(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=s&&s.node==t.anchorNode&&s.offset==t.anchorOffset||!d(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),a=e.viewport;if((Y.ios||Y.chrome)&&e.state.selection.main.empty&&i!=r&&(a.from>0||a.to<e.state.doc.length)){let t=Math.min(i,r),n=Math.max(i,r),o=a.from-t,s=a.to-n;0!=o&&1!=o&&0!=t||0!=s&&-1!=s&&n!=e.state.doc.length||(i=0,r=e.state.doc.length)}this.newSel=n.jT.single(r,i)}}}function $t(e,t){let i,{newSel:r}=t,o=e.state.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:r,to:a}=t.bounds,l=o.from,c=null;(8===s||Y.android&&t.text.length<a-r)&&(l=o.to,c="end");let h=function(e,t,i,n){let r=Math.min(e.length,t.length),o=0;for(;o<r&&e.charCodeAt(o)==t.charCodeAt(o);)o++;if(o==r&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==n&&(i-=s+Math.max(0,o-Math.min(s,a))-o),s<o&&e.length<t.length?(o-=i<=o&&i>=s?o-i:0,a=o+(a-s),s=o):a<o&&(o-=i<=o&&i>=a?o-i:0,s=o+(s-a),a=o),{from:o,toA:s,toB:a}}(e.state.doc.sliceString(r,a,Bt),t.text,l-r,c);h&&(Y.chrome&&13==s&&h.toB==h.from+2&&t.text.slice(h.from,h.toB)==Bt+Bt&&h.toB--,i={from:r+h.from,to:r+h.toA,insert:n.xv.of(t.text.slice(h.from,h.toB).split(Bt))})}else r&&(!e.hasFocus&&e.state.facet(st)||r.main.eq(o))&&(r=null);if(!i&&!r)return!1;if(!i&&t.typeOver&&!o.empty&&r&&r.main.empty?i={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:i&&i.from>=o.from&&i.to<=o.to&&(i.from!=o.from||i.to!=o.to)&&o.to-o.from-(i.to-i.from)<=4?i={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,o.to))}:(Y.mac||Y.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(r&&2==i.insert.length&&(r=n.jT.single(r.main.anchor-1,r.main.head-1)),i={from:o.from,to:o.to,insert:n.xv.of([" "])}):Y.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&e.lineWrapping&&(r&&(r=n.jT.single(r.main.anchor-1,r.main.head-1)),i={from:o.from,to:o.to,insert:n.xv.of([" "])}),i)return Qt(e,i,r,s);if(r&&!r.main.eq(o)){let t=!1,i="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:t,userEvent:i}),!0}return!1}function Qt(e,t,i,r=-1){if(Y.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(Y.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&A(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==r&&t.insert.length<t.to-t.from&&t.to>o.head)&&A(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&A(e.contentDOM,"Delete",46)))return!0;let s,a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l=()=>s||(s=function(e,t,i){let r,o=e.state,s=o.selection.main;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let i=s.from<t.from?o.sliceDoc(s.from,t.from):"",n=s.to>t.to?o.sliceDoc(t.to,s.to):"";r=o.replaceSelection(e.state.toText(i+t.insert.sliceString(0,void 0,e.state.lineBreak)+n))}else{let a=o.changes(t),l=i&&i.main.to<=a.newLength?i.main:void 0;if(o.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let c,h=e.state.sliceDoc(t.from,t.to),u=i&&St(e,i.main.head);if(u){let e=t.insert.length-(t.to-t.from);c={from:u.from,to:u.to-e}}else c=e.state.doc.lineAt(s.head);let d=s.to-t.to,p=s.to-s.from;r=o.changeByRange((i=>{if(i.from==s.from&&i.to==s.to)return{changes:a,range:l||i.map(a)};let r=i.to-d,u=r-h.length;if(i.to-i.from!=p||e.state.sliceDoc(u,r)!=h||i.to>=c.from&&i.from<=c.to)return{range:i};let f=o.changes({from:u,to:r,insert:t.insert}),m=i.to-s.to;return{changes:f,range:l?n.jT.range(Math.max(0,l.anchor+m),Math.max(0,l.head+m)):i.map(f)}}))}else r={changes:a,selection:l&&o.selection.replaceRange(l)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),o.update(r,{userEvent:a,scrollIntoView:!0})}(e,t,i));return e.state.facet(Xe).some((i=>i(e,t.from,t.to,a,l)))||e.dispatch(l()),!0}class Ht{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Y.safari&&e.contentDOM.addEventListener("input",(()=>null)),Y.gecko&&function(e){yi.has(e)||(yi.add(e),e.addEventListener("copy",(()=>{})),e.addEventListener("cut",(()=>{})))}(e.contentDOM.ownerDocument)}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let i,n=t.target;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=I.get(n))&&i.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let e of i.observers)e(this.view,t);for(let e of i.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Zt(e),i=this.handlers,n=this.view.contentDOM;for(let e in t)if("scroll"!=e){let r=!t[e].handlers.length,o=i[e];o&&r!=!o.handlers.length&&(n.removeEventListener(e,this.handleEvent),o=null),o||n.addEventListener(e,this.handleEvent,{passive:r})}for(let e in i)"scroll"==e||t[e]||n.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=e.keyCode&&Jt.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Y.android&&Y.chrome&&!e.synthetic&&(13==e.keyCode||8==e.keyCode))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return!Y.ios||e.synthetic||e.altKey||e.metaKey||!((t=Ut.find((t=>t.keyCode==e.keyCode)))&&!e.ctrlKey||Xt.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&!("Enter"==t.key&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString()))&&(this.pendingIOSKey=void 0,A(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(Y.safari&&!Y.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function qt(e,t){return(i,n)=>{try{return t.call(e,n,i)}catch(e){ot(i.state,e)}}}function Zt(e){let t=Object.create(null);function i(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec;if(e&&e.domEventHandlers)for(let n in e.domEventHandlers){let r=e.domEventHandlers[n];r&&i(n).handlers.push(qt(t.value,r))}if(e&&e.domEventObservers)for(let n in e.domEventObservers){let r=e.domEventObservers[n];r&&i(n).observers.push(qt(t.value,r))}}for(let e in Gt)i(e).handlers.push(Gt[e]);for(let e in ei)i(e).observers.push(ei[e]);return t}const Ut=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Xt="dthko",Jt=[16,17,18,20,91,92,224,225];function Yt(e){return.7*Math.max(0,e)+8}class Kt{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=function(e){let t,i,n=e.ownerDocument;for(let r=e.parentNode;r&&!(r==n.body||t&&i);)if(1==r.nodeType)!i&&r.scrollHeight>r.clientHeight&&(i=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else{if(11!=r.nodeType)break;r=r.host}return{x:t,y:i}}(e.contentDOM),this.atoms=e.state.facet(mt).map((t=>t(e)));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(n.yy.allowMultipleSelections)&&function(e,t){let i=e.state.facet(Qe);return i.length?i[0](t):Y.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:i}=e.state.selection;if(i.empty)return!1;let n=u(e.root);if(!n||0==n.rangeCount)return!0;let r=n.getRangeAt(0).getClientRects();for(let e=0;e<r.length;e++){let i=r[e];if(i.left<=t.clientX&&i.right>=t.clientX&&i.top<=t.clientY&&i.bottom>=t.clientY)return!0}return!1}(e,t)||1!=di(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(t=this.startEvent,i=e,Math.max(Math.abs(t.clientX-i.clientX),Math.abs(t.clientY-i.clientY))<10))return;var t,i;this.select(this.lastEvent=e);let n=0,r=0,o=0,s=0,a=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:o,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=bt(this.view);e.clientX-c.left<=o+6?n=-Yt(o-e.clientX):e.clientX+c.right>=a-6&&(n=Yt(e.clientX-a)),e.clientY-c.top<=s+6?r=-Yt(s-e.clientY):e.clientY+c.bottom>=l-6&&(r=Yt(e.clientY-l)),this.setScrollSpeed(n,r)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],o=null;if(r.empty){let e=Nt(this.atoms,r.from,0);e!=r.from&&(o=n.jT.cursor(e,-1))}else{let e=Nt(this.atoms,r.from,-1),t=Nt(this.atoms,r.to,1);e==r.from&&t==r.to||(o=n.jT.range(r.from==r.anchor?e:t,r.from==r.head?e:t))}o&&(t||(t=e.ranges.slice()),t[i]=o)}return t?n.jT.create(t,e.mainIndex):e}select(e){let{view:t}=this,i=this.skipAtoms(this.style.get(e,this.extend,this.multiple));!this.mustSelect&&i.eq(t.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some((e=>e.isUserEvent("input.type")))?this.destroy():this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}const Gt=Object.create(null),ei=Object.create(null),ti=Y.ie&&Y.ie_version<15||Y.ios&&Y.webkit_version<604;function ii(e,t,i){for(let n of e.facet(t))i=n(i,e);return i}function ni(e,t){t=ii(e.state,Ye,t);let i,{state:r}=e,o=1,s=r.toText(t),a=s.lines==r.selection.ranges.length;if(null!=fi&&r.selection.ranges.every((e=>e.empty))&&fi==s.toString()){let e=-1;i=r.changeByRange((i=>{let l=r.doc.lineAt(i.from);if(l.from==e)return{range:i};e=l.from;let c=r.toText((a?s.line(o++).text:t)+r.lineBreak);return{changes:{from:l.from,insert:c},range:n.jT.cursor(i.from+c.length)}}))}else i=a?r.changeByRange((e=>{let t=s.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:n.jT.cursor(e.from+t.length)}})):r.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function ri(e,t,i,r){if(1==r)return n.jT.cursor(t,i);if(2==r)return function(e,t,i=1){let r=e.charCategorizer(t),o=e.doc.lineAt(t),s=t-o.from;if(0==o.length)return n.jT.cursor(t);0==s?i=1:s==o.length&&(i=-1);let a=s,l=s;i<0?a=(0,n.cp)(o.text,s,!1):l=(0,n.cp)(o.text,s);let c=r(o.text.slice(a,l));for(;a>0;){let e=(0,n.cp)(o.text,a,!1);if(r(o.text.slice(e,a))!=c)break;a=e}for(;l<o.length;){let e=(0,n.cp)(o.text,l);if(r(o.text.slice(l,e))!=c)break;l=e}return n.jT.range(a+o.from,l+o.from)}(e.state,t,i);{let i=ye.find(e.docView,t),r=e.state.doc.lineAt(i?i.posAtEnd:t),o=i?i.posAtStart:r.from,s=i?i.posAtEnd:r.to;return s<e.state.doc.length&&s==r.to&&s++,n.jT.range(o,s)}}ei.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Gt.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&0!=e.inputState.tabFocusMode&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),ei.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},ei.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Gt.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of e.state.facet(qe))if(i=n(e,t),i)break;if(i||0!=t.button||(i=function(e,t){let i=ai(e,t),r=di(t),o=e.state.selection;return{update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),o=o.map(e.changes))},get(t,s,a){let l,c=ai(e,t),h=ri(e,c.pos,c.bias,r);if(i.pos!=c.pos&&!s){let t=ri(e,i.pos,i.bias,r),o=Math.min(t.from,h.from),s=Math.max(t.to,h.to);h=o<h.from?n.jT.range(o,s):n.jT.range(s,o)}return s?o.replaceRange(o.main.extend(h.from,h.to)):a&&1==r&&o.ranges.length>1&&(l=function(e,t){for(let i=0;i<e.ranges.length;i++){let{from:r,to:o}=e.ranges[i];if(r<=t&&o>=t)return n.jT.create(e.ranges.slice(0,i).concat(e.ranges.slice(i+1)),e.mainIndex==i?0:e.mainIndex-(e.mainIndex>i?1:0))}return null}(o,c.pos))?l:a?o.addRange(h):n.jT.create([h])}}}(e,t)),i){let n=!e.hasFocus;e.inputState.startMouseSelection(new Kt(e,t,i,n)),n&&e.observer.ignore((()=>{C(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()}));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let oi=(e,t,i)=>t>=i.top&&t<=i.bottom&&e>=i.left&&e<=i.right;function si(e,t,i,n){let r=ye.find(e.docView,t);if(!r)return 1;let o=t-r.posAtStart;if(0==o)return 1;if(o==r.length)return-1;let s=r.coordsAt(o,-1);if(s&&oi(i,n,s))return-1;let a=r.coordsAt(o,1);return a&&oi(i,n,a)?1:s&&s.bottom>=n?-1:1}function ai(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:i,bias:si(e,i,t.clientX,t.clientY)}}const li=Y.ie&&Y.ie_version<=11;let ci=null,hi=0,ui=0;function di(e){if(!li)return e.detail;let t=ci,i=ui;return ci=e,ui=Date.now(),hi=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(hi+1)%3:1}function pi(e,t,i,n){if(!(i=ii(e.state,Ye,i)))return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:o}=e.inputState,s=n&&o&&function(e,t){let i=e.state.facet(He);return i.length?i[0](t):Y.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:o.from,to:o.to}:null,a={from:r,insert:i},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Gt.dragstart=(e,t)=>{let{selection:{main:i}}=e.state;if(t.target.draggable){let r=e.docView.nearest(t.target);if(r&&r.isWidget){let e=r.posAtStart,t=e+r.length;(e>=i.to||t<=i.from)&&(i=n.jT.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=i,t.dataTransfer&&(t.dataTransfer.setData("Text",ii(e.state,Ke,e.state.sliceDoc(i.from,i.to))),t.dataTransfer.effectAllowed="copyMove"),!1},Gt.dragend=e=>(e.inputState.draggedContent=null,!1),Gt.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let i=t.dataTransfer.files;if(i&&i.length){let n=Array(i.length),r=0,o=()=>{++r==i.length&&pi(e,t,n.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e<i.length;e++){let t=new FileReader;t.onerror=o,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(n[e]=t.result),o()},t.readAsText(i[e])}return!0}{let i=t.dataTransfer.getData("Text");if(i)return pi(e,t,i,!0),!0}return!1},Gt.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let i=ti?null:t.clipboardData;return i?(ni(e,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{e.focus(),i.remove(),ni(e,i.value)}),50)}(e),!1)};let fi=null;Gt.copy=Gt.cut=(e,t)=>{let{text:i,ranges:n,linewise:r}=function(e){let t=[],i=[],n=!1;for(let n of e.selection.ranges)n.empty||(t.push(e.sliceDoc(n.from,n.to)),i.push(n));if(!t.length){let r=-1;for(let{from:n}of e.selection.ranges){let o=e.doc.lineAt(n);o.number>r&&(t.push(o.text),i.push({from:o.from,to:Math.min(e.doc.length,o.to+1)})),r=o.number}n=!0}return{text:ii(e,Ke,t.join(e.lineBreak)),ranges:i,linewise:n}}(e.state);if(!i&&!r)return!1;fi=r?i:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let o=ti?null:t.clipboardData;return o?(o.clearData(),o.setData("text/plain",i),!0):(function(e,t){let i=e.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=t,n.focus(),n.selectionEnd=t.length,n.selectionStart=0,setTimeout((()=>{n.remove(),e.focus()}),50)}(e,i),!1)};const mi=n.q6.define();function gi(e,t){let i=[];for(let n of e.facet(Je)){let r=n(e,t);r&&i.push(r)}return i?e.update({effects:i,annotations:mi.of(!0)}):null}function vi(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let i=gi(e.state,t);i?e.dispatch(i):e.update([])}}),10)}ei.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),vi(e)},ei.blur=e=>{e.observer.clearSelectionRange(),vi(e)},ei.compositionstart=ei.compositionupdate=e=>{e.observer.editContext||(null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},ei.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Y.chrome&&Y.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50))},ei.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Gt.beforeinput=(e,t)=>{var i,n;if("insertReplacementText"==t.inputType&&e.observer.editContext){let n=null===(i=t.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),r=t.getTargetRanges();if(n&&r.length){let t=r[0],i=e.posAtDOM(t.startContainer,t.startOffset),o=e.posAtDOM(t.endContainer,t.endOffset);return Qt(e,{from:i,to:o,insert:e.state.toText(n)},null),!0}}let r;if(Y.chrome&&Y.android&&(r=Ut.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return Y.ios&&"deleteContentForward"==t.inputType&&e.observer.flushSoon(),Y.safari&&"insertText"==t.inputType&&e.inputState.composing>=0&&setTimeout((()=>ei.compositionend(e,t)),20),!1};const yi=new Set,bi=["pre-wrap","normal","pre-line","break-spaces"];let wi=!1;function ki(){wi=!1}class xi{constructor(e){this.lineWrapping=e,this.doc=n.xv.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return bi.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let n=e[i];n<0?i++:this.heightSamples[Math.floor(10*n)]||(t=!0,this.heightSamples[Math.floor(10*n)]=!0)}return t}refresh(e,t,i,n,r,o){let s=bi.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let e=0;e<o.length;e++){let t=o[e];t<0?e++:this.heightSamples[Math.floor(10*t)]=!0}}return a}}class _i{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class Si{constructor(e,t,i,n,r){this.from=e,this.length=t,this.top=i,this.height=n,this._content=r}get type(){return"number"==typeof this._content?ue.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof me?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Si(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Oi=function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e}(Oi||(Oi={}));const Ci=.001;class Ti{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(2&this.flags)>0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ci&&(wi=!0),this.height=e)}replace(e,t,i){return Ti.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this,o=i.doc;for(let s=n.length-1;s>=0;s--){let{fromA:a,toA:l,fromB:c,toB:h}=n[s],u=r.lineAt(a,Oi.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=l?u:r.lineAt(l,Oi.ByPosNoHeight,i,0,0);for(h+=d.to-l,l=d.to;s>0&&u.from<=n[s-1].toA;)a=n[s-1].fromA,c=n[s-1].fromB,s--,a<u.from&&(u=r.lineAt(a,Oi.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let p=Ri.build(i.setDoc(o),e,c,h);r=Ai(r,r.replace(a,l,p))}return r.updateHeight(i,0)}static empty(){return new Mi(0,0)}static of(e){if(1==e.length)return e[0];let t=0,i=e.length,n=0,r=0;for(;;)if(t==i)if(n>2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),i+=1+r.break,n-=r.size}else{if(!(r>2*n))break;{let t=e[i];t.break?e.splice(i,1,t.left,null,t.right):e.splice(i,1,t.left,t.right),i+=2+t.break,r-=t.size}}else if(n<r){let i=e[t++];i&&(n+=i.size)}else{let t=e[--i];t&&(r+=t.size)}let o=0;return null==e[t-1]?(o=1,t--):null==e[t]&&(o=1,i++),new Di(Ti.of(e.slice(0,t)),o,Ti.of(e.slice(i)))}}function Ai(e,t){return e==t?e:(e.constructor!=t.constructor&&(wi=!0),t)}Ti.prototype.size=1;class Pi extends Ti{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,n){return new Si(n,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,n,r){return this.blockAt(0,i,n,r)}forEachLine(e,t,i,n,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,n,r))}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Mi extends Pi{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,n){return new Si(n,this.length,i,this.height,this.breaks)}replace(e,t,i){let n=i[0];return 1==i.length&&(n instanceof Mi||n instanceof Ei&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Ei?n=new Mi(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):Ti.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ei extends Ti{constructor(e){super(e,0)}heightMetrics(e,t){let i,n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,o=r-n+1,s=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*o);i=t/o,this.length>o+1&&(s=(this.height-t)/(this.length-o-1))}else i=this.height/o;return{firstLine:n,lastLine:r,perLine:i,perChar:s}}blockAt(e,t,i,n){let{firstLine:r,lastLine:o,perLine:s,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let r=n+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),o=t.doc.lineAt(r),l=s+o.length*a,c=Math.max(i,e-l/2);return new Si(o.from,o.length,c,l,0)}{let n=Math.max(0,Math.min(o-r,Math.floor((e-i)/s))),{from:a,length:l}=t.doc.line(r+n);return new Si(a,l,i+s*n,s,0)}}lineAt(e,t,i,n,r){if(t==Oi.ByHeight)return this.blockAt(e,i,n,r);if(t==Oi.ByPosNoHeight){let{from:t,to:n}=i.doc.lineAt(e);return new Si(t,n-t,0,0,0)}let{firstLine:o,perLine:s,perChar:a}=this.heightMetrics(i,r),l=i.doc.lineAt(e),c=s+l.length*a,h=l.number-o,u=n+s*h+a*(l.from-r-h);return new Si(l.from,l.length,Math.max(n,Math.min(u,n+this.height-c)),c,0)}forEachLine(e,t,i,n,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(i,r);for(let c=e,h=n;c<=t;){let t=i.doc.lineAt(c);if(c==e){let i=t.number-s;h+=a*i+l*(e-r-i)}let n=a+l*t.length;o(new Si(t.from,t.length,h,n,0)),h+=n,c=t.to+1}}replace(e,t,i){let n=this.length-t;if(n>0){let e=i[i.length-1];e instanceof Ei?i[i.length-1]=new Ei(e.length+n):i.push(null,new Ei(n-1))}if(e>0){let t=i[0];t instanceof Ei?i[0]=new Ei(e+t.length):i.unshift(new Ei(e-1),null)}return Ti.of(i)}decomposeLeft(e,t){t.push(new Ei(e-1),null)}decomposeRight(e,t){t.push(null,new Ei(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let i=[],o=Math.max(t,n.from),s=-1;for(n.from>t&&i.push(new Ei(n.from-t-1).updateHeight(e,t));o<=r&&n.more;){let t=e.doc.lineAt(o).length;i.length&&i.push(null);let r=n.heights[n.index++];-1==s?s=r:Math.abs(r-s)>=Ci&&(s=-2);let a=new Mi(t,r);a.outdated=!1,i.push(a),o+=t+1}o<=r&&i.push(null,new Ei(r-o).updateHeight(e,o));let a=Ti.of(i);return(s<0||Math.abs(a.height-this.height)>=Ci||Math.abs(s-this.heightMetrics(e,t).perLine)>=Ci)&&(wi=!0),Ai(this,a)}return(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Di extends Ti{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return 1&this.flags}blockAt(e,t,i,n){let r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,n):this.right.blockAt(e,t,r,n+this.left.length+this.break)}lineAt(e,t,i,n,r){let o=n+this.left.height,s=r+this.left.length+this.break,a=t==Oi.ByHeight?e<o:e<s,l=a?this.left.lineAt(e,t,i,n,r):this.right.lineAt(e,t,i,o,s);if(this.break||(a?l.to<s:l.from>s))return l;let c=t==Oi.ByPosNoHeight?Oi.ByPosNoHeight:Oi.ByPos;return a?l.join(this.right.lineAt(s,c,i,o,s)):this.left.lineAt(s,c,i,n,r).join(l)}forEachLine(e,t,i,n,r,o){let s=n+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,n,r,o),t>=a&&this.right.forEachLine(e,t,i,s,a,o);else{let l=this.lineAt(a,Oi.ByPos,i,n,r);e<l.from&&this.left.forEachLine(e,l.from-1,i,n,r,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,i,s,a,o)}}replace(e,t,i){let n=this.left.length+this.break;if(t<n)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let e of i)r.push(e);if(e>0&&Li(r,o-1),t<this.length){let e=r.length;this.decomposeRight(t,r),Li(r,e)}return Ti.of(r)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<n&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Ti.of(this.break?[e,null,t]:[e,t]):(this.left=Ai(this.left,e),this.right=Ai(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:r,right:o}=this,s=t+r.length+this.break,a=null;return n&&n.from<=t+r.length&&n.more?a=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=s+o.length&&n.more?a=o=o.updateHeight(e,s,i,n):o.updateHeight(e,s,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Li(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof Ei&&(n=e[t+1])instanceof Ei&&e.splice(t-1,3,new Ei(i.length+1+n.length))}class Ri{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Mi?i.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new Mi(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new Pi(o,n,i)):(o||r||n>=5)&&this.addLineDeco(n,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Mi(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new Ei(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Mi)return e;let t=new Mi(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof Mi||this.isCovered?(this.writtenTo<this.pos||null==t)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Mi(0,-1));let i=e;for(let e of this.nodes)e instanceof Mi&&e.updateHeight(this.oracle,i),i+=e?e.length:1;return this.nodes}static build(e,t,i,r){let o=new Ri(i,e);return n.Xs.spans(t,i,r,o,0),o.finish(i)}}class Ii{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,n){(e<t||i&&i.heightRelevant||n&&n.heightRelevant)&&ve(e,t,this.changes,5)}}function Ni(e,t){let i=e.getBoundingClientRect(),n=e.ownerDocument,r=n.defaultView||window,o=Math.max(0,i.left),s=Math.min(r.innerWidth,i.right),a=Math.max(0,i.top),l=Math.min(r.innerHeight,i.bottom);for(let t=e.parentNode;t&&t!=n.body;)if(1==t.nodeType){let i=t,n=window.getComputedStyle(i);if((i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=n.overflow){let n=i.getBoundingClientRect();o=Math.max(o,n.left),s=Math.min(s,n.right),a=Math.max(a,n.top),l=Math.min(t==e.parentNode?r.innerHeight:l,n.bottom)}t="absolute"==n.position||"fixed"==n.position?i.offsetParent:i.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:o-i.left,right:Math.max(o,s)-i.left,top:a-(i.top+t),bottom:Math.max(a,l)-(i.top+t)}}function zi(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}class Bi{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],r=t[i];if(n.from!=r.from||n.to!=r.to||n.size!=r.size)return!1}return!0}draw(e,t){return de.replace({widget:new ji(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class ji extends he{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Fi{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Qi,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Se.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(dt).some((e=>"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new xi(t),this.stateDeco=e.facet(pt).filter((e=>"function"!=typeof e)),this.heightMap=Ti.empty().applyChanges(this.stateDeco,n.xv.empty,this.heightOracle.setDoc(e.doc),[new kt(0,0,0,e.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=de.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some((({from:e,to:t})=>n>=e&&n<=t))){let{from:t,to:i}=this.lineBlockAt(n);e.push(new Vi(t,i))}}return this.viewports=e.sort(((e,t)=>e.from-t.from)),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Qi:new Hi(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(e=>{this.viewportLines.push(qi(e,this.scaler))}))}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(pt).filter((e=>"function"!=typeof e));let r=e.changedRanges,o=kt.extendWithRanges(r,function(e,t,i){let r=new Ii;return n.Xs.compare(e,t,i,r,0),r.changes}(i,this.stateDeco,e?e.changes:n.as.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);ki(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=s||wi)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let l=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||2&e.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(et)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?Se.RTL:Se.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),a=t.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,h=0;if(a.width&&a.height){let{scaleX:e,scaleY:i}=x(t,a);(e>.005&&Math.abs(this.scaleX-e)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=e,this.scaleY=i,c|=8,s=l=!0)}let u=(parseInt(i.paddingTop)||0)*this.scaleY,d=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=M(e.scrollDOM);let f=(this.printing?zi:Ni)(t,this.paddingTop),m=f.top-this.pixelViewport.top,g=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=a.width;if(this.contentDOMWidth==y&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),l){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(s=!0),s||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:i,charWidth:n,textHeight:a}=e.docView.measureTextSize();s=i>0&&r.refresh(o,i,n,a,y/n,t),s&&(e.docView.minWidth=0,c|=8)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),ki();for(let i of this.viewports){let o=i.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(i);this.heightMap=(s?Ti.empty().applyChanges(this.stateDeco,n.xv.empty,this.heightOracle,[new kt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,s,new _i(i.from,o))}wi&&(c|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return b&&(2&c&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(2&c||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:s}=this,a=new Vi(n.lineAt(o-1e3*i,Oi.ByHeight,r,0,0).from,n.lineAt(s+1e3*(1-i),Oi.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(e<a.from||e>a.to){let i,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),s=n.lineAt(e,Oi.ByPos,r,0,0);i="center"==t.y?(s.top+s.bottom)/2-o/2:"start"==t.y||"nearest"==t.y&&e<a.from?s.top:s.bottom-o,a=new Vi(n.lineAt(i-500,Oi.ByHeight,r,0,0).from,n.lineAt(i+o+500,Oi.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),n=t.mapPos(e.to,1);return new Vi(this.heightMap.lineAt(i,Oi.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,Oi.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(e,Oi.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(t,Oi.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:s}=this;return(0==e||n<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=s+Math.max(10,Math.min(i,250)))&&n>o-2e3&&r<s+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let n of e)t.touchesRange(n.from,n.to)||i.push(new Bi(t.mapPos(n.from),t.mapPos(n.to),n.size));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,o=r>>1,s=r<<1;if(this.defaultTextDirection!=Se.LTR&&!i)return[];let a=[],l=(r,s,c,h)=>{if(s-r<o)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<s)return l(r,e-10,c,h),void l(e+10,s,c,h);let p=function(e,t){for(let i of e)if(t(i))return i}(e,(e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<o&&Math.abs(e.to-s)<o&&!d.some((t=>e.from<t&&e.to>t))));if(!p){if(s<c.to&&t&&i&&t.visibleRanges.some((e=>e.from<=s&&e.to>=s))){let e=t.moveToLineBoundary(n.jT.cursor(s),!1,!0).head;e>r&&(s=e)}p=new Bi(r,s,this.gapSize(c,r,s,h))}a.push(p)},c=e=>{if(e.length<s||e.type!=ue.Text)return;let t=function(e,t,i){let r=[],o=e,s=0;return n.Xs.spans(i,e,t,{span(){},point(e,t){e>o&&(r.push({from:o,to:e}),s+=e-o),o=t}},20),o<t&&(r.push({from:o,to:t}),s+=t-o),{total:s,ranges:r}}(e.from,e.to,this.stateDeco);if(t.total<s)return;let o,a,c=this.scrollTarget?this.scrollTarget.range.head:null;if(i){let i,n,s=r/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let r=$i(t,c),o=((this.visibleBottom-this.visibleTop)/2+s)/e.height;i=r-o,n=r+o}else i=(this.visibleTop-e.top-s)/e.height,n=(this.visibleBottom-e.top+s)/e.height;o=Wi(t,i),a=Wi(t,n)}else{let e,i,n=t.total*this.heightOracle.charWidth,s=r*this.heightOracle.charWidth;if(null!=c){let r=$i(t,c),o=((this.pixelViewport.right-this.pixelViewport.left)/2+s)/n;e=r-o,i=r+o}else e=(this.pixelViewport.left-s)/n,i=(this.pixelViewport.right+s)/n;o=Wi(t,e),a=Wi(t,i)}o>e.from&&l(e.from,o,e,t),a<e.to&&l(a,e.to,e,t)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return a}gapSize(e,t,i,n){let r=$i(n,i)-$i(n,t);return this.heightOracle.lineWrapping?e.height*r:n.total*this.heightOracle.charWidth*r}updateLineGaps(e){Bi.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=de.set(e.map((e=>e.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];n.Xs.spans(e,this.viewport.from,this.viewport.to,{span(e,i){t.push({from:e,to:i})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,i)=>e.from!=t[i].from||e.to!=t[i].to));return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||qi(this.heightMap.lineAt(e,Oi.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((t=>t.top<=e&&t.bottom>=e))||qi(this.heightMap.lineAt(this.scaler.fromDOM(e),Oi.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return qi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Vi{constructor(e,t){this.from=e,this.to=t}}function Wi({total:e,ranges:t},i){if(i<=0)return t[0].from;if(i>=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let e=0;;e++){let{from:i,to:r}=t[e],o=r-i;if(n<=o)return i+n;n-=o}}function $i(e,t){let i=0;for(let{from:n,to:r}of e.ranges){if(t<=r){i+=t-n;break}i+=r-n}return i/e.total}const Qi={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};class Hi{constructor(e,t,i){let n=0,r=0,o=0;this.viewports=i.map((({from:i,to:r})=>{let o=t.lineAt(i,Oi.ByPos,e,0,0).top,s=t.lineAt(r,Oi.ByPos,e,0,0).bottom;return n+=s-o,{from:i,to:r,top:o,bottom:s,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(t.height-n);for(let e of this.viewports)e.domTop=o+(e.top-r)*this.scale,o=e.domBottom=e.domTop+(e.bottom-e.top),r=e.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return n+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,n=r.domBottom}}fromDOM(e){for(let t=0,i=0,n=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-n)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,n=r.domBottom}}eq(e){return e instanceof Hi&&this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every(((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to))}}function qi(e,t){if(1==t.scale)return e;let i=t.toDOM(e.top),n=t.toDOM(e.bottom);return new Si(e.from,e.length,i,n-i,Array.isArray(e._content)?e._content.map((e=>qi(e,t))):e._content)}const Zi=n.r$.define({combine:e=>e.join(" ")}),Ui=n.r$.define({combine:e=>e.indexOf(!0)>-1}),Xi=r.V.newName(),Ji=r.V.newName(),Yi=r.V.newName(),Ki={"&light":"."+Ji,"&dark":"."+Yi};function Gi(e,t,i){return new r.V(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]})):e+" "+t}})}const en=Gi("."+Xi,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ki),tn={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},nn=Y.ie&&Y.ie_version<=11;class rn{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new _,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(Y.ie&&Y.ie_version<=11||Y.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),!window.EditContext||!1===e.constructor.EDIT_CONTEXT||Y.chrome&&Y.chrome_version<126||(this.editContext=new an(e),e.state.facet(st)&&(e.contentDOM.editContext=this.editContext.editContext)),nn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()})),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver((e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(e){("change"!=e.type&&e.type||e.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,i)=>t!=e[i])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(st)?i.root.activeElement!=this.dom:!p(i.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(Y.ie&&Y.ie_version<=11||Y.android&&Y.chrome)&&!i.state.selection.main.empty&&n.focusNode&&m(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=u(e.root);if(!t)return!1;let i=Y.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return sn(e,i)}let i=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),i=e.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),i?sn(e,i):null}(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=p(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&function(e,t){let i=t.focusNode,n=t.focusOffset;if(!i||t.anchorNode!=i||t.anchorOffset!=n)return!1;for(n=Math.min(n,b(i));;)if(n){if(1!=i.nodeType)return!1;let e=i.childNodes[n-1];"false"==e.contentEditable?n--:(i=e,n=b(i))}else{if(i==e)return!0;n=g(i),i=i.parentNode}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),n&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(1==i.nodeType)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else{if(11!=i.nodeType)break;i=i.host}if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,tn),nn&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),nn&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&A(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(null===(i=this.delayedAndroidKey)||void 0===i?void 0:i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame((()=>{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(n=!0),-1==t?({from:t,to:i}=e):(t=Math.min(e.from,t),i=Math.max(e.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&p(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Wt(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,n=$t(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let i=on(t,e.previousSibling||e.target.previousSibling,-1),n=on(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(st)!=e.state.facet(st)&&(e.view.contentDOM.editContext=e.state.facet(st)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function on(e,t,i){for(;t;){let n=I.get(t);if(n&&n.parent==e)return n;let r=t.parentNode;t=r!=e.dom?r:i>0?t.nextSibling:t.previousSibling}return null}function sn(e,t){let i=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor);return m(s.node,s.offset,r,o)&&([i,n,r,o]=[r,o,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:o}}class an{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=t=>{let{anchor:i}=e.state.selection.main,r={from:this.toEditorPos(t.updateRangeStart),to:this.toEditorPos(t.updateRangeEnd),insert:n.xv.of(t.text.split("\n"))};r.from==this.from&&i<this.from?r.from=i:r.to==this.to&&i>this.to&&(r.to=i),(r.from!=r.to||r.insert.length)&&(this.pendingContextChange=r,e.state.readOnly||Qt(e,r,n.jT.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let t=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);t<o;t++){let i=e.coordsForChar(t);r=i&&new DOMRect(i.left,i.top,i.right-i.left,i.bottom-i.top)||r||new DOMRect,n.push(r)}t.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=t=>{let i=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,n=e.underlineThickness;if("None"!=t&&"None"!=n){let r=`text-decoration: underline ${"Dashed"==t?"dashed ":"Squiggle"==t?"wavy ":""}${"Thin"==n?1:2}px`;i.push(de.mark({attributes:{style:r}}).range(this.toEditorPos(e.rangeStart),this.toEditorPos(e.rangeEnd)))}}e.dispatch({effects:rt.of(de.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=u(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges(((r,o,s,a,l)=>{if(i)return;let c=l.length-(o-r);if(n&&o>=n.to){if(n.from==r&&n.to==o&&n.insert.eq(l))return n=this.pendingContextChange=null,t+=c,void(this.to+=c);n=null,this.revertPending(e.state)}if(r+=t,(o+=t)<=this.from)this.from+=c,this.to+=c;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+l.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),l.toString()),this.to+=c}t+=c})),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;this.applyEdits(e)&&this.rangeIsValid(e.state)?(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state):(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==n||this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>3e4)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ln{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(e=>e.forEach((e=>i(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new Fi(e.state||n.yy.create(e)),e.scrollTo&&e.scrollTo.is(nt)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(lt).map((e=>new ht(e)));for(let e of this.plugins)e.update(this);this.observer=new rn(this),this.inputState=new Ht(this),this.inputState.ensureHandlers(this.plugins),this.docView=new _t(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(t=document.fonts)||void 0===t?void 0:t.ready)&&document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...e){let t=1==e.length&&e[0]instanceof n.YW?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,i=!1,r=!1,o=this.state;for(let t of e){if(t.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=t.state}if(this.destroyed)return void(this.viewState.state=o);let s=this.hasFocus,a=0,l=null;e.some((e=>e.annotation(mi)))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=gi(o,s),l||(a=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(h=null)):this.observer.clear(),o.facet(n.yy.phrases)!=this.state.facet(n.yy.phrases))return this.setState(o);t=xt.create(this,o,e),t.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new it(e.empty?e:n.jT.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(nt)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=un.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),i=this.docView.update(t),this.state.facet(wt)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(Zi)!=t.state.facet(Zi)&&(this.viewState.mustMeasureContent=!0),(i||r||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!t.empty)for(let e of this.state.facet(Ue))try{e(t)}catch(e){ot(this.state,e,"update listener")}(l||h)&&Promise.resolve().then((()=>{l&&this.state==l.startState&&this.dispatch(l),h&&!$t(this,h)&&c.force&&A(this.contentDOM,c.key,c.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new Fi(e),this.plugins=e.facet(lt).map((e=>new ht(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new _t(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(lt),i=e.state.facet(lt);if(t!=i){let n=[];for(let r of i){let i=t.indexOf(r);if(i<0)n.push(new ht(r));else{let t=this.plugins[i];t.mustUpdate=e,n.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){ot(this.state,e,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(o<0)if(M(i))r=-1,o=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(n);r=e.from,o=e.top}this.updateState=1;let s=this.viewState.measure(this);if(!s&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&s||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((e=>{try{return e.read(this)}catch(e){return ot(this.state,e),hn}})),c=xt.create(this,this.state,[]),h=!1;c.flags|=s,t?t.flags|=s:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),h=this.docView.update(c),h&&this.docViewUpdate());for(let e=0;e<a.length;e++)if(l[e]!=hn)try{let t=a[e];t.write&&t.write(l[e],this)}catch(e){ot(this.state,e)}if(h&&this.docView.updateSelection(!0),!c.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}{let e=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(e>1||e<-1){n+=e,i.scrollTop=n/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(Ue))e(t)}get themeClasses(){return Xi+" "+(this.state.facet(Ui)?Yi:Ji)+" "+this.state.facet(Zi)}updateAttrs(){let e=dn(this,ut,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(st)?"true":"false",class:"cm-content",style:`${Y.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),dn(this,dt,t);let i=this.observer.ignore((()=>{let i=le(this.contentDOM,this.contentAttrs,t),n=le(this.dom,this.editorAttrs,e);return i||n}));return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let e of i.effects)e.is(ln.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(wt);let e=this.state.facet(ln.cspNonce);r.V.mount(this.root,this.styleModules.concat(en).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),e){if(this.measureRequests.indexOf(e)>-1)return;if(null!=e.key)for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key)return void(this.measureRequests[t]=e);this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(void 0===t||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find((t=>t.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return zt(this,e,It(this,e,t,i))}moveByGroup(e,t){return zt(this,e,It(this,e,t,(t=>function(e,t,i){let r=e.state.charCategorizer(t),o=r(i);return e=>{let t=r(e);return o==n.D0.Space&&(o=t),o==t}}(this,e.head,t))))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),o=i[t?i.length-1:0];return n.jT.cursor(o.side(t,r)+e.from,o.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return function(e,t,i,r){let o=Rt(e,t.head),s=r&&o.type==ue.Text&&(e.lineWrapping||o.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>o.from?t.head-1:t.head):null;if(s){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(o.from),a=e.posAtCoords({x:i==(r==Se.LTR)?t.right-1:t.left+1,y:(s.top+s.bottom)/2});if(null!=a)return n.jT.cursor(a,i?-1:1)}return n.jT.cursor(i?o.to:o.from,i?-1:1)}(this,e,t,i)}moveVertically(e,t,i){return zt(this,e,function(e,t,i,r){let o=t.head,s=i?1:-1;if(o==(i?e.state.doc.length:0))return n.jT.cursor(o,t.assoc);let a,l=t.goalColumn,c=e.contentDOM.getBoundingClientRect(),h=e.coordsAtPos(o,t.assoc||-1),u=e.documentTop;if(h)null==l&&(l=h.left-c.left),a=s<0?h.top:h.bottom;else{let t=e.viewState.lineBlockAt(o);null==l&&(l=Math.min(c.right-c.left,e.defaultCharacterWidth*(o-t.from))),a=(s<0?t.top:t.bottom)+u}let d=c.left+l,p=null!=r?r:e.viewState.heightOracle.textHeight>>1;for(let t=0;;t+=10){let i=a+(p+t)*s,r=Dt(e,{x:d,y:i},!1,s);if(i<c.top||i>c.bottom||(s<0?r<o:r>o)){let t=e.docView.coordsForChar(r),o=!t||i<t.top?-1:1;return n.jT.cursor(r,o,void 0,l)}}}(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Dt(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n);return w(i,r[Re.find(r,e-n.from,-1,t)].dir==Se.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Ge)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>cn)return Fe(e.length);let t,i=this.textDirectionAt(e.from);for(let n of this.bidiCache)if(n.from==e.from&&n.dir==i&&(n.fresh||Ie(n.isolates,t=vt(this,e))))return n.order;t||(t=vt(this,e));let n=je(e.text,i,t);return this.bidiCache.push(new un(e.from,e.to,i,t,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Y.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{C(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return nt.of(new it("number"==typeof e?n.jT.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return nt.of(new it(n.jT.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){null==e?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof e?this.inputState.tabFocusMode=e?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return ct.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return ct.define((()=>({})),{eventObservers:e})}static theme(e,t){let i=r.V.newName(),n=[Zi.of(i),wt.of(Gi(`.${i}`,e))];return t&&t.dark&&n.push(Ui.of(!0)),n}static baseTheme(e){return n.Wl.lowest(wt.of(Gi("."+Xi,e,Ki)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&I.get(i)||I.get(e);return(null===(t=null==n?void 0:n.rootView)||void 0===t?void 0:t.view)||null}}ln.styleModule=wt,ln.inputHandler=Xe,ln.clipboardInputFilter=Ye,ln.clipboardOutputFilter=Ke,ln.scrollHandler=tt,ln.focusChangeEffect=Je,ln.perLineTextDirection=Ge,ln.exceptionSink=Ze,ln.updateListener=Ue,ln.editable=st,ln.mouseSelectionStyle=qe,ln.dragMovesSelection=He,ln.clickAddsSelectionRange=Qe,ln.decorations=pt,ln.outerDecorations=ft,ln.atomicRanges=mt,ln.bidiIsolatedRanges=gt,ln.scrollMargins=yt,ln.darkTheme=Ui,ln.cspNonce=n.r$.define({combine:e=>e.length?e[0]:""}),ln.contentAttributes=dt,ln.editorAttributes=ut,ln.lineWrapping=ln.contentAttributes.of({class:"cm-lineWrapping"}),ln.announce=n.Py.define();const cn=4096,hn={};class un{constructor(e,t,i,n,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let i=[],n=e.length?e[e.length-1].dir:Se.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir!=n||t.touchesRange(o.from,o.to)||i.push(new un(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function dn(e,t,i){for(let n=e.state.facet(t),r=n.length-1;r>=0;r--){let t=n[r],o="function"==typeof t?t(e):t;o&&oe(o,i)}return i}const pn=Y.mac?"mac":Y.windows?"win":Y.linux?"linux":"key";function fn(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}const mn=n.Wl.default(ln.domEventHandlers({keydown(e,t){return xn(yn(t.state),e,t,"editor")}})),gn=n.r$.define({enables:mn}),vn=new WeakMap;function yn(e){let t=e.facet(gn),i=vn.get(t);return i||vn.set(t,i=function(e,t=pn){let i=Object.create(null),n=Object.create(null),r=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},o=(e,n,o,s,a)=>{var l,c;let h=i[e]||(i[e]=Object.create(null)),u=n.split(/ (?!$)/).map((e=>function(e,t){const i=e.split(/-(?!$)/);let n,r,o,s,a=i[i.length-1];"Space"==a&&(a=" ");for(let e=0;e<i.length-1;++e){const a=i[e];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else if(/^s(hift)?$/i.test(a))o=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==t?s=!0:r=!0}}return n&&(a="Alt-"+a),r&&(a="Ctrl-"+a),s&&(a="Meta-"+a),o&&(a="Shift-"+a),a}(e,t)));for(let t=1;t<u.length;t++){let i=u.slice(0,t).join(" ");r(i,!0),h[i]||(h[i]={preventDefault:!0,stopPropagation:!1,run:[t=>{let n=wn={view:t,prefix:i,scope:e};return setTimeout((()=>{wn==n&&(wn=null)}),4e3),!0}]})}let d=u.join(" ");r(d,!1);let p=h[d]||(h[d]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=h._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});o&&p.run.push(o),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let n of e){let e=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let t of e){let e=i[t]||(i[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:r}=n;for(let t in e)e[t].run.push((e=>r(e,kn)))}let r=n[t]||n.key;if(r)for(let t of e)o(t,r,n.run,n.preventDefault,n.stopPropagation),n.shift&&o(t,"Shift-"+r,n.shift,n.preventDefault,n.stopPropagation)}return i}(t.reduce(((e,t)=>e.concat(t)),[]))),i}function bn(e,t,i){return xn(yn(e.state),t,e,i)}let wn=null,kn=null;function xn(e,t,i,r){kn=t;let c=function(e){var t=!(a&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||l&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?s:o)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),h=(0,n.gm)(c,0),u=(0,n.nZ)(h)==c.length&&" "!=c,d="",p=!1,f=!1,m=!1;wn&&wn.view==i&&wn.scope==r&&(d=wn.prefix+" ",Jt.indexOf(t.keyCode)<0&&(f=!0,wn=null));let g,v,y=new Set,b=e=>{if(e){for(let t of e.run)if(!y.has(t)&&(y.add(t),t(i)))return e.stopPropagation&&(m=!0),!0;e.preventDefault&&(e.stopPropagation&&(m=!0),f=!0)}return!1},w=e[r];return w&&(b(w[d+fn(c,t,!u)])?p=!0:u&&(t.altKey||t.metaKey||t.ctrlKey)&&!(Y.windows&&t.ctrlKey&&t.altKey)&&(g=o[t.keyCode])&&g!=c?(b(w[d+fn(g,t,!0)])||t.shiftKey&&(v=s[t.keyCode])!=c&&v!=g&&b(w[d+fn(v,t,!1)]))&&(p=!0):u&&t.shiftKey&&b(w[d+fn(c,t,!0)])&&(p=!0),!p&&b(w._any)&&(p=!0)),f&&(p=!0),p&&m&&t.stopPropagation(),kn=null,p}class Sn{constructor(e,t,i,n,r){this.className=e,this.left=t,this.top=i,this.width=n,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let n=e.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=On(e);return[new Sn(t,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}return function(e,t,i){if(i.to<=e.viewport.from||i.from>=e.viewport.to)return[];let n=Math.max(i.from,e.viewport.from),r=Math.min(i.to,e.viewport.to),o=e.textDirection==Se.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=On(e),c=s.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),u=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),d=a.right-(h?parseInt(h.paddingRight):0),p=Rt(e,n),f=Rt(e,r),m=p.type==ue.Text?p:null,g=f.type==ue.Text?f:null;if(m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=Cn(e,n,1,m)),g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=Cn(e,r,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(b(i.from,i.to,m));{let t=m?b(i.from,null,m):w(p,!1),n=g?b(null,i.to,g):w(f,!0),r=[];return(m||p).to<(g||f).from-(m&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<n.top?r.push(v(u,t.bottom,d,n.top)):t.bottom<n.top&&e.elementAtHeight((t.bottom+n.top)/2).type==ue.Text&&(t.bottom=n.top=(t.bottom+n.top)/2),y(t).concat(r).concat(y(n))}function v(e,i,n,r){return new Sn(t,e-l.left,i-l.top-.01,n-e,r-i+.01)}function y({top:e,bottom:t,horizontal:i}){let n=[];for(let r=0;r<i.length;r+=2)n.push(v(i[r],e,i[r+1],t));return n}function b(t,i,n){let r=1e9,s=-1e9,a=[];function l(t,i,l,c,h){let p=e.coordsAtPos(t,t==n.to?-2:2),f=e.coordsAtPos(l,l==n.from?2:-2);p&&f&&(r=Math.min(p.top,f.top,r),s=Math.max(p.bottom,f.bottom,s),h==Se.LTR?a.push(o&&i?u:p.left,o&&c?d:f.right):a.push(!o&&c?u:f.left,!o&&i?d:p.right))}let c=null!=t?t:n.from,h=null!=i?i:n.to;for(let n of e.visibleRanges)if(n.to>c&&n.from<h)for(let r=Math.max(n.from,c),o=Math.min(n.to,h);;){let n=e.state.doc.lineAt(r);for(let s of e.bidiSpans(n)){let e=s.from+n.from,a=s.to+n.from;if(e>=o)break;a>r&&l(Math.max(e,r),null==t&&e<=c,Math.min(a,o),null==i&&a>=h,s.dir)}if(r=n.to+1,r>=o)break}return 0==a.length&&l(c,null==t,h,null==i,e.textDirection),{top:r,bottom:s,horizontal:a}}function w(e,t){let i=a.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}(e,t,i)}}function On(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Se.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Cn(e,t,i,n){let r=e.coordsAtPos(t,2*i);if(!r)return n;let o=e.dom.getBoundingClientRect(),s=(r.top+r.bottom)/2,a=e.posAtCoords({x:o.left+1,y:s}),l=e.posAtCoords({x:o.right-1,y:s});return null==a||null==l?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}class Tn{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(An)!=e.state.facet(An)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){!1!==this.layer.updateOnDocViewUpdate&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(An);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;e==this.scaleX&&t==this.scaleY||(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some(((e,t)=>{return i=e,n=this.drawn[t],!(i.constructor==n.constructor&&i.eq(n));var i,n}))){let t=this.dom.firstChild,i=0;for(let n of e)n.update&&t&&n.constructor&&this.drawn[i].constructor&&n.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(n.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const An=n.r$.define();function Pn(e){return[ct.define((t=>new Tn(t,e))),An.of(e)]}const Mn=!Y.ios,En=n.r$.define({combine(e){return(0,n.BO)(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Dn(e={}){return[En.of(e),In,zn,jn,et.of(!0)]}function Ln(e){return e.facet(En)}function Rn(e){return e.startState.facet(En)!=e.state.facet(En)}const In=Pn({above:!0,markers(e){let{state:t}=e,i=t.facet(En),r=[];for(let o of t.selection.ranges){let s=o==t.selection.main;if(o.empty?!s||Mn:i.drawRangeCursor){let t=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=o.empty?o:n.jT.cursor(o.head,o.head>o.anchor?-1:1);for(let n of Sn.forRange(e,t,i))r.push(n)}}return r},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let i=Rn(e);return i&&Nn(e.state,t),e.docChanged||e.selectionSet||i},mount(e,t){Nn(t.state,e)},class:"cm-cursorLayer"});function Nn(e,t){t.style.animationDuration=e.facet(En).cursorBlinkRate+"ms"}const zn=Pn({above:!1,markers(e){return e.state.selection.ranges.map((t=>t.empty?[]:Sn.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t)))},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||Rn(e)},class:"cm-selectionLayer"}),Bn={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Mn&&(Bn[".cm-line"].caretColor=Bn[".cm-content"].caretColor="transparent !important");const jn=n.Wl.highest(ln.theme(Bn)),Fn=n.Py.define({map(e,t){return null==e?null:t.mapPos(e)}}),Vn=n.QQ.define({create(){return null},update(e,t){return null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(Fn)?t.value:e),e)}}),Wn=ct.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let i=e.state.field(Vn);null==i?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Vn)!=i||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Vn),i=null!=t&&e.coordsAtPos(t);if(!i)return null;let n=e.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+e.scrollDOM.scrollLeft*e.scaleX,top:i.top-n.top+e.scrollDOM.scrollTop*e.scaleY,height:i.bottom-i.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:i}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/i+"px",this.cursor.style.height=e.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Vn)!=e&&this.view.dispatch({effects:Fn.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $n(){return[Vn,Wn]}function Qn(e,t,i,n,r){t.lastIndex=0;for(let o,s=e.iterRange(i,n),a=i;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;o=t.exec(s.value);)r(a+o.index,o)}class Hn{constructor(e){const{regexp:t,decoration:i,decorate:n,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,n)this.addMatch=(e,t,i,r)=>n(r,i,i+e[0].length,e,t);else if("function"==typeof i)this.addMatch=(e,t,n,r)=>{let o=i(e,t,n);o&&r(n,n+e[0].length,o)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,n,r)=>r(n,n+e[0].length,i)}this.boundary=r,this.maxLength=o}createDeco(e){let t=new n.f_,i=t.add.bind(t);for(let{from:t,to:n}of function(e,t){let i=e.visibleRanges;if(1==i.length&&i[0].from==e.viewport.from&&i[0].to==e.viewport.to)return i;let n=[];for(let{from:r,to:o}of i)r=Math.max(e.state.doc.lineAt(r).from,r-t),o=Math.min(e.state.doc.lineAt(o).to,o+t),n.length&&n[n.length-1].to>=r?n[n.length-1].to=o:n.push({from:r,to:o});return n}(e,this.maxLength))Qn(e.state.doc,this.regexp,t,n,((t,n)=>this.addMatch(n,e,t,i)));return t.finish()}updateDeco(e,t){let i=1e9,n=-1;return e.docChanged&&e.changes.iterChanges(((t,r,o,s)=>{s>e.view.viewport.from&&o<e.view.viewport.to&&(i=Math.min(o,i),n=Math.max(s,n))})),e.viewportChanged||n-i>1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,t.map(e.changes),i,n):t}updateRange(e,t,i,n){for(let r of e.visibleRanges){let o=Math.max(r.from,i),s=Math.min(r.to,n);if(s>o){let i=e.state.doc.lineAt(o),n=i.to<s?e.state.doc.lineAt(s):i,a=Math.max(r.from,i.from),l=Math.min(r.to,n.to);if(this.boundary){for(;o>i.from;o--)if(this.boundary.test(i.text[o-1-i.from])){a=o;break}for(;s<n.to;s++)if(this.boundary.test(n.text[s-n.from])){l=s;break}}let c,h=[],u=(e,t,i)=>h.push(i.range(e,t));if(i==n)for(this.regexp.lastIndex=a-i.from;(c=this.regexp.exec(i.text))&&c.index<l-i.from;)this.addMatch(c,e,c.index+i.from,u);else Qn(e.state.doc,this.regexp,a,l,((t,i)=>this.addMatch(i,e,t,u)));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>e<a||t>l,add:h})}}return t}}const qn=null!=/x/.unicode?"gu":"g",Zn=new RegExp("[\0-\b\n--\u2028\u2029\ufeff-]",qn),Un={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Xn=null;const Jn=n.r$.define({combine(e){let t=(0,n.BO)(e,{render:null,specialChars:Zn,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==Xn&&"undefined"!=typeof document&&document.body){let t=document.body.style;Xn=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return Xn||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,qn)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,qn)),t}});function Yn(e={}){return[Jn.of(e),Kn||(Kn=ct.fromClass(class{constructor(e){this.view=e,this.decorations=de.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Jn)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Hn({regexp:e.specialChars,decoration:(t,i,r)=>{let{doc:o}=i.state,s=(0,n.gm)(t[0],0);if(9==s){let e=o.lineAt(r),t=i.state.tabSize,s=(0,n.IS)(e.text,t,r-e.from);return de.replace({widget:new er((t-s%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=de.replace({widget:new Gn(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Jn);e.startState.facet(Jn)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let Kn=null;class Gn extends he{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"":String.fromCharCode(9216+e)}(this.code),i=e.state.phrase("Control character")+" "+(Un[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,t);if(n)return n;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class er extends he{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const tr=ct.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(e){let{view:t}=e,i=t.viewState.editorHeight-t.defaultLineHeight-t.documentPadding.top-.5;i>=0&&i!=this.height&&(this.height=i,this.attrs={style:`padding-bottom: ${i}px`})}});function ir(){return[tr,dt.of((e=>{var t;return(null===(t=e.plugin(tr))||void 0===t?void 0:t.attrs)||null}))]}function nr(){return or}const rr=de.line({class:"cm-activeLine"}),or=ct.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,i=[];for(let n of e.state.selection.ranges){let r=e.lineBlockAt(n.head);r.from>t&&(i.push(rr.range(r.from)),t=r.from)}return de.set(i)}},{decorations:e=>e.decorations});class sr extends he{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?f(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),n=w(t[0],"rtl"!=i.direction),r=parseInt(i.lineHeight);return n.bottom-n.top>1.5*r?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}function ar(e){return ct.fromClass(class{constructor(t){this.view=t,this.placeholder=e?de.set([de.widget({widget:new sr(e),side:1}).range(0)]):de.none}get decorations(){return this.view.state.doc.length?de.none:this.placeholder}},{decorations:e=>e.decorations})}const lr=2e3;function cr(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(i),o=i-r.from,s=o>lr?-1:o==r.length?function(e,t){let i=e.coordsAtPos(e.viewport.from);return i?Math.round(Math.abs((i.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):(0,n.IS)(r.text,e.state.tabSize,i-r.from);return{line:r.number,col:s,off:o}}function hr(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return ln.mouseSelectionStyle.of(((e,i)=>t(i)?function(e,t){let i=cr(e,t),r=e.state.selection;return i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),n=e.state.doc.lineAt(t);i={line:n.number,col:i.col,off:Math.min(i.off,n.length)},r=r.map(e.changes)}},get(t,o,s){let a=cr(e,t);if(!a)return r;let l=function(e,t,i){let r=Math.min(t.line,i.line),o=Math.max(t.line,i.line),s=[];if(t.off>lr||i.off>lr||t.col<0||i.col<0){let a=Math.min(t.off,i.off),l=Math.max(t.off,i.off);for(let t=r;t<=o;t++){let i=e.doc.line(t);i.length<=l&&s.push(n.jT.range(i.from+a,i.to+l))}}else{let a=Math.min(t.col,i.col),l=Math.max(t.col,i.col);for(let t=r;t<=o;t++){let i=e.doc.line(t),r=(0,n.Gz)(i.text,a,e.tabSize,!0);if(r<0)s.push(n.jT.cursor(i.to));else{let t=(0,n.Gz)(i.text,l,e.tabSize);s.push(n.jT.range(i.from+r,i.from+t))}}}return s}(e.state,i,a);return l.length?s?n.jT.create(l.concat(r.ranges)):n.jT.create(l):r}}:null}(e,i):null))}const ur={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},dr={style:"cursor: crosshair"};function pr(e={}){let[t,i]=ur[e.key||"Alt"],n=ct.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||i(e))},keyup(e){e.keyCode!=t&&i(e)||this.set(!1)},mousemove(e){this.set(i(e))}}});return[n,ln.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(n))||void 0===t?void 0:t.isDown)?dr:null}))]}const fr="-10000px";class mr{constructor(e,t,i,n){this.facet=t,this.createTooltipView=i,this.removeTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e));let r=null;this.tooltipViews=this.tooltips.map((e=>r=i(e,r)))}update(e,t){var i;let n=e.state.facet(this.facet),r=n.filter((e=>e));if(n===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let o=[],s=t?[]:null;for(let i=0;i<r.length;i++){let n=r[i],a=-1;if(n){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==n.create&&(a=e)}if(a<0)o[i]=this.createTooltipView(n,i?o[i-1]:null),s&&(s[i]=!!n.above);else{let n=o[i]=this.tooltipViews[a];s&&(s[i]=t[a]),n.update&&n.update(e)}}}for(let e of this.tooltipViews)o.indexOf(e)<0&&(this.removeTooltipView(e),null===(i=e.destroy)||void 0===i||i.call(e));return t&&(s.forEach(((e,i)=>t[i]=e)),t.length=s.length),this.input=n,this.tooltips=r,this.tooltipViews=o,!0}}function gr(e={}){return yr.of(e)}function vr(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const yr=n.r$.define({combine:e=>{var t,i,n;return{position:Y.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(i=e.find((e=>e.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=e.find((e=>e.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||vr}}}),br=new WeakMap,wr=ct.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(yr);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver((()=>this.measureSoon())):null,this.manager=new mr(e,_r,((e,t)=>this.createTooltip(e,t)),(e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()})),this.above=this.manager.tooltips.map((e=>!!e.above)),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let i=t||e.geometryChanged,n=e.state.facet(yr);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(e,t){let i=e.create(this.view),n=t?t.dom:null;if(i.dom.classList.add("cm-tooltip"),e.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",i.dom.appendChild(e)}return i.dom.style.position=this.position,i.dom.style.top=fr,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var e,t,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),null===(e=t.destroy)||void 0===e||e.call(t);this.parent&&this.container.remove(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,i=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(Y.gecko)n=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==fr&&"0px"==e.style.left){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(n||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,i=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:i}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(yr).tooltipSpace(this.view),scaleX:t,scaleY:i,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:i,space:n,scaleX:r,scaleY:o}=e,s=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:h}=c,u=e.pos[a],d=e.size[a];if(!u||u.bottom<=Math.max(i.top,n.top)||u.top>=Math.min(i.bottom,n.bottom)||u.right<Math.max(i.left,n.left)-.1||u.left>Math.min(i.right,n.right)+.1){h.style.top=fr;continue}let p=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=p?7:0,m=d.right-d.left,g=null!==(t=br.get(c))&&void 0!==t?t:d.bottom-d.top,v=c.offset||xr,y=this.view.textDirection==Se.LTR,b=d.width>n.right-n.left?y?n.left:n.right-d.width:y?Math.max(n.left,Math.min(u.left-(p?14:0)+v.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(p?14:0)-v.x),n.right-m),w=this.above[a];!l.strictSide&&(w?u.top-(d.bottom-d.top)-v.y<n.top:u.bottom+(d.bottom-d.top)+v.y>n.bottom)&&w==n.bottom-u.bottom>u.top-n.top&&(w=this.above[a]=!w);let k=(w?u.top-n.top:n.bottom-u.bottom)-f;if(k<g&&!1!==c.resize){if(k<this.view.defaultLineHeight){h.style.top=fr;continue}br.set(c,g),h.style.height=(g=k)/o+"px"}else h.style.height&&(h.style.height="");let x=w?u.top-g-f-v.y:u.bottom+f+v.y,_=b+m;if(!0!==c.overlap)for(let e of s)e.left<_&&e.right>b&&e.top<x+g&&e.bottom>x&&(x=w?e.top-g-2-f:e.bottom+f+2);if("absolute"==this.position?(h.style.top=(x-e.parent.top)/o+"px",h.style.left=(b-e.parent.left)/r+"px"):(h.style.top=x/o+"px",h.style.left=b/r+"px"),p){let e=u.left+(y?v.x:-v.x)-(b+14-7);p.style.left=e/r+"px"}!0!==c.overlap&&s.push({left:b,top:x,right:_,bottom:x+g}),h.classList.toggle("cm-tooltip-above",w),h.classList.toggle("cm-tooltip-below",!w),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=fr}},{eventObservers:{scroll(){this.maybeMeasure()}}}),kr=ln.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),xr={x:0,y:0},_r=n.r$.define({enables:[wr,kr]}),Sr=n.r$.define({combine:e=>e.reduce(((e,t)=>e.concat(t)),[])});class Or{static create(e){return new Or(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new mr(e,Sr,((e,t)=>this.createHostedView(e,t)),(e=>e.dom.remove()))}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let n=i[e];if(void 0!==n)if(void 0===t)t=n;else if(t!==n)return}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Cr=_r.compute([Sr],(e=>{let t=e.facet(Sr);return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:Or.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class Tr{constructor(e,t,i,n,r){this.view=e,this.source=t,this.field=i,this.setHover=n,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout((()=>this.startHover()),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.nearest(t.target);if(!i)return;let n,r=1;if(i instanceof ee)n=i.posAtStart;else{if(n=e.posAtCoords(t),null==n)return;let i=e.coordsAtPos(n);if(!i||t.y<i.top||t.y>i.bottom||t.x<i.left-e.defaultCharacterWidth||t.x>i.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(n)).find((e=>e.from<=n&&e.to>=n)),s=o&&o.dir==Se.RTL?-1:1;r=t.x<i.left?-s:s}let o=this.source(e,n,r);if(null==o?void 0:o.then){let t=this.pending={pos:n};o.then((i=>{this.pending==t&&(this.pending=null,!i||Array.isArray(i)&&!i.length||e.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])}))}),(t=>ot(e.state,t,"hover tooltip")))}else!o||Array.isArray(o)&&!o.length||e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(wr),t=e?e.manager.tooltips.findIndex((e=>e.create==Or.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:r}=this;if(n.length&&r&&!function(e,t){let i,{left:n,right:r,top:o,bottom:s}=e.getBoundingClientRect();if(i=e.querySelector(".cm-tooltip-arrow")){let e=i.getBoundingClientRect();o=Math.min(e.top,o),s=Math.max(e.bottom,s)}return t.clientX>=n-4&&t.clientX<=r+4&&t.clientY>=o-4&&t.clientY<=s+4}(r.dom,e)||this.pending){let{pos:r}=n[0]||this.pending,o=null!==(i=null===(t=n[0])||void 0===t?void 0:t.end)&&void 0!==i?i:r;(r==o?this.view.posAtCoords(this.lastMove)==r:function(e,t,i,n,r,o){let s=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(s.left>n||s.right<n||s.top>r||Math.min(s.bottom,a)<r)return!1;let l=e.posAtCoords({x:n,y:r},!1);return l>=t&&l<=i}(this.view,r,o,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Ar(e,t={}){let i=n.Py.define(),r=n.QQ.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter((e=>!t.hideOn(r,e)))),r.docChanged)){let t=[];for(let i of e){let e=r.changes.mapPos(i.pos,-1,n.gc.TrackDel);if(null!=e){let n=Object.assign(Object.create(null),i);n.pos=e,null!=n.end&&(n.end=r.changes.mapPos(n.end)),t.push(n)}}e=t}for(let t of r.effects)t.is(i)&&(e=t.value),t.is(Er)&&(e=[]);return e},provide:e=>Sr.from(e)});return{active:r,extension:[r,ct.define((n=>new Tr(n,e,r,i,t.hoverTime||300))),Cr]}}function Pr(e,t){let i=e.plugin(wr);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}function Mr(e){return e.facet(Sr).some((e=>e))}const Er=n.Py.define(),Dr=Er.of(null);function Lr(e){let t=e.plugin(wr);t&&t.maybeMeasure()}const Rr=n.r$.define({combine(e){let t,i;for(let n of e)t=t||n.topContainer,i=i||n.bottomContainer;return{topContainer:t,bottomContainer:i}}});function Ir(e){return e?[Rr.of(e)]:[]}function Nr(e,t){let i=e.plugin(zr),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}const zr=ct.fromClass(class{constructor(e){this.input=e.state.facet(Fr),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(Rr);this.top=new Br(e,!0,t.topContainer),this.bottom=new Br(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(Rr);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Br(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Br(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=e.state.facet(Fr);if(i!=this.input){let t=i.filter((e=>e)),n=[],r=[],o=[],s=[];for(let i of t){let t,a=this.specs.indexOf(i);a<0?(t=i(e.view),s.push(t)):(t=this.panels[a],t.update&&t.update(e)),n.push(t),(t.top?r:o).push(t)}this.specs=t,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let e of s)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>ln.scrollMargins.of((t=>{let i=t.plugin(e);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}}))});class Br{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=jr(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=jr(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function jr(e){let t=e.nextSibling;return e.remove(),t}const Fr=n.r$.define({enables:zr});class Vr extends n.uU{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Vr.prototype.elementClass="",Vr.prototype.toDOM=void 0,Vr.prototype.mapMode=n.gc.TrackBefore,Vr.prototype.startSide=Vr.prototype.endSide=-1,Vr.prototype.point=!0;const Wr=n.r$.define(),$r=n.r$.define(),Qr={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>n.Xs.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Hr=n.r$.define();function qr(e){return[Ur(),Hr.of(Object.assign(Object.assign({},Qr),e))]}const Zr=n.r$.define({combine:e=>e.some((e=>e))});function Ur(e){let t=[Xr];return e&&!1===e.fixed&&t.push(Zr.of(!0)),t}const Xr=ct.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Hr).map((t=>new Gr(e,t)));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(Zr),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,i=e.view.viewport,n=Math.min(t.to,i.to)-Math.max(t.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Zr)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let i=n.Xs.iter(this.view.state.facet(Wr),this.view.viewport.from),r=[],o=this.gutters.map((e=>new Kr(e,this.view.viewport,-this.view.documentPadding.top)));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let n of e.type)if(n.type==ue.Text&&t){Yr(i,r,n.from);for(let e of o)e.line(this.view,n,r);t=!1}else if(n.widget)for(let e of o)e.widget(this.view,n)}else if(e.type==ue.Text){Yr(i,r,e.from);for(let t of o)t.line(this.view,e,r)}else if(e.widget)for(let t of o)t.widget(this.view,e);for(let e of o)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(Hr),i=e.state.facet(Hr),r=e.docChanged||e.heightChanged||e.viewportChanged||!n.Xs.eq(e.startState.facet(Wr),e.state.facet(Wr),e.view.viewport.from,e.view.viewport.to);if(t==i)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let n=[];for(let r of i){let i=t.indexOf(r);i<0?n.push(new Gr(this.view,r)):(this.gutters[i].update(e),n.push(this.gutters[i]))}for(let e of this.gutters)e.dom.remove(),n.indexOf(e)<0&&e.destroy();for(let e of n)this.dom.appendChild(e.dom);this.gutters=n}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>ln.scrollMargins.of((t=>{let i=t.plugin(e);return i&&0!=i.gutters.length&&i.fixed?t.textDirection==Se.LTR?{left:i.dom.offsetWidth*t.scaleX}:{right:i.dom.offsetWidth*t.scaleX}:null}))});function Jr(e){return Array.isArray(e)?e:[e]}function Yr(e,t,i){for(;e.value&&e.from<=i;)e.from==i&&t.push(e.value),e.next()}class Kr{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=n.Xs.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:n}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==n.elements.length){let t=new eo(e,o,r,i);n.elements.push(t),n.dom.appendChild(t.dom)}else n.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let n=[];Yr(this.cursor,n,t.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(e,t,n);r&&n.unshift(r);let o=this.gutter;(0!=n.length||o.config.renderEmptyElements)&&this.addElement(e,t,n)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),n=i?[i]:null;for(let i of e.state.facet($r)){let r=i(e,t.widget,t);r&&(n||(n=[])).push(r)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Gr{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,(n=>{let r,o=n.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let e=o.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=n.clientY;let s=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[i](e,s,n)&&n.preventDefault()}));this.markers=Jr(t.markers(e)),t.initialSpacer&&(this.spacer=new eo(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Jr(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let i=e.view.viewport;return!n.Xs.eq(this.markers,t,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class eo{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].compare(t[i]))return!1;return!0}(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let i="cm-gutterElement",n=this.dom.firstChild;for(let r=0,o=0;;){let s=o,a=r<t.length?t[r++]:null,l=!1;if(a){let e=a.elementClass;e&&(i+=" "+e);for(let e=o;e<this.markers.length;e++)if(this.markers[e].compare(a)){s=e,l=!0;break}}else s=this.markers.length;for(;o<s;){let e=this.markers[o++];if(e.toDOM){e.destroy(n);let t=n.nextSibling;n.remove(),n=t}}if(!a)break;a.toDOM&&(l?n=n.nextSibling:this.dom.insertBefore(a.toDOM(e),n)),l&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}const to=n.r$.define(),io=n.r$.define(),no=n.r$.define({combine(e){return(0,n.BO)(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let e in t){let n=i[e],r=t[e];i[e]=n?(e,t,i)=>n(e,t,i)||r(e,t,i):r}return i}})}});class ro extends Vr{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function oo(e,t){return e.state.facet(no).formatNumber(t,e.state)}const so=Hr.compute([no],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(to)},lineMarker(e,t,i){return i.some((e=>e.toDOM))?null:new ro(oo(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let n of e.state.facet(io)){let r=n(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(no)!=e.state.facet(no),initialSpacer(e){return new ro(oo(e,lo(e.state.doc.lines)))},updateSpacer(e,t){let i=oo(t.view,lo(t.view.state.doc.lines));return i==e.number?e:new ro(i)},domEventHandlers:e.facet(no).domEventHandlers})));function ao(e={}){return[no.of(e),Ur(),so]}function lo(e){let t=9;for(;t<e;)t=10*t+9;return t}const co=new class extends Vr{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},ho=Wr.compute(["selection"],(e=>{let t=[],i=-1;for(let n of e.selection.ranges){let r=e.doc.lineAt(n.head).from;r>i&&(i=r,t.push(co.range(r)))}return n.Xs.of(t)}));function uo(){return ho}const po=new Map;function fo(e){return ct.define((t=>({decorations:e.createDeco(t),update(t){this.decorations=e.updateDeco(t,this.decorations)}})),{decorations:e=>e.decorations})}const mo=fo(new Hn({regexp:/\t| +/g,decoration:e=>function(e){let t=po.get(e);return t||po.set(e,t=de.mark({attributes:"\t"===e?{class:"cm-highlightTab"}:{class:"cm-highlightSpace","data-display":e.replace(/ /g,"·")}})),t}(e[0]),boundary:/\S/}));function go(){return mo}const vo=fo(new Hn({regexp:/\s+$/g,decoration:de.mark({class:"cm-trailingSpace"}),boundary:/\S/}));function yo(){return vo}const bo={HeightMap:Ti,HeightOracle:xi,MeasuredHeights:_i,QueryType:Oi,ChangedRange:kt,computeOrder:je,moveVisually:We,clearHeightChangeFlag:ki,getHeightChangeFlag:()=>wi}},1113:function(e,t,i){i.d(t,{Jq:function(){return c},L3:function(){return n},Lj:function(){return h},_b:function(){return R},hr:function(){return D},i9:function(){return L},md:function(){return s},mp:function(){return f},vj:function(){return p}});const n=1024;let r=0;class o{constructor(e,t){this.from=e,this.to=t}}class s{constructor(e={}){this.id=r++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=c.match(e)),t=>{let i=e(t);return void 0===i?null:[this,i]}}}s.closedBy=new s({deserialize:e=>e.split(" ")}),s.openedBy=new s({deserialize:e=>e.split(" ")}),s.group=new s({deserialize:e=>e.split(" ")}),s.isolate=new s({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}}),s.contextHash=new s({perNode:!0}),s.lookAhead=new s({perNode:!0}),s.mounted=new s({perNode:!0});class a{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[s.mounted.id]}}const l=Object.create(null);class c{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):l,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),n=new c(e.name||"",t,e.id,i);if(e.props)for(let i of e.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}return n}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(s.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return e=>{for(let i=e.prop(s.group),n=-1;n<(i?i.length:0);n++){let r=t[n<0?e.name:i[n]];if(r)return r}}}}c.none=new c("",Object.create(null),0,8);class h{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let n=null;for(let t of e){let e=t(i);e&&(n||(n=Object.assign({},i.props)),n[e[0].id]=e[1])}t.push(n?new c(i.name,n,i.id,i.flags):i)}return new h(t)}}const u=new WeakMap,d=new WeakMap;var p;!function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays"}(p||(p={}));class f{constructor(e,t,i,n,r){if(this.type=e,this.children=t,this.positions=i,this.length=n,this.props=null,r&&r.length){this.props=Object.create(null);for(let[e,t]of r)this.props["number"==typeof e?e:e.id]=t}}toString(){let e=a.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let i=e.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new T(this.topNode,e)}cursorAt(e,t=0,i=0){let n=u.get(this)||this.topNode,r=new T(n);return r.moveTo(e,t),u.set(this,r._tree),r}get topNode(){return new w(this,0,0,null)}resolve(e,t=0){let i=y(u.get(this)||this.topNode,e,t,!1);return u.set(this,i),i}resolveInner(e,t=0){let i=y(d.get(this)||this.topNode,e,t,!0);return d.set(this,i),i}resolveStack(e,t=0){return function(e,t,i){let n=e.resolveInner(t,i),r=null;for(let e=n instanceof w?n:n.context.parent;e;e=e.parent)if(e.index<0){let o=e.parent;(r||(r=[n])).push(o.resolve(t,i)),e=o}else{let o=a.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let s=new w(o.tree,o.overlay[0].from+e.from,-1,e);(r||(r=[n])).push(y(s,t,i,!1))}}return r?O(r):n}(this,e,t)}iterate(e){let{enter:t,leave:i,from:n=0,to:r=this.length}=e,o=e.mode||0,s=(o&p.IncludeAnonymous)>0;for(let e=this.cursor(o|p.IncludeAnonymous);;){let o=!1;if(e.from<=r&&e.to>=n&&(!s&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;o=!0}for(;o&&i&&(s||!e.type.isAnonymous)&&i(e),!e.nextSibling();){if(!e.parent())return;o=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:E(c.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,i)=>new f(this.type,e,t,i,this.propValues)),e.makeTree||((e,t,i)=>new f(c.none,e,t,i)))}static build(e){return function(e){var t;let{buffer:i,nodeSet:r,maxBufferLength:o=n,reused:a=[],minRepeatType:l=r.types.length}=e,c=Array.isArray(i)?new m(i,i.length):i,h=r.types,u=0,d=0;function p(e,t,i,n,m,k){let{id:x,start:_,end:S,size:O}=c,C=d;for(;O<0;){if(c.next(),-1==O){let t=a[x];return i.push(t),void n.push(_-e)}if(-3==O)return void(u=x);if(-4==O)return void(d=x);throw new RangeError(`Unrecognized record size: ${O}`)}let T,A,P=h[x],M=_-e;if(S-_<=o&&(A=function(e,t){let i=c.fork(),n=0,r=0,s=0,a=i.end-o,h={size:0,start:0,skip:0};e:for(let o=i.pos-e;i.pos>o;){let e=i.size;if(i.id==t&&e>=0){h.size=n,h.start=r,h.skip=s,s+=4,n+=4,i.next();continue}let c=i.pos-e;if(e<0||c<o||i.start<a)break;let u=i.id>=l?4:0,d=i.start;for(i.next();i.pos>c;){if(i.size<0){if(-3!=i.size)break e;u+=4}else i.id>=l&&(u+=4);i.next()}r=d,n+=e,s+=u}return(t<0||n==e)&&(h.size=n,h.start=r,h.skip=s),h.size>4?h:void 0}(c.pos-t,m))){let t=new Uint16Array(A.size-A.skip),i=c.pos-A.size,n=t.length;for(;c.pos>i;)n=w(A.start,t,n);T=new g(t,S-A.start,r),M=A.start-e}else{let e=c.pos-O;c.next();let t=[],i=[],n=x>=l?x:-1,r=0,a=S;for(;c.pos>e;)n>=0&&c.id==n&&c.size>=0?(c.end<=a-o&&(y(t,i,_,r,c.end,a,n,C),r=t.length,a=c.end),c.next()):k>2500?v(_,e,t,i):p(_,e,t,i,n,k+1);if(n>=0&&r>0&&r<t.length&&y(t,i,_,r,_,a,n,C),t.reverse(),i.reverse(),n>-1&&r>0){let e=function(e){return(t,i,n)=>{let r,o,a=0,l=t.length-1;if(l>=0&&(r=t[l])instanceof f){if(!l&&r.type==e&&r.length==n)return r;(o=r.prop(s.lookAhead))&&(a=i[l]+r.length+o)}return b(e,t,i,n,a)}}(P);T=E(P,t,i,0,t.length,0,S-_,e,e)}else T=b(P,t,i,S-_,C-S)}i.push(T),n.push(M)}function v(e,t,i,n){let s=[],a=0,l=-1;for(;c.pos>t;){let{id:e,start:t,end:i,size:n}=c;if(n>4)c.next();else{if(l>-1&&t<l)break;l<0&&(l=i-o),s.push(e,t,i),a++,c.next()}}if(a){let t=new Uint16Array(4*a),o=s[s.length-2];for(let e=s.length-3,i=0;e>=0;e-=3)t[i++]=s[e],t[i++]=s[e+1]-o,t[i++]=s[e+2]-o,t[i++]=i;i.push(new g(t,s[2]-o,r)),n.push(o-e)}}function y(e,t,i,n,o,s,a,l){let c=[],h=[];for(;e.length>n;)c.push(e.pop()),h.push(t.pop()+i-o);e.push(b(r.types[a],c,h,s-o,l-s)),t.push(o-i)}function b(e,t,i,n,r=0,o){if(u){let e=[s.contextHash,u];o=o?[e].concat(o):[e]}if(r>25){let e=[s.lookAhead,r];o=o?[e].concat(o):[e]}return new f(e,t,i,n,o)}function w(e,t,i){let{id:n,start:r,end:o,size:s}=c;if(c.next(),s>=0&&n<l){let a=i;if(s>4){let n=c.pos-(s-4);for(;c.pos>n;)i=w(e,t,i)}t[--i]=a,t[--i]=o-e,t[--i]=r-e,t[--i]=n}else-3==s?u=n:-4==s&&(d=n);return i}let k=[],x=[];for(;c.pos>0;)p(e.start||0,e.bufferStart||0,k,x,-1,0);let _=null!==(t=e.length)&&void 0!==t?t:k.length?x[0]+k[0].length:0;return new f(h[e.topID],k.reverse(),x.reverse(),_)}(e)}}f.empty=new f(c.none,[],[],0);class m{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new m(this.buffer,this.index)}}class g{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return c.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],n=this.set.types[t],r=n.name;if(/\W/.test(r)&&!n.isError&&(r=JSON.stringify(r)),i==(e+=4))return r;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,i,n,r){let{buffer:o}=this,s=-1;for(let a=e;a!=t&&!(v(r,n,o[a+1],o[a+2])&&(s=a,i>0));a=o[a+3]);return s}slice(e,t,i){let n=this.buffer,r=new Uint16Array(t-e),o=0;for(let s=e,a=0;s<t;){r[a++]=n[s++],r[a++]=n[s++]-i;let t=r[a++]=n[s++]-i;r[a++]=n[s++]-e,o=Math.max(o,t)}return new g(r,o,this.set)}}function v(e,t,i,n){switch(e){case-2:return i<t;case-1:return n>=t&&i<t;case 0:return i<t&&n>t;case 1:return i<=t&&n>t;case 2:return n>t;case 4:return!0}}function y(e,t,i,n){for(var r;e.from==e.to||(i<1?e.from>=t:e.from>t)||(i>-1?e.to<=t:e.to<t);){let t=!n&&e instanceof w&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=n?0:p.IgnoreOverlays;if(n)for(let n=e,s=n.parent;s;n=s,s=n.parent)n instanceof w&&n.index<0&&(null===(r=s.enter(t,i,o))||void 0===r?void 0:r.from)!=n.from&&(e=s);for(;;){let n=e.enter(t,i,o);if(!n)return e;e=n}}class b{cursor(e=0){return new T(this,e)}getChild(e,t=null,i=null){let n=k(this,e,t,i);return n.length?n[0]:null}getChildren(e,t=null,i=null){return k(this,e,t,i)}resolve(e,t=0){return y(this,e,t,!1)}resolveInner(e,t=0){return y(this,e,t,!0)}matchContext(e){return x(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(i=t,t=e.prevSibling):t=e}return i}get node(){return this}get next(){return this.parent}}class w extends b{constructor(e,t,i,n){super(),this._tree=e,this.from=t,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,n,r=0){for(let o=this;;){for(let{children:s,positions:l}=o._tree,c=t>0?s.length:-1;e!=c;e+=t){let c=s[e],h=l[e]+o.from;if(v(n,i,h,h+c.length))if(c instanceof g){if(r&p.ExcludeBuffers)continue;let s=c.findChild(0,c.buffer.length,t,i-h,n);if(s>-1)return new S(new _(o,c,e,h),null,s)}else if(r&p.IncludeAnonymous||!c.type.isAnonymous||A(c)){let s;if(!(r&p.IgnoreMounts)&&(s=a.get(c))&&!s.overlay)return new w(s.tree,h,e,o);let l=new w(c,h,e,o);return r&p.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?c.children.length-1:0,t,i,n)}}if(r&p.IncludeAnonymous||!o.type.isAnonymous)return null;if(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let n;if(!(i&p.IgnoreOverlays)&&(n=a.get(this._tree))&&n.overlay){let i=e-this.from;for(let{from:e,to:r}of n.overlay)if((t>0?e<=i:e<i)&&(t<0?r>=i:r>i))return new w(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function k(e,t,i,n){let r=e.cursor(),o=[];if(!r.firstChild())return o;if(null!=i)for(let e=!1;!e;)if(e=r.type.is(i),!r.nextSibling())return o;for(;;){if(null!=n&&r.type.is(n))return o;if(r.type.is(t)&&o.push(r.node),!r.nextSibling())return null==n?o:[]}}function x(e,t,i=t.length-1){for(let n=e.parent;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[i]&&t[i]!=n.name)return!1;i--}}return!0}class _{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class S extends b{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new S(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&p.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new S(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new S(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new S(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];e.push(i.slice(n,r,o)),t.push(0)}return new f(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function O(e){if(!e.length)return null;let t=0,i=e[0];for(let n=1;n<e.length;n++){let r=e[n];(r.from>i.from||r.to<i.to)&&(i=r,t=n)}let n=i instanceof w&&i.index<0?null:i.parent,r=e.slice();return n?r[t]=n:r.splice(t,1),new C(r,i)}class C{constructor(e,t){this.heads=e,this.node=t}get next(){return O(this.heads)}}class T{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof w)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:i,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return!!e&&(e instanceof w?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?!(i&p.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&p.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&p.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let e=i<0?0:this.stack[i]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(e)}return i<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:n}=this;if(n){if(e>0){if(this.index<n.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(n.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:i}=n)}else({index:t,_parent:i}=this._tree);for(;i;({index:t,_parent:i}=i))if(t>-1)for(let n=t+e,r=e<0?-1:i._tree.children.length;n!=r;n+=e){let e=i._tree.children[n];if(this.mode&p.IncludeAnonymous||e instanceof g||!e.type.isAnonymous||A(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let n=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==n){if(n==this.index)return o;t=o,i=r+1;break e}n=this.stack[--r]}for(let e=i;e<this.stack.length;e++)t=new S(this.buffer,t,this.stack[e]);return this.bufferNode=new S(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let n=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;n&&t&&t(this),n=this.type.isAnonymous,!this.nextSibling();){if(!i)return;this.parent(),i--,n=!0}}}matchContext(e){if(!this.buffer)return x(this.node,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let n=e.length-1,r=this.stack.length-1;n>=0;r--){if(r<0)return x(this.node,e,n);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}}function A(e){return e.children.some((e=>e instanceof g||!e.type.isAnonymous||A(e)))}const P=new WeakMap;function M(e,t){if(!e.isAnonymous||t instanceof g||t.type!=e)return 1;let i=P.get(t);if(null==i){i=1;for(let n of t.children){if(n.type!=e||!(n instanceof f)){i=1;break}i+=M(e,n)}P.set(t,i)}return i}function E(e,t,i,n,r,o,s,a,l){let c=0;for(let i=n;i<r;i++)c+=M(e,t[i]);let h=Math.ceil(1.5*c/8),u=[],d=[];return function t(i,n,r,s,a){for(let c=r;c<s;){let r=c,p=n[c],f=M(e,i[c]);for(c++;c<s;c++){let t=M(e,i[c]);if(f+t>=h)break;f+=t}if(c==r+1){if(f>h){let e=i[r];t(e.children,e.positions,0,e.children.length,n[r]+a);continue}u.push(i[r])}else{let t=n[c-1]+i[c-1].length-p;u.push(E(e,i,n,r,c,p,t,null,l))}d.push(p+a-o)}}(t,i,n,r,0),(a||l)(u,d,s)}class D{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof S?this.setBuffer(e.context.buffer,e.index,t):e instanceof w&&this.map.set(e.tree,t)}get(e){return e instanceof S?this.getBuffer(e.context.buffer,e.index):e instanceof w?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class L{constructor(e,t,i,n,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],i=!1){let n=[new L(0,e.length,e,0,!1,i)];for(let i of t)i.to>e.length&&n.push(i);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,o=e.length?e[0]:null;for(let s=0,a=0,l=0;;s++){let c=s<t.length?t[s]:null,h=c?c.fromA:1e9;if(h-a>=i)for(;o&&o.from<h;){let t=o;if(a>=t.from||h<=t.to||l){let e=Math.max(t.from,a)-l,i=Math.min(t.to,h)-l;t=e>=i?null:new L(e,i,t.tree,t.offset+l,s>0,!!c)}if(t&&n.push(t),o.to>h)break;o=r<e.length?e[r++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return n}}class R{startParse(e,t,i){return"string"==typeof e&&(e=new I(e)),i=i?i.length?i.map((e=>new o(e.from,e.to))):[new o(0,0)]:[new o(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let e=n.advance();if(e)return e}}}class I{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new s({perNode:!0})},5524:function(e,t,i){i.d(t,{Gv:function(){return l},QR:function(){return u},bW:function(){return d},pJ:function(){return P}});var n=i(1113);let r=0;class o{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=r++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i="string"==typeof e?e:"?";if(e instanceof o&&(t=e),null==t?void 0:t.base)throw new Error("Can not derive from a modified tag");let n=new o(i,[],null,[]);if(n.set.push(n),t)for(let e of t.set)n.set.push(e);return n}static defineModifier(e){let t=new a(e);return e=>e.modified.indexOf(t)>-1?e:a.get(e.base||e,e.modified.concat(t).sort(((e,t)=>e.id-t.id)))}}let s=0;class a{constructor(e){this.name=e,this.instances=[],this.id=s++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find((i=>{return i.base==e&&(n=t,r=i.modified,n.length==r.length&&n.every(((e,t)=>e==r[t])));var n,r}));if(i)return i;let n=[],r=new o(e.name,n,e,t);for(let e of t)e.instances.push(r);let s=function(e){let t=[[]];for(let i=0;i<e.length;i++)for(let n=0,r=t.length;n<r;n++)t.push(t[n].concat(e[i]));return t.sort(((e,t)=>t.length-e.length))}(t);for(let t of e.set)if(!t.modified.length)for(let e of s)n.push(a.get(t,e));return r}}function l(e){let t=Object.create(null);for(let i in e){let n=e[i];Array.isArray(n)||(n=[n]);for(let e of i.split(" "))if(e){let i=[],r=2,o=e;for(let t=0;;){if("..."==o&&t>0&&t+3==e.length){r=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!n)throw new RangeError("Invalid path: "+e);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),t+=n[0].length,t==e.length)break;let s=e[t++];if(t==e.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+e);o=e.slice(t)}let s=i.length-1,a=i[s];if(!a)throw new RangeError("Invalid path: "+e);let l=new h(n,r,s>0?i.slice(0,s):null);t[a]=l.sort(t[a])}}return c.add(t)}const c=new n.md;class h{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function u(e,t){let i=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)i[e.id]=t.class;else i[t.tag.id]=t.class;let{scope:n,all:r=null}=t||{};return{style:e=>{let t=r;for(let n of e)for(let e of n.set){let n=i[e.id];if(n){t=t?t+" "+n:n;break}}return t},scope:n}}function d(e,t,i,n=0,r=e.length){let o=new p(n,Array.isArray(t)?t:[t],i);o.highlightRange(e.cursor(),n,r,"",o.highlighters),o.flush(r)}h.empty=new h([],2,null);class p{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,o){let{type:s,from:a,to:l}=e;if(a>=i||l<=t)return;s.isTop&&(o=this.highlighters.filter((e=>!e.scope||e.scope(s))));let u=r,d=function(e){let t=e.type.prop(c);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||h.empty,p=function(e,t){let i=null;for(let n of e){let e=n.style(t);e&&(i=i?i+" "+e:e)}return i}(o,d.tags);if(p&&(u&&(u+=" "),u+=p,1==d.mode&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(t,a),u),d.opaque)return;let f=e.tree&&e.tree.prop(n.md.mounted);if(f&&f.overlay){let n=e.node.enter(f.overlay[0].from+a,1),s=this.highlighters.filter((e=>!e.scope||e.scope(f.tree.type))),c=e.firstChild();for(let h=0,d=a;;h++){let p=h<f.overlay.length?f.overlay[h]:null,m=p?p.from+a:l,g=Math.max(t,d),v=Math.min(i,m);if(g<v&&c)for(;e.from<v&&(this.highlightRange(e,g,v,r,o),this.startSpan(Math.min(v,e.to),u),!(e.to>=m)&&e.nextSibling()););if(!p||m>i)break;d=p.to+a,d>t&&(this.highlightRange(n.cursor(),Math.max(t,p.from+a),Math.min(i,d),"",s),this.startSpan(Math.min(i,d),u))}c&&e.parent()}else if(e.firstChild()){f&&(r="");do{if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,o),this.startSpan(Math.min(i,e.to),u)}}while(e.nextSibling());e.parent()}}}const f=o.define,m=f(),g=f(),v=f(g),y=f(g),b=f(),w=f(b),k=f(b),x=f(),_=f(x),S=f(),O=f(),C=f(),T=f(C),A=f(),P={comment:m,lineComment:f(m),blockComment:f(m),docComment:f(m),name:g,variableName:f(g),typeName:v,tagName:f(v),propertyName:y,attributeName:f(y),className:f(g),labelName:f(g),namespace:f(g),macroName:f(g),literal:b,string:w,docString:f(w),character:f(w),attributeValue:f(w),number:k,integer:f(k),float:f(k),bool:f(b),regexp:f(b),escape:f(b),color:f(b),url:f(b),keyword:S,self:f(S),null:f(S),atom:f(S),unit:f(S),modifier:f(S),operatorKeyword:f(S),controlKeyword:f(S),definitionKeyword:f(S),moduleKeyword:f(S),operator:O,derefOperator:f(O),arithmeticOperator:f(O),logicOperator:f(O),bitwiseOperator:f(O),compareOperator:f(O),updateOperator:f(O),definitionOperator:f(O),typeOperator:f(O),controlOperator:f(O),punctuation:C,separator:f(C),bracket:T,angleBracket:f(T),squareBracket:f(T),paren:f(T),brace:f(T),content:x,heading:_,heading1:f(_),heading2:f(_),heading3:f(_),heading4:f(_),heading5:f(_),heading6:f(_),contentSeparator:f(x),list:f(x),quote:f(x),emphasis:f(x),strong:f(x),link:f(x),monospace:f(x),strikethrough:f(x),inserted:f(),deleted:f(),changed:f(),invalid:f(),meta:A,documentMeta:f(A),annotation:f(A),processingInstruction:f(A),definition:o.defineModifier("definition"),constant:o.defineModifier("constant"),function:o.defineModifier("function"),standard:o.defineModifier("standard"),local:o.defineModifier("local"),special:o.defineModifier("special")};for(let e in P){let t=P[e];t instanceof o&&(t.name=e)}u([{tag:P.link,class:"tok-link"},{tag:P.heading,class:"tok-heading"},{tag:P.emphasis,class:"tok-emphasis"},{tag:P.strong,class:"tok-strong"},{tag:P.keyword,class:"tok-keyword"},{tag:P.atom,class:"tok-atom"},{tag:P.bool,class:"tok-bool"},{tag:P.url,class:"tok-url"},{tag:P.labelName,class:"tok-labelName"},{tag:P.inserted,class:"tok-inserted"},{tag:P.deleted,class:"tok-deleted"},{tag:P.literal,class:"tok-literal"},{tag:P.string,class:"tok-string"},{tag:P.number,class:"tok-number"},{tag:[P.regexp,P.escape,P.special(P.string)],class:"tok-string2"},{tag:P.variableName,class:"tok-variableName"},{tag:P.local(P.variableName),class:"tok-variableName tok-local"},{tag:P.definition(P.variableName),class:"tok-variableName tok-definition"},{tag:P.special(P.variableName),class:"tok-variableName2"},{tag:P.definition(P.propertyName),class:"tok-propertyName tok-definition"},{tag:P.typeName,class:"tok-typeName"},{tag:P.namespace,class:"tok-namespace"},{tag:P.className,class:"tok-className"},{tag:P.macroName,class:"tok-macroName"},{tag:P.propertyName,class:"tok-propertyName"},{tag:P.operator,class:"tok-operator"},{tag:P.comment,class:"tok-comment"},{tag:P.meta,class:"tok-meta"},{tag:P.invalid,class:"tok-invalid"},{tag:P.punctuation,class:"tok-punctuation"}])},8580:function(e,t,i){function n(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var o=i[n];"string"==typeof o?e.setAttribute(n,o):null!=o&&(e[n]=o)}t++}for(;t<arguments.length;t++)r(e,arguments[t]);return e}function r(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var i=0;i<t.length;i++)r(e,t[i])}}i.d(t,{Z:function(){return n}})},8699:function(e,t,i){i.d(t,{V:function(){return s}});const n="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class s{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,o,s){let a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return o.push(e[0]+";");for(let i in t){let s=t[i];if(/&/.test(i))r(i.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),s,o);else if(s&&"object"==typeof s){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");r(n(i),s,a,c)}else null!=s&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+s+";")}(a.length||c)&&o.push((!i||l||s?e:e.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let t in e)r(n(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=o[n]||1;return o[n]=e+1,"ͼ"+e.toString(36)}static mount(e,t,i){let n=e[r],o=i&&i.nonce;n?o&&n.setNonce(o):n=new l(e,o),n.mount(Array.isArray(t)?t:[t],e)}}let a=new Map;class l{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let t=a.get(i);if(t)return e[r]=t;this.sheet=new n.CSSStyleSheet,a.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[r]=this}mount(e,t){let i=this.sheet,n=0,r=0;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<r&&s>-1&&(this.modules.splice(s,1),r--,s=-1),-1==s){if(this.modules.splice(r++,0,o),i)for(let e=0;e<o.rules.length;e++)i.insertRule(o.rules[e],n++)}else{for(;r<s;)n+=this.modules[r++].rules.length;n+=o.rules.length,r++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let i=t.head||t;this.styleTag.parentNode!=i&&i.insertBefore(this.styleTag,i.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}}}]);