@pubann/textae 14.3.0 → 14.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1131 +0,0 @@
1
- (()=>{var t={117:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2586),s=i(5765),o=i(4227),r=i(8660),a={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:i,parentSchema:a,data:l,it:c}=t;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&r.default.code(new n.KeywordCxt(c,r.default,"additionalProperties"));const h=(0,s.allSchemaProperties)(i);for(const t of h)c.definedProperties.add(t);c.opts.unevaluated&&h.length&&!0!==c.props&&(c.props=o.mergeEvaluated.props(e,(0,o.toHash)(h),c.props));const u=h.filter(t=>!(0,o.alwaysValidSchema)(c,i[t]));if(0===u.length)return;const d=e.name("valid");for(const i of u)f(i)?p(i):(e.if((0,s.propertyInData)(e,l,i,c.opts.ownProperties)),p(i),c.allErrors||e.else().var(d,!0),e.endIf()),t.it.definedProperties.add(i),t.ok(d);function f(t){return c.opts.useDefaults&&!c.compositeRule&&void 0!==i[t].default}function p(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},d)}}};e.default=a},208:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const n=i(396),s=i(7887),o=i(8708),r=i(9029),a=i(4227);var l;function c(t){const e=Array.isArray(t)?t:t?[t]:[];if(e.every(n.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}!function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"}(l||(e.DataType=l={})),e.getSchemaTypes=function(t){const e=c(t.type);if(e.includes("null")){if(!1===t.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&void 0!==t.nullable)throw new Error('"nullable" cannot be used without "type"');!0===t.nullable&&e.push("null")}return e},e.getJSONTypes=c,e.coerceAndCheckDataType=function(t,e){const{gen:i,data:n,opts:o}=t,a=function(t,e){return e?t.filter(t=>h.has(t)||"array"===e&&"array"===t):[]}(e,o.coerceTypes),c=e.length>0&&!(0===a.length&&1===e.length&&(0,s.schemaHasRulesForType)(t,e[0]));if(c){const s=d(e,n,o.strictNumbers,l.Wrong);i.if(s,()=>{a.length?function(t,e,i){const{gen:n,data:s,opts:o}=t,a=n.let("dataType",r._`typeof ${s}`),l=n.let("coerced",r._`undefined`);"array"===o.coerceTypes&&n.if(r._`${a} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,r._`${s}[0]`).assign(a,r._`typeof ${s}`).if(d(e,s,o.strictNumbers),()=>n.assign(l,s)));n.if(r._`${l} !== undefined`);for(const t of i)(h.has(t)||"array"===t&&"array"===o.coerceTypes)&&c(t);function c(t){switch(t){case"string":return void n.elseIf(r._`${a} == "number" || ${a} == "boolean"`).assign(l,r._`"" + ${s}`).elseIf(r._`${s} === null`).assign(l,r._`""`);case"number":return void n.elseIf(r._`${a} == "boolean" || ${s} === null
2
- || (${a} == "string" && ${s} && ${s} == +${s})`).assign(l,r._`+${s}`);case"integer":return void n.elseIf(r._`${a} === "boolean" || ${s} === null
3
- || (${a} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(l,r._`+${s}`);case"boolean":return void n.elseIf(r._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(l,!1).elseIf(r._`${s} === "true" || ${s} === 1`).assign(l,!0);case"null":return n.elseIf(r._`${s} === "" || ${s} === 0 || ${s} === false`),void n.assign(l,null);case"array":n.elseIf(r._`${a} === "string" || ${a} === "number"
4
- || ${a} === "boolean" || ${s} === null`).assign(l,r._`[${s}]`)}}n.else(),p(t),n.endIf(),n.if(r._`${l} !== undefined`,()=>{n.assign(s,l),function({gen:t,parentData:e,parentDataProperty:i},n){t.if(r._`${e} !== undefined`,()=>t.assign(r._`${e}[${i}]`,n))}(t,l)})}(t,e,a):p(t)})}return c};const h=new Set(["string","number","integer","boolean","null"]);function u(t,e,i,n=l.Correct){const s=n===l.Correct?r.operators.EQ:r.operators.NEQ;let o;switch(t){case"null":return r._`${e} ${s} null`;case"array":o=r._`Array.isArray(${e})`;break;case"object":o=r._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":o=a(r._`!(${e} % 1) && !isNaN(${e})`);break;case"number":o=a();break;default:return r._`typeof ${e} ${s} ${t}`}return n===l.Correct?o:(0,r.not)(o);function a(t=r.nil){return(0,r.and)(r._`typeof ${e} == "number"`,t,i?r._`isFinite(${e})`:r.nil)}}function d(t,e,i,n){if(1===t.length)return u(t[0],e,i,n);let s;const o=(0,a.toHash)(t);if(o.array&&o.object){const t=r._`typeof ${e} != "object"`;s=o.null?t:r._`!${e} || ${t}`,delete o.null,delete o.array,delete o.object}else s=r.nil;o.number&&delete o.integer;for(const t in o)s=(0,r.and)(s,u(t,e,i,n));return s}e.checkDataType=u,e.checkDataTypes=d;const f={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>"string"==typeof t?r._`{type: ${t}}`:r._`{type: ${e}}`};function p(t){const e=function(t){const{gen:e,data:i,schema:n}=t,s=(0,a.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:i,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:t}}(t);(0,o.reportError)(e,f)}e.reportTypeError=p},343:(t,e,i)=>{"use strict";const{isUUID:n}=i(4834),s=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function r(t){return!0===t.secure||!1!==t.secure&&(!!t.scheme&&!(3!==t.scheme.length||"w"!==t.scheme[0]&&"W"!==t.scheme[0]||"s"!==t.scheme[1]&&"S"!==t.scheme[1]||"s"!==t.scheme[2]&&"S"!==t.scheme[2]))}function a(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function l(t){const e="https"===String(t.scheme).toLowerCase();return t.port!==(e?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}const c={scheme:"http",domainHost:!0,parse:a,serialize:l},h={scheme:"ws",domainHost:!0,parse:function(t){return t.secure=r(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(t){if(t.port!==(r(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[e,i]=t.resourceName.split("?");t.path=e&&"/"!==e?e:void 0,t.query=i,t.resourceName=void 0}return t.fragment=void 0,t}},u={http:c,https:{scheme:"https",domainHost:c.domainHost,parse:a,serialize:l},ws:h,wss:{scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},urn:{scheme:"urn",parse:function(t,e){if(!t.path)return t.error="URN can not be parsed",t;const i=t.path.match(s);if(i){const n=e.scheme||t.scheme||"urn";t.nid=i[1].toLowerCase(),t.nss=i[2];const s=d(`${n}:${e.nid||t.nid}`);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(t,e){if(void 0===t.nid)throw new Error("URN without nid cannot be serialized");const i=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),s=d(`${i}:${e.nid||n}`);s&&(t=s.serialize(t,e));const o=t,r=t.nss;return o.path=`${n||e.nid}:${r}`,e.skipEscape=!0,o},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(t,e){const i=t;return i.uuid=i.nss,i.nss=void 0,e.tolerant||i.uuid&&n(i.uuid)||(i.error=i.error||"UUID is not valid."),i},serialize:function(t){const e=t;return e.nss=(t.uuid||"").toLowerCase(),e},skipNormalize:!0}};function d(t){return t&&(u[t]||u[t.toLowerCase()])||void 0}Object.setPrototypeOf(u,null),t.exports={wsIsSecure:r,SCHEMES:u,isValidSchemeName:function(t){return-1!==o.indexOf(t)},getSchemeHandler:d}},396:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;const i=new Set(["string","number","integer","boolean","null","object","array"]);e.isJSONType=function(t){return"string"==typeof t&&i.has(t)},e.getRules=function(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}},422:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),s=i(9029),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>s.str`must match pattern "${t}"`,params:({schemaCode:t})=>s._`{pattern: ${t}}`},code(t){const{data:e,$data:i,schema:o,schemaCode:r,it:a}=t,l=a.opts.unicodeRegExp?"u":"",c=i?s._`(new RegExp(${r}, ${l}))`:(0,n.usePattern)(t,o);t.fail$data(s._`!${c}.test(${e})`)}};e.default=o},494:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;const n=i(9029),s=i(4227),o=i(5765),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:i}=t;if(Array.isArray(e))return a(t,"additionalItems",e);i.items=!0,(0,s.alwaysValidSchema)(i,e)||t.ok((0,o.validateArray)(t))}};function a(t,e,i=t.schema){const{gen:o,parentSchema:r,data:a,keyword:l,it:c}=t;!function(t){const{opts:n,errSchemaPath:o}=c,r=i.length,a=r===t.minItems&&(r===t.maxItems||!1===t[e]);if(n.strictTuples&&!a){const t=`"${l}" is ${r}-tuple, but minItems or maxItems/${e} are not specified or different at path "${o}"`;(0,s.checkStrictMode)(c,t,n.strictTuples)}}(r),c.opts.unevaluated&&i.length&&!0!==c.items&&(c.items=s.mergeEvaluated.items(o,i.length,c.items));const h=o.name("valid"),u=o.const("len",n._`${a}.length`);i.forEach((e,i)=>{(0,s.alwaysValidSchema)(c,e)||(o.if(n._`${u} > ${i}`,()=>t.subschema({keyword:l,schemaProp:i,dataProp:i},h)),t.ok(h))})}e.validateTuple=a,e.default=r},504:t=>{t.exports=function(t){var e=[];return t=void 0===t?null:t,i.set=function(i){t=i,e.forEach(function(t){t(i)})},i;function i(i){return i?(e.push(i),function(){e.splice(e.indexOf(i),1)}):t}}},617:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(208),s=i(9029),o=i(4227),r=i(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:e}})=>s.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>s._`{i: ${t}, j: ${e}}`},code(t){const{gen:e,data:i,$data:a,schema:l,parentSchema:c,schemaCode:h,it:u}=t;if(!a&&!l)return;const d=e.let("valid"),f=c.items?(0,n.getSchemaTypes)(c.items):[];function p(o,r){const a=e.name("item"),l=(0,n.checkDataTypes)(f,a,u.opts.strictNumbers,n.DataType.Wrong),c=e.const("indices",s._`{}`);e.for(s._`;${o}--;`,()=>{e.let(a,s._`${i}[${o}]`),e.if(l,s._`continue`),f.length>1&&e.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),e.if(s._`typeof ${c}[${a}] == "number"`,()=>{e.assign(r,s._`${c}[${a}]`),t.error(),e.assign(d,!1).break()}).code(s._`${c}[${a}] = ${o}`)})}function m(n,a){const l=(0,o.useFunc)(e,r.default),c=e.name("outer");e.label(c).for(s._`;${n}--;`,()=>e.for(s._`${a} = ${n}; ${a}--;`,()=>e.if(s._`${l}(${i}[${n}], ${i}[${a}])`,()=>{t.error(),e.assign(d,!1).break(c)})))}t.block$data(d,function(){const n=e.let("i",s._`${i}.length`),o=e.let("j");t.setParams({i:n,j:o}),e.assign(d,!0),e.if(s._`${n} > 1`,()=>(f.length>0&&!f.some(t=>"object"===t||"array"===t)?p:m)(n,o))},s._`${h} === false`),t.ok(d)}};e.default=a},724:(t,e,i)=>{var n,s,o;
5
- /*!
6
- * jQuery UI Disable Selection 1.14.1
7
- * https://jqueryui.com
8
- *
9
- * Copyright OpenJS Foundation and other contributors
10
- * Released under the MIT license.
11
- * https://jquery.org/license
12
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.fn.extend({disableSelection:(e="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(e+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var e})?n.apply(e,s):n)||(t.exports=o)}()},1163:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const i="maxItems"===t?"more":"fewer";return n.str`must NOT have ${i} than ${e} items`},params:({schemaCode:t})=>n._`{limit: ${t}}`},code(t){const{keyword:e,data:i,schemaCode:s}=t,o="maxItems"===e?n.operators.GT:n.operators.LT;t.fail$data(n._`${i}.length ${o} ${s}`)}};e.default=s},1193:(t,e,i)=>{var n,s,o;
13
- /*!
14
- * jQuery UI Dialog 1.14.1
15
- * https://jqueryui.com
16
- *
17
- * Copyright OpenJS Foundation and other contributors
18
- * Released under the MIT license.
19
- * https://jquery.org/license
20
- */!function(){"use strict";s=[i(4692),i(8481),i(1758),i(3662),i(8604),i(1255),i(1897),i(4224),i(7144),i(5304),i(6883),i(9139)],n=function(t){t.widget("ui.dialog",{version:"1.14.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;i<0&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,uiDialogTitleHeadingLevel:0,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",e)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t(this.document[0].activeElement).trigger("blur"),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var n=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,s);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),n=!0),n&&!i&&this._trigger("focus",e),n},open:function(){var e=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_restoreTabbableFocus:function(){var e=this.document[0].activeElement;this.uiDialog[0]===e||t.contains(this.uiDialog[0],e)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus()},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog","aria-modal":this.options.modal?"true":null}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),n=i.first(),s=i.last();e.target!==s[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==n[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){s.trigger("focus")}),e.preventDefault()):(this._delay(function(){n.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}});var i=Number.isInteger(this.options.uiDialogTitleHeadingLevel)&&this.options.uiDialogTitleHeadingLevel>0&&this.options.uiDialogTitleHeadingLevel<=6?"h"+this.options.uiDialogTitleHeadingLevel:"span";e=t("<"+i+">").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||Array.isArray(i)&&!i.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(t.each(i,function(i,n){var s,o;n="function"==typeof n?{click:n,text:i}:n,n=t.extend({type:"button"},n),s=n.click,o={icon:n.icon,iconPosition:n.iconPosition,showLabel:n.showLabel,icons:n.icons,text:n.text},delete n.click,delete n.icon,delete n.iconPosition,delete n.showLabel,delete n.icons,"boolean"==typeof n.text&&delete n.text,t("<button></button>",n).button(o).appendTo(e.uiButtonSet).on("click",function(){s.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var e=this,i=this.options;function n(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,s){e._addClass(t(this),"ui-dialog-dragging"),e._blockFrames(),e._trigger("dragStart",i,n(s))},drag:function(t,i){e._trigger("drag",t,n(i))},stop:function(s,o){var r=o.offset.left-e.document.scrollLeft(),a=o.offset.top-e.document.scrollTop();i.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" top"+(a>=0?"+":"")+a,of:e.window},e._removeClass(t(this),"ui-dialog-dragging"),e._unblockFrames(),e._trigger("dragStop",s,n(o))}})},_makeResizable:function(){var e=this,i=this.options,n=i.resizable,s=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";function r(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(i,n){e._addClass(t(this),"ui-dialog-resizing"),e._blockFrames(),e._trigger("resizeStart",i,r(n))},resize:function(t,i){e._trigger("resize",t,r(i))},stop:function(n,s){var o=e.uiDialog.offset(),a=o.left-e.document.scrollLeft(),l=o.top-e.document.scrollTop();i.height=e.uiDialog.height(),i.width=e.uiDialog.width(),i.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(l>=0?"+":"")+l,of:e.window},e._removeClass(t(this),"ui-dialog-resizing"),e._unblockFrames(),e._trigger("resizeStop",n,r(s))}}).css("position",s)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,n=!1,s={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(n=!0),t in i.resizableRelatedOptions&&(s[t]=e)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(e,i){var n,s,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&((n=o.is(":data(ui-draggable)"))&&!i&&o.draggable("destroy"),!n&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&((s=o.is(":data(ui-resizable)"))&&!i&&o.resizable("destroy"),s&&"string"==typeof i&&o.resizable("option","handles",i),s||!1===i||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")),"modal"===e&&o.attr("aria-modal",i?"true":null))},_size:function(){var t,e,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),t=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),e=Math.max(0,n.minHeight-t),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-t):"none","auto"===n.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){if(!e){var i=this._trackingInstances()[0];i._allowInteraction(t)||(t.preventDefault(),i._focusTabbable())}}.bind(this)),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!0===t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});return t.ui.dialog},void 0===(o="function"==typeof n?n.apply(e,s):n)||(t.exports=o)}()},1239:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>n.str`must match "${t.ifClause}" schema`,params:({params:t})=>n._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:i,it:o}=t;void 0===i.then&&void 0===i.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=r(o,"then"),l=r(o,"else");if(!a&&!l)return;const c=e.let("valid",!0),h=e.name("_valid");if(function(){const e=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);t.mergeEvaluated(e)}(),t.reset(),a&&l){const i=e.let("ifClause");t.setParams({ifClause:i}),e.if(h,u("then",i),u("else",i))}else a?e.if(h,u("then")):e.if((0,n.not)(h),u("else"));function u(i,s){return()=>{const o=t.subschema({keyword:i},h);e.assign(c,h),t.mergeValidEvaluated(o,c),s?e.assign(s,n._`${i}`):t.setParams({ifClause:i})}}t.pass(c,()=>t.error(!0))}};function r(t,e){const i=t.schema[e];return void 0!==i&&!(0,s.alwaysValidSchema)(t,i)}e.default=o},1255:(t,e,i)=>{var n,s,o;
21
- /*!
22
- * jQuery UI Focusable 1.14.1
23
- * https://jqueryui.com
24
- *
25
- * Copyright OpenJS Foundation and other contributors
26
- * Released under the MIT license.
27
- * https://jquery.org/license
28
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.ui.focusable=function(e,i){var n,s,o,r,a,l=e.nodeName.toLowerCase();return"area"===l?(s=(n=e.parentNode).name,!(!e.href||!s||"map"!==n.nodeName.toLowerCase())&&((o=t("img[usemap='#"+s+"']")).length>0&&o.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(l)?(r=!e.disabled)&&(a=t(e).closest("fieldset")[0])&&(r=!a.disabled):r="a"===l&&e.href||i,r&&t(e).is(":visible")&&"visible"===t(e).css("visibility"))},t.extend(t.expr.pseudos,{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable})?n.apply(e,s):n)||(t.exports=o)}()},1520:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class i{}e._CodeOrName=i,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends i{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class s extends i{constructor(t){super(),this._items="string"==typeof t?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return""===t||'""'===t}get str(){var t;return null!==(t=this._str)&&void 0!==t?t:this._str=this._items.reduce((t,e)=>`${t}${e}`,"")}get names(){var t;return null!==(t=this._names)&&void 0!==t?t:this._names=this._items.reduce((t,e)=>(e instanceof n&&(t[e.str]=(t[e.str]||0)+1),t),{})}}function o(t,...e){const i=[t[0]];let n=0;for(;n<e.length;)l(i,e[n]),i.push(t[++n]);return new s(i)}e._Code=s,e.nil=new s(""),e._=o;const r=new s("+");function a(t,...e){const i=[h(t[0])];let n=0;for(;n<e.length;)i.push(r),l(i,e[n]),i.push(r,h(t[++n]));return function(t){let e=1;for(;e<t.length-1;){if(t[e]===r){const i=c(t[e-1],t[e+1]);if(void 0!==i){t.splice(e-1,3,i);continue}t[e++]="+"}e++}}(i),new s(i)}function l(t,e){var i;e instanceof s?t.push(...e._items):e instanceof n?t.push(e):t.push("number"==typeof(i=e)||"boolean"==typeof i||null===i?i:h(Array.isArray(i)?i.join(","):i))}function c(t,e){if('""'===e)return t;if('""'===t)return e;if("string"==typeof t){if(e instanceof n||'"'!==t[t.length-1])return;return"string"!=typeof e?`${t.slice(0,-1)}${e}"`:'"'===e[0]?t.slice(0,-1)+e.slice(1):void 0}return"string"!=typeof e||'"'!==e[0]||t instanceof n?void 0:`"${t}${e.slice(1)}`}function h(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=a,e.addCodeArg=l,e.strConcat=function(t,e){return e.emptyStr()?t:t.emptyStr()?e:a`${t}${e}`},e.stringify=function(t){return new s(h(t))},e.safeStringify=h,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new s(`.${t}`):o`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new s(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(t){return new s(t.toString())}},1758:(t,e,i)=>{var n,s,o;
29
- /*!
30
- * jQuery UI Draggable 1.14.1
31
- * https://jqueryui.com
32
- *
33
- * Copyright OpenJS Foundation and other contributors
34
- * Released under the MIT license.
35
- * https://jquery.org/license
36
- */!function(){"use strict";s=[i(4692),i(3662),i(9983),i(2336),i(2299),i(6883),i(9139)],void 0===(o="function"==typeof(n=function(t){return t.widget("ui.draggable",t.ui.mouse,{version:"1.14.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=this.document[0].activeElement;t(e.target).closest(i).length||t(i).trigger("blur")},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=n.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,n=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(n=t.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,n)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,n="function"==typeof i.helper,s=n?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n&&s[0]===this.element[0]&&this._setPositionRelative(),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),Array.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,n,s=this.options,o=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(n=(i=t(s.containment))[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)):this.containment=s.containment:this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,n,s,o,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,c=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(n=this.relativeContainer.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(c=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(c=i[3]+this.offset.click.top)),r.grid&&(s=r.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,c=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-r.grid[1]:s+r.grid[1]:s,o=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-r.grid[0]:o+r.grid[0]:o),"y"===r.axis&&(l=this.originalPageX),"x"===r.axis&&(c=this.originalPageY)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,n){return n=n||this._uiHash(),t.ui.plugin.call(this,e,[i,n,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,n){var s=t.extend({},i,{item:n.element});n.sortables=[],t(n.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(n.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,s))})},stop:function(e,i,n){var s=t.extend({},i,{item:n.element});n.cancelHelperRemoval=!1,t.each(n.sortables,function(){var t=this;t.isOver?(t.isOver=0,n.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(e,i,n){t.each(n.sortables,function(){var s=!1,o=this;o.positionAbs=n.positionAbs,o.helperProportions=n.helperProportions,o.offset.click=n.offset.click,o._intersectsWith(o.containerCache)&&(s=!0,t.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(s=!1),s})),s?(o.isOver||(o.isOver=1,n._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=n.offset.click.top,o.offset.click.left=n.offset.click.left,o.offset.parent.left-=n.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=n.offset.parent.top-o.offset.parent.top,n._trigger("toSortable",e),n.dropped=o.element,t.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,o.fromOutside=n),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(n._parent),n._refreshOffsets(e),i.position=n._generatePosition(e,!0),n._trigger("fromSortable",e),n.dropped=!1,t.each(n.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,n){var s=t("body"),o=n.options;s.css("cursor")&&(o._cursor=s.css("cursor")),s.css("cursor",o.cursor)},stop:function(e,i,n){var s=n.options;s._cursor&&t("body").css("cursor",s._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,n){var s=t(i.helper),o=n.options;s.css("opacity")&&(o._opacity=s.css("opacity")),s.css("opacity",o.opacity)},stop:function(e,i,n){var s=n.options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,n){var s=n.options,o=!1,r=n.scrollParentNotHidden[0],a=n.document[0];r!==a&&"HTML"!==r.tagName?(s.axis&&"x"===s.axis||(n.overflowOffset.top+r.offsetHeight-e.pageY<s.scrollSensitivity?r.scrollTop=o=r.scrollTop+s.scrollSpeed:e.pageY-n.overflowOffset.top<s.scrollSensitivity&&(r.scrollTop=o=r.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(n.overflowOffset.left+r.offsetWidth-e.pageX<s.scrollSensitivity?r.scrollLeft=o=r.scrollLeft+s.scrollSpeed:e.pageX-n.overflowOffset.left<s.scrollSensitivity&&(r.scrollLeft=o=r.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(a).scrollTop()<s.scrollSensitivity?o=t(a).scrollTop(t(a).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(a).scrollTop())<s.scrollSensitivity&&(o=t(a).scrollTop(t(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(a).scrollLeft()<s.scrollSensitivity?o=t(a).scrollLeft(t(a).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(a).scrollLeft())<s.scrollSensitivity&&(o=t(a).scrollLeft(t(a).scrollLeft()+s.scrollSpeed)))),!1!==o&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(n,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,n){var s=n.options;n.snapElements=[],t(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var e=t(this),i=e.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,n){var s,o,r,a,l,c,h,u,d,f,p=n.options,m=p.snapTolerance,g=i.offset.left,v=g+n.helperProportions.width,y=i.offset.top,O=y+n.helperProportions.height;for(d=n.snapElements.length-1;d>=0;d--)c=(l=n.snapElements[d].left-n.margins.left)+n.snapElements[d].width,u=(h=n.snapElements[d].top-n.margins.top)+n.snapElements[d].height,v<l-m||g>c+m||O<h-m||y>u+m||!t.contains(n.snapElements[d].item.ownerDocument,n.snapElements[d].item)?(n.snapElements[d].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=!1):("inner"!==p.snapMode&&(s=Math.abs(h-O)<=m,o=Math.abs(u-y)<=m,r=Math.abs(l-v)<=m,a=Math.abs(c-g)<=m,s&&(i.position.top=n._convertPositionTo("relative",{top:h-n.helperProportions.height,left:0}).top),o&&(i.position.top=n._convertPositionTo("relative",{top:u,left:0}).top),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:c}).left)),f=s||o||r||a,"outer"!==p.snapMode&&(s=Math.abs(h-y)<=m,o=Math.abs(u-O)<=m,r=Math.abs(l-g)<=m,a=Math.abs(c-v)<=m,s&&(i.position.top=n._convertPositionTo("relative",{top:h,left:0}).top),o&&(i.position.top=n._convertPositionTo("relative",{top:u-n.helperProportions.height,left:0}).top),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l}).left),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:c-n.helperProportions.width}).left)),!n.snapElements[d].snapping&&(s||o||r||a||f)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=s||o||r||a||f)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,n){var s,o=n.options,r=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});r.length&&(s=parseInt(t(r[0]).css("zIndex"),10)||0,t(r).each(function(e){t(this).css("zIndex",s+e)}),this.css("zIndex",s+r.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,n){var s=t(i.helper),o=n.options;s.css("zIndex")&&(o._zIndex=s.css("zIndex")),s.css("zIndex",o.zIndex)},stop:function(e,i,n){var s=n.options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}}),t.ui.draggable})?n.apply(e,s):n)||(t.exports=o)}()},1897:(t,e,i)=>{var n,s,o;
37
- /*!
38
- * jQuery UI Keycode 1.14.1
39
- * https://jqueryui.com
40
- *
41
- * Copyright OpenJS Foundation and other contributors
42
- * Released under the MIT license.
43
- * https://jquery.org/license
44
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})?n.apply(e,s):n)||(t.exports=o)}()},2017:t=>{"use strict";t.exports=function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var n,s,o;if(Array.isArray(e)){if((n=e.length)!=i.length)return!1;for(s=n;0!==s--;)if(!t(e[s],i[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(s=n;0!==s--;)if(!Object.prototype.hasOwnProperty.call(i,o[s]))return!1;for(s=n;0!==s--;){var r=o[s];if(!t(e[r],i[r]))return!1}return!0}return e!=e&&i!=i}},2023:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};e.default=s},2079:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2097:(t,e,i)=>{var n,s,o;
45
- /*!
46
- * jQuery UI Checkboxradio 1.14.1
47
- * https://jqueryui.com
48
- *
49
- * Copyright OpenJS Foundation and other contributors
50
- * Released under the MIT license.
51
- * https://jquery.org/license
52
- */!function(){"use strict";s=[i(4692),i(7687),i(2420),i(9139)],void 0===(o="function"==typeof(n=function(t){return t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.14.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,n,s=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",(n=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=n.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(s.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(s.disabled=e),s},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e=this.element[0].name,i="input[name='"+CSS.escape(e)+"']";return e?(this.form.length?t(this.form[0].elements).filter(i):t(i).filter(function(){return 0===t(t(this).prop("form")).length})).not(this.element):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio})?n.apply(e,s):n)||(t.exports=o)}()},2128:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(3463),s=i(3693),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,s.default];e.default=o},2299:(t,e,i)=>{var n,s,o;
53
- /*!
54
- * jQuery UI Scroll Parent 1.14.1
55
- * https://jqueryui.com
56
- *
57
- * Copyright OpenJS Foundation and other contributors
58
- * Released under the MIT license.
59
- * https://jquery.org/license
60
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.fn.scrollParent=function(e){var i=this.css("position"),n="absolute"===i,s=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return(!n||"static"!==e.css("position"))&&s.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)}})?n.apply(e,s):n)||(t.exports=o)}()},2336:(t,e,i)=>{var n,s,o;!function(){"use strict";s=[i(4692),i(6883)],n=function(t){return t.ui.plugin={add:function(e,i,n){var s,o=t.ui[e].prototype;for(s in n)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([i,n[s]])},call:function(t,e,i,n){var s,o=t.plugins[e];if(o&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(s=0;s<o.length;s++)t.options[o[s][0]]&&o[s][1].apply(t.element,i)}}},void 0===(o="function"==typeof n?n.apply(e,s):n)||(t.exports=o)}()},2420:(t,e,i)=>{var n,s,o;
61
- /*!
62
- * jQuery UI Labels 1.14.1
63
- * https://jqueryui.com
64
- *
65
- * Copyright OpenJS Foundation and other contributors
66
- * Released under the MIT license.
67
- * https://jquery.org/license
68
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.fn.labels=function(){var t,e,i,n,s;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),(i=this.attr("id"))&&(s=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+CSS.escape(i)+"']",n=n.add(s.find(e).addBack(e))),this.pushStack(n)):this.pushStack([])}})?n.apply(e,s):n)||(t.exports=o)}()},2586:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;const n=i(8727),s=i(208),o=i(7887),r=i(208),a=i(7870),l=i(3673),c=i(4495),h=i(9029),u=i(2023),d=i(6939),f=i(4227),p=i(8708);function m({gen:t,validateName:e,schema:i,schemaEnv:n,opts:s},o){s.code.es5?t.func(e,h._`${u.default.data}, ${u.default.valCxt}`,n.$async,()=>{t.code(h._`"use strict"; ${g(i,s)}`),function(t,e){t.if(u.default.valCxt,()=>{t.var(u.default.instancePath,h._`${u.default.valCxt}.${u.default.instancePath}`),t.var(u.default.parentData,h._`${u.default.valCxt}.${u.default.parentData}`),t.var(u.default.parentDataProperty,h._`${u.default.valCxt}.${u.default.parentDataProperty}`),t.var(u.default.rootData,h._`${u.default.valCxt}.${u.default.rootData}`),e.dynamicRef&&t.var(u.default.dynamicAnchors,h._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{t.var(u.default.instancePath,h._`""`),t.var(u.default.parentData,h._`undefined`),t.var(u.default.parentDataProperty,h._`undefined`),t.var(u.default.rootData,u.default.data),e.dynamicRef&&t.var(u.default.dynamicAnchors,h._`{}`)})}(t,s),t.code(o)}):t.func(e,h._`${u.default.data}, ${function(t){return h._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${t.dynamicRef?h._`, ${u.default.dynamicAnchors}={}`:h.nil}}={}`}(s)}`,n.$async,()=>t.code(g(i,s)).code(o))}function g(t,e){const i="object"==typeof t&&t[e.schemaId];return i&&(e.code.source||e.code.process)?h._`/*# sourceURL=${i} */`:h.nil}function v(t,e){O(t)&&(b(t),y(t))?function(t,e){const{schema:i,gen:n,opts:s}=t;s.$comment&&i.$comment&&w(t);(function(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,d.resolveUrl)(t.opts.uriResolver,t.baseId,e))})(t),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}(t);const o=n.const("_errs",u.default.errors);x(t,o),n.var(e,h._`${o} === ${u.default.errors}`)}(t,e):(0,n.boolOrEmptySchema)(t,e)}function y({schema:t,self:e}){if("boolean"==typeof t)return!t;for(const i in t)if(e.RULES.all[i])return!0;return!1}function O(t){return"boolean"!=typeof t.schema}function b(t){(0,f.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:i,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}(t)}function x(t,e){if(t.opts.jtd)return _(t,[],!1,e);const i=(0,s.getSchemaTypes)(t.schema);_(t,i,!(0,s.coerceAndCheckDataType)(t,i),e)}function w({gen:t,schemaEnv:e,schema:i,errSchemaPath:n,opts:s}){const o=i.$comment;if(!0===s.$comment)t.code(h._`${u.default.self}.logger.log(${o})`);else if("function"==typeof s.$comment){const i=h.str`${n}/$comment`,s=t.scopeValue("root",{ref:e.root});t.code(h._`${u.default.self}.opts.$comment(${o}, ${i}, ${s}.schema)`)}}function _(t,e,i,n){const{gen:s,schema:a,data:l,allErrors:c,opts:d,self:p}=t,{RULES:m}=p;function g(f){(0,o.shouldUseGroup)(a,f)&&(f.type?(s.if((0,r.checkDataType)(f.type,l,d.strictNumbers)),S(t,f),1===e.length&&e[0]===f.type&&i&&(s.else(),(0,r.reportTypeError)(t)),s.endIf()):S(t,f),c||s.if(h._`${u.default.errors} === ${n||0}`))}!a.$ref||!d.ignoreKeywordsWithRef&&(0,f.schemaHasRulesButRef)(a,m)?(d.jtd||function(t,e){if(t.schemaEnv.meta||!t.opts.strictTypes)return;(function(t,e){if(!e.length)return;if(!t.dataTypes.length)return void(t.dataTypes=e);e.forEach(e=>{$(t.dataTypes,e)||T(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)}),function(t,e){const i=[];for(const n of t.dataTypes)$(e,n)?i.push(n):e.includes("integer")&&"number"===n&&i.push("integer");t.dataTypes=i}(t,e)})(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&T(t,"use allowUnionTypes to allow union type keyword")}(t,e);!function(t,e){const i=t.self.RULES.all;for(const n in i){const s=i[n];if("object"==typeof s&&(0,o.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some(t=>k(e,t))&&T(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}(t,t.dataTypes)}(t,e),s.block(()=>{for(const t of m.rules)g(t);g(m.post)})):s.block(()=>P(t,"$ref",m.all.$ref.definition))}function S(t,e){const{gen:i,schema:n,opts:{useDefaults:s}}=t;s&&(0,a.assignDefaults)(t,e.type),i.block(()=>{for(const i of e.rules)(0,o.shouldUseRule)(n,i)&&P(t,i.keyword,i.definition,e.type)})}function k(t,e){return t.includes(e)||"number"===e&&t.includes("integer")}function $(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function T(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,(0,f.checkStrictMode)(t,e,t.opts.strictTypes)}e.validateFunctionCode=function(t){O(t)&&(b(t),y(t))?function(t){const{schema:e,opts:i,gen:n}=t;m(t,()=>{i.$comment&&e.$comment&&w(t),function(t){const{schema:e,opts:i}=t;void 0!==e.default&&i.useDefaults&&i.strictSchema&&(0,f.checkStrictMode)(t,"default is ignored in the schema root")}(t),n.let(u.default.vErrors,null),n.let(u.default.errors,0),i.unevaluated&&function(t){const{gen:e,validateName:i}=t;t.evaluated=e.const("evaluated",h._`${i}.evaluated`),e.if(h._`${t.evaluated}.dynamicProps`,()=>e.assign(h._`${t.evaluated}.props`,h._`undefined`)),e.if(h._`${t.evaluated}.dynamicItems`,()=>e.assign(h._`${t.evaluated}.items`,h._`undefined`))}(t),x(t),function(t){const{gen:e,schemaEnv:i,validateName:n,ValidationError:s,opts:o}=t;i.$async?e.if(h._`${u.default.errors} === 0`,()=>e.return(u.default.data),()=>e.throw(h._`new ${s}(${u.default.vErrors})`)):(e.assign(h._`${n}.errors`,u.default.vErrors),o.unevaluated&&function({gen:t,evaluated:e,props:i,items:n}){i instanceof h.Name&&t.assign(h._`${e}.props`,i);n instanceof h.Name&&t.assign(h._`${e}.items`,n)}(t),e.return(h._`${u.default.errors} === 0`))}(t)})}(t):m(t,()=>(0,n.topBoolOrEmptySchema)(t))};class C{constructor(t,e,i){if((0,l.validateKeywordUsage)(t,e,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=e.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,f.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=e.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=e,this.$data)this.schemaCode=t.gen.const("vSchema",M(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,e.schemaType,e.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(e.schemaType)}`);("code"in e?e.trackErrors:!1!==e.errors)&&(this.errsCount=t.gen.const("_errs",u.default.errors))}result(t,e,i){this.failResult((0,h.not)(t),e,i)}failResult(t,e,i){this.gen.if(t),i?i():this.error(),e?(this.gen.else(),e(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,e){this.failResult((0,h.not)(t),void 0,e)}fail(t){if(void 0===t)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:e}=this;this.fail(h._`${e} !== undefined && (${(0,h.or)(this.invalid$data(),t)})`)}error(t,e,i){if(e)return this.setParams(e),this._error(t,i),void this.setParams({});this._error(t,i)}_error(t,e){(t?p.reportExtraError:p.reportError)(this,this.def.error,e)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,e){e?Object.assign(this.params,t):this.params=t}block$data(t,e,i=h.nil){this.gen.block(()=>{this.check$data(t,i),e()})}check$data(t=h.nil,e=h.nil){if(!this.$data)return;const{gen:i,schemaCode:n,schemaType:s,def:o}=this;i.if((0,h.or)(h._`${n} === undefined`,e)),t!==h.nil&&i.assign(t,!0),(s.length||o.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==h.nil&&i.assign(t,!1)),i.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:i,def:n,it:s}=this;return(0,h.or)(function(){if(i.length){if(!(e instanceof h.Name))throw new Error("ajv implementation error");const t=Array.isArray(i)?i:[i];return h._`${(0,r.checkDataTypes)(t,e,s.opts.strictNumbers,r.DataType.Wrong)}`}return h.nil}(),function(){if(n.validateSchema){const i=t.scopeValue("validate$data",{ref:n.validateSchema});return h._`!${i}(${e})`}return h.nil}())}subschema(t,e){const i=(0,c.getSubschema)(this.it,t);(0,c.extendSubschemaData)(i,this.it,t),(0,c.extendSubschemaMode)(i,t);const n={...this.it,...i,items:void 0,props:void 0};return v(n,e),n}mergeEvaluated(t,e){const{it:i,gen:n}=this;i.opts.unevaluated&&(!0!==i.props&&void 0!==t.props&&(i.props=f.mergeEvaluated.props(n,t.props,i.props,e)),!0!==i.items&&void 0!==t.items&&(i.items=f.mergeEvaluated.items(n,t.items,i.items,e)))}mergeValidEvaluated(t,e){const{it:i,gen:n}=this;if(i.opts.unevaluated&&(!0!==i.props||!0!==i.items))return n.if(e,()=>this.mergeEvaluated(t,h.Name)),!0}}function P(t,e,i,n){const s=new C(t,i,e);"code"in i?i.code(s,n):s.$data&&i.validate?(0,l.funcKeywordCode)(s,i):"macro"in i?(0,l.macroKeywordCode)(s,i):(i.compile||i.validate)&&(0,l.funcKeywordCode)(s,i)}e.KeywordCxt=C;const E=/^\/(?:[^~]|~0|~1)*$/,A=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function M(t,{dataLevel:e,dataNames:i,dataPathArr:n}){let s,o;if(""===t)return u.default.rootData;if("/"===t[0]){if(!E.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,o=u.default.rootData}else{const r=A.exec(t);if(!r)throw new Error(`Invalid JSON-pointer: ${t}`);const a=+r[1];if(s=r[2],"#"===s){if(a>=e)throw new Error(l("property/index",a));return n[e-a]}if(a>e)throw new Error(l("data",a));if(o=i[e-a],!s)return o}let r=o;const a=s.split("/");for(const t of a)t&&(o=h._`${o}${(0,h.getProperty)((0,f.unescapeJsonPointer)(t))}`,r=h._`${r} && ${o}`);return r;function l(t,i){return`Cannot access ${t} ${i} levels up, current level is ${e}`}}e.getData=M},2628:t=>{var e;self,e=function(){return function(){var t={3099:function(t){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},6077:function(t,e,i){var n=i(111);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},1223:function(t,e,i){var n=i(5112),s=i(30),o=i(3070),r=n("unscopables"),a=Array.prototype;null==a[r]&&o.f(a,r,{configurable:!0,value:s(null)}),t.exports=function(t){a[r][t]=!0}},1530:function(t,e,i){"use strict";var n=i(8710).charAt;t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},5787:function(t){t.exports=function(t,e,i){if(!(t instanceof e))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return t}},9670:function(t,e,i){var n=i(111);t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},4019:function(t){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},260:function(t,e,i){"use strict";var n,s=i(4019),o=i(9781),r=i(7854),a=i(111),l=i(6656),c=i(648),h=i(8880),u=i(1320),d=i(3070).f,f=i(9518),p=i(7674),m=i(5112),g=i(9711),v=r.Int8Array,y=v&&v.prototype,O=r.Uint8ClampedArray,b=O&&O.prototype,x=v&&f(v),w=y&&f(y),_=Object.prototype,S=_.isPrototypeOf,k=m("toStringTag"),$=g("TYPED_ARRAY_TAG"),T=s&&!!p&&"Opera"!==c(r.opera),C=!1,P={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},E={BigInt64Array:8,BigUint64Array:8},A=function(t){if(!a(t))return!1;var e=c(t);return l(P,e)||l(E,e)};for(n in P)r[n]||(T=!1);if((!T||"function"!=typeof x||x===Function.prototype)&&(x=function(){throw TypeError("Incorrect invocation")},T))for(n in P)r[n]&&p(r[n],x);if((!T||!w||w===_)&&(w=x.prototype,T))for(n in P)r[n]&&p(r[n].prototype,w);if(T&&f(b)!==w&&p(b,w),o&&!l(w,k))for(n in C=!0,d(w,k,{get:function(){return a(this)?this[$]:void 0}}),P)r[n]&&h(r[n],$,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:C&&$,aTypedArray:function(t){if(A(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(p){if(S.call(x,t))return t}else for(var e in P)if(l(P,n)){var i=r[e];if(i&&(t===i||S.call(i,t)))return t}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i){if(o){if(i)for(var n in P){var s=r[n];s&&l(s.prototype,t)&&delete s.prototype[t]}w[t]&&!i||u(w,t,i?e:T&&y[t]||e)}},exportTypedArrayStaticMethod:function(t,e,i){var n,s;if(o){if(p){if(i)for(n in P)(s=r[n])&&l(s,t)&&delete s[t];if(x[t]&&!i)return;try{return u(x,t,i?e:T&&v[t]||e)}catch(t){}}for(n in P)!(s=r[n])||s[t]&&!i||u(s,t,e)}},isView:function(t){if(!a(t))return!1;var e=c(t);return"DataView"===e||l(P,e)||l(E,e)},isTypedArray:A,TypedArray:x,TypedArrayPrototype:w}},3331:function(t,e,i){"use strict";var n=i(7854),s=i(9781),o=i(4019),r=i(8880),a=i(2248),l=i(7293),c=i(5787),h=i(9958),u=i(7466),d=i(7067),f=i(1179),p=i(9518),m=i(7674),g=i(8006).f,v=i(3070).f,y=i(1285),O=i(8003),b=i(9909),x=b.get,w=b.set,_="ArrayBuffer",S="DataView",k="prototype",$="Wrong index",T=n[_],C=T,P=n[S],E=P&&P[k],A=Object.prototype,M=n.RangeError,Q=f.pack,D=f.unpack,R=function(t){return[255&t]},I=function(t){return[255&t,t>>8&255]},L=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},N=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},j=function(t){return Q(t,23,4)},z=function(t){return Q(t,52,8)},B=function(t,e){v(t[k],e,{get:function(){return x(this)[e]}})},Z=function(t,e,i,n){var s=d(i),o=x(t);if(s+e>o.byteLength)throw M($);var r=x(o.buffer).bytes,a=s+o.byteOffset,l=r.slice(a,a+e);return n?l:l.reverse()},W=function(t,e,i,n,s,o){var r=d(i),a=x(t);if(r+e>a.byteLength)throw M($);for(var l=x(a.buffer).bytes,c=r+a.byteOffset,h=n(+s),u=0;u<e;u++)l[c+u]=h[o?u:e-u-1]};if(o){if(!l(function(){T(1)})||!l(function(){new T(-1)})||l(function(){return new T,new T(1.5),new T(NaN),T.name!=_})){for(var F,X=(C=function(t){return c(this,C),new T(d(t))})[k]=T[k],q=g(T),H=0;q.length>H;)(F=q[H++])in C||r(C,F,T[F]);X.constructor=C}m&&p(E)!==A&&m(E,A);var V=new P(new C(2)),Y=E.setInt8;V.setInt8(0,2147483648),V.setInt8(1,2147483649),!V.getInt8(0)&&V.getInt8(1)||a(E,{setInt8:function(t,e){Y.call(this,t,e<<24>>24)},setUint8:function(t,e){Y.call(this,t,e<<24>>24)}},{unsafe:!0})}else C=function(t){c(this,C,_);var e=d(t);w(this,{bytes:y.call(new Array(e),0),byteLength:e}),s||(this.byteLength=e)},P=function(t,e,i){c(this,P,S),c(t,C,S);var n=x(t).byteLength,o=h(e);if(o<0||o>n)throw M("Wrong offset");if(o+(i=void 0===i?n-o:u(i))>n)throw M("Wrong length");w(this,{buffer:t,byteLength:i,byteOffset:o}),s||(this.buffer=t,this.byteLength=i,this.byteOffset=o)},s&&(B(C,"byteLength"),B(P,"buffer"),B(P,"byteLength"),B(P,"byteOffset")),a(P[k],{getInt8:function(t){return Z(this,1,t)[0]<<24>>24},getUint8:function(t){return Z(this,1,t)[0]},getInt16:function(t){var e=Z(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Z(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return N(Z(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return N(Z(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return D(Z(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return D(Z(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){W(this,1,t,R,e)},setUint8:function(t,e){W(this,1,t,R,e)},setInt16:function(t,e){W(this,2,t,I,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){W(this,2,t,I,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){W(this,4,t,L,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){W(this,4,t,L,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){W(this,4,t,j,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){W(this,8,t,z,e,arguments.length>2?arguments[2]:void 0)}});O(C,_),O(P,S),t.exports={ArrayBuffer:C,DataView:P}},1048:function(t,e,i){"use strict";var n=i(7908),s=i(1400),o=i(7466),r=Math.min;t.exports=[].copyWithin||function(t,e){var i=n(this),a=o(i.length),l=s(t,a),c=s(e,a),h=arguments.length>2?arguments[2]:void 0,u=r((void 0===h?a:s(h,a))-c,a-l),d=1;for(c<l&&l<c+u&&(d=-1,c+=u-1,l+=u-1);u-- >0;)c in i?i[l]=i[c]:delete i[l],l+=d,c+=d;return i}},1285:function(t,e,i){"use strict";var n=i(7908),s=i(1400),o=i(7466);t.exports=function(t){for(var e=n(this),i=o(e.length),r=arguments.length,a=s(r>1?arguments[1]:void 0,i),l=r>2?arguments[2]:void 0,c=void 0===l?i:s(l,i);c>a;)e[a++]=t;return e}},8533:function(t,e,i){"use strict";var n=i(2092).forEach,s=i(9341)("forEach");t.exports=s?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,e,i){"use strict";var n=i(9974),s=i(7908),o=i(3411),r=i(7659),a=i(7466),l=i(6135),c=i(1246);t.exports=function(t){var e,i,h,u,d,f,p=s(t),m="function"==typeof this?this:Array,g=arguments.length,v=g>1?arguments[1]:void 0,y=void 0!==v,O=c(p),b=0;if(y&&(v=n(v,g>2?arguments[2]:void 0,2)),null==O||m==Array&&r(O))for(i=new m(e=a(p.length));e>b;b++)f=y?v(p[b],b):p[b],l(i,b,f);else for(d=(u=O.call(p)).next,i=new m;!(h=d.call(u)).done;b++)f=y?o(u,v,[h.value,b],!0):h.value,l(i,b,f);return i.length=b,i}},1318:function(t,e,i){var n=i(5656),s=i(7466),o=i(1400),r=function(t){return function(e,i,r){var a,l=n(e),c=s(l.length),h=o(r,c);if(t&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===i)return t||h||0;return!t&&-1}};t.exports={includes:r(!0),indexOf:r(!1)}},2092:function(t,e,i){var n=i(9974),s=i(8361),o=i(7908),r=i(7466),a=i(5417),l=[].push,c=function(t){var e=1==t,i=2==t,c=3==t,h=4==t,u=6==t,d=7==t,f=5==t||u;return function(p,m,g,v){for(var y,O,b=o(p),x=s(b),w=n(m,g,3),_=r(x.length),S=0,k=v||a,$=e?k(p,_):i||d?k(p,0):void 0;_>S;S++)if((f||S in x)&&(O=w(y=x[S],S,b),t))if(e)$[S]=O;else if(O)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:l.call($,y)}else switch(t){case 4:return!1;case 7:l.call($,y)}return u?-1:c||h?h:$}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},6583:function(t,e,i){"use strict";var n=i(5656),s=i(9958),o=i(7466),r=i(9341),a=Math.min,l=[].lastIndexOf,c=!!l&&1/[1].lastIndexOf(1,-0)<0,h=r("lastIndexOf"),u=c||!h;t.exports=u?function(t){if(c)return l.apply(this,arguments)||0;var e=n(this),i=o(e.length),r=i-1;for(arguments.length>1&&(r=a(r,s(arguments[1]))),r<0&&(r=i+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}:l},1194:function(t,e,i){var n=i(7293),s=i(5112),o=i(7392),r=s("species");t.exports=function(t){return o>=51||!n(function(){var e=[];return(e.constructor={})[r]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},9341:function(t,e,i){"use strict";var n=i(7293);t.exports=function(t,e){var i=[][t];return!!i&&n(function(){i.call(null,e||function(){throw 1},1)})}},3671:function(t,e,i){var n=i(3099),s=i(7908),o=i(8361),r=i(7466),a=function(t){return function(e,i,a,l){n(i);var c=s(e),h=o(c),u=r(c.length),d=t?u-1:0,f=t?-1:1;if(a<2)for(;;){if(d in h){l=h[d],d+=f;break}if(d+=f,t?d<0:u<=d)throw TypeError("Reduce of empty array with no initial value")}for(;t?d>=0:u>d;d+=f)d in h&&(l=i(l,h[d],d,c));return l}};t.exports={left:a(!1),right:a(!0)}},5417:function(t,e,i){var n=i(111),s=i(3157),o=i(5112)("species");t.exports=function(t,e){var i;return s(t)&&("function"!=typeof(i=t.constructor)||i!==Array&&!s(i.prototype)?n(i)&&null===(i=i[o])&&(i=void 0):i=void 0),new(void 0===i?Array:i)(0===e?0:e)}},3411:function(t,e,i){var n=i(9670),s=i(9212);t.exports=function(t,e,i,o){try{return o?e(n(i)[0],i[1]):e(i)}catch(e){throw s(t),e}}},7072:function(t,e,i){var n=i(5112)("iterator"),s=!1;try{var o=0,r={next:function(){return{done:!!o++}},return:function(){s=!0}};r[n]=function(){return this},Array.from(r,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!s)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},t(o)}catch(t){}return i}},4326:function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},648:function(t,e,i){var n=i(1694),s=i(4326),o=i(5112)("toStringTag"),r="Arguments"==s(function(){return arguments}());t.exports=n?s:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?i:r?s(e):"Object"==(n=s(e))&&"function"==typeof e.callee?"Arguments":n}},9920:function(t,e,i){var n=i(6656),s=i(3887),o=i(1236),r=i(3070);t.exports=function(t,e){for(var i=s(e),a=r.f,l=o.f,c=0;c<i.length;c++){var h=i[c];n(t,h)||a(t,h,l(e,h))}}},8544:function(t,e,i){var n=i(7293);t.exports=!n(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},4994:function(t,e,i){"use strict";var n=i(3383).IteratorPrototype,s=i(30),o=i(9114),r=i(8003),a=i(7497),l=function(){return this};t.exports=function(t,e,i){var c=e+" Iterator";return t.prototype=s(n,{next:o(1,i)}),r(t,c,!1,!0),a[c]=l,t}},8880:function(t,e,i){var n=i(9781),s=i(3070),o=i(9114);t.exports=n?function(t,e,i){return s.f(t,e,o(1,i))}:function(t,e,i){return t[e]=i,t}},9114:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:function(t,e,i){"use strict";var n=i(7593),s=i(3070),o=i(9114);t.exports=function(t,e,i){var r=n(e);r in t?s.f(t,r,o(0,i)):t[r]=i}},654:function(t,e,i){"use strict";var n=i(2109),s=i(4994),o=i(9518),r=i(7674),a=i(8003),l=i(8880),c=i(1320),h=i(5112),u=i(1913),d=i(7497),f=i(3383),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,g=h("iterator"),v="keys",y="values",O="entries",b=function(){return this};t.exports=function(t,e,i,h,f,x,w){s(i,e,h);var _,S,k,$=function(t){if(t===f&&A)return A;if(!m&&t in P)return P[t];switch(t){case v:case y:case O:return function(){return new i(this,t)}}return function(){return new i(this)}},T=e+" Iterator",C=!1,P=t.prototype,E=P[g]||P["@@iterator"]||f&&P[f],A=!m&&E||$(f),M="Array"==e&&P.entries||E;if(M&&(_=o(M.call(new t)),p!==Object.prototype&&_.next&&(u||o(_)===p||(r?r(_,p):"function"!=typeof _[g]&&l(_,g,b)),a(_,T,!0,!0),u&&(d[T]=b))),f==y&&E&&E.name!==y&&(C=!0,A=function(){return E.call(this)}),u&&!w||P[g]===A||l(P,g,A),d[e]=A,f)if(S={values:$(y),keys:x?A:$(v),entries:$(O)},w)for(k in S)(m||C||!(k in P))&&c(P,k,S[k]);else n({target:e,proto:!0,forced:m||C},S);return S}},9781:function(t,e,i){var n=i(7293);t.exports=!n(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},317:function(t,e,i){var n=i(7854),s=i(111),o=n.document,r=s(o)&&s(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8113:function(t,e,i){var n=i(5005);t.exports=n("navigator","userAgent")||""},7392:function(t,e,i){var n,s,o=i(7854),r=i(8113),a=o.process,l=a&&a.versions,c=l&&l.v8;c?s=(n=c.split("."))[0]+n[1]:r&&(!(n=r.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=r.match(/Chrome\/(\d+)/))&&(s=n[1]),t.exports=s&&+s},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,i){var n=i(7854),s=i(1236).f,o=i(8880),r=i(1320),a=i(3505),l=i(9920),c=i(4705);t.exports=function(t,e){var i,h,u,d,f,p=t.target,m=t.global,g=t.stat;if(i=m?n:g?n[p]||a(p,{}):(n[p]||{}).prototype)for(h in e){if(d=e[h],u=t.noTargetGet?(f=s(i,h))&&f.value:i[h],!c(m?h:p+(g?".":"#")+h,t.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(t.sham||u&&u.sham)&&o(d,"sham",!0),r(i,h,d,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,e,i){"use strict";i(4916);var n=i(1320),s=i(7293),o=i(5112),r=i(2261),a=i(8880),l=o("species"),c=!s(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),h="$0"==="a".replace(/./,"$0"),u=o("replace"),d=!!/./[u]&&""===/./[u]("a","$0"),f=!s(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2!==i.length||"a"!==i[0]||"b"!==i[1]});t.exports=function(t,e,i,u){var p=o(t),m=!s(function(){var e={};return e[p]=function(){return 7},7!=""[t](e)}),g=m&&!s(function(){var e=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[l]=function(){return i},i.flags="",i[p]=/./[p]),i.exec=function(){return e=!0,null},i[p](""),!e});if(!m||!g||"replace"===t&&(!c||!h||d)||"split"===t&&!f){var v=/./[p],y=i(p,""[t],function(t,e,i,n,s){return e.exec===r?m&&!s?{done:!0,value:v.call(e,i,n)}:{done:!0,value:t.call(i,e,n)}:{done:!1}},{REPLACE_KEEPS_$0:h,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),O=y[0],b=y[1];n(String.prototype,t,O),n(RegExp.prototype,p,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)})}u&&a(RegExp.prototype[p],"sham",!0)}},9974:function(t,e,i){var n=i(3099);t.exports=function(t,e,i){if(n(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,s){return t.call(e,i,n,s)}}return function(){return t.apply(e,arguments)}}},5005:function(t,e,i){var n=i(857),s=i(7854),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(n[t])||o(s[t]):n[t]&&n[t][e]||s[t]&&s[t][e]}},1246:function(t,e,i){var n=i(648),s=i(7497),o=i(5112)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||s[n(t)]}},8554:function(t,e,i){var n=i(9670),s=i(1246);t.exports=function(t){var e=s(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return n(e.call(t))}},647:function(t,e,i){var n=i(7908),s=Math.floor,o="".replace,r=/\$([$&'`]|\d\d?|<[^>]*>)/g,a=/\$([$&'`]|\d\d?)/g;t.exports=function(t,e,i,l,c,h){var u=i+t.length,d=l.length,f=a;return void 0!==c&&(c=n(c),f=r),o.call(h,f,function(n,o){var r;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,i);case"'":return e.slice(u);case"<":r=c[o.slice(1,-1)];break;default:var a=+o;if(0===a)return n;if(a>d){var h=s(a/10);return 0===h?n:h<=d?void 0===l[h-1]?o.charAt(1):l[h-1]+o.charAt(1):n}r=l[a-1]}return void 0===r?"":r})}},7854:function(t,e,i){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},6656:function(t){var e={}.hasOwnProperty;t.exports=function(t,i){return e.call(t,i)}},3501:function(t){t.exports={}},490:function(t,e,i){var n=i(5005);t.exports=n("document","documentElement")},4664:function(t,e,i){var n=i(9781),s=i(7293),o=i(317);t.exports=!n&&!s(function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},1179:function(t){var e=Math.abs,i=Math.pow,n=Math.floor,s=Math.log,o=Math.LN2;t.exports={pack:function(t,r,a){var l,c,h,u=new Array(a),d=8*a-r-1,f=(1<<d)-1,p=f>>1,m=23===r?i(2,-24)-i(2,-77):0,g=t<0||0===t&&1/t<0?1:0,v=0;for((t=e(t))!=t||t===1/0?(c=t!=t?1:0,l=f):(l=n(s(t)/o),t*(h=i(2,-l))<1&&(l--,h*=2),(t+=l+p>=1?m/h:m*i(2,1-p))*h>=2&&(l++,h/=2),l+p>=f?(c=0,l=f):l+p>=1?(c=(t*h-1)*i(2,r),l+=p):(c=t*i(2,p-1)*i(2,r),l=0));r>=8;u[v++]=255&c,c/=256,r-=8);for(l=l<<r|c,d+=r;d>0;u[v++]=255&l,l/=256,d-=8);return u[--v]|=128*g,u},unpack:function(t,e){var n,s=t.length,o=8*s-e-1,r=(1<<o)-1,a=r>>1,l=o-7,c=s-1,h=t[c--],u=127&h;for(h>>=7;l>0;u=256*u+t[c],c--,l-=8);for(n=u&(1<<-l)-1,u>>=-l,l+=e;l>0;n=256*n+t[c],c--,l-=8);if(0===u)u=1-a;else{if(u===r)return n?NaN:h?-1/0:1/0;n+=i(2,e),u-=a}return(h?-1:1)*n*i(2,u-e)}}},8361:function(t,e,i){var n=i(7293),s=i(4326),o="".split;t.exports=n(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==s(t)?o.call(t,""):Object(t)}:Object},9587:function(t,e,i){var n=i(111),s=i(7674);t.exports=function(t,e,i){var o,r;return s&&"function"==typeof(o=e.constructor)&&o!==i&&n(r=o.prototype)&&r!==i.prototype&&s(t,r),t}},2788:function(t,e,i){var n=i(5465),s=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return s.call(t)}),t.exports=n.inspectSource},9909:function(t,e,i){var n,s,o,r=i(8536),a=i(7854),l=i(111),c=i(8880),h=i(6656),u=i(5465),d=i(6200),f=i(3501),p=a.WeakMap;if(r){var m=u.state||(u.state=new p),g=m.get,v=m.has,y=m.set;n=function(t,e){return e.facade=t,y.call(m,t,e),e},s=function(t){return g.call(m,t)||{}},o=function(t){return v.call(m,t)}}else{var O=d("state");f[O]=!0,n=function(t,e){return e.facade=t,c(t,O,e),e},s=function(t){return h(t,O)?t[O]:{}},o=function(t){return h(t,O)}}t.exports={set:n,get:s,has:o,enforce:function(t){return o(t)?s(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=s(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}}},7659:function(t,e,i){var n=i(5112),s=i(7497),o=n("iterator"),r=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||r[o]===t)}},3157:function(t,e,i){var n=i(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},4705:function(t,e,i){var n=i(7293),s=/#|\.prototype\./,o=function(t,e){var i=a[r(t)];return i==c||i!=l&&("function"==typeof e?n(e):!!e)},r=o.normalize=function(t){return String(t).replace(s,".").toLowerCase()},a=o.data={},l=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},111:function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},1913:function(t){t.exports=!1},7850:function(t,e,i){var n=i(111),s=i(4326),o=i(5112)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==s(t))}},9212:function(t,e,i){var n=i(9670);t.exports=function(t){var e=t.return;if(void 0!==e)return n(e.call(t)).value}},3383:function(t,e,i){"use strict";var n,s,o,r=i(7293),a=i(9518),l=i(8880),c=i(6656),h=i(5112),u=i(1913),d=h("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(s=a(a(o)))!==Object.prototype&&(n=s):f=!0);var p=null==n||r(function(){var t={};return n[d].call(t)!==t});p&&(n={}),u&&!p||c(n,d)||l(n,d,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:f}},7497:function(t){t.exports={}},133:function(t,e,i){var n=i(7293);t.exports=!!Object.getOwnPropertySymbols&&!n(function(){return!String(Symbol())})},590:function(t,e,i){var n=i(7293),s=i(5112),o=i(1913),r=s("iterator");t.exports=!n(function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,i="";return t.pathname="c%20d",e.forEach(function(t,n){e.delete("b"),i+=n+t}),o&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[r]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host})},8536:function(t,e,i){var n=i(7854),s=i(2788),o=n.WeakMap;t.exports="function"==typeof o&&/native code/.test(s(o))},1574:function(t,e,i){"use strict";var n=i(9781),s=i(7293),o=i(1956),r=i(5181),a=i(5296),l=i(7908),c=i(8361),h=Object.assign,u=Object.defineProperty;t.exports=!h||s(function(){if(n&&1!==h({b:1},h(u({},"a",{enumerable:!0,get:function(){u(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),s="abcdefghijklmnopqrst";return t[i]=7,s.split("").forEach(function(t){e[t]=t}),7!=h({},t)[i]||o(h({},e)).join("")!=s})?function(t,e){for(var i=l(t),s=arguments.length,h=1,u=r.f,d=a.f;s>h;)for(var f,p=c(arguments[h++]),m=u?o(p).concat(u(p)):o(p),g=m.length,v=0;g>v;)f=m[v++],n&&!d.call(p,f)||(i[f]=p[f]);return i}:h},30:function(t,e,i){var n,s=i(9670),o=i(6048),r=i(748),a=i(3501),l=i(490),c=i(317),h=i(6200),u="prototype",d="script",f=h("IE_PROTO"),p=function(){},m=function(t){return"<"+d+">"+t+"</"+d+">"},g=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e,i;g=n?function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e}(n):(e=c("iframe"),i="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(m("document.F=Object")),t.close(),t.F);for(var s=r.length;s--;)delete g[u][r[s]];return g()};a[f]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(p[u]=s(t),i=new p,p[u]=null,i[f]=t):i=g(),void 0===e?i:o(i,e)}},6048:function(t,e,i){var n=i(9781),s=i(3070),o=i(9670),r=i(1956);t.exports=n?Object.defineProperties:function(t,e){o(t);for(var i,n=r(e),a=n.length,l=0;a>l;)s.f(t,i=n[l++],e[i]);return t}},3070:function(t,e,i){var n=i(9781),s=i(4664),o=i(9670),r=i(7593),a=Object.defineProperty;e.f=n?a:function(t,e,i){if(o(t),e=r(e,!0),o(i),s)try{return a(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},1236:function(t,e,i){var n=i(9781),s=i(5296),o=i(9114),r=i(5656),a=i(7593),l=i(6656),c=i(4664),h=Object.getOwnPropertyDescriptor;e.f=n?h:function(t,e){if(t=r(t),e=a(e,!0),c)try{return h(t,e)}catch(t){}if(l(t,e))return o(!s.f.call(t,e),t[e])}},8006:function(t,e,i){var n=i(6324),s=i(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,s)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},9518:function(t,e,i){var n=i(6656),s=i(7908),o=i(6200),r=i(8544),a=o("IE_PROTO"),l=Object.prototype;t.exports=r?Object.getPrototypeOf:function(t){return t=s(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?l:null}},6324:function(t,e,i){var n=i(6656),s=i(5656),o=i(1318).indexOf,r=i(3501);t.exports=function(t,e){var i,a=s(t),l=0,c=[];for(i in a)!n(r,i)&&n(a,i)&&c.push(i);for(;e.length>l;)n(a,i=e[l++])&&(~o(c,i)||c.push(i));return c}},1956:function(t,e,i){var n=i(6324),s=i(748);t.exports=Object.keys||function(t){return n(t,s)}},5296:function(t,e){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!i.call({1:2},1);e.f=s?function(t){var e=n(this,t);return!!e&&e.enumerable}:i},7674:function(t,e,i){var n=i(9670),s=i(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(i,[]),e=i instanceof Array}catch(t){}return function(i,o){return n(i),s(o),e?t.call(i,o):i.__proto__=o,i}}():void 0)},288:function(t,e,i){"use strict";var n=i(1694),s=i(648);t.exports=n?{}.toString:function(){return"[object "+s(this)+"]"}},3887:function(t,e,i){var n=i(5005),s=i(8006),o=i(5181),r=i(9670);t.exports=n("Reflect","ownKeys")||function(t){var e=s.f(r(t)),i=o.f;return i?e.concat(i(t)):e}},857:function(t,e,i){var n=i(7854);t.exports=n},2248:function(t,e,i){var n=i(1320);t.exports=function(t,e,i){for(var s in e)n(t,s,e[s],i);return t}},1320:function(t,e,i){var n=i(7854),s=i(8880),o=i(6656),r=i(3505),a=i(2788),l=i(9909),c=l.get,h=l.enforce,u=String(String).split("String");(t.exports=function(t,e,i,a){var l,c=!!a&&!!a.unsafe,d=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof e||o(i,"name")||s(i,"name",e),(l=h(i)).source||(l.source=u.join("string"==typeof e?e:""))),t!==n?(c?!f&&t[e]&&(d=!0):delete t[e],d?t[e]=i:s(t,e,i)):d?t[e]=i:r(e,i)})(Function.prototype,"toString",function(){return"function"==typeof this&&c(this).source||a(this)})},7651:function(t,e,i){var n=i(4326),s=i(2261);t.exports=function(t,e){var i=t.exec;if("function"==typeof i){var o=i.call(t,e);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==n(t))throw TypeError("RegExp#exec called on incompatible receiver");return s.call(t,e)}},2261:function(t,e,i){"use strict";var n,s,o=i(7066),r=i(2999),a=RegExp.prototype.exec,l=String.prototype.replace,c=a,h=(n=/a/,s=/b*/g,a.call(n,"a"),a.call(s,"a"),0!==n.lastIndex||0!==s.lastIndex),u=r.UNSUPPORTED_Y||r.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(h||d||u)&&(c=function(t){var e,i,n,s,r=this,c=u&&r.sticky,f=o.call(r),p=r.source,m=0,g=t;return c&&(-1===(f=f.replace("y","")).indexOf("g")&&(f+="g"),g=String(t).slice(r.lastIndex),r.lastIndex>0&&(!r.multiline||r.multiline&&"\n"!==t[r.lastIndex-1])&&(p="(?: "+p+")",g=" "+g,m++),i=new RegExp("^(?:"+p+")",f)),d&&(i=new RegExp("^"+p+"$(?!\\s)",f)),h&&(e=r.lastIndex),n=a.call(c?i:r,g),c?n?(n.input=n.input.slice(m),n[0]=n[0].slice(m),n.index=r.lastIndex,r.lastIndex+=n[0].length):r.lastIndex=0:h&&n&&(r.lastIndex=r.global?n.index+n[0].length:e),d&&n&&n.length>1&&l.call(n[0],i,function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(n[s]=void 0)}),n}),t.exports=c},7066:function(t,e,i){"use strict";var n=i(9670);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},2999:function(t,e,i){"use strict";var n=i(7293);function s(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=n(function(){var t=s("a","y");return t.lastIndex=2,null!=t.exec("abcd")}),e.BROKEN_CARET=n(function(){var t=s("^r","gy");return t.lastIndex=2,null!=t.exec("str")})},4488:function(t){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},3505:function(t,e,i){var n=i(7854),s=i(8880);t.exports=function(t,e){try{s(n,t,e)}catch(i){n[t]=e}return e}},6340:function(t,e,i){"use strict";var n=i(5005),s=i(3070),o=i(5112),r=i(9781),a=o("species");t.exports=function(t){var e=n(t),i=s.f;r&&e&&!e[a]&&i(e,a,{configurable:!0,get:function(){return this}})}},8003:function(t,e,i){var n=i(3070).f,s=i(6656),o=i(5112)("toStringTag");t.exports=function(t,e,i){t&&!s(t=i?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},6200:function(t,e,i){var n=i(2309),s=i(9711),o=n("keys");t.exports=function(t){return o[t]||(o[t]=s(t))}},5465:function(t,e,i){var n=i(7854),s=i(3505),o="__core-js_shared__",r=n[o]||s(o,{});t.exports=r},2309:function(t,e,i){var n=i(1913),s=i(5465);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.9.0",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:function(t,e,i){var n=i(9670),s=i(3099),o=i(5112)("species");t.exports=function(t,e){var i,r=n(t).constructor;return void 0===r||null==(i=n(r)[o])?e:s(i)}},8710:function(t,e,i){var n=i(9958),s=i(4488),o=function(t){return function(e,i){var o,r,a=String(s(e)),l=n(i),c=a.length;return l<0||l>=c?t?"":void 0:(o=a.charCodeAt(l))<55296||o>56319||l+1===c||(r=a.charCodeAt(l+1))<56320||r>57343?t?a.charAt(l):o:t?a.slice(l,l+2):r-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},3197:function(t){"use strict";var e=2147483647,i=/[^\0-\u007E]/,n=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",o=Math.floor,r=String.fromCharCode,a=function(t){return t+22+75*(t<26)},l=function(t,e,i){var n=0;for(t=i?o(t/700):t>>1,t+=o(t/e);t>455;n+=36)t=o(t/35);return o(n+36*t/(t+38))},c=function(t){var i=[];t=function(t){for(var e=[],i=0,n=t.length;i<n;){var s=t.charCodeAt(i++);if(s>=55296&&s<=56319&&i<n){var o=t.charCodeAt(i++);56320==(64512&o)?e.push(((1023&s)<<10)+(1023&o)+65536):(e.push(s),i--)}else e.push(s)}return e}(t);var n,c,h=t.length,u=128,d=0,f=72;for(n=0;n<t.length;n++)(c=t[n])<128&&i.push(r(c));var p=i.length,m=p;for(p&&i.push("-");m<h;){var g=e;for(n=0;n<t.length;n++)(c=t[n])>=u&&c<g&&(g=c);var v=m+1;if(g-u>o((e-d)/v))throw RangeError(s);for(d+=(g-u)*v,u=g,n=0;n<t.length;n++){if((c=t[n])<u&&++d>e)throw RangeError(s);if(c==u){for(var y=d,O=36;;O+=36){var b=O<=f?1:O>=f+26?26:O-f;if(y<b)break;var x=y-b,w=36-b;i.push(r(a(b+x%w))),y=o(x/w)}i.push(r(a(y))),f=l(d,v,m==p),d=0,++m}}++d,++u}return i.join("")};t.exports=function(t){var e,s,o=[],r=t.toLowerCase().replace(n,".").split(".");for(e=0;e<r.length;e++)s=r[e],o.push(i.test(s)?"xn--"+c(s):s);return o.join(".")}},6091:function(t,e,i){var n=i(7293),s=i(1361);t.exports=function(t){return n(function(){return!!s[t]()||"​…᠎"!="​…᠎"[t]()||s[t].name!==t})}},3111:function(t,e,i){var n=i(4488),s="["+i(1361)+"]",o=RegExp("^"+s+s+"*"),r=RegExp(s+s+"*$"),a=function(t){return function(e){var i=String(n(e));return 1&t&&(i=i.replace(o,"")),2&t&&(i=i.replace(r,"")),i}};t.exports={start:a(1),end:a(2),trim:a(3)}},1400:function(t,e,i){var n=i(9958),s=Math.max,o=Math.min;t.exports=function(t,e){var i=n(t);return i<0?s(i+e,0):o(i,e)}},7067:function(t,e,i){var n=i(9958),s=i(7466);t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=s(e);if(e!==i)throw RangeError("Wrong length or index");return i}},5656:function(t,e,i){var n=i(8361),s=i(4488);t.exports=function(t){return n(s(t))}},9958:function(t){var e=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:e)(t)}},7466:function(t,e,i){var n=i(9958),s=Math.min;t.exports=function(t){return t>0?s(n(t),9007199254740991):0}},7908:function(t,e,i){var n=i(4488);t.exports=function(t){return Object(n(t))}},4590:function(t,e,i){var n=i(3002);t.exports=function(t,e){var i=n(t);if(i%e)throw RangeError("Wrong offset");return i}},3002:function(t,e,i){var n=i(9958);t.exports=function(t){var e=n(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}},7593:function(t,e,i){var n=i(111);t.exports=function(t,e){if(!n(t))return t;var i,s;if(e&&"function"==typeof(i=t.toString)&&!n(s=i.call(t)))return s;if("function"==typeof(i=t.valueOf)&&!n(s=i.call(t)))return s;if(!e&&"function"==typeof(i=t.toString)&&!n(s=i.call(t)))return s;throw TypeError("Can't convert object to primitive value")}},1694:function(t,e,i){var n={};n[i(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},9843:function(t,e,i){"use strict";var n=i(2109),s=i(7854),o=i(9781),r=i(3832),a=i(260),l=i(3331),c=i(5787),h=i(9114),u=i(8880),d=i(7466),f=i(7067),p=i(4590),m=i(7593),g=i(6656),v=i(648),y=i(111),O=i(30),b=i(7674),x=i(8006).f,w=i(7321),_=i(2092).forEach,S=i(6340),k=i(3070),$=i(1236),T=i(9909),C=i(9587),P=T.get,E=T.set,A=k.f,M=$.f,Q=Math.round,D=s.RangeError,R=l.ArrayBuffer,I=l.DataView,L=a.NATIVE_ARRAY_BUFFER_VIEWS,N=a.TYPED_ARRAY_TAG,j=a.TypedArray,z=a.TypedArrayPrototype,B=a.aTypedArrayConstructor,Z=a.isTypedArray,W="BYTES_PER_ELEMENT",F="Wrong length",X=function(t,e){for(var i=0,n=e.length,s=new(B(t))(n);n>i;)s[i]=e[i++];return s},q=function(t,e){A(t,e,{get:function(){return P(this)[e]}})},H=function(t){var e;return t instanceof R||"ArrayBuffer"==(e=v(t))||"SharedArrayBuffer"==e},V=function(t,e){return Z(t)&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Y=function(t,e){return V(t,e=m(e,!0))?h(2,t[e]):M(t,e)},U=function(t,e,i){return!(V(t,e=m(e,!0))&&y(i)&&g(i,"value"))||g(i,"get")||g(i,"set")||i.configurable||g(i,"writable")&&!i.writable||g(i,"enumerable")&&!i.enumerable?A(t,e,i):(t[e]=i.value,t)};o?(L||($.f=Y,k.f=U,q(z,"buffer"),q(z,"byteOffset"),q(z,"byteLength"),q(z,"length")),n({target:"Object",stat:!0,forced:!L},{getOwnPropertyDescriptor:Y,defineProperty:U}),t.exports=function(t,e,i){var o=t.match(/\d+$/)[0]/8,a=t+(i?"Clamped":"")+"Array",l="get"+t,h="set"+t,m=s[a],g=m,v=g&&g.prototype,k={},$=function(t,e){A(t,e,{get:function(){return function(t,e){var i=P(t);return i.view[l](e*o+i.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,n){var s=P(t);i&&(n=(n=Q(n))<0?0:n>255?255:255&n),s.view[h](e*o+s.byteOffset,n,!0)}(this,e,t)},enumerable:!0})};L?r&&(g=e(function(t,e,i,n){return c(t,g,a),C(y(e)?H(e)?void 0!==n?new m(e,p(i,o),n):void 0!==i?new m(e,p(i,o)):new m(e):Z(e)?X(g,e):w.call(g,e):new m(f(e)),t,g)}),b&&b(g,j),_(x(m),function(t){t in g||u(g,t,m[t])}),g.prototype=v):(g=e(function(t,e,i,n){c(t,g,a);var s,r,l,h=0,u=0;if(y(e)){if(!H(e))return Z(e)?X(g,e):w.call(g,e);s=e,u=p(i,o);var m=e.byteLength;if(void 0===n){if(m%o)throw D(F);if((r=m-u)<0)throw D(F)}else if((r=d(n)*o)+u>m)throw D(F);l=r/o}else l=f(e),s=new R(r=l*o);for(E(t,{buffer:s,byteOffset:u,byteLength:r,length:l,view:new I(s)});h<l;)$(t,h++)}),b&&b(g,j),v=g.prototype=O(z)),v.constructor!==g&&u(v,"constructor",g),N&&u(v,N,a),k[a]=g,n({global:!0,forced:g!=m,sham:!L},k),W in g||u(g,W,o),W in v||u(v,W,o),S(a)}):t.exports=function(){}},3832:function(t,e,i){var n=i(7854),s=i(7293),o=i(7072),r=i(260).NATIVE_ARRAY_BUFFER_VIEWS,a=n.ArrayBuffer,l=n.Int8Array;t.exports=!r||!s(function(){l(1)})||!s(function(){new l(-1)})||!o(function(t){new l,new l(null),new l(1.5),new l(t)},!0)||s(function(){return 1!==new l(new a(2),1,void 0).length})},3074:function(t,e,i){var n=i(260).aTypedArrayConstructor,s=i(6707);t.exports=function(t,e){for(var i=s(t,t.constructor),o=0,r=e.length,a=new(n(i))(r);r>o;)a[o]=e[o++];return a}},7321:function(t,e,i){var n=i(7908),s=i(7466),o=i(1246),r=i(7659),a=i(9974),l=i(260).aTypedArrayConstructor;t.exports=function(t){var e,i,c,h,u,d,f=n(t),p=arguments.length,m=p>1?arguments[1]:void 0,g=void 0!==m,v=o(f);if(null!=v&&!r(v))for(d=(u=v.call(f)).next,f=[];!(h=d.call(u)).done;)f.push(h.value);for(g&&p>2&&(m=a(m,arguments[2],2)),i=s(f.length),c=new(l(this))(i),e=0;i>e;e++)c[e]=g?m(f[e],e):f[e];return c}},9711:function(t){var e=0,i=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+i).toString(36)}},3307:function(t,e,i){var n=i(133);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5112:function(t,e,i){var n=i(7854),s=i(2309),o=i(6656),r=i(9711),a=i(133),l=i(3307),c=s("wks"),h=n.Symbol,u=l?h:h&&h.withoutSetter||r;t.exports=function(t){return o(c,t)||(a&&o(h,t)?c[t]=h[t]:c[t]=u("Symbol."+t)),c[t]}},1361:function(t){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},8264:function(t,e,i){"use strict";var n=i(2109),s=i(7854),o=i(3331),r=i(6340),a="ArrayBuffer",l=o[a];n({global:!0,forced:s[a]!==l},{ArrayBuffer:l}),r(a)},2222:function(t,e,i){"use strict";var n=i(2109),s=i(7293),o=i(3157),r=i(111),a=i(7908),l=i(7466),c=i(6135),h=i(5417),u=i(1194),d=i(5112),f=i(7392),p=d("isConcatSpreadable"),m=9007199254740991,g="Maximum allowed index exceeded",v=f>=51||!s(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),y=u("concat"),O=function(t){if(!r(t))return!1;var e=t[p];return void 0!==e?!!e:o(t)};n({target:"Array",proto:!0,forced:!v||!y},{concat:function(t){var e,i,n,s,o,r=a(this),u=h(r,0),d=0;for(e=-1,n=arguments.length;e<n;e++)if(O(o=-1===e?r:arguments[e])){if(d+(s=l(o.length))>m)throw TypeError(g);for(i=0;i<s;i++,d++)i in o&&c(u,d,o[i])}else{if(d>=m)throw TypeError(g);c(u,d++,o)}return u.length=d,u}})},7327:function(t,e,i){"use strict";var n=i(2109),s=i(2092).filter;n({target:"Array",proto:!0,forced:!i(1194)("filter")},{filter:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}})},2772:function(t,e,i){"use strict";var n=i(2109),s=i(1318).indexOf,o=i(9341),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0,l=o("indexOf");n({target:"Array",proto:!0,forced:a||!l},{indexOf:function(t){return a?r.apply(this,arguments)||0:s(this,t,arguments.length>1?arguments[1]:void 0)}})},6992:function(t,e,i){"use strict";var n=i(5656),s=i(1223),o=i(7497),r=i(9909),a=i(654),l="Array Iterator",c=r.set,h=r.getterFor(l);t.exports=a(Array,"Array",function(t,e){c(this,{type:l,target:n(t),index:0,kind:e})},function(){var t=h(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}},"values"),o.Arguments=o.Array,s("keys"),s("values"),s("entries")},1249:function(t,e,i){"use strict";var n=i(2109),s=i(2092).map;n({target:"Array",proto:!0,forced:!i(1194)("map")},{map:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}})},7042:function(t,e,i){"use strict";var n=i(2109),s=i(111),o=i(3157),r=i(1400),a=i(7466),l=i(5656),c=i(6135),h=i(5112),u=i(1194)("slice"),d=h("species"),f=[].slice,p=Math.max;n({target:"Array",proto:!0,forced:!u},{slice:function(t,e){var i,n,h,u=l(this),m=a(u.length),g=r(t,m),v=r(void 0===e?m:e,m);if(o(u)&&("function"!=typeof(i=u.constructor)||i!==Array&&!o(i.prototype)?s(i)&&null===(i=i[d])&&(i=void 0):i=void 0,i===Array||void 0===i))return f.call(u,g,v);for(n=new(void 0===i?Array:i)(p(v-g,0)),h=0;g<v;g++,h++)g in u&&c(n,h,u[g]);return n.length=h,n}})},561:function(t,e,i){"use strict";var n=i(2109),s=i(1400),o=i(9958),r=i(7466),a=i(7908),l=i(5417),c=i(6135),h=i(1194)("splice"),u=Math.max,d=Math.min;n({target:"Array",proto:!0,forced:!h},{splice:function(t,e){var i,n,h,f,p,m,g=a(this),v=r(g.length),y=s(t,v),O=arguments.length;if(0===O?i=n=0:1===O?(i=0,n=v-y):(i=O-2,n=d(u(o(e),0),v-y)),v+i-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(h=l(g,n),f=0;f<n;f++)(p=y+f)in g&&c(h,f,g[p]);if(h.length=n,i<n){for(f=y;f<v-n;f++)m=f+i,(p=f+n)in g?g[m]=g[p]:delete g[m];for(f=v;f>v-n+i;f--)delete g[f-1]}else if(i>n)for(f=v-n;f>y;f--)m=f+i-1,(p=f+n-1)in g?g[m]=g[p]:delete g[m];for(f=0;f<i;f++)g[f+y]=arguments[f+2];return g.length=v-n+i,h}})},8309:function(t,e,i){var n=i(9781),s=i(3070).f,o=Function.prototype,r=o.toString,a=/^\s*function ([^ (]*)/,l="name";n&&!(l in o)&&s(o,l,{configurable:!0,get:function(){try{return r.call(this).match(a)[1]}catch(t){return""}}})},489:function(t,e,i){var n=i(2109),s=i(7293),o=i(7908),r=i(9518),a=i(8544);n({target:"Object",stat:!0,forced:s(function(){r(1)}),sham:!a},{getPrototypeOf:function(t){return r(o(t))}})},1539:function(t,e,i){var n=i(1694),s=i(1320),o=i(288);n||s(Object.prototype,"toString",o,{unsafe:!0})},4916:function(t,e,i){"use strict";var n=i(2109),s=i(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==s},{exec:s})},9714:function(t,e,i){"use strict";var n=i(1320),s=i(9670),o=i(7293),r=i(7066),a="toString",l=RegExp.prototype,c=l[a],h=o(function(){return"/a/b"!=c.call({source:"a",flags:"b"})}),u=c.name!=a;(h||u)&&n(RegExp.prototype,a,function(){var t=s(this),e=String(t.source),i=t.flags;return"/"+e+"/"+String(void 0===i&&t instanceof RegExp&&!("flags"in l)?r.call(t):i)},{unsafe:!0})},8783:function(t,e,i){"use strict";var n=i(8710).charAt,s=i(9909),o=i(654),r="String Iterator",a=s.set,l=s.getterFor(r);o(String,"String",function(t){a(this,{type:r,string:String(t),index:0})},function(){var t,e=l(this),i=e.string,s=e.index;return s>=i.length?{value:void 0,done:!0}:(t=n(i,s),e.index+=t.length,{value:t,done:!1})})},4723:function(t,e,i){"use strict";var n=i(7007),s=i(9670),o=i(7466),r=i(4488),a=i(1530),l=i(7651);n("match",1,function(t,e,i){return[function(e){var i=r(this),n=null==e?void 0:e[t];return void 0!==n?n.call(e,i):new RegExp(e)[t](String(i))},function(t){var n=i(e,t,this);if(n.done)return n.value;var r=s(t),c=String(this);if(!r.global)return l(r,c);var h=r.unicode;r.lastIndex=0;for(var u,d=[],f=0;null!==(u=l(r,c));){var p=String(u[0]);d[f]=p,""===p&&(r.lastIndex=a(c,o(r.lastIndex),h)),f++}return 0===f?null:d}]})},5306:function(t,e,i){"use strict";var n=i(7007),s=i(9670),o=i(7466),r=i(9958),a=i(4488),l=i(1530),c=i(647),h=i(7651),u=Math.max,d=Math.min,f=function(t){return void 0===t?t:String(t)};n("replace",2,function(t,e,i,n){var p=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,m=n.REPLACE_KEEPS_$0,g=p?"$":"$0";return[function(i,n){var s=a(this),o=null==i?void 0:i[t];return void 0!==o?o.call(i,s,n):e.call(String(s),i,n)},function(t,n){if(!p&&m||"string"==typeof n&&-1===n.indexOf(g)){var a=i(e,t,this,n);if(a.done)return a.value}var v=s(t),y=String(this),O="function"==typeof n;O||(n=String(n));var b=v.global;if(b){var x=v.unicode;v.lastIndex=0}for(var w=[];;){var _=h(v,y);if(null===_)break;if(w.push(_),!b)break;""===String(_[0])&&(v.lastIndex=l(y,o(v.lastIndex),x))}for(var S="",k=0,$=0;$<w.length;$++){_=w[$];for(var T=String(_[0]),C=u(d(r(_.index),y.length),0),P=[],E=1;E<_.length;E++)P.push(f(_[E]));var A=_.groups;if(O){var M=[T].concat(P,C,y);void 0!==A&&M.push(A);var Q=String(n.apply(void 0,M))}else Q=c(T,y,C,P,A,n);C>=k&&(S+=y.slice(k,C)+Q,k=C+T.length)}return S+y.slice(k)}]})},3123:function(t,e,i){"use strict";var n=i(7007),s=i(7850),o=i(9670),r=i(4488),a=i(6707),l=i(1530),c=i(7466),h=i(7651),u=i(2261),d=i(7293),f=[].push,p=Math.min,m=4294967295,g=!d(function(){return!RegExp(m,"y")});n("split",2,function(t,e,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,i){var n=String(r(this)),o=void 0===i?m:i>>>0;if(0===o)return[];if(void 0===t)return[n];if(!s(t))return e.call(n,t,o);for(var a,l,c,h=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,g=new RegExp(t.source,d+"g");(a=u.call(g,n))&&!((l=g.lastIndex)>p&&(h.push(n.slice(p,a.index)),a.length>1&&a.index<n.length&&f.apply(h,a.slice(1)),c=a[0].length,p=l,h.length>=o));)g.lastIndex===a.index&&g.lastIndex++;return p===n.length?!c&&g.test("")||h.push(""):h.push(n.slice(p)),h.length>o?h.slice(0,o):h}:"0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:e.call(this,t,i)}:e,[function(e,i){var s=r(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,s,i):n.call(String(s),e,i)},function(t,s){var r=i(n,t,this,s,n!==e);if(r.done)return r.value;var u=o(t),d=String(this),f=a(u,RegExp),v=u.unicode,y=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(g?"y":"g"),O=new f(g?u:"^(?:"+u.source+")",y),b=void 0===s?m:s>>>0;if(0===b)return[];if(0===d.length)return null===h(O,d)?[d]:[];for(var x=0,w=0,_=[];w<d.length;){O.lastIndex=g?w:0;var S,k=h(O,g?d:d.slice(w));if(null===k||(S=p(c(O.lastIndex+(g?0:w)),d.length))===x)w=l(d,w,v);else{if(_.push(d.slice(x,w)),_.length===b)return _;for(var $=1;$<=k.length-1;$++)if(_.push(k[$]),_.length===b)return _;w=x=S}}return _.push(d.slice(x)),_}]},!g)},3210:function(t,e,i){"use strict";var n=i(2109),s=i(3111).trim;n({target:"String",proto:!0,forced:i(6091)("trim")},{trim:function(){return s(this)}})},2990:function(t,e,i){"use strict";var n=i(260),s=i(1048),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("copyWithin",function(t,e){return s.call(o(this),t,e,arguments.length>2?arguments[2]:void 0)})},8927:function(t,e,i){"use strict";var n=i(260),s=i(2092).every,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",function(t){return s(o(this),t,arguments.length>1?arguments[1]:void 0)})},3105:function(t,e,i){"use strict";var n=i(260),s=i(1285),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("fill",function(t){return s.apply(o(this),arguments)})},5035:function(t,e,i){"use strict";var n=i(260),s=i(2092).filter,o=i(3074),r=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",function(t){var e=s(r(this),t,arguments.length>1?arguments[1]:void 0);return o(this,e)})},7174:function(t,e,i){"use strict";var n=i(260),s=i(2092).findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",function(t){return s(o(this),t,arguments.length>1?arguments[1]:void 0)})},4345:function(t,e,i){"use strict";var n=i(260),s=i(2092).find,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",function(t){return s(o(this),t,arguments.length>1?arguments[1]:void 0)})},2846:function(t,e,i){"use strict";var n=i(260),s=i(2092).forEach,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",function(t){s(o(this),t,arguments.length>1?arguments[1]:void 0)})},4731:function(t,e,i){"use strict";var n=i(260),s=i(1318).includes,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",function(t){return s(o(this),t,arguments.length>1?arguments[1]:void 0)})},7209:function(t,e,i){"use strict";var n=i(260),s=i(1318).indexOf,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",function(t){return s(o(this),t,arguments.length>1?arguments[1]:void 0)})},6319:function(t,e,i){"use strict";var n=i(7854),s=i(260),o=i(6992),r=i(5112)("iterator"),a=n.Uint8Array,l=o.values,c=o.keys,h=o.entries,u=s.aTypedArray,d=s.exportTypedArrayMethod,f=a&&a.prototype[r],p=!!f&&("values"==f.name||null==f.name),m=function(){return l.call(u(this))};d("entries",function(){return h.call(u(this))}),d("keys",function(){return c.call(u(this))}),d("values",m,!p),d(r,m,!p)},8867:function(t,e,i){"use strict";var n=i(260),s=n.aTypedArray,o=n.exportTypedArrayMethod,r=[].join;o("join",function(t){return r.apply(s(this),arguments)})},7789:function(t,e,i){"use strict";var n=i(260),s=i(6583),o=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",function(t){return s.apply(o(this),arguments)})},3739:function(t,e,i){"use strict";var n=i(260),s=i(2092).map,o=i(6707),r=n.aTypedArray,a=n.aTypedArrayConstructor;(0,n.exportTypedArrayMethod)("map",function(t){return s(r(this),t,arguments.length>1?arguments[1]:void 0,function(t,e){return new(a(o(t,t.constructor)))(e)})})},4483:function(t,e,i){"use strict";var n=i(260),s=i(3671).right,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",function(t){return s(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)})},9368:function(t,e,i){"use strict";var n=i(260),s=i(3671).left,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",function(t){return s(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)})},2056:function(t,e,i){"use strict";var n=i(260),s=n.aTypedArray,o=n.exportTypedArrayMethod,r=Math.floor;o("reverse",function(){for(var t,e=this,i=s(e).length,n=r(i/2),o=0;o<n;)t=e[o],e[o++]=e[--i],e[i]=t;return e})},3462:function(t,e,i){"use strict";var n=i(260),s=i(7466),o=i(4590),r=i(7908),a=i(7293),l=n.aTypedArray;(0,n.exportTypedArrayMethod)("set",function(t){l(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=this.length,n=r(t),a=s(n.length),c=0;if(a+e>i)throw RangeError("Wrong length");for(;c<a;)this[e+c]=n[c++]},a(function(){new Int8Array(1).set({})}))},678:function(t,e,i){"use strict";var n=i(260),s=i(6707),o=i(7293),r=n.aTypedArray,a=n.aTypedArrayConstructor,l=n.exportTypedArrayMethod,c=[].slice;l("slice",function(t,e){for(var i=c.call(r(this),t,e),n=s(this,this.constructor),o=0,l=i.length,h=new(a(n))(l);l>o;)h[o]=i[o++];return h},o(function(){new Int8Array(1).slice()}))},7462:function(t,e,i){"use strict";var n=i(260),s=i(2092).some,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",function(t){return s(o(this),t,arguments.length>1?arguments[1]:void 0)})},3824:function(t,e,i){"use strict";var n=i(260),s=n.aTypedArray,o=n.exportTypedArrayMethod,r=[].sort;o("sort",function(t){return r.call(s(this),t)})},5021:function(t,e,i){"use strict";var n=i(260),s=i(7466),o=i(1400),r=i(6707),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",function(t,e){var i=a(this),n=i.length,l=o(t,n);return new(r(i,i.constructor))(i.buffer,i.byteOffset+l*i.BYTES_PER_ELEMENT,s((void 0===e?n:o(e,n))-l))})},2974:function(t,e,i){"use strict";var n=i(7854),s=i(260),o=i(7293),r=n.Int8Array,a=s.aTypedArray,l=s.exportTypedArrayMethod,c=[].toLocaleString,h=[].slice,u=!!r&&o(function(){c.call(new r(1))});l("toLocaleString",function(){return c.apply(u?h.call(a(this)):a(this),arguments)},o(function(){return[1,2].toLocaleString()!=new r([1,2]).toLocaleString()})||!o(function(){r.prototype.toLocaleString.call([1,2])}))},5016:function(t,e,i){"use strict";var n=i(260).exportTypedArrayMethod,s=i(7293),o=i(7854).Uint8Array,r=o&&o.prototype||{},a=[].toString,l=[].join;s(function(){a.call({})})&&(a=function(){return l.call(this)});var c=r.toString!=a;n("toString",a,c)},2472:function(t,e,i){i(9843)("Uint8",function(t){return function(e,i,n){return t(this,e,i,n)}})},4747:function(t,e,i){var n=i(7854),s=i(8324),o=i(8533),r=i(8880);for(var a in s){var l=n[a],c=l&&l.prototype;if(c&&c.forEach!==o)try{r(c,"forEach",o)}catch(t){c.forEach=o}}},3948:function(t,e,i){var n=i(7854),s=i(8324),o=i(6992),r=i(8880),a=i(5112),l=a("iterator"),c=a("toStringTag"),h=o.values;for(var u in s){var d=n[u],f=d&&d.prototype;if(f){if(f[l]!==h)try{r(f,l,h)}catch(t){f[l]=h}if(f[c]||r(f,c,u),s[u])for(var p in o)if(f[p]!==o[p])try{r(f,p,o[p])}catch(t){f[p]=o[p]}}}},1637:function(t,e,i){"use strict";i(6992);var n=i(2109),s=i(5005),o=i(590),r=i(1320),a=i(2248),l=i(8003),c=i(4994),h=i(9909),u=i(5787),d=i(6656),f=i(9974),p=i(648),m=i(9670),g=i(111),v=i(30),y=i(9114),O=i(8554),b=i(1246),x=i(5112),w=s("fetch"),_=s("Headers"),S=x("iterator"),k="URLSearchParams",$=k+"Iterator",T=h.set,C=h.getterFor(k),P=h.getterFor($),E=/\+/g,A=Array(4),M=function(t){return A[t-1]||(A[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},Q=function(t){try{return decodeURIComponent(t)}catch(e){return t}},D=function(t){var e=t.replace(E," "),i=4;try{return decodeURIComponent(e)}catch(t){for(;i;)e=e.replace(M(i--),Q);return e}},R=/[!'()~]|%20/g,I={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},L=function(t){return I[t]},N=function(t){return encodeURIComponent(t).replace(R,L)},j=function(t,e){if(e)for(var i,n,s=e.split("&"),o=0;o<s.length;)(i=s[o++]).length&&(n=i.split("="),t.push({key:D(n.shift()),value:D(n.join("="))}))},z=function(t){this.entries.length=0,j(this.entries,t)},B=function(t,e){if(t<e)throw TypeError("Not enough arguments")},Z=c(function(t,e){T(this,{type:$,iterator:O(C(t).entries),kind:e})},"Iterator",function(){var t=P(this),e=t.kind,i=t.iterator.next(),n=i.value;return i.done||(i.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),i}),W=function(){u(this,W,k);var t,e,i,n,s,o,r,a,l,c=arguments.length>0?arguments[0]:void 0,h=[];if(T(this,{type:k,entries:h,updateURL:function(){},updateSearchParams:z}),void 0!==c)if(g(c))if("function"==typeof(t=b(c)))for(i=(e=t.call(c)).next;!(n=i.call(e)).done;){if((r=(o=(s=O(m(n.value))).next).call(s)).done||(a=o.call(s)).done||!o.call(s).done)throw TypeError("Expected sequence with length 2");h.push({key:r.value+"",value:a.value+""})}else for(l in c)d(c,l)&&h.push({key:l,value:c[l]+""});else j(h,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},F=W.prototype;a(F,{append:function(t,e){B(arguments.length,2);var i=C(this);i.entries.push({key:t+"",value:e+""}),i.updateURL()},delete:function(t){B(arguments.length,1);for(var e=C(this),i=e.entries,n=t+"",s=0;s<i.length;)i[s].key===n?i.splice(s,1):s++;e.updateURL()},get:function(t){B(arguments.length,1);for(var e=C(this).entries,i=t+"",n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){B(arguments.length,1);for(var e=C(this).entries,i=t+"",n=[],s=0;s<e.length;s++)e[s].key===i&&n.push(e[s].value);return n},has:function(t){B(arguments.length,1);for(var e=C(this).entries,i=t+"",n=0;n<e.length;)if(e[n++].key===i)return!0;return!1},set:function(t,e){B(arguments.length,1);for(var i,n=C(this),s=n.entries,o=!1,r=t+"",a=e+"",l=0;l<s.length;l++)(i=s[l]).key===r&&(o?s.splice(l--,1):(o=!0,i.value=a));o||s.push({key:r,value:a}),n.updateURL()},sort:function(){var t,e,i,n=C(this),s=n.entries,o=s.slice();for(s.length=0,i=0;i<o.length;i++){for(t=o[i],e=0;e<i;e++)if(s[e].key>t.key){s.splice(e,0,t);break}e===i&&s.push(t)}n.updateURL()},forEach:function(t){for(var e,i=C(this).entries,n=f(t,arguments.length>1?arguments[1]:void 0,3),s=0;s<i.length;)n((e=i[s++]).value,e.key,this)},keys:function(){return new Z(this,"keys")},values:function(){return new Z(this,"values")},entries:function(){return new Z(this,"entries")}},{enumerable:!0}),r(F,S,F.entries),r(F,"toString",function(){for(var t,e=C(this).entries,i=[],n=0;n<e.length;)t=e[n++],i.push(N(t.key)+"="+N(t.value));return i.join("&")},{enumerable:!0}),l(W,k),n({global:!0,forced:!o},{URLSearchParams:W}),o||"function"!=typeof w||"function"!=typeof _||n({global:!0,enumerable:!0,forced:!0},{fetch:function(t){var e,i,n,s=[t];return arguments.length>1&&(g(e=arguments[1])&&(i=e.body,p(i)===k&&((n=e.headers?new _(e.headers):new _).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=v(e,{body:y(0,String(i)),headers:y(0,n)}))),s.push(e)),w.apply(this,s)}}),t.exports={URLSearchParams:W,getState:C}},285:function(t,e,i){"use strict";i(8783);var n,s=i(2109),o=i(9781),r=i(590),a=i(7854),l=i(6048),c=i(1320),h=i(5787),u=i(6656),d=i(1574),f=i(8457),p=i(8710).codeAt,m=i(3197),g=i(8003),v=i(1637),y=i(9909),O=a.URL,b=v.URLSearchParams,x=v.getState,w=y.set,_=y.getterFor("URL"),S=Math.floor,k=Math.pow,$="Invalid scheme",T="Invalid host",C="Invalid port",P=/[A-Za-z]/,E=/[\d+-.A-Za-z]/,A=/\d/,M=/^(0x|0X)/,Q=/^[0-7]+$/,D=/^\d+$/,R=/^[\dA-Fa-f]+$/,I=/[\u0000\t\u000A\u000D #%/:?@[\\]]/,L=/[\u0000\t\u000A\u000D #/:?@[\\]]/,N=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,j=/[\t\u000A\u000D]/g,z=function(t,e){var i,n,s;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return T;if(!(i=Z(e.slice(1,-1))))return T;t.host=i}else if(U(t)){if(e=m(e),I.test(e))return T;if(null===(i=B(e)))return T;t.host=i}else{if(L.test(e))return T;for(i="",n=f(e),s=0;s<n.length;s++)i+=V(n[s],F);t.host=i}},B=function(t){var e,i,n,s,o,r,a,l=t.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(e=l.length)>4)return t;for(i=[],n=0;n<e;n++){if(""==(s=l[n]))return t;if(o=10,s.length>1&&"0"==s.charAt(0)&&(o=M.test(s)?16:8,s=s.slice(8==o?1:2)),""===s)r=0;else{if(!(10==o?D:8==o?Q:R).test(s))return t;r=parseInt(s,o)}i.push(r)}for(n=0;n<e;n++)if(r=i[n],n==e-1){if(r>=k(256,5-e))return null}else if(r>255)return null;for(a=i.pop(),n=0;n<i.length;n++)a+=i[n]*k(256,3-n);return a},Z=function(t){var e,i,n,s,o,r,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return t.charAt(u)};if(":"==d()){if(":"!=t.charAt(1))return;u+=2,h=++c}for(;d();){if(8==c)return;if(":"!=d()){for(e=i=0;i<4&&R.test(d());)e=16*e+parseInt(d(),16),u++,i++;if("."==d()){if(0==i)return;if(u-=i,c>6)return;for(n=0;d();){if(s=null,n>0){if(!("."==d()&&n<4))return;u++}if(!A.test(d()))return;for(;A.test(d());){if(o=parseInt(d(),10),null===s)s=o;else{if(0==s)return;s=10*s+o}if(s>255)return;u++}l[c]=256*l[c]+s,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,h=++c}}if(null!==h)for(r=c-h,c=7;0!=c&&r>0;)a=l[c],l[c--]=l[h+r-1],l[h+--r]=a;else if(8!=c)return;return l},W=function(t){var e,i,n,s;if("number"==typeof t){for(e=[],i=0;i<4;i++)e.unshift(t%256),t=S(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,i=1,n=null,s=0,o=0;o<8;o++)0!==t[o]?(s>i&&(e=n,i=s),n=null,s=0):(null===n&&(n=o),++s);return s>i&&(e=n,i=s),e}(t),i=0;i<8;i++)s&&0===t[i]||(s&&(s=!1),n===i?(e+=i?":":"::",s=!0):(e+=t[i].toString(16),i<7&&(e+=":")));return"["+e+"]"}return t},F={},X=d({},F,{" ":1,'"':1,"<":1,">":1,"`":1}),q=d({},X,{"#":1,"?":1,"{":1,"}":1}),H=d({},q,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),V=function(t,e){var i=p(t,0);return i>32&&i<127&&!u(e,t)?t:encodeURIComponent(t)},Y={ftp:21,file:null,http:80,https:443,ws:80,wss:443},U=function(t){return u(Y,t.scheme)},G=function(t){return""!=t.username||""!=t.password},K=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},J=function(t,e){var i;return 2==t.length&&P.test(t.charAt(0))&&(":"==(i=t.charAt(1))||!e&&"|"==i)},tt=function(t){var e;return t.length>1&&J(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},et=function(t){var e=t.path,i=e.length;!i||"file"==t.scheme&&1==i&&J(e[0],!0)||e.pop()},it=function(t){return"."===t||"%2e"===t.toLowerCase()},nt=function(t){return".."===(t=t.toLowerCase())||"%2e."===t||".%2e"===t||"%2e%2e"===t},st={},ot={},rt={},at={},lt={},ct={},ht={},ut={},dt={},ft={},pt={},mt={},gt={},vt={},yt={},Ot={},bt={},xt={},wt={},_t={},St={},kt=function(t,e,i,s){var o,r,a,l,c=i||st,h=0,d="",p=!1,m=!1,g=!1;for(i||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(N,"")),e=e.replace(j,""),o=f(e);h<=o.length;){switch(r=o[h],c){case st:if(!r||!P.test(r)){if(i)return $;c=rt;continue}d+=r.toLowerCase(),c=ot;break;case ot:if(r&&(E.test(r)||"+"==r||"-"==r||"."==r))d+=r.toLowerCase();else{if(":"!=r){if(i)return $;d="",c=rt,h=0;continue}if(i&&(U(t)!=u(Y,d)||"file"==d&&(G(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=d,i)return void(U(t)&&Y[t.scheme]==t.port&&(t.port=null));d="","file"==t.scheme?c=vt:U(t)&&s&&s.scheme==t.scheme?c=at:U(t)?c=ut:"/"==o[h+1]?(c=lt,h++):(t.cannotBeABaseURL=!0,t.path.push(""),c=wt)}break;case rt:if(!s||s.cannotBeABaseURL&&"#"!=r)return $;if(s.cannotBeABaseURL&&"#"==r){t.scheme=s.scheme,t.path=s.path.slice(),t.query=s.query,t.fragment="",t.cannotBeABaseURL=!0,c=St;break}c="file"==s.scheme?vt:ct;continue;case at:if("/"!=r||"/"!=o[h+1]){c=ct;continue}c=dt,h++;break;case lt:if("/"==r){c=ft;break}c=xt;continue;case ct:if(t.scheme=s.scheme,r==n)t.username=s.username,t.password=s.password,t.host=s.host,t.port=s.port,t.path=s.path.slice(),t.query=s.query;else if("/"==r||"\\"==r&&U(t))c=ht;else if("?"==r)t.username=s.username,t.password=s.password,t.host=s.host,t.port=s.port,t.path=s.path.slice(),t.query="",c=_t;else{if("#"!=r){t.username=s.username,t.password=s.password,t.host=s.host,t.port=s.port,t.path=s.path.slice(),t.path.pop(),c=xt;continue}t.username=s.username,t.password=s.password,t.host=s.host,t.port=s.port,t.path=s.path.slice(),t.query=s.query,t.fragment="",c=St}break;case ht:if(!U(t)||"/"!=r&&"\\"!=r){if("/"!=r){t.username=s.username,t.password=s.password,t.host=s.host,t.port=s.port,c=xt;continue}c=ft}else c=dt;break;case ut:if(c=dt,"/"!=r||"/"!=d.charAt(h+1))continue;h++;break;case dt:if("/"!=r&&"\\"!=r){c=ft;continue}break;case ft:if("@"==r){p&&(d="%40"+d),p=!0,a=f(d);for(var v=0;v<a.length;v++){var y=a[v];if(":"!=y||g){var O=V(y,H);g?t.password+=O:t.username+=O}else g=!0}d=""}else if(r==n||"/"==r||"?"==r||"#"==r||"\\"==r&&U(t)){if(p&&""==d)return"Invalid authority";h-=f(d).length+1,d="",c=pt}else d+=r;break;case pt:case mt:if(i&&"file"==t.scheme){c=Ot;continue}if(":"!=r||m){if(r==n||"/"==r||"?"==r||"#"==r||"\\"==r&&U(t)){if(U(t)&&""==d)return T;if(i&&""==d&&(G(t)||null!==t.port))return;if(l=z(t,d))return l;if(d="",c=bt,i)return;continue}"["==r?m=!0:"]"==r&&(m=!1),d+=r}else{if(""==d)return T;if(l=z(t,d))return l;if(d="",c=gt,i==mt)return}break;case gt:if(!A.test(r)){if(r==n||"/"==r||"?"==r||"#"==r||"\\"==r&&U(t)||i){if(""!=d){var b=parseInt(d,10);if(b>65535)return C;t.port=U(t)&&b===Y[t.scheme]?null:b,d=""}if(i)return;c=bt;continue}return C}d+=r;break;case vt:if(t.scheme="file","/"==r||"\\"==r)c=yt;else{if(!s||"file"!=s.scheme){c=xt;continue}if(r==n)t.host=s.host,t.path=s.path.slice(),t.query=s.query;else if("?"==r)t.host=s.host,t.path=s.path.slice(),t.query="",c=_t;else{if("#"!=r){tt(o.slice(h).join(""))||(t.host=s.host,t.path=s.path.slice(),et(t)),c=xt;continue}t.host=s.host,t.path=s.path.slice(),t.query=s.query,t.fragment="",c=St}}break;case yt:if("/"==r||"\\"==r){c=Ot;break}s&&"file"==s.scheme&&!tt(o.slice(h).join(""))&&(J(s.path[0],!0)?t.path.push(s.path[0]):t.host=s.host),c=xt;continue;case Ot:if(r==n||"/"==r||"\\"==r||"?"==r||"#"==r){if(!i&&J(d))c=xt;else if(""==d){if(t.host="",i)return;c=bt}else{if(l=z(t,d))return l;if("localhost"==t.host&&(t.host=""),i)return;d="",c=bt}continue}d+=r;break;case bt:if(U(t)){if(c=xt,"/"!=r&&"\\"!=r)continue}else if(i||"?"!=r)if(i||"#"!=r){if(r!=n&&(c=xt,"/"!=r))continue}else t.fragment="",c=St;else t.query="",c=_t;break;case xt:if(r==n||"/"==r||"\\"==r&&U(t)||!i&&("?"==r||"#"==r)){if(nt(d)?(et(t),"/"==r||"\\"==r&&U(t)||t.path.push("")):it(d)?"/"==r||"\\"==r&&U(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&J(d)&&(t.host&&(t.host=""),d=d.charAt(0)+":"),t.path.push(d)),d="","file"==t.scheme&&(r==n||"?"==r||"#"==r))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==r?(t.query="",c=_t):"#"==r&&(t.fragment="",c=St)}else d+=V(r,q);break;case wt:"?"==r?(t.query="",c=_t):"#"==r?(t.fragment="",c=St):r!=n&&(t.path[0]+=V(r,F));break;case _t:i||"#"!=r?r!=n&&("'"==r&&U(t)?t.query+="%27":t.query+="#"==r?"%23":V(r,F)):(t.fragment="",c=St);break;case St:r!=n&&(t.fragment+=V(r,X))}h++}},$t=function(t){var e,i,n=h(this,$t,"URL"),s=arguments.length>1?arguments[1]:void 0,r=String(t),a=w(n,{type:"URL"});if(void 0!==s)if(s instanceof $t)e=_(s);else if(i=kt(e={},String(s)))throw TypeError(i);if(i=kt(a,r,null,e))throw TypeError(i);var l=a.searchParams=new b,c=x(l);c.updateSearchParams(a.query),c.updateURL=function(){a.query=String(l)||null},o||(n.href=Ct.call(n),n.origin=Pt.call(n),n.protocol=Et.call(n),n.username=At.call(n),n.password=Mt.call(n),n.host=Qt.call(n),n.hostname=Dt.call(n),n.port=Rt.call(n),n.pathname=It.call(n),n.search=Lt.call(n),n.searchParams=Nt.call(n),n.hash=jt.call(n))},Tt=$t.prototype,Ct=function(){var t=_(this),e=t.scheme,i=t.username,n=t.password,s=t.host,o=t.port,r=t.path,a=t.query,l=t.fragment,c=e+":";return null!==s?(c+="//",G(t)&&(c+=i+(n?":"+n:"")+"@"),c+=W(s),null!==o&&(c+=":"+o)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?r[0]:r.length?"/"+r.join("/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},Pt=function(){var t=_(this),e=t.scheme,i=t.port;if("blob"==e)try{return new URL(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&U(t)?e+"://"+W(t.host)+(null!==i?":"+i:""):"null"},Et=function(){return _(this).scheme+":"},At=function(){return _(this).username},Mt=function(){return _(this).password},Qt=function(){var t=_(this),e=t.host,i=t.port;return null===e?"":null===i?W(e):W(e)+":"+i},Dt=function(){var t=_(this).host;return null===t?"":W(t)},Rt=function(){var t=_(this).port;return null===t?"":String(t)},It=function(){var t=_(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},Lt=function(){var t=_(this).query;return t?"?"+t:""},Nt=function(){return _(this).searchParams},jt=function(){var t=_(this).fragment;return t?"#"+t:""},zt=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(o&&l(Tt,{href:zt(Ct,function(t){var e=_(this),i=String(t),n=kt(e,i);if(n)throw TypeError(n);x(e.searchParams).updateSearchParams(e.query)}),origin:zt(Pt),protocol:zt(Et,function(t){var e=_(this);kt(e,String(t)+":",st)}),username:zt(At,function(t){var e=_(this),i=f(String(t));if(!K(e)){e.username="";for(var n=0;n<i.length;n++)e.username+=V(i[n],H)}}),password:zt(Mt,function(t){var e=_(this),i=f(String(t));if(!K(e)){e.password="";for(var n=0;n<i.length;n++)e.password+=V(i[n],H)}}),host:zt(Qt,function(t){var e=_(this);e.cannotBeABaseURL||kt(e,String(t),pt)}),hostname:zt(Dt,function(t){var e=_(this);e.cannotBeABaseURL||kt(e,String(t),mt)}),port:zt(Rt,function(t){var e=_(this);K(e)||(""==(t=String(t))?e.port=null:kt(e,t,gt))}),pathname:zt(It,function(t){var e=_(this);e.cannotBeABaseURL||(e.path=[],kt(e,t+"",bt))}),search:zt(Lt,function(t){var e=_(this);""==(t=String(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",kt(e,t,_t)),x(e.searchParams).updateSearchParams(e.query)}),searchParams:zt(Nt),hash:zt(jt,function(t){var e=_(this);""!=(t=String(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",kt(e,t,St)):e.fragment=null})}),c(Tt,"toJSON",function(){return Ct.call(this)},{enumerable:!0}),c(Tt,"toString",function(){return Ct.call(this)},{enumerable:!0}),O){var Bt=O.createObjectURL,Zt=O.revokeObjectURL;Bt&&c($t,"createObjectURL",function(t){return Bt.apply(O,arguments)}),Zt&&c($t,"revokeObjectURL",function(t){return Zt.apply(O,arguments)})}g($t,"URL"),s({global:!0,forced:!r,sham:!o},{URL:$t})}},e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={exports:{}};return t[n](s,s.exports,i),s.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return function(){"use strict";function t(t,i){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,i){if(t){if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,i):void 0}}(t))||i&&t&&"number"==typeof t.length){n&&(t=n);var s=0,o=function(){};return{s:o,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:o}}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 r,a=!0,l=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,r=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw r}}}}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}i.r(n),i.d(n,{Dropzone:function(){return b},default:function(){return k}}),i(2222),i(7327),i(2772),i(6992),i(1249),i(7042),i(561),i(8264),i(8309),i(489),i(1539),i(4916),i(9714),i(8783),i(4723),i(5306),i(3123),i(3210),i(2472),i(2990),i(8927),i(3105),i(5035),i(4345),i(7174),i(2846),i(4731),i(7209),i(6319),i(8867),i(7789),i(3739),i(9368),i(4483),i(2056),i(3462),i(678),i(7462),i(3824),i(5021),i(2974),i(5016),i(4747),i(3948),i(285);var o=function(){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e)}var i,n,o;return i=e,n=[{key:"on",value:function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};for(var i=this._callbacks[e],n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];if(i){var r,a=t(i,!0);try{for(a.s();!(r=a.n()).done;)r.value.apply(this,s)}catch(t){a.e(t)}finally{a.f()}}return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+e,{args:s})),this}},{key:"makeEvent",value:function(t,e){var i={bubbles:!0,cancelable:!0,detail:e};if("function"==typeof window.CustomEvent)return new CustomEvent(t,i);var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),n}},{key:"off",value:function(t,e){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var i=this._callbacks[t];if(!i)return this;if(1===arguments.length)return delete this._callbacks[t],this;for(var n=0;n<i.length;n++)if(i[n]===e){i.splice(n,1);break}return this}}],n&&s(i.prototype,n),o&&s(i,o),e}();function r(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return a(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,s=function(){};return{s,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:s}}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,r=!0,l=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return r=t.done,t},e:function(t){l=!0,o=t},f:function(){try{r||null==i.return||i.return()}finally{if(l)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var l={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(t,e,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept:function(t,e){return e()},chunksUploaded:function(t,e){e()},fallback:function(){var t;this.element.className="".concat(this.element.className," dz-browser-not-supported");var e,i=r(this.element.getElementsByTagName("div"),!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;if(/(^| )dz-message($| )/.test(n.className)){t=n,n.className="dz-message";break}}}catch(t){i.e(t)}finally{i.f()}t||(t=b.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(t));var s=t.getElementsByTagName("span")[0];return s&&(null!=s.textContent?s.textContent=this.options.dictFallbackMessage:null!=s.innerText&&(s.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(t,e,i,n){var s={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},o=t.width/t.height;null==e&&null==i?(e=s.srcWidth,i=s.srcHeight):null==e?e=i*o:null==i&&(i=e/o);var r=(e=Math.min(e,s.srcWidth))/(i=Math.min(i,s.srcHeight));if(s.srcWidth>e||s.srcHeight>i)if("crop"===n)o>r?(s.srcHeight=t.height,s.srcWidth=s.srcHeight*r):(s.srcWidth=t.width,s.srcHeight=s.srcWidth/r);else{if("contain"!==n)throw new Error("Unknown resizeMethod '".concat(n,"'"));o>r?i=e/o:e=i*o}return s.srcX=(t.width-s.srcWidth)/2,s.srcY=(t.height-s.srcHeight)/2,s.trgWidth=e,s.trgHeight=i,s},transformFile:function(t,e){return(this.options.resizeWidth||this.options.resizeHeight)&&t.type.match(/image.*/)?this.resizeImage(t,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(t)},previewTemplate:'<div class="dz-preview dz-file-preview"> <div class="dz-image"><img data-dz-thumbnail/></div> <div class="dz-details"> <div class="dz-size"><span data-dz-size></span></div> <div class="dz-filename"><span data-dz-name></span></div> </div> <div class="dz-progress"> <span class="dz-upload" data-dz-uploadprogress></span> </div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Check</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path> </g> </svg> </div> <div class="dz-error-mark"> <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Error</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475"> <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path> </g> </g> </svg> </div> </div> ',drop:function(t){return this.element.classList.remove("dz-drag-hover")},dragstart:function(t){},dragend:function(t){return this.element.classList.remove("dz-drag-hover")},dragenter:function(t){return this.element.classList.add("dz-drag-hover")},dragover:function(t){return this.element.classList.add("dz-drag-hover")},dragleave:function(t){return this.element.classList.remove("dz-drag-hover")},paste:function(t){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var e=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){t.previewElement=b.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement);var i,n=r(t.previewElement.querySelectorAll("[data-dz-name]"),!0);try{for(n.s();!(i=n.n()).done;){var s=i.value;s.textContent=t.name}}catch(t){n.e(t)}finally{n.f()}var o,a=r(t.previewElement.querySelectorAll("[data-dz-size]"),!0);try{for(a.s();!(o=a.n()).done;)(s=o.value).innerHTML=this.filesize(t.size)}catch(t){a.e(t)}finally{a.f()}this.options.addRemoveLinks&&(t._removeLink=b.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),t.previewElement.appendChild(t._removeLink));var l,c=function(i){return i.preventDefault(),i.stopPropagation(),t.status===b.UPLOADING?b.confirm(e.options.dictCancelUploadConfirmation,function(){return e.removeFile(t)}):e.options.dictRemoveFileConfirmation?b.confirm(e.options.dictRemoveFileConfirmation,function(){return e.removeFile(t)}):e.removeFile(t)},h=r(t.previewElement.querySelectorAll("[data-dz-remove]"),!0);try{for(h.s();!(l=h.n()).done;)l.value.addEventListener("click",c)}catch(t){h.e(t)}finally{h.f()}}},removedfile:function(t){return null!=t.previewElement&&null!=t.previewElement.parentNode&&t.previewElement.parentNode.removeChild(t.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(t,e){if(t.previewElement){t.previewElement.classList.remove("dz-file-preview");var i,n=r(t.previewElement.querySelectorAll("[data-dz-thumbnail]"),!0);try{for(n.s();!(i=n.n()).done;){var s=i.value;s.alt=t.name,s.src=e}}catch(t){n.e(t)}finally{n.f()}return setTimeout(function(){return t.previewElement.classList.add("dz-image-preview")},1)}},error:function(t,e){if(t.previewElement){t.previewElement.classList.add("dz-error"),"string"!=typeof e&&e.error&&(e=e.error);var i,n=r(t.previewElement.querySelectorAll("[data-dz-errormessage]"),!0);try{for(n.s();!(i=n.n()).done;)i.value.textContent=e}catch(t){n.e(t)}finally{n.f()}}},errormultiple:function(){},processing:function(t){if(t.previewElement&&(t.previewElement.classList.add("dz-processing"),t._removeLink))return t._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(t,e,i){if(t.previewElement){var n,s=r(t.previewElement.querySelectorAll("[data-dz-uploadprogress]"),!0);try{for(s.s();!(n=s.n()).done;){var o=n.value;"PROGRESS"===o.nodeName?o.value=e:o.style.width="".concat(e,"%")}}catch(t){s.e(t)}finally{s.f()}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(t){if(t.previewElement)return t.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(t){return this.emit("error",t,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(t){if(t._removeLink&&(t._removeLink.innerHTML=this.options.dictRemoveFile),t.previewElement)return t.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}};function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function h(t,e){var i;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return u(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,s=function(){};return{s,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:s}}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,r=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,o=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw o}}}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t,e,i){return e&&f(t.prototype,e),i&&f(t,i),t}function m(t,e){return m=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},m(t,e)}function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var i,n=O(t);if(e){var s=O(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return v(this,i)}}function v(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?y(t):e}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O(t){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},O(t)}var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&m(t,e)}(i,t);var e=g(i);function i(t,n){var s,o,r;if(d(this,i),(s=e.call(this)).element=t,s.version=i.version,s.clickableElements=[],s.listeners=[],s.files=[],"string"==typeof s.element&&(s.element=document.querySelector(s.element)),!s.element||null==s.element.nodeType)throw new Error("Invalid dropzone element.");if(s.element.dropzone)throw new Error("Dropzone already attached.");i.instances.push(y(s)),s.element.dropzone=y(s);var a=null!=(r=i.optionsForElement(s.element))?r:{};if(s.options=i.extend({},l,a,null!=n?n:{}),s.options.previewTemplate=s.options.previewTemplate.replace(/\n*/g,""),s.options.forceFallback||!i.isBrowserSupported())return v(s,s.options.fallback.call(y(s)));if(null==s.options.url&&(s.options.url=s.element.getAttribute("action")),!s.options.url)throw new Error("No URL provided.");if(s.options.acceptedFiles&&s.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(s.options.uploadMultiple&&s.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return s.options.acceptedMimeTypes&&(s.options.acceptedFiles=s.options.acceptedMimeTypes,delete s.options.acceptedMimeTypes),null!=s.options.renameFilename&&(s.options.renameFile=function(t){return s.options.renameFilename.call(y(s),t.name,t)}),"string"==typeof s.options.method&&(s.options.method=s.options.method.toUpperCase()),(o=s.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),!1!==s.options.previewsContainer&&(s.options.previewsContainer?s.previewsContainer=i.getElement(s.options.previewsContainer,"previewsContainer"):s.previewsContainer=s.element),s.options.clickable&&(!0===s.options.clickable?s.clickableElements=[s.element]:s.clickableElements=i.getElements(s.options.clickable,"clickable")),s.init(),s}return p(i,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(t){return t.accepted}).map(function(t){return t})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(t){return!t.accepted}).map(function(t){return t})}},{key:"getFilesWithStatus",value:function(t){return this.files.filter(function(e){return e.status===t}).map(function(t){return t})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(i.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(i.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(i.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(t){return t.status===i.UPLOADING||t.status===i.QUEUED}).map(function(t){return t})}},{key:"init",value:function(){var t=this;"form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length&&function e(){t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null===t.options.maxFiles||t.options.maxFiles>1)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!==t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!==t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.setAttribute("tabindex","-1"),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",i.getElement(t.options.hiddenInputContainer,"hiddenInputContainer").appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var i=t.hiddenFileInput.files;if(i.length){var n,s=h(i,!0);try{for(s.s();!(n=s.n()).done;){var o=n.value;t.addFile(o)}}catch(t){s.e(t)}finally{s.f()}}t.emit("addedfiles",i),e()})}(),this.URL=null!==window.URL?window.URL:window.webkitURL;var e,n=h(this.events,!0);try{for(n.s();!(e=n.n()).done;){var s=e.value;this.on(s,this.options[s])}}catch(t){n.e(t)}finally{n.f()}this.on("uploadprogress",function(){return t.updateTotalUploadProgress()}),this.on("removedfile",function(){return t.updateTotalUploadProgress()}),this.on("canceled",function(e){return t.emit("complete",e)}),this.on("complete",function(e){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout(function(){return t.emit("queuecomplete")},0)});var o=function(t){if(function(t){if(t.dataTransfer.types)for(var e=0;e<t.dataTransfer.types.length;e++)if("Files"===t.dataTransfer.types[e])return!0;return!1}(t))return t.stopPropagation(),t.preventDefault?t.preventDefault():t.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(e){return t.emit("dragstart",e)},dragenter:function(e){return o(e),t.emit("dragenter",e)},dragover:function(e){var i;try{i=e.dataTransfer.effectAllowed}catch(t){}return e.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",o(e),t.emit("dragover",e)},dragleave:function(e){return t.emit("dragleave",e)},drop:function(e){return o(e),t.drop(e)},dragend:function(e){return t.emit("dragend",e)}}}],this.clickableElements.forEach(function(e){return t.listeners.push({element:e,events:{click:function(n){return(e!==t.element||n.target===t.element||i.elementInside(n.target,t.element.querySelector(".dz-message")))&&t.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var t,e=0,i=0;if(this.getActiveFiles().length){var n,s=h(this.getActiveFiles(),!0);try{for(s.s();!(n=s.n()).done;){var o=n.value;e+=o.upload.bytesSent,i+=o.upload.total}}catch(t){s.e(t)}finally{s.f()}t=100*e/i}else t=100;return this.emit("totaluploadprogress",t,i,e)}},{key:"_getParamName",value:function(t){return"function"==typeof this.options.paramName?this.options.paramName(t):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(t,"]"):"")}},{key:"_renameFile",value:function(t){return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)}},{key:"getFallbackForm",value:function(){var t,e;if(t=this.getExistingFallback())return t;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>".concat(this.options.dictFallbackText,"</p>")),n+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var s=i.createElement(n);return"FORM"!==this.element.tagName?(e=i.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(s):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:s}},{key:"getExistingFallback",value:function(){for(var t=function(t){var e,i=h(t,!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;if(/(^| )fallback($| )/.test(n.className))return n}}catch(t){i.e(t)}finally{i.f()}},e=0,i=["div","form"];e<i.length;e++){var n,s=i[e];if(n=t(this.element.getElementsByTagName(s)))return n}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(t){return function(){var e=[];for(var i in t.events){var n=t.events[i];e.push(t.element.addEventListener(i,n,!1))}return e}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(t){return function(){var e=[];for(var i in t.events){var n=t.events[i];e.push(t.element.removeEventListener(i,n,!1))}return e}()})}},{key:"disable",value:function(){var t=this;return this.clickableElements.forEach(function(t){return t.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(e){return t.cancelUpload(e)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(t){return t.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(t){var e=0,i="b";if(t>0){for(var n=["tb","gb","mb","kb","b"],s=0;s<n.length;s++){var o=n[s];if(t>=Math.pow(this.options.filesizeBase,4-s)/10){e=t/Math.pow(this.options.filesizeBase,4-s),i=o;break}}e=Math.round(10*e)/10}return"<strong>".concat(e,"</strong> ").concat(this.options.dictFileSizeUnits[i])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(t){if(t.dataTransfer){this.emit("drop",t);for(var e=[],i=0;i<t.dataTransfer.files.length;i++)e[i]=t.dataTransfer.files[i];if(e.length){var n=t.dataTransfer.items;n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(e)}this.emit("addedfiles",e)}}},{key:"paste",value:function(t){if(null!=(e=null!=t?t.clipboardData:void 0,i=function(t){return t.items},null!=e?i(e):void 0)){var e,i;this.emit("paste",t);var n=t.clipboardData.items;return n.length?this._addFilesFromItems(n):void 0}}},{key:"handleFiles",value:function(t){var e,i=h(t,!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;this.addFile(n)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_addFilesFromItems",value:function(t){var e=this;return function(){var i,n=[],s=h(t,!0);try{for(s.s();!(i=s.n()).done;){var o,r=i.value;null!=r.webkitGetAsEntry&&(o=r.webkitGetAsEntry())?o.isFile?n.push(e.addFile(r.getAsFile())):o.isDirectory?n.push(e._addFilesFromDirectory(o,o.name)):n.push(void 0):null==r.getAsFile||null!=r.kind&&"file"!==r.kind?n.push(void 0):n.push(e.addFile(r.getAsFile()))}}catch(t){s.e(t)}finally{s.f()}return n}()}},{key:"_addFilesFromDirectory",value:function(t,e){var i=this,n=t.createReader(),s=function(t){return e=console,i="log",n=function(e){return e.log(t)},null!=e&&"function"==typeof e[i]?n(e,i):void 0;var e,i,n};return function t(){return n.readEntries(function(n){if(n.length>0){var s,o=h(n,!0);try{for(o.s();!(s=o.n()).done;){var r=s.value;r.isFile?r.file(function(t){if(!i.options.ignoreHiddenFiles||"."!==t.name.substring(0,1))return t.fullPath="".concat(e,"/").concat(t.name),i.addFile(t)}):r.isDirectory&&i._addFilesFromDirectory(r,"".concat(e,"/").concat(r.name))}}catch(t){o.e(t)}finally{o.f()}t()}return null},s)}()}},{key:"accept",value:function(t,e){this.options.maxFilesize&&t.size>1024*this.options.maxFilesize*1024?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var e=this;t.upload={uuid:i.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=i.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(i){i?(t.accepted=!1,e._errorProcessing([t],i)):(t.accepted=!0,e.options.autoQueue&&e.enqueueFile(t)),e._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(t){var e,i=h(t,!0);try{for(i.s();!(e=i.n()).done;){var n=e.value;this.enqueueFile(n)}}catch(t){i.e(t)}finally{i.f()}return null}},{key:"enqueueFile",value:function(t){var e=this;if(t.status!==i.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=i.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return e.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(t){var e=this;if(this.options.createImageThumbnails&&t.type.match(/image.*/)&&t.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(t),setTimeout(function(){return e._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var t=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return t.emit("thumbnail",e,i),t._processingThumbnail=!1,t._processThumbnailQueue()})}}},{key:"removeFile",value:function(t){if(t.status===i.UPLOADING&&this.cancelUpload(t),this.files=x(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(t){null==t&&(t=!1);var e,n=h(this.files.slice(),!0);try{for(n.s();!(e=n.n()).done;){var s=e.value;(s.status!==i.UPLOADING||t)&&this.removeFile(s)}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"resizeImage",value:function(t,e,n,s,o){var r=this;return this.createThumbnail(t,e,n,s,!0,function(e,n){if(null==n)return o(t);var s=r.options.resizeMimeType;null==s&&(s=t.type);var a=n.toDataURL(s,r.options.resizeQuality);return"image/jpeg"!==s&&"image/jpg"!==s||(a=S.restore(t.dataURL,a)),o(i.dataURItoBlob(a))})}},{key:"createThumbnail",value:function(t,e,i,n,s,o){var r=this,a=new FileReader;a.onload=function(){t.dataURL=a.result,"image/svg+xml"!==t.type?r.createThumbnailFromUrl(t,e,i,n,s,o):null!=o&&o(a.result)},a.readAsDataURL(t)}},{key:"displayExistingFile",value:function(t,e,i,n){var s=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.emit("addedfile",t),this.emit("complete",t),o?(t.dataURL=e,this.createThumbnailFromUrl(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,function(e){s.emit("thumbnail",t,e),i&&i()},n)):(this.emit("thumbnail",t,e),i&&i())}},{key:"createThumbnailFromUrl",value:function(t,e,i,n,s,o,r){var a=this,l=document.createElement("img");return r&&(l.crossOrigin=r),s="from-image"!=getComputedStyle(document.body).imageOrientation&&s,l.onload=function(){var r=function(t){return t(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&s&&(r=function(t){return EXIF.getData(l,function(){return t(EXIF.getTag(this,"Orientation"))})}),r(function(s){t.width=l.width,t.height=l.height;var r=a.options.resize.call(a,t,e,i,n),c=document.createElement("canvas"),h=c.getContext("2d");switch(c.width=r.trgWidth,c.height=r.trgHeight,s>4&&(c.width=r.trgHeight,c.height=r.trgWidth),s){case 2:h.translate(c.width,0),h.scale(-1,1);break;case 3:h.translate(c.width,c.height),h.rotate(Math.PI);break;case 4:h.translate(0,c.height),h.scale(1,-1);break;case 5:h.rotate(.5*Math.PI),h.scale(1,-1);break;case 6:h.rotate(.5*Math.PI),h.translate(0,-c.width);break;case 7:h.rotate(.5*Math.PI),h.translate(c.height,-c.width),h.scale(-1,1);break;case 8:h.rotate(-.5*Math.PI),h.translate(-c.height,0)}_(h,l,null!=r.srcX?r.srcX:0,null!=r.srcY?r.srcY:0,r.srcWidth,r.srcHeight,null!=r.trgX?r.trgX:0,null!=r.trgY?r.trgY:0,r.trgWidth,r.trgHeight);var u=c.toDataURL("image/png");if(null!=o)return o(u,c)})},null!=o&&(l.onerror=o),l.src=t.dataURL}},{key:"processQueue",value:function(){var t=this.options.parallelUploads,e=this.getUploadingFiles().length,i=e;if(!(e>=t)){var n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-e));for(;i<t;){if(!n.length)return;this.processFile(n.shift()),i++}}}}},{key:"processFile",value:function(t){return this.processFiles([t])}},{key:"processFiles",value:function(t){var e,n=h(t,!0);try{for(n.s();!(e=n.n()).done;){var s=e.value;s.processing=!0,s.status=i.UPLOADING,this.emit("processing",s)}}catch(t){n.e(t)}finally{n.f()}return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)}},{key:"_getFilesWithXhr",value:function(t){return this.files.filter(function(e){return e.xhr===t}).map(function(t){return t})}},{key:"cancelUpload",value:function(t){if(t.status===i.UPLOADING){var e,n=this._getFilesWithXhr(t.xhr),s=h(n,!0);try{for(s.s();!(e=s.n()).done;)e.value.status=i.CANCELED}catch(t){s.e(t)}finally{s.f()}void 0!==t.xhr&&t.xhr.abort();var o,r=h(n,!0);try{for(r.s();!(o=r.n()).done;){var a=o.value;this.emit("canceled",a)}}catch(t){r.e(t)}finally{r.f()}this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else t.status!==i.ADDED&&t.status!==i.QUEUED||(t.status=i.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(t){if("function"==typeof t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return t.apply(this,i)}return t}},{key:"uploadFile",value:function(t){return this.uploadFiles([t])}},{key:"uploadFiles",value:function(t){var e=this;this._transformFiles(t,function(n){if(e.options.chunking){var s=n[0];t[0].upload.chunked=e.options.chunking&&(e.options.forceChunking||s.size>e.options.chunkSize),t[0].upload.totalChunkCount=Math.ceil(s.size/e.options.chunkSize)}if(t[0].upload.chunked){var o=t[0],r=n[0];o.upload.chunks=[];var a=function(){for(var n=0;void 0!==o.upload.chunks[n];)n++;if(!(n>=o.upload.totalChunkCount)){var s=n*e.options.chunkSize,a=Math.min(s+e.options.chunkSize,r.size),l={name:e._getParamName(0),data:r.webkitSlice?r.webkitSlice(s,a):r.slice(s,a),filename:o.upload.filename,chunkIndex:n};o.upload.chunks[n]={file:o,index:n,dataBlock:l,status:i.UPLOADING,progress:0,retries:0},e._uploadData(t,[l])}};if(o.upload.finishedChunkUpload=function(n,s){var r=!0;n.status=i.SUCCESS,n.dataBlock=null,n.xhr=null;for(var l=0;l<o.upload.totalChunkCount;l++){if(void 0===o.upload.chunks[l])return a();o.upload.chunks[l].status!==i.SUCCESS&&(r=!1)}r&&e.options.chunksUploaded(o,function(){e._finished(t,s,null)})},e.options.parallelChunkUploads)for(var l=0;l<o.upload.totalChunkCount;l++)a();else a()}else{for(var c=[],h=0;h<t.length;h++)c[h]={name:e._getParamName(h),data:n[h],filename:t[h].upload.filename};e._uploadData(t,c)}})}},{key:"_getChunk",value:function(t,e){for(var i=0;i<t.upload.totalChunkCount;i++)if(void 0!==t.upload.chunks[i]&&t.upload.chunks[i].xhr===e)return t.upload.chunks[i]}},{key:"_uploadData",value:function(t,e){var n,s=this,o=new XMLHttpRequest,r=h(t,!0);try{for(r.s();!(n=r.n()).done;)n.value.xhr=o}catch(t){r.e(t)}finally{r.f()}t[0].upload.chunked&&(t[0].upload.chunks[e[0].chunkIndex].xhr=o);var a=this.resolveOption(this.options.method,t),l=this.resolveOption(this.options.url,t);o.open(a,l,!0),this.resolveOption(this.options.timeout,t)&&(o.timeout=this.resolveOption(this.options.timeout,t)),o.withCredentials=!!this.options.withCredentials,o.onload=function(e){s._finishedUploading(t,o,e)},o.ontimeout=function(){s._handleUploadError(t,o,"Request timedout after ".concat(s.options.timeout/1e3," seconds"))},o.onerror=function(){s._handleUploadError(t,o)},(null!=o.upload?o.upload:o).onprogress=function(e){return s._updateFilesUploadProgress(t,o,e)};var c={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var u in this.options.headers&&i.extend(c,this.options.headers),c){var d=c[u];d&&o.setRequestHeader(u,d)}var f=new FormData;if(this.options.params){var p=this.options.params;for(var m in"function"==typeof p&&(p=p.call(this,t,o,t[0].upload.chunked?this._getChunk(t[0],o):null)),p){var g=p[m];if(Array.isArray(g))for(var v=0;v<g.length;v++)f.append(m,g[v]);else f.append(m,g)}}var y,O=h(t,!0);try{for(O.s();!(y=O.n()).done;){var b=y.value;this.emit("sending",b,o,f)}}catch(t){O.e(t)}finally{O.f()}this.options.uploadMultiple&&this.emit("sendingmultiple",t,o,f),this._addFormElementData(f);for(var x=0;x<e.length;x++){var w=e[x];f.append(w.name,w.data,w.filename)}this.submitRequest(o,f,t)}},{key:"_transformFiles",value:function(t,e){for(var i=this,n=[],s=0,o=function(o){i.options.transformFile.call(i,t[o],function(i){n[o]=i,++s===t.length&&e(n)})},r=0;r<t.length;r++)o(r)}},{key:"_addFormElementData",value:function(t){if("FORM"===this.element.tagName){var e,i=h(this.element.querySelectorAll("input, textarea, select, button"),!0);try{for(i.s();!(e=i.n()).done;){var n=e.value,s=n.getAttribute("name"),o=n.getAttribute("type");if(o&&(o=o.toLowerCase()),null!=s)if("SELECT"===n.tagName&&n.hasAttribute("multiple")){var r,a=h(n.options,!0);try{for(a.s();!(r=a.n()).done;){var l=r.value;l.selected&&t.append(s,l.value)}}catch(t){a.e(t)}finally{a.f()}}else(!o||"checkbox"!==o&&"radio"!==o||n.checked)&&t.append(s,n.value)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"_updateFilesUploadProgress",value:function(t,e,i){if(t[0].upload.chunked){var n=t[0],s=this._getChunk(n,e);i?(s.progress=100*i.loaded/i.total,s.total=i.total,s.bytesSent=i.loaded):(s.progress=100,s.bytesSent=s.total),n.upload.progress=0,n.upload.total=0,n.upload.bytesSent=0;for(var o=0;o<n.upload.totalChunkCount;o++)n.upload.chunks[o]&&void 0!==n.upload.chunks[o].progress&&(n.upload.progress+=n.upload.chunks[o].progress,n.upload.total+=n.upload.chunks[o].total,n.upload.bytesSent+=n.upload.chunks[o].bytesSent);n.upload.progress=n.upload.progress/n.upload.totalChunkCount,this.emit("uploadprogress",n,n.upload.progress,n.upload.bytesSent)}else{var r,a=h(t,!0);try{for(a.s();!(r=a.n()).done;){var l=r.value;l.upload.total&&l.upload.bytesSent&&l.upload.bytesSent==l.upload.total||(i?(l.upload.progress=100*i.loaded/i.total,l.upload.total=i.total,l.upload.bytesSent=i.loaded):(l.upload.progress=100,l.upload.bytesSent=l.upload.total),this.emit("uploadprogress",l,l.upload.progress,l.upload.bytesSent))}}catch(t){a.e(t)}finally{a.f()}}}},{key:"_finishedUploading",value:function(t,e,n){var s;if(t[0].status!==i.CANCELED&&4===e.readyState){if("arraybuffer"!==e.responseType&&"blob"!==e.responseType&&(s=e.responseText,e.getResponseHeader("content-type")&&~e.getResponseHeader("content-type").indexOf("application/json")))try{s=JSON.parse(s)}catch(t){n=t,s="Invalid JSON response from server."}this._updateFilesUploadProgress(t,e),200<=e.status&&e.status<300?t[0].upload.chunked?t[0].upload.finishedChunkUpload(this._getChunk(t[0],e),s):this._finished(t,s,n):this._handleUploadError(t,e,s)}}},{key:"_handleUploadError",value:function(t,e,n){if(t[0].status!==i.CANCELED){if(t[0].upload.chunked&&this.options.retryChunks){var s=this._getChunk(t[0],e);if(s.retries++<this.options.retryChunksLimit)return void this._uploadData(t,[s.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(t,n||this.options.dictResponseError.replace("{{statusCode}}",e.status),e)}}},{key:"submitRequest",value:function(t,e,i){1==t.readyState?t.send(e):console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.")}},{key:"_finished",value:function(t,e,n){var s,o=h(t,!0);try{for(o.s();!(s=o.n()).done;){var r=s.value;r.status=i.SUCCESS,this.emit("success",r,e,n),this.emit("complete",r)}}catch(t){o.e(t)}finally{o.f()}if(this.options.uploadMultiple&&(this.emit("successmultiple",t,e,n),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(t,e,n){var s,o=h(t,!0);try{for(o.s();!(s=o.n()).done;){var r=s.value;r.status=i.ERROR,this.emit("error",r,e,n),this.emit("complete",r)}}catch(t){o.e(t)}finally{o.f()}if(this.options.uploadMultiple&&(this.emit("errormultiple",t,e,n),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"initClass",value:function(){this.prototype.Emitter=o,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];for(var s=0,o=i;s<o.length;s++){var r=o[s];for(var a in r){var l=r[a];t[a]=l}}return t}},{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}}]),i}(o);b.initClass(),b.version="5.9.3",b.options={},b.optionsForElement=function(t){return t.getAttribute("id")?b.options[w(t.getAttribute("id"))]:void 0},b.instances=[],b.forElement=function(t){if("string"==typeof t&&(t=document.querySelector(t)),null==(null!=t?t.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return t.dropzone},b.autoDiscover=!0,b.discover=function(){var t;if(document.querySelectorAll)t=document.querySelectorAll(".dropzone");else{t=[];var e=function(e){return function(){var i,n=[],s=h(e,!0);try{for(s.s();!(i=s.n()).done;){var o=i.value;/(^| )dropzone($| )/.test(o.className)?n.push(t.push(o)):n.push(void 0)}}catch(t){s.e(t)}finally{s.f()}return n}()};e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))}return function(){var e,i=[],n=h(t,!0);try{for(n.s();!(e=n.n()).done;){var s=e.value;!1!==b.optionsForElement(s)?i.push(new b(s)):i.push(void 0)}}catch(t){n.e(t)}finally{n.f()}return i}()},b.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],b.isBrowserSupported=function(){var t=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){void 0!==b.blacklistedBrowsers&&(b.blockedBrowsers=b.blacklistedBrowsers);var e,i=h(b.blockedBrowsers,!0);try{for(i.s();!(e=i.n()).done;)e.value.test(navigator.userAgent)&&(t=!1)}catch(t){i.e(t)}finally{i.f()}}else t=!1;else t=!1;return t},b.dataURItoBlob=function(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),s=new Uint8Array(n),o=0,r=e.length,a=0<=r;a?o<=r:o>=r;a?o++:o--)s[o]=e.charCodeAt(o);return new Blob([n],{type:i})};var x=function(t,e){return t.filter(function(t){return t!==e}).map(function(t){return t})},w=function(t){return t.replace(/[\-_](\w)/g,function(t){return t.charAt(1).toUpperCase()})};b.createElement=function(t){var e=document.createElement("div");return e.innerHTML=t,e.childNodes[0]},b.elementInside=function(t,e){if(t===e)return!0;for(;t=t.parentNode;)if(t===e)return!0;return!1},b.getElement=function(t,e){var i;if("string"==typeof t?i=document.querySelector(t):null!=t.nodeType&&(i=t),null==i)throw new Error("Invalid `".concat(e,"` option provided. Please provide a CSS selector or a plain HTML element."));return i},b.getElements=function(t,e){var i,n;if(t instanceof Array){n=[];try{var s,o=h(t,!0);try{for(o.s();!(s=o.n()).done;)i=s.value,n.push(this.getElement(i,e))}catch(t){o.e(t)}finally{o.f()}}catch(t){n=null}}else if("string"==typeof t){n=[];var r,a=h(document.querySelectorAll(t),!0);try{for(a.s();!(r=a.n()).done;)i=r.value,n.push(i)}catch(t){a.e(t)}finally{a.f()}}else null!=t.nodeType&&(n=[t]);if(null==n||!n.length)throw new Error("Invalid `".concat(e,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return n},b.confirm=function(t,e,i){return window.confirm(t)?e():null!=i?i():void 0},b.isValidFile=function(t,e){if(!e)return!0;e=e.split(",");var i,n=t.type,s=n.replace(/\/.*$/,""),o=h(e,!0);try{for(o.s();!(i=o.n()).done;){var r=i.value;if("."===(r=r.trim()).charAt(0)){if(-1!==t.name.toLowerCase().indexOf(r.toLowerCase(),t.name.length-r.length))return!0}else if(/\/\*$/.test(r)){if(s===r.replace(/\/.*$/,""))return!0}else if(n===r)return!0}}catch(t){o.e(t)}finally{o.f()}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(t){return this.each(function(){return new b(this,t)})}),b.ADDED="added",b.QUEUED="queued",b.ACCEPTED=b.QUEUED,b.UPLOADING="uploading",b.PROCESSING=b.UPLOADING,b.CANCELED="canceled",b.ERROR="error",b.SUCCESS="success";var _=function(t,e,i,n,s,o,r,a,l,c){var h=function(t){t.naturalWidth;var e=t.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=e;var n=i.getContext("2d");n.drawImage(t,0,0);for(var s=n.getImageData(1,0,1,e).data,o=0,r=e,a=e;a>o;)0===s[4*(a-1)+3]?r=a:o=a,a=r+o>>1;var l=a/e;return 0===l?1:l}(e);return t.drawImage(e,i,n,s,o,r,a,l,c/h)},S=function(){function t(){d(this,t)}return p(t,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(t){for(var e="",i=void 0,n=void 0,s="",o=void 0,r=void 0,a=void 0,l="",c=0;o=(i=t[c++])>>2,r=(3&i)<<4|(n=t[c++])>>4,a=(15&n)<<2|(s=t[c++])>>6,l=63&s,isNaN(n)?a=l=64:isNaN(s)&&(l=64),e=e+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),i=n=s="",o=r=a=l="",c<t.length;);return e}},{key:"restore",value:function(t,e){if(!t.match("data:image/jpeg;base64,"))return e;var i=this.decode64(t.replace("data:image/jpeg;base64,","")),n=this.slice2Segments(i),s=this.exifManipulation(e,n);return"data:image/jpeg;base64,".concat(this.encode64(s))}},{key:"exifManipulation",value:function(t,e){var i=this.getExifArray(e),n=this.insertExif(t,i);return new Uint8Array(n)}},{key:"getExifArray",value:function(t){for(var e=void 0,i=0;i<t.length;){if(255===(e=t[i])[0]&225===e[1])return e;i++}return[]}},{key:"insertExif",value:function(t,e){var i=t.replace("data:image/jpeg;base64,",""),n=this.decode64(i),s=n.indexOf(255,3),o=n.slice(0,s),r=n.slice(s),a=o;return a=(a=a.concat(e)).concat(r)}},{key:"slice2Segments",value:function(t){for(var e=0,i=[];!(255===t[e]&218===t[e+1]);){if(255===t[e]&216===t[e+1])e+=2;else{var n=e+(256*t[e+2]+t[e+3])+2,s=t.slice(e,n);i.push(s),e=n}if(e>t.length)break}return i}},{key:"decode64",value:function(t){var e=void 0,i=void 0,n="",s=void 0,o=void 0,r="",a=0,l=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(t)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");e=this.KEY_STR.indexOf(t.charAt(a++))<<2|(s=this.KEY_STR.indexOf(t.charAt(a++)))>>4,i=(15&s)<<4|(o=this.KEY_STR.indexOf(t.charAt(a++)))>>2,n=(3&o)<<6|(r=this.KEY_STR.indexOf(t.charAt(a++))),l.push(e),64!==o&&l.push(i),64!==r&&l.push(n),e=i=n="",s=o=r="",a<t.length;);return l}}]),t}();S.initClass(),b._autoDiscoverFunction=function(){if(b.autoDiscover)return b.discover()},function(t,e){var i=!1,n=!0,s=t.document,o=s.documentElement,r=s.addEventListener?"addEventListener":"attachEvent",a=s.addEventListener?"removeEventListener":"detachEvent",l=s.addEventListener?"":"on",c=function n(o){if("readystatechange"!==o.type||"complete"===s.readyState)return("load"===o.type?t:s)[a](l+o.type,n,!1),!i&&(i=!0)?e.call(t,o.type||o):void 0};if("complete"!==s.readyState){if(s.createEventObject&&o.doScroll){try{n=!t.frameElement}catch(t){}n&&function t(){try{o.doScroll("left")}catch(e){return void setTimeout(t,50)}return c("poll")}()}s[r](l+"DOMContentLoaded",c,!1),s[r](l+"readystatechange",c,!1),t[r](l+"load",c,!1)}}(window,b._autoDiscoverFunction),window.Dropzone=b;var k=b}(),n}()},t.exports=e()},2661:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:e}})=>void 0===e?n.str`must contain at least ${t} valid item(s)`:n.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>void 0===e?n._`{minContains: ${t}}`:n._`{minContains: ${t}, maxContains: ${e}}`},code(t){const{gen:e,schema:i,parentSchema:o,data:r,it:a}=t;let l,c;const{minContains:h,maxContains:u}=o;a.opts.next?(l=void 0===h?1:h,c=u):l=1;const d=e.const("len",n._`${r}.length`);if(t.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,s.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,s.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void t.fail();if((0,s.alwaysValidSchema)(a,i)){let e=n._`${d} >= ${l}`;return void 0!==c&&(e=n._`${e} && ${d} <= ${c}`),void t.pass(e)}a.items=!0;const f=e.name("valid");function p(){const t=e.name("_valid"),i=e.let("count",0);m(t,()=>e.if(t,()=>function(t){e.code(n._`${t}++`),void 0===c?e.if(n._`${t} >= ${l}`,()=>e.assign(f,!0).break()):(e.if(n._`${t} > ${c}`,()=>e.assign(f,!1).break()),1===l?e.assign(f,!0):e.if(n._`${t} >= ${l}`,()=>e.assign(f,!0)))}(i)))}function m(i,n){e.forRange("i",0,d,e=>{t.subschema({keyword:"contains",dataProp:e,dataPropType:s.Type.Num,compositeRule:!0},i),n()})}void 0===c&&1===l?m(f,()=>e.if(f,()=>e.break())):0===l?(e.let(f,!0),void 0!==c&&e.if(n._`${r}.length > 0`,p)):(e.let(f,!1),p()),t.result(f,()=>t.reset())}};e.default=o},3025:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const n=i(9029),s=i(4227),o=i(5765);e.error={message:({params:{property:t,depsCount:e,deps:i}})=>{const s=1===e?"property":"properties";return n.str`must have ${s} ${i} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:i,missingProperty:s}})=>n._`{property: ${t},
69
- missingProperty: ${s},
70
- depsCount: ${e},
71
- deps: ${i}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(t){const[e,i]=function({schema:t}){const e={},i={};for(const n in t){if("__proto__"===n)continue;(Array.isArray(t[n])?e:i)[n]=t[n]}return[e,i]}(t);a(t,e),l(t,i)}};function a(t,e=t.schema){const{gen:i,data:s,it:r}=t;if(0===Object.keys(e).length)return;const a=i.let("missing");for(const l in e){const c=e[l];if(0===c.length)continue;const h=(0,o.propertyInData)(i,s,l,r.opts.ownProperties);t.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),r.allErrors?i.if(h,()=>{for(const e of c)(0,o.checkReportMissingProp)(t,e)}):(i.if(n._`${h} && (${(0,o.checkMissingProp)(t,c,a)})`),(0,o.reportMissingProp)(t,a),i.else())}}function l(t,e=t.schema){const{gen:i,data:n,keyword:r,it:a}=t,l=i.name("valid");for(const c in e)(0,s.alwaysValidSchema)(a,e[c])||(i.if((0,o.propertyInData)(i,n,c,a.opts.ownProperties),()=>{const e=t.subschema({keyword:r,schemaProp:c},l);t.mergeValidEvaluated(e,l)},()=>i.var(l,!0)),t.ok(l))}e.validatePropertyDeps=a,e.validateSchemaDeps=l,e.default=r},3036:t=>{if("undefined"!=typeof Element&&!Element.prototype.matches){var e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},3053:function(t,e){var i;!function(n){"use strict";var s=":not(:disabled):not(.ajs-reset)",o=13,r=27,a=112,l=123,c=37,h=39,u=9,d={autoReset:!0,basic:!1,closable:!0,closableByDimmer:!0,invokeOnCloseOff:!1,frameless:!1,defaultFocusOff:!1,maintainFocus:!0,maximizable:!0,modal:!0,movable:!0,moveBounded:!1,overflow:!0,padding:!0,pinnable:!0,pinned:!0,preventBodyShift:!1,resizable:!0,startMaximized:!1,transition:"pulse",transitionOff:!1,tabbable:["button","[href]","input","select","textarea",'[tabindex]:not([tabindex^="-"])'+s].join(s+","),notifier:{delay:5,position:"bottom-right",closeButton:!1,classes:{base:"alertify-notifier",prefix:"ajs-",message:"ajs-message",top:"ajs-top",right:"ajs-right",bottom:"ajs-bottom",left:"ajs-left",center:"ajs-center",visible:"ajs-visible",hidden:"ajs-hidden",close:"ajs-close"}},glossary:{title:"AlertifyJS",ok:"OK",cancel:"Cancel",acccpt:"Accept",deny:"Deny",confirm:"Confirm",decline:"Decline",close:"Close",maximize:"Maximize",restore:"Restore"},theme:{input:"ajs-input",ok:"ajs-ok",cancel:"ajs-cancel"},hooks:{preinit:function(){},postinit:function(){}}},f=[];function p(t,e){t.className+=" "+e}function m(t,e){for(var i=t.className.split(" "),n=e.split(" "),s=0;s<n.length;s+=1){var o=i.indexOf(n[s]);o>-1&&i.splice(o,1)}t.className=i.join(" ")}function g(){return"rtl"===n.getComputedStyle(document.body).direction}function v(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}function y(){return document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft}function O(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function b(t){return"[object String]"===Object.prototype.toString.call(t)}function x(t){if(null===t)return t;var e;if(Array.isArray(t)){e=[];for(var i=0;i<t.length;i+=1)e.push(x(t[i]));return e}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return(e=new RegExp(t.source)).global=t.global,e.ignoreCase=t.ignoreCase,e.multiline=t.multiline,e.lastIndex=t.lastIndex,e;if("object"==typeof t){for(var n in e={},t)t.hasOwnProperty(n)&&(e[n]=x(t[n]));return e}return t}function w(t,e){if(t.elements){var i=t.elements.root;i.parentNode.removeChild(i),delete t.elements,t.settings=x(t.__settings),t.__init=e,delete t.__internal}}var _=!1;try{var S=Object.defineProperty({},"passive",{get:function(){_=!0}});n.addEventListener("test",S,S),n.removeEventListener("test",S,S)}catch(t){}var k=function(t,e,i,n,s){t.addEventListener(e,i,_?{capture:n,passive:s}:!0===n)},$=function(t,e,i,n,s){t.removeEventListener(e,i,_?{capture:n,passive:s}:!0===n)},T=function(){var t,e,i=!1,n={animation:"animationend",OAnimation:"oAnimationEnd oanimationend",msAnimation:"MSAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in n)if(void 0!==document.documentElement.style[t]){e=n[t],i=!0;break}return{type:e,supported:i}}();function C(t,e){return function(){if(arguments.length>0){for(var i=[],n=0;n<arguments.length;n+=1)i.push(arguments[n]);return i.push(t),e.apply(t,i)}return e.apply(t,[null,t])}}function P(t,e){return{index:t,button:e,cancel:!1}}function E(t,e){if("function"==typeof e.get(t))return e.get(t).call(e)}var A=function(){var t,e,i=[],s=!1,o=n.navigator.userAgent.indexOf("Safari")>-1&&n.navigator.userAgent.indexOf("Chrome")<0,_='<div class="ajs-dimmer"></div>',S='<div class="ajs-modal" tabindex="0"></div>',A='<div class="ajs-dialog" tabindex="0"></div>',M='<button class="ajs-reset"></button>',D='<div class="ajs-commands"><button class="ajs-pin"></button><button class="ajs-maximize"></button><button class="ajs-close"></button></div>',R='<div class="ajs-header"></div>',I='<div class="ajs-body"></div>',L='<div class="ajs-content"></div>',N='<div class="ajs-footer"></div>',j={primary:'<div class="ajs-primary ajs-buttons"></div>',auxiliary:'<div class="ajs-auxiliary ajs-buttons"></div>'},z='<button class="ajs-button"></button>',B='<div class="ajs-handle"></div>',Z="ajs-in",W="ajs-out",F="alertify",X="ajs-basic",q="ajs-capture",H="ajs-closable",V="ajs-fixed",Y="ajs-frameless",U="ajs-hidden",G="ajs-maximized",K="ajs-maximizable",J="ajs-modeless",tt="ajs-movable",et="ajs-no-selection",it="ajs-no-overflow",nt="ajs-no-padding",st="ajs-pinnable",ot="ajs-",rt="ajs-resizable",at="ajs-shake",lt="ajs-unpinned",ct="ajs-no-transition";function ht(t){if(!t.__internal){var e;Q.defaults.hooks.preinit(t),delete t.__init,t.__settings||(t.__settings=x(t.settings)),"function"==typeof t.setup?((e=t.setup()).options=e.options||{},e.focus=e.focus||{}):e={buttons:[],focus:{element:null,select:!1},options:{}},"object"!=typeof t.hooks&&(t.hooks={});var n=[];if(Array.isArray(e.buttons))for(var s=0;s<e.buttons.length;s+=1){var o=e.buttons[s],r={};for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a]);n.push(r)}var l=t.__internal={isOpen:!1,activeElement:document.body,timerIn:void 0,timerOut:void 0,buttons:n,focus:e.focus,options:{title:void 0,modal:void 0,basic:void 0,frameless:void 0,defaultFocusOff:void 0,pinned:void 0,movable:void 0,moveBounded:void 0,resizable:void 0,autoReset:void 0,closable:void 0,closableByDimmer:void 0,invokeOnCloseOff:void 0,maximizable:void 0,startMaximized:void 0,pinnable:void 0,transition:void 0,transitionOff:void 0,padding:void 0,overflow:void 0,onshow:void 0,onclosing:void 0,onclose:void 0,onfocus:void 0,onmove:void 0,onmoved:void 0,onresize:void 0,onresized:void 0,onmaximize:void 0,onmaximized:void 0,onrestore:void 0,onrestored:void 0},resetHandler:void 0,beginMoveHandler:void 0,beginResizeHandler:void 0,bringToFrontHandler:void 0,modalClickHandler:void 0,buttonsClickHandler:void 0,commandsClickHandler:void 0,transitionInHandler:void 0,transitionOutHandler:void 0,destroy:void 0},c={};c.root=document.createElement("div"),c.root.style.display="none",c.root.className=F+" "+U+" ",c.root.innerHTML=_+S,c.dimmer=c.root.firstChild,c.modal=c.root.lastChild,c.modal.innerHTML=A,c.dialog=c.modal.firstChild,c.dialog.innerHTML=M+D+R+I+N+B+M,c.reset=[],c.reset.push(c.dialog.firstChild),c.reset.push(c.dialog.lastChild),c.commands={},c.commands.container=c.reset[0].nextSibling,c.commands.pin=c.commands.container.firstChild,c.commands.maximize=c.commands.pin.nextSibling,c.commands.close=c.commands.maximize.nextSibling,c.header=c.commands.container.nextSibling,c.body=c.header.nextSibling,c.body.innerHTML=L,c.content=c.body.firstChild,c.footer=c.body.nextSibling,c.footer.innerHTML=j.auxiliary+j.primary,c.resizeHandle=c.footer.nextSibling,c.buttons={},c.buttons.auxiliary=c.footer.firstChild,c.buttons.primary=c.buttons.auxiliary.nextSibling,c.buttons.primary.innerHTML=z,c.buttonTemplate=c.buttons.primary.firstChild,c.buttons.primary.removeChild(c.buttonTemplate);for(var h=0;h<t.__internal.buttons.length;h+=1){var u=t.__internal.buttons[h];for(var d in i.indexOf(u.key)<0&&i.push(u.key),u.element=c.buttonTemplate.cloneNode(),u.element.innerHTML=u.text,"string"==typeof u.className&&""!==u.className&&p(u.element,u.className),u.attrs)"className"!==d&&u.attrs.hasOwnProperty(d)&&u.element.setAttribute(d,u.attrs[d]);"auxiliary"===u.scope?c.buttons.auxiliary.appendChild(u.element):c.buttons.primary.appendChild(u.element)}for(var f in t.elements=c,l.resetHandler=C(t,Nt),l.beginMoveHandler=C(t,Jt),l.beginResizeHandler=C(t,le),l.bringToFrontHandler=C(t,gt),l.modalClickHandler=C(t,Et),l.buttonsClickHandler=C(t,Dt),l.commandsClickHandler=C(t,bt),l.transitionInHandler=C(t,Bt),l.transitionOutHandler=C(t,Zt),l.options)void 0!==e.options[f]?t.set(f,e.options[f]):Q.defaults.hasOwnProperty(f)?t.set(f,Q.defaults[f]):"title"===f&&t.set(f,Q.defaults.glossary[f]);"function"==typeof t.build&&t.build(),Q.defaults.hooks.postinit(t)}document.body.appendChild(t.elements.root)}function ut(){n.scrollTo(t,e)}function dt(){for(var t=0,e=0;e<f.length;e+=1){var i=f[e];(i.isModal()||i.isMaximized())&&(t+=1)}0===t&&document.body.className.indexOf(it)>=0?(m(document.body,it),mt(!1)):t>0&&document.body.className.indexOf(it)<0&&(mt(!0),p(document.body,it))}var ft="",pt=0;function mt(t){Q.defaults.preventBodyShift&&(t&&document.documentElement.scrollHeight>document.documentElement.clientHeight?(pt=e,ft=n.getComputedStyle(document.body).top,p(document.body,V),document.body.style.top=-e+"px"):t||(e=pt,document.body.style.top=ft,m(document.body,V),ut()))}function gt(t,e){for(var i=f.indexOf(e)+1;i<f.length;i+=1)if(f[i].isModal())return;return document.body.lastChild!==e.elements.root&&(document.body.appendChild(e.elements.root),f.splice(f.indexOf(e),1),f.push(e),Lt(e)),!1}function vt(t,e,i,n){switch(e){case"title":t.setHeader(n);break;case"modal":!function(t){t.get("modal")?(m(t.elements.root,J),t.isOpen()&&(pe(t),Tt(t),dt())):(p(t.elements.root,J),t.isOpen()&&(fe(t),Tt(t),dt()))}(t);break;case"basic":!function(t){t.get("basic")?p(t.elements.root,X):m(t.elements.root,X)}(t);break;case"frameless":!function(t){t.get("frameless")?p(t.elements.root,Y):m(t.elements.root,Y)}(t);break;case"pinned":!function(t){t.get("pinned")?(m(t.elements.root,lt),t.isOpen()&&$t(t)):(p(t.elements.root,lt),t.isOpen()&&!t.isModal()&&kt(t))}(t);break;case"closable":!function(t){t.get("closable")?(p(t.elements.root,H),function(t){k(t.elements.modal,"click",t.__internal.modalClickHandler)}(t)):(m(t.elements.root,H),function(t){$(t.elements.modal,"click",t.__internal.modalClickHandler)}(t))}(t);break;case"maximizable":!function(t){t.get("maximizable")?p(t.elements.root,K):m(t.elements.root,K)}(t);break;case"pinnable":!function(t){t.get("pinnable")?p(t.elements.root,st):m(t.elements.root,st)}(t);break;case"movable":!function(t){t.get("movable")?(p(t.elements.root,tt),t.isOpen()&&me(t)):(ie(t),m(t.elements.root,tt),t.isOpen()&&ge(t))}(t);break;case"resizable":!function(t){t.get("resizable")?(p(t.elements.root,rt),t.isOpen()&&ve(t)):(ue(t),m(t.elements.root,rt),t.isOpen()&&ye(t))}(t);break;case"padding":n?m(t.elements.root,nt):t.elements.root.className.indexOf(nt)<0&&p(t.elements.root,nt);break;case"overflow":n?m(t.elements.root,it):t.elements.root.className.indexOf(it)<0&&p(t.elements.root,it);break;case"transition":!function(t,e,i){b(i)&&m(t.elements.root,ot+i),p(t.elements.root,ot+e),t.elements.root.offsetWidth}(t,n,i);break;case"transitionOff":!function(t){t.get("transitionOff")?p(t.elements.root,ct):m(t.elements.root,ct)}(t)}"function"==typeof t.hooks.onupdate&&t.hooks.onupdate.call(t,e,i,n)}function yt(t,e,i,n,s){var o,r={op:void 0,items:[]};if(void 0===s&&"string"==typeof n)r.op="get",e.hasOwnProperty(n)?(r.found=!0,r.value=e[n]):(r.found=!1,r.value=void 0);else if(r.op="set","object"==typeof n){var a=n;for(var l in a)e.hasOwnProperty(l)?(e[l]!==a[l]&&(o=e[l],e[l]=a[l],i.call(t,l,o,a[l])),r.items.push({key:l,value:a[l],found:!0})):r.items.push({key:l,value:a[l],found:!1})}else{if("string"!=typeof n)throw new Error("args must be a string or object");e.hasOwnProperty(n)?(e[n]!==s&&(o=e[n],e[n]=s,i.call(t,n,o,s)),r.items.push({key:n,value:s,found:!0})):r.items.push({key:n,value:s,found:!1})}return r}function Ot(t){var e;Qt(t,function(i){return e=!0!==t.get("invokeOnCloseOff")&&!0===i.invokeOnClose}),!e&&t.isOpen()&&t.close()}function bt(t,e){switch(t.srcElement||t.target){case e.elements.commands.pin:e.isPinned()?wt(e):xt(e);break;case e.elements.commands.maximize:e.isMaximized()?St(e):_t(e);break;case e.elements.commands.close:Ot(e)}return!1}function xt(t){t.set("pinned",!0)}function wt(t){t.set("pinned",!1)}function _t(t){E("onmaximize",t),p(t.elements.root,G),t.isOpen()&&dt(),E("onmaximized",t)}function St(t){E("onrestore",t),m(t.elements.root,G),t.isOpen()&&dt(),E("onrestored",t)}function kt(t){var e=y();t.elements.modal.style.marginTop=v()+"px",t.elements.modal.style.marginLeft=e+"px",t.elements.modal.style.marginRight=-e+"px"}function $t(t){var e=parseInt(t.elements.modal.style.marginTop,10),i=parseInt(t.elements.modal.style.marginLeft,10);if(t.elements.modal.style.marginTop="",t.elements.modal.style.marginLeft="",t.elements.modal.style.marginRight="",t.isOpen()){var n=0,s=0;""!==t.elements.dialog.style.top&&(n=parseInt(t.elements.dialog.style.top,10)),t.elements.dialog.style.top=n+(e-v())+"px",""!==t.elements.dialog.style.left&&(s=parseInt(t.elements.dialog.style.left,10)),t.elements.dialog.style.left=s+(i-y())+"px"}}function Tt(t){t.get("modal")||t.get("pinned")?$t(t):kt(t)}var Ct=!1,Pt=0;function Et(t,e){if(t.timeStamp-Pt>200&&(Pt=t.timeStamp)&&!Ct){var i=t.srcElement||t.target;!0===e.get("closableByDimmer")&&i===e.elements.modal&&Ot(e)}Ct=!1}var At=0,Mt=!1;function Qt(t,e){if(Date.now()-At>200&&(At=Date.now()))for(var i=0;i<t.__internal.buttons.length;i+=1){var n=t.__internal.buttons[i];if(!n.element.disabled&&e(n)){var s=P(i,n);"function"==typeof t.callback&&t.callback.apply(t,[s]),!1===s.cancel&&t.close();break}}}function Dt(t,e){var i=t.srcElement||t.target;Qt(e,function(t){return t.element.contains(i)&&(Mt=!0)})}function Rt(t){if(!Mt){var e=f[f.length-1],n=t.keyCode;return 0===e.__internal.buttons.length&&n===r&&!0===e.get("closable")?(Ot(e),!1):i.indexOf(n)>-1?(Qt(e,function(t){return t.key===n}),!1):void 0}Mt=!1}function It(t){var e=f[f.length-1],n=t.keyCode;if(n===c||n===h){for(var s=e.__internal.buttons,o=0;o<s.length;o+=1)if(document.activeElement===s[o].element)switch(n){case c:return void s[(o||s.length)-1].element.focus();case h:return void s[(o+1)%s.length].element.focus()}}else if(n<l+1&&n>a-1&&i.indexOf(n)>-1)return t.preventDefault(),t.stopPropagation(),Qt(e,function(t){return t.key===n}),!1}function Lt(t,e){if(e)e.focus();else{var i=t.__internal.focus,n=i.element;switch(typeof i.element){case"number":t.__internal.buttons.length>i.element&&(n=!0===t.get("basic")?t.elements.reset[0]:t.__internal.buttons[i.element].element);break;case"string":n=t.elements.body.querySelector(i.element);break;case"function":n=i.element.call(t)}(!0===t.get("defaultFocusOff")||null==n&&0===t.__internal.buttons.length)&&(n=t.elements.reset[0]),n&&n.focus&&(n.focus(),i.select&&n.select&&n.select())}}function Nt(t,e){if(!e)for(var i=f.length-1;i>-1;i-=1)if(f[i].isModal()){e=f[i];break}if(e&&e.isModal()){var n,s=e.elements.reset[0],o=e.elements.reset[1],r=t.relatedTarget,a=e.elements.root.contains(r),l=t.srcElement||t.target;if(l===s&&!a||l===o&&r===s)return;l===o||l===document.body?n=s:l===s&&r===o?n=jt(e):l===s&&a&&(n=jt(e,!0)),Lt(e,n)}}function jt(t,e){var i=[].slice.call(t.elements.dialog.querySelectorAll(d.tabbable));e&&i.reverse();for(var n=0;n<i.length;n+=1){var s=i[n];if(s.offsetParent||s.offsetWidth||s.offsetHeight||s.getClientRects().length)return s}}function zt(t){var e=f[f.length-1];e&&t.shiftKey&&t.keyCode===u&&e.elements.reset[1].focus()}function Bt(t,e){clearTimeout(e.__internal.timerIn),Lt(e),Mt=!1,E("onfocus",e),$(e.elements.dialog,T.type,e.__internal.transitionInHandler),m(e.elements.root,Z)}function Zt(t,e){clearTimeout(e.__internal.timerOut),$(e.elements.dialog,T.type,e.__internal.transitionOutHandler),ie(e),ue(e),e.isMaximized()&&!e.get("startMaximized")&&St(e),"function"==typeof e.__internal.destroy&&e.__internal.destroy.apply(e)}var Wt=null,Ft=0,Xt=0,qt="pageX",Ht="pageY",Vt=null,Yt=!1,Ut=null;function Gt(t,e){var i=t[qt]-Ft,n=t[Ht]-Xt;Yt&&(n-=document.body.scrollTop),e.style.left=i+"px",e.style.top=n+"px"}function Kt(t,e){var i=t[qt]-Ft,n=t[Ht]-Xt;Yt&&(n-=document.body.scrollTop),e.style.left=Math.min(Vt.maxLeft,Math.max(Vt.minLeft,i))+"px",e.style.top=Yt?Math.min(Vt.maxTop,Math.max(Vt.minTop,n))+"px":Math.max(Vt.minTop,n)+"px"}function Jt(t,e){if(null===ne&&!e.isMaximized()&&e.get("movable")){var i,n=0,s=0;if("touchstart"===t.type?(t.preventDefault(),i=t.targetTouches[0],qt="clientX",Ht="clientY"):0===t.button&&(i=t),i){var o=e.elements.dialog;if(p(o,q),o.style.left&&(n=parseInt(o.style.left,10)),o.style.top&&(s=parseInt(o.style.top,10)),Ft=i[qt]-n,Xt=i[Ht]-s,e.isModal()?Xt+=e.elements.modal.scrollTop:e.isPinned()&&(Xt-=document.body.scrollTop),e.get("moveBounded")){var r=o,a=-n,l=-s;do{a+=r.offsetLeft,l+=r.offsetTop}while(r=r.offsetParent);Vt={maxLeft:a,minLeft:-a,maxTop:document.documentElement.clientHeight-o.clientHeight-l,minTop:-l},Ut=Kt}else Vt=null,Ut=Gt;return E("onmove",e),Yt=!e.isModal()&&e.isPinned(),Wt=e,Ut(i,o),p(document.body,et),!1}}}function te(t){var e;Wt&&("touchmove"===t.type?(t.preventDefault(),e=t.targetTouches[0]):0===t.button&&(e=t),e&&Ut(e,Wt.elements.dialog))}function ee(){if(Wt){var t=Wt;Wt=Vt=null,m(document.body,et),m(t.elements.dialog,q),E("onmoved",t)}}function ie(t){Wt=null;var e=t.elements.dialog;e.style.left=e.style.top=""}var ne=null,se=Number.Nan,oe=0,re=0,ae=0;function le(t,e){var i;if(!e.isMaximized()&&("touchstart"===t.type?(t.preventDefault(),i=t.targetTouches[0]):0===t.button&&(i=t),i)){E("onresize",e),ne=e,ae=e.elements.resizeHandle.offsetHeight/2;var n=e.elements.dialog;return p(n,q),se=parseInt(n.style.left,10),n.style.height=n.offsetHeight+"px",n.style.minHeight=e.elements.header.offsetHeight+e.elements.footer.offsetHeight+"px",n.style.width=(oe=n.offsetWidth)+"px","none"!==n.style.maxWidth&&(n.style.minWidth=(re=n.offsetWidth)+"px"),n.style.maxWidth="none",p(document.body,et),!1}}function ce(t){var e;ne&&("touchmove"===t.type?(t.preventDefault(),e=t.targetTouches[0]):0===t.button&&(e=t),e&&function(t,e,i){var n,s,o=e,r=0,a=0;do{r+=o.offsetLeft,a+=o.offsetTop}while(o=o.offsetParent);!0===i?(n=t.pageX,s=t.pageY):(n=t.clientX,s=t.clientY);var l=g();if(l&&(n=document.body.offsetWidth-n,isNaN(se)||(r=document.body.offsetWidth-r-e.offsetWidth)),e.style.height=s-a+ae+"px",e.style.width=n-r+ae+"px",!isNaN(se)){var c=.5*Math.abs(e.offsetWidth-oe);l&&(c*=-1),e.offsetWidth>oe?e.style.left=se+c+"px":e.offsetWidth>=re&&(e.style.left=se-c+"px")}}(e,ne.elements.dialog,!ne.get("modal")&&!ne.get("pinned")))}function he(){if(ne){var t=ne;ne=null,m(document.body,et),m(t.elements.dialog,q),Ct=!0,E("onresized",t)}}function ue(t){ne=null;var e=t.elements.dialog;"none"===e.style.maxWidth&&(e.style.maxWidth=e.style.minWidth=e.style.width=e.style.height=e.style.minHeight=e.style.left="",se=Number.Nan,oe=re=ae=0)}function de(){for(var t=0;t<f.length;t+=1){var e=f[t];e.get("autoReset")&&(ie(e),ue(e))}}function fe(t){k(t.elements.dialog,"focus",t.__internal.bringToFrontHandler,!0)}function pe(t){$(t.elements.dialog,"focus",t.__internal.bringToFrontHandler,!0)}function me(t){k(t.elements.header,"mousedown",t.__internal.beginMoveHandler),k(t.elements.header,"touchstart",t.__internal.beginMoveHandler,!1,!1)}function ge(t){$(t.elements.header,"mousedown",t.__internal.beginMoveHandler),$(t.elements.header,"touchstart",t.__internal.beginMoveHandler,!1,!1)}function ve(t){k(t.elements.resizeHandle,"mousedown",t.__internal.beginResizeHandler),k(t.elements.resizeHandle,"touchstart",t.__internal.beginResizeHandler,!1,!1)}function ye(t){$(t.elements.resizeHandle,"mousedown",t.__internal.beginResizeHandler),$(t.elements.resizeHandle,"touchstart",t.__internal.beginResizeHandler,!1,!1)}return{__init:ht,isOpen:function(){return this.__internal.isOpen},isModal:function(){return this.elements.root.className.indexOf(J)<0},isMaximized:function(){return this.elements.root.className.indexOf(G)>-1},isPinned:function(){return this.elements.root.className.indexOf(lt)<0},maximize:function(){return this.isMaximized()||_t(this),this},restore:function(){return this.isMaximized()&&St(this),this},pin:function(){return this.isPinned()||xt(this),this},unpin:function(){return this.isPinned()&&wt(this),this},bringToFront:function(){return gt(0,this),this},moveTo:function(t,e){if(!isNaN(t)&&!isNaN(e)){E("onmove",this);var i=this.elements.dialog,n=i,s=0,o=0;i.style.left&&(s-=parseInt(i.style.left,10)),i.style.top&&(o-=parseInt(i.style.top,10));do{s+=n.offsetLeft,o+=n.offsetTop}while(n=n.offsetParent);var r=t-s,a=e-o;g()&&(r*=-1),i.style.left=r+"px",i.style.top=a+"px",E("onmoved",this)}return this},resizeTo:function(t,e){var i=parseFloat(t),n=parseFloat(e),s=/(\d*\.\d+|\d+)%/;if(!isNaN(i)&&!isNaN(n)&&!0===this.get("resizable")){E("onresize",this),(""+t).match(s)&&(i=i/100*document.documentElement.clientWidth),(""+e).match(s)&&(n=n/100*document.documentElement.clientHeight);var o=this.elements.dialog;"none"!==o.style.maxWidth&&(o.style.minWidth=(re=o.offsetWidth)+"px"),o.style.maxWidth="none",o.style.minHeight=this.elements.header.offsetHeight+this.elements.footer.offsetHeight+"px",o.style.width=i+"px",o.style.height=n+"px",E("onresized",this)}return this},setting:function(t,e){var i=this,n=yt(this,this.__internal.options,function(t,e,n){vt(i,t,e,n)},t,e);if("get"===n.op)return n.found?n.value:void 0!==this.settings?yt(this,this.settings,this.settingUpdated||function(){},t,e).value:void 0;if("set"===n.op){if(n.items.length>0)for(var s=this.settingUpdated||function(){},o=0;o<n.items.length;o+=1){var r=n.items[o];r.found||void 0===this.settings||yt(this,this.settings,s,r.key,r.value)}return this}},set:function(t,e){return this.setting(t,e),this},get:function(t){return this.setting(t)},setHeader:function(t){return b(t)?(O(this.elements.header),this.elements.header.innerHTML=t):t instanceof n.HTMLElement&&this.elements.header.firstChild!==t&&(O(this.elements.header),this.elements.header.appendChild(t)),this},setContent:function(t){return b(t)?(O(this.elements.content),this.elements.content.innerHTML=t):t instanceof n.HTMLElement&&this.elements.content.firstChild!==t&&(O(this.elements.content),this.elements.content.appendChild(t)),this},showModal:function(t){return this.show(!0,t)},show:function(i,r){if(ht(this),this.__internal.isOpen){ie(this),ue(this),p(this.elements.dialog,at);var a=this;setTimeout(function(){m(a.elements.dialog,at)},200)}else{if(this.__internal.isOpen=!0,f.push(this),Q.defaults.maintainFocus&&(this.__internal.activeElement=document.activeElement),document.body.hasAttribute("tabindex")||document.body.setAttribute("tabindex",s="0"),"function"==typeof this.prepare&&this.prepare(),c=this,1===f.length&&(k(n,"resize",de),k(document.body,"keyup",Rt),k(document.body,"keydown",It),k(document.body,"focus",Nt),k(document.documentElement,"mousemove",te),k(document.documentElement,"touchmove",te,!1,!1),k(document.documentElement,"mouseup",ee),k(document.documentElement,"touchend",ee),k(document.documentElement,"mousemove",ce),k(document.documentElement,"touchmove",ce,!1,!1),k(document.documentElement,"mouseup",he),k(document.documentElement,"touchend",he)),k(c.elements.commands.container,"click",c.__internal.commandsClickHandler),k(c.elements.footer,"click",c.__internal.buttonsClickHandler),k(c.elements.reset[0],"focusin",c.__internal.resetHandler),k(c.elements.reset[0],"keydown",zt),k(c.elements.reset[1],"focusin",c.__internal.resetHandler),Mt=!0,k(c.elements.dialog,T.type,c.__internal.transitionInHandler),c.get("modal")||fe(c),c.get("resizable")&&ve(c),c.get("movable")&&me(c),void 0!==i&&this.set("modal",i),t=y(),e=v(),dt(),"string"==typeof r&&""!==r&&(this.__internal.className=r,p(this.elements.root,r)),this.get("startMaximized")?this.maximize():this.isMaximized()&&St(this),Tt(this),this.elements.root.removeAttribute("style"),m(this.elements.root,W),p(this.elements.root,Z),clearTimeout(this.__internal.timerIn),this.__internal.timerIn=setTimeout(this.__internal.transitionInHandler,T.supported?1e3:100),o){var l=this.elements.root;l.style.display="none",setTimeout(function(){l.style.display="block"},0)}this.elements.root.offsetWidth,m(this.elements.root,U),ut(),"function"==typeof this.hooks.onshow&&this.hooks.onshow.call(this),E("onshow",this)}var c;return this},close:function(){var t;return this.__internal.isOpen&&!1!==E("onclosing",this)&&(t=this,1===f.length&&($(n,"resize",de),$(document.body,"keyup",Rt),$(document.body,"keydown",It),$(document.body,"focus",Nt),$(document.documentElement,"mousemove",te),$(document.documentElement,"mouseup",ee),$(document.documentElement,"mousemove",ce),$(document.documentElement,"mouseup",he)),$(t.elements.commands.container,"click",t.__internal.commandsClickHandler),$(t.elements.footer,"click",t.__internal.buttonsClickHandler),$(t.elements.reset[0],"focusin",t.__internal.resetHandler),$(t.elements.reset[0],"keydown",zt),$(t.elements.reset[1],"focusin",t.__internal.resetHandler),k(t.elements.dialog,T.type,t.__internal.transitionOutHandler),t.get("modal")||pe(t),t.get("movable")&&ge(t),t.get("resizable")&&ye(t),m(this.elements.root,Z),p(this.elements.root,W),clearTimeout(this.__internal.timerOut),this.__internal.timerOut=setTimeout(this.__internal.transitionOutHandler,T.supported?1e3:100),p(this.elements.root,U),this.elements.modal.offsetWidth,Q.defaults.maintainFocus&&this.__internal.activeElement&&(this.__internal.activeElement.focus(),this.__internal.activeElement=null),void 0!==this.__internal.className&&""!==this.__internal.className&&m(this.elements.root,this.__internal.className),"function"==typeof this.hooks.onclose&&this.hooks.onclose.call(this),E("onclose",this),f.splice(f.indexOf(this),1),this.__internal.isOpen=!1,dt()),f.length||"0"!==s||document.body.removeAttribute("tabindex"),this},closeOthers:function(){return Q.closeAll(this),this},destroy:function(){return this.__internal&&(this.__internal.isOpen?(this.__internal.destroy=function(){w(this,ht)},this.close()):this.__internal.destroy||w(this,ht)),this}}}(),M=function(){var t,e=[],i=d.notifier.classes,s=i.base;function o(e){e.__internal||(e.__internal={position:Q.defaults.notifier.position,delay:Q.defaults.notifier.delay},t=document.createElement("DIV"),("transitionOff"in d.notifier?d.notifier.transitionOff:d.transitionOff)&&(s=i.base+" ajs-no-transition"),r(e));t.parentNode!==document.body&&document.body.appendChild(t)}function r(e){switch(t.className=s,e.__internal.position){case"top-right":p(t,i.top+" "+i.right);break;case"top-left":p(t,i.top+" "+i.left);break;case"top-center":p(t,i.top+" "+i.center);break;case"bottom-left":p(t,i.bottom+" "+i.left);break;case"bottom-center":p(t,i.bottom+" "+i.center);break;default:p(t,i.bottom+" "+i.right)}}function a(s,o){function r(t,e){e.__internal.closeButton&&"true"!==t.target.getAttribute("data-close")||e.dismiss(!0)}function a(e,i){$(i.element,T.type,a),t.removeChild(i.element)}function l(t){clearTimeout(t.__internal.timer),clearTimeout(t.__internal.transitionTimeout)}return c={element:s,push:function(n,s){if(!this.__internal.pushed){var o,r;switch((a=this).__internal.pushed=!0,e.push(a),l(this),arguments.length){case 0:r=this.__internal.delay;break;case 1:"number"==typeof n?r=n:(o=n,r=this.__internal.delay);break;case 2:o=n,r=s}return this.__internal.closeButton=Q.defaults.notifier.closeButton,void 0!==o&&this.setContent(o),M.__internal.position.indexOf("top")<0?t.appendChild(this.element):t.insertBefore(this.element,t.firstChild),this.element.offsetWidth,p(this.element,i.visible),k(this.element,"click",this.__internal.clickHandler),this.delay(r)}var a;return this},ondismiss:function(){},callback:o,dismiss:function(n){var s;return this.__internal.pushed&&(l(this),"function"==typeof this.ondismiss&&!1===this.ondismiss.call(this)||($(this.element,"click",this.__internal.clickHandler),void 0!==this.element&&this.element.parentNode===t&&(this.__internal.transitionTimeout=setTimeout(this.__internal.transitionEndHandler,T.supported?1e3:100),m(this.element,i.visible),"function"==typeof this.callback&&this.callback.call(this,n)),s=this,e.splice(e.indexOf(s),1),s.__internal.pushed=!1)),this},delay:function(t){if(l(this),this.__internal.delay=void 0===t||isNaN(+t)?M.__internal.delay:+t,this.__internal.delay>0){var e=this;this.__internal.timer=setTimeout(function(){e.dismiss()},1e3*this.__internal.delay)}return this},setContent:function(t){if(b(t)?(O(this.element),this.element.innerHTML=t):t instanceof n.HTMLElement&&this.element.firstChild!==t&&(O(this.element),this.element.appendChild(t)),this.__internal.closeButton){var e=document.createElement("span");p(e,i.close),e.setAttribute("data-close",!0),this.element.appendChild(e)}return this},dismissOthers:function(){return M.dismissAll(this),this}},c.__internal||(c.__internal={pushed:!1,delay:void 0,timer:void 0,clickHandler:void 0,transitionEndHandler:void 0,transitionTimeout:void 0},c.__internal.clickHandler=C(c,r),c.__internal.transitionEndHandler=C(c,a)),c;var c}return{setting:function(t,e){if(o(this),void 0===e)return this.__internal[t];switch(t){case"position":this.__internal.position=e,r(this);break;case"delay":this.__internal.delay=e}return this},set:function(t,e){return this.setting(t,e),this},get:function(t){return this.setting(t)},create:function(t,e){o(this);var n=document.createElement("div");return n.className=i.message+("string"==typeof t&&""!==t?" "+i.prefix+t:""),a(n,e)},dismissAll:function(t){for(var i=e.slice(0),n=0;n<i.length;n+=1){var s=i[n];void 0!==t&&t===s||s.dismiss()}}}}();var Q=new function(){var t={};function e(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function i(e){var i=t[e].dialog;return i&&"function"==typeof i.__init&&i.__init(i),i}return{defaults:d,dialog:function(n,s,o,r){if("function"!=typeof s)return i(n);if(this.hasOwnProperty(n))throw new Error("alertify.dialog: name already exists");var a=function(i,n,s,o){var r={dialog:null,factory:n};return void 0!==o&&(r.factory=function(){return e(new t[o].factory,new n)}),s||(r.dialog=e(new r.factory,A)),t[i]=r}(n,s,o,r);this[n]=o?function(){if(0===arguments.length)return a.dialog;var t=e(new a.factory,A);return t&&"function"==typeof t.__init&&t.__init(t),t.main.apply(t,arguments),t.show.apply(t)}:function(){if(a.dialog&&"function"==typeof a.dialog.__init&&a.dialog.__init(a.dialog),0===arguments.length)return a.dialog;var t=a.dialog;return t.main.apply(a.dialog,arguments),t.show.apply(a.dialog)}},closeAll:function(t){for(var e=f.slice(0),i=0;i<e.length;i+=1){var n=e[i];void 0!==t&&t===n||n.close()}},setting:function(t,e,n){if("notifier"===t)return M.setting(e,n);var s=i(t);return s?s.setting(e,n):void 0},set:function(t,e,i){return this.setting(t,e,i)},get:function(t,e){return this.setting(t,e)},notify:function(t,e,i,n){return M.create(e,n).push(t,i)},message:function(t,e,i){return M.create(null,i).push(t,e)},success:function(t,e,i){return M.create("success",i).push(t,e)},error:function(t,e,i){return M.create("error",i).push(t,e)},warning:function(t,e,i){return M.create("warning",i).push(t,e)},dismissAll:function(){M.dismissAll()}}};Q.dialog("alert",function(){return{main:function(t,e,i){var n,s,o;switch(arguments.length){case 1:s=t;break;case 2:"function"==typeof e?(s=t,o=e):(n=t,s=e);break;case 3:n=t,s=e,o=i}return this.set("title",n),this.set("message",s),this.set("onok",o),this},setup:function(){return{buttons:[{text:Q.defaults.glossary.ok,key:r,invokeOnClose:!0,className:Q.defaults.theme.ok}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(t){this.setContent(t)},settings:{message:void 0,onok:void 0,label:void 0},settingUpdated:function(t,e,i){switch(t){case"message":this.setMessage(i);break;case"label":this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=i)}},callback:function(t){if("function"==typeof this.get("onok")){var e=this.get("onok").call(this,t);void 0!==e&&(t.cancel=!e)}}}}),Q.dialog("confirm",function(){var t={timer:null,index:null,text:null,duration:null,task:function(i,n){if(n.isOpen()){if(n.__internal.buttons[t.index].element.innerHTML=t.text+" (&#8207;"+t.duration+"&#8207;) ",t.duration-=1,-1===t.duration){e(n);var s=n.__internal.buttons[t.index],o=P(t.index,s);"function"==typeof n.callback&&n.callback.apply(n,[o]),!1!==o.close&&n.close()}}else e(n)}};function e(e){null!==t.timer&&(clearInterval(t.timer),t.timer=null,e.__internal.buttons[t.index].element.innerHTML=t.text)}function i(i,n,s){e(i),t.duration=s,t.index=n,t.text=i.__internal.buttons[n].element.innerHTML,t.timer=setInterval(C(i,t.task),1e3),t.task(null,i)}return{main:function(t,e,i,n){var s,o,r,a;switch(arguments.length){case 1:o=t;break;case 2:o=t,r=e;break;case 3:o=t,r=e,a=i;break;case 4:s=t,o=e,r=i,a=n}return this.set("title",s),this.set("message",o),this.set("onok",r),this.set("oncancel",a),this},setup:function(){return{buttons:[{text:Q.defaults.glossary.ok,key:o,className:Q.defaults.theme.ok},{text:Q.defaults.glossary.cancel,key:r,invokeOnClose:!0,className:Q.defaults.theme.cancel}],focus:{element:0,select:!1},options:{maximizable:!1,resizable:!1}}},build:function(){},prepare:function(){},setMessage:function(t){this.setContent(t)},settings:{message:null,labels:null,onok:null,oncancel:null,defaultFocus:null,reverseButtons:null},settingUpdated:function(t,e,i){switch(t){case"message":this.setMessage(i);break;case"labels":"ok"in i&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].text=i.ok,this.__internal.buttons[0].element.innerHTML=i.ok),"cancel"in i&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].text=i.cancel,this.__internal.buttons[1].element.innerHTML=i.cancel);break;case"reverseButtons":!0===i?this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element):this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element);break;case"defaultFocus":this.__internal.focus.element="ok"===i?0:1}},callback:function(t){var i;switch(e(this),t.index){case 0:"function"==typeof this.get("onok")&&void 0!==(i=this.get("onok").call(this,t))&&(t.cancel=!i);break;case 1:"function"==typeof this.get("oncancel")&&void 0!==(i=this.get("oncancel").call(this,t))&&(t.cancel=!i)}},autoOk:function(t){return i(this,0,t),this},autoCancel:function(t){return i(this,1,t),this}}}),Q.dialog("prompt",function(){var t=document.createElement("INPUT"),e=document.createElement("P");return{main:function(t,e,i,n,s){var o,r,a,l,c;switch(arguments.length){case 1:r=t;break;case 2:r=t,a=e;break;case 3:r=t,a=e,l=i;break;case 4:r=t,a=e,l=i,c=n;break;case 5:o=t,r=e,a=i,l=n,c=s}return this.set("title",o),this.set("message",r),this.set("value",a),this.set("onok",l),this.set("oncancel",c),this},setup:function(){return{buttons:[{text:Q.defaults.glossary.ok,key:o,className:Q.defaults.theme.ok},{text:Q.defaults.glossary.cancel,key:r,invokeOnClose:!0,className:Q.defaults.theme.cancel}],focus:{element:t,select:!0},options:{maximizable:!1,resizable:!1}}},build:function(){t.className=Q.defaults.theme.input,t.setAttribute("type","text"),t.value=this.get("value"),this.elements.content.appendChild(e),this.elements.content.appendChild(t)},prepare:function(){},setMessage:function(t){b(t)?(O(e),e.innerHTML=t):t instanceof n.HTMLElement&&e.firstChild!==t&&(O(e),e.appendChild(t))},settings:{message:void 0,labels:void 0,onok:void 0,oncancel:void 0,value:"",type:"text",reverseButtons:void 0},settingUpdated:function(e,i,n){switch(e){case"message":this.setMessage(n);break;case"value":t.value=n;break;case"type":switch(n){case"text":case"color":case"date":case"datetime-local":case"email":case"month":case"number":case"password":case"search":case"tel":case"time":case"week":t.type=n;break;default:t.type="text"}break;case"labels":n.ok&&this.__internal.buttons[0].element&&(this.__internal.buttons[0].element.innerHTML=n.ok),n.cancel&&this.__internal.buttons[1].element&&(this.__internal.buttons[1].element.innerHTML=n.cancel);break;case"reverseButtons":!0===n?this.elements.buttons.primary.appendChild(this.__internal.buttons[0].element):this.elements.buttons.primary.appendChild(this.__internal.buttons[1].element)}},callback:function(e){var i;switch(e.index){case 0:this.settings.value=t.value,"function"==typeof this.get("onok")&&void 0!==(i=this.get("onok").call(this,e,this.settings.value))&&(e.cancel=!i);break;case 1:"function"==typeof this.get("oncancel")&&void 0!==(i=this.get("oncancel").call(this,e))&&(e.cancel=!i),e.cancel||(t.value=this.settings.value)}}}}),"object"==typeof t.exports?t.exports=Q:void 0===(i=function(){return Q}.apply(e,[]))||(t.exports=i)}("undefined"!=typeof window?window:this)},3282:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const n=i(4042),s=i(6144),o=i(6653),r=i(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),s.default.forEach(t=>this.addVocabulary(t)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(r,a):r;this.addMetaSchema(t,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var h=i(2586);Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var u=i(9029);Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=i(3558);Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=i(4551);Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})},3439:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>n.str`must be multiple of ${t}`,params:({schemaCode:t})=>n._`{multipleOf: ${t}}`},code(t){const{gen:e,data:i,schemaCode:s,it:o}=t,r=o.opts.multipleOfPrecision,a=e.let("res"),l=r?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${r}`:n._`${a} !== parseInt(${a})`;t.fail$data(n._`(${s} === 0 || (${a} = ${i}/${s}, ${l}))`)}};e.default=s},3463:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=i},3558:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});class i extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}e.default=i},3662:(t,e,i)=>{var n,s,o;
72
- /*!
73
- * jQuery UI Mouse 1.14.1
74
- * https://jqueryui.com
75
- *
76
- * Copyright OpenJS Foundation and other contributors
77
- * Released under the MIT license.
78
- * https://jquery.org/license
79
- */!function(){"use strict";s=[i(4692),i(6883),i(9139)],void 0===(o="function"==typeof(n=function(t){var e=!1;return t(document).on("mouseup",function(){e=!1}),t.widget("ui.mouse",{version:"1.14.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var n=this,s=1===i.which,o="string"==typeof this.options.cancel&&t(i.target).closest(this.options.cancel).length;return!(s&&!o&&this._mouseCapture(i))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=!1!==this._mouseStart(i),!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return n._mouseMove(t)},this._mouseUpDelegate=function(t){return n._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0))}},_mouseMove:function(t){if(this._mouseMoved&&!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t);return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(i){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,i.target===this._mouseDownEvent.target&&t.data(i.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(i)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,e=!1,i.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?n.apply(e,s):n)||(t.exports=o)}()},3673:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;const n=i(9029),s=i(2023),o=i(5765),r=i(8708);function a(t){const{gen:e,data:i,it:s}=t;e.if(s.parentData,()=>e.assign(i,n._`${s.parentData}[${s.parentDataProperty}]`))}function l(t,e,i){if(void 0===i)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword","function"==typeof i?{ref:i}:{ref:i,code:(0,n.stringify)(i)})}e.macroKeywordCode=function(t,e){const{gen:i,keyword:s,schema:o,parentSchema:r,it:a}=t,c=e.macro.call(a.self,o,r,a),h=l(i,s,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const u=i.name("valid");t.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:h,compositeRule:!0},u),t.pass(u,()=>t.error(!0))},e.funcKeywordCode=function(t,e){var i;const{gen:c,keyword:h,schema:u,parentSchema:d,$data:f,it:p}=t;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(p,e);const m=!f&&e.compile?e.compile.call(p.self,u,d,p):e.validate,g=l(c,h,m),v=c.let("valid");function y(i=(e.async?n._`await `:n.nil)){const r=p.opts.passContext?s.default.this:s.default.self,a=!("compile"in e&&!f||!1===e.schema);c.assign(v,n._`${i}${(0,o.callValidateCode)(t,g,r,a)}`,e.modifying)}function O(t){var i;c.if((0,n.not)(null!==(i=e.valid)&&void 0!==i?i:v),t)}t.block$data(v,function(){if(!1===e.errors)y(),e.modifying&&a(t),O(()=>t.error());else{const i=e.async?function(){const t=c.let("ruleErrs",null);return c.try(()=>y(n._`await `),e=>c.assign(v,!1).if(n._`${e} instanceof ${p.ValidationError}`,()=>c.assign(t,n._`${e}.errors`),()=>c.throw(e))),t}():function(){const t=n._`${g}.errors`;return c.assign(t,null),y(n.nil),t}();e.modifying&&a(t),O(()=>function(t,e){const{gen:i}=t;i.if(n._`Array.isArray(${e})`,()=>{i.assign(s.default.vErrors,n._`${s.default.vErrors} === null ? ${e} : ${s.default.vErrors}.concat(${e})`).assign(s.default.errors,n._`${s.default.vErrors}.length`),(0,r.extendErrors)(t)},()=>t.error())}(t,i))}}),t.ok(null!==(i=e.valid)&&void 0!==i?i:v)},e.validSchemaType=function(t,e,i=!1){return!e.length||e.some(e=>"array"===e?Array.isArray(t):"object"===e?t&&"object"==typeof t&&!Array.isArray(t):typeof t==e||i&&void 0===t)},e.validateKeywordUsage=function({schema:t,opts:e,self:i,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const r=s.dependencies;if(null==r?void 0:r.some(e=>!Object.prototype.hasOwnProperty.call(t,e)))throw new Error(`parent schema must have dependencies of ${o}: ${r.join(",")}`);if(s.validateSchema){if(!s.validateSchema(t[o])){const t=`keyword "${o}" value is invalid at path "${n}": `+i.errorsText(s.validateSchema.errors);if("log"!==e.validateSchema)throw new Error(t);i.logger.error(t)}}}},3693:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;const n=i(4551),s=i(5765),o=i(9029),r=i(2023),a=i(3835),l=i(4227),c={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:i,it:s}=t,{baseId:r,schemaEnv:l,validateName:c,opts:d,self:f}=s,{root:p}=l;if(("#"===i||"#/"===i)&&r===p.baseId)return function(){if(l===p)return u(t,c,l,l.$async);const i=e.scopeValue("root",{ref:p});return u(t,o._`${i}.validate`,p,p.$async)}();const m=a.resolveRef.call(f,p,r,i);if(void 0===m)throw new n.default(s.opts.uriResolver,r,i);return m instanceof a.SchemaEnv?function(e){const i=h(t,e);u(t,i,e,e.$async)}(m):function(n){const s=e.scopeValue("schema",!0===d.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),r=e.name("valid"),a=t.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:i},r);t.mergeEvaluated(a),t.ok(r)}(m)}};function h(t,e){const{gen:i}=t;return e.validate?i.scopeValue("validate",{ref:e.validate}):o._`${i.scopeValue("wrapper",{ref:e})}.validate`}function u(t,e,i,n){const{gen:a,it:c}=t,{allErrors:h,schemaEnv:u,opts:d}=c,f=d.passContext?r.default.this:o.nil;function p(t){const e=o._`${t}.errors`;a.assign(r.default.vErrors,o._`${r.default.vErrors} === null ? ${e} : ${r.default.vErrors}.concat(${e})`),a.assign(r.default.errors,o._`${r.default.vErrors}.length`)}function m(t){var e;if(!c.opts.unevaluated)return;const n=null===(e=null==i?void 0:i.validate)||void 0===e?void 0:e.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=l.mergeEvaluated.props(a,n.props,c.props));else{const e=a.var("props",o._`${t}.evaluated.props`);c.props=l.mergeEvaluated.props(a,e,c.props,o.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=l.mergeEvaluated.items(a,n.items,c.items));else{const e=a.var("items",o._`${t}.evaluated.items`);c.items=l.mergeEvaluated.items(a,e,c.items,o.Name)}}n?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const i=a.let("valid");a.try(()=>{a.code(o._`await ${(0,s.callValidateCode)(t,e,f)}`),m(e),h||a.assign(i,!0)},t=>{a.if(o._`!(${t} instanceof ${c.ValidationError})`,()=>a.throw(t)),p(t),h||a.assign(i,!1)}),t.ok(i)}():t.result((0,s.callValidateCode)(t,e,f),()=>m(e),()=>p(e))}e.getValidate=h,e.callRef=u,e.default=c},3835:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;const n=i(9029),s=i(3558),o=i(2023),r=i(6939),a=i(4227),l=i(2586);class c{constructor(t){var e;let i;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(e=t.baseId)&&void 0!==e?e:(0,r.normalizeId)(null==i?void 0:i[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==i?void 0:i.$async,this.refs={}}}function h(t){const e=d.call(this,t);if(e)return e;const i=(0,r.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:h}=this.opts,u=new n.CodeGen(this.scope,{es5:a,lines:c,ownProperties:h});let f;t.$async&&(f=u.scopeValue("Error",{ref:s.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=u.scopeName("validate");t.validateName=p;const m={gen:u,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:u.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,n.stringify)(t.schema)}:{ref:t.schema}),validateName:p,ValidationError:f,schema:t.schema,schemaEnv:t,rootId:i,baseId:t.baseId||i,schemaPath:n.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(t),(0,l.validateFunctionCode)(m),u.optimize(this.opts.code.optimize);const e=u.toString();g=`${u.scopeRefs(o.default.scope)}return ${e}`,this.opts.code.process&&(g=this.opts.code.process(g,t));const i=new Function(`${o.default.self}`,`${o.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:i}),i.errors=null,i.schema=t.schema,i.schemaEnv=t,t.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:p,validateCode:e,scopeValues:u._values}),this.opts.unevaluated){const{props:t,items:e}=m;i.evaluated={props:t instanceof n.Name?void 0:t,items:e instanceof n.Name?void 0:e,dynamicProps:t instanceof n.Name,dynamicItems:e instanceof n.Name},i.source&&(i.source.evaluated=(0,n.stringify)(i.evaluated))}return t.validate=i,t}catch(e){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),e}finally{this._compilations.delete(t)}}function u(t){return(0,r.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:h.call(this,t)}function d(t){for(const e of this._compilations)if(f(e,t))return e}function f(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function p(t,e){let i;for(;"string"==typeof(i=this.refs[e]);)e=i;return i||this.schemas[e]||m.call(this,t,e)}function m(t,e){const i=this.opts.uriResolver.parse(e),n=(0,r._getFullPath)(this.opts.uriResolver,i);let s=(0,r.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return v.call(this,i,t);const o=(0,r.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const e=m.call(this,t,a);if("object"!=typeof(null==e?void 0:e.schema))return;return v.call(this,i,e)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||h.call(this,a),o===(0,r.normalizeId)(e)){const{schema:e}=a,{schemaId:i}=this.opts,n=e[i];return n&&(s=(0,r.resolveUrl)(this.opts.uriResolver,s,n)),new c({schema:e,schemaId:i,root:t,baseId:s})}return v.call(this,i,a)}}e.SchemaEnv=c,e.compileSchema=h,e.resolveRef=function(t,e,i){var n;i=(0,r.resolveUrl)(this.opts.uriResolver,e,i);const s=t.refs[i];if(s)return s;let o=p.call(this,t,i);if(void 0===o){const s=null===(n=t.localRefs)||void 0===n?void 0:n[i],{schemaId:r}=this.opts;s&&(o=new c({schema:s,schemaId:r,root:t,baseId:e}))}return void 0!==o?t.refs[i]=u.call(this,o):void 0},e.getCompilingSchema=d,e.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v(t,{baseId:e,schema:i,root:n}){var s;if("/"!==(null===(s=t.fragment)||void 0===s?void 0:s[0]))return;for(const n of t.fragment.slice(1).split("/")){if("boolean"==typeof i)return;const t=i[(0,a.unescapeFragment)(n)];if(void 0===t)return;const s="object"==typeof(i=t)&&i[this.opts.schemaId];!g.has(n)&&s&&(e=(0,r.resolveUrl)(this.opts.uriResolver,e,s))}let o;if("boolean"!=typeof i&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const t=(0,r.resolveUrl)(this.opts.uriResolver,e,i.$ref);o=m.call(this,n,t)}const{schemaId:l}=this.opts;return o=o||new c({schema:i,schemaId:l,root:n,baseId:e}),o.schema!==o.root.schema?o:void 0}},3837:t=>{"use strict";t.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3853:(t,e)=>{"use strict";function i(t){const e=t.length;let i,n=0,s=0;for(;s<e;)n++,i=t.charCodeAt(s++),i>=55296&&i<=56319&&s<e&&(i=t.charCodeAt(s),56320==(64512&i)&&s++);return n}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,i.code='require("ajv/dist/runtime/ucs2length").default'},3966:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o=i(5765),r=i(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>n.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>n._`{limit: ${t}}`},code(t){const{schema:e,parentSchema:i,it:n}=t,{prefixItems:a}=i;n.items=!0,(0,s.alwaysValidSchema)(n,e)||(a?(0,r.validateAdditionalItems)(t,a):t.ok((0,o.validateArray)(t)))}};e.default=a},4003:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),s=i(9029),o=i(4227),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>s.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>s._`{missingProperty: ${t}}`},code(t){const{gen:e,schema:i,schemaCode:r,data:a,$data:l,it:c}=t,{opts:h}=c;if(!l&&0===i.length)return;const u=i.length>=h.loopRequired;if(c.allErrors?function(){if(u||l)t.block$data(s.nil,d);else for(const e of i)(0,n.checkReportMissingProp)(t,e)}():function(){const o=e.let("missing");if(u||l){const i=e.let("valid",!0);t.block$data(i,()=>function(i,o){t.setParams({missingProperty:i}),e.forOf(i,r,()=>{e.assign(o,(0,n.propertyInData)(e,a,i,h.ownProperties)),e.if((0,s.not)(o),()=>{t.error(),e.break()})},s.nil)}(o,i)),t.ok(i)}else e.if((0,n.checkMissingProp)(t,i,o)),(0,n.reportMissingProp)(t,o),e.else()}(),h.strictRequired){const e=t.parentSchema.properties,{definedProperties:n}=t.it;for(const t of i)if(void 0===(null==e?void 0:e[t])&&!n.has(t)){const e=`required property "${t}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(c,e,c.opts.strictRequired)}}function d(){e.forOf("prop",r,i=>{t.setParams({missingProperty:i}),e.if((0,n.noPropertyInData)(e,a,i,h.ownProperties),()=>t.error())})}}};e.default=r},4018:(t,e)=>{"use strict";function i(t,e){return{validate:t,compare:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:i(o,r),time:i(l(!0),c),"date-time":i(d(!0),f),"iso-time":i(l(),h),"iso-date-time":i(d(),p),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return m.test(t)&&g.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)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-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(x.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return v.lastIndex=0,v.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=O&&t>=y}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:i(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,r),time:i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),"iso-time":i(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"iso-date-time":i(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,p),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(t){const e=n.exec(t);if(!e)return!1;const i=+e[1],o=+e[2],r=+e[3];return o>=1&&o<=12&&r>=1&&r<=(2===o&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(i)?29:s[o])}function r(t,e){if(t&&e)return t>e?1:t<e?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(t){return function(e){const i=a.exec(e);if(!i)return!1;const n=+i[1],s=+i[2],o=+i[3],r=i[4],l="-"===i[5]?-1:1,c=+(i[6]||0),h=+(i[7]||0);if(c>23||h>59||t&&!r)return!1;if(n<=23&&s<=59&&o<60)return!0;const u=s-h*l,d=n-c*l-(u<0?1:0);return(23===d||-1===d)&&(59===u||-1===u)&&o<61}}function c(t,e){if(!t||!e)return;const i=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();return i&&n?i-n:void 0}function h(t,e){if(!t||!e)return;const i=a.exec(t),n=a.exec(e);return i&&n?(t=i[1]+i[2]+i[3])>(e=n[1]+n[2]+n[3])?1:t<e?-1:0:void 0}const u=/t|\s/i;function d(t){const e=l(t);return function(t){const i=t.split(u);return 2===i.length&&o(i[0])&&e(i[1])}}function f(t,e){if(!t||!e)return;const i=new Date(t).valueOf(),n=new Date(e).valueOf();return i&&n?i-n:void 0}function p(t,e){if(!t||!e)return;const[i,n]=t.split(u),[s,o]=e.split(u),a=r(i,s);return void 0!==a?a||c(n,o):void 0}const m=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;const y=-(2**31),O=2**31-1;function b(){return!0}const x=/[^\\]\\Z/},4042:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=i(2586);Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var s=i(9029);Object.defineProperty(e,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const o=i(3558),r=i(4551),a=i(396),l=i(3835),c=i(9029),h=i(6939),u=i(208),d=i(4227),f=i(3837),p=i(5944),m=(t,e)=>new RegExp(t,e);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},O={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(t){var e,i,n,s,o,r,a,l,c,h,u,d,f,g,v,y,O,b,x,w,_,S,k,$,T;const C=t.strict,P=null===(e=t.code)||void 0===e?void 0:e.optimize,E=!0===P||void 0===P?1:P||0,A=null!==(n=null===(i=t.code)||void 0===i?void 0:i.regExp)&&void 0!==n?n:m,M=null!==(s=t.uriResolver)&&void 0!==s?s:p.default;return{strictSchema:null===(r=null!==(o=t.strictSchema)&&void 0!==o?o:C)||void 0===r||r,strictNumbers:null===(l=null!==(a=t.strictNumbers)&&void 0!==a?a:C)||void 0===l||l,strictTypes:null!==(h=null!==(c=t.strictTypes)&&void 0!==c?c:C)&&void 0!==h?h:"log",strictTuples:null!==(d=null!==(u=t.strictTuples)&&void 0!==u?u:C)&&void 0!==d?d:"log",strictRequired:null!==(g=null!==(f=t.strictRequired)&&void 0!==f?f:C)&&void 0!==g&&g,code:t.code?{...t.code,optimize:E,regExp:A}:{optimize:E,regExp:A},loopRequired:null!==(v=t.loopRequired)&&void 0!==v?v:200,loopEnum:null!==(y=t.loopEnum)&&void 0!==y?y:200,meta:null===(O=t.meta)||void 0===O||O,messages:null===(b=t.messages)||void 0===b||b,inlineRefs:null===(x=t.inlineRefs)||void 0===x||x,schemaId:null!==(w=t.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(_=t.addUsedSchema)||void 0===_||_,validateSchema:null===(S=t.validateSchema)||void 0===S||S,validateFormats:null===(k=t.validateFormats)||void 0===k||k,unicodeRegExp:null===($=t.unicodeRegExp)||void 0===$||$,int32range:null===(T=t.int32range)||void 0===T||T,uriResolver:M}}class x{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...b(t)};const{es5:e,lines:i}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:v,es5:e,lines:i}),this.logger=function(t){if(!1===t)return C;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}(t.logger);const n=t.validateFormats;t.validateFormats=!1,this.RULES=(0,a.getRules)(),w.call(this,y,t,"NOT SUPPORTED"),w.call(this,O,t,"DEPRECATED","warn"),this._metaOpts=T.call(this),t.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&$.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),S.call(this),t.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:e,schemaId:i}=this.opts;let n=f;"id"===i&&(n={...f},n.id=n.$id,delete n.$id),e&&t&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){const{meta:t,schemaId:e}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[e]||t:void 0}validate(t,e){let i;if("string"==typeof t){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);const n=i(e);return"$async"in i||(this.errors=i.errors),n}compile(t,e){const i=this._addSchema(t,e);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,e){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:i}=this.opts;return n.call(this,t,e);async function n(t,e){await s.call(this,t.$schema);const i=this._addSchema(t,e);return i.validate||o.call(this,i)}async function s(t){t&&!this.getSchema(t)&&await n.call(this,{$ref:t},!0)}async function o(t){try{return this._compileSchemaEnv(t)}catch(e){if(!(e instanceof r.default))throw e;return a.call(this,e),await l.call(this,e.missingSchema),o.call(this,t)}}function a({missingSchema:t,missingRef:e}){if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${e} cannot be resolved`)}async function l(t){const i=await c.call(this,t);this.refs[t]||await s.call(this,i.$schema),this.refs[t]||this.addSchema(i,t,e)}async function c(t){const e=this._loading[t];if(e)return e;try{return await(this._loading[t]=i(t))}finally{delete this._loading[t]}}}addSchema(t,e,i,n=this.opts.validateSchema){if(Array.isArray(t)){for(const e of t)this.addSchema(e,void 0,i,n);return this}let s;if("object"==typeof t){const{schemaId:e}=this.opts;if(s=t[e],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${e} must be string`)}return e=(0,h.normalizeId)(e||s),this._checkUnique(e),this.schemas[e]=this._addSchema(t,i,e,n,!0),this}addMetaSchema(t,e,i=this.opts.validateSchema){return this.addSchema(t,e,!0,i),this}validateSchema(t,e){if("boolean"==typeof t)return!0;let i;if(i=t.$schema,void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(i,t);if(!n&&e){const t="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(t);this.logger.error(t)}return n}getSchema(t){let e;for(;"string"==typeof(e=_.call(this,t));)t=e;if(void 0===e){const{schemaId:i}=this.opts,n=new l.SchemaEnv({schema:{},schemaId:i});if(e=l.resolveSchema.call(this,n,t),!e)return;this.refs[t]=e}return e.validate||this._compileSchemaEnv(e)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const e=_.call(this,t);return"object"==typeof e&&this._cache.delete(e.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{const e=t;this._cache.delete(e);let i=t[this.opts.schemaId];return i&&(i=(0,h.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const e of t)this.addKeyword(e);return this}addKeyword(t,e){let i;if("string"==typeof t)i=t,"object"==typeof e&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),e.keyword=i);else{if("object"!=typeof t||void 0!==e)throw new Error("invalid addKeywords parameters");if(i=(e=t).keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(E.call(this,i,e),!e)return(0,d.eachItem)(i,t=>A.call(this,t)),this;Q.call(this,e);const n={...e,type:(0,u.getJSONTypes)(e.type),schemaType:(0,u.getJSONTypes)(e.schemaType)};return(0,d.eachItem)(i,0===n.type.length?t=>A.call(this,t,n):t=>n.type.forEach(e=>A.call(this,t,n,e))),this}getKeyword(t){const e=this.RULES.all[t];return"object"==typeof e?e.definition:!!e}removeKeyword(t){const{RULES:e}=this;delete e.keywords[t],delete e.all[t];for(const i of e.rules){const e=i.rules.findIndex(e=>e.keyword===t);e>=0&&i.rules.splice(e,1)}return this}addFormat(t,e){return"string"==typeof e&&(e=new RegExp(e)),this.formats[t]=e,this}errorsText(t=this.errors,{separator:e=", ",dataVar:i="data"}={}){return t&&0!==t.length?t.map(t=>`${i}${t.instancePath} ${t.message}`).reduce((t,i)=>t+e+i):"No errors"}$dataMetaSchema(t,e){const i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const n of e){const e=n.split("/").slice(1);let s=t;for(const t of e)s=s[t];for(const t in i){const e=i[t];if("object"!=typeof e)continue;const{$data:n}=e.definition,o=s[t];n&&o&&(s[t]=R(o))}}return t}_removeAllSchemas(t,e){for(const i in t){const n=t[i];e&&!e.test(i)||("string"==typeof n?delete t[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[i]))}}_addSchema(t,e,i,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o;const{schemaId:r}=this.opts;if("object"==typeof t)o=t[r];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof t)throw new Error("schema must be object or boolean")}let a=this._cache.get(t);if(void 0!==a)return a;i=(0,h.normalizeId)(o||i);const c=h.getSchemaRefs.call(this,t,i);return a=new l.SchemaEnv({schema:t,schemaId:r,meta:e,baseId:i,localRefs:c}),this._cache.set(a.schema,a),s&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=a),n&&this.validateSchema(t,!0),a}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):l.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const e=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,t)}finally{this.opts=e}}}function w(t,e,i,n="error"){for(const s in t){const o=s;o in e&&this.logger[n](`${i}: option ${s}. ${t[o]}`)}}function _(t){return t=(0,h.normalizeId)(t),this.schemas[t]||this.refs[t]}function S(){const t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}function k(){for(const t in this.opts.formats){const e=this.opts.formats[t];e&&this.addFormat(t,e)}}function $(t){if(Array.isArray(t))this.addVocabulary(t);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const i=t[e];i.keyword||(i.keyword=e),this.addKeyword(i)}}}function T(){const t={...this.opts};for(const e of g)delete t[e];return t}x.ValidationError=o.default,x.MissingRefError=r.default,e.default=x;const C={log(){},warn(){},error(){}};const P=/^[a-z_$][a-z0-9_$:-]*$/i;function E(t,e){const{RULES:i}=this;if((0,d.eachItem)(t,t=>{if(i.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!P.test(t))throw new Error(`Keyword ${t} has invalid name`)}),e&&e.$data&&!("code"in e)&&!("validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function A(t,e,i){var n;const s=null==e?void 0:e.post;if(i&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let r=s?o.post:o.rules.find(({type:t})=>t===i);if(r||(r={type:i,rules:[]},o.rules.push(r)),o.keywords[t]=!0,!e)return;const a={keyword:t,definition:{...e,type:(0,u.getJSONTypes)(e.type),schemaType:(0,u.getJSONTypes)(e.schemaType)}};e.before?M.call(this,r,a,e.before):r.rules.push(a),o.all[t]=a,null===(n=e.implements)||void 0===n||n.forEach(t=>this.addKeyword(t))}function M(t,e,i){const n=t.rules.findIndex(t=>t.keyword===i);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${i} is not defined`))}function Q(t){let{metaSchema:e}=t;void 0!==e&&(t.$data&&this.opts.$data&&(e=R(e)),t.validateSchema=this.compile(e,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function R(t){return{anyOf:[t,D]}}},4224:(t,e,i)=>{var n,s,o;
80
- /*!
81
- * jQuery UI Position 1.14.1
82
- * https://jqueryui.com
83
- *
84
- * Copyright OpenJS Foundation and other contributors
85
- * Released under the MIT license.
86
- * https://jquery.org/license
87
- *
88
- * https://api.jqueryui.com/position/
89
- */!function(){"use strict";s=[i(4692),i(6883)],n=function(t){return function(){var e,i=Math.max,n=Math.abs,s=/left|center|right/,o=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,c=t.fn.position;function h(t,e,i){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?i/100:1)]}function u(e,i){return parseInt(t.css(e,i),10)||0}function d(t){return null!=t&&t===t.window}function f(t){var e=t[0];return 9===e.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:d(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}t.position={scrollbarWidth:function(){if(void 0!==e)return e;var i,n,s=t("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),i=o.offsetWidth,s.css("overflow","scroll"),i===(n=o.offsetWidth)&&(n=s[0].clientWidth),s.remove(),e=i-n},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),n=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),s="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:s?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),n=d(i[0]),s=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:s,offset:!n&&!s?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return c.apply(this,arguments);var l,d,p,m,g,v,y="string"==typeof(e=t.extend({},e)).of?t(document).find(e.of):t(e.of),O=t.position.getWithinInfo(e.within),b=t.position.getScrollInfo(O),x=(e.collision||"flip").split(" "),w={};return v=f(y),y[0].preventDefault&&(e.at="left top"),d=v.width,p=v.height,m=v.offset,g=t.extend({},m),t.each(["my","at"],function(){var t,i,n=(e[this]||"").split(" ");1===n.length&&(n=s.test(n[0])?n.concat(["center"]):o.test(n[0])?["center"].concat(n):["center","center"]),n[0]=s.test(n[0])?n[0]:"center",n[1]=o.test(n[1])?n[1]:"center",t=r.exec(n[0]),i=r.exec(n[1]),w[this]=[t?t[0]:0,i?i[0]:0],e[this]=[a.exec(n[0])[0],a.exec(n[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?g.left+=d:"center"===e.at[0]&&(g.left+=d/2),"bottom"===e.at[1]?g.top+=p:"center"===e.at[1]&&(g.top+=p/2),l=h(w.at,d,p),g.left+=l[0],g.top+=l[1],this.each(function(){var s,o,r=t(this),a=r.outerWidth(),c=r.outerHeight(),f=u(this,"marginLeft"),v=u(this,"marginTop"),_=a+f+u(this,"marginRight")+b.width,S=c+v+u(this,"marginBottom")+b.height,k=t.extend({},g),$=h(w.my,r.outerWidth(),r.outerHeight());"right"===e.my[0]?k.left-=a:"center"===e.my[0]&&(k.left-=a/2),"bottom"===e.my[1]?k.top-=c:"center"===e.my[1]&&(k.top-=c/2),k.left+=$[0],k.top+=$[1],s={marginLeft:f,marginTop:v},t.each(["left","top"],function(i,n){t.ui.position[x[i]]&&t.ui.position[x[i]][n](k,{targetWidth:d,targetHeight:p,elemWidth:a,elemHeight:c,collisionPosition:s,collisionWidth:_,collisionHeight:S,offset:[l[0]+$[0],l[1]+$[1]],my:e.my,at:e.at,within:O,elem:r})}),e.using&&(o=function(t){var s=m.left-k.left,o=s+d-a,l=m.top-k.top,h=l+p-c,u={target:{element:y,left:m.left,top:m.top,width:d,height:p},element:{element:r,left:k.left,top:k.top,width:a,height:c},horizontal:o<0?"left":s>0?"right":"center",vertical:h<0?"top":l>0?"bottom":"middle"};d<a&&n(s+o)<d&&(u.horizontal="center"),p<c&&n(l+h)<p&&(u.vertical="middle"),i(n(s),n(o))>i(n(l),n(h))?u.important="horizontal":u.important="vertical",e.using.call(this,t,u)}),r.offset(t.extend(k,{using:o}))})},t.ui.position={fit:{left:function(t,e){var n,s=e.within,o=s.isWindow?s.scrollLeft:s.offset.left,r=s.width,a=t.left-e.collisionPosition.marginLeft,l=o-a,c=a+e.collisionWidth-r-o;e.collisionWidth>r?l>0&&c<=0?(n=t.left+l+e.collisionWidth-r-o,t.left+=l-n):t.left=c>0&&l<=0?o:l>c?o+r-e.collisionWidth:o:l>0?t.left+=l:c>0?t.left-=c:t.left=i(t.left-a,t.left)},top:function(t,e){var n,s=e.within,o=s.isWindow?s.scrollTop:s.offset.top,r=e.within.height,a=t.top-e.collisionPosition.marginTop,l=o-a,c=a+e.collisionHeight-r-o;e.collisionHeight>r?l>0&&c<=0?(n=t.top+l+e.collisionHeight-r-o,t.top+=l-n):t.top=c>0&&l<=0?o:l>c?o+r-e.collisionHeight:o:l>0?t.top+=l:c>0?t.top-=c:t.top=i(t.top-a,t.top)}},flip:{left:function(t,e){var i,s,o=e.within,r=o.offset.left+o.scrollLeft,a=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,c=t.left-e.collisionPosition.marginLeft,h=c-l,u=c+e.collisionWidth-a-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];h<0?((i=t.left+d+f+p+e.collisionWidth-a-r)<0||i<n(h))&&(t.left+=d+f+p):u>0&&((s=t.left-e.collisionPosition.marginLeft+d+f+p-l)>0||n(s)<u)&&(t.left+=d+f+p)},top:function(t,e){var i,s,o=e.within,r=o.offset.top+o.scrollTop,a=o.height,l=o.isWindow?o.scrollTop:o.offset.top,c=t.top-e.collisionPosition.marginTop,h=c-l,u=c+e.collisionHeight-a-l,d="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,p=-2*e.offset[1];h<0?((s=t.top+d+f+p+e.collisionHeight-a-r)<0||s<n(h))&&(t.top+=d+f+p):u>0&&((i=t.top-e.collisionPosition.marginTop+d+f+p-l)>0||n(i)<u)&&(t.top+=d+f+p)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position},void 0===(o="function"==typeof n?n.apply(e,s):n)||(t.exports=o)}()},4227:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const n=i(9029),s=i(1520);function o(t,e=t.schema){const{opts:i,self:n}=t;if(!i.strictSchema)return;if("boolean"==typeof e)return;const s=n.RULES.keywords;for(const i in e)s[i]||p(t,`unknown keyword: "${i}"`)}function r(t,e){if("boolean"==typeof t)return!t;for(const i in t)if(e[i])return!0;return!1}function a(t){return"number"==typeof t?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}function l(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:t,mergeToName:e,mergeValues:i,resultToName:s}){return(o,r,a,l)=>{const c=void 0===a?r:a instanceof n.Name?(r instanceof n.Name?t(o,r,a):e(o,r,a),a):r instanceof n.Name?(e(o,a,r),r):i(r,a);return l!==n.Name||c instanceof n.Name?c:s(o,c)}}function h(t,e){if(!0===e)return t.var("props",!0);const i=t.var("props",n._`{}`);return void 0!==e&&u(t,i,e),i}function u(t,e,i){Object.keys(i).forEach(i=>t.assign(n._`${e}${(0,n.getProperty)(i)}`,!0))}e.toHash=function(t){const e={};for(const i of t)e[i]=!0;return e},e.alwaysValidSchema=function(t,e){return"boolean"==typeof e?e:0===Object.keys(e).length||(o(t,e),!r(e,t.self.RULES.all))},e.checkUnknownRules=o,e.schemaHasRules=r,e.schemaHasRulesButRef=function(t,e){if("boolean"==typeof t)return!t;for(const i in t)if("$ref"!==i&&e.all[i])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:t,schemaPath:e},i,s,o){if(!o){if("number"==typeof i||"boolean"==typeof i)return i;if("string"==typeof i)return n._`${i}`}return n._`${t}${e}${(0,n.getProperty)(s)}`},e.unescapeFragment=function(t){return l(decodeURIComponent(t))},e.escapeFragment=function(t){return encodeURIComponent(a(t))},e.escapeJsonPointer=a,e.unescapeJsonPointer=l,e.eachItem=function(t,e){if(Array.isArray(t))for(const i of t)e(i);else e(t)},e.mergeEvaluated={props:c({mergeNames:(t,e,i)=>t.if(n._`${i} !== true && ${e} !== undefined`,()=>{t.if(n._`${e} === true`,()=>t.assign(i,!0),()=>t.assign(i,n._`${i} || {}`).code(n._`Object.assign(${i}, ${e})`))}),mergeToName:(t,e,i)=>t.if(n._`${i} !== true`,()=>{!0===e?t.assign(i,!0):(t.assign(i,n._`${i} || {}`),u(t,i,e))}),mergeValues:(t,e)=>!0===t||{...t,...e},resultToName:h}),items:c({mergeNames:(t,e,i)=>t.if(n._`${i} !== true && ${e} !== undefined`,()=>t.assign(i,n._`${e} === true ? true : ${i} > ${e} ? ${i} : ${e}`)),mergeToName:(t,e,i)=>t.if(n._`${i} !== true`,()=>t.assign(i,!0===e||n._`${i} > ${e} ? ${i} : ${e}`)),mergeValues:(t,e)=>!0===t||Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})},e.evaluatedPropsToName=h,e.setEvaluated=u;const d={};var f;function p(t,e,i=t.opts.strictSchema){if(i){if(e=`strict mode: ${e}`,!0===i)throw new Error(e);t.self.logger.warn(e)}}e.useFunc=function(t,e){return t.scopeValue("func",{ref:e,code:d[e.code]||(d[e.code]=new s._Code(e.code))})},function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"}(f||(e.Type=f={})),e.getErrorPath=function(t,e,i){if(t instanceof n.Name){const s=e===f.Num;return i?s?n._`"[" + ${t} + "]"`:n._`"['" + ${t} + "']"`:s?n._`"/" + ${t}`:n._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return i?(0,n.getProperty)(t).toString():"/"+a(t)},e.checkStrictMode=p},4426:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4227),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:i}){void 0===e.if&&(0,n.checkStrictMode)(i,`"${t}" without "if" is ignored`)}};e.default=s},4486:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const i="maxProperties"===t?"more":"fewer";return n.str`must NOT have ${i} than ${e} properties`},params:({schemaCode:t})=>n._`{limit: ${t}}`},code(t){const{keyword:e,data:i,schemaCode:s}=t,o="maxProperties"===e?n.operators.GT:n.operators.LT;t.fail$data(n._`Object.keys(${i}).length ${o} ${s}`)}};e.default=s},4495:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;const n=i(9029),s=i(4227);e.getSubschema=function(t,{keyword:e,schemaProp:i,schema:o,schemaPath:r,errSchemaPath:a,topSchemaRef:l}){if(void 0!==e&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==e){const o=t.schema[e];return void 0===i?{schema:o,schemaPath:n._`${t.schemaPath}${(0,n.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:o[i],schemaPath:n._`${t.schemaPath}${(0,n.getProperty)(e)}${(0,n.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,s.escapeFragment)(i)}`}}if(void 0!==o){if(void 0===r||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:r,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(t,e,{dataProp:i,dataPropType:o,data:r,dataTypes:a,propertyName:l}){if(void 0!==r&&void 0!==i)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=e;if(void 0!==i){const{errorPath:r,dataPathArr:a,opts:l}=e;h(c.let("data",n._`${e.data}${(0,n.getProperty)(i)}`,!0)),t.errorPath=n.str`${r}${(0,s.getErrorPath)(i,o,l.jsPropertySyntax)}`,t.parentDataProperty=n._`${i}`,t.dataPathArr=[...a,t.parentDataProperty]}if(void 0!==r){h(r instanceof n.Name?r:c.let("data",r,!0)),void 0!==l&&(t.propertyName=l)}function h(i){t.data=i,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,i]}a&&(t.dataTypes=a)},e.extendSubschemaMode=function(t,{jtdDiscriminator:e,jtdMetadata:i,compositeRule:n,createErrors:s,allErrors:o}){void 0!==n&&(t.compositeRule=n),void 0!==s&&(t.createErrors=s),void 0!==o&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=i}},4551:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(6939);class s extends Error{constructor(t,e,i,s){super(s||`can't resolve reference ${i} from id ${e}`),this.missingRef=(0,n.resolveUrl)(t,e,i),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(t,this.missingRef))}}e.default=s},4692:function(t,e){var i;
90
- /*!
91
- * jQuery JavaScript Library v3.7.1
92
- * https://jquery.com/
93
- *
94
- * Copyright OpenJS Foundation and other contributors
95
- * Released under the MIT license
96
- * https://jquery.org/license
97
- *
98
- * Date: 2023-08-28T13:37Z
99
- */!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,function(n,s){"use strict";var o=[],r=Object.getPrototypeOf,a=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},c=o.push,h=o.indexOf,u={},d=u.toString,f=u.hasOwnProperty,p=f.toString,m=p.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},O=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,i){var n,s,o=(i=i||O).createElement("script");if(o.text=t,e)for(n in b)(s=e[n]||e.getAttribute&&e.getAttribute(n))&&o.setAttribute(n,s);i.head.appendChild(o).parentNode.removeChild(o)}function w(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[d.call(t)]||"object":typeof t}var _="3.7.1",S=/HTML$/i,k=function(t,e){return new k.fn.init(t,e)};function $(t){var e=!!t&&"length"in t&&t.length,i=w(t);return!v(t)&&!y(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}k.fn=k.prototype={jquery:_,constructor:k,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=k.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return k.each(this,t)},map:function(t){return this.pushStack(k.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(k.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:o.sort,splice:o.splice},k.extend=k.fn.extend=function(){var t,e,i,n,s,o,r=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof r&&(c=r,r=arguments[a]||{},a++),"object"==typeof r||v(r)||(r={}),a===l&&(r=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)n=t[e],"__proto__"!==e&&r!==n&&(c&&n&&(k.isPlainObject(n)||(s=Array.isArray(n)))?(i=r[e],o=s&&!Array.isArray(i)?[]:s||k.isPlainObject(i)?i:{},s=!1,r[e]=k.extend(c,o,n)):void 0!==n&&(r[e]=n));return r},k.extend({expando:"jQuery"+(_+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==d.call(t))&&(!(e=r(t))||"function"==typeof(i=f.call(e,"constructor")&&e.constructor)&&p.call(i)===m)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){x(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,n=0;if($(t))for(i=t.length;n<i&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},text:function(t){var e,i="",n=0,s=t.nodeType;if(!s)for(;e=t[n++];)i+=k.text(e);return 1===s||11===s?t.textContent:9===s?t.documentElement.textContent:3===s||4===s?t.nodeValue:i},makeArray:function(t,e){var i=e||[];return null!=t&&($(Object(t))?k.merge(i,"string"==typeof t?[t]:t):c.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:h.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!S.test(e||i&&i.nodeName||"HTML")},merge:function(t,e){for(var i=+e.length,n=0,s=t.length;n<i;n++)t[s++]=e[n];return t.length=s,t},grep:function(t,e,i){for(var n=[],s=0,o=t.length,r=!i;s<o;s++)!e(t[s],s)!==r&&n.push(t[s]);return n},map:function(t,e,i){var n,s,o=0,r=[];if($(t))for(n=t.length;o<n;o++)null!=(s=e(t[o],o,i))&&r.push(s);else for(o in t)null!=(s=e(t[o],o,i))&&r.push(s);return l(r)},guid:1,support:g}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=o[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){u["[object "+e+"]"]=e.toLowerCase()});var C=o.pop,P=o.sort,E=o.splice,A="[\\x20\\t\\r\\n\\f]",M=new RegExp("^"+A+"+|((?:^|[^\\\\])(?:\\\\.)*)"+A+"+$","g");k.contains=function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))};var Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function D(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}k.escapeSelector=function(t){return(t+"").replace(Q,D)};var R=O,I=c;!function(){var t,e,i,s,r,l,c,u,d,p,m=I,v=k.expando,y=0,O=0,b=tt(),x=tt(),w=tt(),_=tt(),S=function(t,e){return t===e&&(r=!0),0},$="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",Q="(?:\\\\[\\da-fA-F]{1,6}"+A+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",D="\\["+A+"*("+Q+")(?:"+A+"*([*^$|!~]?=)"+A+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+Q+"))|)"+A+"*\\]",L=":("+Q+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+D+")*)|.*)\\)|)",N=new RegExp(A+"+","g"),j=new RegExp("^"+A+"*,"+A+"*"),z=new RegExp("^"+A+"*([>+~]|"+A+")"+A+"*"),B=new RegExp(A+"|>"),Z=new RegExp(L),W=new RegExp("^"+Q+"$"),F={ID:new RegExp("^#("+Q+")"),CLASS:new RegExp("^\\.("+Q+")"),TAG:new RegExp("^("+Q+"|[*])"),ATTR:new RegExp("^"+D),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),bool:new RegExp("^(?:"+$+")$","i"),needsContext:new RegExp("^"+A+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+A+"*((?:-\\d)?\\d*)"+A+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,H=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,V=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+A+"?|\\\\([^\\r\\n\\f])","g"),U=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},G=function(){lt()},K=dt(function(t){return!0===t.disabled&&T(t,"fieldset")},{dir:"parentNode",next:"legend"});try{m.apply(o=a.call(R.childNodes),R.childNodes),o[R.childNodes.length].nodeType}catch(t){m={apply:function(t,e){I.apply(t,a.call(e))},call:function(t){I.apply(t,a.call(arguments,1))}}}function J(t,e,i,n){var s,o,r,a,c,h,f,p=e&&e.ownerDocument,y=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return i;if(!n&&(lt(e),e=e||l,u)){if(11!==y&&(c=H.exec(t)))if(s=c[1]){if(9===y){if(!(r=e.getElementById(s)))return i;if(r.id===s)return m.call(i,r),i}else if(p&&(r=p.getElementById(s))&&J.contains(e,r)&&r.id===s)return m.call(i,r),i}else{if(c[2])return m.apply(i,e.getElementsByTagName(t)),i;if((s=c[3])&&e.getElementsByClassName)return m.apply(i,e.getElementsByClassName(s)),i}if(!(_[t+" "]||d&&d.test(t))){if(f=t,p=e,1===y&&(B.test(t)||z.test(t))){for((p=V.test(t)&&at(e.parentNode)||e)==e&&g.scope||((a=e.getAttribute("id"))?a=k.escapeSelector(a):e.setAttribute("id",a=v)),o=(h=ht(t)).length;o--;)h[o]=(a?"#"+a:":scope")+" "+ut(h[o]);f=h.join(",")}try{return m.apply(i,p.querySelectorAll(f)),i}catch(e){_(t,!0)}finally{a===v&&e.removeAttribute("id")}}}return yt(t.replace(M,"$1"),e,i,n)}function tt(){var t=[];return function i(n,s){return t.push(n+" ")>e.cacheLength&&delete i[t.shift()],i[n+" "]=s}}function et(t){return t[v]=!0,t}function it(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return T(e,"input")&&e.type===t}}function st(t){return function(e){return(T(e,"input")||T(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&K(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function rt(t){return et(function(e){return e=+e,et(function(i,n){for(var s,o=t([],i.length,e),r=o.length;r--;)i[s=o[r]]&&(i[s]=!(n[s]=i[s]))})})}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var i,n=t?t.ownerDocument||t:R;return n!=l&&9===n.nodeType&&n.documentElement?(c=(l=n).documentElement,u=!k.isXMLDoc(l),p=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&R!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",G),g.getById=it(function(t){return c.appendChild(t).id=k.expando,!l.getElementsByName||!l.getElementsByName(k.expando).length}),g.disconnectedMatch=it(function(t){return p.call(t,"*")}),g.scope=it(function(){return l.querySelectorAll(":scope")}),g.cssHas=it(function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}}),g.getById?(e.filter.ID=function(t){var e=t.replace(Y,U);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i=e.getElementById(t);return i?[i]:[]}}):(e.filter.ID=function(t){var e=t.replace(Y,U);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i,n,s,o=e.getElementById(t);if(o){if((i=o.getAttributeNode("id"))&&i.value===t)return[o];for(s=e.getElementsByName(t),n=0;o=s[n++];)if((i=o.getAttributeNode("id"))&&i.value===t)return[o]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&u)return e.getElementsByClassName(t)},d=[],it(function(t){var e;c.appendChild(t).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+A+"*(?:value|"+$+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+A+"*name"+A+"*="+A+"*(?:''|\"\")")}),g.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),S=function(t,e){if(t===e)return r=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===i?t===l||t.ownerDocument==R&&J.contains(R,t)?-1:e===l||e.ownerDocument==R&&J.contains(R,e)?1:s?h.call(s,t)-h.call(s,e):0:4&i?-1:1)},l):l}for(t in J.matches=function(t,e){return J(t,null,null,e)},J.matchesSelector=function(t,e){if(lt(t),u&&!_[e+" "]&&(!d||!d.test(e)))try{var i=p.call(t,e);if(i||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){_(e,!0)}return J(e,l,null,[t]).length>0},J.contains=function(t,e){return(t.ownerDocument||t)!=l&&lt(t),k.contains(t,e)},J.attr=function(t,i){(t.ownerDocument||t)!=l&&lt(t);var n=e.attrHandle[i.toLowerCase()],s=n&&f.call(e.attrHandle,i.toLowerCase())?n(t,i,!u):void 0;return void 0!==s?s:t.getAttribute(i)},J.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},k.uniqueSort=function(t){var e,i=[],n=0,o=0;if(r=!g.sortStable,s=!g.sortStable&&a.call(t,0),P.call(t,S),r){for(;e=t[o++];)e===t[o]&&(n=i.push(o));for(;n--;)E.call(t,i[n],1)}return s=null,t},k.fn.uniqueSort=function(){return this.pushStack(k.uniqueSort(a.apply(this)))},e=k.expr={cacheLength:50,createPseudo:et,match:F,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Y,U),t[3]=(t[3]||t[4]||t[5]||"").replace(Y,U),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||J.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&J.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return F.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&Z.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Y,U).toLowerCase();return"*"===t?function(){return!0}:function(t){return T(t,e)}},CLASS:function(t){var e=b[t+" "];return e||(e=new RegExp("(^|"+A+")"+t+"("+A+"|$)"))&&b(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,i){return function(n){var s=J.attr(n,t);return null==s?"!="===e:!e||(s+="","="===e?s===i:"!="===e?s!==i:"^="===e?i&&0===s.indexOf(i):"*="===e?i&&s.indexOf(i)>-1:"$="===e?i&&s.slice(-i.length)===i:"~="===e?(" "+s.replace(N," ")+" ").indexOf(i)>-1:"|="===e&&(s===i||s.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,s){var o="nth"!==t.slice(0,3),r="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===s?function(t){return!!t.parentNode}:function(e,i,l){var c,h,u,d,f,p=o!==r?"nextSibling":"previousSibling",m=e.parentNode,g=a&&e.nodeName.toLowerCase(),O=!l&&!a,b=!1;if(m){if(o){for(;p;){for(u=e;u=u[p];)if(a?T(u,g):1===u.nodeType)return!1;f=p="only"===t&&!f&&"nextSibling"}return!0}if(f=[r?m.firstChild:m.lastChild],r&&O){for(b=(d=(c=(h=m[v]||(m[v]={}))[t]||[])[0]===y&&c[1])&&c[2],u=d&&m.childNodes[d];u=++d&&u&&u[p]||(b=d=0)||f.pop();)if(1===u.nodeType&&++b&&u===e){h[t]=[y,d,b];break}}else if(O&&(b=d=(c=(h=e[v]||(e[v]={}))[t]||[])[0]===y&&c[1]),!1===b)for(;(u=++d&&u&&u[p]||(b=d=0)||f.pop())&&(!(a?T(u,g):1===u.nodeType)||!++b||(O&&((h=u[v]||(u[v]={}))[t]=[y,b]),u!==e)););return(b-=s)===n||b%n===0&&b/n>=0}}},PSEUDO:function(t,i){var n,s=e.pseudos[t]||e.setFilters[t.toLowerCase()]||J.error("unsupported pseudo: "+t);return s[v]?s(i):s.length>1?(n=[t,t,"",i],e.setFilters.hasOwnProperty(t.toLowerCase())?et(function(t,e){for(var n,o=s(t,i),r=o.length;r--;)t[n=h.call(t,o[r])]=!(e[n]=o[r])}):function(t){return s(t,0,n)}):s}},pseudos:{not:et(function(t){var e=[],i=[],n=vt(t.replace(M,"$1"));return n[v]?et(function(t,e,i,s){for(var o,r=n(t,null,s,[]),a=t.length;a--;)(o=r[a])&&(t[a]=!(e[a]=o))}):function(t,s,o){return e[0]=t,n(e,null,o,i),e[0]=null,!i.pop()}}),has:et(function(t){return function(e){return J(t,e).length>0}}),contains:et(function(t){return t=t.replace(Y,U),function(e){return(e.textContent||k.text(e)).indexOf(t)>-1}}),lang:et(function(t){return W.test(t||"")||J.error("unsupported lang: "+t),t=t.replace(Y,U).toLowerCase(),function(e){var i;do{if(i=u?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(t){var e=n.location&&n.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return T(t,"input")&&!!t.checked||T(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return q.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){return T(t,"input")&&"button"===t.type||T(t,"button")},text:function(t){var e;return T(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:rt(function(){return[0]}),last:rt(function(t,e){return[e-1]}),eq:rt(function(t,e,i){return[i<0?i+e:i]}),even:rt(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:rt(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:rt(function(t,e,i){var n;for(n=i<0?i+e:i>e?e:i;--n>=0;)t.push(n);return t}),gt:rt(function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t})}},e.pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=nt(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=st(t);function ct(){}function ht(t,i){var n,s,o,r,a,l,c,h=x[t+" "];if(h)return i?0:h.slice(0);for(a=t,l=[],c=e.preFilter;a;){for(r in n&&!(s=j.exec(a))||(s&&(a=a.slice(s[0].length)||a),l.push(o=[])),n=!1,(s=z.exec(a))&&(n=s.shift(),o.push({value:n,type:s[0].replace(M," ")}),a=a.slice(n.length)),e.filter)!(s=F[r].exec(a))||c[r]&&!(s=c[r](s))||(n=s.shift(),o.push({value:n,type:r,matches:s}),a=a.slice(n.length));if(!n)break}return i?a.length:a?J.error(t):x(t,l).slice(0)}function ut(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function dt(t,e,i){var n=e.dir,s=e.next,o=s||n,r=i&&"parentNode"===o,a=O++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||r)return t(e,i,s);return!1}:function(e,i,l){var c,h,u=[y,a];if(l){for(;e=e[n];)if((1===e.nodeType||r)&&t(e,i,l))return!0}else for(;e=e[n];)if(1===e.nodeType||r)if(h=e[v]||(e[v]={}),s&&T(e,s))e=e[n]||e;else{if((c=h[o])&&c[0]===y&&c[1]===a)return u[2]=c[2];if(h[o]=u,u[2]=t(e,i,l))return!0}return!1}}function ft(t){return t.length>1?function(e,i,n){for(var s=t.length;s--;)if(!t[s](e,i,n))return!1;return!0}:t[0]}function pt(t,e,i,n,s){for(var o,r=[],a=0,l=t.length,c=null!=e;a<l;a++)(o=t[a])&&(i&&!i(o,n,s)||(r.push(o),c&&e.push(a)));return r}function mt(t,e,i,n,s,o){return n&&!n[v]&&(n=mt(n)),s&&!s[v]&&(s=mt(s,o)),et(function(o,r,a,l){var c,u,d,f,p=[],g=[],v=r.length,y=o||function(t,e,i){for(var n=0,s=e.length;n<s;n++)J(t,e[n],i);return i}(e||"*",a.nodeType?[a]:a,[]),O=!t||!o&&e?y:pt(y,p,t,a,l);if(i?i(O,f=s||(o?t:v||n)?[]:r,a,l):f=O,n)for(c=pt(f,g),n(c,[],a,l),u=c.length;u--;)(d=c[u])&&(f[g[u]]=!(O[g[u]]=d));if(o){if(s||t){if(s){for(c=[],u=f.length;u--;)(d=f[u])&&c.push(O[u]=d);s(null,f=[],c,l)}for(u=f.length;u--;)(d=f[u])&&(c=s?h.call(o,d):p[u])>-1&&(o[c]=!(r[c]=d))}}else f=pt(f===r?f.splice(v,f.length):f),s?s(null,r,f,l):m.apply(r,f)})}function gt(t){for(var n,s,o,r=t.length,a=e.relative[t[0].type],l=a||e.relative[" "],c=a?1:0,u=dt(function(t){return t===n},l,!0),d=dt(function(t){return h.call(n,t)>-1},l,!0),f=[function(t,e,s){var o=!a&&(s||e!=i)||((n=e).nodeType?u(t,e,s):d(t,e,s));return n=null,o}];c<r;c++)if(s=e.relative[t[c].type])f=[dt(ft(f),s)];else{if((s=e.filter[t[c].type].apply(null,t[c].matches))[v]){for(o=++c;o<r&&!e.relative[t[o].type];o++);return mt(c>1&&ft(f),c>1&&ut(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(M,"$1"),s,c<o&&gt(t.slice(c,o)),o<r&&gt(t=t.slice(o)),o<r&&ut(t))}f.push(s)}return ft(f)}function vt(t,n){var s,o=[],r=[],a=w[t+" "];if(!a){for(n||(n=ht(t)),s=n.length;s--;)(a=gt(n[s]))[v]?o.push(a):r.push(a);a=w(t,function(t,n){var s=n.length>0,o=t.length>0,r=function(r,a,c,h,d){var f,p,g,v=0,O="0",b=r&&[],x=[],w=i,_=r||o&&e.find.TAG("*",d),S=y+=null==w?1:Math.random()||.1,$=_.length;for(d&&(i=a==l||a||d);O!==$&&null!=(f=_[O]);O++){if(o&&f){for(p=0,a||f.ownerDocument==l||(lt(f),c=!u);g=t[p++];)if(g(f,a||l,c)){m.call(h,f);break}d&&(y=S)}s&&((f=!g&&f)&&v--,r&&b.push(f))}if(v+=O,s&&O!==v){for(p=0;g=n[p++];)g(b,x,a,c);if(r){if(v>0)for(;O--;)b[O]||x[O]||(x[O]=C.call(h));x=pt(x)}m.apply(h,x),d&&!r&&x.length>0&&v+n.length>1&&k.uniqueSort(h)}return d&&(y=S,i=w),b};return s?et(r):r}(r,o)),a.selector=t}return a}function yt(t,i,n,s){var o,r,a,l,c,h="function"==typeof t&&t,d=!s&&ht(t=h.selector||t);if(n=n||[],1===d.length){if((r=d[0]=d[0].slice(0)).length>2&&"ID"===(a=r[0]).type&&9===i.nodeType&&u&&e.relative[r[1].type]){if(!(i=(e.find.ID(a.matches[0].replace(Y,U),i)||[])[0]))return n;h&&(i=i.parentNode),t=t.slice(r.shift().value.length)}for(o=F.needsContext.test(t)?0:r.length;o--&&(a=r[o],!e.relative[l=a.type]);)if((c=e.find[l])&&(s=c(a.matches[0].replace(Y,U),V.test(r[0].type)&&at(i.parentNode)||i))){if(r.splice(o,1),!(t=s.length&&ut(r)))return m.apply(n,s),n;break}}return(h||vt(t,d))(s,i,!u,n,!i||V.test(t)&&at(i.parentNode)||i),n}ct.prototype=e.filters=e.pseudos,e.setFilters=new ct,g.sortStable=v.split("").sort(S).join("")===v,lt(),g.sortDetached=it(function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))}),k.find=J,k.expr[":"]=k.expr.pseudos,k.unique=k.uniqueSort,J.compile=vt,J.select=yt,J.setDocument=lt,J.tokenize=ht,J.escape=k.escapeSelector,J.getText=k.text,J.isXML=k.isXMLDoc,J.selectors=k.expr,J.support=k.support,J.uniqueSort=k.uniqueSort}();var L=function(t,e,i){for(var n=[],s=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&k(t).is(i))break;n.push(t)}return n},N=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},j=k.expr.match.needsContext,z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function B(t,e,i){return v(e)?k.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?k.grep(t,function(t){return t===e!==i}):"string"!=typeof e?k.grep(t,function(t){return h.call(e,t)>-1!==i}):k.filter(e,t,i)}k.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?k.find.matchesSelector(n,t)?[n]:[]:k.find.matches(t,k.grep(e,function(t){return 1===t.nodeType}))},k.fn.extend({find:function(t){var e,i,n=this.length,s=this;if("string"!=typeof t)return this.pushStack(k(t).filter(function(){for(e=0;e<n;e++)if(k.contains(s[e],this))return!0}));for(i=this.pushStack([]),e=0;e<n;e++)k.find(t,s[e],i);return n>1?k.uniqueSort(i):i},filter:function(t){return this.pushStack(B(this,t||[],!1))},not:function(t){return this.pushStack(B(this,t||[],!0))},is:function(t){return!!B(this,"string"==typeof t&&j.test(t)?k(t):t||[],!1).length}});var Z,W=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(t,e,i){var n,s;if(!t)return this;if(i=i||Z,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:W.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof k?e[0]:e,k.merge(this,k.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:O,!0)),z.test(n[1])&&k.isPlainObject(e))for(n in e)v(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(s=O.getElementById(n[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(k):k.makeArray(t,this)}).prototype=k.fn,Z=k(O);var F=/^(?:parents|prev(?:Until|All))/,X={children:!0,contents:!0,next:!0,prev:!0};function q(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}k.fn.extend({has:function(t){var e=k(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(k.contains(this,e[t]))return!0})},closest:function(t,e){var i,n=0,s=this.length,o=[],r="string"!=typeof t&&k(t);if(!j.test(t))for(;n<s;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(r?r.index(i)>-1:1===i.nodeType&&k.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?k.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?h.call(k(t),this[0]):h.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),k.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return L(t,"parentNode")},parentsUntil:function(t,e,i){return L(t,"parentNode",i)},next:function(t){return q(t,"nextSibling")},prev:function(t){return q(t,"previousSibling")},nextAll:function(t){return L(t,"nextSibling")},prevAll:function(t){return L(t,"previousSibling")},nextUntil:function(t,e,i){return L(t,"nextSibling",i)},prevUntil:function(t,e,i){return L(t,"previousSibling",i)},siblings:function(t){return N((t.parentNode||{}).firstChild,t)},children:function(t){return N(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(T(t,"template")&&(t=t.content||t),k.merge([],t.childNodes))}},function(t,e){k.fn[t]=function(i,n){var s=k.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=k.filter(n,s)),this.length>1&&(X[t]||k.uniqueSort(s),F.test(t)&&s.reverse()),this.pushStack(s)}});var H=/[^\x20\t\r\n\f]+/g;function V(t){return t}function Y(t){throw t}function U(t,e,i,n){var s;try{t&&v(s=t.promise)?s.call(t).done(e).fail(i):t&&v(s=t.then)?s.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}k.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return k.each(t.match(H)||[],function(t,i){e[i]=!0}),e}(t):k.extend({},t);var e,i,n,s,o=[],r=[],a=-1,l=function(){for(s=s||t.once,n=e=!0;r.length;a=-1)for(i=r.shift();++a<o.length;)!1===o[a].apply(i[0],i[1])&&t.stopOnFalse&&(a=o.length,i=!1);t.memory||(i=!1),e=!1,s&&(o=i?[]:"")},c={add:function(){return o&&(i&&!e&&(a=o.length-1,r.push(i)),function e(i){k.each(i,function(i,n){v(n)?t.unique&&c.has(n)||o.push(n):n&&n.length&&"string"!==w(n)&&e(n)})}(arguments),i&&!e&&l()),this},remove:function(){return k.each(arguments,function(t,e){for(var i;(i=k.inArray(e,o,i))>-1;)o.splice(i,1),i<=a&&a--}),this},has:function(t){return t?k.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return s=r=[],o=i="",this},disabled:function(){return!o},lock:function(){return s=r=[],i||e||(o=i=""),this},locked:function(){return!!s},fireWith:function(t,i){return s||(i=[t,(i=i||[]).slice?i.slice():i],r.push(i),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},k.extend({Deferred:function(t){var e=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",s={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return k.Deferred(function(i){k.each(e,function(e,n){var s=v(t[n[4]])&&t[n[4]];o[n[1]](function(){var t=s&&s.apply(this,arguments);t&&v(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,s?[t]:arguments)})}),t=null}).promise()},then:function(t,i,s){var o=0;function r(t,e,i,s){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(t<o)){if((n=i.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,v(c)?s?c.call(n,r(o,e,V,s),r(o,e,Y,s)):(o++,c.call(n,r(o,e,V,s),r(o,e,Y,s),r(o,e,V,e.notifyWith))):(i!==V&&(a=void 0,l=[n]),(s||e.resolveWith)(a,l))}},h=s?c:function(){try{c()}catch(n){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(n,h.error),t+1>=o&&(i!==Y&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?h():(k.Deferred.getErrorHook?h.error=k.Deferred.getErrorHook():k.Deferred.getStackHook&&(h.error=k.Deferred.getStackHook()),n.setTimeout(h))}}return k.Deferred(function(n){e[0][3].add(r(0,n,v(s)?s:V,n.notifyWith)),e[1][3].add(r(0,n,v(t)?t:V)),e[2][3].add(r(0,n,v(i)?i:Y))}).promise()},promise:function(t){return null!=t?k.extend(t,s):s}},o={};return k.each(e,function(t,n){var r=n[2],a=n[5];s[n[1]]=r.add,a&&r.add(function(){i=a},e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),r.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=r.fireWith}),s.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,i=e,n=Array(i),s=a.call(arguments),o=k.Deferred(),r=function(t){return function(i){n[t]=this,s[t]=arguments.length>1?a.call(arguments):i,--e||o.resolveWith(n,s)}};if(e<=1&&(U(t,o.done(r(i)).resolve,o.reject,!e),"pending"===o.state()||v(s[i]&&s[i].then)))return o.then();for(;i--;)U(s[i],r(i),o.reject);return o.promise()}});var G=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&G.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},k.readyException=function(t){n.setTimeout(function(){throw t})};var K=k.Deferred();function J(){O.removeEventListener("DOMContentLoaded",J),n.removeEventListener("load",J),k.ready()}k.fn.ready=function(t){return K.then(t).catch(function(t){k.readyException(t)}),this},k.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==t&&--k.readyWait>0||K.resolveWith(O,[k]))}}),k.ready.then=K.then,"complete"===O.readyState||"loading"!==O.readyState&&!O.documentElement.doScroll?n.setTimeout(k.ready):(O.addEventListener("DOMContentLoaded",J),n.addEventListener("load",J));var tt=function(t,e,i,n,s,o,r){var a=0,l=t.length,c=null==i;if("object"===w(i))for(a in s=!0,i)tt(t,e,a,i[a],!0,o,r);else if(void 0!==n&&(s=!0,v(n)||(r=!0),c&&(r?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(k(t),i)})),e))for(;a<l;a++)e(t[a],i,r?n:n.call(t[a],a,e(t[a],i)));return s?t:c?e.call(t):l?e(t[0],i):o},et=/^-ms-/,it=/-([a-z])/g;function nt(t,e){return e.toUpperCase()}function st(t){return t.replace(et,"ms-").replace(it,nt)}var ot=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function rt(){this.expando=k.expando+rt.uid++}rt.uid=1,rt.prototype={cache:function(t){var e=t[this.expando];return e||(e={},ot(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,s=this.cache(t);if("string"==typeof e)s[st(e)]=i;else for(n in e)s[st(n)]=e[n];return s},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][st(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){i=(e=Array.isArray(e)?e.map(st):(e=st(e))in n?[e]:e.match(H)||[]).length;for(;i--;)delete n[e[i]]}(void 0===e||k.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!k.isEmptyObject(e)}};var at=new rt,lt=new rt,ct=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ht=/[A-Z]/g;function ut(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(ht,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:ct.test(t)?JSON.parse(t):t)}(i)}catch(t){}lt.set(t,e,i)}else i=void 0;return i}k.extend({hasData:function(t){return lt.hasData(t)||at.hasData(t)},data:function(t,e,i){return lt.access(t,e,i)},removeData:function(t,e){lt.remove(t,e)},_data:function(t,e,i){return at.access(t,e,i)},_removeData:function(t,e){at.remove(t,e)}}),k.fn.extend({data:function(t,e){var i,n,s,o=this[0],r=o&&o.attributes;if(void 0===t){if(this.length&&(s=lt.get(o),1===o.nodeType&&!at.get(o,"hasDataAttrs"))){for(i=r.length;i--;)r[i]&&0===(n=r[i].name).indexOf("data-")&&(n=st(n.slice(5)),ut(o,n,s[n]));at.set(o,"hasDataAttrs",!0)}return s}return"object"==typeof t?this.each(function(){lt.set(this,t)}):tt(this,function(e){var i;if(o&&void 0===e)return void 0!==(i=lt.get(o,t))||void 0!==(i=ut(o,t))?i:void 0;this.each(function(){lt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){lt.remove(this,t)})}}),k.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=at.get(t,e),i&&(!n||Array.isArray(i)?n=at.access(t,e,k.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=k.queue(t,e),n=i.length,s=i.shift(),o=k._queueHooks(t,e);"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===e&&i.unshift("inprogress"),delete o.stop,s.call(t,function(){k.dequeue(t,e)},o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return at.get(t,i)||at.access(t,i,{empty:k.Callbacks("once memory").add(function(){at.remove(t,[e+"queue",i])})})}}),k.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?k.queue(this[0],t):void 0===e?this:this.each(function(){var i=k.queue(this,t,e);k._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&k.dequeue(this,t)})},dequeue:function(t){return this.each(function(){k.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,s=k.Deferred(),o=this,r=this.length,a=function(){--n||s.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";r--;)(i=at.get(o[r],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(a));return a(),s.promise(e)}});var dt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ft=new RegExp("^(?:([+-])=|)("+dt+")([a-z%]*)$","i"),pt=["Top","Right","Bottom","Left"],mt=O.documentElement,gt=function(t){return k.contains(t.ownerDocument,t)},vt={composed:!0};mt.getRootNode&&(gt=function(t){return k.contains(t.ownerDocument,t)||t.getRootNode(vt)===t.ownerDocument});var yt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&gt(t)&&"none"===k.css(t,"display")};function Ot(t,e,i,n){var s,o,r=20,a=n?function(){return n.cur()}:function(){return k.css(t,e,"")},l=a(),c=i&&i[3]||(k.cssNumber[e]?"":"px"),h=t.nodeType&&(k.cssNumber[e]||"px"!==c&&+l)&&ft.exec(k.css(t,e));if(h&&h[3]!==c){for(l/=2,c=c||h[3],h=+l||1;r--;)k.style(t,e,h+c),(1-o)*(1-(o=a()/l||.5))<=0&&(r=0),h/=o;h*=2,k.style(t,e,h+c),i=i||[]}return i&&(h=+h||+l||0,s=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=h,n.end=s)),s}var bt={};function xt(t){var e,i=t.ownerDocument,n=t.nodeName,s=bt[n];return s||(e=i.body.appendChild(i.createElement(n)),s=k.css(e,"display"),e.parentNode.removeChild(e),"none"===s&&(s="block"),bt[n]=s,s)}function wt(t,e){for(var i,n,s=[],o=0,r=t.length;o<r;o++)(n=t[o]).style&&(i=n.style.display,e?("none"===i&&(s[o]=at.get(n,"display")||null,s[o]||(n.style.display="")),""===n.style.display&&yt(n)&&(s[o]=xt(n))):"none"!==i&&(s[o]="none",at.set(n,"display",i)));for(o=0;o<r;o++)null!=s[o]&&(t[o].style.display=s[o]);return t}k.fn.extend({show:function(){return wt(this,!0)},hide:function(){return wt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){yt(this)?k(this).show():k(this).hide()})}});var _t,St,kt=/^(?:checkbox|radio)$/i,$t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Tt=/^$|^module$|\/(?:java|ecma)script/i;_t=O.createDocumentFragment().appendChild(O.createElement("div")),(St=O.createElement("input")).setAttribute("type","radio"),St.setAttribute("checked","checked"),St.setAttribute("name","t"),_t.appendChild(St),g.checkClone=_t.cloneNode(!0).cloneNode(!0).lastChild.checked,_t.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!_t.cloneNode(!0).lastChild.defaultValue,_t.innerHTML="<option></option>",g.option=!!_t.lastChild;var Ct={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Pt(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&T(t,e)?k.merge([t],i):i}function Et(t,e){for(var i=0,n=t.length;i<n;i++)at.set(t[i],"globalEval",!e||at.get(e[i],"globalEval"))}Ct.tbody=Ct.tfoot=Ct.colgroup=Ct.caption=Ct.thead,Ct.th=Ct.td,g.option||(Ct.optgroup=Ct.option=[1,"<select multiple='multiple'>","</select>"]);var At=/<|&#?\w+;/;function Mt(t,e,i,n,s){for(var o,r,a,l,c,h,u=e.createDocumentFragment(),d=[],f=0,p=t.length;f<p;f++)if((o=t[f])||0===o)if("object"===w(o))k.merge(d,o.nodeType?[o]:o);else if(At.test(o)){for(r=r||u.appendChild(e.createElement("div")),a=($t.exec(o)||["",""])[1].toLowerCase(),l=Ct[a]||Ct._default,r.innerHTML=l[1]+k.htmlPrefilter(o)+l[2],h=l[0];h--;)r=r.lastChild;k.merge(d,r.childNodes),(r=u.firstChild).textContent=""}else d.push(e.createTextNode(o));for(u.textContent="",f=0;o=d[f++];)if(n&&k.inArray(o,n)>-1)s&&s.push(o);else if(c=gt(o),r=Pt(u.appendChild(o),"script"),c&&Et(r),i)for(h=0;o=r[h++];)Tt.test(o.type||"")&&i.push(o);return u}var Qt=/^([^.]*)(?:\.(.+)|)/;function Dt(){return!0}function Rt(){return!1}function It(t,e,i,n,s,o){var r,a;if("object"==typeof e){for(a in"string"!=typeof i&&(n=n||i,i=void 0),e)It(t,a,i,n,e[a],o);return t}if(null==n&&null==s?(s=i,n=i=void 0):null==s&&("string"==typeof i?(s=n,n=void 0):(s=n,n=i,i=void 0)),!1===s)s=Rt;else if(!s)return t;return 1===o&&(r=s,s=function(t){return k().off(t),r.apply(this,arguments)},s.guid=r.guid||(r.guid=k.guid++)),t.each(function(){k.event.add(this,e,s,n,i)})}function Lt(t,e,i){i?(at.set(t,e,!1),k.event.add(t,e,{namespace:!1,handler:function(t){var i,n=at.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(k.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=a.call(arguments),at.set(this,e,n),this[e](),i=at.get(this,e),at.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(at.set(this,e,k.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Dt)}})):void 0===at.get(t,e)&&k.event.add(t,e,Dt)}k.event={global:{},add:function(t,e,i,n,s){var o,r,a,l,c,h,u,d,f,p,m,g=at.get(t);if(ot(t))for(i.handler&&(i=(o=i).handler,s=o.selector),s&&k.find.matchesSelector(mt,s),i.guid||(i.guid=k.guid++),(l=g.events)||(l=g.events=Object.create(null)),(r=g.handle)||(r=g.handle=function(e){return void 0!==k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(H)||[""]).length;c--;)f=m=(a=Qt.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f&&(u=k.event.special[f]||{},f=(s?u.delegateType:u.bindType)||f,u=k.event.special[f]||{},h=k.extend({type:f,origType:m,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&k.expr.match.needsContext.test(s),namespace:p.join(".")},o),(d=l[f])||((d=l[f]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,n,p,r)||t.addEventListener&&t.addEventListener(f,r)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),s?d.splice(d.delegateCount++,0,h):d.push(h),k.event.global[f]=!0)},remove:function(t,e,i,n,s){var o,r,a,l,c,h,u,d,f,p,m,g=at.hasData(t)&&at.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(H)||[""]).length;c--;)if(f=m=(a=Qt.exec(e[c])||[])[1],p=(a[2]||"").split(".").sort(),f){for(u=k.event.special[f]||{},d=l[f=(n?u.delegateType:u.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=o=d.length;o--;)h=d[o],!s&&m!==h.origType||i&&i.guid!==h.guid||a&&!a.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(d.splice(o,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));r&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,p,g.handle)||k.removeEvent(t,f,g.handle),delete l[f])}else for(f in l)k.event.remove(t,f+e[c],i,n,!0);k.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,i,n,s,o,r,a=new Array(arguments.length),l=k.event.fix(t),c=(at.get(this,"events")||Object.create(null))[l.type]||[],h=k.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(r=k.event.handlers.call(this,l,c),e=0;(s=r[e++])&&!l.isPropagationStopped();)for(l.currentTarget=s.elem,i=0;(o=s.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(n=((k.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,a))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var i,n,s,o,r,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],r={},i=0;i<l;i++)void 0===r[s=(n=e[i]).selector+" "]&&(r[s]=n.needsContext?k(s,this).index(c)>-1:k.find(s,this,null,[c]).length),r[s]&&o.push(n);o.length&&a.push({elem:c,handlers:o})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[k.expando]?t:new k.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return kt.test(e.type)&&e.click&&T(e,"input")&&Lt(e,"click",!0),!1},trigger:function(t){var e=this||t;return kt.test(e.type)&&e.click&&T(e,"input")&&Lt(e,"click"),!0},_default:function(t){var e=t.target;return kt.test(e.type)&&e.click&&T(e,"input")&&at.get(e,"click")||T(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},k.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},k.Event=function(t,e){if(!(this instanceof k.Event))return new k.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Dt:Rt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&k.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Rt,isPropagationStopped:Rt,isImmediatePropagationStopped:Rt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Dt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Dt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Dt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(t,e){function i(t){if(O.documentMode){var i=at.get(this,"handle"),n=k.event.fix(t);n.type="focusin"===t.type?"focus":"blur",n.isSimulated=!0,i(t),n.target===n.currentTarget&&i(n)}else k.event.simulate(e,t.target,k.event.fix(t))}k.event.special[t]={setup:function(){var n;if(Lt(this,t,!0),!O.documentMode)return!1;(n=at.get(this,e))||this.addEventListener(e,i),at.set(this,e,(n||0)+1)},trigger:function(){return Lt(this,t),!0},teardown:function(){var t;if(!O.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,i),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},k.event.special[e]={setup:function(){var n=this.ownerDocument||this.document||this,s=O.documentMode?this:n,o=at.get(s,e);o||(O.documentMode?this.addEventListener(e,i):n.addEventListener(t,i,!0)),at.set(s,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,s=O.documentMode?this:n,o=at.get(s,e)-1;o?at.set(s,e,o):(O.documentMode?this.removeEventListener(e,i):n.removeEventListener(t,i,!0),at.remove(s,e))}}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){k.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=t.relatedTarget,s=t.handleObj;return n&&(n===this||k.contains(this,n))||(t.type=s.origType,i=s.handler.apply(this,arguments),t.type=e),i}}}),k.fn.extend({on:function(t,e,i,n){return It(this,t,e,i,n)},one:function(t,e,i,n){return It(this,t,e,i,n,1)},off:function(t,e,i){var n,s;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,k(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(s in t)this.off(s,e,t[s]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Rt),this.each(function(){k.event.remove(this,t,i,e)})}});var Nt=/<script|<style|<link/i,jt=/checked\s*(?:[^=]|=\s*.checked.)/i,zt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Bt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&k(t).children("tbody")[0]||t}function Zt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Wt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ft(t,e){var i,n,s,o,r,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(s in at.remove(e,"handle events"),a)for(i=0,n=a[s].length;i<n;i++)k.event.add(e,s,a[s][i]);lt.hasData(t)&&(o=lt.access(t),r=k.extend({},o),lt.set(e,r))}}function Xt(t,e){var i=e.nodeName.toLowerCase();"input"===i&&kt.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function qt(t,e,i,n){e=l(e);var s,o,r,a,c,h,u=0,d=t.length,f=d-1,p=e[0],m=v(p);if(m||d>1&&"string"==typeof p&&!g.checkClone&&jt.test(p))return t.each(function(s){var o=t.eq(s);m&&(e[0]=p.call(this,s,o.html())),qt(o,e,i,n)});if(d&&(o=(s=Mt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===s.childNodes.length&&(s=o),o||n)){for(a=(r=k.map(Pt(s,"script"),Zt)).length;u<d;u++)c=s,u!==f&&(c=k.clone(c,!0,!0),a&&k.merge(r,Pt(c,"script"))),i.call(t[u],c,u);if(a)for(h=r[r.length-1].ownerDocument,k.map(r,Wt),u=0;u<a;u++)c=r[u],Tt.test(c.type||"")&&!at.access(c,"globalEval")&&k.contains(h,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?k._evalUrl&&!c.noModule&&k._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},h):x(c.textContent.replace(zt,""),c,h))}return t}function Ht(t,e,i){for(var n,s=e?k.filter(e,t):t,o=0;null!=(n=s[o]);o++)i||1!==n.nodeType||k.cleanData(Pt(n)),n.parentNode&&(i&&gt(n)&&Et(Pt(n,"script")),n.parentNode.removeChild(n));return t}k.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var n,s,o,r,a=t.cloneNode(!0),l=gt(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||k.isXMLDoc(t)))for(r=Pt(a),n=0,s=(o=Pt(t)).length;n<s;n++)Xt(o[n],r[n]);if(e)if(i)for(o=o||Pt(t),r=r||Pt(a),n=0,s=o.length;n<s;n++)Ft(o[n],r[n]);else Ft(t,a);return(r=Pt(a,"script")).length>0&&Et(r,!l&&Pt(t,"script")),a},cleanData:function(t){for(var e,i,n,s=k.event.special,o=0;void 0!==(i=t[o]);o++)if(ot(i)){if(e=i[at.expando]){if(e.events)for(n in e.events)s[n]?k.event.remove(i,n):k.removeEvent(i,n,e.handle);i[at.expando]=void 0}i[lt.expando]&&(i[lt.expando]=void 0)}}}),k.fn.extend({detach:function(t){return Ht(this,t,!0)},remove:function(t){return Ht(this,t)},text:function(t){return tt(this,function(t){return void 0===t?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return qt(this,arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Bt(this,t).appendChild(t)})},prepend:function(){return qt(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Bt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return qt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return qt(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(k.cleanData(Pt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return k.clone(this,t,e)})},html:function(t){return tt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Nt.test(t)&&!Ct[($t.exec(t)||["",""])[1].toLowerCase()]){t=k.htmlPrefilter(t);try{for(;i<n;i++)1===(e=this[i]||{}).nodeType&&(k.cleanData(Pt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=[];return qt(this,arguments,function(e){var i=this.parentNode;k.inArray(this,t)<0&&(k.cleanData(Pt(this)),i&&i.replaceChild(e,this))},t)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){k.fn[t]=function(t){for(var i,n=[],s=k(t),o=s.length-1,r=0;r<=o;r++)i=r===o?this:this.clone(!0),k(s[r])[e](i),c.apply(n,i.get());return this.pushStack(n)}});var Vt=new RegExp("^("+dt+")(?!px)[a-z%]+$","i"),Yt=/^--/,Ut=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Gt=function(t,e,i){var n,s,o={};for(s in e)o[s]=t.style[s],t.style[s]=e[s];for(s in n=i.call(t),e)t.style[s]=o[s];return n},Kt=new RegExp(pt.join("|"),"i");function Jt(t,e,i){var n,s,o,r,a=Yt.test(e),l=t.style;return(i=i||Ut(t))&&(r=i.getPropertyValue(e)||i[e],a&&r&&(r=r.replace(M,"$1")||void 0),""!==r||gt(t)||(r=k.style(t,e)),!g.pixelBoxStyles()&&Vt.test(r)&&Kt.test(e)&&(n=l.width,s=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=i.width,l.width=n,l.minWidth=s,l.maxWidth=o)),void 0!==r?r+"":r}function te(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",mt.appendChild(c).appendChild(h);var t=n.getComputedStyle(h);i="1%"!==t.top,l=12===e(t.marginLeft),h.style.right="60%",r=36===e(t.right),s=36===e(t.width),h.style.position="absolute",o=12===e(h.offsetWidth/3),mt.removeChild(c),h=null}}function e(t){return Math.round(parseFloat(t))}var i,s,o,r,a,l,c=O.createElement("div"),h=O.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===h.style.backgroundClip,k.extend(g,{boxSizingReliable:function(){return t(),s},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,i,s;return null==a&&(t=O.createElement("table"),e=O.createElement("tr"),i=O.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="box-sizing:content-box;border:1px solid",e.style.height="1px",i.style.height="9px",i.style.display="block",mt.appendChild(t).appendChild(e).appendChild(i),s=n.getComputedStyle(e),a=parseInt(s.height,10)+parseInt(s.borderTopWidth,10)+parseInt(s.borderBottomWidth,10)===e.offsetHeight,mt.removeChild(t)),a}}))}();var ee=["Webkit","Moz","ms"],ie=O.createElement("div").style,ne={};function se(t){var e=k.cssProps[t]||ne[t];return e||(t in ie?t:ne[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=ee.length;i--;)if((t=ee[i]+e)in ie)return t}(t)||t)}var oe=/^(none|table(?!-c[ea]).+)/,re={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function le(t,e,i){var n=ft.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function ce(t,e,i,n,s,o){var r="width"===e?1:0,a=0,l=0,c=0;if(i===(n?"border":"content"))return 0;for(;r<4;r+=2)"margin"===i&&(c+=k.css(t,i+pt[r],!0,s)),n?("content"===i&&(l-=k.css(t,"padding"+pt[r],!0,s)),"margin"!==i&&(l-=k.css(t,"border"+pt[r]+"Width",!0,s))):(l+=k.css(t,"padding"+pt[r],!0,s),"padding"!==i?l+=k.css(t,"border"+pt[r]+"Width",!0,s):a+=k.css(t,"border"+pt[r]+"Width",!0,s));return!n&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))||0),l+c}function he(t,e,i){var n=Ut(t),s=(!g.boxSizingReliable()||i)&&"border-box"===k.css(t,"boxSizing",!1,n),o=s,r=Jt(t,e,n),a="offset"+e[0].toUpperCase()+e.slice(1);if(Vt.test(r)){if(!i)return r;r="auto"}return(!g.boxSizingReliable()&&s||!g.reliableTrDimensions()&&T(t,"tr")||"auto"===r||!parseFloat(r)&&"inline"===k.css(t,"display",!1,n))&&t.getClientRects().length&&(s="border-box"===k.css(t,"boxSizing",!1,n),(o=a in t)&&(r=t[a])),(r=parseFloat(r)||0)+ce(t,e,i||(s?"border":"content"),o,n,r)+"px"}function ue(t,e,i,n,s){return new ue.prototype.init(t,e,i,n,s)}k.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Jt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,o,r,a=st(e),l=Yt.test(e),c=t.style;if(l||(e=se(a)),r=k.cssHooks[e]||k.cssHooks[a],void 0===i)return r&&"get"in r&&void 0!==(s=r.get(t,!1,n))?s:c[e];"string"===(o=typeof i)&&(s=ft.exec(i))&&s[1]&&(i=Ot(t,e,s),o="number"),null!=i&&i==i&&("number"!==o||l||(i+=s&&s[3]||(k.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==i||0!==e.indexOf("background")||(c[e]="inherit"),r&&"set"in r&&void 0===(i=r.set(t,i,n))||(l?c.setProperty(e,i):c[e]=i))}},css:function(t,e,i,n){var s,o,r,a=st(e);return Yt.test(e)||(e=se(a)),(r=k.cssHooks[e]||k.cssHooks[a])&&"get"in r&&(s=r.get(t,!0,i)),void 0===s&&(s=Jt(t,e,n)),"normal"===s&&e in ae&&(s=ae[e]),""===i||i?(o=parseFloat(s),!0===i||isFinite(o)?o||0:s):s}}),k.each(["height","width"],function(t,e){k.cssHooks[e]={get:function(t,i,n){if(i)return!oe.test(k.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?he(t,e,n):Gt(t,re,function(){return he(t,e,n)})},set:function(t,i,n){var s,o=Ut(t),r=!g.scrollboxSize()&&"absolute"===o.position,a=(r||n)&&"border-box"===k.css(t,"boxSizing",!1,o),l=n?ce(t,e,n,a,o):0;return a&&r&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ce(t,e,"border",!1,o)-.5)),l&&(s=ft.exec(i))&&"px"!==(s[3]||"px")&&(t.style[e]=i,i=k.css(t,e)),le(0,i,l)}}}),k.cssHooks.marginLeft=te(g.reliableMarginLeft,function(t,e){if(e)return(parseFloat(Jt(t,"marginLeft"))||t.getBoundingClientRect().left-Gt(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(t,e){k.cssHooks[t+e]={expand:function(i){for(var n=0,s={},o="string"==typeof i?i.split(" "):[i];n<4;n++)s[t+pt[n]+e]=o[n]||o[n-2]||o[0];return s}},"margin"!==t&&(k.cssHooks[t+e].set=le)}),k.fn.extend({css:function(t,e){return tt(this,function(t,e,i){var n,s,o={},r=0;if(Array.isArray(e)){for(n=Ut(t),s=e.length;r<s;r++)o[e[r]]=k.css(t,e[r],!1,n);return o}return void 0!==i?k.style(t,e,i):k.css(t,e)},t,e,arguments.length>1)}}),k.Tween=ue,ue.prototype={constructor:ue,init:function(t,e,i,n,s,o){this.elem=t,this.prop=i,this.easing=s||k.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(k.cssNumber[i]?"":"px")},cur:function(){var t=ue.propHooks[this.prop];return t&&t.get?t.get(this):ue.propHooks._default.get(this)},run:function(t){var e,i=ue.propHooks[this.prop];return this.options.duration?this.pos=e=k.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):ue.propHooks._default.set(this),this}},ue.prototype.init.prototype=ue.prototype,ue.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=k.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){k.fx.step[t.prop]?k.fx.step[t.prop](t):1!==t.elem.nodeType||!k.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:k.style(t.elem,t.prop,t.now+t.unit)}}},ue.propHooks.scrollTop=ue.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},k.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},k.fx=ue.prototype.init,k.fx.step={};var de,fe,pe=/^(?:toggle|show|hide)$/,me=/queueHooks$/;function ge(){fe&&(!1===O.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ge):n.setTimeout(ge,k.fx.interval),k.fx.tick())}function ve(){return n.setTimeout(function(){de=void 0}),de=Date.now()}function ye(t,e){var i,n=0,s={height:t};for(e=e?1:0;n<4;n+=2-e)s["margin"+(i=pt[n])]=s["padding"+i]=t;return e&&(s.opacity=s.width=t),s}function Oe(t,e,i){for(var n,s=(be.tweeners[e]||[]).concat(be.tweeners["*"]),o=0,r=s.length;o<r;o++)if(n=s[o].call(i,e,t))return n}function be(t,e,i){var n,s,o=0,r=be.prefilters.length,a=k.Deferred().always(function(){delete l.elem}),l=function(){if(s)return!1;for(var e=de||ve(),i=Math.max(0,c.startTime+c.duration-e),n=1-(i/c.duration||0),o=0,r=c.tweens.length;o<r;o++)c.tweens[o].run(n);return a.notifyWith(t,[c,n,i]),n<1&&r?i:(r||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},i),originalProperties:e,originalOptions:i,startTime:de||ve(),duration:i.duration,tweens:[],createTween:function(e,i){var n=k.Tween(t,c.opts,e,i,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(n),n},stop:function(e){var i=0,n=e?c.tweens.length:0;if(s)return this;for(s=!0;i<n;i++)c.tweens[i].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),h=c.props;for(!function(t,e){var i,n,s,o,r;for(i in t)if(s=e[n=st(i)],o=t[i],Array.isArray(o)&&(s=o[1],o=t[i]=o[0]),i!==n&&(t[n]=o,delete t[i]),(r=k.cssHooks[n])&&"expand"in r)for(i in o=r.expand(o),delete t[n],o)i in t||(t[i]=o[i],e[i]=s);else e[n]=s}(h,c.opts.specialEasing);o<r;o++)if(n=be.prefilters[o].call(c,t,h,c.opts))return v(n.stop)&&(k._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return k.map(h,Oe,c),v(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),k.fx.timer(k.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}k.Animation=k.extend(be,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return Ot(i.elem,t,ft.exec(e),i),i}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(H);for(var i,n=0,s=t.length;n<s;n++)i=t[n],be.tweeners[i]=be.tweeners[i]||[],be.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var n,s,o,r,a,l,c,h,u="width"in e||"height"in e,d=this,f={},p=t.style,m=t.nodeType&&yt(t),g=at.get(t,"fxshow");for(n in i.queue||(null==(r=k._queueHooks(t,"fx")).unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,d.always(function(){d.always(function(){r.unqueued--,k.queue(t,"fx").length||r.empty.fire()})})),e)if(s=e[n],pe.test(s)){if(delete e[n],o=o||"toggle"===s,s===(m?"hide":"show")){if("show"!==s||!g||void 0===g[n])continue;m=!0}f[n]=g&&g[n]||k.style(t,n)}if((l=!k.isEmptyObject(e))||!k.isEmptyObject(f))for(n in u&&1===t.nodeType&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=at.get(t,"display")),"none"===(h=k.css(t,"display"))&&(c?h=c:(wt([t],!0),c=t.style.display||c,h=k.css(t,"display"),wt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===k.css(t,"float")&&(l||(d.done(function(){p.display=c}),null==c&&(h=p.display,c="none"===h?"":h)),p.display="inline-block")),i.overflow&&(p.overflow="hidden",d.always(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]})),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=at.access(t,"fxshow",{display:c}),o&&(g.hidden=!m),m&&wt([t],!0),d.done(function(){for(n in m||wt([t]),at.remove(t,"fxshow"),f)k.style(t,n,f[n])})),l=Oe(m?g[n]:0,n,d),n in g||(g[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?be.prefilters.unshift(t):be.prefilters.push(t)}}),k.speed=function(t,e,i){var n=t&&"object"==typeof t?k.extend({},t):{complete:i||!i&&e||v(t)&&t,duration:t,easing:i&&e||e&&!v(e)&&e};return k.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in k.fx.speeds?n.duration=k.fx.speeds[n.duration]:n.duration=k.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){v(n.old)&&n.old.call(this),n.queue&&k.dequeue(this,n.queue)},n},k.fn.extend({fadeTo:function(t,e,i,n){return this.filter(yt).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var s=k.isEmptyObject(t),o=k.speed(e,i,n),r=function(){var e=be(this,k.extend({},t),o);(s||at.get(this,"finish"))&&e.stop(!0)};return r.finish=r,s||!1===o.queue?this.each(r):this.queue(o.queue,r)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each(function(){var e=!0,s=null!=t&&t+"queueHooks",o=k.timers,r=at.get(this);if(s)r[s]&&r[s].stop&&n(r[s]);else for(s in r)r[s]&&r[s].stop&&me.test(s)&&n(r[s]);for(s=o.length;s--;)o[s].elem!==this||null!=t&&o[s].queue!==t||(o[s].anim.stop(i),e=!1,o.splice(s,1));!e&&i||k.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,i=at.get(this),n=i[t+"queue"],s=i[t+"queueHooks"],o=k.timers,r=n?n.length:0;for(i.finish=!0,k.queue(this,t,[]),s&&s.stop&&s.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<r;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish})}}),k.each(["toggle","show","hide"],function(t,e){var i=k.fn[e];k.fn[e]=function(t,n,s){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(ye(e,!0),t,n,s)}}),k.each({slideDown:ye("show"),slideUp:ye("hide"),slideToggle:ye("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){k.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}}),k.timers=[],k.fx.tick=function(){var t,e=0,i=k.timers;for(de=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||k.fx.stop(),de=void 0},k.fx.timer=function(t){k.timers.push(t),k.fx.start()},k.fx.interval=13,k.fx.start=function(){fe||(fe=!0,ge())},k.fx.stop=function(){fe=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(t,e){return t=k.fx&&k.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,i){var s=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(s)}})},function(){var t=O.createElement("input"),e=O.createElement("select").appendChild(O.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=O.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var xe,we=k.expr.attrHandle;k.fn.extend({attr:function(t,e){return tt(this,k.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){k.removeAttr(this,t)})}}),k.extend({attr:function(t,e,i){var n,s,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?k.prop(t,e,i):(1===o&&k.isXMLDoc(t)||(s=k.attrHooks[e.toLowerCase()]||(k.expr.match.bool.test(e)?xe:void 0)),void 0!==i?null===i?void k.removeAttr(t,e):s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:(t.setAttribute(e,i+""),i):s&&"get"in s&&null!==(n=s.get(t,e))?n:null==(n=k.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&T(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,s=e&&e.match(H);if(s&&1===t.nodeType)for(;i=s[n++];)t.removeAttribute(i)}}),xe={set:function(t,e,i){return!1===e?k.removeAttr(t,i):t.setAttribute(i,i),i}},k.each(k.expr.match.bool.source.match(/\w+/g),function(t,e){var i=we[e]||k.find.attr;we[e]=function(t,e,n){var s,o,r=e.toLowerCase();return n||(o=we[r],we[r]=s,s=null!=i(t,e,n)?r:null,we[r]=o),s}});var _e=/^(?:input|select|textarea|button)$/i,Se=/^(?:a|area)$/i;function ke(t){return(t.match(H)||[]).join(" ")}function $e(t){return t.getAttribute&&t.getAttribute("class")||""}function Te(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(H)||[]}k.fn.extend({prop:function(t,e){return tt(this,k.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[k.propFix[t]||t]})}}),k.extend({prop:function(t,e,i){var n,s,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(t)||(e=k.propFix[e]||e,s=k.propHooks[e]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:t[e]=i:s&&"get"in s&&null!==(n=s.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=k.find.attr(t,"tabindex");return e?parseInt(e,10):_e.test(t.nodeName)||Se.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(k.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,i,n,s,o,r;return v(t)?this.each(function(e){k(this).addClass(t.call(this,e,$e(this)))}):(e=Te(t)).length?this.each(function(){if(n=$e(this),i=1===this.nodeType&&" "+ke(n)+" "){for(o=0;o<e.length;o++)s=e[o],i.indexOf(" "+s+" ")<0&&(i+=s+" ");r=ke(i),n!==r&&this.setAttribute("class",r)}}):this},removeClass:function(t){var e,i,n,s,o,r;return v(t)?this.each(function(e){k(this).removeClass(t.call(this,e,$e(this)))}):arguments.length?(e=Te(t)).length?this.each(function(){if(n=$e(this),i=1===this.nodeType&&" "+ke(n)+" "){for(o=0;o<e.length;o++)for(s=e[o];i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");r=ke(i),n!==r&&this.setAttribute("class",r)}}):this:this.attr("class","")},toggleClass:function(t,e){var i,n,s,o,r=typeof t,a="string"===r||Array.isArray(t);return v(t)?this.each(function(i){k(this).toggleClass(t.call(this,i,$e(this),e),e)}):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(i=Te(t),this.each(function(){if(a)for(o=k(this),s=0;s<i.length;s++)n=i[s],o.hasClass(n)?o.removeClass(n):o.addClass(n);else void 0!==t&&"boolean"!==r||((n=$e(this))&&at.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===t?"":at.get(this,"__className__")||""))}))},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+ke($e(i))+" ").indexOf(e)>-1)return!0;return!1}});var Ce=/\r/g;k.fn.extend({val:function(t){var e,i,n,s=this[0];return arguments.length?(n=v(t),this.each(function(i){var s;1===this.nodeType&&(null==(s=n?t.call(this,i,k(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=k.map(s,function(t){return null==t?"":t+""})),(e=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))})):s?(e=k.valHooks[s.type]||k.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(s,"value"))?i:"string"==typeof(i=s.value)?i.replace(Ce,""):null==i?"":i:void 0}}),k.extend({valHooks:{option:{get:function(t){var e=k.find.attr(t,"value");return null!=e?e:ke(k.text(t))}},select:{get:function(t){var e,i,n,s=t.options,o=t.selectedIndex,r="select-one"===t.type,a=r?null:[],l=r?o+1:s.length;for(n=o<0?l:r?o:0;n<l;n++)if(((i=s[n]).selected||n===o)&&!i.disabled&&(!i.parentNode.disabled||!T(i.parentNode,"optgroup"))){if(e=k(i).val(),r)return e;a.push(e)}return a},set:function(t,e){for(var i,n,s=t.options,o=k.makeArray(e),r=s.length;r--;)((n=s[r]).selected=k.inArray(k.valHooks.option.get(n),o)>-1)&&(i=!0);return i||(t.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=k.inArray(k(t).val(),e)>-1}},g.checkOn||(k.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Pe=n.location,Ee={guid:Date.now()},Ae=/\?/;k.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||k.error("Invalid XML: "+(i?k.map(i.childNodes,function(t){return t.textContent}).join("\n"):t)),e};var Me=/^(?:focusinfocus|focusoutblur)$/,Qe=function(t){t.stopPropagation()};k.extend(k.event,{trigger:function(t,e,i,s){var o,r,a,l,c,h,u,d,p=[i||O],m=f.call(t,"type")?t.type:t,g=f.call(t,"namespace")?t.namespace.split("."):[];if(r=d=a=i=i||O,3!==i.nodeType&&8!==i.nodeType&&!Me.test(m+k.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[k.expando]?t:new k.Event(m,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:k.makeArray(e,[t]),u=k.event.special[m]||{},s||!u.trigger||!1!==u.trigger.apply(i,e))){if(!s&&!u.noBubble&&!y(i)){for(l=u.delegateType||m,Me.test(l+m)||(r=r.parentNode);r;r=r.parentNode)p.push(r),a=r;a===(i.ownerDocument||O)&&p.push(a.defaultView||a.parentWindow||n)}for(o=0;(r=p[o++])&&!t.isPropagationStopped();)d=r,t.type=o>1?l:u.bindType||m,(h=(at.get(r,"events")||Object.create(null))[t.type]&&at.get(r,"handle"))&&h.apply(r,e),(h=c&&r[c])&&h.apply&&ot(r)&&(t.result=h.apply(r,e),!1===t.result&&t.preventDefault());return t.type=m,s||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(p.pop(),e)||!ot(i)||c&&v(i[m])&&!y(i)&&((a=i[c])&&(i[c]=null),k.event.triggered=m,t.isPropagationStopped()&&d.addEventListener(m,Qe),i[m](),t.isPropagationStopped()&&d.removeEventListener(m,Qe),k.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(t,e,i){var n=k.extend(new k.Event,i,{type:t,isSimulated:!0});k.event.trigger(n,null,e)}}),k.fn.extend({trigger:function(t,e){return this.each(function(){k.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return k.event.trigger(t,e,i,!0)}});var De=/\[\]$/,Re=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Le=/^(?:input|select|textarea|keygen)/i;function Ne(t,e,i,n){var s;if(Array.isArray(e))k.each(e,function(e,s){i||De.test(t)?n(t,s):Ne(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,i,n)});else if(i||"object"!==w(e))n(t,e);else for(s in e)Ne(t+"["+s+"]",e[s],i,n)}k.param=function(t,e){var i,n=[],s=function(t,e){var i=v(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!k.isPlainObject(t))k.each(t,function(){s(this.name,this.value)});else for(i in t)Ne(i,t[i],e,s);return n.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=k.prop(this,"elements");return t?k.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!k(this).is(":disabled")&&Le.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!kt.test(t))}).map(function(t,e){var i=k(this).val();return null==i?null:Array.isArray(i)?k.map(i,function(t){return{name:e.name,value:t.replace(Re,"\r\n")}}):{name:e.name,value:i.replace(Re,"\r\n")}}).get()}});var je=/%20/g,ze=/#.*$/,Be=/([?&])_=[^&]*/,Ze=/^(.*?):[ \t]*([^\r\n]*)$/gm,We=/^(?:GET|HEAD)$/,Fe=/^\/\//,Xe={},qe={},He="*/".concat("*"),Ve=O.createElement("a");function Ye(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,s=0,o=e.toLowerCase().match(H)||[];if(v(i))for(;n=o[s++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Ue(t,e,i,n){var s={},o=t===qe;function r(a){var l;return s[a]=!0,k.each(t[a]||[],function(t,a){var c=a(e,i,n);return"string"!=typeof c||o||s[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),r(c),!1)}),l}return r(e.dataTypes[0])||!s["*"]&&r("*")}function Ge(t,e){var i,n,s=k.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((s[i]?t:n||(n={}))[i]=e[i]);return n&&k.extend(!0,t,n),t}Ve.href=Pe.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Pe.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Pe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":He,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,k.ajaxSettings),e):Ge(k.ajaxSettings,t)},ajaxPrefilter:Ye(Xe),ajaxTransport:Ye(qe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,s,o,r,a,l,c,h,u,d,f=k.ajaxSetup({},e),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?k(p):k.event,g=k.Deferred(),v=k.Callbacks("once memory"),y=f.statusCode||{},b={},x={},w="canceled",_={readyState:0,getResponseHeader:function(t){var e;if(c){if(!r)for(r={};e=Ze.exec(o);)r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=r[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)_.always(t[_.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||w;return i&&i.abort(e),S(0,e),this}};if(g.promise(_),f.url=((t||f.url||Pe.href)+"").replace(Fe,Pe.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(H)||[""],null==f.crossDomain){l=O.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ve.protocol+"//"+Ve.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=k.param(f.data,f.traditional)),Ue(Xe,f,e,_),c)return _;for(u in(h=k.event&&f.global)&&0===k.active++&&k.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!We.test(f.type),s=f.url.replace(ze,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(je,"+")):(d=f.url.slice(s.length),f.data&&(f.processData||"string"==typeof f.data)&&(s+=(Ae.test(s)?"&":"?")+f.data,delete f.data),!1===f.cache&&(s=s.replace(Be,"$1"),d=(Ae.test(s)?"&":"?")+"_="+Ee.guid+++d),f.url=s+d),f.ifModified&&(k.lastModified[s]&&_.setRequestHeader("If-Modified-Since",k.lastModified[s]),k.etag[s]&&_.setRequestHeader("If-None-Match",k.etag[s])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&_.setRequestHeader("Content-Type",f.contentType),_.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+He+"; q=0.01":""):f.accepts["*"]),f.headers)_.setRequestHeader(u,f.headers[u]);if(f.beforeSend&&(!1===f.beforeSend.call(p,_,f)||c))return _.abort();if(w="abort",v.add(f.complete),_.done(f.success),_.fail(f.error),i=Ue(qe,f,e,_)){if(_.readyState=1,h&&m.trigger("ajaxSend",[_,f]),c)return _;f.async&&f.timeout>0&&(a=n.setTimeout(function(){_.abort("timeout")},f.timeout));try{c=!1,i.send(b,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,r,l){var u,d,O,b,x,w=e;c||(c=!0,a&&n.clearTimeout(a),i=void 0,o=l||"",_.readyState=t>0?4:0,u=t>=200&&t<300||304===t,r&&(b=function(t,e,i){for(var n,s,o,r,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(s in a)if(a[s]&&a[s].test(n)){l.unshift(s);break}if(l[0]in i)o=l[0];else{for(s in i){if(!l[0]||t.converters[s+" "+l[0]]){o=s;break}r||(r=s)}o=o||r}if(o)return o!==l[0]&&l.unshift(o),i[o]}(f,_,r)),!u&&k.inArray("script",f.dataTypes)>-1&&k.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),b=function(t,e,i,n){var s,o,r,a,l,c={},h=t.dataTypes.slice();if(h[1])for(r in t.converters)c[r.toLowerCase()]=t.converters[r];for(o=h.shift();o;)if(t.responseFields[o]&&(i[t.responseFields[o]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=h.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(r=c[l+" "+o]||c["* "+o]))for(s in c)if((a=s.split(" "))[1]===o&&(r=c[l+" "+a[0]]||c["* "+a[0]])){!0===r?r=c[s]:!0!==c[s]&&(o=a[0],h.unshift(a[1]));break}if(!0!==r)if(r&&t.throws)e=r(e);else try{e=r(e)}catch(t){return{state:"parsererror",error:r?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(f,b,_,u),u?(f.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(k.lastModified[s]=x),(x=_.getResponseHeader("etag"))&&(k.etag[s]=x)),204===t||"HEAD"===f.type?w="nocontent":304===t?w="notmodified":(w=b.state,d=b.data,u=!(O=b.error))):(O=w,!t&&w||(w="error",t<0&&(t=0))),_.status=t,_.statusText=(e||w)+"",u?g.resolveWith(p,[d,w,_]):g.rejectWith(p,[_,w,O]),_.statusCode(y),y=void 0,h&&m.trigger(u?"ajaxSuccess":"ajaxError",[_,f,u?d:O]),v.fireWith(p,[_,w]),h&&(m.trigger("ajaxComplete",[_,f]),--k.active||k.event.trigger("ajaxStop")))}return _},getJSON:function(t,e,i){return k.get(t,e,i,"json")},getScript:function(t,e){return k.get(t,void 0,e,"script")}}),k.each(["get","post"],function(t,e){k[e]=function(t,i,n,s){return v(i)&&(s=s||n,n=i,i=void 0),k.ajax(k.extend({url:t,type:e,dataType:s,data:i,success:n},k.isPlainObject(t)&&t))}}),k.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),k._evalUrl=function(t,e,i){return k.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){k.globalEval(t,e,i)}})},k.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=k(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return v(t)?this.each(function(e){k(this).wrapInner(t.call(this,e))}):this.each(function(){var e=k(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=v(t);return this.each(function(i){k(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(t){return!k.expr.pseudos.visible(t)},k.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ke={0:200,1223:204},Je=k.ajaxSettings.xhr();g.cors=!!Je&&"withCredentials"in Je,g.ajax=Je=!!Je,k.ajaxTransport(function(t){var e,i;if(g.cors||Je&&!t.crossDomain)return{send:function(s,o){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)a.setRequestHeader(r,s[r]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Ke[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){e&&i()})},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}}),k.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return k.globalEval(t),t}}}),k.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),k.ajaxTransport("script",function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,s){e=k("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&s("error"===t.type?404:200,t.type)}),O.head.appendChild(e[0])},abort:function(){i&&i()}}});var ti,ei=[],ii=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=ei.pop()||k.expando+"_"+Ee.guid++;return this[t]=!0,t}}),k.ajaxPrefilter("json jsonp",function(t,e,i){var s,o,r,a=!1!==t.jsonp&&(ii.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ii.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return s=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(ii,"$1"+s):!1!==t.jsonp&&(t.url+=(Ae.test(t.url)?"&":"?")+t.jsonp+"="+s),t.converters["script json"]=function(){return r||k.error(s+" was not called"),r[0]},t.dataTypes[0]="json",o=n[s],n[s]=function(){r=arguments},i.always(function(){void 0===o?k(n).removeProp(s):n[s]=o,t[s]&&(t.jsonpCallback=e.jsonpCallback,ei.push(s)),r&&v(o)&&o(r[0]),r=o=void 0}),"script"}),g.createHTMLDocument=((ti=O.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===ti.childNodes.length),k.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(g.createHTMLDocument?((n=(e=O.implementation.createHTMLDocument("")).createElement("base")).href=O.location.href,e.head.appendChild(n)):e=O),o=!i&&[],(s=z.exec(t))?[e.createElement(s[1])]:(s=Mt([t],e,o),o&&o.length&&k(o).remove(),k.merge([],s.childNodes)));var n,s,o},k.fn.load=function(t,e,i){var n,s,o,r=this,a=t.indexOf(" ");return a>-1&&(n=ke(t.slice(a)),t=t.slice(0,a)),v(e)?(i=e,e=void 0):e&&"object"==typeof e&&(s="POST"),r.length>0&&k.ajax({url:t,type:s||"GET",dataType:"html",data:e}).done(function(t){o=arguments,r.html(n?k("<div>").append(k.parseHTML(t)).find(n):t)}).always(i&&function(t,e){r.each(function(){i.apply(this,o||[t.responseText,e,t])})}),this},k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(t,e,i){var n,s,o,r,a,l,c=k.css(t,"position"),h=k(t),u={};"static"===c&&(t.style.position="relative"),a=h.offset(),o=k.css(t,"top"),l=k.css(t,"left"),("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1?(r=(n=h.position()).top,s=n.left):(r=parseFloat(o)||0,s=parseFloat(l)||0),v(e)&&(e=e.call(t,i,k.extend({},a))),null!=e.top&&(u.top=e.top-a.top+r),null!=e.left&&(u.left=e.left-a.left+s),"using"in e?e.using.call(t,u):h.css(u)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,i,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,n=this[0],s={top:0,left:0};if("fixed"===k.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===k.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((s=k(t).offset()).top+=k.css(t,"borderTopWidth",!0),s.left+=k.css(t,"borderLeftWidth",!0))}return{top:e.top-s.top-k.css(n,"marginTop",!0),left:e.left-s.left-k.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===k.css(t,"position");)t=t.offsetParent;return t||mt})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;k.fn[t]=function(n){return tt(this,function(t,n,s){var o;if(y(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===s)return o?o[e]:t[n];o?o.scrollTo(i?o.pageXOffset:s,i?s:o.pageYOffset):t[n]=s},t,n,arguments.length)}}),k.each(["top","left"],function(t,e){k.cssHooks[e]=te(g.pixelPosition,function(t,i){if(i)return i=Jt(t,e),Vt.test(i)?k(t).position()[e]+"px":i})}),k.each({Height:"height",Width:"width"},function(t,e){k.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){k.fn[n]=function(s,o){var r=arguments.length&&(i||"boolean"!=typeof s),a=i||(!0===s||!0===o?"margin":"border");return tt(this,function(e,i,s){var o;return y(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===s?k.css(e,i,a):k.style(e,i,s,a)},e,r?s:void 0,r)}})}),k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){k.fn[e]=function(t){return this.on(e,t)}}),k.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.on("mouseenter",t).on("mouseleave",e||t)}}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){k.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}});var ni=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;k.proxy=function(t,e){var i,n,s;if("string"==typeof e&&(i=t[e],e=t,t=i),v(t))return n=a.call(arguments,2),s=function(){return t.apply(e||this,n.concat(a.call(arguments)))},s.guid=t.guid=t.guid||k.guid++,s},k.holdReady=function(t){t?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=T,k.isFunction=v,k.isWindow=y,k.camelCase=st,k.type=w,k.now=Date.now,k.isNumeric=function(t){var e=k.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},k.trim=function(t){return null==t?"":(t+"").replace(ni,"$1")},void 0===(i=function(){return k}.apply(e,[]))||(t.exports=i);var si=n.jQuery,oi=n.$;return k.noConflict=function(t){return n.$===k&&(n.$=oi),t&&n.jQuery===k&&(n.jQuery=si),k},void 0===s&&(n.jQuery=n.$=k),k})},4737:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>n.str`must match format "${t}"`,params:({schemaCode:t})=>n._`{format: ${t}}`},code(t,e){const{gen:i,data:s,$data:o,schema:r,schemaCode:a,it:l}=t,{opts:c,errSchemaPath:h,schemaEnv:u,self:d}=l;c.validateFormats&&(o?function(){const o=i.scopeValue("formats",{ref:d.formats,code:c.code.formats}),r=i.const("fDef",n._`${o}[${a}]`),l=i.let("fType"),h=i.let("format");i.if(n._`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>i.assign(l,n._`${r}.type || "string"`).assign(h,n._`${r}.validate`),()=>i.assign(l,n._`"string"`).assign(h,r)),t.fail$data((0,n.or)(!1===c.strictSchema?n.nil:n._`${a} && !${h}`,function(){const t=u.$async?n._`(${r}.async ? await ${h}(${s}) : ${h}(${s}))`:n._`${h}(${s})`,i=n._`(typeof ${h} == "function" ? ${t} : ${h}.test(${s}))`;return n._`${h} && ${h} !== true && ${l} === ${e} && !${i}`}()))}():function(){const o=d.formats[r];if(!o)return void function(){if(!1===c.strictSchema)return void d.logger.warn(t());throw new Error(t());function t(){return`unknown format "${r}" ignored in schema at path "${h}"`}}();if(!0===o)return;const[a,l,f]=function(t){const e=t instanceof RegExp?(0,n.regexpCode)(t):c.code.formats?n._`${c.code.formats}${(0,n.getProperty)(r)}`:void 0,s=i.scopeValue("formats",{key:r,ref:t,code:e});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,n._`${s}.validate`];return["string",t,s]}(o);a===e&&t.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!u.$async)throw new Error("async format in sync schema");return n._`await ${f}(${s})`}return"function"==typeof l?n._`${f}(${s})`:n._`${f}.test(${s})`}())}())}};e.default=s},4834:t=>{"use strict";const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),i=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(t){let e="",i=0,n=0;for(n=0;n<t.length;n++)if(i=t[n].charCodeAt(0),48!==i){if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(i=t[n].charCodeAt(0),!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[n]}return e}const s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(t){return t.length=0,!0}function r(t,e,i){if(t.length){const s=n(t);if(""===s)return i.error=!0,!1;e.push(s),t.length=0}return!0}function a(t){if(function(t,e){let i=0;for(let n=0;n<t.length;n++)t[n]===e&&i++;return i}(t,":")<2)return{host:t,isIPV6:!1};const e=function(t){let e=0;const i={error:!1,address:"",zone:""},s=[],a=[];let l=!1,c=!1,h=r;for(let n=0;n<t.length;n++){const r=t[n];if("["!==r&&"]"!==r)if(":"!==r)if("%"===r){if(!h(a,s,i))break;h=o}else a.push(r);else{if(!0===l&&(c=!0),!h(a,s,i))break;if(++e>7){i.error=!0;break}n>0&&":"===t[n-1]&&(l=!0),s.push(":")}}return a.length&&(h===o?i.zone=a.join(""):c?s.push(a.join("")):s.push(n(a))),i.address=s.join(""),i}(t);if(e.error)return{host:t,isIPV6:!1};{let t=e.address,i=e.address;return e.zone&&(t+="%"+e.zone,i+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:i}}}t.exports={nonSimpleDomain:s,recomposeAuthority:function(t){const e=[];if(void 0!==t.userinfo&&(e.push(t.userinfo),e.push("@")),void 0!==t.host){let n=unescape(t.host);if(!i(n)){const e=a(n);n=!0===e.isIPV6?`[${e.escapedHost}]`:t.host}e.push(n)}return"number"!=typeof t.port&&"string"!=typeof t.port||(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0},normalizeComponentEncoding:function(t,e){const i=!0!==e?escape:unescape;return void 0!==t.scheme&&(t.scheme=i(t.scheme)),void 0!==t.userinfo&&(t.userinfo=i(t.userinfo)),void 0!==t.host&&(t.host=i(t.host)),void 0!==t.path&&(t.path=i(t.path)),void 0!==t.query&&(t.query=i(t.query)),void 0!==t.fragment&&(t.fragment=i(t.fragment)),t},removeDotSegments:function(t){let e=t;const i=[];let n=-1,s=0;for(;s=e.length;){if(1===s){if("."===e)break;if("/"===e){i.push("/");break}i.push(e);break}if(2===s){if("."===e[0]){if("."===e[1])break;if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&("."===e[1]||"/"===e[1])){i.push("/");break}}else if(3===s&&"/.."===e){0!==i.length&&i.pop(),i.push("/");break}if("."===e[0]){if("."===e[1]){if("/"===e[2]){e=e.slice(3);continue}}else if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&"."===e[1]){if("/"===e[2]){e=e.slice(2);continue}if("."===e[2]&&"/"===e[3]){e=e.slice(3),0!==i.length&&i.pop();continue}}if(-1===(n=e.indexOf("/",1))){i.push(e);break}i.push(e.slice(0,n)),e=e.slice(n)}return i.join("")},isIPv4:i,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:n}},5304:(t,e,i)=>{var n,s,o;
100
- /*!
101
- * jQuery UI Unique ID 1.14.1
102
- * https://jqueryui.com
103
- *
104
- * Copyright OpenJS Foundation and other contributors
105
- * Released under the MIT license.
106
- * https://jquery.org/license
107
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.fn.extend({uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}});var e})?n.apply(e,s):n)||(t.exports=o)}()},5333:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),s=i(9029),o=i(4227),r=i(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:i,data:a,parentSchema:l,it:c}=t,{opts:h}=c,u=(0,n.allSchemaProperties)(i),d=u.filter(t=>(0,o.alwaysValidSchema)(c,i[t]));if(0===u.length||d.length===u.length&&(!c.opts.unevaluated||!0===c.props))return;const f=h.strictSchema&&!h.allowMatchingProperties&&l.properties,p=e.name("valid");!0===c.props||c.props instanceof s.Name||(c.props=(0,r.evaluatedPropsToName)(e,c.props));const{props:m}=c;function g(t){for(const e in f)new RegExp(t).test(e)&&(0,o.checkStrictMode)(c,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function v(i){e.forIn("key",a,o=>{e.if(s._`${(0,n.usePattern)(t,i)}.test(${o})`,()=>{const n=d.includes(i);n||t.subschema({keyword:"patternProperties",schemaProp:i,dataProp:o,dataPropType:r.Type.Str},p),c.opts.unevaluated&&!0!==m?e.assign(s._`${m}[${o}]`,!0):n||c.allErrors||e.if((0,s.not)(p),()=>e.break())})})}!function(){for(const t of u)f&&g(t),c.allErrors?v(t):(e.var(p,!0),v(t),e.if(p))}()}};e.default=a},5354:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(494),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,n.validateTuple)(t,"items")};e.default=s},5385:(t,e,i)=>{t.exports=i(7146)},5408:t=>{t.exports=function(t,e){if("function"!=typeof t)throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let i,n=0;return function(...s){clearTimeout(i);const o=Date.now(),r=e-(o-n);r<=0?(n=o,t.apply(this,s)):i=setTimeout(()=>{n=Date.now(),t.apply(this,s)},r)}}},5457:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;const n=i(9029),s=i(4227),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>n.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>n._`{limit: ${t}}`},code(t){const{parentSchema:e,it:i}=t,{items:n}=e;Array.isArray(n)?r(t,n):(0,s.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(t,e){const{gen:i,schema:o,data:r,keyword:a,it:l}=t;l.items=!0;const c=i.const("len",n._`${r}.length`);if(!1===o)t.setParams({len:e.length}),t.pass(n._`${c} <= ${e.length}`);else if("object"==typeof o&&!(0,s.alwaysValidSchema)(l,o)){const o=i.var("valid",n._`${c} <= ${e.length}`);i.if((0,n.not)(o),()=>function(o){i.forRange("i",e.length,c,e=>{t.subschema({keyword:a,dataProp:e,dataPropType:s.Type.Num},o),l.allErrors||i.if((0,n.not)(o),()=>i.break())})}(o)),t.ok(o)}}e.validateAdditionalItems=r,e.default=o},5765:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;const n=i(9029),s=i(4227),o=i(2023),r=i(4227);function a(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function l(t,e,i){return n._`${a(t)}.call(${e}, ${i})`}function c(t,e,i,s){const o=n._`${e}${(0,n.getProperty)(i)} === undefined`;return s?(0,n.or)(o,(0,n.not)(l(t,e,i))):o}function h(t){return t?Object.keys(t).filter(t=>"__proto__"!==t):[]}e.checkReportMissingProp=function(t,e){const{gen:i,data:s,it:o}=t;i.if(c(i,s,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:n._`${e}`},!0),t.error()})},e.checkMissingProp=function({gen:t,data:e,it:{opts:i}},s,o){return(0,n.or)(...s.map(s=>(0,n.and)(c(t,e,s,i.ownProperties),n._`${o} = ${s}`)))},e.reportMissingProp=function(t,e){t.setParams({missingProperty:e},!0),t.error()},e.hasPropFunc=a,e.isOwnProperty=l,e.propertyInData=function(t,e,i,s){const o=n._`${e}${(0,n.getProperty)(i)} !== undefined`;return s?n._`${o} && ${l(t,e,i)}`:o},e.noPropertyInData=c,e.allSchemaProperties=h,e.schemaProperties=function(t,e){return h(e).filter(i=>!(0,s.alwaysValidSchema)(t,e[i]))},e.callValidateCode=function({schemaCode:t,data:e,it:{gen:i,topSchemaRef:s,schemaPath:r,errorPath:a},it:l},c,h,u){const d=u?n._`${t}, ${e}, ${s}${r}`:e,f=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,a)],[o.default.parentData,l.parentData],[o.default.parentDataProperty,l.parentDataProperty],[o.default.rootData,o.default.rootData]];l.opts.dynamicRef&&f.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const p=n._`${d}, ${i.object(...f)}`;return h!==n.nil?n._`${c}.call(${h}, ${p})`:n._`${c}(${p})`};const u=n._`new RegExp`;e.usePattern=function({gen:t,it:{opts:e}},i){const s=e.unicodeRegExp?"u":"",{regExp:o}=e.code,a=o(i,s);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===o.code?u:(0,r.useFunc)(t,o)}(${i}, ${s})`})},e.validateArray=function(t){const{gen:e,data:i,keyword:o,it:r}=t,a=e.name("valid");if(r.allErrors){const t=e.let("valid",!0);return l(()=>e.assign(t,!1)),t}return e.var(a,!0),l(()=>e.break()),a;function l(r){const l=e.const("len",n._`${i}.length`);e.forRange("i",0,l,i=>{t.subschema({keyword:o,dataProp:i,dataPropType:s.Type.Num},a),e.if((0,n.not)(a),r)})}},e.validateUnion=function(t){const{gen:e,schema:i,keyword:o,it:r}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");if(i.some(t=>(0,s.alwaysValidSchema)(r,t))&&!r.opts.unevaluated)return;const a=e.let("valid",!1),l=e.name("_valid");e.block(()=>i.forEach((i,s)=>{const r=t.subschema({keyword:o,schemaProp:s,compositeRule:!0},l);e.assign(a,n._`${a} || ${l}`);t.mergeValidEvaluated(r,l)||e.if((0,n.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}},5844:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4227),s={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:i,it:s}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=e.name("valid");i.forEach((e,i)=>{if((0,n.alwaysValidSchema)(s,e))return;const r=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(r)})}};e.default=s},5882:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=n.operators,o={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},r={message:({keyword:t,schemaCode:e})=>n.str`must be ${o[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>n._`{comparison: ${o[t].okStr}, limit: ${e}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:r,code(t){const{keyword:e,data:i,schemaCode:s}=t;t.fail$data(n._`${i} ${o[e].fail} ${s} || isNaN(${i})`)}};e.default=a},5944:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(8343);n.code='require("ajv/dist/runtime/uri").default',e.default=n},6144:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2128),s=i(7060),o=i(6378),r=i(7532),a=i(9857),l=[n.default,s.default,(0,o.default)(),r.default,a.metadataVocabulary,a.contentVocabulary];e.default=l},6163:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>n._`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:i,parentSchema:o,it:r}=t;if(!Array.isArray(i))throw new Error("ajv implementation error");if(r.opts.discriminator&&o.discriminator)return;const a=i,l=e.let("valid",!1),c=e.let("passing",null),h=e.name("_valid");t.setParams({passing:c}),e.block(function(){a.forEach((i,o)=>{let a;(0,s.alwaysValidSchema)(r,i)?e.var(h,!0):a=t.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},h),o>0&&e.if(n._`${h} && ${l}`).assign(l,!1).assign(c,n._`[${c}, ${o}]`).else(),e.if(h,()=>{e.assign(l,!0),e.assign(c,o),a&&t.mergeEvaluated(a,n.Name)})})}),t.result(l,()=>t.reset(),()=>t.error(!0))}};e.default=o},6250:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2017);n.code='require("ajv/dist/runtime/equal").default',e.default=n},6378:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5457),s=i(5354),o=i(494),r=i(3966),a=i(2661),l=i(3025),c=i(9713),h=i(8660),u=i(117),d=i(5333),f=i(7923),p=i(6505),m=i(6163),g=i(5844),v=i(1239),y=i(4426);e.default=function(t=!1){const e=[f.default,p.default,m.default,g.default,v.default,y.default,c.default,h.default,l.default,u.default,d.default];return t?e.push(s.default,r.default):e.push(n.default,o.default),e.push(a.default),e}},6379:function(t){function e(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}
108
- /**
109
- * Sticky.js
110
- * Library for sticky elements written in vanilla javascript. With this library you can easily set sticky elements on your website. It's also responsive.
111
- *
112
- * @version 1.3.0
113
- * @author Rafal Galus <biuro@rafalgalus.pl>
114
- * @website https://rgalus.github.io/sticky-js/
115
- * @repo https://github.com/rgalus/sticky-js
116
- * @license https://github.com/rgalus/sticky-js/blob/master/LICENSE
117
- */
118
- var i,n=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.selector=e,this.elements=[],this.version="1.3.0",this.vp=this.getViewportSize(),this.body=document.querySelector("body"),this.options={wrap:i.wrap||!1,wrapWith:i.wrapWith||"<span></span>",marginTop:i.marginTop||0,marginBottom:i.marginBottom||0,stickyFor:i.stickyFor||0,stickyClass:i.stickyClass||null,stickyContainer:i.stickyContainer||"body"},this.updateScrollTopPosition=this.updateScrollTopPosition.bind(this),this.updateScrollTopPosition(),window.addEventListener("load",this.updateScrollTopPosition),window.addEventListener("scroll",this.updateScrollTopPosition),this.run()}var i,n,s;return i=t,(n=[{key:"run",value:function(){var t=this,e=setInterval(function(){if("complete"===document.readyState){clearInterval(e);var i=document.querySelectorAll(t.selector);t.forEach(i,function(e){return t.renderElement(e)})}},10)}},{key:"renderElement",value:function(t){var e=this;t.sticky={},t.sticky.active=!1,t.sticky.marginTop=parseInt(t.getAttribute("data-margin-top"))||this.options.marginTop,t.sticky.marginBottom=parseInt(t.getAttribute("data-margin-bottom"))||this.options.marginBottom,t.sticky.stickyFor=parseInt(t.getAttribute("data-sticky-for"))||this.options.stickyFor,t.sticky.stickyClass=t.getAttribute("data-sticky-class")||this.options.stickyClass,t.sticky.wrap=!!t.hasAttribute("data-sticky-wrap")||this.options.wrap,t.sticky.stickyContainer=this.options.stickyContainer,t.sticky.container=this.getStickyContainer(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect=this.getRectangle(t),"img"===t.tagName.toLowerCase()&&(t.onload=function(){return t.sticky.rect=e.getRectangle(t)}),t.sticky.wrap&&this.wrapElement(t),this.activate(t)}},{key:"wrapElement",value:function(t){t.insertAdjacentHTML("beforebegin",t.getAttribute("data-sticky-wrapWith")||this.options.wrapWith),t.previousSibling.appendChild(t)}},{key:"activate",value:function(t){t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active&&(t.sticky.active=!0),this.elements.indexOf(t)<0&&this.elements.push(t),t.sticky.resizeEvent||(this.initResizeEvents(t),t.sticky.resizeEvent=!0),t.sticky.scrollEvent||(this.initScrollEvents(t),t.sticky.scrollEvent=!0),this.setPosition(t)}},{key:"initResizeEvents",value:function(t){var e=this;t.sticky.resizeListener=function(){return e.onResizeEvents(t)},window.addEventListener("resize",t.sticky.resizeListener)}},{key:"destroyResizeEvents",value:function(t){window.removeEventListener("resize",t.sticky.resizeListener)}},{key:"onResizeEvents",value:function(t){this.vp=this.getViewportSize(),t.sticky.rect=this.getRectangle(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active?t.sticky.active=!0:(t.sticky.rect.top+t.sticky.rect.height>=t.sticky.container.rect.top+t.sticky.container.rect.height||t.sticky.stickyFor>=this.vp.width&&t.sticky.active)&&(t.sticky.active=!1),this.setPosition(t)}},{key:"initScrollEvents",value:function(t){var e=this;t.sticky.scrollListener=function(){return e.onScrollEvents(t)},window.addEventListener("scroll",t.sticky.scrollListener)}},{key:"destroyScrollEvents",value:function(t){window.removeEventListener("scroll",t.sticky.scrollListener)}},{key:"onScrollEvents",value:function(t){t.sticky&&t.sticky.active&&this.setPosition(t)}},{key:"setPosition",value:function(t){this.css(t,{position:"",width:"",top:"",left:""}),this.vp.height<t.sticky.rect.height||!t.sticky.active||(t.sticky.rect.width||(t.sticky.rect=this.getRectangle(t)),t.sticky.wrap&&this.css(t.parentNode,{display:"block",width:t.sticky.rect.width+"px",height:t.sticky.rect.height+"px"}),0===t.sticky.rect.top&&t.sticky.container===this.body?(this.css(t,{position:"fixed",top:t.sticky.rect.top+"px",left:t.sticky.rect.left+"px",width:t.sticky.rect.width+"px"}),t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass)):this.scrollTop>t.sticky.rect.top-t.sticky.marginTop?(this.css(t,{position:"fixed",width:t.sticky.rect.width+"px",left:t.sticky.rect.left+"px"}),this.scrollTop+t.sticky.rect.height+t.sticky.marginTop>t.sticky.container.rect.top+t.sticky.container.offsetHeight-t.sticky.marginBottom?(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{top:t.sticky.container.rect.top+t.sticky.container.offsetHeight-(this.scrollTop+t.sticky.rect.height+t.sticky.marginBottom)+"px"})):(t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass),this.css(t,{top:t.sticky.marginTop+"px"}))):(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{position:"",width:"",top:"",left:""}),t.sticky.wrap&&this.css(t.parentNode,{display:"",width:"",height:""})))}},{key:"update",value:function(){var t=this;this.forEach(this.elements,function(e){e.sticky.rect=t.getRectangle(e),e.sticky.container.rect=t.getRectangle(e.sticky.container),t.activate(e),t.setPosition(e)})}},{key:"destroy",value:function(){var t=this;window.removeEventListener("load",this.updateScrollTopPosition),window.removeEventListener("scroll",this.updateScrollTopPosition),this.forEach(this.elements,function(e){t.destroyResizeEvents(e),t.destroyScrollEvents(e),delete e.sticky})}},{key:"getStickyContainer",value:function(t){for(var e=t.parentNode;!e.hasAttribute("data-sticky-container")&&!e.parentNode.querySelector(t.sticky.stickyContainer)&&e!==this.body;)e=e.parentNode;return e}},{key:"getRectangle",value:function(t){this.css(t,{position:"",width:"",top:"",left:""});var e=Math.max(t.offsetWidth,t.clientWidth,t.scrollWidth),i=Math.max(t.offsetHeight,t.clientHeight,t.scrollHeight),n=0,s=0;do{n+=t.offsetTop||0,s+=t.offsetLeft||0,t=t.offsetParent}while(t);return{top:n,left:s,width:e,height:i}}},{key:"getViewportSize",value:function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}}},{key:"updateScrollTopPosition",value:function(){this.scrollTop=(window.pageYOffset||document.scrollTop)-(document.clientTop||0)||0}},{key:"forEach",value:function(t,e){for(var i=0,n=t.length;i<n;i++)e(t[i])}},{key:"css",value:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}}])&&e(i.prototype,n),s&&e(i,s),t}();i=n,t.exports=i},6438:(t,e,i)=>{var n=i(6379);t.exports=n},6461:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const n=i(3282),s=i(9029),o=s.operators,r={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},a={message:({keyword:t,schemaCode:e})=>s.str`should be ${r[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>s._`{comparison: ${r[t].okStr}, limit: ${e}}`};e.formatLimitDefinition={keyword:Object.keys(r),type:"string",schemaType:"string",$data:!0,error:a,code(t){const{gen:e,data:i,schemaCode:o,keyword:a,it:l}=t,{opts:c,self:h}=l;if(!c.validateFormats)return;const u=new n.KeywordCxt(l,h.RULES.all.format.definition,"format");function d(t){return s._`${t}.compare(${i}, ${o}) ${r[a].fail} 0`}u.$data?function(){const i=e.scopeValue("formats",{ref:h.formats,code:c.code.formats}),n=e.const("fmt",s._`${i}[${u.schemaCode}]`);t.fail$data((0,s.or)(s._`typeof ${n} != "object"`,s._`${n} instanceof RegExp`,s._`typeof ${n}.compare != "function"`,d(n)))}():function(){const i=u.schema,n=h.formats[i];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${i}" does not define "compare" function`);const o=e.scopeValue("formats",{key:i,ref:n,code:c.code.formats?s._`${c.code.formats}${(0,s.getProperty)(i)}`:void 0});t.fail$data(d(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)},6505:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:i(5765).validateUnion,error:{message:"must match a schema in anyOf"}};e.default=n},6605:(t,e,i)=>{var n,s,o;
119
- /*!
120
- * jQuery UI Controlgroup 1.14.1
121
- * https://jqueryui.com
122
- *
123
- * Copyright OpenJS Foundation and other contributors
124
- * Released under the MIT license.
125
- * https://jquery.org/license
126
- */!function(){"use strict";s=[i(4692),i(9139)],void 0===(o="function"==typeof(n=function(t){var e=/ui-corner-([a-z]){2,6}/g;return t.widget("ui.controlgroup",{version:"1.14.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(n,s){var o,r={};if(s)return"controlgroupLabel"===n?((o=e.element.find(s)).each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(o.get()))):void(t.fn[n]&&(r=e["_"+n+"Options"]?e["_"+n+"Options"]("middle"):{classes:{}},e.element.find(s).each(function(){var s=t(this),o=s[n]("instance"),a=t.widget.extend({},r);if("button"!==n||!s.parent(".ui-spinner").length){o||(o=s[n]()[n]("instance")),o&&(a.classes=e._resolveClassesValues(a.classes,o)),s[n](a);var l=s[n]("widget");t.data(l[0],"ui-controlgroup-data",o||s[n]("instance")),i.push(l[0])}})))}),this.childWidgets=t(t.uniqueSort(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this).data("ui-controlgroup-data");i&&i[e]&&i[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",n=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,n)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],n},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,n){var s={};return t.each(i,function(t){var o=n.options.classes[t]||"";o=String.prototype.trim.call(o.replace(e,"")),s[t]=(o+" "+i[t]).replace(/\s+/g," ")}),s},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,n){var s=e[n]().data("ui-controlgroup-data");if(s&&i["_"+s.widgetName+"Options"]){var o=i["_"+s.widgetName+"Options"](1===e.length?"only":n);o.classes=i._resolveClassesValues(o.classes,s),s.element[s.widgetName](o)}else i._updateCornerClass(e[n](),n)}),this._callChildMethod("refresh"))}})})?n.apply(e,s):n)||(t.exports=o)}()},6653:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(7652),o=i(3835),r=i(4551),a=i(4227),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===s.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:i}})=>n._`{error: ${t}, tag: ${i}, tagValue: ${e}}`},code(t){const{gen:e,data:i,schema:l,parentSchema:c,it:h}=t,{oneOf:u}=c;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const d=l.propertyName;if("string"!=typeof d)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const f=e.let("valid",!1),p=e.const("tag",n._`${i}${(0,n.getProperty)(d)}`);function m(i){const s=e.name("valid"),o=t.subschema({keyword:"oneOf",schemaProp:i},s);return t.mergeEvaluated(o,n.Name),s}e.if(n._`typeof ${p} == "string"`,()=>function(){const i=function(){var t;const e={},i=s(c);let n=!0;for(let e=0;e<u.length;e++){let c=u[e];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,h.self.RULES)){const t=c.$ref;if(c=o.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,t),c instanceof o.SchemaEnv&&(c=c.schema),void 0===c)throw new r.default(h.opts.uriResolver,h.baseId,t)}const f=null===(t=null==c?void 0:c.properties)||void 0===t?void 0:t[d];if("object"!=typeof f)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(i||s(c)),l(f,e)}if(!n)throw new Error(`discriminator: "${d}" must be required`);return e;function s({required:t}){return Array.isArray(t)&&t.includes(d)}function l(t,e){if(t.const)f(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${d}" must have "const" or "enum"`);for(const i of t.enum)f(i,e)}}function f(t,i){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${d}" values must be unique strings`);e[t]=i}}();e.if(!1);for(const t in i)e.elseIf(n._`${p} === ${t}`),e.assign(f,m(i[t]));e.else(),t.error(!1,{discrError:s.DiscrError.Mapping,tag:p,tagName:d}),e.endIf()}(),()=>t.error(!1,{discrError:s.DiscrError.Tag,tag:p,tagName:d})),t.ok(f)}};e.default=l},6883:(t,e,i)=>{var n,s,o;!function(){"use strict";s=[i(4692)],void 0===(o="function"==typeof(n=function(t){return t.ui=t.ui||{},t.ui.version="1.14.1"})?n.apply(e,s):n)||(t.exports=o)}()},6939:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;const n=i(4227),s=i(2017),o=i(7106),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(t,e=!0){return"boolean"==typeof t||(!0===e?!l(t):!!e&&c(t)<=e)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(t){for(const e in t){if(a.has(e))return!0;const i=t[e];if(Array.isArray(i)&&i.some(l))return!0;if("object"==typeof i&&l(i))return!0}return!1}function c(t){let e=0;for(const i in t){if("$ref"===i)return 1/0;if(e++,!r.has(i)&&("object"==typeof t[i]&&(0,n.eachItem)(t[i],t=>e+=c(t)),e===1/0))return 1/0}return e}function h(t,e="",i){!1!==i&&(e=f(e));const n=t.parse(e);return u(t,n)}function u(t,e){return t.serialize(e).split("#")[0]+"#"}e.getFullPath=h,e._getFullPath=u;const d=/#\/?$/;function f(t){return t?t.replace(d,""):""}e.normalizeId=f,e.resolveUrl=function(t,e,i){return i=f(i),t.resolve(e,i)};const p=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(t,e){if("boolean"==typeof t)return{};const{schemaId:i,uriResolver:n}=this.opts,r=f(t[i]||e),a={"":r},l=h(n,r,!1),c={},u=new Set;return o(t,{allKeys:!0},(t,e,n,s)=>{if(void 0===s)return;const o=l+e;let r=a[s];function h(e){const i=this.opts.uriResolver.resolve;if(e=f(r?i(r,e):e),u.has(e))throw m(e);u.add(e);let n=this.refs[e];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?d(t,n.schema,e):e!==f(o)&&("#"===e[0]?(d(t,c[e],e),c[e]=t):this.refs[e]=o),e}function g(t){if("string"==typeof t){if(!p.test(t))throw new Error(`invalid anchor "${t}"`);h.call(this,`#${t}`)}}"string"==typeof t[i]&&(r=h.call(this,t[i])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),a[e]=r}),c;function d(t,e,i){if(void 0!==e&&!s(t,e))throw m(i)}function m(t){return new Error(`reference "${t}" resolves to more than one schema`)}}},7007:t=>{"use strict";var e,i="object"==typeof Reflect?Reflect:null,n=i&&"function"==typeof i.apply?i.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};e=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise(function(i,n){function s(i){t.removeListener(e,o),n(i)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",s),i([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&m(t,"error",e,i)}(t,s,{once:!0})})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var r=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,i,n){var s,o,r,c;if(a(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),r=o[e]),void 0===r)r=o[e]=i,++t._eventsCount;else if("function"==typeof r?r=o[e]=n?[i,r]:[r,i]:n?r.unshift(i):r.push(i),(s=l(t))>0&&r.length>s&&!r.warned){r.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=r.length,c=h,console&&console.warn&&console.warn(c)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},s=h.bind(n);return s.listener=i,n.wrapFn=s,s}function d(t,e,i){var n=t._events;if(void 0===n)return[];var s=n[e];return void 0===s?[]:"function"==typeof s?i?[s.listener||s]:[s]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(s):p(s,s.length)}function f(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function p(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function m(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function s(o){n.once&&t.removeEventListener(e,s),i(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");r=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var s="error"===t,o=this._events;if(void 0!==o)s=s&&void 0===o.error;else if(!s)return!1;if(s){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var l=o[t];if(void 0===l)return!1;if("function"==typeof l)n(l,this,e);else{var c=l.length,h=p(l,c);for(i=0;i<c;++i)n(h[i],this,e)}return!0},o.prototype.addListener=function(t,e){return c(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return c(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,u(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,u(this,t,e)),this},o.prototype.removeListener=function(t,e){var i,n,s,o,r;if(a(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===e||i[o].listener===e){r=i[o].listener,s=o;break}if(s<0)return this;0===s?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,s),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,r||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var s,o=Object.keys(i);for(n=0;n<o.length;++n)"removeListener"!==(s=o[n])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return d(this,t,!0)},o.prototype.rawListeners=function(t){return d(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},7060:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5882),s=i(3439),o=i(7307),r=i(422),a=i(4486),l=i(4003),c=i(1163),h=i(617),u=i(7935),d=i(8643),f=[n.default,s.default,o.default,r.default,a.default,l.default,c.default,h.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];e.default=f},7106:t=>{"use strict";var e=t.exports=function(t,e,n){"function"==typeof e&&(n=e,e={}),i(e,"function"==typeof(n=e.cb||n)?n:n.pre||function(){},n.post||function(){},t,"",t)};function i(t,s,o,r,a,l,c,h,u,d){if(r&&"object"==typeof r&&!Array.isArray(r)){for(var f in s(r,a,l,c,h,u,d),r){var p=r[f];if(Array.isArray(p)){if(f in e.arrayKeywords)for(var m=0;m<p.length;m++)i(t,s,o,p[m],a+"/"+f+"/"+m,l,a,f,r,m)}else if(f in e.propsKeywords){if(p&&"object"==typeof p)for(var g in p)i(t,s,o,p[g],a+"/"+f+"/"+n(g),l,a,f,r,g)}else(f in e.keywords||t.allKeys&&!(f in e.skipKeywords))&&i(t,s,o,p,a+"/"+f,l,a,f,r)}o(r,a,l,c,h,u,d)}}function n(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7144:(t,e,i)=>{var n,s,o;
127
- /*!
128
- * jQuery UI Tabbable 1.14.1
129
- * https://jqueryui.com
130
- *
131
- * Copyright OpenJS Foundation and other contributors
132
- * Released under the MIT license.
133
- * https://jquery.org/license
134
- */!function(){"use strict";s=[i(4692),i(6883),i(1255)],void 0===(o="function"==typeof(n=function(t){return t.extend(t.expr.pseudos,{tabbable:function(e){var i=t.attr(e,"tabindex"),n=null!=i;return(!n||i>=0)&&t.ui.focusable(e,n)}})})?n.apply(e,s):n)||(t.exports=o)}()},7146:t=>{var e={create:function(t){var e;if(t=t.trim(),/<.*>/g.test(t)){var i=document.createElement("div");i.innerHTML=t,e=i.firstChild}else e=document.createElement(t);if(!this.isValidNode(e))throw new Error("Element not valid");return e},isValidNode:function(t){return t&&"nodeType"in t},render:function(t,e){var i;if(e=null==(i=e)?[]:Array.isArray(i)?i:[i],!this.isValidNode(t))throw new Error("Require a valid HTML Element");return e.forEach(function(e){t.appendChild(e)}),t}};t.exports=e},7307:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o=i(3853),r={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:t,schemaCode:e}){const i="maxLength"===t?"more":"fewer";return n.str`must NOT have ${i} than ${e} characters`},params:({schemaCode:t})=>n._`{limit: ${t}}`},code(t){const{keyword:e,data:i,schemaCode:r,it:a}=t,l="maxLength"===e?n.operators.GT:n.operators.LT,c=!1===a.opts.unicode?n._`${i}.length`:n._`${(0,s.useFunc)(t.gen,o.default)}(${i})`;t.fail$data(n._`${c} ${l} ${r}`)}};e.default=r},7334:t=>{function e(t,e=100,i={}){if("function"!=typeof t)throw new TypeError(`Expected the first parameter to be a function, got \`${typeof t}\`.`);if(e<0)throw new RangeError("`wait` must not be negative.");const{immediate:n}="boolean"==typeof i?{immediate:i}:i;let s,o,r,a,l;function c(){const e=s,i=o;return s=void 0,o=void 0,l=t.apply(e,i),l}function h(){const t=Date.now()-a;t<e&&t>=0?r=setTimeout(h,e-t):(r=void 0,n||(l=c()))}const u=function(...t){if(s&&this!==s&&Object.getPrototypeOf(this)===Object.getPrototypeOf(s))throw new Error("Debounced method called with different contexts of the same prototype.");s=this,o=t,a=Date.now();const i=n&&!r;return r||(r=setTimeout(h,e)),i&&(l=c()),l};return Object.defineProperty(u,"isPending",{get:()=>void 0!==r}),u.clear=()=>{r&&(clearTimeout(r),r=void 0)},u.flush=()=>{r&&u.trigger()},u.trigger=()=>{l=c(),u.clear()},u}t.exports.debounce=e,t.exports=e},7512:(t,e,i)=>{var n=i(3036);function s(t,e,i,n,s){var r=o.apply(this,arguments);return t.addEventListener(i,r,s),{destroy:function(){t.removeEventListener(i,r,s)}}}function o(t,e,i,s){return function(i){i.delegateTarget=n(i.target,e),i.delegateTarget&&s.call(t,i)}}t.exports=function(t,e,i,n,o){return"function"==typeof t.addEventListener?s.apply(null,arguments):"function"==typeof i?s.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return s(t,e,i,n,o)}))}},7532:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=[i(4737).default];e.default=n},7652:(t,e)=>{"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(i||(e.DiscrError=i={}))},7687:(t,e,i)=>{var n,s,o;
135
- /*!
136
- * jQuery UI Form Reset Mixin 1.14.1
137
- * https://jqueryui.com
138
- *
139
- * Copyright OpenJS Foundation and other contributors
140
- * Released under the MIT license.
141
- * https://jquery.org/license
142
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=t(this.element.prop("form")),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}}})?n.apply(e,s):n)||(t.exports=o)}()},7845:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const n=i(1520);class s extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}}var o;!function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"}(o||(e.UsedValueState=o={})),e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class r{constructor({prefixes:t,parent:e}={}){this._names={},this._prefixes=t,this._parent=e}toName(t){return t instanceof n.Name?t:this.name(t)}name(t){return new n.Name(this._newName(t))}_newName(t){return`${t}${(this._names[t]||this._nameGroup(t)).index++}`}_nameGroup(t){var e,i;if((null===(i=null===(e=this._parent)||void 0===e?void 0:e._prefixes)||void 0===i?void 0:i.has(t))||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}}e.Scope=r;class a extends n.Name{constructor(t,e){super(e),this.prefix=t}setValue(t,{property:e,itemIndex:i}){this.value=t,this.scopePath=n._`.${new n.Name(e)}[${i}]`}}e.ValueScopeName=a;const l=n._`\n`;e.ValueScope=class extends r{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?l:n.nil}}get(){return this._scope}name(t){return new a(t,this._newName(t))}value(t,e){var i;if(void 0===e.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(t),{prefix:s}=n,o=null!==(i=e.key)&&void 0!==i?i:e.ref;let r=this._values[s];if(r){const t=r.get(o);if(t)return t}else r=this._values[s]=new Map;r.set(o,n);const a=this._scope[s]||(this._scope[s]=[]),l=a.length;return a[l]=e.ref,n.setValue(e,{property:s,itemIndex:l}),n}getValue(t,e){const i=this._values[t];if(i)return i.get(e)}scopeRefs(t,e=this._values){return this._reduceValues(e,e=>{if(void 0===e.scopePath)throw new Error(`CodeGen: name "${e}" has no value`);return n._`${t}${e.scopePath}`})}scopeCode(t=this._values,e,i){return this._reduceValues(t,t=>{if(void 0===t.value)throw new Error(`CodeGen: name "${t}" has no value`);return t.value.code},e,i)}_reduceValues(t,i,r={},a){let l=n.nil;for(const c in t){const h=t[c];if(!h)continue;const u=r[c]=r[c]||new Map;h.forEach(t=>{if(u.has(t))return;u.set(t,o.Started);let r=i(t);if(r){const i=this.opts.es5?e.varKinds.var:e.varKinds.const;l=n._`${l}${i} ${t} = ${r};${this.opts._n}`}else{if(!(r=null==a?void 0:a(t)))throw new s(t);l=n._`${l}${r}${this.opts._n}`}u.set(t,o.Completed)})}return l}}},7870:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;const n=i(9029),s=i(4227);function o(t,e,i){const{gen:o,compositeRule:r,data:a,opts:l}=t;if(void 0===i)return;const c=n._`${a}${(0,n.getProperty)(e)}`;if(r)return void(0,s.checkStrictMode)(t,`default is ignored for: ${c}`);let h=n._`${c} === undefined`;"empty"===l.useDefaults&&(h=n._`${h} || ${c} === null || ${c} === ""`),o.if(h,n._`${c} = ${(0,n.stringify)(i)}`)}e.assignDefaults=function(t,e){const{properties:i,items:n}=t.schema;if("object"===e&&i)for(const e in i)o(t,e,i[e].default);else"array"===e&&Array.isArray(n)&&n.forEach((e,i)=>o(t,i,e.default))}},7887:(t,e)=>{"use strict";function i(t,e){return e.rules.some(e=>n(t,e))}function n(t,e){var i;return void 0!==t[e.keyword]||(null===(i=e.definition.implements)||void 0===i?void 0:i.some(e=>void 0!==t[e]))}Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0,e.schemaHasRulesForType=function({schema:t,self:e},n){const s=e.RULES.types[n];return s&&!0!==s&&i(t,s)},e.shouldUseGroup=i,e.shouldUseRule=n},7901:(t,e,i)=>{var n="[object Symbol]",s=/[&<>"'`]/g,o=RegExp(s.source),r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,a="object"==typeof self&&self&&self.Object===Object&&self,l=r||a||Function("return this")();var c,h=(c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},function(t){return null==c?void 0:c[t]}),u=Object.prototype.toString,d=l.Symbol,f=d?d.prototype:void 0,p=f?f.toString:void 0;function m(t){if("string"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&u.call(t)==n}(t))return p?p.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}t.exports=function(t){var e;return(t=null==(e=t)?"":m(e))&&o.test(t)?t.replace(s,h):t}},7923:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4227),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:i,it:s}=t;if((0,n.alwaysValidSchema)(s,i))return void t.fail();const o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};e.default=s},7935:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o=i(6250),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>n._`{allowedValue: ${t}}`},code(t){const{gen:e,data:i,$data:r,schemaCode:a,schema:l}=t;r||l&&"object"==typeof l?t.fail$data(n._`!${(0,s.useFunc)(e,o.default)}(${i}, ${a})`):t.fail(n._`${l} !== ${i}`)}};e.default=r},7975:t=>{"use strict";function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function i(t,e){for(var i,n="",s=0,o=-1,r=0,a=0;a<=t.length;++a){if(a<t.length)i=t.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(o===a-1||1===r);else if(o!==a-1&&2===r){if(n.length<2||2!==s||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",s=0):s=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,r=0;continue}}else if(2===n.length||1===n.length){n="",s=0,o=a,r=0;continue}e&&(n.length>0?n+="/..":n="..",s=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),s=a-o-1;o=a,r=0}else 46===i&&-1!==r?++r:r=-1}return n}var n={resolve:function(){for(var t,n="",s=!1,o=arguments.length-1;o>=-1&&!s;o--){var r;o>=0?r=arguments[o]:(void 0===t&&(t=process.cwd()),r=t),e(r),0!==r.length&&(n=r+"/"+n,s=47===r.charCodeAt(0))}return n=i(n,!s),s?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),s=47===t.charCodeAt(t.length-1);return 0!==(t=i(t,!n)).length||n||(t="."),t.length>0&&s&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,i=0;i<arguments.length;++i){var s=arguments[i];e(s),s.length>0&&(void 0===t?t=s:t+="/"+s)}return void 0===t?".":n.normalize(t)},relative:function(t,i){if(e(t),e(i),t===i)return"";if((t=n.resolve(t))===(i=n.resolve(i)))return"";for(var s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var o=t.length,r=o-s,a=1;a<i.length&&47===i.charCodeAt(a);++a);for(var l=i.length-a,c=r<l?r:l,h=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===i.charCodeAt(a+u))return i.slice(a+u+1);if(0===u)return i.slice(a+u)}else r>c&&(47===t.charCodeAt(s+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(s+u);if(d!==i.charCodeAt(a+u))break;47===d&&(h=u)}var f="";for(u=s+h+1;u<=o;++u)u!==o&&47!==t.charCodeAt(u)||(0===f.length?f+="..":f+="/..");return f.length>0?f+i.slice(a+h):(a+=h,47===i.charCodeAt(a)&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return".";for(var i=t.charCodeAt(0),n=47===i,s=-1,o=!0,r=t.length-1;r>=1;--r)if(47===(i=t.charCodeAt(r))){if(!o){s=r;break}}else o=!1;return-1===s?n?"/":".":n&&1===s?"//":t.slice(0,s)},basename:function(t,i){if(void 0!==i&&"string"!=typeof i)throw new TypeError('"ext" argument must be a string');e(t);var n,s=0,o=-1,r=!0;if(void 0!==i&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var a=i.length-1,l=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!r){s=n+1;break}}else-1===l&&(r=!1,l=n+1),a>=0&&(c===i.charCodeAt(a)?-1===--a&&(o=n):(a=-1,o=l))}return s===o?o=l:-1===o&&(o=t.length),t.slice(s,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!r){s=n+1;break}}else-1===o&&(r=!1,o=n+1);return-1===o?"":t.slice(s,o)},extname:function(t){e(t);for(var i=-1,n=0,s=-1,o=!0,r=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===s&&(o=!1,s=a+1),46===l?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1);else if(!o){n=a+1;break}}return-1===i||-1===s||0===r||1===r&&i===s-1&&i===n+1?"":t.slice(i,s)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){e(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return i;var n,s=t.charCodeAt(0),o=47===s;o?(i.root="/",n=1):n=0;for(var r=-1,a=0,l=-1,c=!0,h=t.length-1,u=0;h>=n;--h)if(47!==(s=t.charCodeAt(h)))-1===l&&(c=!1,l=h+1),46===s?-1===r?r=h:1!==u&&(u=1):-1!==r&&(u=-1);else if(!c){a=h+1;break}return-1===r||-1===l||0===u||1===u&&r===l-1&&r===a+1?-1!==l&&(i.base=i.name=0===a&&o?t.slice(1,l):t.slice(a,l)):(0===a&&o?(i.name=t.slice(1,r),i.base=t.slice(1,l)):(i.name=t.slice(a,r),i.base=t.slice(a,l)),i.ext=t.slice(r,l)),a>0?i.dir=t.slice(0,a-1):o&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n},8182:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4018),s=i(6461),o=i(9029),r=new o.Name("fullFormats"),a=new o.Name("fastFormats"),l=(t,e={keywords:!0})=>{if(Array.isArray(e))return c(t,e,n.fullFormats,r),t;const[i,o]="fast"===e.mode?[n.fastFormats,a]:[n.fullFormats,r];return c(t,e.formats||n.formatNames,i,o),e.keywords&&(0,s.default)(t),t};function c(t,e,i,n){var s,r;null!==(s=(r=t.opts.code).formats)&&void 0!==s||(r.formats=o._`require("ajv-formats/dist/formats").${n}`);for(const n of e)t.addFormat(n,i[n])}l.get=(t,e="full")=>{const i=("fast"===e?n.fastFormats:n.fullFormats)[t];if(!i)throw new Error(`Unknown format "${t}"`);return i},t.exports=e=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l},8343:(t,e,i)=>{"use strict";const{normalizeIPv6:n,removeDotSegments:s,recomposeAuthority:o,normalizeComponentEncoding:r,isIPv4:a,nonSimpleDomain:l}=i(4834),{SCHEMES:c,getSchemeHandler:h}=i(343);function u(t,e,i,n){const o={};return n||(t=p(d(t,i),i),e=p(d(e,i),i)),!(i=i||{}).tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=s(e.path||""),o.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=s(e.path||""),o.query=e.query):(e.path?("/"===e.path[0]?o.path=s(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path:o.path="/"+e.path,o.path=s(o.path)),o.query=e.query):(o.path=t.path,void 0!==e.query?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}function d(t,e){const i={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),r=[],a=h(n.scheme||i.scheme);a&&a.serialize&&a.serialize(i,n),void 0!==i.path&&(n.skipEscape?i.path=unescape(i.path):(i.path=escape(i.path),void 0!==i.scheme&&(i.path=i.path.split("%3A").join(":")))),"suffix"!==n.reference&&i.scheme&&r.push(i.scheme,":");const l=o(i);if(void 0!==l&&("suffix"!==n.reference&&r.push("//"),r.push(l),i.path&&"/"!==i.path[0]&&r.push("/")),void 0!==i.path){let t=i.path;n.absolutePath||a&&a.absolutePath||(t=s(t)),void 0===l&&"/"===t[0]&&"/"===t[1]&&(t="/%2F"+t.slice(2)),r.push(t)}return void 0!==i.query&&r.push("?",i.query),void 0!==i.fragment&&r.push("#",i.fragment),r.join("")}const f=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(t,e){const i=Object.assign({},e),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1;"suffix"===i.reference&&(t=i.scheme?i.scheme+":"+t:"//"+t);const r=t.match(f);if(r){if(s.scheme=r[1],s.userinfo=r[3],s.host=r[4],s.port=parseInt(r[5],10),s.path=r[6]||"",s.query=r[7],s.fragment=r[8],isNaN(s.port)&&(s.port=r[5]),s.host){if(!1===a(s.host)){const t=n(s.host);s.host=t.host.toLowerCase(),o=t.isIPV6}else o=!0}void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",i.reference&&"suffix"!==i.reference&&i.reference!==s.reference&&(s.error=s.error||"URI is not a "+i.reference+" reference.");const e=h(i.scheme||s.scheme);if(!(i.unicodeSupport||e&&e.unicodeSupport)&&s.host&&(i.domainHost||e&&e.domainHost)&&!1===o&&l(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(t){s.error=s.error||"Host's domain name can not be converted to ASCII: "+t}(!e||e&&!e.skipNormalize)&&(-1!==t.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=unescape(s.host))),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),e&&e.parse&&e.parse(s,i)}else s.error=s.error||"URI can not be parsed.";return s}const m={SCHEMES:c,normalize:function(t,e){return"string"==typeof t?t=d(p(t,e),e):"object"==typeof t&&(t=p(d(t,e),e)),t},resolve:function(t,e,i){const n=i?Object.assign({scheme:"null"},i):{scheme:"null"},s=u(p(t,n),p(e,n),n,!0);return n.skipEscape=!0,d(s,n)},resolveComponent:u,equal:function(t,e,i){return"string"==typeof t?(t=unescape(t),t=d(r(p(t,i),!0),{...i,skipEscape:!0})):"object"==typeof t&&(t=d(r(t,!0),{...i,skipEscape:!0})),"string"==typeof e?(e=unescape(e),e=d(r(p(e,i),!0),{...i,skipEscape:!0})):"object"==typeof e&&(e=d(r(e,!0),{...i,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()},serialize:d,parse:p};t.exports=m,t.exports.default=m,t.exports.fastUri=m},8481:(t,e,i)=>{var n,s,o;
143
- /*!
144
- * jQuery UI Button 1.14.1
145
- * https://jqueryui.com
146
- *
147
- * Copyright OpenJS Foundation and other contributors
148
- * Released under the MIT license.
149
- * https://jquery.org/license
150
- */!function(){"use strict";s=[i(4692),i(6605),i(2097),i(1897),i(9139)],n=function(t){t.widget("ui.button",{version:"1.14.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var n="iconPosition"!==e,s=n?this.options.iconPosition:i,o="top"===s||"bottom"===s;this.icon?n&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),n&&this._addClass(this.icon,null,i),this._attachIcon(s),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!0===t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),t.fn.button=(e=t.fn.button,function(i){var n="string"==typeof i,s=Array.prototype.slice.call(arguments,1),o=this;return n?this.length||"instance"!==i?this.each(function(){var e,n=t(this).attr("type"),r="checkbox"!==n&&"radio"!==n?"button":"checkboxradio",a=t.data(this,"ui-"+r);return"instance"===i?(o=a,!1):a?"function"!=typeof a[i]||"_"===i.charAt(0)?t.error("no such method '"+i+"' for button widget instance"):(e=a[i].apply(a,s))!==a&&void 0!==e?(o=e&&e.jquery?o.pushStack(e.get()):e,!1):void 0:t.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(s.length&&(i=t.widget.extend.apply(null,[i].concat(s))),this.each(function(){var n=t(this).attr("type"),s="checkbox"!==n&&"radio"!==n?"button":"checkboxradio",o=t.data(this,"ui-"+s);if(o)o.option(i||{}),o._init&&o._init();else{if("button"===s)return void e.call(t(this),i);t(this).checkboxradio(t.extend({icon:!1},i))}})),o}),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var e;return t.ui.button},void 0===(o="function"==typeof n?n.apply(e,s):n)||(t.exports=o)}()},8604:(t,e,i)=>{var n,s,o;
151
- /*!
152
- * jQuery UI Resizable 1.14.1
153
- * https://jqueryui.com
154
- *
155
- * Copyright OpenJS Foundation and other contributors
156
- * Released under the MIT license.
157
- * https://jquery.org/license
158
- */!function(){"use strict";s=[i(4692),i(3662),i(724),i(2336),i(6883),i(9139)],n=function(t){return t.widget("ui.resizable",t.ui.mouse,{version:"1.14.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){var n,s=!1,o=t(e).css("overflow");if("hidden"===o)return!1;if("scroll"===o)return!0;if(e[n=i&&"left"===i?"scrollLeft":"scrollTop"]>0)return!0;try{e[n]=1,s=e[n]>0,e[n]=0}catch(t){}return s},_create:function(){var e,i=this.options,n=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(n._removeClass("ui-resizable-autohide"),n._handles.show())}).on("mouseleave",function(){i.disabled||n.resizing||(n._addClass("ui-resizable-autohide"),n._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable")};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var e,i,n,s,o,r=this.options,a=this;if(this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this._addedHandles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)s="ui-resizable-"+(e=String.prototype.trim.call(n[i])),o=t("<div>"),this._addClass(o,"ui-resizable-handle "+s),o.css({zIndex:r.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.children(this.handles[e]).length||(this.element.append(o),this._addedHandles=this._addedHandles.add(o));this._renderAxis=function(e){var i,n,s,o;for(i in e=e||this.element,this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),s=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(s,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=o&&o[1]?o[1]:"se")}),r.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(e){var i,n,s=!1;for(i in this.handles)((n=t(this.handles[i])[0])===e.target||t.contains(n,e.target))&&(s=!0);return!this.options.disabled&&s},_mouseStart:function(e){var i,n,s,o,r=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),r.containment&&(i+=t(r.containment).scrollLeft()||0,n+=t(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this._helper||(o=this._calculateAdjustedElementDimensions(a)),this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width,height:o.height},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:o.width,height:o.height},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:n},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,n,s=this.originalMousePosition,o=this.axis,r=e.pageX-s.left||0,a=e.pageY-s.top||0,l=this._change[o];return this._updatePrevProperties(),!!l&&(i=l.apply(this,[e,r,a]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),n=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,n,s,o,r,a,l,c=this.options,h=this;return this._helper&&(s=(n=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:h.sizeDiff.height,o=n?0:h.sizeDiff.width,r={width:h.helper.width()-o,height:h.helper.height()-s},a=parseFloat(h.element.css("left"))+(h.position.left-h.originalPosition.left)||null,l=parseFloat(h.element.css("top"))+(h.position.top-h.originalPosition.top)||null,c.animate||this.element.css(t.extend(r,{top:l,left:a})),h.helper.height(h.size.height),h.helper.width(h.size.width),this._helper&&!c.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.helper.css(t),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px",this.helper.width(t.width)),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px",this.helper.height(t.height)),t},_updateVirtualBoundaries:function(t){var e,i,n,s,o,r=this.options;o={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:1/0,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,s=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),i<o.maxWidth&&(o.maxWidth=i),s<o.maxHeight&&(o.maxHeight=s)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,n=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,n=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,s=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,c=/sw|nw|w/.test(i),h=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),s&&(t.height=e.maxHeight),o&&c&&(t.left=a-e.minWidth),n&&c&&(t.left=a-e.maxWidth),r&&h&&(t.top=l-e.minHeight),s&&h&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],n=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],s=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(n[e])||0,i[e]+=parseFloat(s[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_calculateAdjustedElementDimensions:function(t){var e,i,n,s=t.get(0);return"content-box"!==t.css("box-sizing")||!this._hasScroll(s)&&!this._hasScroll(s,"left")?{height:parseFloat(t.css("height")),width:parseFloat(t.css("width"))}:(e=parseFloat(s.style.width),i=parseFloat(s.style.height),n=this._getPaddingPlusBorderDimensions(t),e=isNaN(e)?this._getElementTheoreticalSize(t,n,"width"):e,{height:i=isNaN(i)?this._getElementTheoreticalSize(t,n,"height"):i,width:e})},_getElementTheoreticalSize:function(t,e,i){return Math.max(0,Math.ceil(t.get(0)["offset"+i[0].toUpperCase()+i.slice(1)]-e[i]-.5))||0},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var n=this.originalSize;return{top:this.originalPosition.top+i,height:n.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},sw:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,n]))},ne:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},nw:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,n]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),n=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),r=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=o?0:i.sizeDiff.width,l={width:i.size.width-a,height:i.size.height-r},c=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,h=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,h&&c?{top:h,left:c}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&t(s[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,n,s,o,r,a,l=t(this).resizable("instance"),c=l.options,h=l.element,u=c.containment,d=u instanceof t?u.get(0):/parent/.test(u)?h.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){i[t]=l._num(e.css("padding"+n))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},n=l.containerOffset,s=l.containerSize.height,o=l.containerSize.width,r=l._hasScroll(d,"left")?d.scrollWidth:o,a=l._hasScroll(d)?d.scrollHeight:s,l.parentData={element:d,left:n.left,top:n.top,width:r,height:a}))},resize:function(e){var i,n,s,o,r=t(this).resizable("instance"),a=r.options,l=r.containerOffset,c=r.position,h=r._aspectRatio||e.shiftKey,u={top:0,left:0},d=r.containerElement,f=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),c.left<(r._helper?l.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-l.left:r.position.left-u.left),h&&(r.size.height=r.size.width/r.aspectRatio,f=!1),r.position.left=a.helper?l.left:0),c.top<(r._helper?l.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-l.top:r.position.top),h&&(r.size.width=r.size.height*r.aspectRatio,f=!1),r.position.top=r._helper?l.top:0),s=r.containerElement.get(0)===r.element.parent().get(0),o=/relative|absolute/.test(r.containerElement.css("position")),s&&o?(r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top):(r.offset.left=r.element.offset().left,r.offset.top=r.element.offset().top),i=Math.abs(r.sizeDiff.width+(r._helper?r.offset.left-u.left:r.offset.left-l.left)),n=Math.abs(r.sizeDiff.height+(r._helper?r.offset.top-u.top:r.offset.top-l.top)),i+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-i,h&&(r.size.height=r.size.width/r.aspectRatio,f=!1)),n+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-n,h&&(r.size.width=r.size.height*r.aspectRatio,f=!1)),f||(r.position.left=r.prevPosition.left,r.position.top=r.prevPosition.top,r.size.width=r.prevSize.width,r.size.height=r.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,n=e.containerOffset,s=e.containerPosition,o=e.containerElement,r=t(e.helper),a=r.offset(),l=r.outerWidth()-e.sizeDiff.width,c=r.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:a.left-s.left-n.left,width:l,height:c}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:a.left-s.left-n.left,width:l,height:c})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var i=t(this),n=e._calculateAdjustedElementDimensions(i);i.data("ui-resizable-alsoresize",{width:n.width,height:n.height,left:parseFloat(i.css("left")),top:parseFloat(i.css("top"))})})},resize:function(e,i){var n=t(this).resizable("instance"),s=n.options,o=n.originalSize,r=n.originalPosition,a={height:n.size.height-o.height||0,width:n.size.width-o.width||0,top:n.position.top-r.top||0,left:n.position.left-r.left||0};t(s.alsoResize).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),s={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(a[e]||0);i&&i>=0&&(s[e]=i||null)}),e.css(s)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!0===t.uiBackCompat&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),n=i.options,s=i.size,o=i.originalSize,r=i.originalPosition,a=i.axis,l="number"==typeof n.grid?[n.grid,n.grid]:n.grid,c=l[0]||1,h=l[1]||1,u=Math.round((s.width-o.width)/c)*c,d=Math.round((s.height-o.height)/h)*h,f=o.width+u,p=o.height+d,m=n.maxWidth&&n.maxWidth<f,g=n.maxHeight&&n.maxHeight<p,v=n.minWidth&&n.minWidth>f,y=n.minHeight&&n.minHeight>p;n.grid=l,v&&(f+=c),y&&(p+=h),m&&(f-=c),g&&(p-=h),/^(se|s|e)$/.test(a)?(i.size.width=f,i.size.height=p):/^(ne)$/.test(a)?(i.size.width=f,i.size.height=p,i.position.top=r.top-d):/^(sw)$/.test(a)?(i.size.width=f,i.size.height=p,i.position.left=r.left-u):((p-h<=0||f-c<=0)&&(e=i._getPaddingPlusBorderDimensions(this)),p-h>0?(i.size.height=p,i.position.top=r.top-d):(p=h-e.height,i.size.height=p,i.position.top=r.top+o.height-p),f-c>0?(i.size.width=f,i.position.left=r.left-u):(f=c-e.width,i.size.width=f,i.position.left=r.left+o.width-f))}}),t.ui.resizable},void 0===(o="function"==typeof n?n.apply(e,s):n)||(t.exports=o)}()},8643:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o=i(6250),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>n._`{allowedValues: ${t}}`},code(t){const{gen:e,data:i,$data:r,schema:a,schemaCode:l,it:c}=t;if(!r&&0===a.length)throw new Error("enum must have non-empty array");const h=a.length>=c.opts.loopEnum;let u;const d=()=>null!=u?u:u=(0,s.useFunc)(e,o.default);let f;if(h||r)f=e.let("valid"),t.block$data(f,function(){e.assign(f,!1),e.forOf("v",l,t=>e.if(n._`${d()}(${i}, ${t})`,()=>e.assign(f,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const t=e.const("vSchema",l);f=(0,n.or)(...a.map((e,s)=>function(t,e){const s=a[e];return"object"==typeof s&&null!==s?n._`${d()}(${i}, ${t}[${e}])`:n._`${i} === ${s}`}(t,s)))}t.pass(f)}};e.default=r},8660:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(5765),s=i(9029),o=i(2023),r=i(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>s._`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:i,parentSchema:a,data:l,errsCount:c,it:h}=t;if(!c)throw new Error("ajv implementation error");const{allErrors:u,opts:d}=h;if(h.props=!0,"all"!==d.removeAdditional&&(0,r.alwaysValidSchema)(h,i))return;const f=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(t){e.code(s._`delete ${l}[${t}]`)}function g(n){if("all"===d.removeAdditional||d.removeAdditional&&!1===i)m(n);else{if(!1===i)return t.setParams({additionalProperty:n}),t.error(),void(u||e.break());if("object"==typeof i&&!(0,r.alwaysValidSchema)(h,i)){const i=e.name("valid");"failing"===d.removeAdditional?(v(n,i,!1),e.if((0,s.not)(i),()=>{t.reset(),m(n)})):(v(n,i),u||e.if((0,s.not)(i),()=>e.break()))}}}function v(e,i,n){const s={keyword:"additionalProperties",dataProp:e,dataPropType:r.Type.Str};!1===n&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(s,i)}e.forIn("key",l,i=>{f.length||p.length?e.if(function(i){let o;if(f.length>8){const t=(0,r.schemaRefOrVal)(h,a.properties,"properties");o=(0,n.isOwnProperty)(e,t,i)}else o=f.length?(0,s.or)(...f.map(t=>s._`${i} === ${t}`)):s.nil;return p.length&&(o=(0,s.or)(o,...p.map(e=>s._`${(0,n.usePattern)(t,e)}.test(${i})`))),(0,s.not)(o)}(i),()=>g(i)):g(i)}),t.ok(s._`${c} === ${o.default.errors}`)}};e.default=a},8708:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const n=i(9029),s=i(4227),o=i(2023);function r(t,e){const i=t.const("err",e);t.if(n._`${o.default.vErrors} === null`,()=>t.assign(o.default.vErrors,n._`[${i}]`),n._`${o.default.vErrors}.push(${i})`),t.code(n._`${o.default.errors}++`)}function a(t,e){const{gen:i,validateName:s,schemaEnv:o}=t;o.$async?i.throw(n._`new ${t.ValidationError}(${e})`):(i.assign(n._`${s}.errors`,e),i.return(!1))}e.keywordError={message:({keyword:t})=>n.str`must pass "${t}" keyword validation`},e.keyword$DataError={message:({keyword:t,schemaType:e})=>e?n.str`"${t}" keyword must be ${e} ($data)`:n.str`"${t}" keyword is invalid ($data)`},e.reportError=function(t,i=e.keywordError,s,o){const{it:l}=t,{gen:h,compositeRule:u,allErrors:d}=l,f=c(t,i,s);(null!=o?o:u||d)?r(h,f):a(l,n._`[${f}]`)},e.reportExtraError=function(t,i=e.keywordError,n){const{it:s}=t,{gen:l,compositeRule:h,allErrors:u}=s;r(l,c(t,i,n)),h||u||a(s,o.default.vErrors)},e.resetErrorsCount=function(t,e){t.assign(o.default.errors,e),t.if(n._`${o.default.vErrors} !== null`,()=>t.if(e,()=>t.assign(n._`${o.default.vErrors}.length`,e),()=>t.assign(o.default.vErrors,null)))},e.extendErrors=function({gen:t,keyword:e,schemaValue:i,data:s,errsCount:r,it:a}){if(void 0===r)throw new Error("ajv implementation error");const l=t.name("err");t.forRange("i",r,o.default.errors,r=>{t.const(l,n._`${o.default.vErrors}[${r}]`),t.if(n._`${l}.instancePath === undefined`,()=>t.assign(n._`${l}.instancePath`,(0,n.strConcat)(o.default.instancePath,a.errorPath))),t.assign(n._`${l}.schemaPath`,n.str`${a.errSchemaPath}/${e}`),a.opts.verbose&&(t.assign(n._`${l}.schema`,i),t.assign(n._`${l}.data`,s))})};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(t,e,i){const{createErrors:s}=t.it;return!1===s?n._`{}`:function(t,e,i={}){const{gen:s,it:r}=t,a=[h(r,i),u(t,i)];return function(t,{params:e,message:i},s){const{keyword:r,data:a,schemaValue:c,it:h}=t,{opts:u,propertyName:d,topSchemaRef:f,schemaPath:p}=h;s.push([l.keyword,r],[l.params,"function"==typeof e?e(t):e||n._`{}`]),u.messages&&s.push([l.message,"function"==typeof i?i(t):i]);u.verbose&&s.push([l.schema,c],[l.parentSchema,n._`${f}${p}`],[o.default.data,a]);d&&s.push([l.propertyName,d])}(t,e,a),s.object(...a)}(t,e,i)}function h({errorPath:t},{instancePath:e}){const i=e?n.str`${t}${(0,s.getErrorPath)(e,s.Type.Str)}`:t;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,i)]}function u({keyword:t,it:{errSchemaPath:e}},{schemaPath:i,parentSchema:o}){let r=o?e:n.str`${e}/${t}`;return i&&(r=n.str`${r}${(0,s.getErrorPath)(i,s.Type.Str)}`),[l.schemaPath,r]}},8727:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;const n=i(8708),s=i(9029),o=i(2023),r={message:"boolean schema is false"};function a(t,e){const{gen:i,data:s}=t,o={gen:i,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,n.reportError)(o,r,void 0,e)}e.topBoolOrEmptySchema=function(t){const{gen:e,schema:i,validateName:n}=t;!1===i?a(t,!1):"object"==typeof i&&!0===i.$async?e.return(o.default.data):(e.assign(s._`${n}.errors`,null),e.return(!0))},e.boolOrEmptySchema=function(t,e){const{gen:i,schema:n}=t;!1===n?(i.var(e,!1),a(t)):i.var(e,!0)}},9029:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const n=i(1520),s=i(7845);var o=i(1520);Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var r=i(7845);Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return r.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return r.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return r.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return r.varKinds}}),e.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(t,e){return this}}class l extends a{constructor(t,e,i){super(),this.varKind=t,this.name=e,this.rhs=i}render({es5:t,_n:e}){const i=t?s.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+e}optimizeNames(t,e){if(t[this.name.str])return this.rhs&&(this.rhs=A(this.rhs,t,e)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(t,e,i){super(),this.lhs=t,this.rhs=e,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,e){if(!(this.lhs instanceof n.Name)||t[this.lhs.str]||this.sideEffects)return this.rhs=A(this.rhs,t,e),this}get names(){return E(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class h extends c{constructor(t,e,i,n){super(t,i,n),this.op=e}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class u extends a{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}}class d extends a{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}}class f extends a{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class p extends a{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,e){return this.code=A(this.code,t,e),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((e,i)=>e+i.render(t),"")}optimizeNodes(){const{nodes:t}=this;let e=t.length;for(;e--;){const i=t[e].optimizeNodes();Array.isArray(i)?t.splice(e,1,...i):i?t[e]=i:t.splice(e,1)}return t.length>0?this:void 0}optimizeNames(t,e){const{nodes:i}=this;let n=i.length;for(;n--;){const s=i[n];s.optimizeNames(t,e)||(M(t,s.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((t,e)=>P(t,e.names),{})}}class g extends m{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class v extends m{}class y extends g{}y.kind="else";class O extends g{constructor(t,e){super(e),this.condition=t}render(t){let e=`if(${this.condition})`+super.render(t);return this.else&&(e+="else "+this.else.render(t)),e}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(!0===t)return this.nodes;let e=this.else;if(e){const t=e.optimizeNodes();e=this.else=Array.isArray(t)?new y(t):t}return e?!1===t?e instanceof O?e:e.nodes:this.nodes.length?this:new O(Q(t),e instanceof O?[e]:e.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(t,e){var i;if(this.else=null===(i=this.else)||void 0===i?void 0:i.optimizeNames(t,e),super.optimizeNames(t,e)||this.else)return this.condition=A(this.condition,t,e),this}get names(){const t=super.names;return E(t,this.condition),this.else&&P(t,this.else.names),t}}O.kind="if";class b extends g{}b.kind="for";class x extends b{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,e){if(super.optimizeNames(t,e))return this.iteration=A(this.iteration,t,e),this}get names(){return P(super.names,this.iteration.names)}}class w extends b{constructor(t,e,i,n){super(),this.varKind=t,this.name=e,this.from=i,this.to=n}render(t){const e=t.es5?s.varKinds.var:this.varKind,{name:i,from:n,to:o}=this;return`for(${e} ${i}=${n}; ${i}<${o}; ${i}++)`+super.render(t)}get names(){const t=E(super.names,this.from);return E(t,this.to)}}class _ extends b{constructor(t,e,i,n){super(),this.loop=t,this.varKind=e,this.name=i,this.iterable=n}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,e){if(super.optimizeNames(t,e))return this.iterable=A(this.iterable,t,e),this}get names(){return P(super.names,this.iterable.names)}}class S extends g{constructor(t,e,i){super(),this.name=t,this.args=e,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}S.kind="func";class k extends m{render(t){return"return "+super.render(t)}}k.kind="return";class $ extends g{render(t){let e="try"+super.render(t);return this.catch&&(e+=this.catch.render(t)),this.finally&&(e+=this.finally.render(t)),e}optimizeNodes(){var t,e;return super.optimizeNodes(),null===(t=this.catch)||void 0===t||t.optimizeNodes(),null===(e=this.finally)||void 0===e||e.optimizeNodes(),this}optimizeNames(t,e){var i,n;return super.optimizeNames(t,e),null===(i=this.catch)||void 0===i||i.optimizeNames(t,e),null===(n=this.finally)||void 0===n||n.optimizeNames(t,e),this}get names(){const t=super.names;return this.catch&&P(t,this.catch.names),this.finally&&P(t,this.finally.names),t}}class T extends g{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}T.kind="catch";class C extends g{render(t){return"finally"+super.render(t)}}C.kind="finally";function P(t,e){for(const i in e)t[i]=(t[i]||0)+(e[i]||0);return t}function E(t,e){return e instanceof n._CodeOrName?P(t,e.names):t}function A(t,e,i){return t instanceof n.Name?o(t):(s=t)instanceof n._Code&&s._items.some(t=>t instanceof n.Name&&1===e[t.str]&&void 0!==i[t.str])?new n._Code(t._items.reduce((t,e)=>(e instanceof n.Name&&(e=o(e)),e instanceof n._Code?t.push(...e._items):t.push(e),t),[])):t;var s;function o(t){const n=i[t.str];return void 0===n||1!==e[t.str]?t:(delete e[t.str],n)}}function M(t,e){for(const i in e)t[i]=(t[i]||0)-(e[i]||0)}function Q(t){return"boolean"==typeof t||"number"==typeof t||null===t?!t:n._`!${L(t)}`}e.CodeGen=class{constructor(t,e={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...e,_n:e.lines?"\n":""},this._extScope=t,this._scope=new s.Scope({parent:t}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,e){const i=this._extScope.value(t,e);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(t,e){return this._extScope.getValue(t,e)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,e,i,n){const s=this._scope.toName(e);return void 0!==i&&n&&(this._constants[s.str]=i),this._leafNode(new l(t,s,i)),s}const(t,e,i){return this._def(s.varKinds.const,t,e,i)}let(t,e,i){return this._def(s.varKinds.let,t,e,i)}var(t,e,i){return this._def(s.varKinds.var,t,e,i)}assign(t,e,i){return this._leafNode(new c(t,e,i))}add(t,i){return this._leafNode(new h(t,e.operators.ADD,i))}code(t){return"function"==typeof t?t():t!==n.nil&&this._leafNode(new p(t)),this}object(...t){const e=["{"];for(const[i,s]of t)e.length>1&&e.push(","),e.push(i),(i!==s||this.opts.es5)&&(e.push(":"),(0,n.addCodeArg)(e,s));return e.push("}"),new n._Code(e)}if(t,e,i){if(this._blockNode(new O(t)),e&&i)this.code(e).else().code(i).endIf();else if(e)this.code(e).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new O(t))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(O,y)}_for(t,e){return this._blockNode(t),e&&this.code(e).endFor(),this}for(t,e){return this._for(new x(t),e)}forRange(t,e,i,n,o=(this.opts.es5?s.varKinds.var:s.varKinds.let)){const r=this._scope.toName(t);return this._for(new w(o,r,e,i),()=>n(r))}forOf(t,e,i,o=s.varKinds.const){const r=this._scope.toName(t);if(this.opts.es5){const t=e instanceof n.Name?e:this.var("_arr",e);return this.forRange("_i",0,n._`${t}.length`,e=>{this.var(r,n._`${t}[${e}]`),i(r)})}return this._for(new _("of",o,r,e),()=>i(r))}forIn(t,e,i,o=(this.opts.es5?s.varKinds.var:s.varKinds.const)){if(this.opts.ownProperties)return this.forOf(t,n._`Object.keys(${e})`,i);const r=this._scope.toName(t);return this._for(new _("in",o,r,e),()=>i(r))}endFor(){return this._endBlockNode(b)}label(t){return this._leafNode(new u(t))}break(t){return this._leafNode(new d(t))}return(t){const e=new k;if(this._blockNode(e),this.code(t),1!==e.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(t,e,i){if(!e&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new $;if(this._blockNode(n),this.code(t),e){const t=this.name("e");this._currNode=n.catch=new T(t),e(t)}return i&&(this._currNode=n.finally=new C,this.code(i)),this._endBlockNode(T,C)}throw(t){return this._leafNode(new f(t))}block(t,e){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(e),this}endBlock(t){const e=this._blockStarts.pop();if(void 0===e)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-e;if(i<0||void 0!==t&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=e,this}func(t,e=n.nil,i,s){return this._blockNode(new S(t,e,i)),s&&this.code(s).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,e){const i=this._currNode;if(i instanceof t||e&&i instanceof e)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${e?`${t.kind}/${e.kind}`:t.kind}"`)}_elseNode(t){const e=this._currNode;if(!(e instanceof O))throw new Error('CodeGen: "else" without "if"');return this._currNode=e.else=t,this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const e=this._nodes;e[e.length-1]=t}},e.not=Q;const D=I(e.operators.AND);e.and=function(...t){return t.reduce(D)};const R=I(e.operators.OR);function I(t){return(e,i)=>e===n.nil?i:i===n.nil?e:n._`${L(e)} ${t} ${L(i)}`}function L(t){return t instanceof n.Name?t:n._`(${t})`}e.or=function(...t){return t.reduce(R)}},9139:(t,e,i)=>{var n,s,o;
159
- /*!
160
- * jQuery UI Widget 1.14.1
161
- * https://jqueryui.com
162
- *
163
- * Copyright OpenJS Foundation and other contributors
164
- * Released under the MIT license.
165
- * https://jquery.org/license
166
- */!function(){"use strict";s=[i(4692),i(6883)],n=function(t){var e=0,i=Array.prototype.hasOwnProperty,n=Array.prototype.slice;return t.cleanData=function(e){return function(i){var n,s,o;for(o=0;null!=(s=i[o]);o++)(n=t._data(s,"events"))&&n.remove&&t(s).triggerHandler("remove");e(i)}}(t.cleanData),t.widget=function(e,i,n){var s,o,r,a={},l=e.split(".")[0];if("__proto__"===(e=e.split(".")[1])||"constructor"===e)return t.error("Invalid widget name: "+e);var c=l+"-"+e;return n||(n=i,i=t.Widget),Array.isArray(n)&&(n=t.extend.apply(null,[{}].concat(n))),t.expr.pseudos[c.toLowerCase()]=function(e){return!!t.data(e,c)},t[l]=t[l]||{},s=t[l][e],o=t[l][e]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,s,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),(r=new i).options=t.widget.extend({},r.options),t.each(n,function(t,e){a[t]="function"==typeof e?function(){function n(){return i.prototype[t].apply(this,arguments)}function s(e){return i.prototype[t].apply(this,e)}return function(){var t,i=this._super,o=this._superApply;return this._super=n,this._superApply=s,t=e.apply(this,arguments),this._super=i,this._superApply=o,t}}():e}),o.prototype=t.widget.extend(r,{widgetEventPrefix:s&&r.widgetEventPrefix||e},a,{constructor:o,namespace:l,widgetName:e,widgetFullName:c}),s?(t.each(s._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete s._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,o,r=n.call(arguments,1),a=0,l=r.length;a<l;a++)for(s in r[a])o=r[a][s],i.call(r[a],s)&&void 0!==o&&(t.isPlainObject(o)?e[s]=t.isPlainObject(e[s])?t.widget.extend({},e[s],o):t.widget.extend({},o):e[s]=o);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(o){var r="string"==typeof o,a=n.call(arguments,1),l=this;return r?this.length||"instance"!==o?this.each(function(){var i,n=t.data(this,s);return"instance"===o?(l=n,!1):n?"function"!=typeof n[o]||"_"===o.charAt(0)?t.error("no such method '"+o+"' for "+e+" widget instance"):(i=n[o].apply(n,a))!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0:t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+o+"'")}):l=void 0:(a.length&&(o=t.widget.extend.apply(null,[o].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(o||{}),e._init&&e._init()):t.data(this,s,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var n,s,o,r=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(r={},n=e.split("."),e=n.shift(),n.length){for(s=r[e]=t.widget.extend({},this.options[e]),o=0;o<n.length-1;o++)s[n[o]]=s[n[o]]||{},s=s[n[o]];if(e=n.pop(),1===arguments.length)return void 0===s[e]?null:s[e];s[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];r[e]=i}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,n,s;for(i in e)s=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&s&&s.length&&(n=t(s.get()),this._removeClass(s,i),n.addClass(this._classes({element:n,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var i=[],n=this;function s(){var i=[];e.element.each(function(e,s){t.map(n.classesElementLookup,function(t){return t}).some(function(t){return t.is(s)})||i.push(s)}),n._on(t(i),{remove:"_untrackClassesElement"})}function o(o,r){var a,l;for(l=0;l<o.length;l++)a=n.classesElementLookup[o[l]]||t(),e.add?(s(),a=t(t.uniqueSort(a.get().concat(e.element.get())))):a=t(a.not(e.element).get()),n.classesElementLookup[o[l]]=a,i.push(o[l]),r&&e.classes[o[l]]&&i.push(e.classes[o[l]])}return(e=t.extend({element:this.element,classes:this.options.classes||{}},e)).keys&&o(e.keys.match(/\S+/g)||[],!0),e.extra&&o(e.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(n,s){-1!==t.inArray(e.target,s)&&(i.classesElementLookup[n]=t(s.not(e.target).get()))}),this._off(t(e.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){n="boolean"==typeof n?n:i;var s="string"==typeof t||null===t,o={extra:s?e:i,keys:s?t:e,element:s?this.element:t,add:n};return o.element.toggleClass(this._classes(o),n),this},_on:function(e,i,n){var s,o=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=s=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),t.each(n,function(n,r){function a(){if(e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof r?o[r]:r).apply(o,arguments)}"string"!=typeof r&&(a.guid=r.guid=r.guid||a.guid||t.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+o.eventNamespace,h=l[2];h?s.on(c,h,a):i.on(c,a)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?n[t]:t).apply(n,arguments)}var n=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,n){var s,o,r=this.options[e];if(n=n||{},(i=t.Event(i)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(s in o)s in i||(i[s]=o[s]);return this.element.trigger(i,n),!("function"==typeof r&&!1===r.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(n,s,o){var r;"string"==typeof s&&(s={effect:s});var a=s?!0===s||"number"==typeof s?i:s.effect||i:e;"number"==typeof(s=s||{})?s={duration:s}:!0===s&&(s={}),r=!t.isEmptyObject(s),s.complete=o,s.delay&&n.delay(s.delay),r&&t.effects&&t.effects.effect[a]?n[e](s):a!==e&&n[a]?n[a](s.duration,s.easing,o):n.queue(function(i){t(this)[e](),o&&o.call(n[0]),i()})}}),t.widget},void 0===(o="function"==typeof n?n.apply(e,s):n)||(t.exports=o)}()},9713:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(9029),s=i(4227),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>n._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:i,data:o,it:r}=t;if((0,s.alwaysValidSchema)(r,i))return;const a=e.name("valid");e.forIn("key",o,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},a),e.if((0,n.not)(a),()=>{t.error(!0),r.allErrors||e.break()})}),t.ok(a)}};e.default=o},9857:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},9983:(t,e,i)=>{var n,s,o;
167
- /*!
168
- * jQuery UI :data 1.14.1
169
- * https://jqueryui.com
170
- *
171
- * Copyright OpenJS Foundation and other contributors
172
- * Released under the MIT license.
173
- * https://jquery.org/license
174
- */!function(){"use strict";s=[i(4692),i(6883)],void 0===(o="function"==typeof(n=function(t){return t.extend(t.expr.pseudos,{data:t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}})})})?n.apply(e,s):n)||(t.exports=o)}()}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(3053),e=i.n(t),n=i(7334),s=i.n(n),o=i(7512),r=i.n(o),a=i(5385),l=i.n(a),c=i(4692),h=i.n(c);i(1193);class u{constructor(t,e,i={}){this._el=l().create(`\n <div title="${t}">\n ${e}\n </div>\n `),this._$dialog=h()(this._el),this._$dialog.on("dialogclose",()=>{requestAnimationFrame(()=>this._$dialog.dialog("destroy"))}),this._option=i}get el(){return this._el}get button(){return this._$dialog.dialog("widget")[0].querySelector(".ui-dialog-buttonpane button")}open(){this._$dialog.dialog({classes:{"ui-dialog":"textae-editor__dialog"},height:"auto",modal:!0,resizable:!1,width:"calc(100% - 10px)",create:t=>{h()(t.target.parentElement).css("maxWidth",`${this._option.maxWidth||550}px`)},...this._option})}close(){this._$dialog.dialog("close")}}class d extends u{constructor(){super("Help (Keyboard short-cuts)",'<div class="textae-tool__key-help"></div>\n <ul>\n <li>\n cut\n : Ctrl+x\n </li>\n <li>\n copy\n : Ctrl+c\n </li>\n <li>\n paste\n : Ctrl+v\n </li>\n </ul>\n ',{maxWidth:523})}}function f(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement}var p=i(5408),m=i.n(p);const g=new d,v=new class extends u{constructor(){super("For security reason, the shortcut keys for cut/copy/paste are changed as follows:",'<table class="textae-editor__tips-dialog__table">\n <thead>\n <tr><th></th><th>before</th><th>after</th></tr>\n </thead>\n <tbody>\n <tr><td>cut</td><td>x</td><td>Ctrl-x</td></tr>\n <tr><td>copy</td><td>c</td><td>Ctrl-c</td></tr>\n <tr><td>paste</td><td>v</td><td>Ctrl-v</td></tr>\n </tbody>\n </table>\n ',{maxWidth:785})}};class y{#t;#e;#i;constructor(){this.#t=new Map,this.#e=null,this.#i=0,r()(window,".textae-editor","keyup",t=>{if(this.selected)switch(t.key){case"h":g.open();break;case"c":case"x":case"v":t.ctrlKey||t.metaKey||v.open()}}),this.#n()}set(t,e){this.#t.set(t,e),this.#i++}remove(t){this.#t.get(t).dispose(),this.#t.delete(t),this.selected===t&&(this.#e=null)}get selected(){return this.#e}set selected(t){null===t?(this.#s.deactivate(),this.#e=null):(this.#e=t,this.#s.activate())}drawGridsInSight(){for(const t of this.#t.values())t.drawGridsInSight()}updateDenotationEntitiesWidth(){for(const t of this.#t.values())t.updateDenotationEntitiesWidth()}reLayout(){for(const t of this.#t.values())t.reLayout()}has(t){return this.#t.has(t)}get nextID(){return`editor${this.#i}`}#n(){document.addEventListener("scroll",m()(()=>{this.drawGridsInSight()},300)),document.addEventListener("copy",t=>{f(t.target)||this.selected&&this.#t.get(this.selected).copyEntitiesToSystemClipboard(t)}),document.addEventListener("cut",t=>{f(t.target)||this.selected&&this.#t.get(this.selected).cutEntitiesToSystemClipboard(t)}),document.addEventListener("paste",t=>{f(t.target)||this.selected&&this.#t.get(this.selected).pasteEntitiesFromSystemClipboard(t)}),document.addEventListener("selectionchange",s()(()=>{this.selected&&this.#t.get(this.selected).applyTextSelectionWithTouchDevice()},100)),document.addEventListener("contextmenu",()=>{this.selected&&this.#t.get(this.selected).applyTextSelectionWithTouchDevice()}),document.addEventListener("click",t=>{if(3!==t.which)for(const t of this.#t.values())t.hideContextMenu()}),document.addEventListener("contextmenu",t=>{for(const t of this.#t.values())t.hideContextMenu();const e=t.target.closest(".textae-editor");if(e===this.#e){if(e.classList.contains("textae-editor__mode--view-with-relation")||e.classList.contains("textae-editor__mode--view-without-relation"))return;t.preventDefault(),this.#s.showContextMenu(t)}})}get#s(){return this.#t.get(this.#e)}}const O={attributes:!0,attributeFilter:["class"]};class b{#o;#r;constructor(){this.#o=new Set}setObserver(t){this.#r||(this.#r=l().create('<div class="textae-editor-veil" style="display: none;"></div>'),document.body.appendChild(this.#r)),new MutationObserver(t=>this._mutationCallback(t)).observe(t,O)}_mutationCallback(t){this._collectWaitingEditors(t),this.#o.size>0?this._show():this._hide()}_collectWaitingEditors(t){t.forEach(({target:t})=>{t.classList.contains("textae-editor--wait")?this.#o.add(t):this.#o.delete(t)})}_show(){this.#r.style.display="block"}_hide(){this.#r.style.display="none"}}const x={};document.querySelector("html").addEventListener("mousemove",t=>{x.clientY=t.clientY,x.pageY=t.pageY,x.clientX=t.clientX});class w{#a;#l;#c;constructor(t,e){this.#a=t,this.#l=e,this.#c=new Map}addSource(t,e){for(const i of t.map(t=>this._toInstance(t,e)))this._addToContainer(i)}add(t){const e=this._addToContainer(t);return this._emit(`textae-event.annotation-data.${this.#l}.add`,e),e}get(t){return this.#c.get(t)}get all(){return Array.from(this.#c.values())}get selectedItems(){return this.all.filter(({isSelected:t})=>t)}findByType(t){return this.all.filter(e=>e.typeName===t)}get some(){return!!this.#c.size}changeType(t,e){const i=this.#c.get(t);return i.typeName=e,this._emit(`textae-event.annotation-data.${this.#l}.change`,i),i}remove(t){const e=this.#c.get(t);return e&&(this.#c.delete(t),this._emit(`textae-event.annotation-data.${this.#l}.remove`,e)),e}clear(){this.#c.clear()}get _container(){return this.#c}_toInstance(t){return t}_addToContainer(t){return this.#c.set(t.id,t),t}_emit(t,e){this.#a.emit(t,e)}}function _(t,e){return function(t,e){return!!e&&e.begin<=t.begin&&t.end<=e.end}(t,e)?e:e.parent?_(t,e.parent):null}function S(t,e){return t.begin-e.begin||e.end-t.end}function k(t,e){e.sort(S).forEach((e,i,n)=>{e.severTies();const s=0!==i?n[i-1]:null;if(s){const i=_(e,s);i?e.beChildOf(i):e.beChildOf(t)}else e.beChildOf(t)})}const $="ui-selected";function T(t){const e=0===t.children.length?0:function(t){return Math.max.apply(null,t.children.map(t=>T(t)))}(t);return t.gridHeight+e}function C(t){return Math.round(100*t)/100}const P={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let E;const A=new Uint8Array(16);const M=[];for(let t=0;t<256;++t)M.push((t+256).toString(16).slice(1));function Q(t,e=0){return(M[t[e+0]]+M[t[e+1]]+M[t[e+2]]+M[t[e+3]]+"-"+M[t[e+4]]+M[t[e+5]]+"-"+M[t[e+6]]+M[t[e+7]]+"-"+M[t[e+8]]+M[t[e+9]]+"-"+M[t[e+10]]+M[t[e+11]]+M[t[e+12]]+M[t[e+13]]+M[t[e+14]]+M[t[e+15]]).toLowerCase()}function D(t,e,i){const n=(t=t||{}).random??t.rng?.()??function(){if(!E){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");E=crypto.getRandomValues.bind(crypto)}return E(A)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((i=i||0)<0||i+16>e.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[i+t]=n[t];return e}return Q(n)}const R=function(t,e,i){return!P.randomUUID||e||t?D(t,e,i):P.randomUUID()};function I(t,e,i){(function(t,e,i){return!(!t.style||parseFloat(t.style.top)!==e||parseFloat(t.style.left)!==i)})(t,e,i)||(t.style.top=`${e}px`,t.style.left=`${i}px`)}function L(t){return t.querySelector(".textae-editor__annotation-box")}function N(t,e){return function(t,e,i){console.assert(e,"element MUST exists.");const n=t.querySelectorAll(`.${i}`),s=Array.from(n).indexOf(e);return n.length-s>1?n[s+1]:null}(t,document.querySelector(`#${e}`),"textae-editor__span")}function j(t,e,i){const n=i.begin<t&&t<i.end&&i.end<e,s=t<i.begin&&i.begin<e&&e<i.end;return n||s}function z(t,e,i){return{start:t-i,end:e-i}}function B(t){const{begin:e,end:i,parent:n,bigBrother:s}=t;let o;if(o=s?function(t,e,i){if(j(t,e,i))throw new Error(`span ${t}:${e} is crossing with ${i.begin}:${i.end}`);let{start:n,end:s}=z(t,e,i.end),o=i.element.nextSibling;return o.length<n&&(n-=o.length,s-=o.length,o=o.nextSibling),{textNode:o,start:n,end:s}}(e,i,s):{textNode:n.element.firstChild,...z(e,i,n.begin)},!o.textNode)throw new Error(`The textNode on to create a span ${e}:${i} is not found.`);if(o.start<0)throw new Error(`start must be positive, but ${o.start} for ${e}:${i}.`);return o}class Z{#h=!1;#u=!1;#d=new Set;#f=`span_${R().replace(/-/g,"_")}`;constructor(t,e,i,n,s){this._editorID=t,this._editorHTMLElement=e,this._begin=i,this._end=n,this._spanInstanceContainer=s,this.severTies()}get id(){return this.#f}get begin(){return this._begin}get end(){return this._end}get title(){return`${this._begin}-${this._end}`}get types(){return[]}get entities(){return[...this.#d]}get relations(){return this.entities.map(({relations:t})=>t).flat()}get bigBrother(){const t=this.parent.children,e=t.indexOf(this);return 0===e?null:t[e-1]}get root(){return this._spanInstanceContainer}get parent(){return this._parent}get children(){return this._children}add(t){this.#d.add(t)}remove(t){this.#d.delete(t)}offset(t,e){this._begin+=t,this._end+=e}severTies(){this._parent=null,this._children=[]}beChildOf(t){t.children.push(this),this._parent=t}traverse(t){t(this);for(const e of this._children)e.traverse(t)}get element(){return document.querySelector(`#${this.id}`)}render(){this.traverse(t=>{null!==t.element&&t.destroyElement()}),this.traverse(t=>t.renderElement())}erase(){if(this.hasStyle){const t=this.element;t.removeAttribute("tabindex"),t.classList.remove("textae-editor__span")}else this.destroyElement();this.#p()}renderElement(){const t=l().create(this._contentHTML),{textNode:e,start:i,end:n}=B(this),s=function(t,e,i){if(t.length<i)throw new Error(`oh my god! I cannot render span. "${t.textContent.slice(e,i)}" at ${e}~${i} of text(${t.textContent.length}) as "${t.textContent}".`);const n=document.createRange();return n.setStart(t,e),n.setEnd(t,i),n}(e,i,n);s.surroundContents(t)}destroyElement(){const t=this.element;if(!t)return;const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}get gridElement(){return document.querySelector(`#G${this.id}`)}get gridHeight(){return this.entities.map(({heightWithTypeGap:t})=>t).reduce((t,e)=>t+e,0)}get isGridRendered(){return this.#h}get isSelected(){return this.#u}select(){this.#u=!0}deselect(){this.#u=!1}focus(){this.forceRenderGrid(),this.element.focus()}addEntityElementToGridElement(t){this.gridElement.insertAdjacentElement("beforeend",t)}updateSelfAndAncestorsGridPosition(){}drawGrid(t,e){this.isGridInDrawArea(t,e)?this.forceRenderGrid():this.#p()}forceRenderGrid(){if(!this.#h){this.#m();for(const t of this.entities)t.render()}}isGridInDrawArea(){throw new Error("SpanInstance.isGridInDrawArea should be implemented in a subclass.")}#m(){if(this.isGridRendered)return this.gridElement;const t=function(t,e){const i=N(t,e);return i?document.querySelector(`#G${i.id}`):null}(this._editorHTMLElement,this.id);if(t)return t.insertAdjacentElement("beforebegin",this._createGridElement()),this.#h=!0,t.previousElementSibling;{const t=L(this._editorHTMLElement);return t.insertAdjacentElement("beforeend",this._createGridElement()),this.#h=!0,t.lastElementChild}}_createGridElement(){const{offsetTopOfGrid:t,offsetLeftOfGrid:e,widthOfGrid:i}=this,n=(s=this.id,o=C(t),r=C(e),`\n<div \n id=G${s} \n class="textae-editor__grid" \n style="top: ${o}px; left: ${r}px; width: ${i}px;">\n</div>\n`);var s,o,r;return l().create(n)}updateGridPosition(){if(this.isGridRendered){const{offsetTopOfGrid:t,offsetLeftOfGrid:e}=this;I(this.gridElement,C(t),C(e))}}#p(){if(this.isGridRendered){this.#h=!1;for(const t of this.entities)t.erase();this.gridElement.remove()}}get _styleClasses(){return[...this.styles.values()].map(t=>`textae-editor__style textae-editor__style--${t}`)}getShortenInAnchorNodeToFocusNodeDirection(t,e,i){const{anchor:n,focus:s}=this._spanInstanceContainer.textSelection;return n<s?{begin:t.forwardFromBegin(e,s,i),end:this.end}:{begin:this.begin,end:t.backFromEnd(e,s-1,i)+1}}getShortenInFocusNodeToAnchorNodeDirection(t,e,i){const{anchor:n,focus:s}=this._spanInstanceContainer.textSelection;return s<n?{begin:t.forwardFromBegin(e,n,i),end:this.end}:{begin:this.begin,end:t.backFromEnd(e,n-1,i)+1}}getExpandedInAnchorNodeToFocusNodeDirection(t,e,i){const{anchor:n,focus:s}=this._spanInstanceContainer.textSelection;return n<s?{begin:this.begin,end:t.forwardFromEnd(e,s-1,i)+1}:{begin:t.backFromBegin(e,s,i),end:this.end}}getExpandedInFocusNodeToAnchorNodeDirection(t,e,i){const{anchor:n,focus:s}=this._spanInstanceContainer.textSelection;return s<n?{begin:this.begin,end:t.forwardFromEnd(e,n-1,i)+1}:{begin:t.backFromBegin(e,n,i),end:this.end}}}function W(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}class F extends Z{constructor(t,e,i,n,s){super(t,e,i,n,s)}passesAllEntitiesTo(t){for(const e of this.entities)e.span=t}get hasStyle(){return this.styles.size>0}get styles(){return this._spanInstanceContainer.getStyle(this.id)}get#g(){const t=this.element,e=t.getBoundingClientRect(),i=t.offsetParent.offsetParent.getBoundingClientRect();return e.left-i.left}get isDenotation(){return!0}addEntityElementToGridElement(t){super.addEntityElementToGridElement(t),this.updateSelfAndAncestorsGridPosition()}updateSelfAndAncestorsGridPosition(){this.updateGridPosition();let t=this.parent;for(;t instanceof F;)t.updateGridPosition(),t=t.parent}updateDenotationEntitiesWidth(){if(this.isGridRendered){const{widthOfGrid:t}=this;this.gridElement.style.width=`${t}px`}}select(){super.select();const t=super.element;t.classList.add($),setTimeout(()=>t.focus(),0)}deselect(){super.deselect();const t=super.element;t&&t.classList.remove($)}get heightIncludeDescendantGrids(){return this.#v+23+5}get widthOfGrid(){if(W){const t=this.element.getBoundingClientRect(),e=this.element.offsetParent.offsetParent.getBoundingClientRect(),i=t.left-e.left;return C(Math.min(t.width,e.width-i))}return C(this.element.getBoundingClientRect().width)}get offsetCenterOfGrid(){return this.#g+this.widthOfGrid/2}get clientTopOfGrid(){return this.element.getBoundingClientRect().top-this.#v}get offsetTopOfGrid(){return this.element.getBoundingClientRect().top-this.element.offsetParent.offsetParent.getBoundingClientRect().top-this.#v}get offsetLeftOfGrid(){return this.#g}isGridInViewport(t,e){return this.#y(t,e,0)}isGridInDrawArea(t,e){return this.#y(t,e,t)}#y(t,e,i){const{top:n,left:s}=this.element.getBoundingClientRect(),o=this.#v;return 0-i<=n-o+this.gridHeight&&n-o<=t+i&&s<=e}get _contentHTML(){return`\n <span\n id="${this.id}"\n title="${this.title}"\n tabindex="0"\n class="${["textae-editor__span"].concat(this._styleClasses).join(" ")}"\n >\n </span>\n `}get#v(){return T(this)}}class X extends Z{constructor(t,e,i,n,s,o){super(t,e,i,n,s,o),this.styles=new Set([o])}get styleOnly(){return!0}appendStyles(t){this.styles=new Set([...this.styles,...t])}get _contentHTML(){return`\n <span\n id="${this.id}"\n title="${this.title}"\n class="${this._styleClasses.join(" ")}"\n >\n </span>\n `}}class q extends Z{#O;constructor(t,e,i,n,s,o){super(t,e,i,n,s),this.#O=o}get isBlock(){return!0}passesAllEntitiesTo(t){for(const e of this.entities)e.span=t}select(){super.select();const t=super.element;t.classList.add($),this.#b.classList.add($),t.focus()}deselect(){super.deselect();const t=super.element;t&&t.classList.remove($),this.#b&&this.#b.classList.remove($)}updateBackgroundPosition(){if(this.isGridRendered){const t=this.#x,e=this.element.getBoundingClientRect(),i=e.left-this.#O.boundingClientRect.left-8,n=e.width+8;!function(t,e,i,n,s){t.style.top=`${e}px`,t.style.left=`${i}px`,t.style.width=`${n}px`,t.style.height=`${s}px`}(this.#b,this.#w,i,n,t),this.gridElement.style.height=`${t}px`}}renderElement(){super.renderElement();!function(t,e){const i=l().create(`\n <div id="${e}" class="textae-editor__block-bg"></div>\n `);t.insertAdjacentElement("afterbegin",i)}(L(this._editorHTMLElement),this.#_)}destroyElement(){super.destroyElement(),this.#b.remove()}get heightIncludeDescendantGrids(){return super.gridHeight+35}get widthOfGrid(){return 100}get offsetCenterOfGrid(){return this.#O.boundingClientRect.width-58}get offsetTopOfGrid(){return this.#w}get clientBottomOfGrid(){return this.#S+this.#x}get offsetBottomOfGrid(){return this.#w+this.#x}get offsetLeftOfGrid(){return this.#O.boundingClientRect.width-108}updateGridPosition(){super.updateGridPosition(),this._entityToFocusOn&&(this._entityToFocusOn.select(),this._entityToFocusOn=null)}get isGridBeforePositioned(){return!this.gridElement.style.top}set entityToFocusOn(t){this._entityToFocusOn=t}isGridInViewport(t){return this.#y(t,0)}isGridInDrawArea(t){return this.#y(t,t)}get#x(){return this.element.getBoundingClientRect().height}get#w(){return this.#S-this.#O.boundingClientRect.top}get#_(){return`bg_of_${this.id}`}get#b(){return document.querySelector(`#${this.#_}`)}#y(t,e){return 0-e<=this.#k&&this.#S<=t+e}get#S(){return this.#$(this.element.getBoundingClientRect().top)}get#k(){return this.#$(this.element.getBoundingClientRect().bottom)}#$(t){return t-this.#O.lineHeight/2+20}get _contentHTML(){return`<div id="${this.id}" class="textae-editor__block"></div>`}_createGridElement(){const t=super._createGridElement();return t.classList.add("textae-editor__block-hit-area"),t.dataset.id=this.id,t.title=this.title,t}}function H(t,e,i){return t.filter(({span:t})=>j(e,i,t))}function V(t,e,i){const n=t.get(e),s=t.get(i);let o=n,r=s;return S(n,s)>0&&(o=s,r=n),[...t.values()].filter(t=>o.begin<=t.begin&&(t.end<=o.end||t.end<=r.end)).map(t=>t.id)}function Y(t){let e=0;for(const i of t.parentElement.childNodes){if(i==t)break;"#text"===i.nodeName?e+=i.nodeValue.length:e+=i.textContent.length}return e}function U(t){return t.classList.contains("textae-editor__text-box")}function G(t){return t.classList.contains("textae-editor__span")}function K(t){return t.classList.contains("textae-editor__style")}function J(t){return t.classList.contains("textae-editor__block")}function tt(t,e){const i=e.parentElement;if(U(i))return 0;if(G(i)||J(i)||K(i))return t.get(i.id).begin;throw new Error(`Can not get position of a node : ${e} ${e.data}`)}class et{#T;#C;constructor(t){this.#T=window.getSelection(),this.#C=t}get anchor(){return tt(this.#C,this.#T.anchorNode)+Y(this.#T.anchorNode)+this.#T.anchorOffset}get focus(){return tt(this.#C,this.#T.focusNode)+Y(this.#T.focusNode)+this.#T.focusOffset}get begin(){return this.anchor<this.focus?this.anchor:this.focus}get end(){return this.anchor<this.focus?this.focus:this.anchor}}class it{#P=new Map;#E=new Map;set(t,e){this.#P.set(t,e);const i=this.#A(e.begin,e.end);this.#E.has(i)?this.#E.get(i).add(e):this.#E.set(i,new Set([e]))}get(t){return this.#P.get(t)}getSameBeginEnd(t,e){const i=this.#A(t,e);return this.#E.get(i)}getSingleOrThrowOn(t,e){const i=this.#A(t,e),n=this.#E.get(i);if(1===n.size)return n.values().next().value;throw new Error("The span is not unique.")}has(t){return this.#P.has(t)}delete(t){const e=this.#P.get(t);if(e){const i=this.#A(e.begin,e.end);return this.#E.get(i).delete(e),0===this.#E.get(i).size&&this.#E.delete(i),this.#P.delete(t)}return!1}clear(){this.#P.clear(),this.#E.clear()}values(){return this.#P.values()}#A(t,e){return 1e7*t+e}}class nt{#M;#Q;#a;#O;#D=new it;#R=new it;#I=new Map;constructor(t,e,i,n){this.#M=t,this.#Q=e,this.#a=i,this.#O=n}add(t){if(console.assert(t,"span is necessary."),t instanceof q)return this.#L(t);if(t instanceof F)return this.#N(t);if(t.isBlock){console.assert(!this.#j(t.begin,t.end),`There are some parent spans of {begin: ${t.begin}, end: ${t.end}}.`);const e=new q(this.#M,this.#Q,t.begin,t.end,this,this.#O);return this.#L(e)}{console.assert(!this.find("denotation",t.begin,t.end),"There is already a span.");const e=new F(this.#M,this.#Q,t.begin,t.end,this);return this.#N(e)}}addSource(t,e){for(const i of t)this.#z(e,i);this.#B()}validateNewDenotationSpan(t,i){return this.isBoundaryCrossingWithOtherSpans(t,i)?(e().warning("A span cannot be modified to make a boundary crossing."),!1):!this.find("denotation",t,i)&&!this.#Z(t,i)}validateNewBlockSpan(t,i,n){return this.isBoundaryCrossingWithOtherSpans(t,i)?(e().warning("A span cannot be modified to make a boundary crossing."),!1):!this.#j(t,i)&&!this.#Z(t,i,{excluded:n})}validateEditableText(t,i){return!this.all.find(e=>t<e.begin&&e.begin<i||t<e.end&&e.end<i)||(e().warning("Text that contains any part of a span cannot be edited."),!1)}hasParentOf(t,e,i){for(const n of this.all)if(n.id!==i&&n.begin<=t&&e<=n.end)return!0;return!1}get(t){return this.#D.has(t)?this.#D.get(t):this.#R.has(t)?this.#R.get(t):this.#I.get(t)}find(t,e,i){switch(t){case"denotation":return Array.from(this.#D.values()).find(t=>t.begin===e&&t.end===i);case"block":return Array.from(this.#R.values()).find(t=>t.begin===e&&t.end===i);default:throw`${t} is unknown type span!`}}getStyle(t){return this.#I.has(t)?this.#I.get(t).styles:new Set}getDenotationSpan(t){if(this.#D.has(t))return this.#D.get(t)}rangeDenotationSpan(t,e){return V(this.#D,t,e)}rangeBlockSpan(t,e){return V(this.#R,t,e)}get children(){return this.all.filter(t=>t.parent===this).sort(S)}clear(){this.#D.clear(),this.#R.clear(),this.#I.clear()}remove(t){const e=this.#R.get(t);if(e)return this.#W(e),void this.#a.emit("textae-event.annotation-data.span.remove",e);const i=this.#D.get(t);if(i)return this.#F(i),void this.#a.emit("textae-event.annotation-data.span.remove",i);console.assert(!1,`There is no target for remove for ${t}!`)}moveDenotationSpan(t,e,i,n){const s=this.#D.getSameBeginEnd(t,e);for(const o of s){console.assert(o,`There is no target for move for begin: ${t}, end: ${e}!`),console.assert(o.begin!==i||o.end!==n,`Do not need move span: ${o.id} ${i} ${n}`),this.#F(o);const s=new F(this.#M,this.#Q,i,n,this);this.#N(s,o)}this.#a.emit("textae-event.annotation-data.span.move")}moveBlockSpan(t,e,i,n){const s=this.#R.getSingleOrThrowOn(t,e);console.assert(s.begin!==i||s.end!==n,`Do not need move span: ${s.id} ${i} ${n}`),this.#W(s);const o=new q(this.#M,this.#Q,i,n,this,this.#O);this.#L(o,s),this.#a.emit("textae-event.annotation-data.span.move")}isBoundaryCrossingWithOtherSpans(t,e){return function(t,e,i){return console.assert(void 0!==i,"end is necessary."),H(t.map(t=>({span:t})),e,i).length>0}(this.all,t,e)}get all(){const t=[...this.#I.values()].filter(t=>!this.#D.has(t.id));return[...this.#R.values()].concat([...this.#D.values()]).concat(t)}get selectedItems(){return[...this.#R.values()].concat([...this.#D.values()]).filter(({isSelected:t})=>t)}get allDenotationSpans(){return[...this.#D.values()]}get allBlockSpans(){return[...this.#R.values()]}get begin(){return 0}get element(){return this.#Q.querySelector(".textae-editor__text-box")}get textSelection(){return new et(this)}arrangeDenotationEntityPosition(){for(const t of this.allDenotationSpans)t.updateGridPosition()}arrangeBlockEntityPosition(){for(const t of this.allBlockSpans)t.updateGridPosition()}arrangeBackgroundOfBlockSpanPosition(){for(const t of this.allBlockSpans)t.updateBackgroundPosition()}get maxHeight(){const t=[...this.#R.values()].concat([...this.#D.values()]);return t.length?function(t){return Math.max(...t.map(t=>t.heightIncludeDescendantGrids))}(t):null}renderAll(){for(const t of this.children)t.render()}offsetSpans(t,e,i){const n=[];for(const s of this.all)s.end<=t||s.end<e||(e<=s.begin?(s.offset(i,i),n.push(s)):(s.offset(0,i),n.push(s)));return n.sort(S)}#Z(t,e,i={}){for(const n of this.#R.values())if(t<=n.begin&&n.end<=e&&i&&n.id!==i.excluded)return!0;return!1}#j(t,e){const i=i=>i.begin<=t&&e<=i.end;return[...this.#D.values()].some(i)||[...this.#R.values()].some(i)||[...this.#I.values()].some(i)}#N(t,e=null){return this.#X(this.#D,t,e),this.#a.emit("textae-event.annotation-data.span.add",t),t}#L(t,e=null){return this.#X(this.#R,t,e),this.#a.emit("textae-event.annotation-data.span.add",t),t}#X(t,e,i=null){t.set(e.id,e),this.#B(),i&&i.passesAllEntitiesTo(e),e.render();const{clientHeight:n,clientWidth:s}=document.documentElement;e.drawGrid(n,s)}#F(t){this.#D.delete(t.id),t.erase()}#W(t){this.#R.delete(t.id),t.erase()}#B(){k(this,this.all)}#z(t,e){switch(t){case"denotation":if(!this.#D.getSameBeginEnd(e.span.begin,e.span.end)){const t=new F(this.#M,this.#Q,e.span.begin,e.span.end,this);this.#D.set(t.id,t)}break;case"block":{const t=new q(this.#M,this.#Q,e.span.begin,e.span.end,this,this.#O);this.#R.has(t.id)||this.#R.set(t.id,t);break}case"typesetting":{const t=new X(this.#M,this.#Q,e.span.begin,e.span.end,this,e.style);this.#I.has(t.id)?this.#I.get(t.id).appendStyles(t.styles):this.#I.set(t.id,t);break}default:throw`${t} is unknown type span!`}}}var st=i(7901),ot=i.n(st);function rt(t){const[e,...i]=t;let n=e;for(const t of[...arguments].slice(1))n=`${n}${at(t)}${i.shift()}`;return n}function at(t){if(Array.isArray(t)&&"function"==typeof t.at(0))return t.map(t=>t()).join("");if("function"==typeof t){const e=t();return Array.isArray(e)?e.join(""):e}return ot()(t)}function lt(t){return t.trim().startsWith("http")}function ct(t,e){const i=t.all.filter(t=>"_base"!==t.prefix).filter(t=>0===e.indexOf(`${t.prefix}:`));return 1===i.length?i[0]:null}function ht(t){return/\(?(?:(http|https|ftp):\/\/)?(?:((?:[^\W\s]|\.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\W\s]|\.|-)+[.][^\W\s]{2,4}|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::(\d*))?([/]?[^\s?]*[/]{1})*(?:\/?([^\s\n?[\]{}#]*(?:(?=\.)){1}|[^\s\n?[\]{}.#]*)?([.]{1}[^\s?#]*)?)?(?:\?{1}([^\s\n#[\]]*))?([#][^\s\n]*)?\)?/gi.exec(t)}function ut(t,e,i){if(i)return i;if(lt(e))return function(t){if(lt(t)){const e=ht(t);if(e)return e[9]?e[9].slice(1):e[6]?e[6]+(e[7]||""):e[5]&&e[5].length>1?e[5].split("/").filter(t=>""!==t).pop():e[3]}return t}(e);const n=ct(t,e);return n?e.replace(`${n.prefix}:`,""):e}function dt(t,e){const i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return console.assert(i,`${t} is not a hexadecimal color values!`),`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${e})`}function ft(){return dt("#FFFFFF",.6)}function pt(t,e,i){if(lt(e))return e;if(i)return i;if(t.some){const i=ct(t,e);if(i)return`${i.uri}${e.replace(`${i.prefix}:`,"")}`;const n=t.all.find(t=>"_base"===t.prefix);if(n)return`${n.uri}${e}`}return null}function mt(t,e){return()=>e?rt`<a target="_blank" href="${e}">${t}</a>`:rt`${t}`}class gt{#q;#H;#V;#Y;#U;#G;#K;#J;#tt;constructor({id:t,subj:e,pred:i,obj:n},s,o,r,a,l){this.#q=t,this.#H=e,this.#V=i,this.#Y=n,this.#U=s,this.#G=o,this.#K=r,this.#J=a,this.#tt=l,"string"!==this.#et||this.#it||this.#tt.acquireContentTypeOf(this.#nt).then(t=>{t&&this.updateElement()})}get id(){return this.#q}set id(t){this.#q=t}get subj(){return this.#H}set subj(t){this.#H=t}get pred(){return this.#V}set pred(t){this.#V=t}get obj(){return this.#Y}set obj(t){"numeric"===this.#et?this.#Y=parseFloat(t):this.#Y=t}get subjectInstance(){return this.#U.get(this.subj)||this.#G.get(this.subj)}get externalFormat(){return{id:this.id,subj:this.subj,pred:this.pred,obj:this.#Y}}equalsTo(t,e){return this.pred===t&&String(this.#Y)===e}updateElement(){this.subjectInstance.updateElement()}clarifyLabelIn(t){t.querySelector(rt`[data-id="${this.id}"] .textae-editor__signboard__attribute-label`).style.backgroundColor=ft()}declarifyLabelIn(t){t.querySelector(rt`[data-id="${this.id}"] .textae-editor__signboard__attribute-label`).style.backgroundColor=dt(this.#st,1)}get contentHTML(){return()=>rt`
175
- <div
176
- class="textae-editor__signboard__attribute"
177
- title="${this.#ot}"
178
- data-id="${this.id}"
179
- style="background-color: ${dt(this.#st,.4)}; height: ${this.height}px;"
180
- >
181
- <span
182
- class="textae-editor__signboard__attribute-label"
183
- style="background-color: ${dt(this.#st,1)};"
184
- >
185
- ${this.#rt}
186
- </span>
187
- </div>
188
- `}get height(){return this.#J.get(this.pred).mediaHeight?this.#J.get(this.pred).mediaHeight:18}get#ot(){return`[${this.id}] pred: ${this.pred}, value: ${this.#Y}`}get#rt(){return this.#at?()=>`<img src="${this.obj}" height="${this.height}" >`:mt(this.#lt,this.#nt)}get#at(){return"string"===this.#et&&(this.#it||this.#tt.hasImageContentTypeOf(this.#nt))}get#it(){return/\.(jpg|png|gif)$/.test(this.#nt)}get#lt(){return ut(this.#K,"string"==typeof this.#Y?this.#Y:"",this.#J.getDisplayName(this.pred,this.#Y))}get#nt(){return pt(this.#K,"string"==typeof this.#Y?this.#Y:"")}get#st(){return this.#J.getColor(this.pred,this.#Y)||this.subjectInstance.color}get#et(){return this.#J.get(this.pred).valueType}}class vt extends w{#ct;constructor(t,e,i){super(t,e),this.#ct=i}addSource(t,e){const i=t.map(t=>this._toInstance(t,e));i.sort((t,e)=>t.id?e.id?t.id<e.id?-1:t.id>e.id?1:0:-1:1);for(const t of i)super._addToContainer(this.#ht(t))}add(t){return super.add(this.#ht(t))}#ht(t){return t.id||(t.id=this.#ut(t)),t}#ut(t){const e=this.#ct(t),i=new Set;for(const t of super._container.keys())new RegExp(`^${e}\\d+$`).test(t)&&i.add(t.slice(1));if(0===i.size)return`${e}1`;return`${e}${Math.max(...i.values())+1}`}}class yt{#dt=new Map;async acquireContentTypeOf(t){if(!t)return Promise.resolve(!1);if(this.#dt.has(t))return this.#dt.get(t);const e=new Request(t,{method:"get",mode:"cors",cache:"force-cache"}),i=new Promise(n=>{fetch(e).then(t=>{const e=/image\/(jpg|png|gif)$/.test(t.headers.get("content-type"));i.value=e,n(e)}).catch(e=>{console.warn(e.message,t),n(!1)})});return this.#dt.set(t,i),i}hasImageContentTypeOf(t){return!!t&&(!!this.#dt.has(t)&&this.#dt.get(t).value)}}class Ot extends vt{#U;#G;#K;#J;#tt;constructor(t,e,i,n,s){super(t,"attribute",()=>"A"),this.#U=e,this.#G=i,this.#K=n,this.#J=s,this.#tt=new yt}_toInstance(t){return new gt(t,this.#U,this.#G,this.#K,this.#J,this.#tt)}add(t){return t=t instanceof gt?t:this._toInstance(t),super.add(t),t.updateElement(),t}change(t,e,i){const n=this.get(t);return e&&(n.pred=e),i&&(n.obj=i),n}remove(t){const e=super.remove(t);console.assert(e,`There are no attribute ${t} to delete!`),e.updateElement()}getSameDefinitionsAttributes(t){return this.all.filter(e=>e.pred===t)}getSameAttributes(t,e){return this.all.filter(i=>i.equalsTo(t,e))}getAttributesFor(t){return this.all.filter(e=>e.subj===t).sort((t,e)=>this.#J.attributeCompareFunction(t,e))}}class bt{#ft;#pt;constructor(t,e=[]){this.#ft=t,this.#pt=e}get typeName(){return this.#ft}get attributes(){return this.#pt}get externalFormat(){return{obj:this.#ft,attributes:this.#pt.map(({externalFormat:t})=>t)}}isSameType(t,e=null){return e?this.typeName===t&&this._hasSameAttributes(e):this.typeName===t}hasSpecificPredicateAttribute(t){return this.attributes.some(e=>e.pred===t)}_hasSameAttributes(t){if(t.length!=this.attributes.length)return!1;const e=[...t];for(const t of this.attributes){const i=e.findIndex(e=>e.pred===t.pred&&e.obj===String(t.obj));if(-1===i)return!1;e.splice(i,1)}return 0===e.length||void 0}}function xt(t,e,i,n){t.setAttribute("d",e.pathCommands),t.setAttribute("style",`stroke: ${i};`),n?t.classList.add("textae-editor__relation--isBold"):t.classList.remove("textae-editor__relation--isBold")}const wt="http://www.w3.org/2000/svg";function _t(){const t=document.createElementNS(wt,"polygon");return t.setAttribute("points","-4 6, 4 6, 0 0"),t}function St(){const t=document.createElementNS(wt,"polygon");return t.setAttribute("points","-4 0, 4 0, 0 6"),t}function kt(t,e,i,n){t.setAttribute("points",`${e} ${i+6}, ${n.offsetCenter} ${i+6}, ${n.offsetCenter} ${n.offsetTop}`)}function $t(t,e,i){const n=document.createElementNS(wt,"polyline");return kt(n,t,e,i),n}class Tt{constructor(t,e,i,n,s){this._controlY=t.offsetTop-t.horizontalDistance/4-20+(e&&i?3:0),this._startAndEnd=t,this._toolBarHeight=n,this._clientTopOfContainer=s,this._virtualEntityWidth=100}get sourceX(){return this._startAndEnd.start.x}get targetX(){return this._startAndEnd.end.x}get sourceY(){return this._startAndEnd.start.y-6}get targetY(){return this._startAndEnd.end.y-6}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n C ${this._sourceControlX} ${this._controlY}, ${this._targetControlX} ${this._controlY}, ${this.targetX} ${this.targetY}`}get transformDefinitionsForSourceTriangle(){return`translate(${this.sourceX}, ${this.sourceY})`}get transformDefinitionsForTargetTriangle(){return`translate(${this.targetX}, ${this.targetY})`}getTForY(t){return[...Array(20).keys()].map(t=>1*t/20).find(e=>{const i=Math.pow(1-e,3)*this.sourceY+3*Math.pow(1-e,2)*e*this._controlY+3*(1-e)*Math.pow(e,2)*this._controlY+Math.pow(e,3)*this.targetY;return Math.abs(i-t)<1})}getXOnT(t){const{sourceX:e,targetX:i,_sourceControlX:n,_targetControlX:s}=this;return Math.pow(1-t,3)*e+3*Math.pow(1-t,2)*t*n+3*(1-t)*Math.pow(t,2)*s+Math.pow(t,3)*i}get _sourceControlX(){return this._startAndEnd.start.x}get _targetControlX(){return this._startAndEnd.end.x}}class Ct extends Tt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!0}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n C ${this._sourceControlX} ${this._controlY}, ${this._targetControlX} ${this._controlY}, ${this._junctionPointX} ${this._junctionPointY}\n Q ${this.targetX} ${this._additionalControlY}, ${this.targetX} ${this.targetY}`}getTForY(t){return[...Array(20).keys()].map(t=>1*t/20).find(e=>{const i=Math.pow(1-e,3)*this.sourceY+3*Math.pow(1-e,2)*e*this._controlY+3*(1-e)*Math.pow(e,2)*this._controlY+Math.pow(e,3)*this._junctionPointY;return Math.abs(i-t)<1})}get _additionalControlY(){return.3*this.sourceY+.7*this.targetY}get _junctionPointX(){return.25*this._targetControlX+.75*this.targetX}get _junctionPointY(){return.25*this._controlY+.75*this._additionalControlY}get _targetControlX(){return this._startAndEnd.end.x+(this._startAndEnd.isPointingToRight?150:-150)}}class Pt extends Tt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!0}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n Q ${this.sourceX} ${this._additionalControlY}, ${this._junctionPointX} ${this._junctionPointY}\n C ${this._sourceControlX} ${this._controlY}, ${this._targetControlX} ${this._controlY}, ${this.targetX} ${this.targetY}`}getTForY(t){return[...Array(20).keys()].map(t=>1*t/20).find(e=>{const i=Math.pow(1-e,3)*this._junctionPointY+3*Math.pow(1-e,2)*e*this._controlY+3*(1-e)*Math.pow(e,2)*this._controlY+Math.pow(e,3)*this.targetY;return Math.abs(i-t)<1})}get _additionalControlY(){return.7*this.sourceY+.3*this.targetY}get _junctionPointX(){return.25*this._sourceControlX+.75*this.sourceX}get _junctionPointY(){return.25*this._controlY+.75*this._additionalControlY}get _sourceControlX(){return this._startAndEnd.start.x+(this._startAndEnd.isPointingToRight?150:-150)}}class Et extends Tt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY+6}\n C ${this._sourceControlX} ${this.sourceY+Math.abs(this.targetY-this.sourceY)/3}, ${this._targetControlX} ${this.targetY-Math.abs(this.targetY-this.sourceY)/3}, ${this.targetX} ${this.targetY}`}get transformDefinitionsForSourceTriangle(){return`rotate(180, ${this.sourceX}, ${this.sourceY+3}) translate(${this.sourceX}, ${this.sourceY})`}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){return this._toolBarHeight-this._clientTopOfContainer}}class At extends Tt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get pathCommands(){return`M ${this.sourceX}, ${this.sourceY}\n C ${this._sourceControlX} ${this.sourceY-Math.abs(this.targetY-this.sourceY)/3}, ${this._targetControlX} ${this.targetY+Math.abs(this.targetY-this.sourceY)/3}, ${this.targetX} ${this.targetY+6}`}get transformDefinitionsForTargetTriangle(){return` rotate(180, ${this.targetX}, ${this.targetY+3}) translate(${this.targetX}, ${this.targetY})`}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){return this._toolBarHeight-this._clientTopOfContainer}}class Mt extends Tt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!0}}class Qt{constructor(t,e,i){this._relation=t,this._sourceEntity=t.sourceEntity,this._targetEntity=t.targetEntity;const n=this._sourceEntity.offsetTop-(e?3:0),s=this._targetEntity.offsetTop-(i?3:0),o=this._sourceEntity.getSourceAnchorPosition(e),r=this._targetEntity.getTargetAnchorPosition(i);if(this._sourceEntity.offsetCenter===this._targetEntity.offsetCenter)return this._start={y:n,x:this._sourceEntity.offsetCenter},void(this._end={y:s,x:this._targetEntity.offsetCenter});if(n<s){const t=this.isPointingToRight?"right":"left",e=o[t]<this._targetEntity.offsetCenter?"left":"right";return this._start={y:n,x:o[t]},void(this._end={y:s,x:r[e]})}if(n>s){const t=this.isPointingToRight?"left":"right",e=r[t]<this._sourceEntity.offsetCenter?"left":"right";return this._start={y:n,x:o[e]},void(this._end={y:s,x:r[t]})}if(this.isPointingToRight){const t=o.right<r.left?"left":"right";return this._start={y:n,x:o.right},void(this._end={y:s,x:r[t]})}{const t=o.left<r.right?"left":"right";return this._start={y:n,x:o.left},void(this._end={y:s,x:r[t]})}}get start(){return this._start}get end(){return this._end}get isPointingToRight(){return this._sourceEntity.offsetCenter<this._targetEntity.offsetCenter}get isDownward(){return this._start.y<this._end.y}get offsetTop(){return Math.min(this._start.y,this._end.y)}get horizontalDistance(){return Math.abs(this._end.x-this._start.x)}get sourceXShiftRate(){const{relations:t}=this._sourceEntity.span,e=t.indexOf(this._relation);return 1===t.length?.5:e/(t.length-1)}get targetXShiftRate(){const{relations:t}=this._targetEntity.span,e=t.indexOf(this._relation);return 1===t.length?.5:e/(t.length-1)}}class Dt extends Pt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Rt extends Ct{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class It extends Ct{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Lt extends Pt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class Nt extends Mt{get isSourceJettyVisible(){return!1}get isTargetJettyVisible(){return!0}get sourceX(){return super.sourceX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.sourceXShiftRate}get sourceY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class jt extends Mt{get isSourceJettyVisible(){return!0}get isTargetJettyVisible(){return!1}get targetX(){return super.targetX-this._virtualEntityWidth/2+this._virtualEntityWidth*this._startAndEnd.targetXShiftRate}get targetY(){const{clientHeight:t}=document.documentElement;return t-this._clientTopOfContainer-8}}class zt{static create(t,e,i,n,s){const o=new Qt(t,e,i),{sourceEntity:r,targetEntity:a}=t;if(a.clientBottom<s&&a.clientTop<r.clientTop)return new At(o,e,i,s,n);if(r.clientBottom<s&&r.clientTop<a.clientTop)return new Et(o,e,i,s,n);const{clientHeight:l}=document.documentElement;return Math.abs(r.clientBottom-a.clientBottom)<12||42<o.horizontalDistance?l<r.clientTop?new Nt(o,e,i,s,n):l<a.clientTop?new jt(o,e,i,s,n):new Mt(o,e,i,s,n):o.isDownward?l<r.clientTop?new It(o,e,i,s,n):l<a.clientTop?new Rt(o,e,i,s,n):new Ct(o,e,i,s,n):l<r.clientTop?new Dt(o,e,i,s,n):l<a.clientTop?new Lt(o,e,i,s,n):new Pt(o,e,i,s,n)}}class Bt{#c;#mt;#gt;#vt;#yt;#Ot;#bt;#xt;#wt;#_t;#St;#kt;constructor(t,e,i,n,s,o,r){this.#c=t.querySelector(".textae-editor__relation-box"),this.#mt=e,this.#gt=i;const a=_t();this.#c.appendChild(a),this.#vt=a;const l=St();this.#c.appendChild(l),this.#yt=l;const c=function(){const t=document.createElementNS(wt,"path");return t.classList.add("textae-editor__relation"),t}();this.#c.appendChild(c),this.#Ot=c;const h=document.createElementNS(wt,"path");h.classList.add("textae-editor__relation-aura"),h.addEventListener("click",n),h.addEventListener("mouseenter",o),h.addEventListener("mouseleave",r);const u=document.createElementNS(wt,"title");h.appendChild(u),this.#c.appendChild(h),this.#bt=h;const d=_t();d.classList.add("textae-editor__relation-bollard-aura"),d.addEventListener("click",t=>s(t,e.sourceEntity)),d.appendChild(document.createElementNS(wt,"title")),this.#c.appendChild(d),this.#xt=d;const f=St();f.classList.add("textae-editor__relation-bollard-aura"),f.addEventListener("click",t=>s(t,e.targetEntity)),f.appendChild(document.createElementNS(wt,"title")),this.#c.appendChild(f),this.#wt=f,this.#_t=null,this.#St=null,this.update(!1,!1,!1)}update(t,e,i){const n=zt.create(this.#mt,e,i,this.#c.getBoundingClientRect().top,this.#gt);xt(this.#Ot,n,this.#mt.color,t),xt(this.#bt,n,this.#mt.color,!1),this.#bt.children[0].textContent=this.#mt.title,this.#vt.setAttribute("style",`fill:${this.#mt.sourceColor}`),this.#vt.setAttribute("transform",n.transformDefinitionsForSourceTriangle),this.#yt.setAttribute("style",`fill:${this.#mt.targetColor}`),this.#yt.setAttribute("transform",n.transformDefinitionsForTargetTriangle),this.#xt.children[0].textContent=this.#mt.sourceEntity.title,this.#xt.setAttribute("transform",n.transformDefinitionsForSourceTriangle),this.#wt.children[0].textContent=this.#mt.targetEntity.title,this.#wt.setAttribute("transform",n.transformDefinitionsForTargetTriangle),e&&n.isSourceJettyVisible?this.#$t(n):this.#Tt(),i&&n.isTargetJettyVisible?this.#Ct(n):this.#Pt(),this.#kt=n}destructor(){this.#c.removeChild(this.#Ot),this.#c.removeChild(this.#xt),this.#c.removeChild(this.#wt),this.#c.removeChild(this.#bt),this.#c.removeChild(this.#vt),this.#c.removeChild(this.#yt),this.#Tt(),this.#Pt()}get top(){return this.#Ot.getBBox().y}get left(){return this.#Ot.getBBox().x}get highestX(){const t=this.#kt.getTForY(this.top);return this.#kt.getXOnT(t)}get width(){return this.#Ot.getBBox().width}#$t(t){const{sourceEntity:e}=this.#mt;if(this.#_t)kt(this.#_t,t.sourceX,t.sourceY,e);else{const i=$t(t.sourceX,t.sourceY,e);this.#c.appendChild(i),this.#_t=i}}#Ct(t){const{targetEntity:e}=this.#mt;if(this.#St)kt(this.#St,t.targetX,t.targetY,e);else{const i=$t(t.targetX,t.targetY,e);this.#c.appendChild(i),this.#St=i}}#Tt(){this.#_t&&(this.#c.removeChild(this.#_t),this.#_t=null)}#Pt(){this.#St&&(this.#c.removeChild(this.#St),this.#St=null)}}const Zt="textae-editor__signboard--selected",Wt="textae-editor__signboard--cutting";class Ft{#Et;#At;constructor(t,e,i){this.#Et=t,this.#At=l().create(this.#Mt(i,e))}get element(){return this.#At}addEventListener(t,e){this.#At.addEventListener(t,e)}hover(){this.#At.classList.add("textae-editor__signboard--hovered")}select(){this.#At.classList.add(Zt)}deselect(){this.#At.classList.remove(Zt)}startCut(){this.#At.classList.add(Wt)}cancelCut(){this.#At.classList.remove(Wt)}clearCSSClass(){this.element.className="",this.element.classList.add("textae-editor__signboard")}updateLabel(){const t=this.element.querySelector(".textae-editor__signboard__type-values");t.style.backgroundColor=dt(this.#Et.color,.4),t.querySelector(".textae-editor__signboard__type-label").innerHTML=rt`${this.#Et.anchorHTML}`;for(const e of t.querySelectorAll(".textae-editor__signboard__attribute"))e.remove();for(const e of this.#Et.attributes)t.insertAdjacentHTML("beforeend",rt`${e.contentHTML}`)}clarifyLabel(){this.element.querySelector(".textae-editor__signboard__type-label").style.backgroundColor=ft();for(const t of this.#Et.attributes)t.clarifyLabelIn(this.element)}declarifyLabel(){this.element.querySelector(".textae-editor__signboard__type-label").style.backgroundColor=dt(this.#Et.color,1);for(const t of this.#Et.attributes)t.declarifyLabelIn(this.element)}focus(){this.#At.querySelector(".textae-editor__signboard__type-label").focus()}replaceWith(t){return this.#At.replaceWith(t.element),t}reflectTypeGapInTheHeight(t){this.#At.setAttribute("style",`padding-top: ${t}px;`)}remove(){this.#At.remove()}#Mt(t,e){return rt`
189
- <div
190
- class="textae-editor__signboard"
191
- ${t?`id="${t}"`:""}
192
- title="${this.#Et.title}"
193
- data-entity-type="${e}"
194
- data-id="${this.#Et.id}"
195
- >
196
- <div
197
- class="textae-editor__signboard__type-values"
198
- style="background-color: ${dt(this.#Et.color,.4)};"
199
- >
200
- <div
201
- class="textae-editor__signboard__type-label"
202
- tabindex="0"
203
- style="background-color: ${ft()};"
204
- >
205
- ${this.#Et.anchorHTML}
206
- </div>
207
- ${this.#Et.attributes.map(t=>t.contentHTML)}
208
- </div>
209
- </div>
210
- `}}class Xt{#c;#mt;#Qt;#Dt;#Rt;#It;constructor(t,e,i,n,s,o){this.#c=L(t),this.#mt=e,this.#Qt=i,this.#Dt=l().create('<div class="textae-editor__relation__signboard-location"></div>'),this.#Lt(),this.#Rt=new Ft(e,"relation",null),this.#Dt.appendChild(this.#Rt.element),this.#c.appendChild(this.#Dt),this.#Dt.addEventListener("click",n),this.#Dt.addEventListener("mouseenter",s),this.#Dt.addEventListener("mouseleave",o)}updateValue(){this.#Lt(),this.#Rt.updateLabel()}updateHighlighting(){this.#Lt(),this.#Rt.clearCSSClass(),this.#mt.isSelected?this.#Rt.select():this.#mt.isHovered&&this.#Rt.hover()}destructor(){this.#c.removeChild(this.#Dt)}get y(){return this.#It.getBBox().y}get width(){return this.#Dt.getBBox().width}get height(){return this.#Dt.getBBox().height}#Lt(){this.#Dt.style.width="0px",this.#Dt.style.left=`${this.#Qt.highestX}px`,this.#Dt.style.top=this.#Qt.top-18-18*this.#mt.attributes.length+"px"}}class qt{#Q;#Nt;#U;#jt;#q;#ft;#H;#Y;#K;#J;#gt;#u;#zt;#Qt;#Bt;constructor(t,e,i,n,s,{id:o,pred:r,subj:a,obj:l},c,h){this.#Q=t,this.#Nt=e,this.#U=i,this.#jt=n,this.#q=o,this.#H=a,this.#Y=l,this.#K=s,this.#J=c,this.#gt=h,this.#u=!1,this.#zt=!1,this.typeName=r}get id(){return this.#q}set id(t){this.#q=t}get typeName(){return this.#ft}set typeName(t){this.#ft=String(t)}get typeValues(){return new bt(this.#ft,this.#jt.getAttributesFor(this.#q))}get subj(){return this.#H}get obj(){return this.#Y}get attributes(){return this.#jt.getAttributesFor(this.#q)}get sourceEntity(){return this.#U.get(this.subj)}get targetEntity(){return this.#U.get(this.obj)}get sourceColor(){return this.sourceEntity.color}get targetColor(){return this.targetEntity.color}get isSelected(){return this.#u}get isHovered(){return this.#zt}select(){this.#u||(this.#u=!0,this.#Bt&&this.#Bt.updateHighlighting())}deselect(){this.#u&&(this.#u=!1,(this.#Qt||this.#Bt)&&this.redrawLineConsideringSelection())}render(t,e){this.sourceEntity.isInViewport(t,e)||this.targetEntity.isInViewport(t,e)?(this.#Qt?this.#Zt():(this.#Qt=new Bt(this.#Q,this,this.#gt,t=>{this.#Nt.emit("textae-event.editor.relation.click",t,this),t.stopPropagation()},(t,e)=>{this.#Nt.emit("textae-event.editor.relation-bollard.click",t,e),t.stopPropagation()},()=>this.#Wt(),()=>this.#Ft()),this.#Bt=new Xt(this.#Q,this,this.#Qt,(t,e)=>{this.#Nt.emit("textae-event.editor.relation.click",t,this,e),t.stopPropagation()},()=>this.#Wt(),()=>this.#Ft())),this.sourceEntity.clientTop>this.targetEntity.clientTop&&this.targetEntity.isInViewport(t,e)||this.sourceEntity.clientTop<this.targetEntity.clientTop&&this.sourceEntity.isInViewport(t,e)||this.sourceEntity.clientTop===this.targetEntity.clientTop?this.#Bt?this.#Xt():(this.#Bt=new Xt(this.#Q,this,this.#Qt,(t,e)=>{this.#Nt.emit("textae-event.editor.relation.click",t,this,e),t.stopPropagation()},()=>this.#Wt(),()=>this.#Ft()),this.#Bt.updateHighlighting()):this.#Bt&&(this.#Bt.destructor(),this.#Bt=void 0)):(this.#Qt||this.#Bt)&&this.erase()}updateElement(){this.#Qt&&this.#Qt.update(this.isSelected,this.isSelected,this.isSelected),this.#Bt&&this.#Bt.updateValue()}redrawLineConsideringSelection(){this.#Zt(),this.#Xt()}pointUpPathAndSourceBollards(){this.#Qt&&(this.targetEntity.isSelected?this.#Qt.update(!0,!0,!0):this.#Qt.update(!0,!0,this.isSelected)),this.#Bt&&this.#Bt.updateHighlighting()}pointUpPathAndTargetBollards(){this.#Qt&&(this.sourceEntity.isSelected?this.#Qt.update(!0,!0,!0):this.#Qt.update(!0,this.isSelected,!0)),this.#Bt&&this.#Bt.updateHighlighting()}pointUpSourceBollardsAndTargetBollards(){this.#Qt&&this.#Qt.update(this.isSelected,!0,!0),this.#Bt&&this.#Bt.updateHighlighting()}pointUpSourceBollards(){this.#Qt&&this.#Qt.update(this.isSelected,!0,this.isSelected),this.#Bt&&this.#Bt.updateHighlighting()}pointUpTargetBollards(){this.#Qt&&this.#Qt.update(this.isSelected,this.isSelected,!0),this.#Bt&&this.#Bt.updateHighlighting()}erase(){this.#Qt&&(this.#Qt.destructor(),this.#Qt=void 0),this.#Bt&&(this.#Bt.destructor(),this.#Bt=void 0)}get title(){return`[${this.id}] pred: type, value: ${this.typeName}`}get color(){return this.#J.getColor(this.typeName)}get anchorHTML(){return mt(this.#lt,this.#nt)}get#lt(){return ut(this.#K,this.typeName,this.#J.getLabel(this.typeName))}get#nt(){return pt(this.#K,this.typeName,this.#J.getURI(this.typeName))}#Wt(){this.#zt=!0,this.#Qt.update(!0,!0,!0),this.#Bt&&this.#Bt.updateHighlighting();const t=new Set,e=new Set,i=new Set;for(const i of this.sourceEntity.relationsWhereThisIsSource)i!==this&&(i.targetEntity==this.targetEntity?t.add(i):e.add(i));for(const e of this.sourceEntity.relationsWhereThisIsTarget)e!==this&&(e.sourceEntity==this.targetEntity?t.add(e):i.add(e));for(const i of this.targetEntity.relationsWhereThisIsSource)i!==this&&(i.targetEntity==this.sourceEntity?t.add(i):e.add(i));for(const e of this.targetEntity.relationsWhereThisIsTarget)e!==this&&(e.sourceEntity==this.sourceEntity?t.add(e):i.add(e));for(const e of t)e.pointUpSourceBollardsAndTargetBollards();for(const t of e)t.pointUpSourceBollards();for(const t of i)t.pointUpTargetBollards()}#Ft(){this.#zt=!1;const t=new Set;for(const e of this.sourceEntity.relations)t.add(e);for(const e of this.targetEntity.relations)t.add(e);for(const e of t)e.redrawLineConsideringSelection()}#Zt(){this.#Qt&&(this.sourceEntity.isSelected&&this.targetEntity.isSelected?this.#Qt.update(!0,!0,!0):this.sourceEntity.isSelected?this.#Qt.update(!0,!0,this.isSelected):this.targetEntity.isSelected?this.#Qt.update(!0,this.isSelected,!0):this.#Qt.update(this.isSelected,this.isSelected,this.isSelected))}#Xt(){this.#Bt&&this.#Bt.updateHighlighting()}}class Ht extends vt{#Q;#Nt;#qt;#K;#J;#gt;constructor(t,e,i,n){super(e,"relation",()=>"R"),this.#Q=t,this.#Nt=e,this.#qt=i,this.#K=i.namespaceInstanceContainer,this.#J=n}set toolBarHeight(t){this.#gt=t}_toInstance(t){return new qt(this.#Q,this.#Nt,this.#qt.entityInstanceContainer,this.#qt.attributeInstanceContainer,this.#K,t,this.#J,this.#gt)}add(t){t=t instanceof qt?t:new qt(this.#Q,this.#Nt,this.#qt.entityInstanceContainer,this.#qt.attributeInstanceContainer,this.#K,t,this.#J,this.#gt);const e=super.add(t),{clientHeight:i,clientWidth:n}=document.documentElement;return e.render(i,n),e}changeType(t,e){const i=super.changeType(t,e);return i.updateElement(),i}remove(t){console.assert(t,"id is necessary!");super.remove(t).erase()}clear(){for(const t of this.all)t.erase();super.clear()}}class Vt{#M;#q;#jt;#G;#K;#Ht;#Vt;#gt;#u=!1;#zt=!1;#Yt=!1;#Rt=null;#Ut;#ft;constructor(t,e,i,n,s,o,r,a,l,c=null){this.#M=t,this.#q=c,this.#jt=e,this.#G=i,this.#Ht=s,this.#Vt=o,this.#K=n,this.#gt=l,this.span=r,this.typeName=a}get id(){return this.#q}set id(t){this.#q=t}get title(){return`[${this.id}] pred: type, value: ${this.#ft}`}get color(){return this.#J.getColor(this.typeName)}get anchorHTML(){return mt(this.#lt,this.#nt)}get span(){return this.#Ut}set span(t){this.#Ut=t,t.add(this)}get typeName(){return this.#ft}set typeName(t){this.#ft=String(t)}get typeValues(){return new bt(this.#ft,this.#jt.getAttributesFor(this.#q))}get relations(){return this.relationsWhereThisIsSource.concat(this.relationsWhereThisIsTarget)}get attributes(){return this.#jt.getAttributesFor(this.#q)}get relationsWhereThisIsSource(){return this.#G.all.filter(t=>t.subj===this.id)}get relationsWhereThisIsTarget(){return this.#G.all.filter(t=>t.obj===this.id)}get hasMultipleEndpoints(){const t=new Map;t.set("whereThisIsSourceAndTargetIsOnTheLeft",new Set),t.set("whereThisIsSourceAndTargetIsOnTheRight",new Set),t.set("whereThisIsSourceAndTargetIsUpOrDown",new Set);for(const e of this.relationsWhereThisIsSource)e.targetEntity.offsetCenter<this.offsetCenter?t.get("whereThisIsSourceAndTargetIsOnTheLeft").add(e):this.offsetCenter<e.targetEntity.offsetCenter?t.get("whereThisIsSourceAndTargetIsOnTheRight").add(e):t.get("whereThisIsSourceAndTargetIsUpOrDown").add(e);t.set("whereThisIsTargetAndSourceIsOnTheLeft",new Set),t.set("whereThisIsTargetAndSourceIsOnTheRight",new Set),t.set("whereThisIsTargetAndSourceIsUpOrDown",new Set);for(const e of this.relationsWhereThisIsTarget)e.sourceEntity.offsetCenter<this.offsetCenter?t.get("whereThisIsTargetAndSourceIsOnTheLeft").add(e):this.offsetCenter<e.targetEntity.offsetCenter?t.get("whereThisIsTargetAndSourceIsOnTheRight").add(e):t.get("whereThisIsTargetAndSourceIsUpOrDown").add(e);return[...t.values()].filter(t=>t.size).length>1}get clientTop(){const{span:t}=this;if(t.isDenotation){let e=t.clientTopOfGrid+this.#Ht.height;for(const i of t.entities){if(i===this)break;e+=this.#Ht.height+i.height}return C(e)}if(t.isBlock){const e=15;return C(t.clientBottomOfGrid-this.height-e)}throw new Error("Unexpected type of span")}get offsetTop(){return this.clientTop-this.span.element.offsetParent.offsetParent.getBoundingClientRect().top}get clientBottom(){return this.clientTop+this.height}isInViewport(t){return this.#gt<=this.clientBottom&&this.clientTop<=t}get width(){return this.span.widthOfGrid}get height(){return 18+this.#Gt}get heightWithTypeGap(){return this.height+this.#Ht.height}get offsetCenter(){return C(this.span.offsetCenterOfGrid)}get isDenotation(){return this.#Ut.isDenotation}get isBlock(){return this.#Ut.isBlock}get isSelected(){return this.#u}getSourceAnchorPosition(t){const e=this.width/2>=28||this.hasMultipleEndpoints&&t;return{left:e?this.offsetCenter-24:this.offsetCenter,right:e?this.offsetCenter+24:this.offsetCenter}}getTargetAnchorPosition(t){const e=this.width/2>=28||this.hasMultipleEndpoints&&t;return{left:e?this.offsetCenter-8:this.offsetCenter,right:e?this.offsetCenter+8:this.offsetCenter}}focus(){if(this.isDenotation)this.span.focus();else{if(!this.isBlock)throw new Error("Unexpected type of entity");this.span.forceRenderGrid(),this.#Rt.focus()}}select(){this.#u||(this.#u=!0,this.#Kt(),this.#Jt())}deselect(){this.#u&&(this.#u=!1,this.#Rt&&this.#Rt.deselect(),this.#Jt())}startCut(){this.#Rt&&this.#Rt.startCut()}cancelCut(){this.#Rt&&this.#Rt.cancelCut()}render(){if(!this.#Rt&&this.span.isGridRendered){this.#Rt=this.#te(),this.span.addEntityElementToGridElement(this.#Rt.element),this.reflectTypeGapInTheHeight();for(const t of this.span.entities.filter(t=>t!==this))for(const e of t.relations)e.redrawLineConsideringSelection();this.#u&&this.#Rt.select()}}updateElement(){if(this.#Rt){this.#Rt=this.#Rt.replaceWith(this.#te()),this.#u&&this.#Kt(),this.reflectTypeGapInTheHeight(),this.span.updateSelfAndAncestorsGridPosition();for(const t of this.span.entities)for(const e of t.relations)e.redrawLineConsideringSelection()}}reflectTypeGapInTheHeight(){this.isDenotation&&this.#Rt&&this.#Rt.reflectTypeGapInTheHeight(this.#Ht.height)}clarifyLabel(){this.#Rt&&this.#Rt.clarifyLabel(),this.#Yt=!0}declarifyLabel(){!this.#zt&&this.#Rt&&this.#Rt.declarifyLabel(),this.#Yt=!1}erase(){this.#Rt&&(this.#Rt.remove(),this.#Rt=null,this.span.updateSelfAndAncestorsGridPosition())}#te(){const t=new Ft(this,this.isDenotation?"denotation":"block",`${this.#M}__E${this.id.replace(/[:¥.]/g,"")}`);return t.addEventListener("mouseenter",()=>{t.clarifyLabel(),this.#ee(),this.#zt=!0}),t.addEventListener("mouseleave",()=>{this.#Yt||t.declarifyLabel(),this.#Jt(),this.#zt=!1}),t}#Kt(){this.span.forceRenderGrid(),this.#Rt.select(),this.span.isGridBeforePositioned?this.span.entityToFocusOn=this:this.focus()}get#J(){if(this.isDenotation)return this.#Vt.denotation;if(this.isBlock)return this.#Vt.block;throw"unknown entity type"}get#lt(){return ut(this.#K,this.typeName,this.#J.getLabel(this.typeName))}get#nt(){return pt(this.#K,this.typeName,this.#J.getURI(this.typeName))}get#Gt(){return this.attributes.map(({height:t})=>t).reduce((t,e)=>t+e,0)}#ee(){for(const t of this.relationsWhereThisIsSource)t.pointUpPathAndSourceBollards();for(const t of this.relationsWhereThisIsTarget)t.pointUpPathAndTargetBollards()}#Jt(){for(const t of this.relations)t.redrawLineConsideringSelection()}}class Yt extends vt{#M;#qt;#Ht;#K;#gt;constructor(t,e,i,n){super(e,"entity",t=>t.isDenotation?"T":"B"),this.#M=t,this.#qt=i,this.#Ht=n,this.#K=i.namespaceInstanceContainer}get#C(){return this.#qt.spanInstanceContainer}get#jt(){return this.#qt.attributeInstanceContainer}get#G(){return this.#qt.relationInstanceContainer}set toolBarHeight(t){this.#gt=t}_toInstance(t,e){const i=this.#ie(e,t);return new Vt(this.#M,this.#jt,this.#G,this.#K,this.#Ht,this.#qt.typeDictionary,i,t.obj,this.#gt,t.id)}add(t){if(t instanceof Vt){if(!t.span)throw new Error(`entity has no span! ${JSON.stringify(t)}`);return super.add(t),t.span.add(t),t.render(),t}if(void 0===t.spanType||void 0===t.begin||void 0===t.end)throw new Error(`entity has no span information! ${JSON.stringify(t)}`);const e=this.#C.find(t.spanType,t.begin,t.end),i=new Vt(this.#M,this.#jt,this.#G,this.#K,this.#Ht,this.#qt.typeDictionary,e,t.typeName,this.#gt);return console.assert(i.span.isDenotation||i.span.entities.length>0,"A block span cannot have more than one entity."),super.add(i),i.render(),i}remove(t){const e=super.get(t);e.span.remove(e),super.remove(t),e.erase()}changeType(t,e){const i=super.changeType(t,e);return i.updateElement(),i}moveEntities(t,e){for(const i of e){i.erase();const e=i.span;e.remove(i),e.updateSelfAndAncestorsGridPosition(),i.span=t,i.render();for(const t of i.relations)t.redrawLineConsideringSelection()}super._emit("textae-event.annotation-data.entity.move")}get denotations(){return this.all.filter(t=>t.isDenotation)}get blocks(){return this.all.filter(t=>t.isBlock)}redrawEntitiesWithSpecifiedAttribute(t){const e=this.all.filter(e=>e.typeValues.hasSpecificPredicateAttribute(t));for(const t of e)t.updateElement();for(const t of new Set([...e.map(({span:t})=>t)]))t.updateGridPosition()}clarifyLabelOfAll(){for(const t of this.all)t.clarifyLabel()}declarifyLabelOfAll(){for(const t of this.all)t.declarifyLabel()}#ie(t,e){return this.#C.find(t,e.span.begin,e.span.end)}hasDenotation(t){return this.denotations.some(e=>e.id===t)}}class Ut{constructor(t){this._trackNumber=t}addTrackNumberAsIDPrefix(t,e,i,n){const s=t.map(t=>({...t,id:this._prependToIDOf(t)})),o=e.map(t=>({...t,id:this._prependToIDOf(t)})),r=n.map(t=>({...t,id:this._prependToIDOf(t),subj:this._prependTrackNumberTo(t.subj),obj:t.obj})),a=i.map(t=>({...t,id:this._prependToIDOf(t),subj:this._prependTrackNumberTo(t.subj),obj:this._prependTrackNumberTo(t.obj)}));return{denotations:s,blocks:o,relations:a,attributes:r}}_prependToIDOf(t){return t.id?this._prependTrackNumberTo(t.id):null}_prependTrackNumberTo(t){return this._trackNumber+t}}function Gt(t){const{span:e}=t;return{...t,span:Kt(e)}}function Kt(t){return{...t,begin:parseInt(t.begin),end:parseInt(t.end)}}function Jt(t,e,i,n,s,o=""){const[r,a,l]=function(t,e,i){return[t.map(Gt),e.map(Gt),i.map(Gt)]}(s.typeSetting,s.denotation,s.block),{relation:c,attribute:h}=s,{denotations:u,blocks:d,relations:f,attributes:p}=new Ut(o).addTrackNumberAsIDPrefix(a,l,c,h);t.addSource(r,"typesetting"),t.addSource(u,"denotation"),t.addSource(d,"block"),e.addSource(u,"denotation"),e.addSource(d,"block"),n.addSource(f),i.addSource(p)}function te(t,e){return 0<=t&&t<=e.length}class ee{constructor(){this._map=new Map}set(t,e,i){this._map.set(t,[e,i])}getErrors(t){return this._map.has(t)?this._map.get(t)[0]:[]}getInhibitors(t){return this._map.has(t)?this._map.get(t)[1]:[]}get size(){return this._map.size}}function ie(t,e){return e.reduce((e,i)=>e.concat(i.getErrors(t)),[])}class ne{constructor(t,e,i="",n=()=>!0,s){this._candidates=t||[],this._name=i,this._predicate=n,this._prevValidation=s,this._sourcePropertyName=e}and(t,e){return new ne(this._candidates,this._sourcePropertyName,t,e,this)}validateAll(){const t=new ee;let e,i;for(e=this,i=this._candidates;e;e=e._prevValidation)i=e._validate(i,this._candidates,t);return[i,t]}_validate(t,e,i){return this._getRejects(e).length>0&&i.set(this._name,this._getRejects(e),this._getInhibitors(e)),this._getAccepts(t)}_getAccepts(t){return t.filter(t=>this._test(t))}_getRejects(t){return t.filter(t=>!this._test(t)).map(t=>function(t,e){return t.sourceProperty=e,t}(t,this._sourcePropertyName))}_getInhibitors(t){const e=new Map;for(const i of t){const t=this._predicate(i);Array.isArray(t)&&!t[0]&&e.set(i,t[1])}return e}_test(t){const e=this._predicate(t);return Array.isArray(e)?e[0]:e}}function se(t,e,i,n){return new ne(t,n).and("hasLength",t=>t.span.end-t.span.begin>0).and("inText",t=>function(t,e){return te(e.begin,t)&&te(e.end,t)}(e,t.span)).and("isNotCrossing",t=>{const e=H(i,t.span.begin,t.span.end);return[0===e.length,e]})}function oe(t,e){return t.some(t=>t.id===e)}function re(t,e){return void 0===e.id||1===t.filter(t=>e.id&&e.id===t.id).length}function ae(t,e){for(const[i,n]of e.getInhibitors("isNotCrossing"))console.warn(`Crossing ${t}: [${i.span.begin}:${i.span.end}](${i.id}) crosses with ${n.map(({id:t,span:e})=>`[${e.begin}:${e.end}](${t})`).join(", ")}`)}function le(t){const{typesettings:e,denotations:i,blocks:n}=t;return(e||[]).concat(i||[]).concat(n||[])}function ce(t,e,i){const[n,s]=function(t,e,i){return se(e,t,i,"typesettings").validateAll()}(t,i.typesettings,e),o=le(i),[r,a]=function(t,e,i,n){return se(e,t,i,"denotations").and("uniqueID",t=>re(n,t)).validateAll()}(t,i.denotations,e,o),[l,c]=function(t,e,i,n){return se(e,t,i,"blocks").and("uniqueID",t=>re(n,t)).and("uniqueRange",({span:t})=>1===e.filter(({span:e})=>t.begin===e.begin&t.end===e.end).length).validateAll()}(t,i.blocks,e,o),[h,u]=(d=r.concat(l),f=i.relations,new ne(f).and("object",t=>oe(d,t.obj)).and("subject",t=>oe(d,t.subj)).validateAll());var d,f;const[p,m]=(g=r.concat(l).concat(h),v=i.attributes,new ne(v).and("subject",t=>oe(g,t.subj)).and("unique",t=>function(t,e){return 1===t.filter(t=>t.subj===e.subj&&t.pred===e.pred&&t.obj===e.obj).length}(v,t)).validateAll());var g,v,y,O,b;return ae("TypeSettings",s),ae("Denotations",a),ae("Blocks",c),{accept:{denotation:r,attribute:p,relation:h,typeSetting:n,block:l},reject:{wrongRangeDenotations:a.getErrors("hasLength"),outOfTextDenotations:a.getErrors("inText"),wrongRangeBlocks:c.getErrors("hasLength"),outOfTextBlocks:c.getErrors("inText"),duplicatedRangeBlocks:c.getErrors("uniqueRange"),wrongRangeTypesettings:s.getErrors("hasLength"),outOfTextTypesettings:s.getErrors("inText"),duplicatedIDs:ie("uniqueID",[a,c]),boundaryCrossingSpans:ie("isNotCrossing",[s,a,c]),referencedEntitiesDoNotExist:(y=m.getErrors("subject"),O=u.getErrors("object"),b=u.getErrors("subject"),y.map(t=>(t.sourceProperty="attributes",t.alertSubj=!0,t)).concat(O.map(t=>(t.sourceProperty="relations",t.alertObj=!0,t))).concat(b.map(t=>(t.sourceProperty="relations",t.alertSubj=!0,t)))),duplicatedAttributes:m.getErrors("unique"),hasError:a.size||c.size||m.size||u.size||s.size}}}class he{#K;#C;#U;#G;#jt;#ne;#se;#oe;constructor(t,e){const{namespaceInstanceContainer:i,spanInstanceContainer:n,entityInstanceContainer:s,attributeInstanceContainer:o,relationInstanceContainer:r}=t;this.#K=i,this.#C=n,this.#U=s,this.#G=r,this.#jt=o,this.#ne=e}eval(){this.#ne.namespaces?this.#K.addSource(this.#ne.namespaces.map(t=>({id:t.prefix,...t}))):this.#K.addSource([]);const{accept:t,reject:e}=ce(this.#re,this.#ae,this.#ne);Jt(this.#C,this.#U,this.#jt,this.#G,t),e.name="Root annotations.",this.#se=e,this.hasMultiTracks&&(this.#oe=function(t,e,i,n,s,o,r){console.assert(r.tracks);const{tracks:a}=r;return a.map((r,a)=>{const l=a+1,c=`track${l}_`,{accept:h,reject:u}=ce(s,o,r);return Jt(t,e,i,n,h,c),u.name=`Track ${l} annotations.`,u})}(this.#C,this.#U,this.#jt,this.#G,this.#re,this.#ae,this.#ne))}get hasMultiTracks(){return Boolean(this.#ne.tracks)}get rejects(){return this.hasMultiTracks?[this.#se].concat(this.#oe):[this.#se]}get#re(){return this.#ne.text}get#ae(){return function(t){let e=le(t);if(t.tracks)for(const i of t.tracks)e=e.concat(le(i));return e}(this.#ne)}}function ue(t){return t.relationInstanceContainer.all.map(t=>({id:t.id,pred:t.typeName,subj:t.subj,obj:t.obj}))}function de(t){return t.entityInstanceContainer.blocks.map(t=>({id:t.id,span:{begin:t.span.begin,end:t.span.end},obj:t.typeName}))}class fe{constructor(t){this._isGapShown=!0,this._numberOfGap=1,this._callback=t}set show(t){this._isGapShown!==t&&(this._isGapShown=t,this._callback(this.value))}get show(){return this._isGapShown}get value(){return this._isGapShown?this._numberOfGap:0}get height(){return 24*this.value}set value(t){this._numberOfGap!==t&&(this._numberOfGap=t,this._callback(t))}}function pe(t){const e=parseInt(t,10);return isNaN(e)?0:e}class me{#Q;#r;#qt;#le;constructor(t,e,i){this.#Q=t,this.#r=t.querySelector(".textae-editor__text-box"),this.#qt=e,this.#le=i}get boundingClientRect(){return this.#r.getBoundingClientRect()}get lineHeight(){return t=this.#r,pe(window.getComputedStyle(t).lineHeight);var t}set lineHeight(t){var e,i,n;e=this.#r,i=t,n=this.#le,e.style.lineHeight=`${i}px`,e.style.paddingTop=`${i/2+n}px`,this.forceUpdate(),this.#qt.updatePosition()}render(t){this.#r.innerHTML=t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#039;")}updateLineHeight(){const t=this.#qt.spanInstanceContainer.maxHeight;t?this.lineHeight=t:this.#ce()}forceUpdate(){!function(t,e){const i=window.getComputedStyle(t);t.style.height="auto",t.style.height=`${t.offsetHeight-pe(i.paddingTop)+20+e}px`}(this.#r,this.#le),this.#he()}#ce(){const{lineHeight:t}=window.getComputedStyle(this.#Q);this.lineHeight=pe(t)}#he(){const t=this.#Q.querySelector(".textae-editor__relation-box");t.style.height=this.#r.style.height;const e=parseFloat(window.getComputedStyle(this.#r).width);t.style.width=e-10+"px"}}function ge(t,e,i){const n='\n <div class="textae-editor__body">\n <div class="textae-editor__annotation-box"></div>\n <svg\n namespace="http://www.w3.org/2000/svg"\n class="textae-editor__relation-box">\n </svg>\n <div class="textae-editor__text-box"></div>\n </div>\n ';return t.innerHTML=n.replace(/[\n\r]+/g,""),function(t){new MutationObserver(e=>{e.forEach(e=>{e.removedNodes.length&&1===e.removedNodes[0].nodeType&&(e.removedNodes[0].classList.contains("textae-editor__span")||e.removedNodes[0].classList.contains("textae-editor__type"))&&"BODY"===document.activeElement.tagName&&t.focus()})}).observe(t.querySelector(".textae-editor__body"),{childList:!0,subtree:!0})}(t),new me(t,e,i)}var ve=i(504),ye=i.n(ve);class Oe{#Nt;#ue;#de;#fe;#pe;#me=new(ye())(!1);constructor(t,e,i,n,s,o=!0){this.#Nt=t,this.#ue=e,this.#de=i,this.#fe=n,this.#pe=s,this.#me(()=>this.#Nt.emit("textae-event.type-definition.lock")),this.#me.set(o)}set autocompletionWs(t){this.#ue.autocompletionWs=t,this.#fe.autocompletionWs=t,this.#de.autocompletionWs=t}set autocompletionFunction(t){this.#ue.autocompletionFunction=t,this.#fe.autocompletionFunction=t,this.#de.autocompletionFunction=t}get denotation(){return this.#ue}get block(){return this.#de}get relation(){return this.#fe}get attribute(){return this.#pe}get autocompletionWs(){return this.#ue.autocompletionWs}get config(){const t={};return this.#ue.config.length&&(t["entity types"]=this.#ue.config),this.#fe.config.length&&(t["relation types"]=this.#fe.config),this.#pe.config.length&&(t["attribute types"]=this.#pe.config),this.#de.config.length&&(t["block types"]=this.#de.config),t}get isLock(){return this.#me()}lockEdit(){this.#me.set(!0)}unlockEdit(){this.#me.set(!1)}setTypeConfig(t){t?(this.#ue.config=t["entity types"],this.#fe.config=t["relation types"],this.#pe.config=t["attribute types"],this.#de.config=t["block types"],this.autocompletionWs=t.autocompletion_ws):(this.#ue.config=null,this.#fe.config=null,this.#pe.config=null,this.#de.config=null,this.autocompletionWs=""),this.#Nt.emit("textae-event.type-definition.reset")}}function be(t){const e=Array.from(t.keys());return e.sort((e,i)=>{const n=t.get(i).usage-t.get(e).usage;return 0!==n?n:e>i?1:e<i?-1:0}),e}function xe(t,e){for(const[e,i]of t.entries())t.set(e,{...i,usage:0});return e.reduce((t,{typeName:e})=>(t.get(e).usage+=1,t),t)}class we{#q;#st;#Bt;#ge;constructor(t,e,i,n){this.#q=t,this.#st=e,this.#Bt=i,this.#ge=n}get id(){return this.#q}get color(){return this.#st}get label(){return this.#Bt}get default(){return this.#ge}toJSON(){return{id:this.#q,color:this.#st,label:this.#Bt,default:this.#ge}}}class _e{#ve;constructor(t=[]){this.#ve=t.map(t=>new we(t.id,t.color,t.label,t.default))}has(t){return this.map.has(t)}get default(){return this.#ve.find(t=>!0===t.default)}replace(t,e){e=new we(e.id,e.color,e.label,e.default);const i=this.#ve.findIndex(e=>e.id===t);-1!==i?this.#ve.splice(i,1,e):this.#ve.push(e)}delete(t){this.#ve=this.#ve.filter(e=>e.id!==t)}ids(){return this.map.keys()}getColorOf(t){return this.#ye(t)?.color}getLabelOf(t){return this.#ye(t)?.label}labelsIncludes(t){return this.#ve.filter(t=>t.label).filter(e=>e.label.includes(t))}get map(){return new Map(this.#ve.map(t=>[t.id,t]))}#ye(t){if(this.has(t))return this.map.get(t);const e=function(t,e){const i=function(t,e){const i=[];for(const n of t)-1!==n.indexOf("*")&&0===e.indexOf(n.slice(0,-1))&&i.push(n);return i}(t,e);return 0===i.length?null:function(t){let e="";for(const i of t)i.length>e.length&&(e=i);return e}(i)}(this.ids(),t);return this.map.get(e)}}function Se(t,e){const i=new URL(t,location);return i.searchParams.append("term",e),fetch(i.href).then(t=>t.ok?t.json():[])}class ke{#Nt;#Oe;#be=new _e([]);#xe;#we;#_e;#Se="";#ke;constructor(t,e,i,n){this.#Nt=t,this.#Oe=e,this.#xe=i,this.#we=n}set autocompletionWs(t){this.#Se=t}set autocompletionFunction(t){this.#ke=t}get autocompletionWs(){return this.#Se}get annotationType(){return this.#Oe}get config(){const t=this.#$e;for(const[e,i]of t.entries()){const n=i.toJSON();i.id===this.defaultType?n.default=!0:delete n.default,t.set(e,n)}return[...t.values()]}set config(t){this.#be=new _e(t);const e=this.#be.default;e?(delete e.default,this.#_e=e.id):this.#_e=null}has(t){return this.#be.has(t)}get(t){const e={...this.#be.map.get(t)};return this.#_e===t?(e.default=!0,e):(delete e.default,e)}replace(t,e){this.#be.replace(t,e),this.#Nt.emit(`textae-event.type-definition.${this.#Oe}.change`,e.id)}addDefinedType(t){if(void 0===t.color){const e=this.getColor(t.id);e!==this.#we&&(t.color=e)}if(void 0===t.label){const e=this.getLabel(t.id);e&&(t.label=e)}t.default&&(this.#_e=t.id),this.replace(t.id,t)}get defaultType(){return this.#_e?this.#_e:this.#xe().length>0?be(xe(this.#$e,this.#xe()))[0]:"something"}set defaultType(t){this.#_e=t,this.#Nt.emit(`textae-event.type-definition.${this.#Oe}.change-default`,t)}get defaultColor(){return this.#we}getColor(t){return this.#be.getColorOf(t)||this.#we}getLabel(t){return this.#be.getLabelOf(t)}getURI(t){return ht(t)?t:void 0}searchByLabel(t,e){if("function"==typeof this.#ke){const i=this.#ke(t),n=this.mergeWithLocalData(i,t);return void e(n)}this.#Se?Se(this.#Se,t).then(i=>{const n=this.mergeWithLocalData(i,t);e(n)}):e(this.findByLabel(t))}findByLabel(t){return this.#be.labelsIncludes(t)}mergeWithLocalData(t,e){const i=this.findByLabel(e),n=(t||[]).filter(t=>!i.some(e=>t.id===e.id));return i.concat(n)}get pallet(){const t=xe(this.#$e,this.#xe());return function(t,e,i,n,s){return t.map(t=>({id:t,label:i.getLabelOf(t)||void 0,defaultType:t===n,uri:ht(t)?t:void 0,color:i.getColorOf(t)||s,useNumber:e.get(t).usage}))}(be(t),t,this.#be,this.defaultType,this.#we)}get#$e(){const t=this.#be.map;for(const{typeName:e}of this.#xe())t.has(e)||t.set(e,new we(e));return t}delete(t,e){this.#be.delete(t),this.#_e=e,this.#Nt.emit(`textae-event.type-definition.${this.#Oe}.delete`,t)}}class $e{constructor(t,e){this.valueType=t,this.pred=e}get values(){return console.assert(this._values,"this._values to return!"),this._values}get externalFormat(){return{pred:this.pred}}get _valuesClone(){if(console.assert(this._values,"this._values is necessary to clone!"),Array.isArray(this._values)&&0===this._values.length)return;const t=[];for(const e of this._values)t.push({...e});return t}}class Te extends $e{constructor(t,e){super(t,e.pred),this.default=!0,this.label=e.label,this.color=e.color}getLabel(){return this.label}getDisplayName(){return this.label?this.label:this.pred}getColor(){return this.color}get externalFormat(){return{...super.externalFormat,"value type":"flag",default:this.default,label:this.label,color:this.color}}}function Ce(t,e){return t<=e}function Pe(t,e){return t<e}function Ee(t){if(t.startsWith("["))return e=>Ce(new Number(t.replace("[","")),e);if(t.startsWith("("))return e=>Pe(new Number(t.replace("(","")),e);throw`${t} is not valid interval notation`}function Ae(t){if(t.endsWith("]"))return e=>Ce(e,new Number(t.replace("]","")));if(t.endsWith(")"))return e=>Pe(e,new Number(t.replace(")","")));throw`${t} is not valid interval notation`}class Me{constructor(t){const[e,i]=t.split(",");if(i?(this._lowwerCond=Ee(e),this._upperCond=Ae(i)):((e.startsWith("[")||e.startsWith("("))&&(this._lowwerCond=Ee(e),this._upperCond=t=>!0),(e.endsWith("]")||e.endsWith(")"))&&(this._lowwerCond=t=>!0,this._upperCond=Ae(e))),!this._lowwerCond||!this._upperCond)throw`${t} is not valid interval notation`}test(t){return this._lowwerCond(t)&&this._upperCond(t)}}function Qe(t){return!Number.isNaN(parseFloat(t))}class De extends $e{constructor(t,e){super(t,e.pred),this.default=Qe(e.default)?parseFloat(e.default):0,Qe(e.min)&&(this.min=parseFloat(e.min)),Qe(e.max)&&(this.max=parseFloat(e.max)),this.step=Qe(e.step)?parseFloat(e.step):2,this._values=e.values||[]}getLabel(t){const e=this.#Te(t);if(e&&e.label)return e.label}getDisplayName(t){return this.getLabel(t)||String(t)}getColor(t){const e=this.#Te(t);return e&&e.color?e.color:null}#Te(t){const e=this._values.filter(t=>"default"!==t.range).find(e=>new Me(e.range).test(t));if(e)return e;const i=this._values.find(t=>"default"===t.range);return i||null}get externalFormat(){return{...super.externalFormat,"value type":"numeric",default:this.default,min:this.min,max:this.max,step:this.step,values:super._valuesClone}}}class Re extends $e{constructor(t,e){super(t,e.pred),this._values=e.values||[]}get default(){return this.values.find(t=>t.default).id}getLabel(t){const e=this.#Te(t);if(e&&e.label)return e.label}getDisplayName(t){return this.getLabel(t)}getColor(t){const e=this.#Te(t);return e&&e.color?e.color:null}get values(){return this._values}get hasOnlyOneValue(){return 1===this._values.length}#Te(t){return this.values.find(e=>e.id==t)}get externalFormat(){return{...super.externalFormat,"value type":"selection",values:super._valuesClone}}}class Ie extends $e{constructor(t,e){super(t,e.pred),this.autocompletionWs=e.autocompletion_ws,this.default=e.default,Qe(e["media height"])&&(this.mediaHeight=parseFloat(e["media height"])),this._values=e.values||[]}getLabel(t){const e=this.#Te(t);if(e&&e.label)return e.label}getDisplayName(t){return this.getLabel(t)}getColor(t){const e=this.#Te(t);return e&&e.color?e.color:null}#Te(t){const e=this._values.filter(t=>"default"!==t.pattern).find(e=>new RegExp(e.pattern).test(t));if(e)return e;const i=this._values.find(t=>"default"===t.pattern);return i||null}get externalFormat(){return{...super.externalFormat,"value type":"string",autocompletion_ws:this.autocompletionWs,default:this.default,values:super._valuesClone,"media height":this.mediaHeight}}}function Le(t,e){switch(t){case"flag":return new Te(t,e);case"numeric":return new De(t,e);case"selection":return new Re(t,e);case"string":return new Ie(t,e);default:throw new Error(`${t} of ${JSON.stringify(e)} is Uknown Attribute`)}}class Ne{#Nt;#xe;#be=new Map;constructor(t,e){this.#Nt=t,this.#xe=e}get config(){return this.attributes.map(t=>t.externalFormat)}set config(t){this.#be=new Map((t||[]).map(t=>[t.pred,Le(t["value type"],t)]))}create(t,e,i=null){null!==i&&this.#be.size!==i?this.#be=new Map(Array.from(this.#be.entries()).reduce((n,[s,o],r)=>(r===i&&n.push([e.pred,Le(t,e)]),n.push([s,o]),n),[])):this.#be.set(e.pred,Le(t,e)),this.#Nt.emit("textae-event.type-definition.attribute.create",e.pred)}get(t){return this.#be.get(t)}update(t,e){return this.#be=new Map(Array.from(this.#be.entries()).map(([i,n])=>i===t?[e.pred,Le(n.valueType,e)]:[i,n])),this.#Nt.emit("textae-event.type-definition.attribute.change",e.pred),this.get(e.pred)}updateValues(t,e){const i=this.get(t).externalFormat;return this.update(t,{...i,values:e})}move(t,e){var i,n,s;this.#be=new Map((i=this.attributes,n=t,s=e,function(t,e,i){const n=e<0?t.length+e:e;if(n>=0&&n<t.length){const n=i<0?t.length+i:i,[s]=t.splice(e,1);t.splice(n,0,s)}}(i=[...i],n,s),i).map(t=>[t.pred,t]));const{pred:o}=this.attributes[-1===e?this.attributes.length-1:e];this.#Nt.emit("textae-event.type-definition.attribute.move",o)}delete(t){this.#be.delete(t),this.#Nt.emit("textae-event.type-definition.attribute.delete")}get attributes(){return Array.from(this.#be.values())||[]}isSelectionAttributeValueIndelible(t,e){return!!this.get(t).hasOnlyOneValue||!!this.#xe().some(i=>i.equalsTo(t,e))}getLabel(t,e){return console.assert(this.#be.has(t),`There is no attribute definition for ${t}.`),this.get(t).getLabel(e)}getDisplayName(t,e){return console.assert(this.#be.has(t),`There is no attribute definition for ${t}.`),this.get(t).getDisplayName(e)}getColor(t,e){if(this.#be.has(t))return this.get(t).getColor(e)}getIndexOf(t){return Array.from(this.#be.values()).findIndex(e=>e.pred===t)}getAttributeAt(t){return Array.from(this.#be.values())[t-1]}attributeCompareFunction(t,e){const i=this.getIndexOf(t.pred),n=this.getIndexOf(e.pred);return i!==n?i-n:t.id&&e.id?t.id.localeCompare(e.id):0}}class je{constructor(t,e){this._textBox=e,this._enable=!1,t.on("textae-event.control.button.push",({name:t,isPushed:e})=>{"auto adjust lineheight"===t&&(this._enable=e)})}updateLineHeight(){this._enable&&this._textBox.updateLineHeight()}}function ze(t,e,i){for(const n of i)t[n]=(...t)=>{const i=e();return console.assert(i[n],`No ${n} method to forward`,i),i[n].apply(i,t)};return t}class Be{#Ce;#Ht;#O;#Pe;#K;#C;#U;#G;#jt;#Vt;#Q;#Nt;constructor(t,e,i,n,s,o,r,a){this.#Ce="",this.#K=new w(i,"namespace");const l=new ke(i,"relation",()=>this.#G.all,"#00CC66");this.#G=new Ht(e,i,this,l),this.#Ht=new fe(()=>{for(const t of this.entityInstanceContainer.denotations)t.reflectTypeGapInTheHeight();this.#O.updateLineHeight(),i.emit("textae-event.annotation-data.entity-gap.change")}),this.#U=new Yt(t,i,this,this.#Ht),this.attributeDefinitionContainer=new Ne(i,()=>this.#jt.all),this.#jt=new Ot(i,this.#U,this.#G,this.#K,this.attributeDefinitionContainer),this.updatePosition=()=>{try{n.startWait(),s(),this.#Ee()}catch(t){console.error(t)}finally{n.endWait(),o()}},this.#O=ge(e,this,a),this.#Pe=new je(i,this.#O),this.#C=new nt(t,e,i,this.#O),ze(this,()=>this.#C,["getDenotationSpan","isBoundaryCrossingWithOtherSpans","hasParentOf","validateNewDenotationSpan","validateNewBlockSpan","validateEditableText"]),this.denotationDefinitionContainer=new ke(i,"entity",()=>this.#U.denotations,"#77DDDD");const c=new ke(i,"entity",()=>this.#U.blocks,"#77DDDD");this.#Vt=new Oe(i,this.denotationDefinitionContainer,c,l,this.attributeDefinitionContainer,r),i.on("textae-event.annotation-data.span.add",t=>{(t.isDenotation||t.isBlock)&&(this.#O.forceUpdate(),this.#Ee())}).on("textae-event.annotation-data.span.remove",t=>{(t.isDenotation||t.isBlock)&&(this.#O.forceUpdate(),this.#Ee())}).on("textae-event.annotation-data.entity.add",t=>{t.span.isDenotation&&this.#Pe.updateLineHeight()}).on("textae-event.annotation-data.entity.remove",t=>{t.span.isDenotation&&this.#Pe.updateLineHeight()}),i.on("textae-event.type-definition.entity.change",t=>{for(const e of this.#U.all)(e.typeName===t||t.lastIndexOf("*")===t.length-1&&e.typeName.indexOf(0===t.slice(0,-1)))&&e.updateElement()}).on("textae-event.type-definition.attribute.change",t=>this.#U.redrawEntitiesWithSpecifiedAttribute(t)).on("textae-event.type-definition.attribute.move",t=>this.#U.redrawEntitiesWithSpecifiedAttribute(t)).on("textae-event.type-definition.relation.change",t=>{for(const e of this.#G.all)(e.typeName===t||t.lastIndexOf("*")===t.length-1&&e.typeName.indexOf(0===t.slice(0,-1)))&&e.updateElement()}),this.#Q=e,this.#Nt=i}reset(t,e){console.assert(t.text,"This is not a json file of annotations."),this.#Vt.setTypeConfig(e),this.#Ce=t.text,this.#O.render(this.sourceDoc),this.#Ae();const i=new he(this,t);i.eval(),this.#Me(),this.#Nt.emit("textae-event.annotation-data.all.change",i.hasMultiTracks,i.rejects),this.reLayout()}set autocompletionFunction(t){this.#Vt.autocompletionFunction=t}get externalFormat(){return{text:this.#Ce,denotations:(t=this,t.entityInstanceContainer.denotations.map(t=>({id:t.id,span:{begin:t.span.begin,end:t.span.end},obj:t.typeName}))),attributes:this.#jt.all.map(({externalFormat:t})=>t),relations:ue(this),blocks:de(this)};var t}getReplicationRanges(t,e){return function(t,e,i,n,s){return function(t,e,i){const n=t.substring(e,i),s=i-e,o=[];let r=0;for(let e=t.indexOf(n);-1!==e;e=t.indexOf(n,r))r=e+s,o.push({begin:e,end:r});return o}(t,e,i).filter(({begin:t})=>t!==e).filter(({begin:e,end:i})=>function(t,e,i,n){const s=t.charAt(e-1),o=t.charAt(i);return n(s)&&n(o)}(t,e,i,s)).filter(({begin:t,end:e})=>!n.find("denotation",t,e)).filter(({begin:t,end:e})=>!n.isBoundaryCrossingWithOtherSpans(t,e))}(this.sourceDoc,t.begin,t.end,this.#C,e)}get typeGap(){return this.#Ht}get textBox(){return this.#O}get sourceDoc(){return this.#Ce.replaceAll(/\r\n/g," \n")}get typeDictionary(){return this.#Vt}get spanInstanceContainer(){return this.#C}getSpan(t){return this.#C.get(t)}get entityInstanceContainer(){return this.#U}get relationInstanceContainer(){return this.#G}get attributeInstanceContainer(){return this.#jt}get namespaceInstanceContainer(){return this.#K}get textSelection(){return this.#C.textSelection}findDenotation(t,e){return this.#C.find("denotation",t,e)}findBlock(t,e){return this.#C.find("block",t,e)}getTextBetween(t,e){return this.sourceDoc.substring(t,e)}changeTextBetween(t,e,i){this.#Ce=`${this.#Ce.slice(0,t)}${i}${this.#Ce.slice(e)}`;const n=i.length-(e-t),s=this.#C.offsetSpans(t,e,n);return this.#O.render(this.sourceDoc),this.#Me(),this.#Nt.emit("textae-event.annotation-data.text.change"),s}hasCharacters(t){const{begin:e,end:i}=this.textSelection,n=this.getTextBetween(e,i);return t.removeBlankCharacters(n).length>0}getTextSelection(t,e){const{begin:i,end:n}=this.textSelection;return{begin:e.backFromBegin(this.sourceDoc,i,t),end:e.forwardFromEnd(this.sourceDoc,n-1,t)+1}}getInstanceContainerFor(t){switch(t){case"span":return this.#C;case"relation":return this.#G;case"entity":return this.#U;case"attribute":return this.#jt}}drawGridsInSight(){if(this.#Qe){const{clientHeight:t,clientWidth:e}=document.documentElement;for(const i of this.#C.allDenotationSpans)i.drawGrid(t,e);for(const i of this.#C.allBlockSpans)i.drawGrid(t,e),i.updateBackgroundPosition();for(const i of this.#G.all)i.render(t,e)}}reLayout(){this.#O.forceUpdate(),this.#Qe&&this.updatePosition()}set toolBarHeight(t){this.#U.toolBarHeight=t,this.#G.toolBarHeight=t}get#Qe(){const{clientHeight:t}=document.documentElement,{top:e,bottom:i}=this.#Q.getBoundingClientRect();return 0<=i&&e<=t}focusDenotation(t){console.assert(this.#U.hasDenotation(t),"The denotation does not exist.");const{span:e}=this.#U.get(t);e.focus()}#Me(){this.#C.renderAll(),this.#O.updateLineHeight(),this.drawGridsInSight()}#Ee(){this.#C.arrangeDenotationEntityPosition(),this.#C.arrangeBackgroundOfBlockSpanPosition(),this.#C.arrangeBlockEntityPosition();for(const t of this.#G.all)t.sourceEntity.span.isGridRendered&&t.targetEntity.span.isGridRendered&&t.redrawLineConsideringSelection()}#Ae(){this.#C.clear(),this.#U.clear(),this.#jt.clear(),this.#G.clear(),this.#K.clear(),L(this.#Q).innerHTML=""}}const Ze={"delimiter characters":[" ",".","!","?",",",":",";","-","/","&","(",")","{","}","[","]","+","*","\\",'"',"'","\n","–"],"non-edge characters":[" ","\n"]};class We{#De;#Re;constructor(){this.#De=[],this.#Re=[]}get delimiterCharacters(){return this.#De}get blankCharacters(){return this.#Re}set(t){const e={...Ze,...t};return this.#De=e["delimiter characters"],this.#Re=e["non-edge characters"],t}isDelimiter(t){return this.#De.indexOf("ANY")>=0?1:this.#De.indexOf(t)>=0}isBlankCharacter(t){return this.#Re.indexOf(t)>=0}removeBlankCharacters(t){for(const e of this.#Re)t=t.replaceAll(e,"");return t}}class Fe{constructor(t){this._resetHistory(),this._eventEmitter=t,t.on("textae-event.type-definition.reset",()=>{this._removeConfigurationOperationsFromHistory(),this._trigger()}).on("textae-event.annotation-data.all.change",()=>{this._resetHistory(),this._trigger()}).on("textae-event.resource.annotation.save",()=>{this._trigger()}).on("textae-event.resource.configuration.save",()=>{this._trigger()})}push(t){this._histories.splice(this._pointer+1,this._histories.length-this._pointer,t),this._pointer++,this._trigger()}next(){this._pointer++;const t=this._histories[this._pointer];return this._trigger(),t}prev(){const t=this._histories[this._pointer];return this._pointer--,this._trigger(),t}get hasAnythingToUndo(){return this._pointer>-1}get hasAnythingToRedo(){return this._pointer<this._histories.length-1}_trigger(){this._eventEmitter.emit("textae-event.history.change",this)}_removeConfigurationOperationsFromHistory(){for(let t=0;t<this._histories.length;t++)this._histories[t].isExactly("configuration_command")&&(this._pointer--,this._histories.splice(t,1))}_resetHistory(){this._pointer=-1,this._histories=[]}}function Xe(t,e,i){i?console.log(`[${t.constructor.name}]`,e,i):console.log(`[${t.constructor.name}]`,e)}class qe{get isEmpty(){return!1}isExactly(t){return this.kind.has(t)&&1===this.kind.size}}class He extends qe{get kind(){return new Set(["annotation_command"])}}class Ve extends He{#qt;#Oe;#Et;#Ie;constructor(t,e,i,n=null){super(),this.#qt=t,this.#Oe=e,this.#Et=i,this.#Ie=n}execute(){this.#Et=this.#qt.getInstanceContainerFor(this.#Oe).add(this.#Et),this.#Ie&&this.#Ie.add(this.#Oe,[this.#Et.id]),Xe(this,`${this.#Oe}: ${this.#Et.id}`)}revert(){return new Ye(this.#qt,this.#Oe,this.#Et)}}class Ye extends He{#qt;#Oe;#Et;constructor(t,e,i){super(),this.#qt=t,this.#Oe=e,this.#Et=i}execute(){this.#qt.getInstanceContainerFor(this.#Oe).remove(this.#Et.id),Xe(this,`${this.#Oe}: ${this.#Et.id}`)}revert(){return new Ve(this.#qt,this.#Oe,this.#Et)}}class Ue extends qe{get kind(){return new Set(["configuration_command"])}}class Ge extends Ue{constructor(t,e,i,n=null){super(),this._definitionContainer=t,this._attrDef=e,this._index=i,this._indexThatAddDefaultTo=n}execute(){const t=[...this._attrDef.values];if("selection"===this._attrDef.valueType&&t[this._index].default&&null===this._indexThatAddDefaultTo){let e=null;t.forEach((t,i)=>{null===e&&i!=this._index&&(e=i)}),t[e]={...t[e],default:!0}}this._deletedValue=t.splice(this._index,1)[0],"selection"===this._attrDef.valueType&&null!==this._indexThatAddDefaultTo&&(t[this._indexThatAddDefaultTo]={...t[this._indexThatAddDefaultTo],default:!0}),this._updatedAttrDef=this._definitionContainer.updateValues(this._attrDef.pred,t),Xe(this,`remove a value from an attrribute:${this._attrDef.pred}, index:${this._index}, updated values: \n ${t.map(t=>JSON.stringify(t)).join("\n ")}`)}revert(){return new Ke(this._definitionContainer,this._updatedAttrDef,this._deletedValue,this._index)}}class Ke extends Ue{constructor(t,e,i,n=null){super(),this._definitionContainer=t,this._pred=e.pred,this._index=n,this._value=i;const s=[...e.values];if("selection"===e.valueType&&i.default){this._indexThatRemoveDefaultFrom||(this._indexThatRemoveDefaultFrom=s.findIndex(t=>t.default));const t={...s[this._indexThatRemoveDefaultFrom]};delete t.default,s[this._indexThatRemoveDefaultFrom]=t}s.splice(n||s.length,0,i),this._modifiedValues=s}execute(){this._updatedAttrDef=this._definitionContainer.updateValues(this._pred,this._modifiedValues),Xe(this,`add a new value to attrribute:${this._pred}, value: ${JSON.stringify(this._value)}, index: ${this._index}, updated values: \n ${this._modifiedValues.map(t=>JSON.stringify(t)).join("\n ")}`)}revert(){return new Ge(this._definitionContainer,this._updatedAttrDef,this._updatedAttrDef.values.length-1,this._indexThatRemoveDefaultFrom)}}class Je extends qe{constructor(){super(),this._isExecuteSubCommandsInReverseOrderWhenRevert=!0}execute(){if(console.assert(this._subCommands,"_subCommands is necessary!"),this.isEmpty)return void(this.revert=()=>({execute(){}}));for(const t of this._subCommands)t.execute();this._afterInvoke&&this._afterInvoke();const t=this;this.revert=()=>({_subCommands:this._subCommands,_logMessage:this._logMessage,_afterInvoke:this._afterInvoke,_isExecuteSubCommandsInReverseOrderWhenRevert:this._isExecuteSubCommandsInReverseOrderWhenRevert,execute(){let e=this._subCommands.map(t=>t.revert());this._isExecuteSubCommandsInReverseOrderWhenRevert&&(e=e.reverse());for(const t of e)t.execute();this._afterInvoke&&this._afterInvoke(),Xe(t,`revert: ${this._logMessage}`)}}),Xe(this,this._logMessage)}get kind(){return this._subCommands.reduce((t,e)=>new Set([...t,...e.kind]),new Set)}get isEmpty(){return!this._subCommands||0===this._subCommands.length}}class ti extends Ue{constructor(t,e,i){super(),this._definitionContainer=t,this._attrDef=e,this._changedProperties=i}execute(){const t=this._attrDef.pred,[e,i]=function(t,e){const i=t.externalFormat,n=new Map;for(const[s,o]of e.entries())null===o&&void 0!==t[s]?(delete i[s],n.set(s,t[s])):null!==o&&(i[s]=o,n.set(s,void 0===t[s]?null:t[s]));return[i,n]}(this._attrDef,this._changedProperties);this._revertAttrDef=this._definitionContainer.update(t,e),this._revertChangedProperties=i,Xe(this,`change old pred:${t} to new attridute definition:${JSON.stringify(e)}`)}revert(){return new ti(this._definitionContainer,this._revertAttrDef,this._revertChangedProperties)}}class ei extends He{#qt;#Le;#Ne;#je;#ze;#Be;#Ze;constructor(t,e,i,n){super(),this.#qt=t,this.#Le=e,this.#Ne=e.pred,this.#je=e.obj,this.#ze=i,this.#Be=n}execute(){this.#Ze=this.#qt.attributeInstanceContainer.change(this.#Le.id,this.#ze,this.#Be),Xe(this,`attribute: ${this.#Le.id} changed from ${this.#Ne}:${this.#je} to ${this.#Ze.pred}:${this.#Ze.obj}.`)}revert(){return new ei(this.#qt,this.#Ze,this.#Ne,this.#je)}}class ii extends Je{constructor(t,e,i,n,s){super(),this._isExecuteSubCommandsInReverseOrderWhenRevert=!1;const o=[new ti(i,n,s)];let r=[];if(s.has("pred")){const i=e.attributeInstanceContainer.getSameDefinitionsAttributes(n.pred);r=i.map(t=>new ei(e,t,s.get("pred"),t.obj)),this._afterInvoke=()=>{t.emit("textae-event.commander.attributes.change",i)}}this._subCommands=o.concat(r),this._logMessage=`set ${[...s.entries()].map(([t,e])=>`${t}:${e}`)} to attribute definition ${n.pred}`}}class ni extends Je{constructor(t,e,i,n,s){super();const o=[];for(const t of i){const e=t.attributes.find(t=>t.pred==n.pred&&t.obj!==s);e&&o.push(e)}this._subCommands=o.map(t=>new ei(e,t,null,s)),o.length&&(this._afterInvoke=()=>t.emit("textae-event.commander.attributes.change",o)),this._logMessage=`update obj ${s} to attributes: ${o.map(t=>t.id).join(",")}`}}function si(t,e,i,n){if("string"===e.valueType&&n&&!e.values.some(t=>t.pattern===i)&&n!==e.getLabel(i))return new Ke(t,e,{pattern:i,label:n})}class oi extends Je{constructor(t,e,i,n,s,o,r=null){super();const a=[];for(const t of n){const e=t.attributes.find(t=>t.pred==s.pred&&t.obj!==o);e&&a.push(e)}this._subCommands=a.map(t=>new ei(e,t,null,o)),a.length&&(this._afterInvoke=()=>t.emit("textae-event.commander.attributes.change",a));const l=si(i,s,o,r);l&&this._subCommands.push(l),this._logMessage=`update obj ${o} to attributes: ${a.map(t=>t.id).join(",")}`}}class ri extends He{#We;#Oe;#q;#Fe;constructor(t,e,i,n){super(),this.#We=t,this.#Oe=e,this.#q=i,this.#Fe=n}execute(){this.oldType=this.#We.getInstanceContainerFor(this.#Oe).get(this.#q).typeName;const t=this.#We.getInstanceContainerFor(this.#Oe).changeType(this.#q,this.#Fe);Xe(this,`change type of a ${this.#Oe}. old type:${this.oldType} ${this.#Oe}:`,t)}revert(){return new ri(this.#We,this.#Oe,this.#q,this.oldType)}}class ai extends Je{constructor(t,e,i,n,s){super();const o=e[i].all.filter(t=>!t.typeValues.isSameType(n,s));this._subCommands=o.map(e=>new ri(t,i,e.id,n)),this._subCommands=this._subCommands.concat(function(t,e,i){const n=[];for(const s of t){if(s.typeValues)for(const t of s.attributes){const s=e.find(e=>t.equalsTo(e.pred,e.obj));s?String(t.obj)!==s.obj&&n.push(new ei(i,t,s.pred,s.obj)):n.push(new Ye(i,"attribute",t))}for(const t of e)s.attributes.some(e=>e.equalsTo(t.pred,t.obj))||n.push(new Ve(i,"attribute",{subj:s.id,pred:t.pred,obj:t.obj}))}return n}(o,s,t));for(const{pred:e,obj:i,label:n}of s){const s=t.typeDictionary.attribute,o=s.get(e),r=si(s,o,i,n);r&&this._subCommands.push(r)}this._logMessage=`set type ${n}${s.length>0?` and attributes ${JSON.stringify(s)}`:""} to ${i} items ${o.map(t=>t.id)}`}}class li extends Ue{constructor(t,e,i,n,s){super(),this._annotationModel=t,this._definitionContainer=e,this._id=i,this._changedProperties=n,this._newDefaultTypeId=s}execute(){const t=this._definitionContainer.get(this._id),[e,i]=function(t,e){const i={...e},n=new Map;for(const[s,o]of t.entries())null===o&&void 0!==e[s]?(delete i[s],n.set(s,e[s])):null!==o&&(i[s]=o,n.set(s,void 0===e[s]?null:e[s]));return[i,n]}(this._changedProperties,t);this._definitionContainer.replace(this._id,e),e.default?(this.revertDefaultTypeId=this._definitionContainer.defaultType,this._definitionContainer.defaultType=e.id):this._newDefaultTypeId&&(this._definitionContainer.defaultType=this._newDefaultTypeId),this.revertId=e.id,this.revertChangedProperties=i,Xe(this,`change old type:${JSON.stringify(t)} to new type:${JSON.stringify(e)}, default is ${this._definitionContainer.defaultType}`)}revert(){return new li(this._annotationModel,this._definitionContainer,this.revertId,this.revertChangedProperties,this.revertDefaultTypeId)}}class ci extends Ue{constructor(t,e,i){super(),this._definitionContainer=t,this._removeType=e,this._revertDefaultTypeId=i}execute(){const{id:t}=this._removeType,e=this._definitionContainer.get(t);this._definitionContainer.delete(t,this._revertDefaultTypeId),e&&(this._removeType=e),Xe(this,`remove a type:${JSON.stringify(this._removeType)}, default is ${this._definitionContainer.defaultType}`)}revert(){return new hi(this._definitionContainer,this._removeType)}}class hi extends Ue{constructor(t,e){super(),this._definitionContainer=t,this._newType=e}execute(){this._revertDefaultTypeId=this._definitionContainer._defaultType,this._definitionContainer.addDefinedType(this._newType),Xe(this,`create a new type:${JSON.stringify(this._newType)}, default is ${this._definitionContainer.defaultType}`)}revert(){return new ci(this._definitionContainer,this._newType,this._revertDefaultTypeId)}}function ui(t,e,i,n){return t.has(e)?new li(i,t,e,n,null):new hi(t,{id:e,...Object.fromEntries(n)})}class di extends Je{constructor(t,e,i,n,s,o){super();const r=[];i&&r.push(ui(s,n,t,new Map([["label",i]])));const a=new ai(t,e,s.annotationType,n,o);a.isEmpty||r.push(a),this._subCommands=r,this._logMessage=`change ${s.annotationType} value:"${n}"${i?`, label:"${i}"`:""}${o.length>0?`, attributes:${JSON.stringify(o)}`:""}`}}class fi extends Je{constructor(t,e,i,n,s){super();const o=[ui(e,n,t,s)];let r=[];s.has("id")&&(r=function(t,e,i,n){return t.getInstanceContainerFor(e).all.filter(t=>t.typeName===i).map(i=>new ri(t,e,i.id,n))}(t,i,n,s.get("id"))),this._subCommands=o.concat(r),this._logMessage=`set ${[...s.entries()].map(([t,e])=>`${t}:${e}`)} to type definition ${n}`}}class pi extends Je{constructor(t,e,i,n){super();const s=e[i].all.filter(t=>!t.typeValues.isSameType(n));this._subCommands=s.map(e=>new ri(t,i,e.id,n)),this._logMessage=`set type ${n} to ${i} items ${s}`}}class mi extends Ue{constructor(t,e,i,n,s){super(),this._definitionContainer=t,this._attrDef=e,this._targetIndex=i,this._newValue=n,this._indexThatRemoveDefaultFrom=s}execute(){if("selection"===this._attrDef["value type"]&&(!this._attrDef.values[this._targetIndex].default&&this._newValue.default&&(this._indexThatRemoveDefaultFrom||(this._indexThatRemoveDefaultFrom=this._attrDef.values.findIndex(t=>t.default)),delete this._attrDef.values[this._indexThatRemoveDefaultFrom].default),this._attrDef.values[this._targetIndex].default&&!this._newValue.default))if(1===this._attrDef.values.length)this._newValue.default=!0;else if(this._indexThatRemoveDefaultFrom)this._attrDef.values[this._indexThatRemoveDefaultFrom].default=!0;else{let t=null;this._attrDef.values.forEach((e,i)=>{null===t&&i!=this._targetIndex&&(t=i)}),this._attrDef.values[t].default=!0,this._indexThatRemoveDefaultFrom=t}this._valueBeforeChange=this._attrDef.values.splice(this._targetIndex,1,this._newValue)[0],this._definitionContainer.update(this._attrDef.pred,this._attrDef),Xe(this,`change value of attrribute:${this._attrDef.pred}, oldValue: ${JSON.stringify(this._valueBeforeChange)}, newValue: ${JSON.stringify(this._newValue)}`)}revert(){return new mi(this._definitionContainer,this._attrDef,this._targetIndex,this._valueBeforeChange,this._indexThatRemoveDefaultFrom)}}class gi extends Je{constructor(t,e,i,n,s,o,r){if(super(),this._subCommands=[new mi(i,n,s,o,r)],"selection"===n["value type"]&&n.values[s].id!==o.id){const i=e.attributeInstanceContainer.getSameAttributes(n.pred,n.values[s].id),r=i.map(t=>new ei(e,t,null,o.id));this._subCommands=this._subCommands.concat(r),this._afterInvoke=()=>t.emit("textae-event.commander.attributes.change",i)}this._logMessage=`attribute: ${n.pred}`}}class vi extends Ue{constructor(t,e){super(),this._definitionContainer=t,this._removeAttrdef=e,this._index=t.getIndexOf(e.pred)}execute(){this._definitionContainer.delete(this._removeAttrdef.pred),Xe(this,`remove an attrribute definition:${JSON.stringify(this._removeAttrdef)}, index:${this._index}`)}revert(){return new yi(this._definitionContainer,this._removeAttrdef,this._index)}}class yi extends Ue{constructor(t,e,i){super(),this._definitionContainer=t,this._newAttrDef=e,this._index=i}execute(){"selection"!==this._newAttrDef.valueType||this._newAttrDef.values||(this._newAttrDef.values=[{id:"default",default:!0}]),this._definitionContainer.create(this._newAttrDef.valueType,this._newAttrDef,this._index),Xe(this,`create a new attrribute definition:${JSON.stringify(this._newAttrDef)}, index: ${this._index}`)}revert(){return new vi(this._definitionContainer,this._newAttrDef)}}function Oi(t,e,i,n){return e.filter(t=>!t.typeValues.hasSpecificPredicateAttribute(i)).map(({id:e})=>new Ve(t,"attribute",{id:null,subj:e,pred:i,obj:n}))}class bi extends Je{constructor(t,e,i,n){super(),this._subCommands=Oi(t,e,i.pred,n||i.default),this._logMessage=`create attirbute ${i.pred}:${i.default} to item ${e.map(({id:t})=>t).join(", ")}`}}class xi extends Ve{constructor(t,e,i){super(t,"attribute",{obj:e,pred:i})}execute(){const t=this._annotationModel.entityInstanceContainer.all.pop().id;return this._instance.subj=t,super.execute()}}class wi extends Je{constructor(t,e,i,n,s,o,r){super(),this._subCommands=[new Ve(t,"entity",{spanType:i,begin:n,end:s,typeName:o},e)].concat(r.map(({obj:e,pred:i})=>new xi(t,e,i))),this._logMessage=`span: ${n}:${s}, type: ${o}${r.length?`, attributes: ${r.map(({pred:t})=>t).join(", ")}`:""}`}}class _i extends Je{constructor(t,e,i,n,s,o){super();const r=new Ve(e,"span",{begin:n,end:s,isBlock:!0},i),a=new wi(e,i,"block",n,s,o,[]);this._subCommands=[r,a],this._logMessage=`create a span ${n}:${s} with type ${o}`}}class Si extends Je{constructor(t,e,i){super();const n=e.span.all.filter(t=>t.isDenotation);this._subCommands=n.map(n=>new Ve(t,"entity",{spanType:"denotation",begin:n.begin,end:n.end,typeName:i},e)),this._logMessage=`create a ${i} type entity to ${n}`}}class ki extends Je{constructor(t,e,i,n,s,o){super(),this._subCommands=[new Ve(t,"span",{begin:n,end:s},e)].concat(o.map(i=>new wi(t,e,"denotation",n,s,i.typeName,i.attributes))),this._logMessage=`span: ${n}:${s}, types: ${o.map(({typeName:t})=>t).join(", ")}`}}class $i extends Je{constructor(t,e,i,n,s,o){super(),console.log(n),this._subCommands=e.getReplicationRanges(n,o).map(({begin:n,end:o})=>new ki(e,i,t,n,o,s)),this._logMessage=`from span: ${n.id}`}}class Ti extends Je{constructor(t,e,i,n,s,o,r){super();const a=[new bt(s)];this._subCommands=[new ki(e,i,t,n.begin,n.end,a)],this._logMessage=`create a span ${n.begin}:${n.end} with type ${a[0].typeName}`,o&&n.end-n.begin<=100&&(this._subCommands.push(new $i(t,e,i,{begin:n.begin,end:n.end},a,r)),this._logMessage=`${this._logMessage} and replicate auto`)}}class Ci extends Ue{constructor(t,e,i){super(),this._definitionContainer=t,this._oldIndex=e,this._newIndex=i}execute(){this._definitionContainer.move(this._oldIndex,this._newIndex),Xe(this,`move the attrribute definition: from ${this._oldIndex} to ${this._newIndex}`)}revert(){return new Ci(this._definitionContainer,this._newIndex,this._oldIndex)}}class Pi extends He{#C;#Xe;#qe;#He;#Ve;constructor(t,e,i,n,s){super(),this.#C=t,this.#Xe=e,this.#qe=i,this.#He=n,this.#Ve=s}execute(){this.#C.moveBlockSpan(this.#Xe,this.#qe,this.#He,this.#Ve),Xe(this,`move span: from {begin: ${this.#Xe}, end: ${this.#qe} } to {begin: ${this.#He}, end: ${this.#Ve}}`)}revert(){return new Pi(this.#C,this.#He,this.#Ve,this.#Xe,this.#qe)}}class Ei extends He{#C;#Xe;#qe;#He;#Ve;constructor(t,e,i,n,s){super(),this.#C=t,this.#Xe=e,this.#qe=i,this.#He=n,this.#Ve=s}execute(){this.#C.moveDenotationSpan(this.#Xe,this.#qe,this.#He,this.#Ve),Xe(this,`move span: from {begin: ${this.#Xe}, end: ${this.#qe} } to {begin: ${this.#He}, end: ${this.#Ve}}`)}revert(){return new Ei(this.#C,this.#He,this.#Ve,this.#Xe,this.#qe)}}function Ai(t,e){return t.entities.every(t=>e.includes(t))}class Mi extends Je{constructor(t,e){super(),this._subCommands=[];for(const[i,n]of e.entries())this._subCommands.push(new Qi(t,i,n));this._logMessage=`revert: move entities ${Array.from(e.values()).flat().map(t=>t.id).join(", ")}`}}class Qi extends He{constructor(t,e,i){super(),this._annotationModel=t,this._span=e,this._entities=i}execute(){this._moveMap=this._entities.reduce((t,e)=>(t.has(e.span)?t.get(e.span).push(e):t.set(e.span,[e]),t),new Map);const t=`${Array.from(this._moveMap.entries()).map(([t,e])=>`${e.map(t=>t.id).join(", ")} from ${e[0].span.id} to ${this._span.id}`).join(", ")}`;this._annotationModel.entityInstanceContainer.moveEntities(this._span,this._entities),Xe(this,t)}revert(){return new Mi(this._annotationModel,this._moveMap)}}class Di extends Je{constructor(t,e,i){console.assert(e.span.single,"There must be one span to be pasted."),super();const n=[new Qi(t,e.span.single,i)];for(const e of i.map(t=>t.span).reduce((t,e)=>(t.add(e),t),new Set).values())Ai(e,i)&&n.push(new Ye(t,"span",e));this._subCommands=n,this._logMessage="paste cut entities"}}class Ri extends Je{constructor(t,e,i,n,s,o){super();const r=e.span.all;this._subCommands=[];for(const e of n)this._subCommands.push(new hi(t.denotationDefinitionContainer,e));for(const e of s)this._subCommands.push(new yi(t.attributeInstanceContainerDefinitionContainer,{valueType:e["value type"],...e}));for(const{pred:e,value:i}of o)this._subCommands.push(new Ke(t.attributeInstanceContainerDefinitionContainer,t.attributeInstanceContainerDefinitionContainer.get(e),i));this._subCommands=this._subCommands.concat(r.map(n=>i.map(i=>new wi(t,e,"denotation",n.begin,n.end,i.typeName,i.attributes))).flat()),this._logMessage=`paste types [${i.map(({typeName:t,attributes:e})=>[`{type:${t}}`].concat(e.map(({pred:t,obj:e})=>`{${t}:${e}}`)))}] to ${r}`}}function Ii(t,e,i){return e.reduce((t,{attributes:e})=>t.concat(e),[]).filter(t=>t.pred===i).map(e=>new Ye(t,"attribute",e))}class Li extends Je{constructor(t,e,i){super();const n=Ii(t,e,i.pred);this._subCommands=n,this._logMessage=`remove ${i.pred} attribute from items ${e.map(t=>t.id).join(", ")}`}}function Ni(t,e,i){t.add(i);for(const t of i.attributes)e.add(t)}function ji(t,e,i,n){t.add(n);for(const t of n.attributes)i.add(t);for(const t of n.relations)Ni(e,i,t)}class zi extends Je{constructor(t,e){super();const i=new Set,n=new Set,s=new Set,o=new Set;for(const t of e.span.all){i.add(t);for(const e of t.entities)ji(n,s,o,e)}for(const t of e.entity.all)ji(n,s,o,t);for(const t of e.relation.all)Ni(s,o,t);for(const n of t.spanInstanceContainer.all)n.entities.every(t=>e.entity.all.includes(t))&&(n.styleOnly||i.add(n));this._subCommands=[];for(const e of o)this._subCommands.push(new Ye(t,"attribute",e));for(const e of s)this._subCommands.push(new Ye(t,"relation",e));for(const e of n)this._subCommands.push(new Ye(t,"entity",e));for(const e of i)this._subCommands.push(new Ye(t,"span",e));this._logMessage=`remove selected ${[...i,...n,...s,...o].map(({id:t})=>t).join(", ")}`}}class Bi extends Je{constructor(t,e){super();const i=new Ye(t,"relation",e),n=e.attributes.map(e=>new Ye(t,"attribute",e));this._subCommands=n.concat(i),this._logMessage=`remove a relation ${e.id}`}}class Zi extends Je{constructor(t,e){super();const i=new Ye(t,"entity",e),n=e.relations.map(e=>new Bi(t,e)),s=e.attributes.map(e=>new Ye(t,"attribute",e));this._subCommands=n.concat(s).concat(i),this._logMessage=`remove an entity ${e.id}`}}class Wi extends Je{constructor(t,e){super();const i=t.getSpan(e),n=i.entities.map(e=>new Zi(t,e)),s=new Ye(t,"span",i);this._subCommands=n.concat(s),this._logMessage=`remove a span ${e}`}}class Fi extends Je{constructor(t,e,i){super(),this._subCommands=Oi(t,e,i.pred,i.default);const n=Ii(t,e,i.pred);this._subCommands=this._subCommands.concat(n),this._logMessage=`toggle flag attirbute ${i.pred} to item ${e.map(({id:t})=>t).join(", ")}`}}class Xi extends He{#qt;#Ye;#Ue;#Ge;#Ke;#Je;constructor(t,e,i){super(),this.#qt=t,this.#Ye=e.begin,this.#Ue=e.end,this.#Ge=i}execute(){this.#Ke=this.#Ye+this.#Ge.length,this.#Je=this.#qt.getTextBetween(this.#Ye,this.#Ue);const t=this.#qt.changeTextBetween(this.#Ye,this.#Ue,this.#Ge);Xe(this,`change text at ${this.#Ye}:${this.#Ue} to ${this.#Ge} and spans [${t.map(({begin:t,end:e})=>`${t}:${e}`).join(", ")}] are effected.`)}revert(){return new Xi(this.#qt,{begin:this.#Ye,end:this.#Ke},this.#Je)}}class qi extends Je{constructor(t,e,i,n){super(),this._isExecuteSubCommandsInReverseOrderWhenRevert=!1,this._subCommands=[new Xi(t,{begin:e,end:i},n)],this._logMessage=`change text from ${e} to ${i} to ${n}`}}class Hi{#M;#Nt;#qt;#Ie;constructor(t,e,i,n){this.#M=t,this.#Nt=e,this.#qt=i,this.#Ie=n}addValueToAttributeDefinitionCommand(t,e){return new Ke(this.#qt.typeDictionary.attribute,t,e)}changeAttributeDefinitionCommand(t,e){return new ii(this.#Nt,this.#qt,this.#qt.typeDictionary.attribute,t,e)}changeAttributeObjOfItemsCommand(t,e,i){return new ni(this.#Nt,this.#qt,t,e,i)}changeStringAttributeObjOfItemsCommand(t,e,i,n){return new oi(this.#Nt,this.#qt,this.#qt.typeDictionary.attribute,t,e,i,n)}changeTypeValuesCommand(t,e,i,n){return new di(this.#qt,this.#Ie,t,e,i,n)}changeTypeDefinitionCommand(t,e,i,n){return new fi(this.#qt,t,e,i,n)}changeTypeOfSelectedItemsCommand(t,e){return new pi(this.#qt,this.#Ie,t,e)}changeValueOfAttributeDefinitionAndObjectOfSelectionAttributeCommand(t,e,i){return new gi(this.#Nt,this.#qt,this.#qt.typeDictionary.attribute,t,e,i)}createAttributeDefinitionCommand(t){return new yi(this.#qt.typeDictionary.attribute,t)}createAttributeToItemsCommand(t,e,i=null){return new bi(this.#qt,t,e,i)}createBlockSpanCommand(t){return new _i(this.#M,this.#qt,this.#Ie,t.begin,t.end,this.#qt.typeDictionary.block.defaultType)}createDefaultTypeEntityToSelectedSpansCommand(t){return new Si(this.#qt,this.#Ie,t)}createRelationCommand(t){return new Ve(this.#qt,"relation",t,this.#Ie)}createSpanAndAutoReplicateCommand(t,e,i){return new Ti(this.#M,this.#qt,this.#Ie,t,this.#qt.typeDictionary.denotation.defaultType,e,i)}createTypeDefinitionCommand(t,e){return new hi(t,e)}deleteAttributeDefinitionCommand(t){return new vi(this.#qt.typeDictionary.attribute,t)}moveAttributeDefinitionCommand(t,e){return new Ci(this.#qt.typeDictionary.attribute,t,e)}moveBlockSpanCommand(t,e,i){const{begin:n,end:s}=this.#qt.getSpan(t);return new Pi(this.#qt.spanInstanceContainer,n,s,e,i)}moveDenotationSpanCommand(t,e,i){const{begin:n,end:s}=this.#qt.getSpan(t);return new Ei(this.#qt.spanInstanceContainer,n,s,e,i)}moveEntitiesToSelectedSpanCommand(t){return new Di(this.#qt,this.#Ie,t)}pasteTypesToSelectedSpansCommand(t,e=[],i=[],n=[]){return new Ri(this.#qt,this.#Ie,t,e,i,n)}replicateSpanCommand(t,e,i){return new $i(this.#M,this.#qt,this.#Ie,t,e,i)}removeAttributesFromItemsByPredCommand(t,e){return new Li(this.#qt,t,e)}removeSpanCommand(t){return new Wi(this.#qt,t)}removeSelectedCommand(){return new zi(this.#qt,this.#Ie)}removeTypeDefinitionCommand(t,e){return new ci(t,e)}removeValueFromAttributeDefinitionCommand(t,e){return new Ge(this.#qt.typeDictionary.attribute,t,e)}toggleFlagAttributeToItemsCommand(t,e){return new Fi(this.#qt,t,e)}changeTextAndMoveSpanCommand(t,e,i){return new qi(this.#qt,t,e,i)}}class Vi{#Q;#M;#Nt;#qt;#Ie;#ti;constructor(t,e,i,n,s){this.#Q=t,this.#M=e,this.#Nt=i,this.#qt=n,this.#Ie=s,this.#ti=new Fe(i)}invoke(t){t.isEmpty||(t.execute(),this.#ti.push(t))}undo(){if(this.#ti.hasAnythingToUndo){this.#Ie.removeAll(),this.#Q.focus();const t=this.#ti.prev();t.kind.has("configuration_command")&&e().success("configuration has been undone"),t.revert().execute()}}redo(){if(this.#ti.hasAnythingToRedo){this.#Ie.removeAll();const t=this.#ti.next();t.kind.has("configuration_command")&&e().success("configuration has been redo"),t.execute()}}get factory(){return new Hi(this.#M,this.#Nt,this.#qt,this.#Ie,this.#qt.typeDictionary)}}class Yi{constructor(t,e){this._editorHTMLElement=t,this._selectionModel=e}left(t){const e=this._searchLeft(".textae-editor__span");if(e)return void(t?this._selectionModel.add("span",[e.id]):this._selectionModel.selectSpan(e.id));const i=this._searchLeft(".textae-editor__grid .textae-editor__signboard");i&&(t?this._selectionModel.add("entity",[i.dataset.id]):this._selectionModel.selectEntity(i.dataset.id))}right(t){const e=this._searchRight(".textae-editor__span");if(e)return void(t?this._selectionModel.add("span",[e.id]):this._selectionModel.selectSpan(e.id));const i=this._searchRight(".textae-editor__grid .textae-editor__signboard");i&&(t?this._selectionModel.add("entity",[i.dataset.id]):this._selectionModel.selectEntity(i.dataset.id))}_searchLeft(t){const e=this._editorHTMLElement.querySelectorAll(t),i=[...e].findIndex(t=>t.classList.contains("ui-selected")||t.classList.contains("textae-editor__signboard--selected"));if(i>0)return e[i-1]}_searchRight(t){const e=this._editorHTMLElement.querySelectorAll(t),i=[...e].reverse().findIndex(t=>t.classList.contains("ui-selected")||t.classList.contains("textae-editor__signboard--selected"));if(e.length-i>0)return e[e.length-i]}}class Ui{constructor(t,e){this._editorHTMLElement=t,this._selectionModel=e}up(){if(this._selectionModel.span.single){const t=this._selectionModel.span.single.gridElement.querySelector(".textae-editor__signboard");this._selectionModel.selectEntity(t.dataset.id)}}down(){const t=this._editorHTMLElement.querySelector(".textae-editor__signboard--selected");if(t){const e=t.closest(".textae-editor__grid").id.substring(1);this._selectionModel.selectSpan(e)}}}function Gi(t){return s()(t,300)}function Ki(t,e){r()(t,".textae-editor__setting-dialog__line-height-text","change",Gi(t=>{e.lineHeight=t.target.value,function(){const t=new Event("resize");window.dispatchEvent(t)}()}))}function Ji(t,e,i,n,s,o){!function(t,e,i){r()(t,".textae-editor__setting-dialog__type-gap-text","change",Gi(n=>{e.value=Number(n.target.value),t.querySelector(".textae-editor__setting-dialog__line-height-text").value=i.lineHeight}))}(t,i,s),Ki(t,s),function(t,e){r()(t,".textae-editor__setting-dialog__lock-config-text","change",Gi(t=>{t.target.checked?e.lockEdit():e.unlockEdit()}))}(t,n),function(t,e,i){r()(t,".textae-editor__setting-dialog__function-availability-checkbox","change",Gi(({target:t})=>{const n=t.closest(".textae-editor__setting-dialog__function-availability-label").textContent.trim();t.checked?(i.enable(n),e.emit("textae-event.configuration.reset")):(i.disable(n),e.emit("textae-event.configuration.reset"))}))}(t,e,o)}const tn="14.3.0";class en{static escape(t){return t.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}static decode(t){return t.replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r")}}function nn(t){const e=en.escape(t);return ot()(e)}function sn(t){const{typeGap:e,typeGapDisabled:i,lineHeight:n,autocompletionWs:s,typeDictionaryLocked:o,delimiterCharacters:r,blankCharacters:a,functionAvailability:l,version:c}=t;return rt`
211
- <div class="textae-editor__setting-dialog__container">
212
- <div class="textae-editor__setting-dialog__row">
213
- <label>Type Gap</label>
214
- <input
215
- type="number"
216
- class="textae-editor__setting-dialog__type-gap-text"
217
- step="1"
218
- min="0"
219
- max="5"
220
- value="${e}" ${i?'disabled="disabled"':""}>
221
- </div>
222
- <div class="textae-editor__setting-dialog__row">
223
- <label>Line Height(px)</label>
224
- <input
225
- type="number" class="textae-editor__setting-dialog__line-height-text"
226
- step="1"
227
- min="50"
228
- max="500"
229
- value="${n}">
230
- </div>
231
- <div class="textae-editor__setting-dialog__row">
232
- <label>Autocompletion_ws</label>
233
- <input
234
- type="text"
235
- class="textae-editor__setting-dialog__autocompletion_ws-text"
236
- value="${s}">
237
- </div>
238
- <div class="textae-editor__setting-dialog__details">
239
- <details>
240
- <summary>Delimiter Characters</summary>
241
- <table>
242
- <tr class="textae-editor__setting-dialog__delimiter-character-add-row">
243
- <td><input class="textae-editor__setting-dialog__delimiter-character-add-input" type="text"></td>
244
- <td><button class="textae-editor__setting-dialog__delimiter-character-add-button">+</button></td>
245
- </tr>
246
- ${()=>r.slice().reverse().map(t=>function(t){return`\n<tr class="textae-editor__setting-dialog__delimiter-character-row">\n <td>\n <span class="textae-editor__setting-dialog__delimiter-character">${nn(t)}</span>\n </td>\n <td><button class="textae-editor__setting-dialog__delimiter-character-delete-button">&times;</button></td>\n</tr>`}(t)).join("")}
247
- </table>
248
- </details>
249
- </div>
250
- <div class="textae-editor__setting-dialog__details">
251
- <details>
252
- <summary>Non-edge Characters</summary>
253
- <table>
254
- <tr class="textae-editor__setting-dialog__blank-character-add-row">
255
- <td><input class="textae-editor__setting-dialog__blank-character-add-input" type="text"></td>
256
- <td><button class="textae-editor__setting-dialog__blank-character-add-button">+</button></td>
257
- </tr>
258
- ${()=>a.slice().reverse().map(t=>function(t){return`\n<tr class="textae-editor__setting-dialog__blank-character-row">\n <td>\n <span class="textae-editor__setting-dialog__blank-character">${nn(t)}</span>\n </td>\n <td><button class="textae-editor__setting-dialog__blank-character-delete-button">&times;</button></td>\n</tr>`}(t)).join("")}
259
- </table>
260
- </details>
261
- </div>
262
- <div class="textae-editor__setting-dialog__details">
263
- <details>
264
- <summary>Function Availability</summary>
265
- <div class="textae-editor__setting-dialog__function-availability-list">
266
- ${()=>l.names.map(t=>function(t,e){return`\n<label class="textae-editor__setting-dialog__function-availability-label">\n <input\n type="checkbox"\n class="textae-editor__setting-dialog__function-availability-checkbox"\n ${t.isAvailable(e)?'checked="checked"':""}>\n ${e}\n</label>`}(l,t)).join("")}
267
- </div>
268
- </details>
269
- </div>
270
- <div class="textae-editor__setting-dialog__row">
271
- <label>
272
- <input
273
- type="checkbox"
274
- class="textae-editor__setting-dialog__lock-config-text"
275
- ${o?'checked="checked"':""}>
276
- Lock Edit Config
277
- </label>
278
- </div>
279
- <div class="textae-editor__setting-dialog__row">
280
- <label>Version ${c}</label>
281
- </div>
282
- </div>
283
- `}var on=i(3282),rn=i.n(on),an=i(8182),ln=i.n(an);const cn=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"JSON schema for texta configuration files","definitions":{"characters":{"type":"array","items":{"type":"string","minLength":1,"maxLength":1}},"color":{"pattern":"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$","type":"string"},"default":{"type":"boolean"},"denote":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"label":{"type":"string"},"color":{"$ref":"#/definitions/color"},"default":{"$ref":"#/definitions/default"}}},"types":{"type":"array","items":{"$ref":"#/definitions/denote"}},"autocompletion_ws":{"type":"string","format":"uri-reference"}},"type":"object","properties":{"delimiter characters":{"$ref":"#/definitions/characters"},"non-edge characters":{"$ref":"#/definitions/characters"},"autocompletion_ws":{"$ref":"#/definitions/autocompletion_ws"},"autosave":{"type":"boolean"},"autolineheight":{"type":"boolean"},"boundarydetection":{"type":"boolean"},"entity types":{"$ref":"#/definitions/types"},"relation types":{"$ref":"#/definitions/types"},"attribute types":{"type":"array","items":{"type":"object","required":["pred","value type"],"properties":{"pred":{"type":"string"},"value type":{"enum":["flag","selection","string","numeric"]}},"allOf":[{"if":{"properties":{"value type":{"const":"flag"}}},"then":{"properties":{"color":{"$ref":"#/definitions/color"},"label":{"type":"string"}}}},{"if":{"properties":{"value type":{"const":"selection"}}},"then":{"required":["values"],"properties":{"values":{"type":"array","items":{"$ref":"#/definitions/denote"}}}}},{"if":{"properties":{"value type":{"const":"string"}}},"then":{"properties":{"autocompletion_ws":{"$ref":"#/definitions/autocompletion_ws"},"default":{"type":"string"},"values":{"type":"array","items":{"type":"object","required":["pattern"],"properties":{"pattern":{"type":"string","format":"regex"},"label":{"type":"string"},"color":{"$ref":"#/definitions/color"}}}}}}},{"if":{"properties":{"value type":{"const":"numeric"}}},"then":{"required":["default","step"],"properties":{"default":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"step":{"type":"number"},"values":{"type":"array","items":{"type":"object","required":["range"],"properties":{"range":{"type":"string"},"label":{"type":"string"},"color":{"$ref":"#/definitions/color"}}}}}}}]}},"function availability":{"type":"object","properties":{"read":{"type":"boolean"},"write":{"type":"boolean"},"write-auto":{"type":"boolean"},"view":{"type":"boolean"},"term":{"type":"boolean"},"block":{"type":"boolean"},"relation":{"type":"boolean"},"simple":{"type":"boolean"},"line-height":{"type":"boolean"},"line-height-auto":{"type":"boolean"},"undo":{"type":"boolean"},"redo":{"type":"boolean"},"replicate":{"type":"boolean"},"replicate-auto":{"type":"boolean"},"boundary-detection":{"type":"boolean"},"create-span-by-touch":{"type":"boolean"},"expand-span-by-touch":{"type":"boolean"},"shrink-span-by-touch":{"type":"boolean"},"entity":{"type":"boolean"},"pallet":{"type":"boolean"},"edit-properties":{"type":"boolean"},"delete":{"type":"boolean"},"copy":{"type":"boolean"},"cut":{"type":"boolean"},"paste":{"type":"boolean"},"setting":{"type":"boolean"},"help":{"type":"boolean"}}}}}'),hn=new(rn())({verbose:!0});ln()(hn,["uri-reference","regex"]);const un=hn.compile(cn);function dn(t){un(t)||console.warn(un.errors)}function fn(t,i){const n=t.querySelector(`.textae-editor__setting-dialog__${i}-character-add-input`),s=n.value;if(!function(t,i){return i.includes(t)?(e().warning(`${t} is already added.`),!1):!(en.decode(t).length>1&&(e().warning("Only one character is allowed."),1))}(s,Array.from(t.querySelectorAll(`.textae-editor__setting-dialog__${i}-character`)).map(t=>t.textContent)))return;const o=rt`
284
- <tr class="textae-editor__setting-dialog__${i}-character-row">
285
- <td>
286
- <span class="textae-editor__setting-dialog__${i}-character">${s}</span>
287
- </td>
288
- <td><button class="textae-editor__setting-dialog__${i}-character-delete-button">&times;</button></td>
289
- </tr>`;t.querySelector(`.textae-editor__setting-dialog__${i}-character-add-row`).insertAdjacentHTML("afterend",o),n.value=""}class pn extends u{constructor(t,e,i,n,s,o){super("Setting",sn({typeGapDisabled:!i.show,typeGap:i.value,lineHeight:n.lineHeight,autocompletionWs:e.autocompletionWs,typeDictionaryLocked:e.isLock,delimiterCharacters:s.delimiterCharacters,blankCharacters:s.blankCharacters,functionAvailability:o,version:tn})),Ji(super.el,t,i,e,n,o),r()(super.el,".textae-editor__dialog","keyup",t=>{13===t.keyCode&&super.close()}),function(t){r()(t,".textae-editor__setting-dialog__delimiter-character-add-button","click",()=>fn(t,"delimiter")),r()(t,".textae-editor__setting-dialog__blank-character-add-button","click",()=>fn(t,"blank"))}(super.el),function(t){r()(t,".textae-editor__setting-dialog__delimiter-character-delete-button","click",({target:t})=>{t.closest(".textae-editor__setting-dialog__delimiter-character-row").remove()}),r()(t,".textae-editor__setting-dialog__blank-character-delete-button","click",({target:t})=>{t.closest(".textae-editor__setting-dialog__blank-character-row").remove()})}(super.el),h()(this.el).on("dialogclose",()=>{!function(t,e){const i=t.querySelector(".textae-editor__setting-dialog__autocompletion_ws-text").value;dn({autocompletion_ws:i}),e.autocompletionWs=i}(super.el,e),function(t,e){const i=t.querySelectorAll(".textae-editor__setting-dialog__delimiter-character"),n=Array.from(i).map(t=>en.decode(t.textContent)).reverse(),s=t.querySelectorAll(".textae-editor__setting-dialog__blank-character"),o=Array.from(s).map(t=>en.decode(t.textContent)).reverse(),r={"delimiter characters":Array.from(n),"non-edge characters":Array.from(o)};dn(r),e.set(r)}(super.el,s)})}}function mn(t,e){return t.isPushed("boundary detection")?t=>e.isDelimiter(t):()=>!0}function gn(t){for(const e of t.querySelectorAll("mark")){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e),t.normalize()}}class vn{#Q;#Nt;#ei;#Ie;#qt;#ii;#ni;#si;#oi;#ri;#ai;#li;#ci;constructor(t,e,i,n,s,o,r,a,l,c){e.on("textae-event.edit-mode.transition",()=>{i.entityInstanceContainer.declarifyLabelOfAll(),n.removeAll(),gn(t.querySelector(".textae-editor__text-box")),e.emit("textae-event.editor.selected-text.change")}),this.#Q=t,this.#Nt=e,this.#ei=s,this.#Ie=n,this.#qt=i,this.#ii=l,this.#ni=o,this.#si=r,this.#oi=a,this.#ri=new Yi(t,n),this.#ai=new Ui(t,n),this.#li=!1,this.#ci=c,ze(this,()=>this.#oi,["copyEntitiesToLocalClipboard","copyEntitiesToSystemClipboard","cutEntitiesToLocalClipboard","cutEntitiesToSystemClipboard","pasteEntitiesFromLocalClipboard","pasteEntitiesFromSystemClipboard"]),ze(this,()=>this.#ii,["toggleButton"])}removeSelectedElements(){const t=this.#ei.factory.removeSelectedCommand();this.#ri.right(null),this.#ei.invoke(t)}createEntity(){const t=this.#ei.factory.createDefaultTypeEntityToSelectedSpansCommand(this.#qt.typeDictionary.denotation.defaultType);t.isEmpty||this.#ei.invoke(t)}replicate(){const t=mn(this.#ii,this.#ni);this.#Ie.span.single?this.#ei.invoke(this.#ei.factory.replicateSpanCommand(this.#Ie.span.single,this.#Ie.span.single.entities.map(t=>t.typeValues),t)):e().warning("You can replicate span annotation when there is only span selected.")}cancelSelect(){this.#ci.hidePallet(),this.#Ie.removeAll(),this.#Q.focus()}showSettingDialog(){new pn(this.#Nt,this.#qt.typeDictionary,this.#qt.typeGap,this.#qt.textBox,this.#ni,this.#si).open()}get isActive(){return this.#li}activate(){this.#Q.classList.add("textae-editor--active"),this.#li=!0}deactivate(){this.#Q.classList.remove("textae-editor--active"),this.#Nt.emit("textae-event.editor.unselect"),this.#li=!1}selectLeft(t){this.#ci.isTypeValuesPalletShown?this.#ci.selectLeftAttributeTab():this.#ri.left(t)}selectRight(t){this.#ci.isTypeValuesPalletShown?this.#ci.selectRightAttributeTab():this.#ri.right(t)}selectUp(){this.#ci.isEditDenotation&&this.#ai.up()}selectDown(){this.#ci.isEditDenotation&&this.#ai.down()}applyTextSelectionWithTouchDevice(){this.#li&&this.#ci.applyTextSelectionWithTouchDevice()}}function yn(t,e){e?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")}function On(t){if("string"!=typeof t)return!1;try{JSON.parse(t)}catch(t){return!1}return!0}let bn=[],xn=[];function wn(t){if(t<768)return!1;for(let e=0,i=bn.length;;){let n=e+i>>1;if(t<bn[n])i=n;else{if(!(t>=xn[n]))return!0;e=n+1}if(e==i)return!1}}function _n(t){return t>=127462&&t<=127487}(()=>{let t="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(t=>t?parseInt(t,36):1);for(let e=0,i=0;e<t.length;e++)(e%2?xn:bn).push(i+=t[e])})();function Sn(t,e,i=!0,n=!0){return(i?kn:$n)(t,e,n)}function kn(t,e,i){if(e==t.length)return e;e&&Cn(t.charCodeAt(e))&&Pn(t.charCodeAt(e-1))&&e--;let n=Tn(t,e);for(e+=En(n);e<t.length;){let s=Tn(t,e);if(8205==n||8205==s||i&&wn(s))e+=En(s),n=s;else{if(!_n(s))break;{let i=0,n=e-2;for(;n>=0&&_n(Tn(t,n));)i++,n-=2;if(i%2==0)break;e+=2}}}return e}function $n(t,e,i){for(;e>0;){let n=kn(t,e-2,i);if(n<e)return n;e--}return 0}function Tn(t,e){let i=t.charCodeAt(e);if(!Pn(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return Cn(n)?n-56320+(i-55296<<10)+65536:i}function Cn(t){return t>=56320&&t<57344}function Pn(t){return t>=55296&&t<56320}function En(t){return t<65536?1:2}class An{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=zn(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Qn.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=zn(this,t,e);let i=[];return this.decompose(t,e,i,0),Qn.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new In(this),s=new In(t);for(let t=e,o=e;;){if(n.next(t),s.next(t),t=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(t=1){return new In(this,t)}iterRange(t,e=this.length){return new Ln(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new Nn(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new Mn(t):Qn.from(Mn.split(t,[])):An.empty}}class Mn extends An{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let s=0;;s++){let o=this.text[s],r=n+o.length;if((e?i:r)>=t)return new jn(n,r,i,o);n=r+1,i++}}decompose(t,e,i,n){let s=t<=0&&e>=this.length?this:new Mn(Rn(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=Dn(s.text,t.text.slice(),0,s.length);if(e.length<=32)i.push(new Mn(e,t.length+s.length));else{let t=e.length>>1;i.push(new Mn(e.slice(0,t)),new Mn(e.slice(t)))}}else i.push(s)}replace(t,e,i){if(!(i instanceof Mn))return super.replace(t,e,i);[t,e]=zn(this,t,e);let n=Dn(this.text,Dn(i.text,Rn(this.text,0,t)),e),s=this.length+i.length-(e-t);return n.length<=32?new Mn(n,s):Qn.from(Mn.split(n,[]),s)}sliceString(t,e=this.length,i="\n"){[t,e]=zn(this,t,e);let n="";for(let s=0,o=0;s<=e&&o<this.text.length;o++){let r=this.text[o],a=s+r.length;s>t&&o&&(n+=i),t<a&&e>s&&(n+=r.slice(Math.max(0,t-s),e-s)),s=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let s of t)i.push(s),n+=s.length+1,32==i.length&&(e.push(new Mn(i,n)),i=[],n=-1);return n>-1&&e.push(new Mn(i,n)),e}}class Qn extends An{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,n){for(let s=0;;s++){let o=this.children[s],r=n+o.length,a=i+o.lines-1;if((e?a:r)>=t)return o.lineInner(t,e,i,n);n=r+1,i=a+1}}decompose(t,e,i,n){for(let s=0,o=0;o<=e&&s<this.children.length;s++){let r=this.children[s],a=o+r.length;if(t<=a&&e>=o){let s=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!s?i.push(r):r.decompose(t-o,e-o,i,s)}o=a+1}}replace(t,e,i){if([t,e]=zn(this,t,e),i.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let o=this.children[n],r=s+o.length;if(t>=s&&e<=r){let a=o.replace(t-s,e-s,i),l=this.lines-o.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let s=this.children.slice();return s[n]=a,new Qn(s,this.length-(e-t)+i.length)}return super.replace(s,r,a)}s=r+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=zn(this,t,e);let n="";for(let s=0,o=0;s<this.children.length&&o<=e;s++){let r=this.children[s],a=o+r.length;o>t&&s&&(n+=i),t<a&&e>o&&(n+=r.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Qn))return 0;let i=0,[n,s,o,r]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,s+=e){if(n==o||s==r)return i;let a=this.children[n],l=t.children[s];if(a!=l)return i+a.scanIdentical(l,e);i+=a.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new Mn(i,e)}let n=Math.max(32,i>>5),s=n<<1,o=n>>1,r=[],a=0,l=-1,c=[];function h(t){let e;if(t.lines>s&&t instanceof Qn)for(let e of t.children)h(e);else t.lines>o&&(a>o||!a)?(u(),r.push(t)):t instanceof Mn&&a&&(e=c[c.length-1])instanceof Mn&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,c[c.length-1]=new Mn(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>n&&u(),a+=t.lines,l+=t.length+1,c.push(t))}function u(){0!=a&&(r.push(1==c.length?c[0]:Qn.from(c,l)),l=-1,a=c.length=0)}for(let e of t)h(e);return u(),1==r.length?r[0]:new Qn(r,e)}}function Dn(t,e,i=0,n=1e9){for(let s=0,o=0,r=!0;o<t.length&&s<=n;o++){let a=t[o],l=s+a.length;l>=i&&(l>n&&(a=a.slice(0,n-s)),s<i&&(a=a.slice(i-s)),r?(e[e.length-1]+=a,r=!1):e.push(a)),s=l+1}return e}function Rn(t,e,i){return Dn(t,[""],e,i)}An.empty=new Mn([""],0);class In{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof Mn?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],o=s>>1,r=n instanceof Mn?n.text.length:n.children.length;if(o==(e>0?r:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&s)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(n instanceof Mn){let s=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let s=n.children[o+(e<0?-1:0)];t>s.length?(t-=s.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(s),this.offsets.push(e>0?1:(s instanceof Mn?s.text.length:s.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Ln{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new In(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class Nn{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(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&&(An.prototype[Symbol.iterator]=function(){return this.iter()},In.prototype[Symbol.iterator]=Ln.prototype[Symbol.iterator]=Nn.prototype[Symbol.iterator]=function(){return this});class jn{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function zn(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function Bn(t,e,i=!0,n=!0){return Sn(t,e,i,n)}function Zn(t,e){let i=t.charCodeAt(e);if(!(n=i,n>=55296&&n<56320&&e+1!=t.length))return i;var n;let s=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344}(s)?s-56320+(i-55296<<10)+65536:i}function Wn(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function Fn(t){return t<65536?1:2}const Xn=/\r\n?|\n/;var qn=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(qn||(qn={}));class Hn{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,n=0;e<this.sections.length;){let s=this.sections[e++],o=this.sections[e++];o<0?(t(i,n,s),n+=s):n+=o,i+=s}}iterChangedRanges(t,e=!1){Gn(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];n<0?t.push(i,n):t.push(n,i)}return new Hn(t)}composeDesc(t){return this.empty?t:t.empty?this:Jn(this,t)}mapDesc(t,e=!1){return t.empty?this:Kn(this,t,e)}mapPos(t,e=-1,i=qn.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let r=this.sections[o++],a=this.sections[o++],l=n+r;if(a<0){if(l>t)return s+(t-n);s+=r}else{if(i!=qn.Simple&&l>=t&&(i==qn.TrackDel&&n<t&&l>t||i==qn.TrackBefore&&n<t||i==qn.TrackAfter&&l>t))return null;if(l>t||l==t&&e<0&&!r)return t==n||e<0?s:s+a;s+=a}n=l}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return s}touchesRange(t,e=t){for(let i=0,n=0;i<this.sections.length&&n<=e;){let s=n+this.sections[i++];if(this.sections[i++]>=0&&n<=e&&s>=t)return!(n<t&&s>e)||"cover";n=s}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];t+=(t?" ":"")+i+(n>=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hn(t)}static create(t){return new Hn(t)}}class Vn extends Hn{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Gn(this,(e,i,n,s,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return Kn(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,s=0;n<e.length;n+=2){let o=e[n],r=e[n+1];if(r>=0){e[n]=r,e[n+1]=o;let a=n>>1;for(;i.length<a;)i.push(An.empty);i.push(o?t.slice(s,s+o):An.empty)}s+=o}return new Vn(e,i)}compose(t){return this.empty?t:t.empty?this:Jn(this,t,!0)}map(t,e=!1){return t.empty?this:Kn(this,t,e,!0)}iterChanges(t,e=!1){Gn(this,t,e)}get desc(){return Hn.create(this.sections)}filter(t){let e=[],i=[],n=[],s=new ts(this);t:for(let o=0,r=0;;){let a=o==t.length?1e9:t[o++];for(;r<a||r==a&&0==s.len;){if(s.done)break t;let t=Math.min(s.len,a-r);Yn(n,t,-1);let o=-1==s.ins?-1:0==s.off?s.ins:0;Yn(e,t,o),o>0&&Un(i,e,s.text),s.forward(t),r+=t}let l=t[o++];for(;r<l;){if(s.done)break t;let t=Math.min(s.len,l-r);Yn(e,t,-1),Yn(n,t,-1==s.ins?-1:0==s.off?s.ins:0),s.forward(t),r+=t}}return{changes:new Vn(e,i),filtered:Hn.create(n)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],n=this.sections[e+1];n<0?t.push(i):0==n?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let n=[],s=[],o=0,r=null;function a(t=!1){if(!t&&!n.length)return;o<e&&Yn(n,e-o,-1);let i=new Vn(n,s);r=r?r.compose(i.map(r)):i,n=[],s=[],o=0}return function t(l){if(Array.isArray(l))for(let e of l)t(e);else if(l instanceof Vn){if(l.length!=e)throw new RangeError(`Mismatched change set length (got ${l.length}, expected ${e})`);a(),r=r?r.compose(l.map(r)):l}else{let{from:t,to:r=t,insert:c}=l;if(t>r||t<0||r>e)throw new RangeError(`Invalid change range ${t} to ${r} (in doc of length ${e})`);let h=c?"string"==typeof c?An.of(c.split(i||Xn)):c:An.empty,u=h.length;if(t==r&&0==u)return;t<o&&a(),t>o&&Yn(n,t-o,-1),Yn(n,r-t,u),Un(s,n,h),o=r}}(t),a(!r),r}static empty(t){return new Vn(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;n<t.length;n++){let s=t[n];if("number"==typeof s)e.push(s,-1);else{if(!Array.isArray(s)||"number"!=typeof s[0]||s.some((t,e)=>e&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==s.length)e.push(s[0],0);else{for(;i.length<n;)i.push(An.empty);i[n]=An.of(s.slice(1)),e.push(s[0],i[n].length)}}}return new Vn(e,i)}static createSet(t,e){return new Vn(t,e)}}function Yn(t,e,i,n=!1){if(0==e&&i<=0)return;let s=t.length-2;s>=0&&i<=0&&i==t[s+1]?t[s]+=e:s>=0&&0==e&&0==t[s]?t[s+1]+=i:n?(t[s]+=e,t[s+1]+=i):t.push(e,i)}function Un(t,e,i){if(0==i.length)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(An.empty);t.push(i)}}function Gn(t,e,i){let n=t.inserted;for(let s=0,o=0,r=0;r<t.sections.length;){let a=t.sections[r++],l=t.sections[r++];if(l<0)s+=a,o+=a;else{let c=s,h=o,u=An.empty;for(;c+=a,h+=l,l&&n&&(u=u.append(n[r-2>>1])),!(i||r==t.sections.length||t.sections[r+1]<0);)a=t.sections[r++],l=t.sections[r++];e(s,c,o,h,u),s=c,o=h}}}function Kn(t,e,i,n=!1){let s=[],o=n?[]:null,r=new ts(t),a=new ts(e);for(let t=-1;;){if(r.done&&a.len||a.done&&r.len)throw new Error("Mismatched change set lengths");if(-1==r.ins&&-1==a.ins){let t=Math.min(r.len,a.len);Yn(s,t,-1),r.forward(t),a.forward(t)}else if(a.ins>=0&&(r.ins<0||t==r.i||0==r.off&&(a.len<r.len||a.len==r.len&&!i))){let e=a.len;for(Yn(s,a.ins,-1);e;){let i=Math.min(r.len,e);r.ins>=0&&t<r.i&&r.len<=i&&(Yn(s,0,r.ins),o&&Un(o,s,r.text),t=r.i),r.forward(i),e-=i}a.next()}else{if(!(r.ins>=0)){if(r.done&&a.done)return o?Vn.createSet(s,o):Hn.create(s);throw new Error("Mismatched change set lengths")}{let e=0,i=r.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.len<i))break;i-=a.len,a.next()}Yn(s,e,t<r.i?r.ins:0),o&&t<r.i&&Un(o,s,r.text),t=r.i,r.forward(r.len-i)}}}}function Jn(t,e,i=!1){let n=[],s=i?[]:null,o=new ts(t),r=new ts(e);for(let t=!1;;){if(o.done&&r.done)return s?Vn.createSet(n,s):Hn.create(n);if(0==o.ins)Yn(n,o.len,0,t),o.next();else if(0!=r.len||r.done){if(o.done||r.done)throw new Error("Mismatched change set lengths");{let e=Math.min(o.len2,r.len),i=n.length;if(-1==o.ins){let i=-1==r.ins?-1:r.off?0:r.ins;Yn(n,e,i,t),s&&i&&Un(s,n,r.text)}else-1==r.ins?(Yn(n,o.off?0:o.len,e,t),s&&Un(s,n,o.textBit(e))):(Yn(n,o.off?0:o.len,r.off?0:r.ins,t),s&&!r.off&&Un(s,n,r.text));t=(o.ins>e||r.ins>=0&&r.len>e)&&(t||n.length>i),o.forward2(e),r.forward(e)}}else Yn(n,0,r.ins,t),s&&Un(s,n,r.text),r.next()}}class ts{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[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:t}=this.set,e=this.i-2>>1;return e>=t.length?An.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?An.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class es{constructor(t,e,i){this.from=t,this.to=e,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 t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new es(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return is.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return is.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return is.range(t.anchor,t.head)}static create(t,e,i){return new es(t,e,i)}}class is{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:is.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new is([this.main],0)}addRange(t,e=!0){return is.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,is.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new is(t.ranges.map(t=>es.fromJSON(t)),t.main)}static single(t,e=t){return new is([is.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<t.length;n++){let s=t[n];if(s.empty?s.from<=i:s.from<i)return is.normalized(t.slice(),e);i=s.to}return new is(t,e)}static cursor(t,e=0,i,n){return es.create(t,t,(0==e?0:e<0?8:16)|(null==i?7:Math.min(6,i))|(null!=n?n:16777215)<<6)}static range(t,e,i,n){let s=(null!=i?i:16777215)<<6|(null==n?7:Math.min(6,n));return e<t?es.create(e,t,48|s):es.create(t,e,(e>t?8:0)|s)}static normalized(t,e=0){let i=t[e];t.sort((t,e)=>t.from-e.from),e=t.indexOf(i);for(let i=1;i<t.length;i++){let n=t[i],s=t[i-1];if(n.empty?n.from<=s.to:n.from<s.to){let o=s.from,r=Math.max(n.to,s.to);i<=e&&e--,t.splice(--i,2,n.anchor>n.head?is.range(r,o):is.range(o,r))}}return new is(t,e)}}function ns(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let ss=0;class os{constructor(t,e,i,n,s){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=ss++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}get reader(){return this}static define(t={}){return new os(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:rs),!!t.static,t.enables)}of(t){return new as([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new as(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new as(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],i=>e(i.field(t)))}}function rs(t,e){return t==e||t.length==e.length&&t.every((t,i)=>t===e[i])}class as{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=ss++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,s=this.id,o=t[s]>>1,r=2==this.type,a=!1,l=!1,c=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||c.push(t[i.id]);return{create:t=>(t.values[o]=i(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||cs(t,c)){let e=i(t);if(r?!ls(e,t.values[o],n):!n(e,t.values[o]))return t.values[o]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[s];if(null!=l){let s=Ss(e,l);if(this.dependencies.every(i=>i instanceof os?e.facet(i)===t.facet(i):!(i instanceof ds)||e.field(i,!1)==t.field(i,!1))||(r?ls(a=i(t),s,n):n(a=i(t),s)))return t.values[o]=s,0}else a=i(t);return t.values[o]=a,1}}}}function ls(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function cs(t,e){let i=!1;for(let n of e)1&_s(t,n)&&(i=!0);return i}function hs(t,e,i){let n=i.map(e=>t[e.id]),s=i.map(t=>t.type),o=n.filter(t=>!(1&t)),r=t[e.id]>>1;function a(t){let i=[];for(let e=0;e<n.length;e++){let o=Ss(t,n[e]);if(2==s[e])for(let t of o)i.push(t);else i.push(o)}return e.combine(i)}return{create(t){for(let e of n)_s(t,e);return t.values[r]=a(t),1},update(t,i){if(!cs(t,o))return 0;let n=a(t);return e.compare(n,t.values[r])?0:(t.values[r]=n,1)},reconfigure(t,s){let o=cs(t,n),l=s.config.facets[e.id],c=s.facet(e);if(l&&!o&&rs(i,l))return t.values[r]=c,0;let h=a(t);return e.compare(h,c)?(t.values[r]=c,0):(t.values[r]=h,1)}}}const us=os.define({static:!0});class ds{constructor(t,e,i,n,s){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=s,this.provides=void 0}static define(t){let e=new ds(ss++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(us).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let n=t.values[e],s=this.updateF(n,i);return this.compareF(n,s)?0:(t.values[e]=s,1)},reconfigure:(t,i)=>{let n,s=t.facet(us),o=i.facet(us);return(n=s.find(t=>t.field==this))&&n!=o.find(t=>t.field==this)?(t.values[e]=n.create(t),1):null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}}init(t){return[this,us.of({field:this,create:t})]}get extension(){return this}}const fs=4,ps=3,ms=2,gs=1;function vs(t){return e=>new Os(e,t)}const ys={highest:vs(0),high:vs(gs),default:vs(ms),low:vs(ps),lowest:vs(fs)};class Os{constructor(t,e){this.inner=t,this.prec=e}}class bs{of(t){return new xs(this,t)}reconfigure(t){return bs.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class xs{constructor(t,e){this.compartment=t,this.inner=e}}class ws{constructor(t,e,i,n,s,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return null==e?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let n=[],s=Object.create(null),o=new Map;for(let i of function(t,e,i){let n=[[],[],[],[],[]],s=new Map;function o(t,r){let a=s.get(t);if(null!=a){if(a<=r)return;let e=n[a].indexOf(t);e>-1&&n[a].splice(e,1),t instanceof xs&&i.delete(t.compartment)}if(s.set(t,r),Array.isArray(t))for(let e of t)o(e,r);else if(t instanceof xs){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=e.get(t.compartment)||t.inner;i.set(t.compartment,n),o(n,r)}else if(t instanceof Os)o(t.inner,t.prec);else if(t instanceof ds)n[r].push(t),t.provides&&o(t.provides,r);else if(t instanceof as)n[r].push(t),t.facet.extensions&&o(t.facet.extensions,ms);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(e,r)}}return o(t,ms),n.reduce((t,e)=>t.concat(e))}(t,e,o))i instanceof ds?n.push(i):(s[i.facet.id]||(s[i.facet.id]=[])).push(i);let r=Object.create(null),a=[],l=[];for(let t of n)r[t.id]=l.length<<1,l.push(e=>t.slot(e));let c=null==i?void 0:i.config.facets;for(let t in s){let e=s[t],n=e[0].facet,o=c&&c[t]||[];if(e.every(t=>0==t.type))if(r[n.id]=a.length<<1|1,rs(o,e))a.push(i.facet(n));else{let t=n.combine(e.map(t=>t.value));a.push(i&&n.compare(t,i.facet(n))?i.facet(n):t)}else{for(let t of e)0==t.type?(r[t.id]=a.length<<1|1,a.push(t.value)):(r[t.id]=l.length<<1,l.push(e=>t.dynamicSlot(e)));r[n.id]=l.length<<1,l.push(t=>hs(t,n,e))}}let h=l.map(t=>t(r));return new ws(t,o,h,r,a,s)}}function _s(t,e){if(1&e)return 2;let i=e>>1,n=t.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;t.status[i]=4;let s=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|s}function Ss(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const ks=os.define(),$s=os.define({combine:t=>t.some(t=>t),static:!0}),Ts=os.define({combine:t=>t.length?t[0]:void 0,static:!0}),Cs=os.define(),Ps=os.define(),Es=os.define(),As=os.define({combine:t=>!!t.length&&t[0]});class Ms{constructor(t,e){this.type=t,this.value=e}static define(){return new Qs}}class Qs{of(t){return new Ms(this,t)}}class Ds{constructor(t){this.map=t}of(t){return new Rs(this,t)}}class Rs{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new Rs(this.type,e)}is(t){return this.type==t}static define(t={}){return new Ds(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let t=n.map(e);t&&i.push(t)}return i}}Rs.reconfigure=Rs.define(),Rs.appendConfig=Rs.define();class Is{constructor(t,e,i,n,s,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ns(i,e.newLength),s.some(t=>t.type==Is.time)||(this.annotations=s.concat(Is.time.of(Date.now())))}static create(t,e,i,n,s,o){return new Is(t,e,i,n,s,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(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(Is.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function Ls(t,e){let i=[];for(let n=0,s=0;;){let o,r;if(n<t.length&&(s==e.length||e[s]>=t[n]))o=t[n++],r=t[n++];else{if(!(s<e.length))return i;o=e[s++],r=e[s++]}!i.length||i[i.length-1]<o?i.push(o,r):i[i.length-1]<r&&(i[i.length-1]=r)}}function Ns(t,e,i){var n;let s,o,r;return i?(s=e.changes,o=Vn.empty(e.changes.length),r=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),r=t.changes.compose(s)),{changes:r,selection:e.selection?e.selection.map(o):null===(n=t.selection)||void 0===n?void 0:n.map(s),effects:Rs.mapEffects(t.effects,s).concat(Rs.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function js(t,e,i){let n=e.selection,s=Zs(e.annotations);return e.userEvent&&(s=s.concat(Is.userEvent.of(e.userEvent))),{changes:e.changes instanceof Vn?e.changes:Vn.of(e.changes||[],i,t.facet(Ts)),selection:n&&(n instanceof is?n:is.single(n.anchor,n.head)),effects:Zs(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function zs(t,e,i){let n=js(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(i=!1);for(let s=1;s<e.length;s++){!1===e[s].filter&&(i=!1);let o=!!e[s].sequential;n=Ns(n,js(t,e[s],o?n.changes.newLength:t.doc.length),o)}let s=Is.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(t){let e=t.startState,i=e.facet(Es),n=t;for(let s=i.length-1;s>=0;s--){let o=i[s](t);o&&Object.keys(o).length&&(n=Ns(n,js(e,o,t.changes.newLength),!0))}return n==t?t:Is.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let n of e.facet(Cs)){let e=n(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:Ls(i,e))}if(!0!==i){let n,s;if(!1===i)s=t.changes.invertedDesc,n=Vn.empty(e.doc.length);else{let e=t.changes.filter(i);n=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=Is.create(e,n,t.selection&&t.selection.map(s),Rs.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(Ps);for(let i=n.length-1;i>=0;i--){let s=n[i](t);t=s instanceof Is?s:Array.isArray(s)&&1==s.length&&s[0]instanceof Is?s[0]:zs(e,Zs(s),!1)}return t}(s):s)}Is.time=Ms.define(),Is.userEvent=Ms.define(),Is.addToHistory=Ms.define(),Is.remote=Ms.define();const Bs=[];function Zs(t){return null==t?Bs:Array.isArray(t)?t:[t]}var Ws=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Ws||(Ws={}));const Fs=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Xs;try{Xs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function qs(t){return e=>{if(!/\S/.test(e))return Ws.Space;if(function(t){if(Xs)return Xs.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>"€"&&(i.toUpperCase()!=i.toLowerCase()||Fs.test(i)))return!0}return!1}(e))return Ws.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return Ws.Word;return Ws.Other}}class Hs{constructor(t,e,i,n,s,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let t=0;t<this.config.dynamicSlots.length;t++)_s(this,t<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(null!=i)return _s(this,i),Ss(this,i);if(e)throw new RangeError("Field is not present in this state")}update(...t){return zs(this,t,!0)}applyTransaction(t){let e,i=this.config,{base:n,compartments:s}=i;for(let e of t.effects)e.is(bs.reconfigure)?(i&&(s=new Map,i.compartments.forEach((t,e)=>s.set(e,t)),i=null),s.set(e.value.compartment,e.value.extension)):e.is(Rs.reconfigure)?(i=null,n=e.value):e.is(Rs.appendConfig)&&(i=null,n=Zs(n).concat(e.value));if(i)e=t.startState.values.slice();else{i=ws.resolve(n,s,this),e=new Hs(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values}let o=t.startState.facet($s)?t.newSelection:t.newSelection.asSingle();new Hs(i,t.newDoc,o,e,(e,i)=>i.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:is.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),s=[i.range],o=Zs(i.effects);for(let i=1;i<e.ranges.length;i++){let r=t(e.ranges[i]),a=this.changes(r.changes),l=a.map(n);for(let t=0;t<i;t++)s[t]=s[t].map(l);let c=n.mapDesc(a,!0);s.push(r.range.map(c)),n=n.compose(l),o=Rs.mapEffects(o,l).concat(Rs.mapEffects(Zs(r.effects),c))}return{changes:n,selection:is.create(s,e.mainIndex),effects:o}}changes(t=[]){return t instanceof Vn?t:Vn.of(t,this.doc.length,this.facet(Hs.lineSeparator))}toText(t){return An.of(t.split(this.facet(Hs.lineSeparator)||Xn))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return null==e?t.default:(_s(this,e),Ss(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let n=t[i];n instanceof ds&&null!=this.config.address[n.id]&&(e[i]=n.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i)for(let e in i)if(Object.prototype.hasOwnProperty.call(t,e)){let s=i[e],o=t[e];n.push(s.init(t=>s.spec.fromJSON(o,t)))}return Hs.create({doc:t.doc,selection:is.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=ws.resolve(t.extensions||[],new Map),i=t.doc instanceof An?t.doc:An.of((t.doc||"").split(e.staticFacet(Hs.lineSeparator)||Xn)),n=t.selection?t.selection instanceof is?t.selection:is.single(t.selection.anchor,t.selection.head):is.single(0);return ns(n,i.length),e.staticFacet($s)||(n=n.asSingle()),new Hs(e,i,n,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(Hs.tabSize)}get lineBreak(){return this.facet(Hs.lineSeparator)||"\n"}get readOnly(){return this.facet(As)}phrase(t,...e){for(let e of this.facet(Hs.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>e.length?t:e[n-1]})),t}languageDataAt(t,e,i=-1){let n=[];for(let s of this.facet(ks))for(let o of s(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&n.push(o[t]);return n}charCategorizer(t){return qs(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),s=this.charCategorizer(t),o=t-i,r=t-i;for(;o>0;){let t=Bn(e,o,!1);if(s(e.slice(t,o))!=Ws.Word)break;o=t}for(;r<n;){let t=Bn(e,r);if(s(e.slice(r,t))!=Ws.Word)break;r=t}return o==r?null:is.range(o+i,r+i)}}function Vs(t,e,i={}){let n={};for(let e of t)for(let t of Object.keys(e)){let s=e[t],o=n[t];if(void 0===o)n[t]=s;else if(o===s||void 0===s);else{if(!Object.hasOwnProperty.call(i,t))throw new Error("Config merge conflict for field "+t);n[t]=i[t](o,s)}}for(let t in e)void 0===n[t]&&(n[t]=e[t]);return n}Hs.allowMultipleSelections=$s,Hs.tabSize=os.define({combine:t=>t.length?t[0]:4}),Hs.lineSeparator=Ts,Hs.readOnly=As,Hs.phrases=os.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(i=>t[i]==e[i])}}),Hs.languageData=ks,Hs.changeFilter=Cs,Hs.transactionFilter=Ps,Hs.transactionExtender=Es,bs.reconfigure=Rs.define();class Ys{eq(t){return this==t}range(t,e=t){return Us.create(t,e,this)}}Ys.prototype.startSide=Ys.prototype.endSide=0,Ys.prototype.point=!1,Ys.prototype.mapMode=qn.TrackDel;class Us{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Us(t,e,i)}}function Gs(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Ks{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let s=i?this.to:this.from;for(let o=n,r=s.length;;){if(o==r)return o;let n=o+r>>1,a=s[n]-t||(i?this.value[n].endSide:this.value[n].startSide)-e;if(n==o)return a>=0?o:r;a>=0?r=n:o=n+1}}between(t,e,i,n){for(let s=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(!1===n(this.from[s]+t,this.to[s]+t,this.value[s]))return!1}map(t,e){let i=[],n=[],s=[],o=-1,r=-1;for(let a=0;a<this.value.length;a++){let l,c,h=this.value[a],u=this.from[a]+t,d=this.to[a]+t;if(u==d){let t=e.mapPos(u,h.startSide,h.mapMode);if(null==t)continue;if(l=c=t,h.startSide!=h.endSide&&(c=e.mapPos(u,h.endSide),c<l))continue}else if(l=e.mapPos(u,h.startSide),c=e.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&&(r=Math.max(r,c-l)),i.push(h),n.push(l-o),s.push(c-o))}return{mapped:i.length?new Ks(n,s,i,r):null,pos:o}}}class Js{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new Js(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:s=this.length}=t,o=t.filter;if(0==e.length&&!o)return this;if(i&&(e=e.slice().sort(Gs)),this.isEmpty)return e.length?Js.of(e):this;let r=new io(this,null,-1).goto(0),a=0,l=[],c=new to;for(;r.value||a<e.length;)if(a<e.length&&(r.from-e[a].from||r.startSide-e[a].value.startSide)>=0){let t=e[a++];c.addInner(t.from,t.to,t.value)||l.push(t)}else 1==r.rangeIndex&&r.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(r.chunkIndex)<e[a].from)&&(!o||n>this.chunkEnd(r.chunkIndex)||s<this.chunkPos[r.chunkIndex])&&c.addChunk(this.chunkPos[r.chunkIndex],this.chunk[r.chunkIndex])?r.nextChunk():((!o||n>r.to||s<r.from||o(r.from,r.to,r.value))&&(c.addInner(r.from,r.to,r.value)||l.push(Us.create(r.from,r.to,r.value))),r.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?Js.empty:this.nextLayer.update({add:l,filter:o,filterFrom:n,filterTo:s}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],i=[],n=-1;for(let s=0;s<this.chunk.length;s++){let o=this.chunkPos[s],r=this.chunk[s],a=t.touchesRange(o,o+r.length);if(!1===a)n=Math.max(n,r.maxPoint),e.push(r),i.push(t.mapPos(o));else if(!0===a){let{mapped:s,pos:a}=r.map(o,t);s&&(n=Math.max(n,s.maxPoint),e.push(s),i.push(a))}}let s=this.nextLayer.map(t);return 0==e.length?s:new Js(i,e,s||Js.empty,n)}between(t,e,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let s=this.chunkPos[n],o=this.chunk[n];if(e>=s&&t<=s+o.length&&!1===o.between(s,t-s,e-s,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return no.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return no.from(t).goto(e)}static compare(t,e,i,n,s=-1){let o=t.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s),r=e.filter(t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s),a=eo(o,r,i),l=new oo(o,a,s),c=new oo(r,a,s);i.iterGaps((t,e,i)=>ro(l,t,c,e,i,n)),i.empty&&0==i.length&&ro(l,0,c,0,0,n)}static eq(t,e,i=0,n){null==n&&(n=999999999);let s=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0),o=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let r=eo(s,o),a=new oo(s,r,0).goto(i),l=new oo(o,r,0).goto(i);for(;;){if(a.to!=l.to||!ao(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(t,e,i,n,s=-1){let o=new oo(t,null,s).goto(e),r=e,a=o.openStart;for(;;){let t=Math.min(o.to,i);if(o.point){let i=o.activeForPoint(o.to),s=o.pointFrom<e?i.length+1:o.point.startSide<0?i.length:Math.min(i.length,a);n.point(r,t,o.point,i,s,o.pointRank),a=Math.min(o.openEnd(t),i.length)}else t>r&&(n.span(r,t,o.active,a),a=o.openEnd(t));if(o.to>i)return a+(o.point&&o.to>i?1:0);r=o.to,o.next()}}static of(t,e=!1){let i=new to;for(let n of t instanceof Us?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(Gs(e,n)>0)return t.slice().sort(Gs);e=n}return t}(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return Js.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=Js.empty;n=n.nextLayer)e=new Js(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}Js.empty=new Js([],[],null,-1),Js.empty.nextLayer=Js.empty;class to{finishChunk(t){this.chunks.push(new Ks(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,t&&(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(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new to)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-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=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(Js.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=Js.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function eo(t,e,i){let n=new Map;for(let e of t)for(let t=0;t<e.chunk.length;t++)e.chunk[t].maxPoint<=0&&n.set(e.chunk[t],e.chunkPos[t]);let s=new Set;for(let t of e)for(let e=0;e<t.chunk.length;e++){let o=n.get(t.chunk[e]);null==o||(i?i.mapPos(o):o)!=t.chunkPos[e]||(null==i?void 0:i.touchesRange(o,o+t.chunk[e].length))||s.add(t.chunk[e])}return s}class io{constructor(t,e,i,n=0){this.layer=t,this.skip=e,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(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){let e=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(e)||this.layer.chunkEnd(this.chunkIndex)<t||e.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],i=t+e.from[this.rangeIndex];if(this.from=i,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(t){if(t==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=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class no{constructor(t){this.heap=t}static from(t,e=null,i=-1){let n=[];for(let s=0;s<t.length;s++)for(let o=t[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&n.push(new io(o,e,i,s));return 1==n.length?n[0]:new no(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)so(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)so(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),so(this.heap,0)}}}function so(t,e){for(let i=t[e];;){let n=1+(e<<1);if(n>=t.length)break;let s=t[n];if(n+1<t.length&&s.compare(t[n+1])>=0&&(s=t[n+1],n++),i.compare(s)<0)break;t[n]=i,t[e]=s,e=n}}class oo{constructor(t,e,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=no.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){lo(this.active,t),lo(this.activeTo,t),lo(this.activeRank,t),this.minActive=ho(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:s}=this.cursor;for(;e<this.activeRank.length&&(s-this.activeRank[e]||n-this.activeTo[e])>0;)e++;co(this.active,e,i),co(this.activeTo,e,n),co(this.activeRank,e,s),t&&co(t,e,this.cursor.from),this.minActive=ho(this.active,this.activeTo)}next(){let t=this.to,e=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]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&lo(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=t,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=t.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 e=i.length-1;e>=0&&i[e]<t;e--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function ro(t,e,i,n,s,o){t.goto(e),i.goto(n);let r=n+s,a=n,l=n-e;for(;;){let e=t.to+l-i.to,n=e||t.endSide-i.endSide,s=n<0?t.to+l:i.to,c=Math.min(s,r);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&ao(t.activeForPoint(t.to),i.activeForPoint(i.to))||o.comparePoint(a,c,t.point,i.point):c>a&&!ao(t.active,i.active)&&o.compareRange(a,c,t.active,i.active),s>r)break;(e||t.openEnd!=i.openEnd)&&o.boundChange&&o.boundChange(s),a=s,n<=0&&t.next(),n>=0&&i.next()}}function ao(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!t[i].eq(e[i]))return!1;return!0}function lo(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function co(t,e,i){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=i}function ho(t,e){let i=-1,n=1e9;for(let s=0;s<e.length;s++)(e[s]-n||t[s].endSide-t[i].endSide)<0&&(i=s,n=e[s]);return i}function uo(t,e,i=t.length){let n=0;for(let s=0;s<i&&s<t.length;)9==t.charCodeAt(s)?(n+=e-n%e,s++):(n++,s=Bn(t,s));return n}function fo(t,e,i,n){for(let n=0,s=0;;){if(s>=e)return n;if(n==t.length)break;s+=9==t.charCodeAt(n)?i-s%i:1,n=Bn(t,n)}return!0===n?-1:t.length}const po="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),mo="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),go="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class vo{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}function s(t,e,o,r){let a=[],l=/^@(\w+)\b/.exec(t[0]),c=l&&"keyframes"==l[1];if(l&&null==e)return o.push(t[0]+";");for(let i in e){let r=e[i];if(/&/.test(i))s(i.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),r,o);else if(r&&"object"==typeof r){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");s(n(i),r,a,c)}else null!=r&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+r+";")}(a.length||c)&&o.push((!i||l||r?t:t.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(n(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=go[po]||1;return go[po]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let n=t[mo],s=i&&i.nonce;n?s&&n.setNonce(s):n=new Oo(t,s),n.mount(Array.isArray(e)?e:[e],t)}}let yo=new Map;class Oo{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let e=yo.get(i);if(e)return t[mo]=e;this.sheet=new n.CSSStyleSheet,yo.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[mo]=this}mount(t,e){let i=this.sheet,n=0,s=0;for(let e=0;e<t.length;e++){let o=t[e],r=this.modules.indexOf(o);if(r<s&&r>-1&&(this.modules.splice(r,1),s--,r=-1),-1==r){if(this.modules.splice(s++,0,o),i)for(let t=0;t<o.rules.length;t++)i.insertRule(o.rules[t],n++)}else{for(;s<r;)n+=this.modules[s++].rules.length;n+=o.rules.length,s++}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let t="";for(let e=0;e<this.modules.length;e++)t+=this.modules[e].getRules()+"\n";this.styleTag.textContent=t;let i=e.head||e;this.styleTag.parentNode!=i&&i.insertBefore(this.styleTag,i.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}for(var bo={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:"'"},xo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),_o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),So=0;So<10;So++)bo[48+So]=bo[96+So]=String(So);for(So=1;So<=24;So++)bo[So+111]="F"+So;for(So=65;So<=90;So++)bo[So]=String.fromCharCode(So+32),xo[So]=String.fromCharCode(So);for(var ko in bo)xo.hasOwnProperty(ko)||(xo[ko]=bo[ko]);function $o(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function To(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function Co(t,e){if(!e.anchorNode)return!1;try{return To(t,e.anchorNode)}catch(t){return!1}}function Po(t){return 3==t.nodeType?Zo(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Eo(t,e,i,n){return!!i&&(Qo(t,e,i,n,-1)||Qo(t,e,i,n,1))}function Ao(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function Mo(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Qo(t,e,i,n,s){for(;;){if(t==i&&e==n)return!0;if(e==(s<0?0:Do(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=Ao(t)+(s<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(s<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=s<0?Do(t):0}}}function Do(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ro(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function Io(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function Lo(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class No{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?Do(e):0),i,Math.min(t.focusOffset,i?Do(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let jo,zo=null;function Bo(t){if(t.setActive)return t.setActive();if(zo)return t.focus(zo);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==zo?{get preventScroll(){return zo={preventScroll:!0},!0}}:void 0),!zo){zo=!1;for(let t=0;t<e.length;){let i=e[t++],n=e[t++],s=e[t++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=s&&(i.scrollLeft=s)}}}function Zo(t,e,i=e){let n=jo||(jo=document.createRange());return n.setEnd(t,i),n.setStart(t,e),n}function Wo(t,e,i,n){let s={key:e,code:e,keyCode:i,which:i,cancelable:!0};n&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=n);let o=new KeyboardEvent("keydown",s);o.synthetic=!0,t.dispatchEvent(o);let r=new KeyboardEvent("keyup",s);return r.synthetic=!0,t.dispatchEvent(r),o.defaultPrevented||r.defaultPrevented}function Fo(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function Xo(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function qo(t,e){for(let i=t,n=e;;){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=Do(i)}else{if(!i.parentNode||Mo(i))return null;n=Ao(i),i=i.parentNode}}}function Ho(t,e){for(let i=t,n=e;;){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||Mo(i))return null;n=Ao(i)+1,i=i.parentNode}}}class Vo{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new Vo(t.parentNode,Ao(t),e)}static after(t,e){return new Vo(t.parentNode,Ao(t)+1,e)}}const Yo=[];class Uo{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(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(2&this.flags){let i,n=this.dom,s=null;for(let o of this.children){if(7&o.flags){if(!o.dom&&(i=s?s.nextSibling:n.firstChild)){let t=Uo.get(i);(!t||!t.parent&&t.canReuseDOM(o))&&o.reuseDOM(i)}o.sync(t,e),o.flags&=-8}if(i=s?s.nextSibling:n.firstChild,e&&!e.written&&e.node==n&&i!=o.dom&&(e.written=!0),o.dom.parentNode==n)for(;i&&i!=o.dom;)i=Go(i);else n.insertBefore(o.dom,i);s=o.dom}for(i=s?s.nextSibling:n.firstChild,i&&e&&e.node==n&&(e.written=!0);i;)i=Go(i)}else if(1&this.flags)for(let i of this.children)7&i.flags&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let n=0==Do(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==this.dom)break;0==n&&e.firstChild!=e.lastChild&&(n=t==e.firstChild?-1:1),t=e}i=n<0?t:t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Uo.get(i);)i=i.nextSibling;if(!i)return this.length;for(let t=0,e=0;;t++){let n=this.children[t];if(n.dom==i)return e;e+=n.length+n.breakAfter}}domBoundsAround(t,e,i=0){let n=-1,s=-1,o=-1,r=-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<t&&h>e)return i.domBoundsAround(t,e,l);if(h>=t&&-1==n&&(n=a,s=l),l>e&&i.dom.parentNode==this.dom){o=a,r=c;break}c=h,l=h+i.breakAfter}return{from:s,to:r<0?i+this.length:r,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(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=Yo){this.markDirty();for(let n=t;n<e;n++){let t=this.children[n];t.parent==this&&i.indexOf(t)<0&&t.destroy()}i.length<250?this.children.splice(t,e-t,...i):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(let t=0;t<i.length;t++)i[t].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new Ko(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,i,n,s,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags))}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}function Go(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}Uo.prototype.breakAfter=0;class Ko{constructor(t,e,i){this.children=t,this.pos=e,this.i=i,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Jo(t,e,i,n,s,o,r,a,l){let{children:c}=t,h=c.length?c[e]:null,u=o.length?o[o.length-1]:null,d=u?u.breakAfter:r;if(!(e==n&&h&&!r&&!d&&o.length<2&&h.merge(i,s,o.length?u:null,0==i,a,l))){if(n<c.length){let t=c[n];t&&(s<t.length||t.breakAfter&&(null==u?void 0:u.breakAfter))?(e==n&&(t=t.split(s),s=0),!d&&u&&t.merge(0,s,u,!0,0,l)?o[o.length-1]=t:((s||t.children.length&&!t.children[0].length)&&t.merge(0,s,null,!1,0,l),o.push(t))):(null==t?void 0:t.breakAfter)&&(u?u.breakAfter=1:r=1),n++}for(h&&(h.breakAfter=r,i>0&&(!r&&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),e++));e<n&&o.length;)if(c[n-1].become(o[o.length-1]))n--,o.pop(),l=o.length?0:a;else{if(!c[e].become(o[0]))break;e++,o.shift(),a=o.length?0:l}!o.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,a,l)&&e--,(e<n||o.length)&&t.replaceChildren(e,n,o)}}function tr(t,e,i,n,s,o){let r=t.childCursor(),{i:a,off:l}=r.findPos(i,1),{i:c,off:h}=r.findPos(e,-1),u=e-i;for(let t of n)u+=t.length;t.length+=u,Jo(t,c,h,a,l,n,0,s,o)}let er="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},ir="undefined"!=typeof document?document:{documentElement:{style:{}}};const nr=/Edge\/(\d+)/.exec(er.userAgent),sr=/MSIE \d/.test(er.userAgent),or=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(er.userAgent),rr=!!(sr||or||nr),ar=!rr&&/gecko\/(\d+)/i.test(er.userAgent),lr=!rr&&/Chrome\/(\d+)/.exec(er.userAgent),cr="webkitFontSmoothing"in ir.documentElement.style,hr=!rr&&/Apple Computer/.test(er.vendor),ur=hr&&(/Mobile\/\w+/.test(er.userAgent)||er.maxTouchPoints>2);var dr={mac:ur||/Mac/.test(er.platform),windows:/Win/.test(er.platform),linux:/Linux|X11/.test(er.platform),ie:rr,ie_version:sr?ir.documentMode||6:or?+or[1]:nr?+nr[1]:0,gecko:ar,gecko_version:ar?+(/Firefox\/(\d+)/.exec(er.userAgent)||[0,0])[1]:0,chrome:!!lr,chrome_version:lr?+lr[1]:0,ios:ur,android:/Android\b/.test(er.userAgent),webkit:cr,safari:hr,webkit_version:cr?+(/\bAppleWebKit\/(\d+)/.exec(er.userAgent)||[0,0])[1]:0,tabSize:null!=ir.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class fr extends Uo{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof fr)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new fr(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new Vo(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,i){let n=t.nodeValue.length;e>n&&(e=n);let s=e,o=e,r=0;0==e&&i<0||e==n&&i>=0?dr.chrome||dr.gecko||(e?(s--,r=1):o<n&&(o++,r=-1)):i<0?s--:o<n&&o++;let a=Zo(t,s,o).getClientRects();if(!a.length)return null;let l=a[(r?r<0:i>=0)?0:a.length-1];dr.safari&&!r&&0==l.width&&(l=Array.prototype.find.call(a,t=>t.width)||l);return r?Ro(l,r<0):l||null}(this.dom,t,e)}}class pr extends Uo{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let t of e)t.setParent(this)}setAttrs(t){if(Fo(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,s,o){return(!i||!(!(i instanceof pr&&i.mark.eq(this.mark))||t&&s<=0||e<this.length&&o<=0))&&(tr(this,t,e,i?i.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(t){let e=[],i=0,n=-1,s=0;for(let o of this.children){let r=i+o.length;r>t&&e.push(i<t?o.split(t-i):o),n<0&&i>=t&&(n=s),i=r,s++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new pr(this.mark,e,o)}domAtPos(t){return vr(this,t)}coordsAt(t,e){return Or(this,t,e)}}class mr extends Uo{static create(t,e,i){return new mr(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=mr.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,s,o){return!(i&&(!(i instanceof mr&&this.widget.compare(i.widget))||t>0&&s<=0||e<this.length&&o<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0)}become(t){return t instanceof mr&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(0==this.length)return An.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,i=e&&e.state.doc,n=this.posAtStart;return i?i.slice(n,n+this.length):An.empty}domAtPos(t){return(this.length?0==t:this.side>0)?Vo.before(this.dom):Vo.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),s=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let e=o?n.length-1:0;s=n[e],!(t>0?0==e:e==n.length-1||s.top<s.bottom);e+=o?-1:1);return Ro(s,!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 gr extends Uo{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof gr&&t.side==this.side}split(){return new gr(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?Vo.before(this.dom):Vo.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return An.empty}get isHidden(){return!0}}function vr(t,e){let i=t.dom,{children:n}=t,s=0;for(let t=0;s<n.length;s++){let o=n[s],r=t+o.length;if(!(r==t&&o.getSide()<=0)){if(e>t&&e<r&&o.dom.parentNode==i)return o.domAtPos(e-t);if(e<=t)break;t=r}}for(let t=s;t>0;t--){let e=n[t-1];if(e.dom.parentNode==i)return e.domAtPos(e.length)}for(let t=s;t<n.length;t++){let e=n[t];if(e.dom.parentNode==i)return e.domAtPos(0)}return new Vo(i,0)}function yr(t,e,i){let n,{children:s}=t;i>0&&e instanceof pr&&s.length&&(n=s[s.length-1])instanceof pr&&n.mark.eq(e.mark)?yr(n,e.children[0],i-1):(s.push(e),e.setParent(t)),t.length+=e.length}function Or(t,e,i){let n=null,s=-1,o=null,r=-1;!function t(e,a){for(let l=0,c=0;l<e.children.length&&c<=a;l++){let h=e.children[l],u=c+h.length;u>=a&&(h.children.length?t(h,a-c):(!o||o.isHidden&&(i>0||br(o,h)))&&(u>a||c==u&&h.getSide()>0)?(o=h,r=a-c):(c<a||c==u&&h.getSide()<0&&!h.isHidden)&&(n=h,s=a-c)),c=u}}(t,e);let a=(i<0?n:o)||n||o;return a?a.coordsAt(Math.max(0,a==n?s:r),i):function(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=Po(e);return i[i.length-1]||null}(t)}function br(t,e){let i=t.coordsAt(0,1),n=e.coordsAt(0,1);return i&&n&&n.top<i.bottom}function xr(t,e){for(let i in t)"class"==i&&e.class?e.class+=" "+t.class:"style"==i&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}fr.prototype.children=mr.prototype.children=gr.prototype.children=Yo;const wr=Object.create(null);function _r(t,e,i){if(t==e)return!0;t||(t=wr),e||(e=wr);let n=Object.keys(t),s=Object.keys(e);if(n.length-(i&&n.indexOf(i)>-1?1:0)!=s.length-(i&&s.indexOf(i)>-1?1:0))return!1;for(let o of n)if(o!=i&&(-1==s.indexOf(o)||t[o]!==e[o]))return!1;return!0}function Sr(t,e,i){let n=!1;if(e)for(let s in e)i&&s in i||(n=!0,"style"==s?t.style.cssText="":t.removeAttribute(s));if(i)for(let s in i)e&&e[s]==i[s]||(n=!0,"style"==s?t.style.cssText=i[s]:t.setAttribute(s,i[s]));return n}function kr(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let n=t.attributes[i];e[n.name]=n.value}return e}class $r{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Tr=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(Tr||(Tr={}));class Cr extends Ys{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new Pr(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new Ar(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,n=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:s,end:o}=Mr(t,n);e=(s?n?-3e8:-1:5e8)-1,i=1+(o?n?2e8:1:-6e8)}return new Ar(t,e,i,n,t.widget||null,!0)}static line(t){return new Er(t)}static set(t,e=!1){return Js.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}Cr.none=Js.empty;class Pr extends Cr{constructor(t){let{start:e,end:i}=Mr(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Pr&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(i=t.attrs)||void 0===i?void 0:i.class))&&_r(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Pr.prototype.point=!1;class Er extends Cr{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Er&&this.spec.class==t.spec.class&&_r(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Er.prototype.mapMode=qn.TrackBefore,Er.prototype.point=!0;class Ar extends Cr{constructor(t,e,i,n,s,o){super(e,i,s,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?qn.TrackBefore:qn.TrackAfter:qn.TrackDel}get type(){return this.startSide!=this.endSide?Tr.WidgetRange:this.startSide<=0?Tr.WidgetBefore:Tr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Ar&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function Mr(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return null==i&&(i=t.inclusive),null==n&&(n=t.inclusive),{start:null!=i?i:e,end:null!=n?n:e}}function Qr(t,e,i,n=0){let s=i.length-1;s>=0&&i[s]+n>=t?i[s]=Math.max(i[s],e):i.push(t,e)}Ar.prototype.point=!0;class Dr extends Uo{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,s,o){if(i){if(!(i instanceof Dr))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),tr(this,t,e,i?i.children.slice():[],s,o),!0}split(t){let e=new Dr;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let t=i;t<this.children.length;t++)e.append(this.children[t],0);for(;i>0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){_r(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){yr(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=xr(e,this.attrs||{})),i&&(this.attrs=xr({class:i},this.attrs||{}))}domAtPos(t){return vr(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?4&this.flags&&(Fo(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&&(Sr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&Uo.get(n)instanceof pr;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=Uo.get(n))||void 0===i?void 0:i.isEditable)||dr.ios&&this.children.some(t=>t instanceof fr)))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let i of this.children){if(!(i instanceof fr)||/[^ -~]/.test(i.text))return null;let n=Po(i.dom);if(1!=n.length)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let i=Or(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=i.bottom-i.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight<e){let n=(e-t.textHeight)/2;return{top:i.top+n,bottom:i.bottom-n,left:i.left,right:i.left}}}return i}become(t){return t instanceof Dr&&0==this.children.length&&0==t.children.length&&_r(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let i=0,n=0;i<t.children.length;i++){let s=t.children[i],o=n+s.length;if(o>=e){if(s instanceof Dr)return s;if(o>e)break}n=o+s.breakAfter}return null}}class Rr extends Uo{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,s,o){return!(i&&(!(i instanceof Rr&&this.widget.compare(i.widget))||t>0&&s<=0||e<this.length&&o<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0)}domAtPos(t){return 0==t?Vo.before(this.dom):Vo.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let i=new Rr(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return Yo}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):An.empty}domBoundsAround(){return null}become(t){return t instanceof Rr&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0)}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof Ir?null:Ro(this.dom.getBoundingClientRect(),this.length?0==t:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:i}=this.deco;return e!=i&&(t<0?e<0:i>0)}}class Ir extends $r{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Lr{constructor(t,e,i,n){this.doc=t,this.pos=e,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=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Rr&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Dr),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Nr(new gr(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof Rr||this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:e,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,t--;continue}this.text=e,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t),s=Math.min(n,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(Nr(new fr(this.text.slice(this.textOff,this.textOff+s)),e),i),this.atCursorPos=!0,this.textOff+=s,t-=s,i=n<=s?0:e.length}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,s,o){if(this.disallowBlockEffectsFor[o]&&i instanceof Ar){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let r=e-t;if(i instanceof Ar)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Rr(i.widget||jr.block,r,i));else{let o=mr.create(i.widget||jr.inline,r,r?0:i.startSide),a=this.atCursorPos&&!o.isEditable&&s<=n.length&&(t<e||i.startSide>0),l=!o.isEditable&&(t<e||s>n.length||i.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||o.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(c.append(Nr(new gr(1),n),s),s=n.length+Math.max(0,s-n.length)),c.append(Nr(o,n),s),this.atCursorPos=l,this.pendingBuffer=l?t<e||s>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);r&&(this.textOff+r<=this.text.length?this.textOff+=r:(this.skip+=r-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=s)}static build(t,e,i,n,s){let o=new Lr(t,e,i,s);return o.openEnd=Js.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Nr(t,e){for(let i of e)t=new pr(i,[t],t.length);return t}class jr extends $r{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}jr.inline=new jr("span"),jr.block=new jr("div");var zr=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(zr||(zr={}));const Br=zr.LTR,Zr=zr.RTL;function Wr(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const Fr=Wr("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Xr=Wr("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),qr=Object.create(null),Hr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);qr[e]=i,qr[i]=-e}function Vr(t){return t<=247?Fr[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Xr[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Yr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ur{get dir(){return this.level%2?Zr:Br}constructor(t,e,i){this.from=t,this.to=e,this.level=i}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,i,n){let s=-1;for(let o=0;o<t.length;o++){let r=t[o];if(r.from<=e&&r.to>=e){if(r.level==i)return o;(s<0||(0!=n?n<0?r.from<e:r.to>e:t[s].level>r.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function Gr(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],s=e[i];if(n.from!=s.from||n.to!=s.to||n.direction!=s.direction||!Gr(n.inner,s.inner))return!1}return!0}const Kr=[];function Jr(t,e,i,n,s,o,r){let a=n%2?2:1;if(n%2==s%2)for(let l=e,c=0;l<i;){let e=!0,h=!1;if(c==o.length||l<o[c].from){let t=Kr[l];t!=a&&(e=!1,h=16==t)}let u=e||1!=a?null:[],d=e?n:n+1,f=l;t:for(;;)if(c<o.length&&f==o[c].from){if(h)break t;let p=o[c];if(!e)for(let t=p.to,e=c+1;;){if(t==i)break t;if(!(e<o.length&&o[e].from==t)){if(Kr[t]==a)break t;break}t=o[e++].to}if(c++,u)u.push(p);else{p.from>l&&r.push(new Ur(l,p.from,d)),ta(t,p.direction==Br!=!(d%2)?n+1:n,s,p.inner,p.from,p.to,r),l=p.to}f=p.to}else{if(f==i||(e?Kr[f]!=a:Kr[f]==a))break;f++}u?Jr(t,l,f,n+1,s,u,r):l<f&&r.push(new Ur(l,f,d)),l=f}else for(let l=i,c=o.length;l>e;){let i=!0,h=!1;if(!c||l>o[c-1].to){let t=Kr[l-1];t!=a&&(i=!1,h=16==t)}let u=i||1!=a?null:[],d=i?n:n+1,f=l;t:for(;;)if(c&&f==o[c-1].to){if(h)break t;let p=o[--c];if(!i)for(let t=p.from,i=c;;){if(t==e)break t;if(!i||o[i-1].to!=t){if(Kr[t-1]==a)break t;break}t=o[--i].from}if(u)u.push(p);else{p.to<l&&r.push(new Ur(p.to,l,d)),ta(t,p.direction==Br!=!(d%2)?n+1:n,s,p.inner,p.from,p.to,r),l=p.from}f=p.from}else{if(f==e||(i?Kr[f-1]!=a:Kr[f-1]==a))break;f--}u?Jr(t,f,l,n+1,s,u,r):f<l&&r.push(new Ur(f,l,d)),l=f}}function ta(t,e,i,n,s,o,r){let a=e%2?2:1;!function(t,e,i,n,s){for(let o=0;o<=n.length;o++){let r=o?n[o-1].to:e,a=o<n.length?n[o].from:i,l=o?256:s;for(let e=r,i=l,n=l;e<a;e++){let s=Vr(t.charCodeAt(e));512==s?s=i:8==s&&4==n&&(s=16),Kr[e]=4==s?2:s,7&s&&(n=s),i=s}for(let t=r,e=l,n=l;t<a;t++){let s=Kr[t];if(128==s)t<a-1&&e==Kr[t+1]&&24&e?s=Kr[t]=e:Kr[t]=256;else if(64==s){let s=t+1;for(;s<a&&64==Kr[s];)s++;let o=t&&8==e||s<i&&8==Kr[s]?1==n?1:8:256;for(let e=t;e<s;e++)Kr[e]=o;t=s-1}else 8==s&&1==n&&(Kr[t]=1);e=s,7&s&&(n=s)}}}(t,s,o,n,a),function(t,e,i,n,s){let o=1==s?2:1;for(let r=0,a=0,l=0;r<=n.length;r++){let c=r?n[r-1].to:e,h=r<n.length?n[r].from:i;for(let e,i,n,r=c;r<h;r++)if(i=qr[e=t.charCodeAt(r)])if(i<0){for(let t=a-3;t>=0;t-=3)if(Hr[t+1]==-i){let e=Hr[t+2],i=2&e?s:4&e?1&e?o:s:0;i&&(Kr[r]=Kr[Hr[t]]=i),a=t;break}}else{if(189==Hr.length)break;Hr[a++]=r,Hr[a++]=e,Hr[a++]=l}else if(2==(n=Kr[r])||1==n){let t=n==s;l=t?0:1;for(let e=a-3;e>=0;e-=3){let i=Hr[e+2];if(2&i)break;if(t)Hr[e+2]|=2;else{if(4&i)break;Hr[e+2]|=4}}}}}(t,s,o,n,a),function(t,e,i,n){for(let s=0,o=n;s<=i.length;s++){let r=s?i[s-1].to:t,a=s<i.length?i[s].from:e;for(let l=r;l<a;){let r=Kr[l];if(256==r){let r=l+1;for(;;)if(r==a){if(s==i.length)break;r=i[s++].to,a=s<i.length?i[s].from:e}else{if(256!=Kr[r])break;r++}let c=1==o,h=c==(1==(r<e?Kr[r]:n))?c?1:2:n;for(let e=r,n=s,o=n?i[n-1].to:t;e>l;)e==o&&(e=i[--n].from,o=n?i[n-1].to:t),Kr[--e]=h;l=r}else o=r,l++}}}(s,o,n,a),Jr(t,s,o,e,i,n,r)}function ea(t,e,i){if(!t)return[new Ur(0,0,e==Zr?1:0)];if(e==Br&&!i.length&&!Yr.test(t))return ia(t.length);if(i.length)for(;t.length>Kr.length;)Kr[Kr.length]=256;let n=[],s=e==Br?0:1;return ta(t,s,s,i,0,t.length,n),n}function ia(t){return[new Ur(0,t,0)]}let na="";function sa(t,e,i,n,s){var o;let r=n.head-t.from,a=Ur.find(e,r,null!==(o=n.bidiLevel)&&void 0!==o?o:-1,n.assoc),l=e[a],c=l.side(s,i);if(r==c){let t=a+=s?1:-1;if(t<0||t>=e.length)return null;l=e[a=t],r=l.side(!s,i),c=l.side(s,i)}let h=Bn(t.text,r,l.forward(s,i));(h<l.from||h>l.to)&&(h=c),na=t.text.slice(Math.min(r,h),Math.max(r,h));let u=a==(s?e.length-1:0)?null:e[a+(s?1:-1)];return u&&h==c&&u.level+(s?0:1)<l.level?is.cursor(u.side(!s,i)+t.from,u.forward(s,i)?1:-1,u.level):is.cursor(h+t.from,l.forward(s,i)?-1:1,l.level)}function oa(t,e,i){for(let n=e;n<i;n++){let e=Vr(t.charCodeAt(n));if(1==e)return Br;if(2==e||4==e)return Zr}return Br}const ra=os.define(),aa=os.define(),la=os.define(),ca=os.define(),ha=os.define(),ua=os.define(),da=os.define(),fa=os.define(),pa=os.define(),ma=os.define({combine:t=>t.some(t=>t)}),ga=os.define({combine:t=>t.some(t=>t)}),va=os.define();class ya{constructor(t,e="nearest",i="nearest",n=5,s=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=s,this.isSnapshot=o}map(t){return t.empty?this:new ya(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new ya(is.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Oa=Rs.define({map:(t,e)=>t.map(e)}),ba=Rs.define();function xa(t,e,i){let n=t.facet(ca);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const wa=os.define({combine:t=>!t.length||t[0]});let _a=0;const Sa=os.define({combine:t=>t.filter((e,i)=>{for(let n=0;n<i;n++)if(t[n].plugin==e.plugin)return!1;return!0})});class ka{constructor(t,e,i,n,s){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Sa.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(Sa.of({plugin:this,arg:t}))}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:s,decorations:o}=e||{};return new ka(_a++,t,i,n,t=>{let e=[];return o&&e.push(Pa.of(e=>{let i=e.plugin(t);return i?o(i):Cr.none})),s&&e.push(s(t)),e})}static fromClass(t,e){return ka.define((e,i)=>new t(e,i),e)}}class $a{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(xa(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(e){xa(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){xa(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ta=os.define(),Ca=os.define(),Pa=os.define(),Ea=os.define(),Aa=os.define(),Ma=os.define();function Qa(t,e){let i=t.state.facet(Ma);if(!i.length)return i;let n=i.map(e=>e instanceof Function?e(t):e),s=[];return Js.spans(n,e.from,e.to,{point(){},span(t,i,n,o){let r=t-e.from,a=i-e.from,l=s;for(let t=n.length-1;t>=0;t--,o--){let i,s=n[t].spec.bidiIsolate;if(null==s&&(s=oa(e.text,r,a)),o>0&&l.length&&(i=l[l.length-1]).to==r&&i.direction==s)i.to=a,l=i.inner;else{let t={from:r,to:a,direction:s,inner:[]};l.push(t),l=t.inner}}}}),s}const Da=os.define();function Ra(t){let e=0,i=0,n=0,s=0;for(let o of t.state.facet(Da)){let r=o(t);r&&(null!=r.left&&(e=Math.max(e,r.left)),null!=r.right&&(i=Math.max(i,r.right)),null!=r.top&&(n=Math.max(n,r.top)),null!=r.bottom&&(s=Math.max(s,r.bottom)))}return{left:e,right:i,top:n,bottom:s}}const Ia=os.define();class La{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new La(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),t.splice(e-1,1)}}return t.splice(e,0,i),t}static extendWithRanges(t,e){if(0==e.length)return t;let i=[];for(let n=0,s=0,o=0,r=0;;n++){let a=n==t.length?null:t[n],l=o-r,c=a?a.fromB:1e9;for(;s<e.length&&e[s]<c;){let t=e[s],n=e[s+1],o=Math.max(r,t),a=Math.min(c,n);if(o<=a&&new La(o+l,a+l,o,a).addToSet(i),n>c)break;s+=2}if(!a)return i;new La(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,r=a.toB}}}class Na{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=Vn.empty(this.startState.doc.length);for(let t of i)this.changes=this.changes.compose(t.changes);let n=[];this.changes.iterChangedRanges((t,e,i,s)=>n.push(new La(t,e,i,s))),this.changedRanges=n}static create(t,e,i){return new Na(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get viewportMoved(){return(8&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(18&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class ja extends Uo{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Cr.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(t.contentDOM),this.children=[new Dr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new La(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:t,toA:e})=>e<this.minWidthFrom||t>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?n=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges((t,n)=>{t<e.to&&n>e.from&&(i=!0)});return i}(t.changes,this.hasComposition)||t.selectionSet||(n=t.state.selection.main.head));let s=n>-1?function(t,e,i){let n=za(t,i);if(!n)return null;let{node:s,from:o,to:r}=n,a=s.nodeValue;if(/[\n\r]/.test(a))return null;if(t.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,c=new La(l.mapPos(o),l.mapPos(r),o,r),h=[];for(let e=s.parentNode;;e=e.parentNode){let i=Uo.get(e);if(i instanceof pr)h.push({node:e,deco:i.mark});else{if(i instanceof Dr||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:c,text:s,marks:h,line:e};if(e==t.contentDOM)return null;h.push({node:e,deco:new Pr({inclusive:!0,attributes:kr(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:n}=this.hasComposition;i=new La(e,n,t.changes.mapPos(e,-1),t.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(dr.ie||dr.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=function(t,e,i){let n=new Ba;return Js.compare(t,e,i,n),n.changes}(this.decorations,this.updateDeco(),t.changes);return i=La.extendWithRanges(i,o),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,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 t=dr.chrome||dr.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||n.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(t=>t.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let t of this.children)t instanceof Rr&&t.widget instanceof Ir&&s.push(t.dom);n.updateGaps(s)}updateChildren(t,e,i){let n=i?i.range.addToSet(t.slice()):t,s=this.childCursor(e);for(let t=n.length-1;;t--){let e=t>=0?n[t]:null;if(!e)break;let o,r,a,l,{fromA:c,toA:h,fromB:u,toB:d}=e;if(i&&i.range.fromB<d&&i.range.toB>u){let t=Lr.build(this.view.state.doc,u,i.range.fromB,this.decorations,this.dynamicDecorationMap),e=Lr.build(this.view.state.doc,i.range.toB,d,this.decorations,this.dynamicDecorationMap);r=t.breakAtStart,a=t.openStart,l=e.openEnd;let n=this.compositionView(i);e.breakAtStart?n.breakAfter=1:e.content.length&&n.merge(n.length,n.length,e.content[0],!1,e.openStart,0)&&(n.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&n.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),o=t.content.concat(n).concat(e.content)}else({content:o,breakAtStart:r,openStart:a,openEnd:l}=Lr.build(this.view.state.doc,u,d,this.decorations,this.dynamicDecorationMap));let{i:f,off:p}=s.findPos(h,1),{i:m,off:g}=s.findPos(c,-1);Jo(this,m,g,f,p,o,r,a,l)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)t.is(ba)&&(this.editContextFormatting=t.value)}compositionView(t){let e=new fr(t.text.nodeValue);e.flags|=8;for(let{deco:i}of t.marks)e=new pr(i,[e],e.length);let i=new Dr;return i.append(e,0),i}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some(t=>7&t.flags)?1:0),this.markedForComposition.add(e);let i=Uo.get(t);i&&i!=e&&(i.dom=null),e.setDOM(t)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let s=t.marks.length-1;s>=-1;s--)i=n.childPos(i.off,1),n=n.children[i.i],e(s>=0?t.marks[s].node:t.text,n)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,s=!n&&!(this.view.state.facet(wa)||this.dom.tabIndex>-1)&&Co(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||s))return;let o=this.forceSelection;this.forceSelection=!1;let r=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(r.anchor)),l=r.empty?a:this.moveToLine(this.domAtPos(r.head));if(dr.gecko&&r.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 t=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(t,a.node.childNodes[a.offset]||null)),a=l=new Vo(t,0),o=!0}var c;let h=this.view.observer.selectionRange;!o&&h.focusNode&&(Eo(a.node,a.offset,h.anchorNode,h.anchorOffset)&&Eo(l.node,l.offset,h.focusNode,h.focusOffset)||this.suppressWidgetCursorChange(h,r))||(this.view.observer.ignore(()=>{dr.android&&dr.chrome&&this.dom.contains(h.focusNode)&&function(t,e){for(let i=t;i&&i!=e;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 t=$o(this.view.root);if(t)if(r.empty){if(dr.gecko){let t=(e=a.node,n=a.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(n<e.childNodes.length&&"false"==e.childNodes[n].contentEditable?2:0));if(t&&3!=t){let e=(1==t?qo:Ho)(a.node,a.offset);e&&(a=new Vo(e.node,e.offset))}}t.collapse(a.node,a.offset),null!=r.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=r.bidiLevel)}else if(t.extend){t.collapse(a.node,a.offset);try{t.extend(l.node,l.offset)}catch(t){}}else{let e=document.createRange();r.anchor>r.head&&([a,l]=[l,a]),e.setEnd(l.node,l.offset),e.setStart(a.node,a.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new Vo(h.anchorNode,h.anchorOffset),this.impreciseHead=l.precise?null:new Vo(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Eo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=$o(t.root),{anchorNode:n,anchorOffset:s}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let o=Dr.find(this,e.head);if(!o)return;let r=o.posAtStart;if(e.head==r||e.head==r+o.length)return;let a=this.coordsAt(e.head,-1),l=this.coordsAt(e.head,1);if(!a||!l||a.bottom>l.top)return;let c=this.domAtPos(e.head+e.assoc);i.collapse(c.node,c.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let h=t.observer.selectionRange;t.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=e.from&&i.collapse(n,s)}moveToLine(t){let e,i=this.dom;if(t.node!=i)return t;for(let n=t.offset;!e&&n<i.childNodes.length;n++){let t=Uo.get(i.childNodes[n]);t instanceof Dr&&(e=t.domAtPos(0))}for(let n=t.offset-1;!e&&n>=0;n--){let t=Uo.get(i.childNodes[n]);t instanceof Dr&&(e=t.domAtPos(t.length))}return e?new Vo(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=Uo.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let t=this.children[e];if(i<t.length||t instanceof Dr)break;e++,i=0}return this.children[e].domAtPos(i)}coordsAt(t,e){let i=null,n=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let r=this.children[o],a=s-r.breakAfter,l=a-r.length;if(a<t)break;if(l<=t&&(l<t||r.covers(-1))&&(a>t||r.covers(1))&&(!i||r instanceof Dr&&!(i instanceof Dr&&e>=0)))i=r,n=l;else if(i&&l==t&&a==t&&r instanceof Rr&&Math.abs(e)<2){if(r.deco.startSide<0)break;o&&(i=null)}s=l}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Dr))return null;for(;n.children.length;){let{i:t,off:e}=n.childPos(i,1);for(;;t++){if(t==n.children.length)return null;if((n=n.children[t]).length)break}i=e}if(!(n instanceof fr))return null;let s=Bn(n.text,i);if(s==i)return null;let o=Zo(n.dom,i,s).getClientRects();for(let t=0;t<o.length;t++){let e=o[t];if(t==o.length-1||e.top<e.bottom&&e.left<e.right)return e}return null}measureVisibleLineHeights(t){let e=[],{from:i,to:n}=t,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,r=-1,a=this.view.textDirection==zr.LTR;for(let t=0,l=0;l<this.children.length;l++){let c=this.children[l],h=t+c.length;if(h>n)break;if(t>=i){let i=c.dom.getBoundingClientRect();if(e.push(i.height),o){let e=c.dom.lastChild,n=e?Po(e):[];if(n.length){let e=n[n.length-1],o=a?e.right-i.left:i.right-e.left;o>r&&(r=o,this.minWidth=s,this.minWidthFrom=t,this.minWidthTo=h)}}}t=h+c.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?zr.RTL:zr.LTR}measureTextSize(){for(let t of this.children)if(t instanceof Dr){let e=t.measureTextSize();if(e)return e}let t,e,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 s=Po(n.firstChild)[0];t=n.getBoundingClientRect().height,e=s?s.width/27:7,i=s?s.height:t,n.remove()}),{lineHeight:t,charWidth:e,textHeight:i}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new Ko(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let s=n==e.viewports.length?null:e.viewports[n],o=s?s.from-1:this.length;if(o>i){let n=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(Cr.replace({widget:new Ir(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Cr.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Pa).map(e=>(this.dynamicDecorationMap[t++]="function"==typeof e)?e(this.view):e),i=!1,n=this.view.state.facet(Ea).map((t,e)=>{let n="function"==typeof t;return n&&(i=!0),n?t(this.view):t});for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(Js.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let e=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=e.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin)}for(let e of this.view.state.facet(va))try{if(e(this.view,t.range,t))return!0}catch(t){xa(this.view.state,t,"scroll handler")}let e,{range:i}=t,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!n)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,e.left),top:Math.min(n.top,e.top),right:Math.max(n.right,e.right),bottom:Math.max(n.bottom,e.bottom)});let s=Ra(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:r,offsetHeight:a}=this.view.scrollDOM;!function(t,e,i,n,s,o,r,a){let l=t.ownerDocument,c=l.defaultView||window;for(let h=t,u=!1;h&&!u;)if(1==h.nodeType){let t,d=h==l.body,f=1,p=1;if(d)t=Io(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 e=h.getBoundingClientRect();({scaleX:f,scaleY:p}=Lo(h,e)),t={left:e.left,right:e.left+h.clientWidth*f,top:e.top,bottom:e.top+h.clientHeight*p}}let m=0,g=0;if("nearest"==s)e.top<t.top?(g=e.top-(t.top+r),i>0&&e.bottom>t.bottom+g&&(g=e.bottom-t.bottom+r)):e.bottom>t.bottom&&(g=e.bottom-t.bottom+r,i<0&&e.top-g<t.top&&(g=e.top-(t.top+r)));else{let n=e.bottom-e.top,o=t.bottom-t.top;g=("center"==s&&n<=o?e.top+n/2-o/2:"start"==s||"center"==s&&i<0?e.top-r:e.bottom-o+r)-t.top}if("nearest"==n?e.left<t.left?(m=e.left-(t.left+o),i>0&&e.right>t.right+m&&(m=e.right-t.right+o)):e.right>t.right&&(m=e.right-t.right+o,i<0&&e.left<t.left+m&&(m=e.left-(t.left+o))):m=("center"==n?e.left+(e.right-e.left)/2-(t.right-t.left)/2:"start"==n==a?e.left-o:e.right-(t.right-t.left)+o)-t.left,m||g)if(d)c.scrollBy(m,g);else{let t=0,i=0;if(g){let t=h.scrollTop;h.scrollTop+=g/p,i=(h.scrollTop-t)*p}if(m){let e=h.scrollLeft;h.scrollLeft+=m/f,t=(h.scrollLeft-e)*f}e={left:e.left-t,top:e.top-i,right:e.right-t,bottom:e.bottom-i},t&&Math.abs(t-m)<1&&(n="nearest"),i&&Math.abs(i-g)<1&&(s="nearest")}if(d)break;(e.top<t.top||e.bottom>t.bottom||e.left<t.left||e.right>t.right)&&(e={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)}),h=h.assignedSlot||h.parentNode}else{if(11!=h.nodeType)break;h=h.host}}(this.view.scrollDOM,o,i.head<i.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,r),-r),Math.max(Math.min(t.yMargin,a),-a),this.view.textDirection==zr.LTR)}}function za(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=qo(i.focusNode,i.focusOffset),s=Ho(i.focusNode,i.focusOffset),o=n||s;if(s&&n&&s.node!=n.node){let e=Uo.get(s.node);if(!e||e instanceof fr&&e.text!=s.node.nodeValue)o=s;else if(t.docView.lastCompositionAfterCursor){let t=Uo.get(n.node);!t||t instanceof fr&&t.text!=n.node.nodeValue||(o=s)}}if(t.docView.lastCompositionAfterCursor=o!=n,!o)return null;let r=e-o.offset;return{from:r,to:r+o.node.nodeValue.length,node:o.node}}let Ba=class{constructor(){this.changes=[]}compareRange(t,e){Qr(t,e,this.changes)}comparePoint(t,e){Qr(t,e,this.changes)}boundChange(t){Qr(t,t,this.changes)}};function Za(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function Wa(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Fa(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function Xa(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function qa(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Ha(t,e,i){let n,s,o,r,a,l,c,h,u=!1;for(let d=t.firstChild;d;d=d.nextSibling){let t=Po(d);for(let f=0;f<t.length;f++){let p=t[f];s&&Fa(s,p)&&(p=Xa(qa(p,s.bottom),s.top));let m=Za(e,p),g=Wa(i,p);if(0==m&&0==g)return 3==d.nodeType?Va(d,e,i):Ha(d,e,i);(!n||r>g||r==g&&o>m)&&(n=d,s=p,o=m,r=g,u=!m||(e<p.left?f>0:f<t.length-1)),0==m?i>p.bottom&&(!c||c.bottom<p.bottom)?(a=d,c=p):i<p.top&&(!h||h.top>p.top)&&(l=d,h=p):c&&Fa(c,p)?c=qa(c,p.bottom):h&&Fa(h,p)&&(h=Xa(h,p.top))}}if(c&&c.bottom>=i?(n=a,s=c):h&&h.top<=i&&(n=l,s=h),!n)return{node:t,offset:0};let d=Math.max(s.left,Math.min(s.right,e));return 3==n.nodeType?Va(n,d,i):u&&"false"!=n.contentEditable?Ha(n,d,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,n)+(e>=(s.left+s.right)/2?1:0)}}function Va(t,e,i){let n=t.nodeValue.length,s=-1,o=1e9,r=0;for(let a=0;a<n;a++){let n=Zo(t,a,a+1).getClientRects();for(let l=0;l<n.length;l++){let c=n[l];if(c.top==c.bottom)continue;r||(r=e-c.left);let h=(c.top>i?c.top-i:i-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&h<o){let i=e>=(c.left+c.right)/2,n=i;if(dr.chrome||dr.gecko){Zo(t,a).getBoundingClientRect().left==c.right&&(n=!i)}if(h<=0)return{node:t,offset:a+(n?1:0)};s=a+(n?1:0),o=h}}}return{node:t,offset:s>-1?s:r>0?t.nodeValue.length:0}}function Ya(t,e,i,n=-1){var s,o;let r,a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,{docHeight:c}=t.viewState,{x:h,y:u}=e,d=u-l;if(d<0)return 0;if(d>c)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,s=!1;r=t.elementAtHeight(d),r.type!=Tr.Text;)for(;d=n>0?r.bottom+e:r.top-e,!(d>=0&&d<=c);){if(s)return i?null:0;s=!0,n=-n}u=l+d;let f=r.from;if(f<t.viewport.from)return 0==t.viewport.from?0:i?null:Ua(t,a,r,h,u);if(f>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Ua(t,a,r,h,u);let p=t.dom.ownerDocument,m=t.root.elementFromPoint?t.root:p,g=m.elementFromPoint(h,u);g&&!t.contentDOM.contains(g)&&(g=null),g||(h=Math.max(a.left+1,Math.min(a.right-1,h)),g=m.elementFromPoint(h,u),g&&!t.contentDOM.contains(g)&&(g=null));let v,y=-1;if(g&&0!=(null===(s=t.docView.nearest(g))||void 0===s?void 0:s.isEditable)){if(p.caretPositionFromPoint){let t=p.caretPositionFromPoint(h,u);t&&({offsetNode:v,offset:y}=t)}else if(p.caretRangeFromPoint){let t=p.caretRangeFromPoint(h,u);t&&({startContainer:v,startOffset:y}=t)}v&&(!t.contentDOM.contains(v)||dr.safari&&function(t,e,i){return Ga(t,e,i)}(v,y,h)||dr.chrome&&function(t,e,i){if(0!=e)return Ga(t,e,i);for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let n=1==t.nodeType?t.getBoundingClientRect():Zo(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-n.left>5}(v,y,h))&&(v=void 0),v&&(y=Math.min(Do(v),y))}if(!v||!t.docView.dom.contains(v)){let e=Dr.find(t.docView,f);if(!e)return d>r.top+r.height/2?r.to:r.from;({node:v,offset:y}=Ha(e.dom,h,u))}let O=t.docView.nearest(v);if(!O)return null;if(O.isWidget&&1==(null===(o=O.dom)||void 0===o?void 0:o.nodeType)){let t=O.dom.getBoundingClientRect();return e.y<t.top||e.y<=t.bottom&&e.x<=(t.left+t.right)/2?O.posAtStart:O.posAtEnd}return O.localPosFromDOM(v,y)+O.posAtStart}function Ua(t,e,i,n,s){let o=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;o+=Math.floor((s-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let r=t.state.sliceDoc(i.from,i.to);return i.from+fo(r,o,t.state.tabSize)}function Ga(t,e,i){let n,s=t;if(3!=t.nodeType||e!=(n=t.nodeValue.length))return!1;for(;;){let t=s.nextSibling;if(t){if("BR"==t.nodeName)break;return!1}{let t=s.parentNode;if(!t||"DIV"==t.nodeName)break;s=t}}return Zo(t,n-1,n).getBoundingClientRect().right>i}function Ka(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let t;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;t&&(s.type!=Tr.Text||t.type==s.type&&!(i<0?s.from<e:s.to>e))||(t=s)}}return t||n}return n}function Ja(t,e,i,n){let s=t.state.doc.lineAt(e.head),o=t.bidiSpans(s),r=t.textDirectionAt(s.from);for(let a=e,l=null;;){let e=sa(s,o,r,a,i),c=na;if(!e){if(s.number==(i?t.state.doc.lines:1))return a;c="\n",s=t.state.doc.line(s.number+(i?1:-1)),o=t.bidiSpans(s),e=t.visualLineSide(s,!i)}if(l){if(!l(c))return a}else{if(!n)return e;l=n(c)}a=e}}function tl(t,e,i){for(;;){let n=0;for(let s of t)s.between(e-1,e+1,(t,s,o)=>{if(e>t&&e<s){let o=n||i||(e-t<s-e?-1:1);e=o<0?t:s,n=o}});if(!n)return e}}function el(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let s=e.ranges[n],o=null;if(s.empty){let e=tl(t,s.from,0);e!=s.from&&(o=is.cursor(e,-1))}else{let e=tl(t,s.from,-1),i=tl(t,s.to,1);e==s.from&&i==s.to||(o=is.range(s.from==s.anchor?e:i,s.from==s.head?e:i))}o&&(i||(i=e.ranges.slice()),i[n]=o)}return i?is.create(i,e.mainIndex):e}function il(t,e,i){let n=tl(t.state.facet(Aa).map(e=>e(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:is.cursor(n,n<i.from?1:-1)}const nl="￿";class sl{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(Hs.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=nl}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let t=this.text.length;this.readNode(n);let s=n.nextSibling;if(s==e)break;let o=Uo.get(n),r=Uo.get(s);(o&&r?o.breakAfter:(o?o.breakAfter:Mo(n))||Mo(s)&&("BR"!=n.nodeName||n.cmIgnore)&&this.text.length>t)&&this.lineBreak(),n=s}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s,o=-1,r=1;if(this.lineSeparator?(o=e.indexOf(this.lineSeparator,i),r=this.lineSeparator.length):(s=n.exec(e))&&(o=s.index,r=s[0].length),this.append(e.slice(i,o<0?e.length:o)),o<0)break;if(this.lineBreak(),r>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=r-1);i=o+r}}readNode(t){if(t.cmIgnore)return;let e=Uo.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(ol(t,i.node,i.offset)?e:0))}}function ol(t,e,i){for(;;){if(!e||i<Do(e))return!1;if(e==t)return!0;i=Ao(e)+1,e=e.parentNode}}class rl{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class al{constructor(t,e,i,n){this.typeOver=n,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:s,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let e=s||o?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:o}=t.observer.selectionRange;i&&(e.push(new rl(i,n)),s==i&&o==n||e.push(new rl(s,o)));return e}(t),i=new sl(e,t.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,n=2==t.length?t[1].pos:i;return i>-1&&n>-1?is.single(i+e,n+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=s&&s.node==e.focusNode&&s.offset==e.focusOffset||!To(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),n=o&&o.node==e.anchorNode&&o.offset==e.anchorOffset||!To(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),r=t.viewport;if((dr.ios||dr.chrome)&&t.state.selection.main.empty&&i!=n&&(r.from>0||r.to<t.state.doc.length)){let e=Math.min(i,n),s=Math.max(i,n),o=r.from-e,a=r.to-s;0!=o&&1!=o&&0!=e||0!=a&&-1!=a&&s!=t.state.doc.length||(i=0,n=t.state.doc.length)}this.newSel=is.single(n,i)}}}function ll(t,e){let i,{newSel:n}=e,s=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:n,to:r}=e.bounds,a=s.from,l=null;(8===o||dr.android&&e.text.length<r-n)&&(a=s.to,l="end");let c=function(t,e,i,n){let s=Math.min(t.length,e.length),o=0;for(;o<s&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==s&&t.length==e.length)return null;let r=t.length,a=e.length;for(;r>0&&a>0&&t.charCodeAt(r-1)==e.charCodeAt(a-1);)r--,a--;if("end"==n){i-=r+Math.max(0,o-Math.min(r,a))-o}if(r<o&&t.length<e.length){o-=i<=o&&i>=r?o-i:0,a=o+(a-r),r=o}else if(a<o){o-=i<=o&&i>=a?o-i:0,r=o+(r-a),a=o}return{from:o,toA:r,toB:a}}(t.state.doc.sliceString(n,r,nl),e.text,a-n,l);c&&(dr.chrome&&13==o&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==nl+nl&&c.toB--,i={from:n+c.from,to:n+c.toA,insert:An.of(e.text.slice(c.from,c.toB).split(nl))})}else n&&(!t.hasFocus&&t.state.facet(wa)||n.main.eq(s))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!s.empty&&n&&n.main.empty?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(dr.mac||dr.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=is.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:An.of([i.insert.toString().replace("."," ")])}):i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,s.to))}:dr.chrome&&i&&i.from==i.to&&i.from==s.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(n&&(n=is.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:An.of([" "])}),i)return cl(t,i,n,o);if(n&&!n.main.eq(s)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin,"select.pointer"==i&&(n=el(t.state.facet(Aa).map(e=>e(t)),n))),t.dispatch({selection:n,scrollIntoView:e,userEvent:i}),!0}return!1}function cl(t,e,i,n=-1){if(dr.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(dr.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&" "==t.state.sliceDoc(e.from,s.from))&&1==e.insert.length&&2==e.insert.lines&&Wo(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&0==e.insert.length||8==n&&e.insert.length<e.to-e.from&&e.to>s.head)&&Wo(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&0==e.insert.length&&Wo(t.contentDOM,"Delete",46)))return!0;let o,r=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a=()=>o||(o=function(t,e,i){let n,s=t.state,o=s.selection.main,r=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let i=e.from<o.from?-1:1,n=i<0?o.from:o.to,a=tl(s.facet(Aa).map(e=>e(t)),n,i);e.from==a&&(r=a)}if(r>-1)n={changes:e,selection:is.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=o.from<e.from?s.sliceDoc(o.from,e.from):"",r=o.to>e.to?s.sliceDoc(e.to,o.to):"";n=s.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+r))}else{let r=s.changes(e),a=i&&i.main.to<=r.newLength?i.main:void 0;if(s.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let l,c=t.state.sliceDoc(e.from,e.to),h=i&&za(t,i.main.head);if(h){let t=e.insert.length-(e.to-e.from);l={from:h.from,to:h.to-t}}else l=t.state.doc.lineAt(o.head);let u=o.to-e.to,d=o.to-o.from;n=s.changeByRange(i=>{if(i.from==o.from&&i.to==o.to)return{changes:r,range:a||i.map(r)};let n=i.to-u,h=n-c.length;if(i.to-i.from!=d||t.state.sliceDoc(h,n)!=c||i.to>=l.from&&i.from<=l.to)return{range:i};let f=s.changes({from:h,to:n,insert:e.insert}),p=i.to-o.to;return{changes:f,range:a?is.range(Math.max(0,a.anchor+p),Math.max(0,a.head+p)):i.map(f)}})}else n={changes:r,selection:a&&s.selection.replaceRange(a)}}let a="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1));return s.update(n,{userEvent:a,scrollIntoView:!0})}(t,e,i));return t.state.facet(ua).some(i=>i(t,e.from,e.to,r,a))||t.dispatch(a()),!0}class hl{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,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=t.hasFocus,dr.safari&&t.contentDOM.addEventListener("input",()=>null),dr.gecko&&function(t){Ll.has(t)||(Ll.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,n=e.target;n!=t.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=Uo.get(n))&&i.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||(0!=this.view.updateState?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t)))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=dl(t),i=this.handlers,n=this.view.contentDOM;for(let t in e)if("scroll"!=t){let s=!e[t].handlers.length,o=i[t];o&&s!=!o.handlers.length&&(n.removeEventListener(t,this.handleEvent),o=null),o||n.addEventListener(t,this.handleEvent,{passive:s})}for(let t in i)"scroll"==t||e[t]||n.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&ml.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),dr.android&&dr.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return!dr.ios||t.synthetic||t.altKey||t.metaKey||!((e=fl.find(e=>e.keyCode==t.keyCode))&&!t.ctrlKey||pl.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0)}flushIOSKey(t){let e=this.pendingIOSKey;return!!e&&(!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,Wo(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0)))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(dr.safari&&!dr.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ul(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(t){xa(i.state,t)}}}function dl(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec,n=t&&t.plugin.domEventHandlers,s=t&&t.plugin.domEventObservers;if(n)for(let t in n){let s=n[t];s&&i(t).handlers.push(ul(e.value,s))}if(s)for(let t in s){let n=s[t];n&&i(t).observers.push(ul(e.value,n))}}for(let t in yl)i(t).handlers.push(yl[t]);for(let t in Ol)i(t).observers.push(Ol[t]);return e}const fl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],pl="dthko",ml=[16,17,18,20,91,92,224,225];function gl(t){return.7*Math.max(0,t)+8}class vl{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){let e,i,n=t.ownerDocument;for(let s=t.parentNode;s&&!(s==n.body||e&&i);)if(1==s.nodeType)!i&&s.scrollHeight>s.clientHeight&&(i=s),!e&&s.scrollWidth>s.clientWidth&&(e=s),s=s.assignedSlot||s.parentNode;else{if(11!=s.nodeType)break;s=s.host}return{x:e,y:i}}(t.contentDOM),this.atoms=t.state.facet(Aa).map(e=>e(t));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(Hs.allowMultipleSelections)&&function(t,e){let i=t.state.facet(ra);return i.length?i[0](e):dr.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=$o(t.root);if(!n||0==n.rangeCount)return!0;let s=n.getRangeAt(0).getClientRects();for(let t=0;t<s.length;t++){let i=s[t];if(i.left<=e.clientX&&i.right>=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=Al(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);let n=0,s=0,o=0,r=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:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=Ra(this.view);t.clientX-c.left<=o+6?n=-gl(o-t.clientX):t.clientX+c.right>=a-6&&(n=gl(t.clientX-a)),t.clientY-c.top<=r+6?s=-gl(r-t.clientY):t.clientY+c.bottom>=l-6&&(s=gl(t.clientY-l)),this.setScrollSpeed(n,s)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent)}select(t){let{view:e}=this,i=el(this.atoms,this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}const yl=Object.create(null),Ol=Object.create(null),bl=dr.ie&&dr.ie_version<15||dr.ios&&dr.webkit_version<604;function xl(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function wl(t,e){e=xl(t.state,fa,e);let i,{state:n}=t,s=1,o=n.toText(e),r=o.lines==n.selection.ranges.length;if(null!=Ql&&n.selection.ranges.every(t=>t.empty)&&Ql==o.toString()){let t=-1;i=n.changeByRange(i=>{let a=n.doc.lineAt(i.from);if(a.from==t)return{range:i};t=a.from;let l=n.toText((r?o.line(s++).text:e)+n.lineBreak);return{changes:{from:a.from,insert:l},range:is.cursor(i.from+l.length)}})}else i=r?n.changeByRange(t=>{let e=o.line(s++);return{changes:{from:t.from,to:t.to,insert:e.text},range:is.cursor(t.from+e.length)}}):n.replaceSelection(o);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function _l(t,e,i,n){if(1==n)return is.cursor(e,i);if(2==n)return function(t,e,i=1){let n=t.charCategorizer(e),s=t.doc.lineAt(e),o=e-s.from;if(0==s.length)return is.cursor(e);0==o?i=1:o==s.length&&(i=-1);let r=o,a=o;i<0?r=Bn(s.text,o,!1):a=Bn(s.text,o);let l=n(s.text.slice(r,a));for(;r>0;){let t=Bn(s.text,r,!1);if(n(s.text.slice(t,r))!=l)break;r=t}for(;a<s.length;){let t=Bn(s.text,a);if(n(s.text.slice(a,t))!=l)break;a=t}return is.range(r+s.from,a+s.from)}(t.state,e,i);{let i=Dr.find(t.docView,e),n=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:n.from,o=i?i.posAtEnd:n.to;return o<t.state.doc.length&&o==n.to&&o++,is.range(s,o)}}Ol.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},yl.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1),Ol.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},Ol.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},yl.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(la))if(i=n(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=$l(t,e),n=Al(e),s=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),s=s.map(t.changes))},get(e,o,r){let a,l=$l(t,e),c=_l(t,l.pos,l.bias,n);if(i.pos!=l.pos&&!o){let e=_l(t,i.pos,i.bias,n),s=Math.min(e.from,c.from),o=Math.max(e.to,c.to);c=s<c.from?is.range(s,o):is.range(o,s)}return o?s.replaceRange(s.main.extend(c.from,c.to)):r&&1==n&&s.ranges.length>1&&(a=function(t,e){for(let i=0;i<t.ranges.length;i++){let{from:n,to:s}=t.ranges[i];if(n<=e&&s>=e)return is.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(s,l.pos))?a:r?s.addRange(c):is.create([c])}}}(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new vl(t,e,i,n)),n&&t.observer.ignore(()=>{Bo(t.contentDOM);let e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),!1===s.dragging}else t.inputState.setSelectionOrigin("select.pointer");return!1};let Sl=(t,e,i)=>e>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;function kl(t,e,i,n){let s=Dr.find(t.docView,e);if(!s)return 1;let o=e-s.posAtStart;if(0==o)return 1;if(o==s.length)return-1;let r=s.coordsAt(o,-1);if(r&&Sl(i,n,r))return-1;let a=s.coordsAt(o,1);return a&&Sl(i,n,a)?1:r&&r.bottom>=n?-1:1}function $l(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:kl(t,i,e.clientX,e.clientY)}}const Tl=dr.ie&&dr.ie_version<=11;let Cl=null,Pl=0,El=0;function Al(t){if(!Tl)return t.detail;let e=Cl,i=El;return Cl=t,El=Date.now(),Pl=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Pl+1)%3:1}function Ml(t,e,i,n){if(!(i=xl(t.state,fa,i)))return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,r=n&&o&&function(t,e){let i=t.state.facet(aa);return i.length?i[0](e):dr.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:o.from,to:o.to}:null,a={from:s,insert:i},l=t.state.changes(r?[r,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(s,-1),head:l.mapPos(s,1)},userEvent:r?"move.drop":"input.drop"}),t.inputState.draggedContent=null}yl.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let n=t.docView.nearest(e.target);if(n&&n.isWidget){let t=n.posAtStart,e=t+n.length;(t>=i.to||e<=i.from)&&(i=is.range(t,e))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",xl(t.state,pa,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1},yl.dragend=t=>(t.inputState.draggedContent=null,!1),yl.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),s=0,o=()=>{++s==i.length&&Ml(t,e,n.filter(t=>null!=t).join(t.state.lineBreak),!1)};for(let t=0;t<i.length;t++){let e=new FileReader;e.onerror=o,e.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(n[t]=e.result),o()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return Ml(t,e,i,!0),!0}return!1},yl.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=bl?null:e.clipboardData;return i?(wl(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),wl(t,i.value)},50)}(t),!1)};let Ql=null;yl.copy=yl.cut=(t,e)=>{let{text:i,ranges:n,linewise:s}=function(t){let e=[],i=[],n=!1;for(let n of t.selection.ranges)n.empty||(e.push(t.sliceDoc(n.from,n.to)),i.push(n));if(!e.length){let s=-1;for(let{from:n}of t.selection.ranges){let o=t.doc.lineAt(n);o.number>s&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),s=o.number}n=!0}return{text:xl(t,pa,e.join(t.lineBreak)),ranges:i,linewise:n}}(t.state);if(!i&&!s)return!1;Ql=s?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let o=bl?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}(t,i),!1)};const Dl=Ms.define();function Rl(t,e){let i=[];for(let n of t.facet(da)){let s=n(t,e);s&&i.push(s)}return i.length?t.update({effects:i,annotations:Dl.of(!0)}):null}function Il(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=Rl(t.state,e);i?t.dispatch(i):t.update([])}},10)}Ol.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Il(t)},Ol.blur=t=>{t.observer.clearSelectionRange(),Il(t)},Ol.compositionstart=Ol.compositionupdate=t=>{t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))},Ol.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,dr.chrome&&dr.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))},Ol.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},yl.beforeinput=(t,e)=>{var i,n;if("insertReplacementText"==e.inputType&&t.observer.editContext){let n=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),s=e.getTargetRanges();if(n&&s.length){let e=s[0],i=t.posAtDOM(e.startContainer,e.startOffset),o=t.posAtDOM(e.endContainer,e.endOffset);return cl(t,{from:i,to:o,insert:t.state.toText(n)},null),!0}}let s;if(dr.chrome&&dr.android&&(s=fl.find(t=>t.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),"Backspace"==s.key||"Delete"==s.key)){let e=(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)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return dr.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),dr.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(()=>Ol.compositionend(t,e),20),!1};const Ll=new Set;const Nl=["pre-wrap","normal","pre-line","break-spaces"];let jl=!1;function zl(){jl=!1}class Bl{constructor(t){this.lineWrapping=t,this.doc=An.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Nl.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i<t.length;i++){let n=t[i];n<0?i++:this.heightSamples[Math.floor(10*n)]||(e=!0,this.heightSamples[Math.floor(10*n)]=!0)}return e}refresh(t,e,i,n,s,o){let r=Nl.indexOf(t)>-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=r;if(this.lineWrapping=r,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=s,a){this.heightSamples={};for(let t=0;t<o.length;t++){let e=o[t];e<0?t++:this.heightSamples[Math.floor(10*e)]=!0}}return a}}class Zl{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class Wl{constructor(t,e,i,n,s){this.from=t,this.length=e,this.top=i,this.height=n,this._content=s}get type(){return"number"==typeof this._content?Tr.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 Ar?this._content.widget:null}get widgetLineBreaks(){return"number"==typeof this._content?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new Wl(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var Fl=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(Fl||(Fl={}));const Xl=.001;class ql{constructor(t,e,i=2){this.length=t,this.height=e,this.flags=i}get outdated(){return(2&this.flags)>0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>Xl&&(jl=!0),this.height=t)}replace(t,e,i){return ql.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let s=this,o=i.doc;for(let r=n.length-1;r>=0;r--){let{fromA:a,toA:l,fromB:c,toB:h}=n[r],u=s.lineAt(a,Fl.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=l?u:s.lineAt(l,Fl.ByPosNoHeight,i,0,0);for(h+=d.to-l,l=d.to;r>0&&u.from<=n[r-1].toA;)a=n[r-1].fromA,c=n[r-1].fromB,r--,a<u.from&&(u=s.lineAt(a,Fl.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let f=Jl.build(i.setDoc(o),t,c,h);s=Hl(s,s.replace(a,l,f))}return s.updateHeight(i,0)}static empty(){return new Yl(0,0)}static of(t){if(1==t.length)return t[0];let e=0,i=t.length,n=0,s=0;for(;;)if(e==i)if(n>2*s){let s=t[e-1];s.break?t.splice(--e,1,s.left,null,s.right):t.splice(--e,1,s.left,s.right),i+=1+s.break,n-=s.size}else{if(!(s>2*n))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,s-=e.size}}else if(n<s){let i=t[e++];i&&(n+=i.size)}else{let e=t[--i];e&&(s+=e.size)}let o=0;return null==t[e-1]?(o=1,e--):null==t[e]&&(o=1,i++),new Gl(ql.of(t.slice(0,e)),o,ql.of(t.slice(i)))}}function Hl(t,e){return t==e?t:(t.constructor!=e.constructor&&(jl=!0),e)}ql.prototype.size=1;class Vl extends ql{constructor(t,e,i){super(t,e),this.deco=i}blockAt(t,e,i,n){return new Wl(n,this.length,i,this.height,this.deco||0)}lineAt(t,e,i,n,s){return this.blockAt(0,i,n,s)}forEachLine(t,e,i,n,s,o){t<=s+this.length&&e>=s&&o(this.blockAt(0,i,n,s))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Yl extends Vl{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Wl(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return 1==i.length&&(n instanceof Yl||n instanceof Ul&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Ul?n=new Yl(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):ql.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ul extends ql{constructor(t){super(t,0)}heightMetrics(t,e){let i,n=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,o=s-n+1,r=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*o);i=e/o,this.length>o+1&&(r=(this.height-e)/(this.length-o-1))}else i=this.height/o;return{firstLine:n,lastLine:s,perLine:i,perChar:r}}blockAt(t,e,i,n){let{firstLine:s,lastLine:o,perLine:r,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let s=n+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),o=e.doc.lineAt(s),l=r+o.length*a,c=Math.max(i,t-l/2);return new Wl(o.from,o.length,c,l,0)}{let n=Math.max(0,Math.min(o-s,Math.floor((t-i)/r))),{from:a,length:l}=e.doc.line(s+n);return new Wl(a,l,i+r*n,r,0)}}lineAt(t,e,i,n,s){if(e==Fl.ByHeight)return this.blockAt(t,i,n,s);if(e==Fl.ByPosNoHeight){let{from:e,to:n}=i.doc.lineAt(t);return new Wl(e,n-e,0,0,0)}let{firstLine:o,perLine:r,perChar:a}=this.heightMetrics(i,s),l=i.doc.lineAt(t),c=r+l.length*a,h=l.number-o,u=n+r*h+a*(l.from-s-h);return new Wl(l.from,l.length,Math.max(n,Math.min(u,n+this.height-c)),c,0)}forEachLine(t,e,i,n,s,o){t=Math.max(t,s),e=Math.min(e,s+this.length);let{firstLine:r,perLine:a,perChar:l}=this.heightMetrics(i,s);for(let c=t,h=n;c<=e;){let e=i.doc.lineAt(c);if(c==t){let i=e.number-r;h+=a*i+l*(t-s-i)}let n=a+l*e.length;o(new Wl(e.from,e.length,h,n,0)),h+=n,c=e.to+1}}replace(t,e,i){let n=this.length-e;if(n>0){let t=i[i.length-1];t instanceof Ul?i[i.length-1]=new Ul(t.length+n):i.push(null,new Ul(n-1))}if(t>0){let e=i[0];e instanceof Ul?i[0]=new Ul(t+e.length):i.unshift(new Ul(t-1),null)}return ql.of(i)}decomposeLeft(t,e){e.push(new Ul(t-1),null)}decomposeRight(t,e){e.push(null,new Ul(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let s=e+this.length;if(n&&n.from<=e+this.length&&n.more){let i=[],o=Math.max(e,n.from),r=-1;for(n.from>e&&i.push(new Ul(n.from-e-1).updateHeight(t,e));o<=s&&n.more;){let e=t.doc.lineAt(o).length;i.length&&i.push(null);let s=n.heights[n.index++];-1==r?r=s:Math.abs(s-r)>=Xl&&(r=-2);let a=new Yl(e,s);a.outdated=!1,i.push(a),o+=e+1}o<=s&&i.push(null,new Ul(s-o).updateHeight(t,o));let a=ql.of(i);return(r<0||Math.abs(a.height-this.height)>=Xl||Math.abs(r-this.heightMetrics(t,e).perLine)>=Xl)&&(jl=!0),Hl(this,a)}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class Gl extends ql{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){let s=i+this.left.height;return t<s?this.left.blockAt(t,e,i,n):this.right.blockAt(t,e,s,n+this.left.length+this.break)}lineAt(t,e,i,n,s){let o=n+this.left.height,r=s+this.left.length+this.break,a=e==Fl.ByHeight?t<o:t<r,l=a?this.left.lineAt(t,e,i,n,s):this.right.lineAt(t,e,i,o,r);if(this.break||(a?l.to<r:l.from>r))return l;let c=e==Fl.ByPosNoHeight?Fl.ByPosNoHeight:Fl.ByPos;return a?l.join(this.right.lineAt(r,c,i,o,r)):this.left.lineAt(r,c,i,n,s).join(l)}forEachLine(t,e,i,n,s,o){let r=n+this.left.height,a=s+this.left.length+this.break;if(this.break)t<a&&this.left.forEachLine(t,e,i,n,s,o),e>=a&&this.right.forEachLine(t,e,i,r,a,o);else{let l=this.lineAt(a,Fl.ByPos,i,n,s);t<l.from&&this.left.forEachLine(t,l.from-1,i,n,s,o),l.to>=t&&l.from<=e&&o(l),e>l.to&&this.right.forEachLine(l.to+1,e,i,r,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(e<n)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let s=[];t>0&&this.decomposeLeft(t,s);let o=s.length;for(let t of i)s.push(t);if(t>0&&Kl(s,o-1),e<this.length){let t=s.length;this.decomposeRight(e,s),Kl(s,t)}return ql.of(s)}decomposeLeft(t,e){let i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t<i&&this.left.decomposeRight(t,e),this.break&&t<n&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?ql.of(this.break?[t,null,e]:[t,e]):(this.left=Hl(this.left,t),this.right=Hl(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:s,right:o}=this,r=e+s.length+this.break,a=null;return n&&n.from<=e+s.length&&n.more?a=s=s.updateHeight(t,e,i,n):s.updateHeight(t,e,i),n&&n.from<=r+o.length&&n.more?a=o=o.updateHeight(t,r,i,n):o.updateHeight(t,r,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Kl(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof Ul&&(n=t[e+1])instanceof Ul&&t.splice(e-1,3,new Ul(i.length+1+n.length))}class Jl{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Yl?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Yl(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t<e||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let o=e-t;i.block?this.addBlock(new Vl(o,n,i)):(o||s||n>=5)&&this.addLineDeco(n,s,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Yl(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new Ul(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Yl)return t;let e=new Yl(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Yl||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Yl(0,-1));let i=t;for(let t of this.nodes)t instanceof Yl&&t.updateHeight(this.oracle,i),i+=t?t.length:1;return this.nodes}static build(t,e,i,n){let s=new Jl(i,t);return Js.spans(e,i,n,s,0),s.finish(i)}}class tc{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,i,n){(t<e||i&&i.heightRelevant||n&&n.heightRelevant)&&Qr(t,e,this.changes,5)}}function ec(t,e){let i=t.getBoundingClientRect(),n=t.ownerDocument,s=n.defaultView||window,o=Math.max(0,i.left),r=Math.min(s.innerWidth,i.right),a=Math.max(0,i.top),l=Math.min(s.innerHeight,i.bottom);for(let e=t.parentNode;e&&e!=n.body;)if(1==e.nodeType){let i=e,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),r=Math.min(r,n.right),a=Math.max(a,n.top),l=Math.min(e==t.parentNode?s.innerHeight:l,n.bottom)}e="absolute"==n.position||"fixed"==n.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:o-i.left,right:Math.max(o,r)-i.left,top:a-(i.top+e),bottom:Math.max(a,l)-(i.top+e)}}function ic(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class nc{constructor(t,e,i,n){this.from=t,this.to=e,this.size=i,this.displaySize=n}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],s=e[i];if(n.from!=s.from||n.to!=s.to||n.size!=s.size)return!1}return!0}draw(t,e){return Cr.replace({widget:new sc(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class sc extends $r{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class oc{constructor(t){this.state=t,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=cc,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=zr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(Ca).some(t=>"function"!=typeof t&&"cm-lineWrapping"==t.class);this.heightOracle=new Bl(e),this.stateDeco=t.facet(Pa).filter(t=>"function"!=typeof t),this.heightMap=ql.empty().applyChanges(this.stateDeco,An.empty,this.heightOracle.setDoc(t.doc),[new La(0,0,0,t.doc.length)]);for(let t=0;t<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());t++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Cr.set(this.lineGaps.map(t=>t.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:t,to:e})=>n>=t&&n<=e)){let{from:e,to:i}=this.lineBlockAt(n);t.push(new rc(e,i))}}return this.viewports=t.sort((t,e)=>t.from-e.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?cc:new hc(this.heightOracle,this.heightMap,this.viewports),t.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,t=>{this.viewportLines.push(uc(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Pa).filter(t=>"function"!=typeof t);let n=t.changedRanges,s=La.extendWithRanges(n,function(t,e,i){let n=new tc;return Js.compare(t,e,i,n,0),n.changes}(i,this.stateDeco,t?t.changes:Vn.empty(this.state.doc.length))),o=this.heightMap.height,r=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);zl(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||jl)&&(t.flags|=2),r?(this.scrollAnchorPos=t.changes.mapPos(r.from,-1),this.scrollAnchorHeight=r.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<a.from||e.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let l=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(l||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(ga)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?zr.RTL:zr.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),r=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=r.height;this.contentDOMHeight=r.height,this.mustMeasureContent=!1;let l=0,c=0;if(r.width&&r.height){let{scaleX:t,scaleY:i}=Lo(e,r);(t>.005&&Math.abs(this.scaleX-t)>.005||i>.005&&Math.abs(this.scaleY-i)>.005)&&(this.scaleX=t,this.scaleY=i,l|=16,o=a=!0)}let h=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==h&&this.paddingBottom==u||(this.paddingTop=h,this.paddingBottom=u,l|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,l|=16);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Xo(t.scrollDOM);let f=(this.printing?ic:ec)(e,this.paddingTop),p=f.top-this.pixelViewport.top,m=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget&&!function(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0}(t.dom))return 0;let v=r.width;if(this.contentDOMWidth==v&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=r.width,this.editorHeight=t.scrollDOM.clientHeight,l|=16),a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(e)&&(o=!0),o||n.lineWrapping&&Math.abs(v-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:r,textHeight:a}=t.docView.measureTextSize();o=i>0&&n.refresh(s,i,r,a,Math.max(5,v/r),e),o&&(t.docView.minWidth=0,l|=16)}p>0&&m>0?c=Math.max(p,m):p<0&&m<0&&(c=Math.min(p,m)),zl();for(let i of this.viewports){let s=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(o?ql.empty().applyChanges(this.stateDeco,An.empty,this.heightOracle,[new La(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Zl(i.from,s))}jl&&(l|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(2&l&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(2&l||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:r}=this,a=new rc(n.lineAt(o-1e3*i,Fl.ByHeight,s,0,0).from,n.lineAt(r+1e3*(1-i),Fl.ByHeight,s,0,0).to);if(e){let{head:t}=e.range;if(t<a.from||t>a.to){let i,o=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),r=n.lineAt(t,Fl.ByPos,s,0,0);i="center"==e.y?(r.top+r.bottom)/2-o/2:"start"==e.y||"nearest"==e.y&&t<a.from?r.top:r.bottom-o,a=new rc(n.lineAt(i-500,Fl.ByHeight,s,0,0).from,n.lineAt(i+o+500,Fl.ByHeight,s,0,0).to)}}return a}mapViewport(t,e){let i=e.mapPos(t.from,-1),n=e.mapPos(t.to,1);return new rc(this.heightMap.lineAt(i,Fl.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,Fl.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(t,Fl.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(e,Fl.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:r}=this;return(0==t||n<=o-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||s>=r+Math.max(10,Math.min(i,250)))&&n>o-2e3&&s<r+2e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let i=[];for(let n of t)e.touchesRange(n.from,n.to)||i.push(new nc(e.mapPos(n.from),e.mapPos(n.to),n.size,n.displaySize));return i}ensureLineGaps(t,e){let i=this.heightOracle.lineWrapping,n=i?1e4:2e3,s=n>>1,o=n<<1;if(this.defaultTextDirection!=zr.LTR&&!i)return[];let r=[],a=(n,o,l,c)=>{if(o-n<s)return;let h=this.state.selection.main,u=[h.from];h.empty||u.push(h.to);for(let t of u)if(t>n&&t<o)return a(n,t-10,l,c),void a(t+10,o,l,c);let d=function(t,e){for(let i of t)if(e(i))return i;return}(t,t=>t.from>=l.from&&t.to<=l.to&&Math.abs(t.from-n)<s&&Math.abs(t.to-o)<s&&!u.some(e=>t.from<e&&t.to>e));if(!d){if(o<l.to&&e&&i&&e.visibleRanges.some(t=>t.from<=o&&t.to>=o)){let t=e.moveToLineBoundary(is.cursor(o),!1,!0).head;t>n&&(o=t)}let t=this.gapSize(l,n,o,c);d=new nc(n,o,t,i||t<2e6?t:2e6)}r.push(d)},l=e=>{if(e.length<o||e.type!=Tr.Text)return;let s=function(t,e,i){let n=[],s=t,o=0;Js.spans(i,t,e,{span(){},point(t,e){t>s&&(n.push({from:s,to:t}),o+=t-s),s=e}},20),s<e&&(n.push({from:s,to:e}),o+=e-s);return{total:o,ranges:n}}(e.from,e.to,this.stateDeco);if(s.total<o)return;let r,l,c=this.scrollTarget?this.scrollTarget.range.head:null;if(i){let t,i,o=n/this.heightOracle.lineLength*this.heightOracle.lineHeight;if(null!=c){let n=lc(s,c),r=((this.visibleBottom-this.visibleTop)/2+o)/e.height;t=n-r,i=n+r}else t=(this.visibleTop-e.top-o)/e.height,i=(this.visibleBottom-e.top+o)/e.height;r=ac(s,t),l=ac(s,i)}else{let i=s.total*this.heightOracle.charWidth,o=n*this.heightOracle.charWidth,a=0;if(i>2e6)for(let i of t)i.from>=e.from&&i.from<e.to&&i.size!=i.displaySize&&i.from*this.heightOracle.charWidth+a<this.pixelViewport.left&&(a=i.size-i.displaySize);let h,u,d=this.pixelViewport.left+a,f=this.pixelViewport.right+a;if(null!=c){let t=lc(s,c),e=((f-d)/2+o)/i;h=t-e,u=t+e}else h=(d-o)/i,u=(f+o)/i;r=ac(s,h),l=ac(s,u)}r>e.from&&a(e.from,r,e,s),l<e.to&&a(l,e.to,e,s)};for(let t of this.viewportLines)Array.isArray(t.type)?t.type.forEach(l):l(t);return r}gapSize(t,e,i,n){let s=lc(n,i)-lc(n,e);return this.heightOracle.lineWrapping?t.height*s:n.total*this.heightOracle.charWidth*s}updateLineGaps(t){nc.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=Cr.set(t.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let i=[];Js.spans(e,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let e=0;e<i.length&&!(8&n);e++){let s=this.visibleRanges[e],o=i[e];s.from==o.from&&s.to==o.to||(n|=4,t&&t.mapPos(s.from,-1)==o.from&&t.mapPos(s.to,1)==o.to||(n|=8))}return this.visibleRanges=i,n}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||uc(this.heightMap.lineAt(t,Fl.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||uc(this.heightMap.lineAt(this.scaler.fromDOM(t),Fl.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return uc(this.heightMap.blockAt(this.scaler.fromDOM(t),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 rc{constructor(t,e){this.from=t,this.to=e}}function ac({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:s}=e[t],o=s-i;if(n<=o)return i+n;n-=o}}function lc(t,e){let i=0;for(let{from:n,to:s}of t.ranges){if(e<=s){i+=e-n;break}i+=s-n}return i/t.total}const cc={toDOM:t=>t,fromDOM:t=>t,scale:1,eq(t){return t==this}};class hc{constructor(t,e,i){let n=0,s=0,o=0;this.viewports=i.map(({from:i,to:s})=>{let o=e.lineAt(i,Fl.ByPos,t,0,0).top,r=e.lineAt(s,Fl.ByPos,t,0,0).bottom;return n+=r-o,{from:i,to:s,top:o,bottom:r,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);for(let t of this.viewports)t.domTop=o+(t.top-s)*this.scale,o=t.domBottom=t.domTop+(t.bottom-t.top),s=t.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let s=e<this.viewports.length?this.viewports[e]:null;if(!s||t<s.top)return n+(t-i)*this.scale;if(t<=s.bottom)return s.domTop+(t-s.top);i=s.bottom,n=s.domBottom}}fromDOM(t){for(let e=0,i=0,n=0;;e++){let s=e<this.viewports.length?this.viewports[e]:null;if(!s||t<s.domTop)return i+(t-n)/this.scale;if(t<=s.domBottom)return s.top+(t-s.domTop);i=s.bottom,n=s.domBottom}}eq(t){return t instanceof hc&&(this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,i)=>e.from==t.viewports[i].from&&e.to==t.viewports[i].to))}}function uc(t,e){if(1==e.scale)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Wl(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(t=>uc(t,e)):t._content)}const dc=os.define({combine:t=>t.join(" ")}),fc=os.define({combine:t=>t.indexOf(!0)>-1}),pc=vo.newName(),mc=vo.newName(),gc=vo.newName(),vc={"&light":"."+mc,"&dark":"."+gc};function yc(t,e,i){return new vo(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]}):t+" "+e})}const Oc=yc("."+pc,{"&":{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:"#ddd"},".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",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&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-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".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",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".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"}},vc),bc={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},xc=dr.ie&&dr.ie_version<=11;class wc{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new No,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=t.contentDOM,this.observer=new MutationObserver(e=>{for(let t of e)this.queue.push(t);(dr.ie&&dr.ie_version<=11||dr.ios&&t.composing)&&e.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),!window.EditContext||!dr.android||!1===t.constructor.EDIT_CONTEXT||dr.chrome&&dr.chrome_version<126||(this.editContext=new kc(t),t.state.facet(wa)&&(t.contentDOM.editContext=this.editContext.editContext)),xc&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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 t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.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(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(wa)?i.root.activeElement!=this.dom:!Co(this.dom,n))return;let s=n.anchorNode&&i.docView.nearest(n.anchorNode);s&&s.ignoreEvent(t)?e||(this.selectionChanged=!1):(dr.ie&&dr.ie_version<=11||dr.android&&dr.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Eo(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=$o(t.root);if(!e)return!1;let i=dr.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Sc(t,i)}let i=null;function n(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?Sc(t,i):null}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=Co(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){let i=e.focusNode,n=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=n)return!1;for(n=Math.min(n,Do(i));;)if(n){if(1!=i.nodeType)return!1;let t=i.childNodes[n-1];"false"==t.contentEditable?n--:(i=t,n=Do(i))}else{if(i==t)return!0;n=Ao(i),i=i.parentNode}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),n&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let i=this.dom;i;)if(1==i.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==i?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(i),i=i.assignedSlot||i.parentNode;else{if(11!=i.nodeType)break;i=i.host}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);for(let t of this.scrollTargets=e)t.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,bc),xc&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),xc&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var i;if(!this.delayedAndroidKey){let t=()=>{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&Wo(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,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 t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let s of t){let t=this.readMutation(s);t&&(t.typeOver&&(n=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&Co(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new al(this.view,t,e,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=ll(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let i=_c(e,t.previousSibling||t.target.previousSibling,-1),n=_c(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(wa)!=t.state.facet(wa)&&(t.view.contentDOM.editContext=t.state.facet(wa)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.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 _c(t,e,i){for(;e;){let n=Uo.get(e);if(n&&n.parent==t)return n;let s=e.parentNode;e=s!=t.dom?s:i>0?e.nextSibling:e.previousSibling}return null}function Sc(t,e){let i=e.startContainer,n=e.startOffset,s=e.endContainer,o=e.endOffset,r=t.docView.domAtPos(t.state.selection.main.anchor);return Eo(r.node,r.offset,s,o)&&([i,n,s,o]=[s,o,i,n]),{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:o}}class kc{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let n=t.state.selection.main,{anchor:s,head:o}=n,r=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:r,drifted:!1});let l={from:r,to:a,insert:An.of(i.text.split("\n"))};if(l.from==this.from&&s<this.from?l.from=s:l.to==this.to&&s>this.to&&(l.to=s),l.from==l.to&&!l.insert.length){let e=is.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));return void(e.main.eq(n)||t.dispatch({selection:e,userEvent:"select"}))}if((dr.mac||dr.android)&&l.from==o-1&&/^\. ?$/.test(i.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(l={from:r,to:a,insert:An.of([i.text.replace("."," ")])}),this.pendingContextChange=l,!t.state.readOnly){let e=this.to-this.from+(l.to-l.from+l.insert.length);cl(t,l,is.single(this.toEditorPos(i.selectionStart,e),this.toEditorPos(i.selectionEnd,e)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),l.from<l.to&&!l.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(e.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(e.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let n=[],s=null;for(let e=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);e<o;e++){let i=t.coordsForChar(e);s=i&&new DOMRect(i.left,i.top,i.right-i.left,i.bottom-i.top)||s||new DOMRect,n.push(s)}e.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=e=>{let i=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,n=t.underlineThickness;if(!/none/i.test(e)&&!/none/i.test(n)){let s=this.toEditorPos(t.rangeStart),o=this.toEditorPos(t.rangeEnd);if(s<o){let t=`text-decoration: underline ${/^[a-z]/.test(e)?e+" ":"Dashed"==e?"dashed ":"Squiggle"==e?"wavy ":""}${/thin/i.test(n)?1:2}px`;i.push(Cr.mark({attributes:{style:t}}).range(s,o))}}}t.dispatch({effects:ba.of(Cr.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:e}=this.composing;this.composing=null,e&&this.reset(t.state)}};for(let t in this.handlers)e.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=$o(t.root);e&&e.rangeCount&&this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((s,o,r,a,l)=>{if(i)return;let c=l.length-(o-s);if(n&&o>=n.to){if(n.from==s&&n.to==o&&n.insert.eq(l))return n=this.pendingContextChange=null,e+=c,void(this.to+=c);n=null,this.revertPending(t.state)}if(s+=e,(o+=e)<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+l.length>3e4)return void(i=!0);this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=c}e+=c}),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some(t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==n||this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class $c{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&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;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),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(t=>t.forEach(t=>i(t,this)))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new oc(t.state||Hs.create(t)),t.scrollTo&&t.scrollTo.is(Oa)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Sa).map(t=>new $a(t));for(let t of this.plugins)t.update(this);this.observer=new wc(this),this.inputState=new hl(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ja(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=1==t.length&&t[0]instanceof Is?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,n=!1,s=this.state;for(let e of t){if(e.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=e.state}if(this.destroyed)return void(this.viewState.state=s);let o=this.hasFocus,r=0,a=null;t.some(t=>t.annotation(Dl))?(this.inputState.notifiedFocused=o,r=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Rl(s,o),a||(r=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(Hs.phrases)!=this.state.facet(Hs.phrases))return this.setState(s);e=Na.create(this,s,t),e.flags|=r;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(h&&(h=h.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;h=new ya(t.empty?t:is.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(Oa)&&(h=t.value.clip(this.state))}this.viewState.update(e,h),this.bidiCache=Pc.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(Ia)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(t=>t.isUserEvent("select.pointer")))}finally{this.updateState=0}if(e.startState.facet(dc)!=e.state.facet(dc)&&(this.viewState.mustMeasureContent=!0),(i||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty)for(let t of this.state.facet(ha))try{t(e)}catch(t){xa(this.state,t,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!ll(this,c)&&l.force&&Wo(this.contentDOM,l.key,l.keyCode)})}setState(t){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=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new oc(t),this.plugins=t.facet(Sa).map(t=>new $a(t)),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new ja(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(Sa),i=t.state.facet(Sa);if(e!=i){let n=[];for(let s of i){let i=e.indexOf(s);if(i<0)n.push(new $a(s));else{let e=this.plugins[i];e.mustUpdate=t,n.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t<this.plugins.length;t++)this.plugins[t].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(t){xa(this.state,t,"doc view update listener")}}}measure(t=!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,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(o<0)if(Xo(i))s=-1,o=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(n);s=t.from,o=t.top}this.updateState=1;let r=this.viewState.measure(this);if(!r&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&r||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map(t=>{try{return t.read(this)}catch(t){return xa(this.state,t),Cc}}),c=Na.create(this,this.state,[]),h=!1;c.flags|=r,e?e.flags|=r:e=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 t=0;t<a.length;t++)if(l[t]!=Cc)try{let e=a[t];e.write&&e.write(l[t],this)}catch(t){xa(this.state,t)}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 t=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(t>1||t<-1){n+=t,i.scrollTop=n/this.scaleY,o=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(ha))t(e)}get themeClasses(){return pc+" "+(this.state.facet(fc)?gc:mc)+" "+this.state.facet(dc)}updateAttrs(){let t=Ec(this,Ta,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(wa)?"true":"false",class:"cm-content",style:`${dr.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Ec(this,Ca,e);let i=this.observer.ignore(()=>{let i=Sr(this.contentDOM,this.contentAttrs,e),n=Sr(this.dom,this.editorAttrs,t);return i||n});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is($c.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Ia);let t=this.state.facet($c.cspNonce);vo.mount(this.root,this.styleModules.concat(Oc).reverse(),t?{nonce:t}: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(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key)return void(this.measureRequests[e]=t);this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(void 0===e||e&&e.plugin!=t)&&this.pluginMap.set(t,e=this.plugins.find(e=>e.plugin==t)||null),e&&e.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(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return il(this,t,Ja(this,t,e,i))}moveByGroup(t,e){return il(this,t,Ja(this,t,e,e=>function(t,e,i){let n=t.state.charCategorizer(e),s=n(i);return t=>{let e=n(t);return s==Ws.Space&&(s=e),s==e}}(this,t.head,e)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),s=i[e?i.length-1:0];return is.cursor(s.side(e,n)+t.from,s.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){let s=Ka(t,e.head,e.assoc||-1),o=n&&s.type==Tr.Text&&(t.lineWrapping||s.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head):null;if(o){let e=t.dom.getBoundingClientRect(),n=t.textDirectionAt(s.from),r=t.posAtCoords({x:i==(n==zr.LTR)?e.right-1:e.left+1,y:(o.top+o.bottom)/2});if(null!=r)return is.cursor(r,i?-1:1)}return is.cursor(i?s.to:s.from,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return il(this,t,function(t,e,i,n){let s=e.head,o=i?1:-1;if(s==(i?t.state.doc.length:0))return is.cursor(s,e.assoc);let r,a=e.goalColumn,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(s,e.assoc||-1),h=t.documentTop;if(c)null==a&&(a=c.left-l.left),r=o<0?c.top:c.bottom;else{let e=t.viewState.lineBlockAt(s);null==a&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(s-e.from))),r=(o<0?e.top:e.bottom)+h}let u=l.left+a,d=null!=n?n:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let i=r+(d+e)*o,n=Ya(t,{x:u,y:i},!1,o);if(i<l.top||i>l.bottom||(o<0?n<s:n>s)){let e=t.docView.coordsForChar(n),s=!e||i<e.top?-1:1;return is.cursor(n,s,void 0,a)}}}(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Ya(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),s=this.bidiSpans(n);return Ro(i,s[Ur.find(s,t-n.from,-1,e)].dir==zr.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(ma)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>Tc)return ia(t.length);let e,i=this.textDirectionAt(t.from);for(let n of this.bidiCache)if(n.from==t.from&&n.dir==i&&(n.fresh||Gr(n.isolates,e=Qa(this,t))))return n.order;e||(e=Qa(this,t));let n=ea(t.text,i,e);return this.bidiCache.push(new Pc(t.from,t.to,i,e,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||dr.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Bo(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.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(t,e={}){return Oa.of(new ya("number"==typeof t?is.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return Oa.of(new ya(is.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return ka.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return ka.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=vo.newName(),n=[dc.of(i),Ia.of(yc(`.${i}`,t))];return e&&e.dark&&n.push(fc.of(!0)),n}static baseTheme(t){return ys.lowest(Ia.of(yc("."+pc,t,vc)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&Uo.get(i)||Uo.get(t);return(null===(e=null==n?void 0:n.rootView)||void 0===e?void 0:e.view)||null}}$c.styleModule=Ia,$c.inputHandler=ua,$c.clipboardInputFilter=fa,$c.clipboardOutputFilter=pa,$c.scrollHandler=va,$c.focusChangeEffect=da,$c.perLineTextDirection=ma,$c.exceptionSink=ca,$c.updateListener=ha,$c.editable=wa,$c.mouseSelectionStyle=la,$c.dragMovesSelection=aa,$c.clickAddsSelectionRange=ra,$c.decorations=Pa,$c.outerDecorations=Ea,$c.atomicRanges=Aa,$c.bidiIsolatedRanges=Ma,$c.scrollMargins=Da,$c.darkTheme=fc,$c.cspNonce=os.define({combine:t=>t.length?t[0]:""}),$c.contentAttributes=Ca,$c.editorAttributes=Ta,$c.lineWrapping=$c.contentAttributes.of({class:"cm-lineWrapping"}),$c.announce=Rs.define();const Tc=4096,Cc={};class Pc{constructor(t,e,i,n,s,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=s,this.order=o}static update(t,e){if(e.empty&&!t.some(t=>t.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:zr.LTR;for(let s=Math.max(0,t.length-10);s<t.length;s++){let o=t[s];o.dir!=n||e.touchesRange(o.from,o.to)||i.push(new Pc(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function Ec(t,e,i){for(let n=t.state.facet(e),s=n.length-1;s>=0;s--){let e=n[s],o="function"==typeof e?e(t):e;o&&xr(o,i)}return i}const Ac=dr.mac?"mac":dr.windows?"win":dr.linux?"linux":"key";function Mc(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const Qc=ys.default($c.domEventHandlers({keydown:(t,e)=>zc(Ic(e.state),t,e,"editor")})),Dc=os.define({enables:Qc}),Rc=new WeakMap;function Ic(t){let e=t.facet(Dc),i=Rc.get(e);return i||Rc.set(e,i=function(t,e=Ac){let i=Object.create(null),n=Object.create(null),s=(t,e)=>{let i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},o=(t,n,o,r,a)=>{var l,c;let h=i[t]||(i[t]=Object.create(null)),u=n.split(/ (?!$)/).map(t=>function(t,e){const i=t.split(/-(?!$)/);let n,s,o,r,a=i[i.length-1];"Space"==a&&(a=" ");for(let t=0;t<i.length-1;++t){const a=i[t];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))s=!0;else if(/^s(hift)?$/i.test(a))o=!0;else{if(!/^mod$/i.test(a))throw new Error("Unrecognized modifier name: "+a);"mac"==e?r=!0:s=!0}}return n&&(a="Alt-"+a),s&&(a="Ctrl-"+a),r&&(a="Meta-"+a),o&&(a="Shift-"+a),a}(t,e));for(let e=1;e<u.length;e++){let i=u.slice(0,e).join(" ");s(i,!0),h[i]||(h[i]={preventDefault:!0,stopPropagation:!1,run:[e=>{let n=Lc={view:e,prefix:i,scope:t};return setTimeout(()=>{Lc==n&&(Lc=null)},Nc),!0}]})}let d=u.join(" ");s(d,!1);let f=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&&f.run.push(o),r&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let n of t){let t=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:s}=n;for(let e in t)t[e].run.push(t=>s(t,jc))}let s=n[e]||n.key;if(s)for(let e of t)o(e,s,n.run,n.preventDefault,n.stopPropagation),n.shift&&o(e,"Shift-"+s,n.shift,n.preventDefault,n.stopPropagation)}return i}(e.reduce((t,e)=>t.concat(e),[]))),i}let Lc=null;const Nc=4e3;let jc=null;function zc(t,e,i,n){jc=e;let s=function(t){var e=!(wo&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||_o&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?xo:bo)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),o=Fn(Zn(s,0))==s.length&&" "!=s,r="",a=!1,l=!1,c=!1;Lc&&Lc.view==i&&Lc.scope==n&&(r=Lc.prefix+" ",ml.indexOf(e.keyCode)<0&&(l=!0,Lc=null));let h,u,d=new Set,f=t=>{if(t){for(let e of t.run)if(!d.has(e)&&(d.add(e),e(i)))return t.stopPropagation&&(c=!0),!0;t.preventDefault&&(t.stopPropagation&&(c=!0),l=!0)}return!1},p=t[n];return p&&(f(p[r+Mc(s,e,!o)])?a=!0:!o||!(e.altKey||e.metaKey||e.ctrlKey)||dr.windows&&e.ctrlKey&&e.altKey||dr.mac&&e.altKey&&!e.ctrlKey&&!e.metaKey||!(h=bo[e.keyCode])||h==s?o&&e.shiftKey&&f(p[r+Mc(s,e,!0)])&&(a=!0):(f(p[r+Mc(h,e,!0)])||e.shiftKey&&(u=xo[e.keyCode])!=s&&u!=h&&f(p[r+Mc(u,e,!1)]))&&(a=!0),!a&&f(p._any)&&(a=!0)),l&&(a=!0),a&&c&&e.stopPropagation(),jc=null,a}class Bc{constructor(t,e,i,n,s){this.className=t,this.left=e,this.top=i,this.width=n,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let s=Zc(t);return[new Bc(e,n.left-s.left,n.top-s.top,null,n.bottom-n.top)]}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),s=Math.min(i.to,t.viewport.to),o=t.textDirection==zr.LTR,r=t.contentDOM,a=r.getBoundingClientRect(),l=Zc(t),c=r.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),f=Ka(t,n,1),p=Ka(t,s,-1),m=f.type==Tr.Text?f:null,g=p.type==Tr.Text?p:null;m&&(t.lineWrapping||f.widgetLineBreaks)&&(m=Wc(t,n,1,m));g&&(t.lineWrapping||p.widgetLineBreaks)&&(g=Wc(t,s,-1,g));if(m&&g&&m.from==g.from&&m.to==g.to)return y(O(i.from,i.to,m));{let e=m?O(i.from,null,m):b(f,!1),n=g?O(null,i.to,g):b(p,!0),s=[];return(m||f).to<(g||p).from-(m&&g?1:0)||f.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2<n.top?s.push(v(u,e.bottom,d,n.top)):e.bottom<n.top&&t.elementAtHeight((e.bottom+n.top)/2).type==Tr.Text&&(e.bottom=n.top=(e.bottom+n.top)/2),y(e).concat(s).concat(y(n))}function v(t,i,n,s){return new Bc(e,t-l.left,i-l.top,n-t,s-i)}function y({top:t,bottom:e,horizontal:i}){let n=[];for(let s=0;s<i.length;s+=2)n.push(v(i[s],t,i[s+1],e));return n}function O(e,i,n){let s=1e9,r=-1e9,a=[];function l(e,i,l,c,h){let f=t.coordsAtPos(e,e==n.to?-2:2),p=t.coordsAtPos(l,l==n.from?2:-2);f&&p&&(s=Math.min(f.top,p.top,s),r=Math.max(f.bottom,p.bottom,r),h==zr.LTR?a.push(o&&i?u:f.left,o&&c?d:p.right):a.push(!o&&c?u:p.left,!o&&i?d:f.right))}let c=null!=e?e:n.from,h=null!=i?i:n.to;for(let n of t.visibleRanges)if(n.to>c&&n.from<h)for(let s=Math.max(n.from,c),o=Math.min(n.to,h);;){let n=t.state.doc.lineAt(s);for(let r of t.bidiSpans(n)){let t=r.from+n.from,a=r.to+n.from;if(t>=o)break;a>s&&l(Math.max(t,s),null==e&&t<=c,Math.min(a,o),null==i&&a>=h,r.dir)}if(s=n.to+1,s>=o)break}return 0==a.length&&l(c,null==e,h,null==i,t.textDirection),{top:s,bottom:r,horizontal:a}}function b(t,e){let i=a.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(t,e,i)}}function Zc(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==zr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Wc(t,e,i,n){let s=t.coordsAtPos(e,2*i);if(!s)return n;let o=t.dom.getBoundingClientRect(),r=(s.top+s.bottom)/2,a=t.posAtCoords({x:o.left+1,y:r}),l=t.posAtCoords({x:o.right-1,y:r});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 Fc{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(Xc)!=t.state.facet(Xc)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(Xc);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some((t,e)=>{return i=t,n=this.drawn[e],!(i.constructor==n.constructor&&i.eq(n));var i,n})){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t,dr.ios&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Xc=os.define();function qc(t){return[ka.define(e=>new Fc(e,t)),Xc.of(t)]}const Hc=os.define({combine:t=>Vs(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function Vc(t={}){return[Hc.of(t),Uc,Kc,Jc,ga.of(!0)]}function Yc(t){return t.startState.facet(Hc)!=t.state.facet(Hc)}const Uc=qc({above:!0,markers(t){let{state:e}=t,i=e.facet(Hc),n=[];for(let s of e.selection.ranges){let o=s==e.selection.main;if(s.empty||i.drawRangeCursor){let e=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=s.empty?s:is.cursor(s.head,s.head>s.anchor?-1:1);for(let s of Bc.forRange(t,e,i))n.push(s)}}return n},update(t,e){t.transactions.some(t=>t.selection)&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let i=Yc(t);return i&&Gc(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){Gc(e.state,t)},class:"cm-cursorLayer"});function Gc(t,e){e.style.animationDuration=t.facet(Hc).cursorBlinkRate+"ms"}const Kc=qc({above:!1,markers:t=>t.state.selection.ranges.map(e=>e.empty?[]:Bc.forRange(t,"cm-selectionBackground",e)).reduce((t,e)=>t.concat(e)),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||Yc(t),class:"cm-selectionLayer"}),Jc=ys.highest($c.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),th=Rs.define({map:(t,e)=>null==t?null:e.mapPos(t)}),eh=ds.define({create:()=>null,update:(t,e)=>(null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce((t,e)=>e.is(th)?e.value:t,t))}),ih=ka.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(eh);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(eh)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(eh),i=null!=e&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(eh)!=t&&this.view.dispatch({effects:th.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function nh(t,e,i,n,s){e.lastIndex=0;for(let o,r=t.iterRange(i,n),a=i;!r.next().done;a+=r.value.length)if(!r.lineBreak)for(;o=e.exec(r.value);)s(a+o.index,o)}class sh{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:s,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(t,e,i,s)=>n(s,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,n,s)=>{let o=i(t,e,n);o&&s(n,n+t[0].length,o)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,n,s)=>s(n,n+t[0].length,i)}this.boundary=s,this.maxLength=o}createDeco(t){let e=new to,i=e.add.bind(e);for(let{from:e,to:n}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:s,to:o}of i)s=Math.max(t.state.doc.lineAt(s).from,s-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=o:n.push({from:s,to:o});return n}(t,this.maxLength))nh(t.state.doc,this.regexp,e,n,(e,n)=>this.addMatch(n,t,e,i));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges((e,s,o,r)=>{r>=t.view.viewport.from&&o<=t.view.viewport.to&&(i=Math.min(o,i),n=Math.max(r,n))}),t.viewportMoved||n-i>1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let s of t.visibleRanges){let o=Math.max(s.from,i),r=Math.min(s.to,n);if(r>=o){let i=t.state.doc.lineAt(o),n=i.to<r?t.state.doc.lineAt(r):i,a=Math.max(s.from,i.from),l=Math.min(s.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(;r<n.to;r++)if(this.boundary.test(n.text[r-n.from])){l=r;break}}let c,h=[],u=(t,e,i)=>h.push(i.range(t,e));if(i==n)for(this.regexp.lastIndex=a-i.from;(c=this.regexp.exec(i.text))&&c.index<l-i.from;)this.addMatch(c,t,c.index+i.from,u);else nh(t.state.doc,this.regexp,a,l,(e,i)=>this.addMatch(i,t,e,u));e=e.update({filterFrom:a,filterTo:l,filter:(t,e)=>t<a||e>l,add:h})}}return e}}const oh=null!=/x/.unicode?"gu":"g",rh=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",oh),ah={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 lh=null;const ch=os.define({combine(t){let e=Vs(t,{render:null,specialChars:rh,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==lh&&"undefined"!=typeof document&&document.body){let e=document.body.style;lh=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return lh||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,oh)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,oh)),e}});function hh(t={}){return[ch.of(t),uh||(uh=ka.fromClass(class{constructor(t){this.view=t,this.decorations=Cr.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(ch)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new sh({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:s}=i.state,o=Zn(e[0],0);if(9==o){let t=s.lineAt(n),e=i.state.tabSize,o=uo(t.text,e,n-t.from);return Cr.replace({widget:new fh((e-o%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Cr.replace({widget:new dh(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(ch);t.startState.facet(ch)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let uh=null;class dh extends $r{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),i=t.state.phrase("Control character")+" "+(ah[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let s=document.createElement("span");return s.textContent=e,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class fh extends $r{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const ph=Cr.line({class:"cm-activeLine"}),mh=ka.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let s=t.lineBlockAt(n.head);s.from>e&&(i.push(ph.range(s.from)),e=s.from)}return Cr.set(i)}},{decorations:t=>t.decorations});const gh=2e3;function vh(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),s=i-n.from,o=s>gh?-1:s==n.length?function(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}(t,e.clientX):uo(n.text,t.state.tabSize,i-n.from);return{line:n.number,col:o,off:s}}function yh(t,e){let i=vh(t,e),n=t.state.selection;return i?{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(i.line).from),s=t.state.doc.lineAt(e);i={line:s.number,col:i.col,off:Math.min(i.off,s.length)},n=n.map(t.changes)}},get(e,s,o){let r=vh(t,e);if(!r)return n;let a=function(t,e,i){let n=Math.min(e.line,i.line),s=Math.max(e.line,i.line),o=[];if(e.off>gh||i.off>gh||e.col<0||i.col<0){let r=Math.min(e.off,i.off),a=Math.max(e.off,i.off);for(let e=n;e<=s;e++){let i=t.doc.line(e);i.length<=a&&o.push(is.range(i.from+r,i.to+a))}}else{let r=Math.min(e.col,i.col),a=Math.max(e.col,i.col);for(let e=n;e<=s;e++){let i=t.doc.line(e),n=fo(i.text,r,t.tabSize,!0);if(n<0)o.push(is.cursor(i.to));else{let e=fo(i.text,a,t.tabSize);o.push(is.range(i.from+n,i.from+e))}}}return o}(t.state,i,r);return a.length?o?is.create(a.concat(n.ranges)):is.create(a):n}}:null}function Oh(t){let e=(null==t?void 0:t.eventFilter)||(t=>t.altKey&&0==t.button);return $c.mouseSelectionStyle.of((t,i)=>e(i)?yh(t,i):null)}const bh={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},xh={style:"cursor: crosshair"};function wh(t={}){let[e,i]=bh[t.key||"Alt"],n=ka.fromClass(class{constructor(t){this.view=t,this.isDown=!1}set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]))}},{eventObservers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){t.keyCode!=e&&i(t)||this.set(!1)},mousemove(t){this.set(i(t))}}});return[n,$c.contentAttributes.of(t=>{var e;return(null===(e=t.plugin(n))||void 0===e?void 0:e.isDown)?xh:null})]}const _h="-10000px";class Sh{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter(t=>t);let s=null;this.tooltipViews=this.tooltips.map(t=>s=i(t,s))}update(t,e){var i;let n=t.state.facet(this.facet),s=n.filter(t=>t);if(n===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let o=[],r=e?[]:null;for(let i=0;i<s.length;i++){let n=s[i],a=-1;if(n){for(let t=0;t<this.tooltips.length;t++){let e=this.tooltips[t];e&&e.create==n.create&&(a=t)}if(a<0)o[i]=this.createTooltipView(n,i?o[i-1]:null),r&&(r[i]=!!n.above);else{let n=o[i]=this.tooltipViews[a];r&&(r[i]=e[a]),n.update&&n.update(t)}}}for(let t of this.tooltipViews)o.indexOf(t)<0&&(this.removeTooltipView(t),null===(i=t.destroy)||void 0===i||i.call(t));return e&&(r.forEach((t,i)=>e[i]=t),e.length=r.length),this.input=n,this.tooltips=s,this.tooltipViews=o,!0}}function kh(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const $h=os.define({combine:t=>{var e,i,n;return{position:dr.ios?"absolute":(null===(e=t.find(t=>t.position))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(t=>t.parent))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=t.find(t=>t.tooltipSpace))||void 0===n?void 0:n.tooltipSpace)||kh}}}),Th=new WeakMap,Ch=ka.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet($h);this.position=e.position,this.parent=e.parent,this.classes=t.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 Sh(t,Mh,(t,e)=>this.createTooltip(t,e),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.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 t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet($h);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let t of this.manager.tooltipViews)t.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 t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",i.dom.appendChild(t)}return i.dom.style.position=this.position,i.dom.style.top=_h,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 t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(dr.gecko)i=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==_h&&"0px"==t.style.left){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(i||"absolute"==this.position)if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(t=i.width/this.parent.offsetWidth,e=i.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),s=Ra(this.view);return{visible:{left:n.left+s.left,top:n.top+s.top,right:n.right-s.right,bottom:n.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)}),size:this.manager.tooltipViews.map(({dom:t})=>t.getBoundingClientRect()),space:this.view.state.facet($h).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:i,space:n,scaleX:s,scaleY:o}=t,r=[];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=t.pos[a],d=t.size[a];if(!u||!1!==l.clip&&(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=_h;continue}let f=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,m=d.right-d.left,g=null!==(e=Th.get(c))&&void 0!==e?e:d.bottom-d.top,v=c.offset||Ah,y=this.view.textDirection==zr.LTR,O=d.width>n.right-n.left?y?n.left:n.right-d.width:y?Math.max(n.left,Math.min(u.left-(f?14:0)+v.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-v.x),n.right-m),b=this.above[a];!l.strictSide&&(b?u.top-g-p-v.y<n.top:u.bottom+g+p+v.y>n.bottom)&&b==n.bottom-u.bottom>u.top-n.top&&(b=this.above[a]=!b);let x=(b?u.top-n.top:n.bottom-u.bottom)-p;if(x<g&&!1!==c.resize){if(x<this.view.defaultLineHeight){h.style.top=_h;continue}Th.set(c,g),h.style.height=(g=x)/o+"px"}else h.style.height&&(h.style.height="");let w=b?u.top-g-p-v.y:u.bottom+p+v.y,_=O+m;if(!0!==c.overlap)for(let t of r)t.left<_&&t.right>O&&t.top<w+g&&t.bottom>w&&(w=b?t.top-g-2-p:t.bottom+p+2);if("absolute"==this.position?(h.style.top=(w-t.parent.top)/o+"px",Ph(h,(O-t.parent.left)/s)):(h.style.top=w/o+"px",Ph(h,O/s)),f){let t=u.left+(y?v.x:-v.x)-(O+14-7);f.style.left=t/s+"px"}!0!==c.overlap&&r.push({left:O,top:w,right:_,bottom:w+g}),h.classList.toggle("cm-tooltip-above",b),h.classList.toggle("cm-tooltip-below",!b),c.positioned&&c.positioned(t.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 t of this.manager.tooltipViews)t.dom.style.top=_h}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Ph(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const Eh=$c.baseTheme({".cm-tooltip":{zIndex:500,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"}}}),Ah={x:0,y:0},Mh=os.define({enables:[Ch,Eh]}),Qh=os.define({combine:t=>t.reduce((t,e)=>t.concat(e),[])});class Dh{static create(t){return new Dh(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Sh(t,Qh,(t,e)=>this.createHostedView(t,e),t=>t.dom.remove())}createHostedView(t,e){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)null===(t=e.destroy)||void 0===t||t.call(e)}passProp(t){let e;for(let i of this.manager.tooltipViews){let n=i[t];if(void 0!==n)if(void 0===e)e=n;else if(e!==n)return}return e}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 Rh=Mh.compute([Qh],t=>{let e=t.facet(Qh);return 0===e.length?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var e;return null!==(e=t.end)&&void 0!==e?e:t.pos})),create:Dh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class Ih{constructor(t,e,i,n,s){this.view=t,this.source=e,this.field=i,this.setHover=n,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.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 t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:e}=this,i=t.docView.nearest(e.target);if(!i)return;let n,s=1;if(i instanceof mr)n=i.posAtStart;else{if(n=t.posAtCoords(e),null==n)return;let i=t.coordsAtPos(n);if(!i||e.y<i.top||e.y>i.bottom||e.x<i.left-t.defaultCharacterWidth||e.x>i.right+t.defaultCharacterWidth)return;let o=t.bidiSpans(t.state.doc.lineAt(n)).find(t=>t.from<=n&&t.to>=n),r=o&&o.dir==zr.RTL?-1:1;s=e.x<i.left?-r:r}let o=this.source(t,n,s);if(null==o?void 0:o.then){let e=this.pending={pos:n};o.then(i=>{this.pending==e&&(this.pending=null,!i||Array.isArray(i)&&!i.length||t.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])}))},e=>xa(t.state,e,"hover tooltip"))}else!o||Array.isArray(o)&&!o.length||t.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let t=this.view.plugin(Ch),e=t?t.manager.tooltips.findIndex(t=>t.create==Dh.create):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:s}=this;if(n.length&&s&&!function(t,e){let i,{left:n,right:s,top:o,bottom:r}=t.getBoundingClientRect();if(i=t.querySelector(".cm-tooltip-arrow")){let t=i.getBoundingClientRect();o=Math.min(t.top,o),r=Math.max(t.bottom,r)}return e.clientX>=n-Lh&&e.clientX<=s+Lh&&e.clientY>=o-Lh&&e.clientY<=r+Lh}(s.dom,t)||this.pending){let{pos:s}=n[0]||this.pending,o=null!==(i=null===(e=n[0])||void 0===e?void 0:e.end)&&void 0!==i?i:s;(s==o?this.view.posAtCoords(this.lastMove)==s:function(t,e,i,n,s){let o=t.scrollDOM.getBoundingClientRect(),r=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.right<n||o.top>s||Math.min(o.bottom,r)<s)return!1;let a=t.posAtCoords({x:n,y:s},!1);return a>=e&&a<=i}(this.view,s,o,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:e}=this;e&&e.dom.contains(t.relatedTarget)?this.watchTooltipLeave(e.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=i=>{t.removeEventListener("mouseleave",e),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Lh=4;function Nh(t,e={}){let i=Rs.define(),n=ds.define({create:()=>[],update(t,n){if(t.length&&(e.hideOnChange&&(n.docChanged||n.selection)?t=[]:e.hideOn&&(t=t.filter(t=>!e.hideOn(n,t))),n.docChanged)){let e=[];for(let i of t){let t=n.changes.mapPos(i.pos,-1,qn.TrackDel);if(null!=t){let s=Object.assign(Object.create(null),i);s.pos=t,null!=s.end&&(s.end=n.changes.mapPos(s.end)),e.push(s)}}t=e}for(let e of n.effects)e.is(i)&&(t=e.value),e.is(zh)&&(t=[]);return t},provide:t=>Qh.from(t)});return{active:n,extension:[n,ka.define(s=>new Ih(s,t,n,i,e.hoverTime||300)),Rh]}}function jh(t,e){let i=t.plugin(Ch);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const zh=Rs.define();const Bh=os.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function Zh(t,e){let i=t.plugin(Wh),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const Wh=ka.fromClass(class{constructor(t){this.input=t.state.facet(qh),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(e=>e(t));let e=t.state.facet(Bh);this.top=new Fh(t,!0,e.topContainer),this.bottom=new Fh(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(Bh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Fh(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Fh(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(qh);if(i!=this.input){let e=i.filter(t=>t),n=[],s=[],o=[],r=[];for(let i of e){let e,a=this.specs.indexOf(i);a<0?(e=i(t.view),r.push(e)):(e=this.panels[a],e.update&&e.update(t)),n.push(e),(e.top?s:o).push(e)}this.specs=e,this.panels=n,this.top.sync(s),this.bottom.sync(o);for(let t of r)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>$c.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class Fh{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,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 t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Xh(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Xh(t)}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 t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Xh(t){let e=t.nextSibling;return t.remove(),e}const qh=os.define({enables:Wh});class Hh extends Ys{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Hh.prototype.elementClass="",Hh.prototype.toDOM=void 0,Hh.prototype.mapMode=qn.TrackBefore,Hh.prototype.startSide=Hh.prototype.endSide=-1,Hh.prototype.point=!0;const Vh=os.define(),Yh=os.define(),Uh={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Js.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Gh=os.define();function Kh(t){return[tu(),Gh.of({...Uh,...t})]}const Jh=os.define({combine:t=>t.some(t=>t)});function tu(t){let e=[eu];return t&&!1===t.fixed&&e.push(Jh.of(!0)),e}const eu=ka.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Gh).map(e=>new ou(t,e)),this.fixed=!t.state.facet(Jh);for(let t of this.gutters)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}if(t.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(Jh)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let i=Js.iter(this.view.state.facet(Vh),this.view.viewport.from),n=[],s=this.gutters.map(t=>new su(t,this.view.viewport,-this.view.documentPadding.top));for(let t of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(t.type)){let e=!0;for(let o of t.type)if(o.type==Tr.Text&&e){nu(i,n,o.from);for(let t of s)t.line(this.view,o,n);e=!1}else if(o.widget)for(let t of s)t.widget(this.view,o)}else if(t.type==Tr.Text){nu(i,n,t.from);for(let e of s)e.line(this.view,t,n)}else if(t.widget)for(let e of s)e.widget(this.view,t);for(let t of s)t.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Gh),i=t.state.facet(Gh),n=t.docChanged||t.heightChanged||t.viewportChanged||!Js.eq(t.startState.facet(Vh),t.state.facet(Vh),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(n=!0);else{n=!0;let s=[];for(let n of i){let i=e.indexOf(n);i<0?s.push(new ou(this.view,n)):(this.gutters[i].update(t),s.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),s.indexOf(t)<0&&t.destroy();for(let t of s)"after"==t.config.side?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.gutters=s}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>$c.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||0==i.gutters.length||!i.fixed)return null;let n=i.dom.offsetWidth*e.scaleX,s=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==zr.LTR?{left:n,right:s}:{right:n,left:s}})});function iu(t){return Array.isArray(t)?t:[t]}function nu(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class su{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=Js.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,s=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==n.elements.length){let e=new ru(t,o,s,i);n.elements.push(e),n.dom.appendChild(e.dom)}else n.elements[this.i].update(t,o,s,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];nu(this.cursor,n,e.from),i.length&&(n=n.concat(i));let s=this.gutter.config.lineMarker(t,e,n);s&&n.unshift(s);let o=this.gutter;(0!=n.length||o.config.renderEmptyElements)&&this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),n=i?[i]:null;for(let i of t.state.facet(Yh)){let s=i(t,e.widget,e);s&&(n||(n=[])).push(s)}n&&this.addElement(t,e,n)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class ou{constructor(t,e){this.view=t,this.config=e,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 e.domEventHandlers)this.dom.addEventListener(i,n=>{let s,o=n.target;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let t=o.getBoundingClientRect();s=(t.top+t.bottom)/2}else s=n.clientY;let r=t.lineBlockAtHeight(s-t.documentTop);e.domEventHandlers[i](t,r,n)&&n.preventDefault()});this.markers=iu(e.markers(t)),e.initialSpacer&&(this.spacer=new ru(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=iu(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!Js.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class ru{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].compare(e[i]))return!1;return!0}(this.markers,n)||this.setMarkers(t,n)}setMarkers(t,e){let i="cm-gutterElement",n=this.dom.firstChild;for(let s=0,o=0;;){let r=o,a=s<e.length?e[s++]:null,l=!1;if(a){let t=a.elementClass;t&&(i+=" "+t);for(let t=o;t<this.markers.length;t++)if(this.markers[t].compare(a)){r=t,l=!0;break}}else r=this.markers.length;for(;o<r;){let t=this.markers[o++];if(t.toDOM){t.destroy(n);let e=n.nextSibling;n.remove(),n=e}}if(!a)break;a.toDOM&&(l?n=n.nextSibling:this.dom.insertBefore(a.toDOM(t),n)),l&&o++}this.dom.className=i,this.markers=e}destroy(){this.setMarkers(null,[])}}const au=os.define(),lu=os.define(),cu=os.define({combine:t=>Vs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let n=i[t],s=e[t];i[t]=n?(t,e,i)=>n(t,e,i)||s(t,e,i):s}return i}})});class hu extends Hh{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function uu(t,e){return t.state.facet(cu).formatNumber(e,t.state)}const du=Gh.compute([cu],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(au),lineMarker:(t,e,i)=>i.some(t=>t.toDOM)?null:new hu(uu(t,t.state.doc.lineAt(e.from).number)),widgetMarker:(t,e,i)=>{for(let n of t.state.facet(lu)){let s=n(t,e,i);if(s)return s}return null},lineMarkerChange:t=>t.startState.facet(cu)!=t.state.facet(cu),initialSpacer:t=>new hu(uu(t,pu(t.state.doc.lines))),updateSpacer(t,e){let i=uu(e.view,pu(e.view.state.doc.lines));return i==t.number?t:new hu(i)},domEventHandlers:t.facet(cu).domEventHandlers,side:"before"}));function fu(t={}){return[cu.of(t),tu(),du]}function pu(t){let e=9;for(;e<t;)e=10*e+9;return e}const mu=new class extends Hh{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},gu=Vh.compute(["selection"],t=>{let e=[],i=-1;for(let n of t.selection.ranges){let s=t.doc.lineAt(n.head).from;s>i&&(i=s,e.push(mu.range(s)))}return Js.of(e)});const vu=1024;let yu=0;class Ou{constructor(t,e){this.from=t,this.to=e}}class bu{constructor(t={}){this.id=yu++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=_u.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}bu.closedBy=new bu({deserialize:t=>t.split(" ")}),bu.openedBy=new bu({deserialize:t=>t.split(" ")}),bu.group=new bu({deserialize:t=>t.split(" ")}),bu.isolate=new bu({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),bu.contextHash=new bu({perNode:!0}),bu.lookAhead=new bu({perNode:!0}),bu.mounted=new bu({perNode:!0});class xu{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[bu.mounted.id]}}const wu=Object.create(null);class _u{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):wu,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new _u(t.name||"",e,t.id,i);if(t.props)for(let i of t.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");e[i[0].id]=i[1]}return n}prop(t){return this.props[t.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(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(bu.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return t=>{for(let i=t.prop(bu.group),n=-1;n<(i?i.length:0);n++){let s=e[n<0?t.name:i[n]];if(s)return s}}}}_u.none=new _u("",Object.create(null),0,8);class Su{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let n=null;for(let e of t){let t=e(i);t&&(n||(n=Object.assign({},i.props)),n[t[0].id]=t[1])}e.push(n?new _u(i.name,n,i.id,i.flags):i)}return new Su(e)}}const ku=new WeakMap,$u=new WeakMap;var Tu;!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"}(Tu||(Tu={}));class Cu{constructor(t,e,i,n,s){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,s&&s.length){this.props=Object.create(null);for(let[t,e]of s)this.props["number"==typeof t?t:t.id]=e}}toString(){let t=xu.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let t of this.children){let i=t.toString();i&&(e&&(e+=","),e+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Bu(this.topNode,t)}cursorAt(t,e=0,i=0){let n=ku.get(this)||this.topNode,s=new Bu(n);return s.moveTo(t,e),ku.set(this,s._tree),s}get topNode(){return new Du(this,0,0,null)}resolve(t,e=0){let i=Mu(ku.get(this)||this.topNode,t,e,!1);return ku.set(this,i),i}resolveInner(t,e=0){let i=Mu($u.get(this)||this.topNode,t,e,!0);return $u.set(this,i),i}resolveStack(t,e=0){return function(t,e,i){let n=t.resolveInner(e,i),s=null;for(let t=n instanceof Du?n:n.context.parent;t;t=t.parent)if(t.index<0){let o=t.parent;(s||(s=[n])).push(o.resolve(e,i)),t=o}else{let o=xu.get(t.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let r=new Du(o.tree,o.overlay[0].from+t.from,-1,t);(s||(s=[n])).push(Mu(r,e,i,!1))}}return s?ju(s):n}(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:s=this.length}=t,o=t.mode||0,r=(o&Tu.IncludeAnonymous)>0;for(let t=this.cursor(o|Tu.IncludeAnonymous);;){let o=!1;if(t.from<=s&&t.to>=n&&(!r&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;o=!0}for(;o&&i&&(r||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;o=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Xu(_u.none,this.children,this.positions,0,this.children.length,0,this.length,(t,e,i)=>new Cu(this.type,t,e,i,this.propValues),t.makeTree||((t,e,i)=>new Cu(_u.none,t,e,i)))}static build(t){return function(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:s=vu,reused:o=[],minRepeatType:r=n.types.length}=t,a=Array.isArray(i)?new Pu(i,i.length):i,l=n.types,c=0,h=0;function u(t,e,i,y,O,b){let{id:x,start:w,end:_,size:S}=a,k=h,$=c;for(;S<0;){if(a.next(),-1==S){let e=o[x];return i.push(e),void y.push(w-t)}if(-3==S)return void(c=x);if(-4==S)return void(h=x);throw new RangeError(`Unrecognized record size: ${S}`)}let T,C,P=l[x],E=w-t;if(_-w<=s&&(C=g(a.pos-e,O))){let e=new Uint16Array(C.size-C.skip),i=a.pos-C.size,s=e.length;for(;a.pos>i;)s=v(C.start,e,s);T=new Eu(e,_-C.start,n),E=C.start-t}else{let t=a.pos-S;a.next();let e=[],i=[],n=x>=r?x:-1,o=0,l=_;for(;a.pos>t;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-s&&(p(e,i,w,o,a.end,l,n,k,$),o=e.length,l=a.end),a.next()):b>2500?d(w,t,e,i):u(w,t,e,i,n,b+1);if(n>=0&&o>0&&o<e.length&&p(e,i,w,o,w,l,n,k,$),e.reverse(),i.reverse(),n>-1&&o>0){let t=f(P,$);T=Xu(P,e,i,0,e.length,0,_-w,t,t)}else T=m(P,e,i,_-w,k-_,$)}i.push(T),y.push(E)}function d(t,e,i,o){let r=[],l=0,c=-1;for(;a.pos>e;){let{id:t,start:e,end:i,size:n}=a;if(n>4)a.next();else{if(c>-1&&e<c)break;c<0&&(c=i-s),r.push(t,e,i),l++,a.next()}}if(l){let e=new Uint16Array(4*l),s=r[r.length-2];for(let t=r.length-3,i=0;t>=0;t-=3)e[i++]=r[t],e[i++]=r[t+1]-s,e[i++]=r[t+2]-s,e[i++]=i;i.push(new Eu(e,r[2]-s,n)),o.push(s-t)}}function f(t,e){return(i,n,s)=>{let o,r,a=0,l=i.length-1;if(l>=0&&(o=i[l])instanceof Cu){if(!l&&o.type==t&&o.length==s)return o;(r=o.prop(bu.lookAhead))&&(a=n[l]+o.length+r)}return m(t,i,n,s,a,e)}}function p(t,e,i,s,o,r,a,l,c){let h=[],u=[];for(;t.length>s;)h.push(t.pop()),u.push(e.pop()+i-o);t.push(m(n.types[a],h,u,r-o,l-r,c)),e.push(o-i)}function m(t,e,i,n,s,o,r){if(o){let t=[bu.contextHash,o];r=r?[t].concat(r):[t]}if(s>25){let t=[bu.lookAhead,s];r=r?[t].concat(r):[t]}return new Cu(t,e,i,n,r)}function g(t,e){let i=a.fork(),n=0,o=0,l=0,c=i.end-s,h={size:0,start:0,skip:0};t:for(let s=i.pos-t;i.pos>s;){let t=i.size;if(i.id==e&&t>=0){h.size=n,h.start=o,h.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-t;if(t<0||a<s||i.start<c)break;let u=i.id>=r?4:0,d=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break t;u+=4}else i.id>=r&&(u+=4);i.next()}o=d,n+=t,l+=u}return(e<0||n==t)&&(h.size=n,h.start=o,h.skip=l),h.size>4?h:void 0}function v(t,e,i){let{id:n,start:s,end:o,size:l}=a;if(a.next(),l>=0&&n<r){let r=i;if(l>4){let n=a.pos-(l-4);for(;a.pos>n;)i=v(t,e,i)}e[--i]=r,e[--i]=o-t,e[--i]=s-t,e[--i]=n}else-3==l?c=n:-4==l&&(h=n);return i}let y=[],O=[];for(;a.pos>0;)u(t.start||0,t.bufferStart||0,y,O,-1,0);let b=null!==(e=t.length)&&void 0!==e?e:y.length?O[0]+y[0].length:0;return new Cu(l[t.topID],y.reverse(),O.reverse(),b)}(t)}}Cu.empty=new Cu(_u.none,[],[],0);class Pu{constructor(t,e){this.buffer=t,this.index=e}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 Pu(this.buffer,this.index)}}class Eu{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return _u.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],n=this.set.types[e],s=n.name;if(/\W/.test(s)&&!n.isError&&(s=JSON.stringify(s)),i==(t+=4))return s;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return s+"("+o.join(",")+")"}findChild(t,e,i,n,s){let{buffer:o}=this,r=-1;for(let a=t;a!=e&&!(Au(s,n,o[a+1],o[a+2])&&(r=a,i>0));a=o[a+3]);return r}slice(t,e,i){let n=this.buffer,s=new Uint16Array(e-t),o=0;for(let r=t,a=0;r<e;){s[a++]=n[r++],s[a++]=n[r++]-i;let e=s[a++]=n[r++]-i;s[a++]=n[r++]-t,o=Math.max(o,e)}return new Eu(s,o,this.set)}}function Au(t,e,i,n){switch(t){case-2:return i<e;case-1:return n>=e&&i<e;case 0:return i<e&&n>e;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function Mu(t,e,i,n){for(var s;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let e=!n&&t instanceof Du&&t.index<0?null:t.parent;if(!e)return t;t=e}let o=n?0:Tu.IgnoreOverlays;if(n)for(let n=t,r=n.parent;r;n=r,r=n.parent)n instanceof Du&&n.index<0&&(null===(s=r.enter(e,i,o))||void 0===s?void 0:s.from)!=n.from&&(t=r);for(;;){let n=t.enter(e,i,o);if(!n)return t;t=n}}class Qu{cursor(t=0){return new Bu(this,t)}getChild(t,e=null,i=null){let n=Ru(this,t,e,i);return n.length?n[0]:null}getChildren(t,e=null,i=null){return Ru(this,t,e,i)}resolve(t,e=0){return Mu(this,t,e,!1)}resolveInner(t,e=0){return Mu(this,t,e,!0)}matchContext(t){return Iu(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let t=e.lastChild;if(!t||t.to!=e.to)break;t.type.isError&&t.from==t.to?(i=e,e=t.prevSibling):e=t}return i}get node(){return this}get next(){return this.parent}}class Du extends Qu{constructor(t,e,i,n){super(),this._tree=t,this.from=e,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(t,e,i,n,s=0){for(let o=this;;){for(let{children:r,positions:a}=o._tree,l=e>0?r.length:-1;t!=l;t+=e){let l=r[t],c=a[t]+o.from;if(Au(n,i,c,c+l.length))if(l instanceof Eu){if(s&Tu.ExcludeBuffers)continue;let r=l.findChild(0,l.buffer.length,e,i-c,n);if(r>-1)return new Nu(new Lu(o,l,t,c),null,r)}else if(s&Tu.IncludeAnonymous||!l.type.isAnonymous||Zu(l)){let r;if(!(s&Tu.IgnoreMounts)&&(r=xu.get(l))&&!r.overlay)return new Du(r.tree,c,t,o);let a=new Du(l,c,t,o);return s&Tu.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(e<0?l.children.length-1:0,e,i,n)}}if(s&Tu.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&Tu.IgnoreOverlays)&&(n=xu.get(this._tree))&&n.overlay){let i=t-this.from;for(let{from:t,to:s}of n.overlay)if((e>0?t<=i:t<i)&&(e<0?s>=i:s>i))return new Du(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 Ru(t,e,i,n){let s=t.cursor(),o=[];if(!s.firstChild())return o;if(null!=i)for(let t=!1;!t;)if(t=s.type.is(i),!s.nextSibling())return o;for(;;){if(null!=n&&s.type.is(n))return o;if(s.type.is(e)&&o.push(s.node),!s.nextSibling())return null==n?o:[]}}function Iu(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class Lu{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Nu extends Qu{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(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return s<0?null:new Nu(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Tu.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return s<0?null:new Nu(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Nu(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Nu(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,s=i.buffer[this.index+3];if(s>n){let o=i.buffer[this.index+1];t.push(i.slice(n,s,o)),e.push(0)}return new Cu(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ju(t){if(!t.length)return null;let e=0,i=t[0];for(let n=1;n<t.length;n++){let s=t[n];(s.from>i.from||s.to<i.to)&&(i=s,e=n)}let n=i instanceof Du&&i.index<0?null:i.parent,s=t.slice();return n?s[e]=n:s.splice(e,1),new zu(s,i)}class zu{constructor(t,e){this.heads=t,this.node=e}get next(){return ju(this.heads)}}class Bu{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof Du)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let e=t._parent;e;e=e._parent)this.stack.unshift(e.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0)}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return!!t&&(t instanceof Du?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,s=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);return!(s<0)&&(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?!(i&Tu.ExcludeBuffers)&&this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Tu.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Tu.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let t=i<0?0:this.stack[i]+4;if(this.index!=t)return this.yieldBuf(e.findChild(t,this.index,-1,0,4))}else{let t=e.buffer[this.index+3];if(t<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(t)}return i<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let t=0;t<this.index;t++)if(n.buffer.buffer[t+3]<this.index)return!1;({index:e,parent:i}=n)}else({index:e,_parent:i}=this._tree);for(;i;({index:e,_parent:i}=i))if(e>-1)for(let n=e+t,s=t<0?-1:i._tree.children.length;n!=s;n+=t){let t=i._tree.children[n];if(this.mode&Tu.IncludeAnonymous||t instanceof Eu||!t.type.isAnonymous||Zu(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let n=this.index,s=this.stack.length;s>=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=s+1;break t}n=this.stack[--s]}for(let t=i;t<this.stack.length;t++)e=new Nu(this.buffer,e,this.stack[t]);return this.bufferNode=new Nu(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let n=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&e&&e(this),n=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,n=!0}}}matchContext(t){if(!this.buffer)return Iu(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let n=t.length-1,s=this.stack.length-1;n>=0;s--){if(s<0)return Iu(this._tree,t,n);let o=i[e.buffer[this.stack[s]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function Zu(t){return t.children.some(t=>t instanceof Eu||!t.type.isAnonymous||Zu(t))}const Wu=new WeakMap;function Fu(t,e){if(!t.isAnonymous||e instanceof Eu||e.type!=t)return 1;let i=Wu.get(e);if(null==i){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof Cu)){i=1;break}i+=Fu(t,n)}Wu.set(e,i)}return i}function Xu(t,e,i,n,s,o,r,a,l){let c=0;for(let i=n;i<s;i++)c+=Fu(t,e[i]);let h=Math.ceil(1.5*c/8),u=[],d=[];return function e(i,n,s,r,a){for(let c=s;c<r;){let s=c,f=n[c],p=Fu(t,i[c]);for(c++;c<r;c++){let e=Fu(t,i[c]);if(p+e>=h)break;p+=e}if(c==s+1){if(p>h){let t=i[s];e(t.children,t.positions,0,t.children.length,n[s]+a);continue}u.push(i[s])}else{let e=n[c-1]+i[c-1].length-f;u.push(Xu(t,i,n,s,c,f,e,null,l))}d.push(f+a-o)}}(e,i,n,s,0),(a||l)(u,d,r)}class qu{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Nu?this.setBuffer(t.context.buffer,t.index,e):t instanceof Du&&this.map.set(t.tree,e)}get(t){return t instanceof Nu?this.getBuffer(t.context.buffer,t.index):t instanceof Du?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class Hu{constructor(t,e,i,n,s=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(s?1:0)|(o?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let n=[new Hu(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&n.push(i);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],s=1,o=t.length?t[0]:null;for(let r=0,a=0,l=0;;r++){let c=r<e.length?e[r]:null,h=c?c.fromA:1e9;if(h-a>=i)for(;o&&o.from<h;){let e=o;if(a>=e.from||h<=e.to||l){let t=Math.max(e.from,a)-l,i=Math.min(e.to,h)-l;e=t>=i?null:new Hu(t,i,e.tree,e.offset+l,r>0,!!c)}if(e&&n.push(e),o.to>h)break;o=s<t.length?t[s++]:null}if(!c)break;a=c.toA,l=c.toA-c.toB}return n}}class Vu{startParse(t,e,i){return"string"==typeof t&&(t=new Yu(t)),i=i?i.length?i.map(t=>new Ou(t.from,t.to)):[new Ou(0,0)]:[new Ou(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let t=n.advance();if(t)return t}}}class Yu{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new bu({perNode:!0});let Uu=0;class Gu{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=Uu++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof Gu&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let n=new Gu(i,[],null,[]);if(n.set.push(n),e)for(let t of e.set)n.set.push(t);return n}static defineModifier(t){let e=new Ju(t);return t=>t.modified.indexOf(e)>-1?t:Ju.get(t.base||t,t.modified.concat(e).sort((t,e)=>t.id-e.id))}}let Ku=0;class Ju{constructor(t){this.name=t,this.instances=[],this.id=Ku++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(i=>{return i.base==t&&(n=e,s=i.modified,n.length==s.length&&n.every((t,e)=>t==s[e]));var n,s});if(i)return i;let n=[],s=new Gu(t.name,n,t,e);for(let t of e)t.instances.push(s);let o=function(t){let e=[[]];for(let i=0;i<t.length;i++)for(let n=0,s=e.length;n<s;n++)e.push(e[n].concat(t[i]));return e.sort((t,e)=>e.length-t.length)}(e);for(let e of t.set)if(!e.modified.length)for(let t of o)n.push(Ju.get(e,t));return s}}function td(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let t of i.split(" "))if(t){let i=[],s=2,o=t;for(let e=0;;){if("..."==o&&e>0&&e+3==t.length){s=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!n)throw new RangeError("Invalid path: "+t);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let r=t[e++];if(e==t.length&&"!"==r){s=0;break}if("/"!=r)throw new RangeError("Invalid path: "+t);o=t.slice(e)}let r=i.length-1,a=i[r];if(!a)throw new RangeError("Invalid path: "+t);let l=new id(n,s,r>0?i.slice(0,r):null);e[a]=l.sort(e[a])}}return ed.add(e)}const ed=new bu;class id{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function nd(t,e){let i=Object.create(null);for(let e of t)if(Array.isArray(e.tag))for(let t of e.tag)i[t.id]=e.class;else i[e.tag.id]=e.class;let{scope:n,all:s=null}=e||{};return{style:t=>{let e=s;for(let n of t)for(let t of n.set){let n=i[t.id];if(n){e=e?e+" "+n:n;break}}return e},scope:n}}function sd(t,e,i,n=0,s=t.length){let o=new od(n,Array.isArray(e)?e:[e],i);o.highlightRange(t.cursor(),n,s,"",o.highlighters),o.flush(s)}id.empty=new id([],2,null);class od{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,s){let{type:o,from:r,to:a}=t;if(r>=i||a<=e)return;o.isTop&&(s=this.highlighters.filter(t=>!t.scope||t.scope(o)));let l=n,c=function(t){let e=t.type.prop(ed);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||id.empty,h=function(t,e){let i=null;for(let n of t){let t=n.style(e);t&&(i=i?i+" "+t:t)}return i}(s,c.tags);if(h&&(l&&(l+=" "),l+=h,1==c.mode&&(n+=(n?" ":"")+h)),this.startSpan(Math.max(e,r),l),c.opaque)return;let u=t.tree&&t.tree.prop(bu.mounted);if(u&&u.overlay){let o=t.node.enter(u.overlay[0].from+r,1),c=this.highlighters.filter(t=>!t.scope||t.scope(u.tree.type)),h=t.firstChild();for(let d=0,f=r;;d++){let p=d<u.overlay.length?u.overlay[d]:null,m=p?p.from+r:a,g=Math.max(e,f),v=Math.min(i,m);if(g<v&&h)for(;t.from<v&&(this.highlightRange(t,g,v,n,s),this.startSpan(Math.min(v,t.to),l),!(t.to>=m)&&t.nextSibling()););if(!p||m>i)break;f=p.to+r,f>e&&(this.highlightRange(o.cursor(),Math.max(e,p.from+r),Math.min(i,f),"",c),this.startSpan(Math.min(i,f),l))}h&&t.parent()}else if(t.firstChild()){u&&(n="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,s),this.startSpan(Math.min(i,t.to),l)}}while(t.nextSibling());t.parent()}}}const rd=Gu.define,ad=rd(),ld=rd(),cd=rd(ld),hd=rd(ld),ud=rd(),dd=rd(ud),fd=rd(ud),pd=rd(),md=rd(pd),gd=rd(),vd=rd(),yd=rd(),Od=rd(yd),bd=rd(),xd={comment:ad,lineComment:rd(ad),blockComment:rd(ad),docComment:rd(ad),name:ld,variableName:rd(ld),typeName:cd,tagName:rd(cd),propertyName:hd,attributeName:rd(hd),className:rd(ld),labelName:rd(ld),namespace:rd(ld),macroName:rd(ld),literal:ud,string:dd,docString:rd(dd),character:rd(dd),attributeValue:rd(dd),number:fd,integer:rd(fd),float:rd(fd),bool:rd(ud),regexp:rd(ud),escape:rd(ud),color:rd(ud),url:rd(ud),keyword:gd,self:rd(gd),null:rd(gd),atom:rd(gd),unit:rd(gd),modifier:rd(gd),operatorKeyword:rd(gd),controlKeyword:rd(gd),definitionKeyword:rd(gd),moduleKeyword:rd(gd),operator:vd,derefOperator:rd(vd),arithmeticOperator:rd(vd),logicOperator:rd(vd),bitwiseOperator:rd(vd),compareOperator:rd(vd),updateOperator:rd(vd),definitionOperator:rd(vd),typeOperator:rd(vd),controlOperator:rd(vd),punctuation:yd,separator:rd(yd),bracket:Od,angleBracket:rd(Od),squareBracket:rd(Od),paren:rd(Od),brace:rd(Od),content:pd,heading:md,heading1:rd(md),heading2:rd(md),heading3:rd(md),heading4:rd(md),heading5:rd(md),heading6:rd(md),contentSeparator:rd(pd),list:rd(pd),quote:rd(pd),emphasis:rd(pd),strong:rd(pd),link:rd(pd),monospace:rd(pd),strikethrough:rd(pd),inserted:rd(),deleted:rd(),changed:rd(),invalid:rd(),meta:bd,documentMeta:rd(bd),annotation:rd(bd),processingInstruction:rd(bd),definition:Gu.defineModifier("definition"),constant:Gu.defineModifier("constant"),function:Gu.defineModifier("function"),standard:Gu.defineModifier("standard"),local:Gu.defineModifier("local"),special:Gu.defineModifier("special")};for(let t in xd){let e=xd[t];e instanceof Gu&&(e.name=t)}nd([{tag:xd.link,class:"tok-link"},{tag:xd.heading,class:"tok-heading"},{tag:xd.emphasis,class:"tok-emphasis"},{tag:xd.strong,class:"tok-strong"},{tag:xd.keyword,class:"tok-keyword"},{tag:xd.atom,class:"tok-atom"},{tag:xd.bool,class:"tok-bool"},{tag:xd.url,class:"tok-url"},{tag:xd.labelName,class:"tok-labelName"},{tag:xd.inserted,class:"tok-inserted"},{tag:xd.deleted,class:"tok-deleted"},{tag:xd.literal,class:"tok-literal"},{tag:xd.string,class:"tok-string"},{tag:xd.number,class:"tok-number"},{tag:[xd.regexp,xd.escape,xd.special(xd.string)],class:"tok-string2"},{tag:xd.variableName,class:"tok-variableName"},{tag:xd.local(xd.variableName),class:"tok-variableName tok-local"},{tag:xd.definition(xd.variableName),class:"tok-variableName tok-definition"},{tag:xd.special(xd.variableName),class:"tok-variableName2"},{tag:xd.definition(xd.propertyName),class:"tok-propertyName tok-definition"},{tag:xd.typeName,class:"tok-typeName"},{tag:xd.namespace,class:"tok-namespace"},{tag:xd.className,class:"tok-className"},{tag:xd.macroName,class:"tok-macroName"},{tag:xd.propertyName,class:"tok-propertyName"},{tag:xd.operator,class:"tok-operator"},{tag:xd.comment,class:"tok-comment"},{tag:xd.meta,class:"tok-meta"},{tag:xd.invalid,class:"tok-invalid"},{tag:xd.punctuation,class:"tok-punctuation"}]);var wd;const _d=new bu;function Sd(t){return os.define({combine:t?e=>e.concat(t):void 0})}const kd=new bu;class $d{constructor(t,e,i=[],n=""){this.data=t,this.name=n,Hs.prototype.hasOwnProperty("tree")||Object.defineProperty(Hs.prototype,"tree",{get(){return Pd(this)}}),this.parser=e,this.extension=[Nd.of(this),Hs.languageData.of((t,e,i)=>{let n=Td(t,e,i),s=n.type.prop(_d);if(!s)return[];let o=t.facet(s),r=n.type.prop(kd);if(r){let s=n.resolve(e-n.from,i);for(let e of r)if(e.test(s,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(o)}}return o})].concat(i)}isActiveAt(t,e,i=-1){return Td(t,e,i).type.prop(_d)==this.data}findRegions(t){let e=t.facet(Nd);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(t,e)=>{if(t.prop(_d)==this.data)return void i.push({from:e,to:e+t.length});let s=t.prop(bu.mounted);if(s){if(s.tree.prop(_d)==this.data){if(s.overlay)for(let t of s.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(s.overlay){let t=i.length;if(n(s.tree,s.overlay[0].from+e),i.length>t)return}}for(let i=0;i<t.children.length;i++){let s=t.children[i];s instanceof Cu&&n(s,t.positions[i]+e)}};return n(Pd(t),0),i}get allowsNesting(){return!0}}function Td(t,e,i){let n=t.facet(Nd),s=Pd(t).topNode;if(!n||n.allowsNesting)for(let t=s;t;t=t.enter(e,i,Tu.ExcludeBuffers))t.type.isTop&&(s=t);return s}$d.setState=Rs.define();class Cd extends $d{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=Sd(t.languageData);return new Cd(e,t.parser.configure({props:[_d.add(t=>t.isTop?e:void 0)]}),t.name)}configure(t,e){return new Cd(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Pd(t){let e=t.field($d.state,!1);return e?e.tree:Cu.empty}class Ed{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let Ad=null;class Md{constructor(t,e,i=[],n,s,o,r,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=s,this.viewport=o,this.skipped=r,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Md(t,e,[],Cu.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Ed(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=Cu.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let n=this.parse.advance();if(n){if(this.fragments=this.withoutTempSkipped(Hu.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!=e?e:this.state.doc.length)))return!0;this.parse=this.startParse()}if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(Hu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Ad;Ad=this;try{return t()}finally{Ad=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Qd(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:s,viewport:o,skipped:r}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,i,n,s)=>e.push({fromA:t,toA:i,fromB:n,toB:s})),i=Hu.applyChanges(i,e),n=Cu.empty,s=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){r=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);i<n&&r.push({from:i,to:n})}}}return new Md(this.parser,e,i,n,s,o,r,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let e=0;e<this.skipped.length;e++){let{from:i,to:n}=this.skipped[e];i<t.to&&n>t.from&&(this.fragments=Qd(this.fragments,i,n),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends Vu{createParse(e,i,n){let s=n[0].from,o=n[n.length-1].to;return{parsedPos:s,advance(){let e=Ad;if(e){for(let t of n)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=o,new Cu(_u.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return Ad}}function Qd(t,e,i){return Hu.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Dd{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Dd(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Md.create(t.facet(Nd).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Dd(i)}}$d.state=ds.define({create:Dd.init,update(t,e){for(let t of e.effects)if(t.is($d.setState))return t.value;return e.startState.facet(Nd)!=e.state.facet(Nd)?Dd.init(e.state):t.apply(e)}});let Rd=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(Rd=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const Id="undefined"!=typeof navigator&&(null===(wd=navigator.scheduling)||void 0===wd?void 0:wd.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ld=ka.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field($d.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field($d.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Rd(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,s=i.field($d.state);if(s.tree==s.context.tree&&s.context.isDone(n+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!Id?Math.max(25,t.timeRemaining()-5):1e9),r=s.context.treeLen<n&&i.doc.length>n+1e3,a=s.context.work(()=>Id&&Id()||Date.now()>o,n+(r?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:$d.setState.of(new Dd(s.context))})),this.chunkBudget>0&&(!a||r)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(t=>xa(this.view.state,t)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Nd=os.define({combine:t=>t.length?t[0]:null,enables:t=>[$d.state,Ld,$c.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class jd{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const zd=os.define(),Bd=os.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Zd(t){let e=t.facet(Bd);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function Wd(t,e){let i="",n=t.tabSize,s=t.facet(Bd)[0];if("\t"==s){for(;e>=n;)i+="\t",e-=n;s=" "}for(let t=0;t<e;t++)i+=s;return i}function Fd(t,e){t instanceof Hs&&(t=new Xd(t));for(let i of t.state.facet(zd)){let n=i(t,e);if(void 0!==n)return n}let i=Pd(t.state);return i.length>=e?function(t,e,i){let n=e.resolveStack(i),s=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(s!=n.node){let t=[];for(let e=s;e&&!(e.from<n.node.from||e.to>n.node.to||e.from==n.node.from&&e.type==n.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)n={node:t[e],next:n}}return Hd(n,t,i)}(t,i,e):null}class Xd{constructor(t,e={}){this.state=t,this.options=e,this.unit=Zd(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return null!=n&&n>=i.from&&n<=i.to?s&&n==t?{text:"",from:t}:(e<0?n<t:n<=t)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(t,e);return i.slice(t-n,Math.min(i.length,t+100-n))}column(t,e=1){let{text:i,from:n}=this.lineAt(t,e),s=this.countColumn(i,t-n),o=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,e=t.length){return uo(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(n);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const qd=new bu;function Hd(t,e,i){for(let n=t;n;n=n.next){let t=Vd(n.node);if(t)return t(Ud.create(e,i,n))}return 0}function Vd(t){let e=t.type.prop(qd);if(e)return e;let i,n=t.firstChild;if(n&&(i=n.type.prop(bu.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>Jd(t,!0,1,void 0,n&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?Yd:null}function Yd(){return 0}class Ud extends Xd{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Ud(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Gd(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Hd(this.context.next,this.base,this.pos)}}function Gd(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function Kd({closing:t,align:e=!0,units:i=1}){return n=>Jd(n,e,i,t)}function Jd(t,e,i,n,s){let o=t.textAfter,r=o.match(/^\s*/)[0].length,a=n&&o.slice(r,r+n.length)==n||s==t.pos+r,l=e?function(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let s=t.options.simulateBreak,o=t.state.doc.lineAt(i.from),r=null==s||s<=o.from?o.to:Math.min(o.to,s);for(let t=i.to;;){let s=e.childAfter(t);if(!s||s==n)return null;if(!s.type.isSkipped){if(s.from>=r)return null;let t=/^ */.exec(o.text.slice(i.to-o.from))[0].length;return{from:i.from,to:i.to+t}}t=s.to}}(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*i)}function tf({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const ef=os.define(),nf=new bu;function sf(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function of(t,e,i){for(let n of t.facet(ef)){let s=n(t,e,i);if(s)return s}return function(t,e,i){let n=Pd(t);if(n.length<i)return null;let s=null;for(let o=n.resolveStack(i,1);o;o=o.next){let r=o.node;if(r.to<=i||r.from>i)continue;if(s&&r.from<e)break;let a=r.type.prop(nf);if(a&&(r.to<n.length-50||n.length==t.doc.length||!sf(r))){let n=a(r,t);n&&n.from<=i&&n.from>=e&&n.to>i&&(s=n)}}return s}(t,e,i)}function rf(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const af=Rs.define({map:rf}),lf=Rs.define({map:rf});function cf(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(t=>t.from<=i&&t.to>=i)||e.push(t.lineBlockAt(i));return e}const hf=ds.define({create:()=>Cr.none,update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((e,i)=>t=uf(t,e,i)),t=t.map(e.changes);for(let i of e.effects)if(i.is(af)&&!ff(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(yf),s=n?Cr.replace({widget:new wf(n(e.state,i.value))}):xf;t=t.update({add:[s.range(i.value.from,i.value.to)]})}else i.is(lf)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=uf(t,e.selection.main.head)),t},provide:t=>$c.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(t,e)=>{i.push(t,e)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let n=t[i++],s=t[i++];if("number"!=typeof n||"number"!=typeof s)throw new RangeError("Invalid JSON for fold state");e.push(xf.range(n,s))}return Cr.set(e,!0)}});function uf(t,e,i=e){let n=!1;return t.between(e,i,(t,s)=>{t<i&&s>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:i,filter:(t,n)=>t>=i||n<=e}):t}function df(t,e,i){var n;let s=null;return null===(n=t.field(hf,!1))||void 0===n||n.between(e,i,(t,e)=>{(!s||s.from>t)&&(s={from:t,to:e})}),s}function ff(t,e,i){let n=!1;return t.between(e,e,(t,s)=>{t==e&&s==i&&(n=!0)}),n}function pf(t,e){return t.field(hf,!1)?e:e.concat(Rs.appendConfig.of(Of()))}function mf(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return $c.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${s}.`)}const gf=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of cf(t)){let i=of(t.state,e.from,e.to);if(i)return t.dispatch({effects:pf(t.state,[af.of(i),mf(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(hf,!1))return!1;let e=[];for(let i of cf(t)){let n=df(t.state,i.from,i.to);n&&e.push(lf.of(n),mf(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let n=0;n<e.doc.length;){let s=t.lineBlockAt(n),o=of(e,s.from,s.to);o&&i.push(af.of(o)),n=(o?t.lineBlockAt(o.to):s).to+1}return i.length&&t.dispatch({effects:pf(t.state,i)}),!!i.length}},{key:"Ctrl-Alt-]",run:t=>{let e=t.state.field(hf,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(t,e)=>{i.push(lf.of({from:t,to:e}))}),t.dispatch({effects:i}),!0}}],vf={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},yf=os.define({combine:t=>Vs(t,vf)});function Of(t){let e=[hf,$f];return t&&e.push(yf.of(t)),e}function bf(t,e){let{state:i}=t,n=i.facet(yf),s=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),n=df(t.state,i.from,i.to);n&&t.dispatch({effects:lf.of(n)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,s,e);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=s,o}const xf=Cr.replace({widget:new class extends $r{toDOM(t){return bf(t,null)}}});class wf extends $r{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return bf(t,this.value)}}const _f={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Sf extends Hh{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function kf(t={}){let e={..._f,...t},i=new Sf(e,!0),n=new Sf(e,!1),s=ka.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Nd)!=t.state.facet(Nd)||t.startState.field(hf,!1)!=t.state.field(hf,!1)||Pd(t.startState)!=Pd(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new to;for(let s of t.viewportLineBlocks){let o=df(t.state,s.from,s.to)?n:of(t.state,s.from,s.to)?i:null;o&&e.add(s.from,s.from,o)}return e.finish()}}),{domEventHandlers:o}=e;return[s,Kh({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||Js.empty},initialSpacer:()=>new Sf(e,!1),domEventHandlers:{...o,click:(t,e,i)=>{if(o.click&&o.click(t,e,i))return!0;let n=df(t.state,e.from,e.to);if(n)return t.dispatch({effects:lf.of(n)}),!0;let s=of(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:af.of(s)}),!0)}}}),Of()]}const $f=$c.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 Tf{constructor(t,e){let i;function n(t){let e=vo.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?n(e.all):void 0,o=e.scope;this.scope=o instanceof $d?t=>t.prop(_d)==o.data:o?t=>t==o:void 0,this.style=nd(t.map(t=>({tag:t.tag,class:t.class||n(Object.assign({},t,{tag:null}))})),{all:s}).style,this.module=i?new vo(i):null,this.themeType=e.themeType}static define(t,e){return new Tf(t,e||{})}}const Cf=os.define(),Pf=os.define({combine:t=>t.length?[t[0]]:null});function Ef(t){let e=t.facet(Cf);return e.length?e:t.facet(Pf)}function Af(t,e){let i,n=[Qf];return t instanceof Tf&&(t.module&&n.push($c.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(Pf.of(t)):i?n.push(Cf.computeN([$c.darkTheme],e=>e.facet($c.darkTheme)==("dark"==i)?[t]:[])):n.push(Cf.of(t)),n}class Mf{constructor(t){this.markCache=Object.create(null),this.tree=Pd(t.state),this.decorations=this.buildDeco(t,Ef(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=Pd(t.state),i=Ef(t.state),n=i!=Ef(t.startState),{viewport:s}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<s.to&&!n&&e.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=s.to)}buildDeco(t,e){if(!e||!this.tree.length)return Cr.none;let i=new to;for(let{from:n,to:s}of t.visibleRanges)sd(this.tree,e,(t,e,n)=>{i.add(t,e,this.markCache[n]||(this.markCache[n]=Cr.mark({class:n})))},n,s);return i.finish()}}const Qf=ys.high(ka.fromClass(Mf,{decorations:t=>t.decorations})),Df=Tf.define([{tag:xd.meta,color:"#404740"},{tag:xd.link,textDecoration:"underline"},{tag:xd.heading,textDecoration:"underline",fontWeight:"bold"},{tag:xd.emphasis,fontStyle:"italic"},{tag:xd.strong,fontWeight:"bold"},{tag:xd.strikethrough,textDecoration:"line-through"},{tag:xd.keyword,color:"#708"},{tag:[xd.atom,xd.bool,xd.url,xd.contentSeparator,xd.labelName],color:"#219"},{tag:[xd.literal,xd.inserted],color:"#164"},{tag:[xd.string,xd.deleted],color:"#a11"},{tag:[xd.regexp,xd.escape,xd.special(xd.string)],color:"#e40"},{tag:xd.definition(xd.variableName),color:"#00f"},{tag:xd.local(xd.variableName),color:"#30a"},{tag:[xd.typeName,xd.namespace],color:"#085"},{tag:xd.className,color:"#167"},{tag:[xd.special(xd.variableName),xd.macroName],color:"#256"},{tag:xd.definition(xd.propertyName),color:"#00c"},{tag:xd.comment,color:"#940"},{tag:xd.invalid,color:"#f00"}]),Rf=$c.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),If="()[]{}",Lf=os.define({combine:t=>Vs(t,{afterCursor:!0,brackets:If,maxScanDistance:1e4,renderMatch:zf})}),Nf=Cr.mark({class:"cm-matchingBracket"}),jf=Cr.mark({class:"cm-nonmatchingBracket"});function zf(t){let e=[],i=t.matched?Nf:jf;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const Bf=ds.define({create:()=>Cr.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(Lf);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=Hf(e.state,t.head,-1,n)||t.head>0&&Hf(e.state,t.head-1,1,n)||n.afterCursor&&(Hf(e.state,t.head,1,n)||t.head<e.state.doc.length&&Hf(e.state,t.head+1,-1,n));s&&(i=i.concat(n.renderMatch(s,e.state)))}return Cr.set(i,!0)},provide:t=>$c.decorations.from(t)}),Zf=[Bf,Rf];function Wf(t={}){return[Lf.of(t),Zf]}const Ff=new bu;function Xf(t,e,i){let n=t.prop(e<0?bu.openedBy:bu.closedBy);if(n)return n;if(1==t.name.length){let n=i.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[i[n+e]]}return null}function qf(t){let e=t.type.prop(Ff);return e?e(t.node):t}function Hf(t,e,i,n={}){let s=n.maxScanDistance||1e4,o=n.brackets||If,r=Pd(t),a=r.resolveInner(e,i);for(let n=a;n;n=n.parent){let s=Xf(n.type,i,o);if(s&&n.from<n.to){let r=qf(n);if(r&&(i>0?e>=r.from&&e<r.to:e>r.from&&e<=r.to))return Vf(t,e,i,n,r,s,o)}}return function(t,e,i,n,s,o,r){let a=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=r.indexOf(a);if(l<0||l%2==0!=i>0)return null;let c={from:i<0?e-1:e,to:i>0?e+1:e},h=t.doc.iterRange(e,i>0?t.doc.length:0),u=0;for(let t=0;!h.next().done&&t<=o;){let o=h.value;i<0&&(t+=o.length);let a=e+t*i;for(let t=i>0?0:o.length-1,e=i>0?o.length:-1;t!=e;t+=i){let e=r.indexOf(o[t]);if(!(e<0||n.resolveInner(a+t,1).type!=s))if(e%2==0==i>0)u++;else{if(1==u)return{start:c,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};u--}}i>0&&(t+=o.length)}return h.done?{start:c,matched:!1}:null}(t,e,i,r,a.type,s,o)}function Vf(t,e,i,n,s,o,r){let a=n.parent,l={from:s.from,to:s.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 t=qf(h);return{start:l,end:t?{from:t.from,to:t.to}:void 0,matched:!0}}if(Xf(h.type,i,r))c++;else if(Xf(h.type,-i,r)){if(0==c){let t=qf(h);return{start:l,end:t&&t.from<t.to?{from:t.from,to:t.to}:void 0,matched:!1}}c--}}}while(i<0?h.prevSibling():h.nextSibling());return{start:l,matched:!1}}const Yf=Object.create(null),Uf=[_u.none],Gf=[],Kf=Object.create(null),Jf=Object.create(null);for(let[t,e]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"]])Jf[t]=ep(Yf,e);function tp(t,e){Gf.indexOf(t)>-1||(Gf.push(t),console.warn(e))}function ep(t,e){let i=[];for(let n of e.split(" ")){let e=[];for(let i of n.split(".")){let n=t[i]||xd[i];n?"function"==typeof n?e.length?e=e.map(n):tp(i,`Modifier ${i} used at start of tag`):e.length?tp(i,`Tag ${i} used as modifier`):e=Array.isArray(n)?n:[n]:tp(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+i.map(t=>t.id),o=Kf[s];if(o)return o.id;let r=Kf[s]=_u.define({id:Uf.length,name:n,props:[td({[n]:i})]});return Uf.push(r),r.id}zr.RTL,zr.LTR;function ip(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let s=t(e,i);return!!s&&(n(i.update(s)),!0)}}const np=ip(cp,0),sp=ip(lp,0),op=ip((t,e)=>lp(t,e,function(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),s=i.to<=n.to?n:t.doc.lineAt(i.to);s.from>n.from&&s.from==i.to&&(s=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let o=e.length-1;o>=0&&e[o].to>n.from?e[o].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}(e)),0);function rp(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const ap=50;function lp(t,e,i=e.selection.ranges){let n=i.map(t=>rp(e,t.from).block);if(!n.every(t=>t))return null;let s=i.map((t,i)=>function(t,{open:e,close:i},n,s){let o,r,a=t.sliceDoc(n-ap,n),l=t.sliceDoc(s,s+ap),c=/\s*$/.exec(a)[0].length,h=/^\s*/.exec(l)[0].length,u=a.length-c;if(a.slice(u-e.length,u)==e&&l.slice(h,h+i.length)==i)return{open:{pos:n-c,margin:c&&1},close:{pos:s+h,margin:h&&1}};s-n<=2*ap?o=r=t.sliceDoc(n,s):(o=t.sliceDoc(n,n+ap),r=t.sliceDoc(s-ap,s));let d=/^\s*/.exec(o)[0].length,f=/\s*$/.exec(r)[0].length,p=r.length-f-i.length;return o.slice(d,d+e.length)==e&&r.slice(p,p+i.length)==i?{open:{pos:n+d+e.length,margin:/\s/.test(o.charAt(d+e.length))?1:0},close:{pos:s-f-i.length,margin:/\s/.test(r.charAt(p-1))?1:0}}:null}(e,n[i],t.from,t.to));if(2!=t&&!s.every(t=>t))return{changes:e.changes(i.map((t,e)=>s[e]?[]:[{from:t.from,insert:n[e].open+" "},{from:t.to,insert:" "+n[e].close}]))};if(1!=t&&s.some(t=>t)){let t=[];for(let e,i=0;i<s.length;i++)if(e=s[i]){let s=n[i],{open:o,close:r}=e;t.push({from:o.pos-s.open.length,to:o.pos+o.margin},{from:r.pos-r.margin,to:r.pos+s.close.length})}return{changes:t}}return null}function cp(t,e,i=e.selection.ranges){let n=[],s=-1;for(let{from:t,to:o}of i){let i=n.length,r=1e9,a=rp(e,t).line;if(a){for(let i=t;i<=o;){let l=e.doc.lineAt(i);if(l.from>s&&(t==o||o>l.from)){s=l.from;let t=/^\s*/.exec(l.text)[0].length,e=t==l.length,i=l.text.slice(t,t+a.length)==a?t:-1;t<l.text.length&&t<r&&(r=t),n.push({line:l,comment:i,token:a,indent:t,empty:e,single:!1})}i=l.to+1}if(r<1e9)for(let t=i;t<n.length;t++)n[t].indent<n[t].line.text.length&&(n[t].indent=r);n.length==i+1&&(n[i].single=!0)}}if(2!=t&&n.some(t=>t.comment<0&&(!t.empty||t.single))){let t=[];for(let{line:e,token:i,indent:s,empty:o,single:r}of n)!r&&o||t.push({from:e.from+s,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&n.some(t=>t.comment>=0)){let t=[];for(let{line:e,comment:i,token:s}of n)if(i>=0){let n=e.from+i,o=n+s.length;" "==e.text[o-e.from]&&o++,t.push({from:n,to:o})}return{changes:t}}return null}const hp=Ms.define(),up=Ms.define(),dp=os.define(),fp=os.define({combine:t=>Vs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}),pp=ds.define({create:()=>Ap.empty,update(t,e){let i=e.state.facet(fp),n=e.annotation(hp);if(n){let s=xp.fromTransaction(e,n.selection),o=n.side,r=0==o?t.undone:t.done;return r=s?wp(r,r.length,i.minDepth,s):$p(r,e.startState.selection),new Ap(0==o?n.rest:r,0==o?r:n.rest)}let s=e.annotation(up);if("full"!=s&&"before"!=s||(t=t.isolate()),!1===e.annotation(Is.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let o=xp.fromTransaction(e),r=e.annotation(Is.time),a=e.annotation(Is.userEvent);return o?t=t.addChanges(o,r,a,i,e):e.selection&&(t=t.addSelection(e.startState.selection,r,a,i.newGroupDelay)),"full"!=s&&"after"!=s||(t=t.isolate()),t},toJSON:t=>({done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}),fromJSON:t=>new Ap(t.done.map(xp.fromJSON),t.undone.map(xp.fromJSON))});function mp(t={}){return[pp,fp.of(t),$c.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?vp:"historyRedo"==t.inputType?yp:null;return!!i&&(t.preventDefault(),i(e))}})]}function gp(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let s=i.field(pp,!1);if(!s)return!1;let o=s.pop(t,i,e);return!!o&&(n(o),!0)}}const vp=gp(0,!1),yp=gp(1,!1),Op=gp(0,!0),bp=gp(1,!0);class xp{constructor(t,e,i,n,s){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(t){return new xp(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new xp(t.changes&&Vn.fromJSON(t.changes),[],t.mapped&&Hn.fromJSON(t.mapped),t.startSelection&&is.fromJSON(t.startSelection),t.selectionsAfter.map(is.fromJSON))}static fromTransaction(t,e){let i=Sp;for(let e of t.startState.facet(dp)){let n=e(t);n.length&&(i=i.concat(n))}return!i.length&&t.changes.empty?null:new xp(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Sp)}static selection(t){return new xp(void 0,Sp,void 0,void 0,t)}}function wp(t,e,i,n){let s=e+1>i+20?e-i-1:0,o=t.slice(s,e);return o.push(n),o}function _p(t,e){return t.length?e.length?t.concat(e):t:e}const Sp=[],kp=200;function $p(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-kp));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),wp(t,t.length-1,1e9,i.setSelAfter(n)))}return[xp.selection([e])]}function Tp(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function Cp(t,e){if(!t.length)return t;let i=t.length,n=Sp;for(;i;){let s=Pp(t[i-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let e=t.slice(0,i);return e[i-1]=s,e}e=s.mapped,i--,n=s.selectionsAfter}return n.length?[xp.selection(n)]:Sp}function Pp(t,e,i){let n=_p(t.selectionsAfter.length?t.selectionsAfter.map(t=>t.map(e)):Sp,i);if(!t.changes)return xp.selection(n);let s=t.changes.map(e),o=e.mapDesc(t.changes,!0),r=t.mapped?t.mapped.composeDesc(o):o;return new xp(s,Rs.mapEffects(t.effects,e),r,t.startSelection.map(o),n)}const Ep=/^(input\.type|delete)($|\.)/;class Ap{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Ap(this.done,this.undone):this}addChanges(t,e,i,n,s){let o=this.done,r=o[o.length-1];return o=r&&r.changes&&!r.changes.empty&&t.changes&&(!i||Ep.test(i))&&(!r.selectionsAfter.length&&e-this.prevTime<n.newGroupDelay&&n.joinToEvent(s,function(t,e){let i=[],n=!1;return t.iterChangedRanges((t,e)=>i.push(t,e)),e.iterChangedRanges((t,e,s,o)=>{for(let t=0;t<i.length;){let e=i[t++],r=i[t++];o>=e&&s<=r&&(n=!0)}}),n}(r.changes,t.changes))||"input.type.compose"==i)?wp(o,o.length-1,n.minDepth,new xp(t.changes.compose(r.changes),_p(Rs.mapEffects(t.effects,r.changes),r.effects),r.mapped,r.startSelection,Sp)):wp(o,o.length,n.minDepth,t),new Ap(o,Sp,e,i)}addSelection(t,e,i,n){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Sp;return s.length>0&&e-this.prevTime<n&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&(o=s[s.length-1],r=t,o.ranges.length==r.ranges.length&&0===o.ranges.filter((t,e)=>t.empty!=r.ranges[e].empty).length)?this:new Ap($p(this.done,t),this.undone,e,i);var o,r}addMapping(t){return new Ap(Cp(this.done,t),Cp(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let n=0==t?this.done:this.undone;if(0==n.length)return null;let s=n[n.length-1],o=s.selectionsAfter[0]||e.selection;if(i&&s.selectionsAfter.length)return e.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:hp.of({side:t,rest:Tp(n),selection:o}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let i=1==n.length?Sp:n.slice(0,n.length-1);return s.mapped&&(i=Cp(i,s.mapped)),e.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:hp.of({side:t,rest:i,selection:o}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}Ap.empty=new Ap(Sp,Sp);const Mp=[{key:"Mod-z",run:vp,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:yp,preventDefault:!0},{linux:"Ctrl-Shift-z",run:yp,preventDefault:!0},{key:"Mod-u",run:Op,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:bp,preventDefault:!0}];function Qp(t,e){return is.create(t.ranges.map(e),t.mainIndex)}function Dp(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Rp({state:t,dispatch:e},i){let n=Qp(t.selection,i);return!n.eq(t.selection,!0)&&(e(Dp(t,n)),!0)}function Ip(t,e){return is.cursor(e?t.to:t.from)}function Lp(t,e){return Rp(t,i=>i.empty?t.moveByChar(i,e):Ip(i,e))}function Np(t){return t.textDirectionAt(t.state.selection.main.head)==zr.LTR}const jp=t=>Lp(t,!Np(t)),zp=t=>Lp(t,Np(t));function Bp(t,e){return Rp(t,i=>i.empty?t.moveByGroup(i,e):Ip(i,e))}"undefined"!=typeof Intl&&Intl.Segmenter;function Zp(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Wp(t,e,i){let n,s,o=Pd(t).resolveInner(e.head),r=i?bu.closedBy:bu.openedBy;for(let n=e.head;;){let e=i?o.childAfter(n):o.childBefore(n);if(!e)break;Zp(t,e,r)?o=e:n=i?e.to:e.from}return s=o.type.prop(r)&&(n=i?Hf(t,o.from,1):Hf(t,o.to,-1))&&n.matched?i?n.end.to:n.end.from:i?o.to:o.from,is.cursor(s,i?-1:1)}function Fp(t,e){return Rp(t,i=>{if(!i.empty)return Ip(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const Xp=t=>Fp(t,!1),qp=t=>Fp(t,!0);function Hp(t){let e,i=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,s=0;if(i){for(let e of t.state.facet($c.scrollMargins)){let i=e(t);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(s=Math.max(null==i?void 0:i.bottom,s))}e=t.scrollDOM.clientHeight-n-s}else e=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:s,selfScroll:i,height:Math.max(t.defaultLineHeight,e-5)}}function Vp(t,e){let i,n=Hp(t),{state:s}=t,o=Qp(s.selection,i=>i.empty?t.moveVertically(i,e,n.height):Ip(i,e));if(o.eq(s.selection))return!1;if(n.selfScroll){let e=t.coordsAtPos(s.selection.main.head),r=t.scrollDOM.getBoundingClientRect(),a=r.top+n.marginTop,l=r.bottom-n.marginBottom;e&&e.top>a&&e.bottom<l&&(i=$c.scrollIntoView(o.main.head,{y:"start",yMargin:e.top-a}))}return t.dispatch(Dp(s,o),{effects:i}),!0}const Yp=t=>Vp(t,!1),Up=t=>Vp(t,!0);function Gp(t,e,i){let n=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,i);if(s.head==e.head&&s.head!=(i?n.to:n.from)&&(s=t.moveToLineBoundary(e,i,!1)),!i&&s.head==n.from&&n.length){let i=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&e.head!=n.from+i&&(s=is.cursor(n.from+i))}return s}function Kp(t,e,i){let n=!1,s=Qp(t.selection,e=>{let s=Hf(t,e.head,-1)||Hf(t,e.head,1)||e.head>0&&Hf(t,e.head-1,1)||e.head<t.doc.length&&Hf(t,e.head+1,-1);if(!s||!s.end)return e;n=!0;let o=s.start.from==e.head?s.end.to:s.end.from;return i?is.range(e.anchor,o):is.cursor(o)});return!!n&&(e(Dp(t,s)),!0)}function Jp(t,e){let i=Qp(t.state.selection,t=>{let i=e(t);return is.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return!i.eq(t.state.selection)&&(t.dispatch(Dp(t.state,i)),!0)}function tm(t,e){return Jp(t,i=>t.moveByChar(i,e))}const em=t=>tm(t,!Np(t)),im=t=>tm(t,Np(t));function nm(t,e){return Jp(t,i=>t.moveByGroup(i,e))}function sm(t,e){return Jp(t,i=>t.moveVertically(i,e))}const om=t=>sm(t,!1),rm=t=>sm(t,!0);function am(t,e){return Jp(t,i=>t.moveVertically(i,e,Hp(t).height))}const lm=t=>am(t,!1),cm=t=>am(t,!0),hm=({state:t,dispatch:e})=>(e(Dp(t,{anchor:0})),!0),um=({state:t,dispatch:e})=>(e(Dp(t,{anchor:t.doc.length})),!0),dm=({state:t,dispatch:e})=>(e(Dp(t,{anchor:t.selection.main.anchor,head:0})),!0),fm=({state:t,dispatch:e})=>(e(Dp(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function pm(t,e){let{state:i}=t,n=i.selection,s=i.selection.ranges.slice();for(let n of i.selection.ranges){let o=i.doc.lineAt(n.head);if(e?o.to<t.state.doc.length:o.from>0)for(let i=n;;){let n=t.moveVertically(i,e);if(n.head<o.from||n.head>o.to){s.some(t=>t.head==n.head)||s.push(n);break}if(n.head==i.head)break;i=n}}return s.length!=n.ranges.length&&(t.dispatch(Dp(i,is.create(s,s.length-1))),!0)}function mm(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,s=n.changeByRange(n=>{let{from:s,to:o}=n;if(s==o){let r=e(n);r<s?(i="delete.backward",r=gm(t,r,!1)):r>s&&(i="delete.forward",r=gm(t,r,!0)),s=Math.min(s,r),o=Math.max(o,r)}else s=gm(t,s,!1),o=gm(t,o,!0);return s==o?{range:n}:{changes:{from:s,to:o},range:is.cursor(s,s<n.head?-1:1)}});return!s.changes.empty&&(t.dispatch(n.update(s,{scrollIntoView:!0,userEvent:i,effects:"delete.selection"==i?$c.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function gm(t,e,i){if(t instanceof $c)for(let n of t.state.facet($c.atomicRanges).map(e=>e(t)))n.between(e,e,(t,n)=>{t<e&&n>e&&(e=i?n:t)});return e}const vm=(t,e,i)=>mm(t,n=>{let s,o,r=n.from,{state:a}=t,l=a.doc.lineAt(r);if(i&&!e&&r>l.from&&r<l.from+200&&!/[^ \t]/.test(s=l.text.slice(0,r-l.from))){if("\t"==s[s.length-1])return r-1;let t=uo(s,a.tabSize)%Zd(a)||Zd(a);for(let e=0;e<t&&" "==s[s.length-1-e];e++)r--;o=r}else o=Bn(l.text,r-l.from,e,e)+l.from,o==r&&l.number!=(e?a.doc.lines:1)?o+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(o-l.from,r-l.from))&&(o=Bn(l.text,o-l.from,!1,!1)+l.from);return o}),ym=t=>vm(t,!1,!0),Om=t=>vm(t,!0,!1),bm=(t,e)=>mm(t,i=>{let n=i.head,{state:s}=t,o=s.doc.lineAt(n),r=s.charCategorizer(n);for(let t=null;;){if(n==(e?o.to:o.from)){n==i.head&&o.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=Bn(o.text,n-o.from,e)+o.from,l=o.text.slice(Math.min(n,a)-o.from,Math.max(n,a)-o.from),c=r(l);if(null!=t&&c!=t)break;" "==l&&n==i.head||(t=c),n=a}return n}),xm=t=>bm(t,!1);function wm(t){let e=[],i=-1;for(let n of t.selection.ranges){let s=t.doc.lineAt(n.from),o=t.doc.lineAt(n.to);if(n.empty||n.to!=o.from||(o=t.doc.lineAt(n.to-1)),i>=s.number){let t=e[e.length-1];t.to=o.to,t.ranges.push(n)}else e.push({from:s.from,to:o.to,ranges:[n]});i=o.number+1}return e}function _m(t,e,i){if(t.readOnly)return!1;let n=[],s=[];for(let e of wm(t)){if(i?e.to==t.doc.length:0==e.from)continue;let o=t.doc.lineAt(i?e.to+1:e.from-1),r=o.length+1;if(i){n.push({from:e.to,to:o.to},{from:e.from,insert:o.text+t.lineBreak});for(let i of e.ranges)s.push(is.range(Math.min(t.doc.length,i.anchor+r),Math.min(t.doc.length,i.head+r)))}else{n.push({from:o.from,to:e.from},{from:e.to,insert:t.lineBreak+o.text});for(let t of e.ranges)s.push(is.range(t.anchor-r,t.head-r))}}return!!n.length&&(e(t.update({changes:n,scrollIntoView:!0,selection:is.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0)}function Sm(t,e,i){if(t.readOnly)return!1;let n=[];for(let e of wm(t))i?n.push({from:e.from,insert:t.doc.slice(e.from,e.to)+t.lineBreak}):n.push({from:e.to,insert:t.lineBreak+t.doc.slice(e.from,e.to)});return e(t.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const km=$m(!1);function $m(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(i=>{let{from:n,to:s}=i,o=e.doc.lineAt(n),r=!t&&n==s&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,n=Pd(t).resolveInner(e),s=n.childBefore(e),o=n.childAfter(e);return s&&o&&s.to<=e&&o.from>=e&&(i=s.type.prop(bu.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(s.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(s.to,o.from))?{from:s.to,to:o.from}:null}(e,n);t&&(n=s=(s<=o.to?o:e.doc.lineAt(s)).to);let a=new Xd(e,{simulateBreak:n,simulateDoubleBreak:!!r}),l=Fd(a,n);for(null==l&&(l=uo(/^\s*/.exec(e.doc.lineAt(n).text)[0],e.tabSize));s<o.to&&/\s/.test(o.text[s-o.from]);)s++;r?({from:n,to:s}=r):n>o.from&&n<o.from+100&&!/\S/.test(o.text.slice(0,n))&&(n=o.from);let c=["",Wd(e,l)];return r&&c.push(Wd(e,a.lineIndent(o.from,-1))),{changes:{from:n,to:s,insert:An.of(c)},range:is.cursor(n+1+c[1].length)}});return i(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Tm(t,e){let i=-1;return t.changeByRange(n=>{let s=[];for(let o=n.from;o<=n.to;){let r=t.doc.lineAt(o);r.number>i&&(n.empty||n.to>r.from)&&(e(r,s,n),i=r.number),o=r.to+1}let o=t.changes(s);return{changes:s,range:is.range(o.mapPos(n.anchor,1),o.mapPos(n.head,1))}})}const Cm=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(Tm(t,(e,i)=>{i.push({from:e.from,insert:t.facet(Bd)})}),{userEvent:"input.indent"})),!0),Pm=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(Tm(t,(e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let s=uo(n,t.tabSize),o=0,r=Wd(t,Math.max(0,s-Zd(t)));for(;o<n.length&&o<r.length&&n.charCodeAt(o)==r.charCodeAt(o);)o++;i.push({from:e.from+o,to:e.from+n.length,insert:r.slice(o)})}),{userEvent:"delete.dedent"})),!0),Em=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:t=>Rp(t,e=>Wp(t.state,e,!Np(t))),shift:t=>Jp(t,e=>Wp(t.state,e,!Np(t)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:t=>Rp(t,e=>Wp(t.state,e,Np(t))),shift:t=>Jp(t,e=>Wp(t.state,e,Np(t)))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>_m(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>Sm(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>_m(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>Sm(t,e,!0)},{key:"Mod-Alt-ArrowUp",run:t=>pm(t,!1)},{key:"Mod-Alt-ArrowDown",run:t=>pm(t,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=is.create([i.main]):i.main.empty||(n=is.create([is.cursor(i.main.head)])),!!n&&(e(Dp(t,n)),!0)}},{key:"Mod-Enter",run:$m(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:t,dispatch:e})=>{let i=wm(t).map(({from:e,to:i})=>is.range(e,Math.min(i+1,t.doc.length)));return e(t.update({selection:is.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:t,dispatch:e})=>{let i=Qp(t.selection,e=>{let i=Pd(t),n=i.resolveStack(e.from,1);if(e.empty){let t=i.resolveStack(e.from,-1);t.node.from>=n.node.from&&t.node.to<=n.node.to&&(n=t)}for(let t=n;t;t=t.next){let{node:i}=t;if((i.from<e.from&&i.to>=e.to||i.to>e.to&&i.from<=e.from)&&t.next)return is.range(i.to,i.from)}return e});return!i.eq(t.selection)&&(e(Dp(t,i)),!0)},preventDefault:!0},{key:"Mod-[",run:Pm},{key:"Mod-]",run:Cm},{key:"Mod-Alt-\\",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new Xd(t,{overrideIndentation:t=>{let e=i[t];return null==e?-1:e}}),s=Tm(t,(e,s,o)=>{let r=Fd(n,e.from);if(null==r)return;/\S/.test(e.text)||(r=0);let a=/^\s*/.exec(e.text)[0],l=Wd(t,r);(a!=l||o.from<e.from+a.length)&&(i[e.from]=r,s.push({from:e.from,to:e.from+a.length,insert:l}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(wm(e).map(({from:t,to:i})=>(t>0?t--:i<e.doc.length&&i++,{from:t,to:i}))),n=Qp(e.selection,e=>{let i;if(t.lineWrapping){let n=t.lineBlockAt(e.head),s=t.coordsAtPos(e.head,e.assoc||1);s&&(i=n.bottom+t.documentTop-s.bottom+t.defaultLineHeight/2)}return t.moveVertically(e,!0,i)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>Kp(t,e,!1)},{key:"Mod-/",run:t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=rp(t.state,i.from);return n.line?np(t):!!n.block&&op(t)}},{key:"Alt-A",run:sp},{key:"Ctrl-m",mac:"Shift-Alt-m",run:t=>(t.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:jp,shift:em,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:t=>Bp(t,!Np(t)),shift:t=>nm(t,!Np(t)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:t=>Rp(t,e=>Gp(t,e,!Np(t))),shift:t=>Jp(t,e=>Gp(t,e,!Np(t))),preventDefault:!0},{key:"ArrowRight",run:zp,shift:im,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Bp(t,Np(t)),shift:t=>nm(t,Np(t)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>Rp(t,e=>Gp(t,e,Np(t))),shift:t=>Jp(t,e=>Gp(t,e,Np(t))),preventDefault:!0},{key:"ArrowUp",run:Xp,shift:om,preventDefault:!0},{mac:"Cmd-ArrowUp",run:hm,shift:dm},{mac:"Ctrl-ArrowUp",run:Yp,shift:lm},{key:"ArrowDown",run:qp,shift:rm,preventDefault:!0},{mac:"Cmd-ArrowDown",run:um,shift:fm},{mac:"Ctrl-ArrowDown",run:Up,shift:cm},{key:"PageUp",run:Yp,shift:lm},{key:"PageDown",run:Up,shift:cm},{key:"Home",run:t=>Rp(t,e=>Gp(t,e,!1)),shift:t=>Jp(t,e=>Gp(t,e,!1)),preventDefault:!0},{key:"Mod-Home",run:hm,shift:dm},{key:"End",run:t=>Rp(t,e=>Gp(t,e,!0)),shift:t=>Jp(t,e=>Gp(t,e,!0)),preventDefault:!0},{key:"Mod-End",run:um,shift:fm},{key:"Enter",run:km,shift:km},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ym,shift:ym,preventDefault:!0},{key:"Delete",run:Om,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:xm,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>bm(t,!0),preventDefault:!0},{mac:"Mod-Backspace",run:t=>mm(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:t=>mm(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),preventDefault:!0}].concat([{key:"Ctrl-b",run:jp,shift:em,preventDefault:!0},{key:"Ctrl-f",run:zp,shift:im},{key:"Ctrl-p",run:Xp,shift:om},{key:"Ctrl-n",run:qp,shift:rm},{key:"Ctrl-a",run:t=>Rp(t,e=>is.cursor(t.lineBlockAt(e.head).from,1)),shift:t=>Jp(t,e=>is.cursor(t.lineBlockAt(e.head).from))},{key:"Ctrl-e",run:t=>Rp(t,e=>is.cursor(t.lineBlockAt(e.head).to,-1)),shift:t=>Jp(t,e=>is.cursor(t.lineBlockAt(e.head).to))},{key:"Ctrl-d",run:Om},{key:"Ctrl-h",run:ym},{key:"Ctrl-k",run:t=>mm(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)})},{key:"Ctrl-Alt-h",run:xm},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:An.of(["",""])},range:is.cursor(t.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,n=t.doc.lineAt(i),s=i==n.from?i-1:Bn(n.text,i-n.from,!1)+n.from,o=i==n.to?i+1:Bn(n.text,i-n.from,!0)+n.from;return{changes:{from:s,to:o,insert:t.doc.slice(i,o).append(t.doc.slice(s,i))},range:is.cursor(o)}});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Up}].map(t=>({mac:t.key,run:t.run,shift:t.shift}))));function Am(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=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 s=i[n];"string"==typeof s?t.setAttribute(n,s):null!=s&&(t[n]=s)}e++}for(;e<arguments.length;e++)Mm(t,arguments[e]);return t}function Mm(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var i=0;i<e.length;i++)Mm(t,e[i])}}const Qm="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class Dm{constructor(t,e,i=0,n=t.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=s?t=>s(Qm(t)):Qm,this.query=this.normalize(e)}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 Zn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=Wn(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Fn(t);let n=this.normalize(e);if(n.length)for(let t=0,s=i;;t++){let o=n.charCodeAt(t),r=this.match(o,s,this.bufferPos+this.bufferStart);if(t==n.length-1){if(r)return this.value=r,this;break}s==i&&t<e.length&&e.charCodeAt(t)==o&&s++}}}match(t,e,i){let n=null;for(let e=0;e<this.matches.length;e+=2){let s=this.matches[e],o=!1;this.query.charCodeAt(s)==t&&(s==this.query.length-1?n={from:this.matches[e+1],to:i}:(this.matches[e]++,o=!0)),o||(this.matches.splice(e,2),e-=2)}return this.query.charCodeAt(0)==t&&(1==this.query.length?n={from:e,to:i}:this.matches.push(1,e)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}}"undefined"!=typeof Symbol&&(Dm.prototype[Symbol.iterator]=function(){return this});const Rm={from:-1,to:-1,match:/.*/.exec("")},Im="gm"+(null==/x/.unicode?"":"u");class Lm{constructor(t,e,i,n=0,s=t.length){if(this.text=t,this.to=s,this.curLine="",this.done=!1,this.value=Rm,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new zm(t,e,i,n,s);this.re=new RegExp(e,Im+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=t.iter();let o=t.lineAt(n);this.curLineStart=o.from,this.matchPos=Bm(t,n),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),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 t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=Bm(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,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),t=0}}}}const Nm=new WeakMap;class jm{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,i){let n=Nm.get(t);if(!n||n.from>=i||n.to<=e){let n=new jm(e,t.sliceString(e,i));return Nm.set(t,n),n}if(n.from==e&&n.to==i)return n;let{text:s,from:o}=n;return o>e&&(s=t.sliceString(e,o)+s,o=e),n.to<i&&(s+=t.sliceString(n.to,i)),Nm.set(t,new jm(o,s)),new jm(e,s.slice(e-o,i-o))}}class zm{constructor(t,e,i,n,s){this.text=t,this.to=s,this.done=!1,this.value=Rm,this.matchPos=Bm(t,n),this.re=new RegExp(e,Im+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.flat=jm.get(t,n,this.chunkEnd(n+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,match:e},this.matchPos=Bm(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=jm.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Bm(t,e){if(e>=t.length)return e;let i,n=t.lineAt(e);for(;e<n.to&&(i=n.text.charCodeAt(e-n.from))>=56320&&i<57344;)e++;return e}function Zm(t){let e=Am("input",{class:"cm-textfield",name:"line",value:String(t.state.doc.lineAt(t.state.selection.main.head).number)});function i(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!i)return;let{state:n}=t,s=n.doc.lineAt(n.selection.main.head),[,o,r,a,l]=i,c=a?+a.slice(1):0,h=r?+r:s.number;if(r&&l){let t=h/100;o&&(t=t*("-"==o?-1:1)+s.number/n.doc.lines),h=Math.round(n.doc.lines*t)}else r&&o&&(h=h*("-"==o?-1:1)+s.number);let u=n.doc.line(Math.max(1,Math.min(n.doc.lines,h))),d=is.cursor(u.from+Math.max(0,Math.min(c,u.length)));t.dispatch({effects:[Wm.of(!1),$c.scrollIntoView(d.from,{y:"center"})],selection:d}),t.focus()}return{dom:Am("form",{class:"cm-gotoLine",onkeydown:e=>{27==e.keyCode?(e.preventDefault(),t.dispatch({effects:Wm.of(!1)}),t.focus()):13==e.keyCode&&(e.preventDefault(),i())},onsubmit:t=>{t.preventDefault(),i()}},Am("label",t.state.phrase("Go to line"),": ",e)," ",Am("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),Am("button",{name:"close",onclick:()=>{t.dispatch({effects:Wm.of(!1)}),t.focus()},"aria-label":t.state.phrase("close"),type:"button"},["×"]))}}"undefined"!=typeof Symbol&&(Lm.prototype[Symbol.iterator]=zm.prototype[Symbol.iterator]=function(){return this});const Wm=Rs.define(),Fm=ds.define({create:()=>!0,update(t,e){for(let i of e.effects)i.is(Wm)&&(t=i.value);return t},provide:t=>qh.from(t,t=>t?Zm:null)}),Xm=$c.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),qm={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Hm=os.define({combine:t=>Vs(t,qm,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function Vm(t){let e=[Jm,Km];return t&&e.push(Hm.of(t)),e}const Ym=Cr.mark({class:"cm-selectionMatch"}),Um=Cr.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Gm(t,e,i,n){return!(0!=i&&t(e.sliceDoc(i-1,i))==Ws.Word||n!=e.doc.length&&t(e.sliceDoc(n,n+1))==Ws.Word)}const Km=ka.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Hm),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Cr.none;let s,o=n.main,r=null;if(o.empty){if(!e.highlightWordAroundCursor)return Cr.none;let t=i.wordAt(o.head);if(!t)return Cr.none;r=i.charCategorizer(o.head),s=i.sliceDoc(t.from,t.to)}else{let t=o.to-o.from;if(t<e.minSelectionLength||t>200)return Cr.none;if(e.wholeWords){if(s=i.sliceDoc(o.from,o.to),r=i.charCategorizer(o.head),!Gm(r,i,o.from,o.to)||!function(t,e,i,n){return t(e.sliceDoc(i,i+1))==Ws.Word&&t(e.sliceDoc(n-1,n))==Ws.Word}(r,i,o.from,o.to))return Cr.none}else if(s=i.sliceDoc(o.from,o.to),!s)return Cr.none}let a=[];for(let n of t.visibleRanges){let t=new Dm(i.doc,s,n.from,n.to);for(;!t.next().done;){let{from:n,to:s}=t.value;if((!r||Gm(r,i,n,s))&&(o.empty&&n<=o.from&&s>=o.to?a.push(Um.range(n,s)):(n>=o.to||s<=o.from)&&a.push(Ym.range(n,s)),a.length>e.maxMatches))return Cr.none}}return Cr.set(a)}},{decorations:t=>t.decorations}),Jm=$c.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const tg=os.define({combine:t=>Vs(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Pg(t),scrollToMatch:t=>$c.scrollIntoView(t)})});class eg{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||function(t){try{return new RegExp(t,Im),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(t,e)=>"n"==e?"\n":"r"==e?"\r":"t"==e?"\t":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new lg(this):new sg(this)}getCursor(t,e=0,i){let n=t.doc?t:Hs.create({doc:t});return null==i&&(i=n.doc.length),this.regexp?og(this,n,e,i):ng(this,n,e,i)}}class ig{constructor(t){this.spec=t}}function ng(t,e,i,n){return new Dm(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:t=>t.toLowerCase(),t.wholeWord?function(t,e){return(i,n,s,o)=>((o>i||o+s.length<n)&&(o=Math.max(0,i-2),s=t.sliceString(o,Math.min(t.length,n+2))),!(e(rg(s,i-o))==Ws.Word&&e(ag(s,i-o))==Ws.Word||e(ag(s,n-o))==Ws.Word&&e(rg(s,n-o))==Ws.Word))}(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}class sg extends ig{constructor(t){super(t)}nextMatch(t,e,i){let n=ng(this.spec,t,i,t.doc.length).nextOverlapping();if(n.done){let i=Math.min(t.doc.length,e+this.spec.unquoted.length);n=ng(this.spec,t,0,i).nextOverlapping()}return n.done||n.value.from==e&&n.value.to==i?null:n.value}prevMatchInRange(t,e,i){for(let n=i;;){let i=Math.max(e,n-1e4-this.spec.unquoted.length),s=ng(this.spec,t,i,n),o=null;for(;!s.nextOverlapping().done;)o=s.value;if(o)return o;if(i==e)return null;n-=1e4}}prevMatch(t,e,i){let n=this.prevMatchInRange(t,0,e);return n||(n=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),!n||n.from==e&&n.to==i?null:n}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=ng(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let s=ng(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}function og(t,e,i,n){return new Lm(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?(s=e.charCategorizer(e.selection.main.head),(t,e,i)=>!i[0].length||(s(rg(i.input,i.index))!=Ws.Word||s(ag(i.input,i.index))!=Ws.Word)&&(s(ag(i.input,i.index+i[0].length))!=Ws.Word||s(rg(i.input,i.index+i[0].length))!=Ws.Word)):void 0},i,n);var s}function rg(t,e){return t.slice(Bn(t,e,!1),e)}function ag(t,e){return t.slice(e,Bn(t,e))}class lg extends ig{nextMatch(t,e,i){let n=og(this.spec,t,i,t.doc.length).next();return n.done&&(n=og(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let s=Math.max(e,i-1e4*n),o=og(this.spec,t,s,i),r=null;for(;!o.next().done;)r=o.value;if(r&&(s==e||r.from>s+10))return r;if(s==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(e,i)=>{if("&"==i)return t.match[0];if("$"==i)return"$";for(let e=i.length;e>0;e--){let n=+i.slice(0,e);if(n>0&&n<t.match.length)return t.match[n]+i.slice(e)}return e})}matchAll(t,e){let i=og(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let s=og(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}const cg=Rs.define(),hg=Rs.define(),ug=ds.define({create:t=>new dg(_g(t).create(),null),update(t,e){for(let i of e.effects)i.is(cg)?t=new dg(i.value.create(),t.panel):i.is(hg)&&(t=new dg(t.query,i.value?wg:null));return t},provide:t=>qh.from(t,t=>t.panel)});class dg{constructor(t,e){this.query=t,this.panel=e}}const fg=Cr.mark({class:"cm-searchMatch"}),pg=Cr.mark({class:"cm-searchMatch cm-searchMatch-selected"}),mg=ka.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ug))}update(t){let e=t.state.field(ug);(e!=t.startState.field(ug)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Cr.none;let{view:i}=this,n=new to;for(let e=0,s=i.visibleRanges,o=s.length;e<o;e++){let{from:r,to:a}=s[e];for(;e<o-1&&a>s[e+1].from-500;)a=s[++e].to;t.highlight(i.state,r,a,(t,e)=>{let s=i.state.selection.ranges.some(i=>i.from==t&&i.to==e);n.add(t,e,s?pg:fg)})}return n.finish()}},{decorations:t=>t.decorations});function gg(t){return e=>{let i=e.state.field(ug,!1);return i&&i.query.spec.valid?t(e,i):$g(e)}}const vg=gg((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let s=is.single(n.from,n.to),o=t.state.facet(tg);return t.dispatch({selection:s,effects:[Qg(t,n),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),kg(t),!0}),yg=gg((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,s=e.prevMatch(i,n,n);if(!s)return!1;let o=is.single(s.from,s.to),r=t.state.facet(tg);return t.dispatch({selection:o,effects:[Qg(t,s),r.scrollToMatch(o.main,t)],userEvent:"select.search"}),kg(t),!0}),Og=gg((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!(!i||!i.length)&&(t.dispatch({selection:is.create(i.map(t=>is.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),bg=gg((t,{query:e})=>{let{state:i}=t,{from:n,to:s}=i.selection.main;if(i.readOnly)return!1;let o=e.nextMatch(i,n,n);if(!o)return!1;let r,a,l=o,c=[],h=[];l.from==n&&l.to==s&&(a=i.toText(e.getReplacement(l)),c.push({from:l.from,to:l.to,insert:a}),l=e.nextMatch(i,l.from,l.to),h.push($c.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+".")));let u=t.state.changes(c);return l&&(r=is.single(l.from,l.to).map(u),h.push(Qg(t,l)),h.push(i.facet(tg).scrollToMatch(r.main,t))),t.dispatch({changes:u,selection:r,effects:h,userEvent:"input.replace"}),!0}),xg=gg((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(t=>{let{from:i,to:n}=t;return{from:i,to:n,insert:e.getReplacement(t)}});if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:$c.announce.of(n),userEvent:"input.replace.all"}),!0});function wg(t){return t.state.facet(tg).createPanel(t)}function _g(t,e){var i,n,s,o,r;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(tg);return new eg({search:(null!==(i=null==e?void 0:e.literal)&&void 0!==i?i:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(n=null==e?void 0:e.caseSensitive)&&void 0!==n?n:c.caseSensitive,literal:null!==(s=null==e?void 0:e.literal)&&void 0!==s?s:c.literal,regexp:null!==(o=null==e?void 0:e.regexp)&&void 0!==o?o:c.regexp,wholeWord:null!==(r=null==e?void 0:e.wholeWord)&&void 0!==r?r:c.wholeWord})}function Sg(t){let e=Zh(t,wg);return e&&e.dom.querySelector("[main-field]")}function kg(t){let e=Sg(t);e&&e==t.root.activeElement&&e.select()}const $g=t=>{let e=t.state.field(ug,!1);if(e&&e.panel){let i=Sg(t);if(i&&i!=t.root.activeElement){let n=_g(t.state,e.query.spec);n.valid&&t.dispatch({effects:cg.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[hg.of(!0),e?cg.of(_g(t.state,e.query.spec)):Rs.appendConfig.of(Rg)]});return!0},Tg=t=>{let e=t.state.field(ug,!1);if(!e||!e.panel)return!1;let i=Zh(t,wg);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:hg.of(!1)}),!0},Cg=[{key:"Mod-f",run:$g,scope:"editor search-panel"},{key:"F3",run:vg,shift:yg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:vg,shift:yg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Tg,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:s}=i.main,o=[],r=0;for(let e=new Dm(t.doc,t.sliceDoc(n,s));!e.next().done;){if(o.length>1e3)return!1;e.value.from==n&&(r=o.length),o.push(is.range(e.value.from,e.value.to))}return e(t.update({selection:is.create(o,r),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:t=>{let e=Zh(t,Zm);if(!e){let i=[Wm.of(!0)];null==t.state.field(Fm,!1)&&i.push(Rs.appendConfig.of([Fm,Xm])),t.dispatch({effects:i}),e=Zh(t,Zm)}return e&&e.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(t=>t.from===t.to))return(({state:t,dispatch:e})=>{let{selection:i}=t,n=is.create(i.ranges.map(e=>t.wordAt(e.head)||is.cursor(e.head)),i.mainIndex);return!n.eq(i)&&(e(t.update({selection:n})),!0)})({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(e=>t.sliceDoc(e.from,e.to)!=n))return!1;let s=function(t,e){let{main:i,ranges:n}=t.selection,s=t.wordAt(i.head),o=s&&s.from==i.from&&s.to==i.to;for(let i=!1,s=new Dm(t.doc,e,n[n.length-1].to);;){if(s.next(),!s.done){if(i&&n.some(t=>t.from==s.value.from))continue;if(o){let e=t.wordAt(s.value.from);if(!e||e.from!=s.value.from||e.to!=s.value.to)continue}return s.value}if(i)return null;s=new Dm(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),i=!0}}(t,n);return!!s&&(e(t.update({selection:t.selection.addRange(is.range(s.from,s.to),!1),effects:$c.scrollIntoView(s.to)})),!0)},preventDefault:!0}];class Pg{constructor(t){this.view=t;let e=this.query=t.state.field(ug).query.spec;function i(t,e,i){return Am("button",{class:"cm-button",name:t,onclick:e,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=Am("input",{value:e.search,placeholder:Eg(t,"Find"),"aria-label":Eg(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Am("input",{value:e.replace,placeholder:Eg(t,"Replace"),"aria-label":Eg(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Am("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=Am("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=Am("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit}),this.dom=Am("div",{onkeydown:t=>this.keydown(t),class:"cm-search"},[this.searchField,i("next",()=>vg(t),[Eg(t,"next")]),i("prev",()=>yg(t),[Eg(t,"previous")]),i("select",()=>Og(t),[Eg(t,"all")]),Am("label",null,[this.caseField,Eg(t,"match case")]),Am("label",null,[this.reField,Eg(t,"regexp")]),Am("label",null,[this.wordField,Eg(t,"by word")]),...t.state.readOnly?[]:[Am("br"),this.replaceField,i("replace",()=>bg(t),[Eg(t,"replace")]),i("replaceAll",()=>xg(t),[Eg(t,"replace all")])],Am("button",{name:"close",onclick:()=>Tg(t),"aria-label":Eg(t,"close"),type:"button"},["×"])])}commit(){let t=new eg({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:cg.of(t)}))}keydown(t){var e,i,n;e=this.view,i=t,n="search-panel",zc(Ic(e.state),i,e,n)?t.preventDefault():13==t.keyCode&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?yg:vg)(this.view)):13==t.keyCode&&t.target==this.replaceField&&(t.preventDefault(),bg(this.view))}update(t){for(let e of t.transactions)for(let t of e.effects)t.is(cg)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(tg).top}}function Eg(t,e){return t.state.phrase(e)}const Ag=30,Mg=/[\s\.,:;?!]/;function Qg(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),s=t.state.doc.lineAt(i).to,o=Math.max(n.from,e-Ag),r=Math.min(s,i+Ag),a=t.state.sliceDoc(o,r);if(o!=n.from)for(let t=0;t<Ag;t++)if(!Mg.test(a[t+1])&&Mg.test(a[t])){a=a.slice(t);break}if(r!=s)for(let t=a.length-1;t>a.length-Ag;t--)if(!Mg.test(a[t-1])&&Mg.test(a[t])){a=a.slice(0,t);break}return $c.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${n.number}.`)}const Dg=$c.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"}}),Rg=[ug,ys.low(mg),Dg];class Ig{constructor(t,e,i,n){this.state=t,this.pos=e,this.explicit=i,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=Pd(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),s=n.search(Bg(t,!1));return s<0?null:{from:i+s,to:this.pos,text:n.slice(s)}}get aborted(){return null==this.abortListeners}addEventListener(t,e,i){"abort"==t&&this.abortListeners&&(this.abortListeners.push(e),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function Lg(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Ng(t){let e=t.map(t=>"string"==typeof t?{label:t}:t),[i,n]=e.every(t=>/^\w+$/.test(t.label))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:n}of t){e[n[0]]=!0;for(let t=1;t<n.length;t++)i[n[t]]=!0}let n=Lg(e)+Lg(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}(e);return t=>{let s=t.matchBefore(n);return s||t.explicit?{from:s?s.from:t.pos,options:e,validFor:i}:null}}class jg{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function zg(t){return t.selection.main.from}function Bg(t,e){var i;let{source:n}=t,s=e&&"^"!=n[0],o="$"!=n[n.length-1];return s||o?new RegExp(`${s?"^":""}(?:${n})${o?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const Zg=Ms.define();function Wg(t,e,i,n){let{main:s}=t.selection,o=i-s.from,r=n-s.from;return{...t.changeByRange(a=>{if(a!=s&&i!=n&&t.sliceDoc(a.from+o,a.from+r)!=t.sliceDoc(i,n))return{range:a};let l=t.toText(e);return{changes:{from:a.from+o,to:n==s.from?a.to:a.from+r,insert:l},range:is.cursor(a.from+o+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const Fg=new WeakMap;function Xg(t){if(!Array.isArray(t))return t;let e=Fg.get(t);return e||Fg.set(t,e=Ng(t)),e}const qg=Rs.define(),Hg=Rs.define();class Vg{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let i=Zn(t,e),n=Fn(i);this.chars.push(i);let s=t.slice(e,e+n),o=s.toUpperCase();this.folded.push(Zn(o==s?s.toLowerCase():o,0)),e+=n}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(0==this.pattern.length)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:i,any:n,precise:s,byWord:o}=this;if(1==e.length){let n=Zn(t,0),s=Fn(n),o=s==t.length?0:-100;if(n==e[0]);else{if(n!=i[0])return null;o+=-200}return this.ret(o,[0,s])}let r=t.indexOf(this.pattern);if(0==r)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=e.length,l=0;if(r<0){for(let s=0,o=Math.min(t.length,200);s<o&&l<a;){let o=Zn(t,s);o!=e[l]&&o!=i[l]||(n[l++]=s),s+=Fn(o)}if(l<a)return null}let c=0,h=0,u=!1,d=0,f=-1,p=-1,m=/[a-z]/.test(t),g=!0;for(let n=0,l=Math.min(t.length,200),v=0;n<l&&h<a;){let l=Zn(t,n);r<0&&(c<a&&l==e[c]&&(s[c++]=n),d<a&&(l==e[d]||l==i[d]?(0==d&&(f=n),p=n+1,d++):d=0));let y,O=l<255?l>=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(y=Wn(l))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!n||1==O&&m||0==v&&0!=O)&&(e[h]==l||i[h]==l&&(u=!0)?o[h++]=n:o.length&&(g=!1)),v=O,n+=Fn(l)}return h==a&&0==o[0]&&g?this.result((u?-200:0)-100,o,t):d==a&&0==f?this.ret(-200-t.length+(p==t.length?0:-100),[0,p]):r>-1?this.ret(-700-t.length,[r,r+this.pattern.length]):d==a?this.ret(-900-t.length,[f,p]):h==a?this.result((u?-200:0)-100-700+(g?0:-1100),o,t):2==e.length?null:this.result((n[0]?-700:0)-200-1100,n,t)}result(t,e,i){let n=[],s=0;for(let t of e){let e=t+(this.astral?Fn(Zn(i,t)):1);s&&n[s-1]==t?n[s-1]=e:(n[s++]=t,n[s++]=e)}return this.ret(t-i.length,n)}}class Yg{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return null==i?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this)}}const Ug=os.define({combine:t=>Vs(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Kg,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Gg(t(i),e(i)),optionClass:(t,e)=>i=>Gg(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})});function Gg(t,e){return t?e?t+" "+e:t:e}function Kg(t,e,i,n,s,o){let r,a,l=t.textDirection==zr.RTL,c=l,h=!1,u="top",d=e.left-s.left,f=s.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(c&&d<Math.min(p,f)?c=!1:!c&&f<Math.min(p,d)&&(c=!0),p<=(c?d:f))r=Math.max(s.top,Math.min(i.top,s.bottom-m))-e.top,a=Math.min(400,c?d:f);else{h=!0,a=Math.min(400,(l?e.right:s.right-e.left)-30);let t=s.bottom-e.bottom;t>=m||t>e.top?r=i.bottom-e.top:(u="bottom",r=e.bottom-i.top)}return{style:`${u}: ${r/((e.bottom-e.top)/o.offsetHeight)}px; max-width: ${a/((e.right-e.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(h?l?"left-narrow":"right-narrow":c?"left":"right")}}function Jg(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class tv{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:s,selected:o}=n.open,r=t.state.facet(Ug);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map(t=>"cm-completionIcon-"+t)),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i,n){let s=document.createElement("span");s.className="cm-completionLabel";let o=t.displayLabel||t.label,r=0;for(let t=0;t<n.length;){let e=n[t++],i=n[t++];e>r&&s.appendChild(document.createTextNode(o.slice(r,e)));let a=s.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(o.slice(e,i))),a.className="cm-completionMatchedText",r=i}return r<o.length&&s.appendChild(document.createTextNode(o.slice(r))),s},position:50},{render(t){if(!t.detail)return null;let e=document.createElement("span");return e.className="cm-completionDetail",e.textContent=t.detail,e},position:80}),e.sort((t,e)=>t.position-e.position).map(t=>t.render)}(r),this.optionClass=r.optionClass,this.tooltipClass=r.tooltipClass,this.range=Jg(s.length,o,r.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",i=>{let{options:n}=t.state.field(e).open;for(let e,s=i.target;s&&s!=this.dom;s=s.parentNode)if("LI"==s.nodeName&&(e=/-(\d+)$/.exec(s.id))&&+e[1]<n.length)return this.applyCompletion(t,n[+e[1]]),void i.preventDefault()}),this.dom.addEventListener("focusout",e=>{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(Ug).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Hg.of(null)})}),this.showOptions(s,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:s,selected:o,disabled:r}=i.open;n.open&&n.open.options==s||(this.range=Jg(s.length,o,t.state.facet(Ug).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),r!=(null===(e=n.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!r)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=Jg(e.options.length,e.selected,this.view.state.facet(Ug).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let s="string"==typeof n?document.createTextNode(n):n(i);if(!s)return;"then"in s?s.then(e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,i)}).catch(t=>xa(this.view.state,t,"completion info")):this.addInfoPane(s,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:n}=t;i.appendChild(e),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return e&&function(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),s=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/s:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/s)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),s=this.space;if(!s){let t=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:t.clientWidth,bottom:t.clientHeight}}return n.top>Math.min(s.bottom,e.bottom)-10||n.bottom<Math.max(s.top,e.top)+10?null:this.view.state.facet(Ug).positionInfo(this.view,e,n,i,s,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,i){const n=document.createElement("ul");n.id=e,n.setAttribute("role","listbox"),n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",this.view.state.phrase("Completions")),n.addEventListener("mousedown",t=>{t.target==n&&t.preventDefault()});let s=null;for(let o=i.from;o<i.to;o++){let{completion:r,match:a}=t[o],{section:l}=r;if(l){let t="string"==typeof l?l:l.name;if(t!=s&&(o>i.from||0==i.from))if(s=t,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=t}}const c=n.appendChild(document.createElement("li"));c.id=e+"-"+o,c.setAttribute("role","option");let h=this.optionClass(r);h&&(c.className=h);for(let t of this.optionContent){let e=t(r,this.view.state,this.view,a);e&&c.appendChild(e)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&n.classList.add("cm-completionListIncompleteBottom"),n}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function ev(t,e){return i=>new tv(i,t,e)}function iv(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class nv{constructor(t,e,i,n,s,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=s,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new nv(this.options,av(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,s,o){if(n&&!o&&t.some(t=>t.isPending))return n.setDisabled();let r=function(t,e){let i=[],n=null,s=null,o=t=>{i.push(t);let{section:e}=t.completion;if(e){n||(n=[]);let t="string"==typeof e?e:e.name;n.some(e=>e.name==t)||n.push("string"==typeof e?{name:t}:e)}},r=e.facet(Ug);for(let n of t)if(n.hasResult()){let t=n.result.getMatch;if(!1===n.result.filter)for(let e of n.result.options)o(new jg(e,n.source,t?t(e):[],1e9-i.length));else{let i,a=e.sliceDoc(n.from,n.to),l=r.filterStrict?new Yg(a):new Vg(a);for(let e of n.result.options)if(i=l.match(e.label)){let r=e.displayLabel?t?t(e,i.matched):[]:i.matched,a=i.score+(e.boost||0);if(o(new jg(e,n.source,r,a)),"object"==typeof e.section&&"dynamic"===e.section.rank){let{name:t}=e.section;s||(s=Object.create(null)),s[t]=Math.max(a,s[t]||-1e9)}}}}if(n){let t=Object.create(null),e=0,o=(t,e)=>("dynamic"===t.rank&&"dynamic"===e.rank?s[e.name]-s[t.name]:0)||("number"==typeof t.rank?t.rank:1e9)-("number"==typeof e.rank?e.rank:1e9)||(t.name<e.name?-1:1);for(let i of n.sort(o))e-=1e5,t[i.name]=e;for(let e of i){let{section:i}=e.completion;i&&(e.score+=t["string"==typeof i?i:i.name])}}let a=[],l=null,c=r.compareCompletions;for(let t of i.sort((t,e)=>e.score-t.score||c(t.completion,e.completion))){let e=t.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?a.push(t):iv(t.completion)>iv(l)&&(a[a.length-1]=t),l=t.completion}return a}(t,e);if(!r.length)return n&&t.some(t=>t.isPending)?n.setDisabled():null;let a=e.facet(Ug).selectOnOpen?0:-1;if(n&&n.selected!=a&&-1!=n.selected){let t=n.options[n.selected].completion;for(let e=0;e<r.length;e++)if(r[e].completion==t){a=e;break}}return new nv(r,av(i,a),{pos:t.reduce((t,e)=>e.hasResult()?Math.min(t,e.from):t,1e8),create:gv,above:s.aboveCursor},n?n.timestamp:Date.now(),a,!1)}map(t){return new nv(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new nv(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class sv{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new sv(lv,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Ug),n=(i.override||e.languageDataAt("autocomplete",zg(e)).map(Xg)).map(e=>(this.active.find(t=>t.source==e)||new hv(e,this.active.some(t=>0!=t.state)?1:0)).update(t,i));n.length==this.active.length&&n.every((t,e)=>t==this.active[e])&&(n=this.active);let s=this.open,o=t.effects.some(t=>t.is(dv));s&&t.docChanged&&(s=s.map(t.changes)),t.selection||n.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!function(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let s=i==t.length,o=n==e.length;if(s||o)return s==o;if(t[i++].result!=e[n++].result)return!1}}(n,this.active)||o?s=nv.build(n,e,this.id,s,i,o):s&&s.disabled&&!n.some(t=>t.isPending)&&(s=null),!s&&n.every(t=>!t.isPending)&&n.some(t=>t.hasResult())&&(n=n.map(t=>t.hasResult()?new hv(t.source,0):t));for(let e of t.effects)e.is(fv)&&(s=s&&s.setSelected(e.value,this.id));return n==this.active&&s==this.open?this:new sv(n,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?ov:rv}}const ov={"aria-autocomplete":"list"},rv={};function av(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const lv=[];function cv(t,e){if(t.isUserEvent("input.complete")){let i=t.annotation(Zg);if(i&&e.activateOnCompletion(i))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class hv{constructor(t,e,i=!1){this.source=t,this.state=e,this.explicit=i}hasResult(){return!1}get isPending(){return 1==this.state}update(t,e){let i=cv(t,e),n=this;(8&i||16&i&&this.touches(t))&&(n=new hv(n.source,0)),4&i&&0==n.state&&(n=new hv(this.source,1)),n=n.updateFor(t,i);for(let e of t.effects)if(e.is(qg))n=new hv(n.source,1,e.value);else if(e.is(Hg))n=new hv(n.source,0);else if(e.is(dv))for(let t of e.value)t.source==n.source&&(n=t);return n}updateFor(t,e){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(zg(t.state))}}class uv extends hv{constructor(t,e,i,n,s,o){super(t,3,e),this.limit=i,this.result=n,this.from=s,this.to=o}hasResult(){return!0}updateFor(t,e){var i;if(!(3&e))return this.map(t.changes);let n=this.result;n.map&&!t.changes.empty&&(n=n.map(n,t.changes));let s=t.changes.mapPos(this.from),o=t.changes.mapPos(this.to,1),r=zg(t.state);if(r>o||!n||2&e&&(zg(t.startState)==this.from||r<this.limit))return new hv(this.source,4&e?1:0);let a=t.changes.mapPos(this.limit);return function(t,e,i,n){if(!t)return!1;let s=e.sliceDoc(i,n);return"function"==typeof t?t(s,i,n,e):Bg(t,!0).test(s)}(n.validFor,t.state,s,o)?new uv(this.source,this.explicit,a,n,s,o):n.update&&(n=n.update(n,s,o,new Ig(t.state,r,!1)))?new uv(this.source,this.explicit,a,n,n.from,null!==(i=n.to)&&void 0!==i?i:zg(t.state)):new hv(this.source,1,this.explicit)}map(t){if(t.empty)return this;return(this.result.map?this.result.map(this.result,t):this.result)?new uv(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new hv(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}const dv=Rs.define({map:(t,e)=>t.map(t=>t.map(e))}),fv=Rs.define(),pv=ds.define({create:()=>sv.start(),update:(t,e)=>t.update(e),provide:t=>[Mh.from(t,t=>t.tooltip),$c.contentAttributes.from(t,t=>t.attrs)]});function mv(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(pv).active.find(t=>t.source==e.source);return n instanceof uv&&("string"==typeof i?t.dispatch({...Wg(t.state,i,n.from,n.to),annotations:Zg.of(e.completion)}):i(t,e.completion,n.from,n.to),!0)}const gv=ev(pv,mv);function vv(t,e="option"){return i=>{let n=i.state.field(pv,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(Ug).interactionDelay)return!1;let s,o=1;"page"==e&&(s=jh(i,n.open.tooltip))&&(o=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:r}=n.open.options,a=n.open.selected>-1?n.open.selected+o*(t?1:-1):t?0:r-1;return a<0?a="page"==e?0:r-1:a>=r&&(a="page"==e?r-1:0),i.dispatch({effects:fv.of(a)}),!0}}const yv=t=>!!t.state.field(pv,!1)&&(t.dispatch({effects:qg.of(!0)}),!0);class Ov{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const bv=ka.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(pv).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(pv),i=t.state.facet(Ug);if(!t.selectionSet&&!t.docChanged&&t.startState.field(pv)==e)return;let n=t.transactions.some(t=>{let e=cv(t,i);return 8&e||(t.selection||t.docChanged)&&!(3&e)});for(let e=0;e<this.running.length;e++){let i=this.running[e];if(n||i.context.abortOnDocChange&&t.docChanged||i.updates.length+t.transactions.length>50&&Date.now()-i.time>1e3){for(let t of i.context.abortListeners)try{t()}catch(t){xa(this.view.state,t)}i.context.abortListeners=null,this.running.splice(e--,1)}else i.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(t=>t.effects.some(t=>t.is(qg)))&&(this.pendingStart=!0);let s=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(t=>t.isPending&&!this.running.some(e=>e.active.source==t.source))?setTimeout(()=>this.startUpdate(),s):-1,0!=this.composing)for(let e of t.transactions)e.isUserEvent("input.type")?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(pv);for(let t of e.active)t.isPending&&!this.running.some(e=>e.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ug).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=zg(e),n=new Ig(e,i,t.explicit,this.view),s=new Ov(t,n);this.running.push(s),Promise.resolve(t.source(n)).then(t=>{s.context.aborted||(s.done=t||null,this.scheduleAccept())},t=>{this.view.dispatch({effects:Hg.of(null)}),xa(this.view.state,t)})}scheduleAccept(){this.running.every(t=>void 0!==t.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ug).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Ug),n=this.view.state.field(pv);for(let s=0;s<this.running.length;s++){let o=this.running[s];if(void 0===o.done)continue;if(this.running.splice(s--,1),o.done){let n=zg(o.updates.length?o.updates[0].startState:this.view.state),s=Math.min(n,o.done.from+(o.active.explicit?0:1)),r=new uv(o.active.source,o.active.explicit,s,o.done,o.done.from,null!==(t=o.done.to)&&void 0!==t?t:n);for(let t of o.updates)r=r.update(t,i);if(r.hasResult()){e.push(r);continue}}let r=n.active.find(t=>t.source==o.active.source);if(r&&r.isPending)if(null==o.done){let t=new hv(o.active.source,0);for(let e of o.updates)t=t.update(e,i);t.isPending||e.push(t)}else this.startQuery(r)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:dv.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(pv,!1);if(e&&e.tooltip&&this.view.state.facet(Ug).closeOnBlur){let i=e.open&&jh(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:Hg.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:qg.of(!1)}),20),this.composing=0}}}),xv="object"==typeof navigator&&/Win/.test(navigator.platform),wv=ys.highest($c.domEventHandlers({keydown(t,e){let i=e.state.field(pv,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&(!xv||!t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],s=i.active.find(t=>t.source==n.source),o=n.completion.commitCharacters||s.result.commitCharacters;return o&&o.indexOf(t.key)>-1&&mv(e,n),!1}})),_v=$c.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"}}});class Sv{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class kv{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,qn.TrackDel),i=t.mapPos(this.to,1,qn.TrackDel);return null==e||null==i?null:new kv(this.field,e,i)}}class $v{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],s=t.doc.lineAt(e),o=/^\s*/.exec(s.text)[0];for(let s of this.lines){if(i.length){let i=o,r=/^\t*/.exec(s)[0].length;for(let e=0;e<r;e++)i+=t.facet(Bd);n.push(e+i.length-r),s=i+s.slice(r)}i.push(s),e+=s.length+1}let r=this.fieldPositions.map(t=>new kv(t.field,n[t.line]+t.from,n[t.line]+t.to));return{text:i,ranges:r}}static parse(t){let e,i=[],n=[],s=[];for(let o of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let t=e[1]?+e[1]:null,r=e[2]||e[3]||"",a=-1,l=r.replace(/\\[{}]/g,t=>t[1]);for(let e=0;e<i.length;e++)(null!=t?i[e].seq==t:l&&i[e].name==l)&&(a=e);if(a<0){let e=0;for(;e<i.length&&(null==t||null!=i[e].seq&&i[e].seq<t);)e++;i.splice(e,0,{seq:t,name:l}),a=e;for(let t of s)t.field>=a&&t.field++}for(let t of s)if(t.line==n.length&&t.from>e.index){let i=e[2]?3+(e[1]||"").length:2;t.from-=i,t.to-=i}s.push(new Sv(a,n.length,e.index,e.index+l.length)),o=o.slice(0,e.index)+r+o.slice(e.index+e[0].length)}o=o.replace(/\\([{}])/g,(t,e,i)=>{for(let t of s)t.line==n.length&&t.from>i&&(t.from--,t.to--);return e}),n.push(o)}return new $v(n,s)}}let Tv=Cr.widget({widget:new class extends $r{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Cv=Cr.mark({class:"cm-snippetField"});class Pv{constructor(t,e){this.ranges=t,this.active=e,this.deco=Cr.set(t.map(t=>(t.from==t.to?Tv:Cv).range(t.from,t.to)),!0)}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new Pv(e,this.active)}selectionInsideField(t){return t.ranges.every(t=>this.ranges.some(e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))}}const Ev=Rs.define({map:(t,e)=>t&&t.map(e)}),Av=Rs.define(),Mv=ds.define({create:()=>null,update(t,e){for(let i of e.effects){if(i.is(Ev))return i.value;if(i.is(Av)&&t)return new Pv(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>$c.decorations.from(t,t=>t?t.deco:Cr.none)});function Qv(t,e){return is.create(t.filter(t=>t.field==e).map(t=>is.range(t.from,t.to)))}function Dv(t){let e=$v.parse(t);return(t,i,n,s)=>{let{text:o,ranges:r}=e.instantiate(t.state,n),{main:a}=t.state.selection,l={changes:{from:n,to:s==a.from?a.to:s,insert:An.of(o)},scrollIntoView:!0,annotations:i?[Zg.of(i),Is.userEvent.of("input.complete")]:void 0};if(r.length&&(l.selection=Qv(r,0)),r.some(t=>t.field>0)){let e=new Pv(r,0),i=l.effects=[Ev.of(e)];void 0===t.state.field(Mv,!1)&&i.push(Rs.appendConfig.of([Mv,Nv,zv,_v]))}t.dispatch(t.state.update(l))}}function Rv(t){return({state:e,dispatch:i})=>{let n=e.field(Mv,!1);if(!n||t<0&&0==n.active)return!1;let s=n.active+t,o=t>0&&!n.ranges.some(e=>e.field==s+t);return i(e.update({selection:Qv(n.ranges,s),effects:Ev.of(o?null:new Pv(n.ranges,s)),scrollIntoView:!0})),!0}}const Iv=[{key:"Tab",run:Rv(1),shift:Rv(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(Mv,!1)&&(e(t.update({effects:Ev.of(null)})),!0)}],Lv=os.define({combine:t=>t.length?t[0]:Iv}),Nv=ys.highest(Dc.compute([Lv],t=>t.facet(Lv)));function jv(t,e){return{...e,apply:Dv(t)}}const zv=$c.domEventHandlers({mousedown(t,e){let i,n=e.state.field(Mv,!1);if(!n||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let s=n.ranges.find(t=>t.from<=i&&t.to>=i);return!(!s||s.field==n.active)&&(e.dispatch({selection:Qv(n.ranges,s.field),effects:Ev.of(n.ranges.some(t=>t.field>s.field)?new Pv(n.ranges,s.field):null),scrollIntoView:!0}),!0)}});const Bv={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Zv=Rs.define({map(t,e){let i=e.mapPos(t,-1,qn.TrackAfter);return null==i?void 0:i}}),Wv=new class extends Ys{};Wv.startSide=1,Wv.endSide=-1;const Fv=ds.define({create:()=>Js.empty,update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:t=>t>=i.from&&t<=i.to})}for(let i of e.effects)i.is(Zv)&&(t=t.update({add:[Wv.range(i.value,i.value+1)]}));return t}});const Xv="()[]{}<>«»»«[]{}";function qv(t){for(let e=0;e<16;e+=2)if(Xv.charCodeAt(e)==t)return Xv.charAt(e+1);return Wn(t<128?t:t+1)}function Hv(t,e){return t.languageDataAt("closeBrackets",e)[0]||Bv}const Vv="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),Yv=$c.inputHandler.of((t,e,i,n)=>{if((Vv?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(n.length>2||2==n.length&&1==Fn(Zn(n,0))||e!=s.from||i!=s.to)return!1;let o=function(t,e){let i=Hv(t,t.selection.main.head),n=i.brackets||Bv.brackets;for(let s of n){let o=qv(Zn(s,0));if(e==s)return o==s?ey(t,s,n.indexOf(s+s+s)>-1,i):Jv(t,s,o,i.before||Bv.before);if(e==o&&Gv(t,t.selection.main.from))return ty(t,s,o)}return null}(t.state,n);return!!o&&(t.dispatch(o),!0)}),Uv=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Hv(t,t.selection.main.head).brackets||Bv.brackets,n=null,s=t.changeByRange(e=>{if(e.empty){let n=function(t,e){let i=t.sliceString(e-2,e);return Fn(Zn(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let s of i)if(s==n&&Kv(t.doc,e.head)==qv(Zn(s,0)))return{changes:{from:e.head-s.length,to:e.head+s.length},range:is.cursor(e.head-s.length)}}return{range:n=e}});return n||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!n}}];function Gv(t,e){let i=!1;return t.field(Fv).between(0,t.doc.length,t=>{t==e&&(i=!0)}),i}function Kv(t,e){let i=t.sliceString(e,e+2);return i.slice(0,Fn(Zn(i,0)))}function Jv(t,e,i,n){let s=null,o=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:i,from:o.to}],effects:Zv.of(o.to+e.length),range:is.range(o.anchor+e.length,o.head+e.length)};let r=Kv(t.doc,o.head);return!r||/\s/.test(r)||n.indexOf(r)>-1?{changes:{insert:e+i,from:o.head},effects:Zv.of(o.head+e.length),range:is.cursor(o.head+e.length)}:{range:s=o}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ty(t,e,i){let n=null,s=t.changeByRange(e=>e.empty&&Kv(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:is.cursor(e.head+i.length)}:n={range:e});return n?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function ey(t,e,i,n){let s=n.stringPrefixes||Bv.stringPrefixes,o=null,r=t.changeByRange(n=>{if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:e,from:n.to}],effects:Zv.of(n.to+e.length),range:is.range(n.anchor+e.length,n.head+e.length)};let r,a=n.head,l=Kv(t.doc,a);if(l==e){if(iy(t,a))return{changes:{insert:e+e,from:a},effects:Zv.of(a+e.length),range:is.cursor(a+e.length)};if(Gv(t,a)){let n=i&&t.sliceDoc(a,a+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+n.length,insert:n},range:is.cursor(a+n.length)}}}else{if(i&&t.sliceDoc(a-2*e.length,a)==e+e&&(r=ny(t,a-2*e.length,s))>-1&&iy(t,r))return{changes:{insert:e+e+e+e,from:a},effects:Zv.of(a+e.length),range:is.cursor(a+e.length)};if(t.charCategorizer(a)(l)!=Ws.Word&&ny(t,a,s)>-1&&!function(t,e,i,n){let s=Pd(t).resolveInner(e,-1),o=n.reduce((t,e)=>Math.max(t,e.length),0);for(let r=0;r<5;r++){let r=t.sliceDoc(s.from,Math.min(s.to,s.from+i.length+o)),a=r.indexOf(i);if(!a||a>-1&&n.indexOf(r.slice(0,a))>-1){let e=s.firstChild;for(;e&&e.from==s.from&&e.to-e.from>i.length+a;){if(t.sliceDoc(e.to-i.length,e.to)==i)return!1;e=e.firstChild}return!0}let l=s.to==e&&s.parent;if(!l)break;s=l}return!1}(t,a,e,s))return{changes:{insert:e+e,from:a},effects:Zv.of(a+e.length),range:is.cursor(a+e.length)}}return{range:o=n}});return o?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function iy(t,e){let i=Pd(t).resolveInner(e+1);return i.parent&&i.from==e}function ny(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Ws.Word)return e;for(let s of i){let i=e-s.length;if(t.sliceDoc(i,e)==s&&n(t.sliceDoc(i-1,i))!=Ws.Word)return i}return-1}function sy(t={}){return[wv,pv,Ug.of(t),bv,ry,_v]}const oy=[{key:"Ctrl-Space",run:yv},{mac:"Alt-`",run:yv},{mac:"Alt-i",run:yv},{key:"Escape",run:t=>{let e=t.state.field(pv,!1);return!(!e||!e.active.some(t=>0!=t.state))&&(t.dispatch({effects:Hg.of(null)}),!0)}},{key:"ArrowDown",run:vv(!0)},{key:"ArrowUp",run:vv(!1)},{key:"PageDown",run:vv(!0,"page")},{key:"PageUp",run:vv(!1,"page")},{key:"Enter",run:t=>{let e=t.state.field(pv,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Ug).interactionDelay)&&mv(t,e.open.options[e.open.selected])}}],ry=ys.highest(Dc.computeN([Ug],t=>t.facet(Ug).defaultKeymap?[oy]:[]));class ay{constructor(t,e,i){this.from=t,this.to=e,this.diagnostic=i}}class ly{constructor(t,e,i){this.diagnostics=t,this.panel=e,this.selected=i}static init(t,e,i){let n=i.facet(xy).markerFilter;n&&(t=n(t,i));let s=t.slice().sort((t,e)=>t.from-e.from||t.to-e.to),o=new to,r=[],a=0;for(let t=0;;){let e,n,l=t==s.length?null:s[t];if(!l&&!r.length)break;for(r.length?(e=a,n=r.reduce((t,e)=>Math.min(t,e.to),l&&l.from>e?l.from:1e8)):(e=l.from,n=l.to,r.push(l),t++);t<s.length;){let i=s[t];if(i.from!=e||!(i.to>i.from||i.to==e)){n=Math.min(i.from,n);break}r.push(i),t++,n=Math.min(i.to,n)}let c=My(r);if(r.some(t=>t.from==t.to||t.from==t.to-1&&i.doc.lineAt(t.from).to==t.from))o.add(e,e,Cr.widget({widget:new ky(c),diagnostics:r.slice()}));else{let t=r.reduce((t,e)=>e.markClass?t+" "+e.markClass:t,"");o.add(e,n,Cr.mark({class:"cm-lintRange cm-lintRange-"+c+t,diagnostics:r.slice(),inclusiveEnd:r.some(t=>t.to>n)}))}a=n;for(let t=0;t<r.length;t++)r[t].to<=a&&r.splice(t--,1)}let l=o.finish();return new ly(l,e,cy(l))}}function cy(t,e=null,i=0){let n=null;return t.between(i,1e9,(t,i,{spec:s})=>{if(!(e&&s.diagnostics.indexOf(e)<0))if(n){if(s.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new ay(n.from,i,n.diagnostic)}else n=new ay(t,i,e||s.diagnostics[0])}),n}function hy(t,e){let i=e.pos,n=e.end||i,s=t.state.facet(xy).hideOn(t,i,n);if(null!=s)return s;let o=t.startState.doc.lineAt(e.pos);return!(!t.effects.some(t=>t.is(dy))&&!t.changes.touchesRange(o.from,Math.max(o.to,n)))}function uy(t,e){return t.field(my,!1)?e:e.concat(Rs.appendConfig.of(Qy))}const dy=Rs.define(),fy=Rs.define(),py=Rs.define(),my=ds.define({create:()=>new ly(Cr.none,null,null),update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),n=null,s=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);n=cy(i,t.selected.diagnostic,s)||cy(i,null,s)}!i.size&&s&&e.state.facet(xy).autoPanel&&(s=null),t=new ly(i,s,n)}for(let i of e.effects)if(i.is(dy)){let n=e.state.facet(xy).autoPanel?i.value.length?Ty.open:null:t.panel;t=ly.init(i.value,n,e.state)}else i.is(fy)?t=new ly(t.diagnostics,i.value?Ty.open:null,t.selected):i.is(py)&&(t=new ly(t.diagnostics,t.panel,i.value));return t},provide:t=>[qh.from(t,t=>t.panel),$c.decorations.from(t,t=>t.diagnostics)]});const gy=Cr.mark({class:"cm-lintRange cm-lintRange-active"});function vy(t,e,i){let n,{diagnostics:s}=t.state.field(my),o=-1,r=-1;s.between(e-(i<0?1:0),e+(i>0?1:0),(t,s,{spec:a})=>{if(e>=t&&e<=s&&(t==s||(e>t||i>0)&&(e<s||i<0)))return n=a.diagnostics,o=t,r=s,!1});let a=t.state.facet(xy).tooltipFilter;return n&&a&&(n=a(n,t.state)),n?{pos:o,end:r,above:t.state.doc.lineAt(o).to<r,create:()=>({dom:yy(t,n)})}:null}function yy(t,e){return Am("ul",{class:"cm-tooltip-lint"},e.map(e=>Sy(t,e,!1)))}const Oy=t=>{let e=t.state.field(my,!1);return!(!e||!e.panel)&&(t.dispatch({effects:fy.of(!1)}),!0)},by=[{key:"Mod-Shift-m",run:t=>{let e=t.state.field(my,!1);e&&e.panel||t.dispatch({effects:uy(t.state,[fy.of(!0)])});let i=Zh(t,Ty.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:t=>{let e=t.state.field(my,!1);if(!e)return!1;let i=t.state.selection.main,n=e.diagnostics.iter(i.to+1);return!(!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==i.from&&n.to==i.to))&&(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)}}];const xy=os.define({combine:t=>({sources:t.map(t=>t.source).filter(t=>null!=t),...Vs(t.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:wy,tooltipFilter:wy,needsRefresh:(t,e)=>t?e?i=>t(i)||e(i):t:e,hideOn:(t,e)=>t?e?(i,n,s)=>t(i,n,s)||e(i,n,s):t:e,autoPanel:(t,e)=>t||e})})});function wy(t,e){return t?e?(i,n)=>e(t(i,n),n):t:e}function _y(t){let e=[];if(t)t:for(let{name:i}of t){for(let t=0;t<i.length;t++){let n=i[t];if(/[a-zA-Z]/.test(n)&&!e.some(t=>t.toLowerCase()==n.toLowerCase())){e.push(n);continue t}}e.push("")}return e}function Sy(t,e,i){var n;let s=i?_y(e.actions):[];return Am("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Am("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),null===(n=e.actions)||void 0===n?void 0:n.map((i,n)=>{let o=!1,r=n=>{if(n.preventDefault(),o)return;o=!0;let s=cy(t.state.field(my).diagnostics,e);s&&i.apply(t,s.from,s.to)},{name:a}=i,l=s[n]?a.indexOf(s[n]):-1,c=l<0?a:[a.slice(0,l),Am("u",a.slice(l,l+1)),a.slice(l+1)];return Am("button",{type:"button",class:"cm-diagnosticAction"+(i.markClass?" "+i.markClass:""),onclick:r,onmousedown:r,"aria-label":` Action: ${a}${l<0?"":` (access key "${s[n]})"`}.`},c)}),e.source&&Am("div",{class:"cm-diagnosticSource"},e.source))}class ky extends $r{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return Am("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class $y{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Sy(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ty{constructor(t){this.view=t,this.items=[];this.list=Am("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e=>{if(27==e.keyCode)Oy(this.view),this.view.focus();else if(38==e.keyCode||33==e.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==e.keyCode||34==e.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==e.keyCode)this.moveSelection(0);else if(35==e.keyCode)this.moveSelection(this.items.length-1);else if(13==e.keyCode)this.view.focus();else{if(!(e.keyCode>=65&&e.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:i}=this.items[this.selectedIndex],n=_y(i.actions);for(let s=0;s<n.length;s++)if(n[s].toUpperCase().charCodeAt(0)==e.keyCode){let e=cy(this.view.state.field(my).diagnostics,i);e&&i.actions[s].apply(t,e.from,e.to)}}}e.preventDefault()},onclick:t=>{for(let e=0;e<this.items.length;e++)this.items[e].dom.contains(t.target)&&this.moveSelection(e)}}),this.dom=Am("div",{class:"cm-panel-lint"},this.list,Am("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Oy(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(my).selected;if(!t)return-1;for(let e=0;e<this.items.length;e++)if(this.items[e].diagnostic==t.diagnostic)return e;return-1}update(){let{diagnostics:t,selected:e}=this.view.state.field(my),i=0,n=!1,s=null,o=new Set;for(t.between(0,this.view.state.doc.length,(t,r,{spec:a})=>{for(let t of a.diagnostics){if(o.has(t))continue;o.add(t);let r,a=-1;for(let e=i;e<this.items.length;e++)if(this.items[e].diagnostic==t){a=e;break}a<0?(r=new $y(this.view,t),this.items.splice(i,0,r),n=!0):(r=this.items[a],a>i&&(this.items.splice(i,a-i),n=!0)),e&&r.diagnostic==e.diagnostic?r.dom.hasAttribute("aria-selected")||(r.dom.setAttribute("aria-selected","true"),s=r):r.dom.hasAttribute("aria-selected")&&r.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 $y(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),n=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:t,panel:e})=>{let i=e.height/this.list.offsetHeight;t.top<e.top?this.list.scrollTop-=(e.top-t.top)/i:t.bottom>e.bottom&&(this.list.scrollTop+=(t.bottom-e.bottom)/i)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let t=this.list.firstChild;function e(){let e=t;t=e.nextSibling,e.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)e();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=cy(this.view.state.field(my).diagnostics,this.items[t].diagnostic);e&&this.view.dispatch({selection:{anchor:e.from,head:e.to},scrollIntoView:!0,effects:py.of(e)})}static open(t){return new Ty(t)}}function Cy(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function Py(t){return Cy(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Ey=$c.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:Py("#d11")},".cm-lintRange-warning":{backgroundImage:Py("orange")},".cm-lintRange-info":{backgroundImage:Py("#999")},".cm-lintRange-hint":{backgroundImage:Py("#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}}});function Ay(t){return"error"==t?4:"warning"==t?3:"info"==t?2:1}function My(t){let e="hint",i=1;for(let n of t){let t=Ay(n.severity);t>i&&(i=t,e=n.severity)}return e}const Qy=[my,$c.decorations.compute([my],t=>{let{selected:e,panel:i}=t.field(my);return e&&i&&e.from!=e.to?Cr.set([gy.range(e.from,e.to)]):Cr.none}),Nh(vy,{hideOn:hy}),Ey];const Dy=(()=>[fu(),gu,hh(),mp(),kf(),Vc(),[eh,ih],Hs.allowMultipleSelections.of(!0),Hs.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,s=i.lineAt(n);if(n>s.from+200)return t;let o=i.sliceString(s.from,n);if(!e.some(t=>t.test(o)))return t;let{state:r}=t,a=-1,l=[];for(let{head:t}of r.selection.ranges){let e=r.doc.lineAt(t);if(e.from==a)continue;a=e.from;let i=Fd(r,e.from);if(null==i)continue;let n=/^\s*/.exec(e.text)[0],s=Wd(r,i);n!=s&&l.push({from:e.from,to:e.from+n.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}),Af(Df,{fallback:!0}),Wf(),[Yv,Fv],sy(),Oh(),wh(),mh,Vm(),Dc.of([...Uv,...Em,...Cg,...Mp,...gf,...oy,...by])])();class Ry{constructor(t,e,i,n,s,o,r,a,l,c=0,h){this.p=t,this.stack=e,this.state=i,this.reducePos=n,this.pos=s,this.score=o,this.buffer=r,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=h}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let n=t.parser.context;return new Ry(t,[],e,i,i,0,[],0,n?new Iy(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,n=65535&t,{parser:s}=this.p,o=this.reducePos<this.pos-25;o&&this.setLookAhead(this.pos);let r=s.dynamicPrecedence(n);if(r&&(this.score+=r),0==i)return this.pushState(s.getGoto(this.state,n,!0),this.reducePos),n<s.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&t?6:0),l=a?this.stack[a-2]:this.p.ranges[0].from,c=this.reducePos-l;c>=2e3&&!(null===(e=this.p.parser.nodeSet.types[n])||void 0===e?void 0:e.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<s.minRepeatTerm||131072&t){let t=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,l,t,u+4,!0)}if(262144&t)this.state=this.stack[a];else{let t=this.stack[a-3];this.state=s.getGoto(t,n,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(n,l)}storeNode(t,e,i,n=4,s=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let t=this,n=this.buffer.length;if(0==n&&t.parent&&(n=t.bufferBase-t.parent.bufferBase,t=t.parent),n>0&&0==t.buffer[n-4]&&t.buffer[n-1]>-1){if(e==i)return;if(t.buffer[n-2]>=e)return void(t.buffer[n-2]=i)}}if(s&&this.pos!=i){let s=this.buffer.length;if(s>0&&0!=this.buffer[s-4]){let t=!1;for(let e=s;e>0&&this.buffer[e-2]>i;e-=4)if(this.buffer[e-1]>=0){t=!0;break}if(t)for(;s>0&&this.buffer[s-2]>i;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,n>4&&(n-=4)}this.buffer[s]=t,this.buffer[s+1]=e,this.buffer[s+2]=i,this.buffer[s+3]=n}else this.buffer.push(t,e,i,n)}shift(t,e,i,n){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=n,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,n,4);else{let s=t,{parser:o}=this.p;(n>this.pos||e<=o.maxNode)&&(this.pos=n,o.stateFlag(s,1)||(this.reducePos=n)),this.pushState(s,i),this.shiftContext(e,i),e<=o.maxNode&&this.buffer.push(e,i,n,4)}}apply(t,e,i,n){65536&t?this.reduce(t):this.shift(t,e,i,n)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),n=t.bufferBase+e;for(;t&&n==t.bufferBase;)t=t.parent;return new Ry(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new Ly(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==i)return!1;if(!(65536&i))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let n,s=0;s<e.length;s+=2)(n=e[s+1])!=this.state&&this.p.parser.hasAction(n,t)&&i.push(e[s],n);if(this.stack.length<120)for(let t=0;i.length<8&&t<e.length;t+=2){let n=e[t+1];i.some((t,e)=>1&e&&t==n)||i.push(e[t],n)}e=i}let i=[];for(let t=0;t<e.length&&i.length<4;t+=2){let n=e[t+1];if(n==this.state)continue;let s=this.split();s.pushState(n,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(e[t],this.pos),s.reducePos=this.pos,s.score-=200,i.push(s)}return i}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if(!(65536&e))return!1;if(!t.validAction(this.state,e)){let i=e>>19,n=65535&e,s=this.stack.length-3*i;if(s<0||t.getGoto(this.stack[s],n,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(n,s)=>{if(!e.includes(n))return e.push(n),t.allActions(n,e=>{if(393216&e);else if(65536&e){let i=(e>>19)-s;if(i>1){let n=65535&e,s=this.stack.length-3*i;if(s>=0&&t.getGoto(this.stack[s],n,!1)>=0)return i<<19|65536|n}}else{let t=i(e,s+1);if(null!=t)return t}})};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:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||-3!=this.buffer[t])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||-4!=this.buffer[t])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new Iy(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Iy{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class Ly{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,i=t>>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],e,!0);this.state=n}}class Ny{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new Ny(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.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 Ny(this.stack,this.pos,this.index)}}function jy(t,e=Uint16Array){if("string"!=typeof t)return t;let i=null;for(let n=0,s=0;n<t.length;){let o=0;for(;;){let e=t.charCodeAt(n++),i=!1;if(126==e){o=65535;break}e>=92&&e--,e>=34&&e--;let s=e-32;if(s>=46&&(s-=46,i=!0),o+=s,i)break;o*=46}i?i[s++]=o:i=new e(o)}return i}class zy{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const By=new zy;class Zy{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=By,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,n=this.rangeIndex,s=this.pos+t;for(;s<i.from;){if(!n)return null;let t=this.ranges[--n];s-=i.from-t.to,i=t}for(;e<0?s>i.to:s>=i.to;){if(n==this.ranges.length-1)return null;let t=this.ranges[++n];s+=t.from-i.to,i=t}return s}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e,i,n=this.chunkOff+t;if(n>=0&&n<this.chunk.length)e=this.pos+t,i=this.chunk.charCodeAt(n);else{let n=this.resolveOffset(t,1);if(null==n)return-1;if(e=n,e>=this.chunk2Pos&&e<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(e-this.chunk2Pos);else{let t=this.rangeIndex,n=this.range;for(;n.to<=e;)n=this.ranges[++t];this.chunk2=this.input.chunk(this.chunk2Pos=e),e+this.chunk2.length>n.to&&(this.chunk2=this.chunk2.slice(0,n.to-e)),i=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),i}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(null==i||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=i}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,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(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,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(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=By,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let n of this.ranges){if(n.from>=e)break;n.to>t&&(i+=this.input.read(Math.max(n.from,t),Math.min(n.to,e)))}return i}}class Wy{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;qy(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}Wy.prototype.contextual=Wy.prototype.fallback=Wy.prototype.extend=!1;class Fy{constructor(t,e,i){this.precTable=e,this.elseToken=i,this.data="string"==typeof t?jy(t):t}token(t,e){let i=t.pos,n=0;for(;;){let i=t.next<0,s=t.resolveOffset(1,1);if(qy(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(i||n++,null==s)break;t.reset(s,t.token)}n&&(t.reset(i,t.token),t.acceptToken(this.elseToken,n))}}Fy.prototype.contextual=Wy.prototype.fallback=Wy.prototype.extend=!1;class Xy{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function qy(t,e,i,n,s,o){let r=0,a=1<<n,{dialect:l}=i.p.parser;t:for(;0!=(a&t[r]);){let i=t[r+1];for(let n=r+3;n<i;n+=2)if((t[n+1]&a)>0){let i=t[n];if(l.allows(i)&&(-1==e.token.value||e.token.value==i||Vy(i,e.token.value,s,o))){e.acceptToken(i);break}}let n=e.next,c=0,h=t[r+2];if(!(e.next<0&&h>c&&65535==t[i+3*h-3])){for(;c<h;){let s=c+h>>1,o=i+s+(s<<1),a=t[o],l=t[o+1]||65536;if(n<a)h=s;else{if(!(n>=l)){r=t[o+2],e.advance();continue t}c=s+1}}break}r=t[i+3*h-1]}}function Hy(t,e,i){for(let n,s=e;65535!=(n=t[s]);s++)if(n==i)return s-e;return-1}function Vy(t,e,i,n){let s=Hy(i,n,e);return s<0||Hy(i,n,t)<s}const Yy="undefined"!=typeof process&&process.env&&/\bparse\b/.test(process.env.LOG);let Uy=null;function Gy(t,e,i){let n=t.cursor(Tu.IncludeAnonymous);for(n.moveTo(e);;)if(!(i<0?n.childBefore(e):n.childAfter(e)))for(;;){if((i<0?n.to<e:n.from>e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class Ky{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Gy(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Gy(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let i=this.trees[e],n=this.index[e];if(n==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[n],o=this.start[e]+i.positions[n];if(o>t)return this.nextStart=o,null;if(s instanceof Cu){if(o==t){if(o<this.safeFrom)return null;let t=o+s.length;if(t<=this.safeTo){let e=s.prop(bu.lookAhead);if(!e||t+e<this.fragment.to)return s}}this.index[e]++,o+s.length>=Math.max(this.safeFrom,t)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+s.length}}}class Jy{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(t=>new zy)}getActions(t){let e=0,i=null,{parser:n}=t.p,{tokenizers:s}=n,o=n.stateSlot(t.state,3),r=t.curContext?t.curContext.hash:0,a=0;for(let n=0;n<s.length;n++){if(!(1<<n&o))continue;let l=s[n],c=this.tokens[n];if((!i||l.fallback)&&((l.contextual||c.start!=t.pos||c.mask!=o||c.context!=r)&&(this.updateCachedToken(c,l,t),c.mask=o,c.context=r),c.lookAhead>c.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=e;if(c.extended>-1&&(e=this.addActions(t,c.extended,c.end,e)),e=this.addActions(t,c.value,c.end,e),!l.extend&&(i=c,e>n))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),i||t.pos!=this.stream.end||(i=new zy,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new zy,{pos:i,p:n}=t;return e.start=i,e.end=Math.min(i+1,n.stream.end),e.value=i==n.stream.end?n.parser.eofTerm:0,e}updateCachedToken(t,e,i){let n=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(n,t),i),t.value>-1){let{parser:e}=i.p;for(let n=0;n<e.specialized.length;n++)if(e.specialized[n]==t.value){let s=e.specializers[n](this.stream.read(t.start,t.end),i);if(s>=0&&i.p.parser.dialect.allows(s>>1)){1&s?t.extended=s>>1:t.value=s>>1;break}}}else t.value=0,t.end=this.stream.clipPos(n+1)}putAction(t,e,i,n){for(let e=0;e<n;e+=3)if(this.actions[e]==t)return n;return this.actions[n++]=t,this.actions[n++]=e,this.actions[n++]=i,n}addActions(t,e,i,n){let{state:s}=t,{parser:o}=t.p,{data:r}=o;for(let t=0;t<2;t++)for(let a=o.stateSlot(s,t?2:1);;a+=3){if(65535==r[a]){if(1!=r[a+1]){0==n&&2==r[a+1]&&(n=this.putAction(oO(r,a+2),e,i,n));break}a=oO(r,a+2)}r[a]==e&&(n=this.putAction(oO(r,a+1),e,i,n))}return n}}class tO{constructor(t,e,i,n){this.parser=t,this.input=e,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 Zy(e,n),this.tokens=new Jy(t,this.stream),this.topTerm=t.top[1];let{from:s}=n[0];this.stacks=[Ry.start(this,t.top[0],s)],this.fragments=i.length&&this.stream.end-s>4*t.bufferLength?new Ky(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,i=this.stacks,n=this.minStackPos,s=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[t]=i;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<i.length;o++){let r=i[o];for(;;){if(this.tokens.mainToken=null,r.pos>n)s.push(r);else{if(this.advanceStack(r,s,i))continue;{t||(t=[],e=[]),t.push(r);let i=this.tokens.getMainToken(r);e.push(i.value,i.end)}}break}}if(!s.length){let e=t&&function(t){let e=null;for(let i of t){let t=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=t&&i.pos>t)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}(t);if(e)return Yy&&console.log("Finish with "+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw Yy&&t&&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&&t){let i=null!=this.stoppedAt&&t[0].pos>this.stoppedAt?t[0]:this.runRecovery(t,e,s);if(i)return Yy&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(s.length>t)for(s.sort((t,e)=>e.score-t.score);s.length>t;)s.pop();s.some(t=>t.reducePos>n)&&this.recovering--}else if(s.length>1){t:for(let t=0;t<s.length-1;t++){let e=s[t];for(let i=t+1;i<s.length;i++){let n=s[i];if(e.sameState(n)||e.buffer.length>500&&n.buffer.length>500){if(!((e.score-n.score||e.buffer.length-n.buffer.length)>0)){s.splice(t--,1);continue t}s.splice(i--,1)}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let t=1;t<s.length;t++)s[t].pos<this.minStackPos&&(this.minStackPos=s[t].pos);return null}stopAt(t){if(null!=this.stoppedAt&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,i){let n=t.pos,{parser:s}=this,o=Yy?this.stackID(t)+" -> ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,i=e?t.curContext.hash:0;for(let r=this.fragments.nodeAt(n);r;){let n=this.parser.nodeSet.types[r.type.id]==r.type?s.getGoto(t.state,r.type.id):-1;if(n>-1&&r.length&&(!e||(r.prop(bu.contextHash)||0)==i))return t.useNode(r,n),Yy&&console.log(o+this.stackID(t)+` (via reuse of ${s.getName(r.type.id)})`),!0;if(!(r instanceof Cu)||0==r.children.length||r.positions[0]>0)break;let a=r.children[0];if(!(a instanceof Cu&&0==r.positions[0]))break;r=a}}let r=s.stateSlot(t.state,4);if(r>0)return t.reduce(r),Yy&&console.log(o+this.stackID(t)+` (via always-reduce ${s.getName(65535&r)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let r=0;r<a.length;){let l=a[r++],c=a[r++],h=a[r++],u=r==a.length||!i,d=u?t:t.split(),f=this.tokens.mainToken;if(d.apply(l,c,f?f.start:d.pos,h),Yy&&console.log(o+this.stackID(d)+` (via ${65536&l?`reduce of ${s.getName(65535&l)}`:"shift"} for ${s.getName(c)} @ ${n}${d==t?"":", split"})`),u)return!0;d.pos>n?e.push(d):i.push(d)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return eO(t,e),!0}}runRecovery(t,e,i){let n=null,s=!1;for(let o=0;o<t.length;o++){let r=t[o],a=e[o<<1],l=e[1+(o<<1)],c=Yy?this.stackID(r)+" -> ":"";if(r.deadEnd){if(s)continue;if(s=!0,r.restart(),Yy&&console.log(c+this.stackID(r)+" (restarted)"),this.advanceFully(r,i))continue}let h=r.split(),u=c;for(let t=0;h.forceReduce()&&t<10;t++){if(Yy&&console.log(u+this.stackID(h)+" (via force-reduce)"),this.advanceFully(h,i))break;Yy&&(u=this.stackID(h)+" -> ")}for(let t of r.recoverByInsert(a))Yy&&console.log(c+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,i);this.stream.end>r.pos?(l==r.pos&&(l++,a=0),r.recoverByDelete(a,l),Yy&&console.log(c+this.stackID(r)+` (via recover-delete ${this.parser.getName(a)})`),eO(r,i)):(!n||n.score<r.score)&&(n=r)}return n}stackToTree(t){return t.close(),Cu.build({buffer:Ny.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(Uy||(Uy=new WeakMap)).get(t);return e||Uy.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function eO(t,e){for(let i=0;i<e.length;i++){let n=e[i];if(n.pos==t.pos&&n.sameState(t))return void(e[i].score<t.score&&(e[i]=t))}e.push(t)}class iO{constructor(t,e,i){this.source=t,this.flags=e,this.disabled=i}allows(t){return!this.disabled||0==this.disabled[t]}}const nO=t=>t;class sO extends Vu{constructor(t){if(super(),this.wrappers=[],14!=t.version)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let i=0;i<t.repeatNodeCount;i++)e.push("");let i=Object.keys(t.topRules).map(e=>t.topRules[e][1]),n=[];for(let t=0;t<e.length;t++)n.push([]);function s(t,e,i){n[t].push([e,e.deserialize(String(i))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];"string"==typeof t&&(t=bu[t]);for(let i=1;i<e.length;){let n=e[i++];if(n>=0)s(n,t,e[i++]);else{let o=e[i+-n];for(let r=-n;r>0;r--)s(e[i++],t,o);i++}}}this.nodeSet=new Su(e.map((e,s)=>_u.define({name:s>=this.minRepeatTerm?void 0:e,id:s,props:n[s],top:i.indexOf(s)>-1,error:0==s,skipped:t.skippedNodes&&t.skippedNodes.indexOf(s)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=vu;let o=jy(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t<this.specializerSpecs.length;t++)this.specialized[t]=this.specializerSpecs[t].term;this.specializers=this.specializerSpecs.map(rO),this.states=jy(t.states,Uint32Array),this.data=jy(t.stateData),this.goto=jy(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(t=>"number"==typeof t?new Wy(o,t):t),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let n=new tO(this,t,e,i);for(let s of this.wrappers)n=s(n,t,e,i);return n}getGoto(t,e,i=!1){let n=this.goto;if(e>=n[0])return-1;for(let s=n[e+1];;){let e=n[s++],o=1&e,r=n[s++];if(o&&i)return r;for(let i=s+(e>>1);s<i;s++)if(n[s]==t)return r;if(o)return-1}}hasAction(t,e){let i=this.data;for(let n=0;n<2;n++)for(let s,o=this.stateSlot(t,n?2:1);;o+=3){if(65535==(s=i[o])){if(1!=i[o+1]){if(2==i[o+1])return oO(i,o+2);break}s=i[o=oO(i,o+2)]}if(s==e||0==s)return oO(i,o+1)}return 0}stateSlot(t,e){return this.states[6*t+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,t=>t==e||null)}allActions(t,e){let i=this.stateSlot(t,4),n=i?e(i):void 0;for(let i=this.stateSlot(t,1);null==n;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=oO(this.data,i+2)}n=e(oO(this.data,i+1))}return n}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=oO(this.data,i+2)}if(!(1&this.data[i+2])){let t=this.data[i+1];e.some((e,i)=>1&i&&e==t)||e.push(this.data[i],t)}}return e}configure(t){let e=Object.assign(Object.create(sO.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(e=>{let i=t.tokenizers.find(t=>t.from==e);return i?i.to:e})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((i,n)=>{let s=t.specializers.find(t=>t.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return e.specializers[n]=rO(o),o})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map(()=>!1);if(t)for(let n of t.split(" ")){let t=e.indexOf(n);t>=0&&(i[t]=!0)}let n=null;for(let t=0;t<e.length;t++)if(!i[t])for(let i,s=this.dialects[e[t]];65535!=(i=this.data[s++]);)(n||(n=new Uint8Array(this.maxTerm+1)))[i]=1;return new iO(t,i,n)}static deserialize(t){return new sO(t)}}function oO(t,e){return t[e]|t[e+1]<<16}function rO(t){if(t.external){let e=t.extend?1:0;return(i,n)=>t.external(i,n)<<1|e}return t.get}const aO=[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],lO=new class{constructor(t){this.start=t.start,this.shift=t.shift||nO,this.reduce=t.reduce||nO,this.reuse=t.reuse||nO,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}({start:!1,shift:(t,e)=>5==e||6==e||320==e?t:321==e,strict:!1}),cO=new Xy((t,e)=>{let{next:i}=t;(125==i||-1==i||e.context)&&t.acceptToken(318)},{contextual:!0,fallback:!0}),hO=new Xy((t,e)=>{let i,{next:n}=t;aO.indexOf(n)>-1||(47!=n||47!=(i=t.peek(1))&&42!=i)&&(125==n||59==n||-1==n||e.context||t.acceptToken(316))},{contextual:!0}),uO=new Xy((t,e)=>{91!=t.next||e.context||t.acceptToken(317)},{contextual:!0}),dO=new Xy((t,e)=>{let{next:i}=t;if(43==i||45==i){if(t.advance(),i==t.next){t.advance();let i=!e.context&&e.canShift(1);t.acceptToken(i?1:2)}}else 63==i&&46==t.peek(1)&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(3))},{contextual:!0});function fO(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const pO=new Xy((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let i=0;for(;aO.indexOf(t.next)>-1;)t.advance(),i++;if(fO(t.next,!0)){for(t.advance(),i++;fO(t.next,!1);)t.advance(),i++;for(;aO.indexOf(t.next)>-1;)t.advance(),i++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!fO(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),i++}}t.acceptToken(4,-i)}),mO=td({"get set async static":xd.modifier,"for while do if else switch try catch finally return throw break continue default case defer":xd.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":xd.operatorKeyword,"let var const using function class extends":xd.definitionKeyword,"import export from":xd.moduleKeyword,"with debugger new":xd.keyword,TemplateString:xd.special(xd.string),super:xd.atom,BooleanLiteral:xd.bool,this:xd.self,null:xd.null,Star:xd.modifier,VariableName:xd.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":xd.function(xd.variableName),VariableDefinition:xd.definition(xd.variableName),Label:xd.labelName,PropertyName:xd.propertyName,PrivatePropertyName:xd.special(xd.propertyName),"CallExpression/MemberExpression/PropertyName":xd.function(xd.propertyName),"FunctionDeclaration/VariableDefinition":xd.function(xd.definition(xd.variableName)),"ClassDeclaration/VariableDefinition":xd.definition(xd.className),"NewExpression/VariableName":xd.className,PropertyDefinition:xd.definition(xd.propertyName),PrivatePropertyDefinition:xd.definition(xd.special(xd.propertyName)),UpdateOp:xd.updateOperator,"LineComment Hashbang":xd.lineComment,BlockComment:xd.blockComment,Number:xd.number,String:xd.string,Escape:xd.escape,ArithOp:xd.arithmeticOperator,LogicOp:xd.logicOperator,BitOp:xd.bitwiseOperator,CompareOp:xd.compareOperator,RegExp:xd.regexp,Equals:xd.definitionOperator,Arrow:xd.function(xd.punctuation),": Spread":xd.punctuation,"( )":xd.paren,"[ ]":xd.squareBracket,"{ }":xd.brace,"InterpolationStart InterpolationEnd":xd.special(xd.brace),".":xd.derefOperator,", ;":xd.separator,"@":xd.meta,TypeName:xd.typeName,TypeDefinition:xd.definition(xd.typeName),"type enum interface implements namespace module declare":xd.definitionKeyword,"abstract global Privacy readonly override":xd.modifier,"is keyof unique infer asserts":xd.operatorKeyword,JSXAttributeValue:xd.attributeValue,JSXText:xd.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":xd.angleBracket,"JSXIdentifier JSXNameSpacedName":xd.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":xd.attributeName,"JSXBuiltin/JSXIdentifier":xd.standard(xd.tagName)}),gO={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},vO={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},yO={__proto__:null,"<":193},OO=sO.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOO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,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:lO,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[mO],skippedNodes:[0,5,6,278],repe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iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>gO[t]||-1},{term:343,get:t=>vO[t]||-1},{term:95,get:t=>yO[t]||-1}],tokenPrec:15201}),bO=[jv("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),jv("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),jv("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),jv("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),jv("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),jv("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),jv("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),jv("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),jv("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),jv('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),jv('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],xO=bO.concat([jv("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),jv("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),jv("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),wO=new qu,_O=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function SO(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const kO=["FunctionDeclaration"],$O={FunctionDeclaration:SO("function"),ClassDeclaration:SO("class"),ClassExpression:()=>!0,EnumDeclaration:SO("constant"),TypeAliasDeclaration:SO("type"),NamespaceDeclaration:SO("namespace"),VariableDefinition(t,e){t.matchContext(kO)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function TO(t,e){let i=wO.get(e);if(i)return i;let n=[],s=!0;function o(e,i){let s=t.sliceString(e.from,e.to);n.push({label:s,type:i})}return e.cursor(Tu.IncludeAnonymous).iterate(e=>{if(s)s=!1;else if(e.name){let t=$O[e.name];if(t&&t(e,o)||_O.has(e.name))return!1}else if(e.to-e.from>8192){for(let i of TO(t,e.node))n.push(i);return!1}}),wO.set(e,n),n}const CO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,PO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function EO(t){let e=Pd(t.state).resolveInner(t.pos,-1);if(PO.indexOf(e.name)>-1)return null;let i="VariableName"==e.name||e.to-e.from<20&&CO.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)_O.has(i.name)&&(n=n.concat(TO(t.state.doc,i)));return{options:n,from:i?e.from:t.pos,validFor:CO}}const AO=Cd.define({name:"javascript",parser:OO.configure({props:[qd.add({IfStatement:tf({except:/^\s*({|else\b)/}),TryStatement:tf({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:t=>t.baseIndent,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:Kd({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":tf({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),nf.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null},BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),MO={test:t=>/^JSX/.test(t.name),facet:Sd({commentTokens:{block:{open:"{/*",close:"*/}"}}})},QO=AO.configure({dialect:"ts"},"typescript"),DO=AO.configure({dialect:"jsx",props:[kd.add(t=>t.isTop?[MO]:void 0)]}),RO=AO.configure({dialect:"jsx ts",props:[kd.add(t=>t.isTop?[MO]:void 0)]},"typescript");let IO=t=>({label:t,type:"keyword"});const LO="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(IO),NO=LO.concat(["declare","implements","private","protected","public"].map(IO));function jO(t={}){let e=t.jsx?t.typescript?RO:DO:t.typescript?QO:AO,i=t.typescript?xO.concat(NO):bO.concat(LO);return new jd(e,[AO.data.of({autocomplete:(n=PO,s=Ng(i),t=>{for(let e=Pd(t.state).resolveInner(t.pos,-1);e;e=e.parent){if(n.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return s(t)})}),AO.data.of({autocomplete:EO}),t.jsx?ZO:[]]);var n,s}function zO(t,e,i=t.length){for(let n=null==e?void 0:e.firstChild;n;n=n.nextSibling)if("JSXIdentifier"==n.name||"JSXBuiltin"==n.name||"JSXNamespacedName"==n.name||"JSXMemberExpression"==n.name)return t.sliceString(n.from,Math.min(n.to,i));return""}const BO="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ZO=$c.inputHandler.of((t,e,i,n,s)=>{if((BO?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||">"!=n&&"/"!=n||!AO.isActiveAt(t.state,e,-1))return!1;let o=s(),{state:r}=o,a=r.changeByRange(t=>{var e;let i,{head:s}=t,o=Pd(r).resolveInner(s-1,-1);if("JSXStartTag"==o.name&&(o=o.parent),r.doc.sliceString(s-1,s)!=n||"JSXAttributeValue"==o.name&&o.to>s);else{if(">"==n&&"JSXFragmentTag"==o.name)return{range:t,changes:{from:s,insert:"</>"}};if("/"==n&&"JSXStartCloseTag"==o.name){let t=o.parent,n=t.parent;if(n&&t.from==s-2&&((i=zO(r.doc,n.firstChild,s))||"JSXFragmentTag"==(null===(e=n.firstChild)||void 0===e?void 0:e.name))){let t=`${i}>`;return{range:is.cursor(s+t.length,-1),changes:{from:s,insert:t}}}}else if(">"==n){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(o);if(e&&"JSXOpenTag"==e.name&&!/^\/?>|^<\//.test(r.doc.sliceString(s,s+2))&&(i=zO(r.doc,e,s)))return{range:t,changes:{from:s,insert:`</${i}>`}}}}return{range:t}});return!a.changes.empty&&(t.dispatch([o,r.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function WO(t,e){const i=$c.theme({"&":{height:.6*e+"px"}}),n=new $c({doc:t.value,extensions:[Dy,jO(),Af(Df),i]});return t.parentNode.insertBefore(n.dom,t),t.style.display="none",n}function FO(t){return!t||window.confirm("There is a change that has not been saved. If you proceed now, you will lose it.")}class XO{#hi;constructor(t){this.#hi=t}get template(){return rt`
290
- <div class="textae-editor__load-dialog__row">
291
- <label>
292
- URL
293
- </label>
294
- <input
295
- type="text"
296
- value="${this.#hi}"
297
- class="textae-editor__load-dialog__url-text">
298
- <input
299
- type="button"
300
- class="textae-editor__load-dialog__url-button"
301
- ${this.#hi?"":'disabled="disabled"'}
302
- value="Open">
303
- </div>
304
- `}bind(t,e){r()(t,".textae-editor__load-dialog__url-text","input",t=>{yn(t.target.nextElementSibling,t.target.value)}),r()(t,".textae-editor__load-dialog__url-button","click",t=>e(t.target.previousElementSibling.value))}}var qO=i(2628),HO=i.n(qO);function VO(t,e){t.element.classList.remove("textae-editor__load-dialog__overlay-dropzone--maximized"),t.element.style.zIndex=e}class YO{#ui;get template(){return'\n<div class="textae-editor__load-dialog__row">\n <label>\n Local\n </label>\n <form class="dropzone textae-editor__load-dialog__dropzone">\n <div class="dz-message">\n Drop a file here or click to select\n </div>\n </form>\n <div class="textae-editor__load-dialog__dz-file-preview">\n <div class="dz-filename"><span data-dz-name>No file selected</span></div>\n </div>\n <input\n type="button"\n class="textae-editor__load-dialog__local-button"\n disabled="disabled"\n value="Open">\n</div>\n'}bind(t,e){r()(t,".textae-editor__load-dialog__local-button","click",()=>e(this.#ui))}intiializeDropzone(t){const e={url:"nothing",previewsContainer:".textae-editor__load-dialog__dz-file-preview",previewTemplate:t.querySelector(".textae-editor__load-dialog__dz-file-preview").innerHTML},i=new(HO())("body > div.ui-widget-overlay.ui-front",{...e,clickable:!1}),n=i.element.style.zIndex;i.on("dragenter",()=>function(t){const{element:e}=t;e.classList.add("textae-editor__load-dialog__overlay-dropzone--maximized"),e.style.zIndex=parseInt(e.style.zIndex)+1}(i)).on("dragleave",()=>VO(i,n)).on("addedfile",e=>{VO(i,n),this.#di(t,e)});new(HO())(".textae-editor__load-dialog__dropzone",e).on("addedfile",e=>{this.#di(t,e)})}#di(t,e){t.querySelector(".textae-editor__load-dialog__dz-file-preview").firstElementChild.remove(),t.querySelector(".textae-editor__load-dialog__dz-file-preview > div").setAttribute("title",e.name),this.#ui=e,yn(t.querySelector(".textae-editor__load-dialog__local-button"),!0)}}class UO extends u{#fi;constructor(t,e,i,n,s,o){const a=new XO(e),l=new YO;super(t,function(t){const{url:e,local:i}=t;return`\n<div class="textae-editor__load-dialog__container">\n ${e}\n ${i}\n <div class="textae-editor__load-dialog__row">\n <div class="textae-editor__load-dialog__format">\n <label class="textae-editor__load-dialog__format-button">\n <input type="radio" name="format" value="json" checked>JSON\n </label>\n <label class="textae-editor__load-dialog__format-button">\n <input type="radio" name="format" value="inline">Text\n </label>\n </div>\n <textarea class="textae-editor__load-dialog__textarea"></textarea>\n <input type="button" value="Edit" class="edit" disabled="disabled">\n <input type="button" value="Open" class="instant" disabled="disabled">\n </div>\n</div>`}({url:a.template,local:l.template})),this.#fi=l,a.bind(super.el,t=>{FO(o)&&i(t),super.close()}),this.#fi.bind(super.el,t=>{FO(o)&&n(t),super.close()}),r()(super.el,".textae-editor__load-dialog__textarea","input",t=>{yn(super.el.querySelector('[type="button"].instant'),t.target.value),yn(super.el.querySelector('[type="button"].edit'),t.target.value)});let c=null;r()(super.el,'[type="button"].instant',"click",()=>{const t=c?c.state.doc.toString():super.el.querySelector(".textae-editor__load-dialog__textarea").value,e=this.#pi();FO(o)&&s(t,e),super.close()}),r()(super.el,'[type="button"].edit',"click",()=>{this.#mi();const t=super.el.querySelector(".textae-editor__load-dialog__textarea"),e=this.#pi();"json"===e&&On(t.value)&&(t.value=JSON.stringify(JSON.parse(t.value),null,2));const i=super.el.closest(".textae-editor__dialog").clientHeight;c="json"===e?WO(t,i):function(t,e){const i=$c.theme({"&":{height:.6*e+"px"}}),n=new $c({doc:t.value,extensions:[Dy,Af(Df),i]});return t.parentNode.insertBefore(n.dom,t),t.style.display="none",n}(t,i);const n=super.el.querySelectorAll('.textae-editor__load-dialog__format-button input[type="radio"]');for(const t of n)t.disabled=!0;super.el.querySelector('[type="button"].edit').disabled=!0})}open(){super.open(),this.#fi.intiializeDropzone(super.el)}#mi(){super.el.closest(".textae-editor__dialog").classList.add("textae-editor__load-dialog--expanded")}#pi(){return super.el.querySelector('input[name="format"]:checked').value}}class GO extends u{#fi;constructor(t,e,i,n,s,o){const a=new XO(e),l=new YO;super(t,function(t){const{url:e,local:i}=t;return`\n<div class="textae-editor__load-dialog__container">\n ${e}\n ${i}\n <div class="textae-editor__load-dialog__row json">\n <label>\n JSON\n </label>\n <textarea class="textae-editor__load-dialog__textarea"></textarea>\n <input type="button" value="Edit" class="edit" disabled="disabled">\n <input type="button" value="Open" class="instant" disabled="disabled">\n </div>\n</div>`}({url:a.template,local:l.template})),this.#fi=l,a.bind(super.el,t=>{FO(o)&&i(t),super.close()}),this.#fi.bind(super.el,t=>{FO(o)&&n(t),super.close()}),r()(super.el,".textae-editor__load-dialog__textarea","input",t=>{yn(super.el.querySelector('[type="button"].instant'),t.target.value),yn(super.el.querySelector('[type="button"].edit'),t.target.value)});let c=null;r()(super.el,'[type="button"].instant',"click",()=>{const t=c?c.state.doc.toString():super.el.querySelector(".textae-editor__load-dialog__textarea").value;FO(o)&&s(t),super.close()}),r()(super.el,'[type="button"].edit',"click",()=>{this.#mi();const t=super.el.querySelector(".textae-editor__load-dialog__textarea");On(t.value)&&(t.value=JSON.stringify(JSON.parse(t.value),null,2));const e=super.el.closest(".textae-editor__dialog").clientHeight;c=WO(t,e),super.el.querySelector('[type="button"].edit').disabled=!0})}open(){super.open(),this.#fi.intiializeDropzone(super.el)}#mi(){super.el.closest(".textae-editor__dialog").classList.add("textae-editor__load-dialog--expanded")}}function KO(t){const e=new Blob([JSON.stringify(t)],{type:"application/json"});return URL.createObjectURL(e)}const JO=class{#gi;#vi;#Y;#q;constructor(t,e,i,n=null){this.#gi=t,this.#vi=e,this.#Y=i,this.#q=n}get beginPos(){return this.#gi}get endPos(){return this.#vi}get obj(){return this.#Y}get id(){return this.#q}get span(){return{begin:this.#gi,end:this.#vi}}toObject(){const t={span:this.span,obj:this.#Y};return this.#q&&(t.id=this.#q),t}isNestedWithin(t){return t.beginPos<=this.#gi&&this.#vi<=t.endPos}get isPositionNotInteger(){return!(Number.isInteger(this.#gi)&&Number.isInteger(this.endPos))}get isPositionNegative(){return this.#gi<0||this.#vi<0}get isPositionInvalid(){return this.#gi>this.#vi}isOutOfBounds(t){return this.#gi>=t||this.#vi>t}isBoundaryCrossing(t){const e=this.#gi>t.beginPos&&this.#gi<t.endPos,i=this.#vi>t.beginPos&&this.#vi<t.endPos;return e||i}};const tb=class{validateDenotations(t,e){let i=this.#yi(t);return i=this.#Oi(i),i=this.#bi(i),i=this.#xi(i),i=this.#wi(i,e),i=this.#_i(i),this.#Si(i)}#yi(t){const e=new Set;return t.filter(t=>{const i=JSON.stringify(t.span);return!e.has(i)&&(e.add(i),!0)})}#Oi(t){return t.filter(t=>!t.isPositionNotInteger)}#bi(t){return t.filter(t=>!t.isPositionNegative)}#xi(t){return t.filter(t=>!t.isPositionInvalid)}#wi(t,e){return t.filter(t=>!t.isOutOfBounds(e))}#_i(t){const e=t.sort((t,e)=>t.beginPos===e.beginPos?e.endPos-t.endPos:t.beginPos-e.beginPos),i=[];return e.forEach(t=>{i.some(e=>t.isNestedWithin(e))||i.push(t)}),i}#Si(t){return t.filter(e=>!t.some(t=>e!==t&&e.isBoundaryCrossing(t)))}};class eb extends Error{constructor(t){super(t),this.name=this.constructor.name}}const ib=eb;const nb=class{validateRelations(t){return this.#ki(t)}#ki(t){return t.filter(t=>t.subj&&t.pred&&t.obj)}};const sb=class{constructor(t){this.source=Object.freeze({...t}),this.denotations=this.#$i(t.denotations||[]),this.config=this.source.config}generate(){const t=this.source.text;if(!t)throw new ib('The "text" key is missing.');const e=(new tb).validateDenotations(this.denotations,t.length),i=(new nb).validateRelations(this.source.relations||[]);return[this.#Ti(t,e,i),this.#Ci()].filter(Boolean).join("\n\n")}#$i(t){return t.map(t=>new JO(t.span.begin,t.span.end,t.obj,t.id||null))}#Ti(t,e,i){return e.sort((t,e)=>e.beginPos-t.beginPos).forEach(e=>{const n=e.beginPos,s=e.endPos,o=e.id?this.#Pi(e,i):this.#Ei(e.obj),r=`[${t.slice(n,s)}][${o}]`;t=t.slice(0,n)+r+t.slice(s)}),t}#Ci(){const t=this.#Ai();return t&&0!==t.length?t.map(t=>`[${t.label}]: ${t.id}`).join("\n"):null}#Ai(){return this.config&&this.config["entity types"]?.filter(t=>t.hasOwnProperty("label"))||null}#Pi(t,e){const i=e.find(e=>e.subj===t.id)||null,n=[t.id,t.obj,i?.pred,i?.obj];if(!this.#Ai())return n.filter(t=>null!=t).join(", ");n[1]=this.#Ei(t.obj);this.#Ai().find(e=>e.id===t.obj);return n.filter(t=>null!=t).join(", ")}#Ei(t){if(!this.#Ai())return t;const e=this.#Ai().find(e=>e.id===t);return e?e.label:t}},ob=/^\s*\[([^\]]+)\]:\s+(\S+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*$/,rb=new RegExp(`(?:\\A|\\n\\s*\\n)((?:${ob.source}(?:\\n|$))+)`,"gm");const ab=class{#Mi;#Qi=null;constructor(t){this.#Mi=t}get(t){return this.#Di[t]}get config(){return Object.entries(this.#Di).map(([t,e])=>({id:e,label:t}))}get#Di(){return this.#Qi||(this.#Qi=this.#Ri()),this.#Qi}#Ri(){const t={},e=Array.from(this.#Mi.matchAll(rb));for(const i of e)this.#Ii(i,t);return t}#Ii(t,e){const i=t[0].split("\n");for(const t of i)this.#Li(t,e)}#Li(t,e){const i=t.trim().match(ob);if(!i)return;const[n,s,o]=i;s!==o&&(e[s]||(e[s]=o))}},lb=new RegExp(`(?:\\A|\\n\\s*\\n)((?:${/^\s*\[([^\]]+)\]:\s+(\S+)(?:\s+(?:"[^"]*"|'[^']*'))?\s*$/.source}(?:\\n|$))+)`,"gm"),cb=/(?<!\\)\[([^\[]+?)\]\[([^\]]+?)\]/;const hb=class{#Mi;#D;#Ni;#ji;constructor(t){this.#Mi=t,this.#Ni=new ab(t)}parse(){this.#D=[],this.#ji=[];let t=this.#zi();return t=this.#Bi(t),new db(t,this.#D,this.#ji,this.#Ni)}#zi(){return this.#Mi.replace(lb,t=>t.startsWith("\n\n")?"\n\n":"").trim()}#Zi(t){return this.#Ni.get(t)||t}#Bi(t){const e=new RegExp(cb,"g");let i;for(;null!==(i=e.exec(t));){const n=i[1],s=i.index,o=s+n.length,r=i[2].split(", ");switch(r.length){case 1:this.#Wi(s,o,r[0]);break;case 2:this.#Fi(s,o,r);break;case 4:this.#Xi(s,o,r);break;default:e.lastIndex=i.index+i[0].length;continue}t=t.slice(0,i.index)+n+t.slice(i.index+i[0].length),e.lastIndex=o}return t}#Wi(t,e,i){const n=this.#Zi(i);this.#D.push(new JO(t,e,n))}#Fi(t,e,i){const[n,s]=i,o=this.#Zi(s);this.#D.push(new JO(t,e,o,n))}#Xi(t,e,i){const[n,s,o,r]=i,a=this.#Zi(s);this.#D.push(new JO(t,e,a,n)),this.#ji.push({pred:o,subj:n,obj:r})}},ub=/\\(?=\[[^\]]+\]\[[^\]]+\])/;const db=class{#re;#D;#ji;#Ni;constructor(t,e,i,n){this.#re=t,this.#D=e,this.#ji=i,this.#Ni=n}static parse(t){return new hb(t).parse().toObject()}static generate(t){return new sb(t).generate()}toObject(){const t={text:this.#qi(this.#re),denotations:this.#D.map(t=>t.toObject())};this.#ji&&this.#ji.length>0&&(t.relations=this.#ji);const e=this.#Hi();return e&&Object.keys(e).length>0&&!Object.values(e).every(t=>null==t||Array.isArray(t)&&0===t.length)&&(t.config=e),t}#qi(t){let e=this.#Vi(t);return this.#Yi(e)}#Vi(t){return t.replace(ub,"")}#Yi(t){return t.replace(/\n{2,}/g,"\n\n")}#Hi(){return this.#Ni&&0!==this.#Ni.length?{"entity types":this.#Ni.config}:null}};function fb(t,e){if("json"===e)return KO(t);if("inline"===e){const e=db.generate(t),i=new Blob([e],{type:"text/plain;charset=utf-8"});return URL.createObjectURL(i)}}function pb(t,e,i,n){t.preventDefault();!function(t,e){const i=document.createElement("a");i.setAttribute("href",t),i.setAttribute("download",e),document.body.appendChild(i),i.click(),document.body.removeChild(i)}(fb(e,i),t.target.previousElementSibling.value),n.emit("textae-event.resource.annotation.save",e)}function mb(t,i,n,s,o,a){r()(i,".textae-editor__save-dialog__url-text","input",t=>{yn(t.target.nextElementSibling,t.target.value)}),r()(i,".textae-editor__save-dialog__url-text","keyup",t=>{if(13===t.keyCode){const e=a();o(t.target.value,e),s()}}),r()(i,".textae-editor__save-dialog__url-button","click",t=>{const e=a();o(t.target.previousElementSibling.value,e),s()}),r()(i,".textae-editor__save-dialog__download-link","click",i=>{const o=a();try{pb(i,n,o,t)}catch(t){e().error(`Failed to download the source as ${o} format.`)}finally{s()}}),r()(i,".textae-editor__save-dialog__viewsource-link","click",()=>{const i=a();try{!function(t,e,i){const n=fb(t,e);window.open(n,"_blank"),i.emit("textae-event.resource.annotation.save",t)}(n,i,t)}catch(t){e().error(`Failed to view the source as ${i} format.`)}finally{s()}})}class gb extends u{constructor(t,e,i,n,s){super("Save Annotations",function(t){const{url:e,filename:i}=t;return`\n<div class="textae-editor__save-dialog__container">\n <div class="textae-editor__save-dialog__row">\n <span>Format</span>\n <div class="textae-editor__save-dialog__format">\n <label class="textae-editor__save-dialog__format-button">\n <input type="radio" name="format" value="json" checked>JSON\n </label>\n <label class="textae-editor__save-dialog__format-button">\n <input type="radio" name="format" value="inline">Text\n </label>\n </div>\n </div>\n <div class="textae-editor__save-dialog__row">\n <label>URL</label>\n <input\n type="text"\n value="${e}"\n class="textae-editor__save-dialog__url-text">\n <input\n type="button"\n class="textae-editor__save-dialog__url-button"\n ${e?"":'disabled="disabled"'}\n value="Save">\n </div>\n <div class="textae-editor__save-dialog__row">\n <label>Local</label>\n <input\n type="text"\n value="${i||""}"\n >\n <a class="textae-editor__save-dialog__download-link" href="#">Download</a>\n </div>\n <div class="textae-editor__save-dialog__row">\n <a class="textae-editor__save-dialog__viewsource-link" href="#">Click to see the source in a new window.</a>\n </div>\n</div>\n`}({filename:i,url:e})),mb(t,super.el,n,()=>super.close(),s,()=>super.el.querySelector('input[name="format"]:checked').value)}}function vb(t,e){if(t.length<2)throw new Error(e||"Expected an array with at least 2 items")}const yb=class{format(t,e){const i={};this.prepareContext(i);const n=i;return this.recurse(n,t,e),this.finalize(n)}prepareContext(t){t.buffer=[],t.out=function(...t){if(!this.buffer)throw new Error("context buffer is not initialized");this.buffer.push(...t)}}typeFormattterNotFound(t,e){throw new Error(`cannot format delta type: ${e}`)}typeFormattterErrorFormatter(t,e,i,n,s,o,r){}finalize({buffer:t}){return Array.isArray(t)?t.join(""):""}recurse(t,e,i,n,s,o,r){const a=e&&o?o.value:i;if(void 0===e&&void 0===n)return;const l=this.getDeltaType(e,o),c="node"===l?"a"===e._t?"array":"object":"";let h;void 0!==n?this.nodeBegin(t,n,s,l,c,null!=r&&r):this.rootBegin(t,l,c);try{h="unknown"!==l?this[`format_${l}`]:this.typeFormattterNotFound(t,l),h.call(this,t,e,a,n,s,o)}catch(i){this.typeFormattterErrorFormatter(t,i,e,a,n,s,o),"undefined"!=typeof console&&console.error&&console.error(i.stack)}void 0!==n?this.nodeEnd(t,n,s,l,c,null!=r&&r):this.rootEnd(t,l,c)}formatDeltaChildren(t,e,i){this.forEachDeltaKey(e,i,(n,s,o,r)=>{this.recurse(t,e[n],i?i[s]:void 0,n,s,o,r)})}forEachDeltaKey(t,e,i){const n=[];if(!("a"===t._t)){const s=Object.keys(t);"object"==typeof e&&null!==e&&n.push(...Object.keys(e));for(const t of s)n.indexOf(t)>=0||n.push(t);for(let t=0;t<n.length;t++){const e=n[t];if(void 0===e)continue;const s=t===n.length-1;i(e,e,void 0,s)}return}const s={};for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const i=t[e];if(Array.isArray(i)&&3===i[2]){s[i[1]]=Number.parseInt(e.substring(1))}}const o=t;let r=0,a=0;const l=Array.isArray(e)?e:void 0,c=l?l.length:Object.keys(o).reduce((t,e)=>{if("_t"===e)return t;if("_"===e.substring(0,1)){const i=o[e],n=Number.parseInt(e.substring(1)),s=Array.isArray(i)&&i.length>=3&&3===i[2]?i[1]:void 0,r=Math.max(n,null!=s?s:0);return r>t?r:t}const i=Number.parseInt(e),n=s[i],r=Math.max(null!=n?n:0,null!=i?i:0);return r>t?r:t},0)+1;let h,u=c;const d=(...t)=>{h&&i(...h),h=t};for(;r<c||a<u||`${a}`in o;){let t=!1;const e=`_${r}`,i=`${a}`,n=a in s?s[a]:void 0;if(e in o){t=!0;const i=o[e];d(e,null!=n?n:r,n?{key:`_${n}`,value:l?l[n]:void 0}:void 0,!1),Array.isArray(i)?0===i[2]?(u--,r++):(i[2],r++):r++}if(i in o){t=!0;const e=o[i],s=Array.isArray(e)&&1===e.length;d(i,null!=n?n:r,n?{key:`_${n}`,value:l?l[n]:void 0}:void 0,!1),s?(u++,a++):void 0===n?(r++,a++):a++}t||((l&&void 0===n||!1!==this.includeMoveDestinations)&&d(i,null!=n?n:r,n?{key:`_${n}`,value:l?l[n]:void 0}:void 0,!1),void 0!==n||r++,a++)}h&&i(h[0],h[1],h[2],!0)}getDeltaType(t,e){if(void 0===t)return void 0!==e?"movedestination":"unchanged";if(Array.isArray(t)){if(1===t.length)return"added";if(2===t.length)return"modified";if(3===t.length&&0===t[2])return"deleted";if(3===t.length&&2===t[2])return"textdiff";if(3===t.length&&3===t[2])return"moved"}else if("object"==typeof t)return"node";return"unknown"}parseTextDiff(t){var e;const i=[],n=t.split("\n@@ ");for(const t of n){const n={pieces:[]},s=null===(e=/^(?:@@ )?[-+]?(\d+),(\d+)/.exec(t))||void 0===e?void 0:e.slice(1);if(!s)throw new Error("invalid text diff format");vb(s),n.location={line:s[0],chr:s[1]};const o=t.split("\n").slice(1);for(let t=0,e=o.length;t<e;t++){const e=o[t];if(void 0===e||!e.length)continue;const i={type:"context"};"+"===e.substring(0,1)?i.type="added":"-"===e.substring(0,1)&&(i.type="deleted"),i.text=e.slice(1),n.pieces.push(i)}i.push(n)}return i}};class Ob extends yb{typeFormattterErrorFormatter(t,e){const i="object"==typeof e&&null!==e&&"message"in e&&"string"==typeof e.message?e.message:String(e);t.out(`<pre class="jsondiffpatch-error">${bb(i)}</pre>`)}formatValue(t,e){const i=void 0===e?"undefined":bb(JSON.stringify(e,null,2));t.out(`<pre>${i}</pre>`)}formatTextDiffString(t,e){const i=this.parseTextDiff(e);t.out('<ul class="jsondiffpatch-textdiff">');for(let e=0,n=i.length;e<n;e++){const n=i[e];if(void 0===n)return;t.out(`<li><div class="jsondiffpatch-textdiff-location"><span class="jsondiffpatch-textdiff-line-number">${n.location.line}</span><span class="jsondiffpatch-textdiff-char">${n.location.chr}</span></div><div class="jsondiffpatch-textdiff-line">`);const s=n.pieces;for(let e=0,i=s.length;e<i;e++){const i=s[e];if(void 0===i)return;t.out(`<span class="jsondiffpatch-textdiff-${i.type}">${bb(decodeURI(i.text))}</span>`)}t.out("</div></li>")}t.out("</ul>")}rootBegin(t,e,i){const n=`jsondiffpatch-${e}${i?` jsondiffpatch-child-node-type-${i}`:""}`;t.out(`<div class="jsondiffpatch-delta ${n}">`)}rootEnd(t){t.out("</div>"+(t.hasArrows?`<script type="text/javascript">setTimeout(${xb.toString()},10);<\/script>`:""))}nodeBegin(t,e,i,n,s){const o=`jsondiffpatch-${n}${s?` jsondiffpatch-child-node-type-${s}`:""}`,r="number"==typeof i&&"_"===e.substring(0,1)?e.substring(1):e;t.out(`<li class="${o}" data-key="${bb(e)}"><div class="jsondiffpatch-property-name">${bb(r)}</div>`)}nodeEnd(t){t.out("</li>")}format_unchanged(t,e,i){void 0!==i&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,i),t.out("</div>"))}format_movedestination(t,e,i){void 0!==i&&(t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,i),t.out("</div>"))}format_node(t,e,i){const n="a"===e._t?"array":"object";t.out(`<ul class="jsondiffpatch-node jsondiffpatch-node-type-${n}">`),this.formatDeltaChildren(t,e,i),t.out("</ul>")}format_added(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")}format_modified(t,e){t.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">'),this.formatValue(t,e[0]),t.out('</div><div class="jsondiffpatch-value jsondiffpatch-right-value">'),this.formatValue(t,e[1]),t.out("</div>")}format_deleted(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out("</div>")}format_moved(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatValue(t,e[0]),t.out(`</div><div class="jsondiffpatch-moved-destination">${e[1]}</div>`),t.out('<div class="jsondiffpatch-arrow" style="position: relative; left: -34px;">\n <svg width="30" height="60" style="position: absolute; display: none;">\n <defs>\n <marker id="markerArrow" markerWidth="8" markerHeight="8"\n refx="2" refy="4" stroke="#88f"\n orient="auto" markerUnits="userSpaceOnUse">\n <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\n </marker>\n </defs>\n <path d="M30,0 Q-10,25 26,50"\n style="stroke: #88f; stroke-width: 2px; fill: none; stroke-opacity: 0.5; marker-end: url(#markerArrow);"\n ></path>\n </svg>\n </div>'),t.hasArrows=!0}format_textdiff(t,e){t.out('<div class="jsondiffpatch-value">'),this.formatTextDiffString(t,e[0]),t.out("</div>")}}function bb(t){if("number"==typeof t)return t;let e=String(t);const i=[[/&/g,"&amp;"],[/</g,"&lt;"],[/>/g,"&gt;"],[/'/g,"&apos;"],[/"/g,"&quot;"]];for(const t of i)e=e.replace(t[0],t[1]);return e}const xb=function(t){const e=t||document;((t,e,i)=>{const n=t.querySelectorAll(e);for(let t=0,e=n.length;t<e;t++)i(n[t])})(e,".jsondiffpatch-arrow",({parentNode:t,children:e,style:i})=>{const n=t,s=e[0],o=s.children[1];s.style.display="none";const r=n.querySelector(".jsondiffpatch-moved-destination");if(!(r instanceof HTMLElement))return;const a=(({textContent:t,innerText:e})=>t||e)(r),l=n.parentNode;if(!l)return;let c;if((({children:t},e)=>{for(let i=0,n=t.length;i<n;i++){const n=t[i];n&&e(n,i)}})(l,t=>{t.getAttribute("data-key")===a&&(c=t)}),c)try{const t=c.offsetTop-n.offsetTop;s.setAttribute("height",`${Math.abs(t)+6}`),i.top=`${-8+(t>0?0:t)}px`;const e=t>0?`M30,0 Q-10,${Math.round(t/2)} 26,${t-4}`:`M30,${-t} Q-10,${Math.round(-t/2)} 26,4`;o.setAttribute("d",e),s.style.display=""}catch(t){console.debug(`[jsondiffpatch] error adjusting arrows: ${t}`)}})},wb=(t,e)=>((t,e,i)=>{const n=e||document.body,s="jsondiffpatch-unchanged-",o={showing:`${s}showing`,hiding:`${s}hiding`,visible:`${s}visible`,hidden:`${s}hidden`},r=n.classList;if(!r)return;if(!i)return r.remove(o.showing),r.remove(o.hiding),r.remove(o.visible),r.remove(o.hidden),void(!1===t&&r.add(o.hidden));!1===t?(r.remove(o.showing),r.add(o.visible),setTimeout(()=>{r.add(o.hiding)},10)):(r.remove(o.hiding),r.add(o.showing),r.remove(o.hidden));const a=setInterval(()=>{xb(n)},100);setTimeout(()=>{r.remove(o.showing),r.remove(o.hiding),!1===t?(r.add(o.hidden),r.remove(o.visible)):(r.add(o.visible),r.remove(o.hidden)),setTimeout(()=>{r.remove(o.visible),clearInterval(a)},i+400)},i)})(!1,t,e);let _b;function Sb(t){if("object"!=typeof t)return t;if(null===t)return null;if(Array.isArray(t))return t.map(Sb);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return function(t){var e;const i=/^\/(.*)\/([gimyu]*)$/.exec(t.toString());if(!i)throw new Error("Invalid RegExp");return new RegExp(null!==(e=i[1])&&void 0!==e?e:"",i[2])}(t);const e={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=Sb(t[i]));return e}class kb{setResult(t){return this.result=t,this.hasResult=!0,this}exit(){return this.exiting=!0,this}push(t,e){var i;return t.parent=this,void 0!==e&&(t.childName=e),t.root=this.root||this,t.options=t.options||this.options,this.children?(!function(t,e){if(0===t.length)throw new Error(e||"Expected a non-empty array")}(this.children),(i=this.children,i[i.length-1]).next=t,this.children.push(t)):(this.children=[t],this.nextAfterChildren=this.next||null,this.next=t),t.next=this,this}}const $b=class extends kb{constructor(t,e){super(),this.left=t,this.right=e,this.pipe="diff"}prepareDeltaResult(t){var e,i,n,s;if("object"==typeof t&&((null===(e=this.options)||void 0===e?void 0:e.omitRemovedValues)&&Array.isArray(t)&&t.length>1&&(2===t.length||0===t[2]||3===t[2])&&(t[0]=0),null===(i=this.options)||void 0===i?void 0:i.cloneDiffValues)){const e="function"==typeof(null===(n=this.options)||void 0===n?void 0:n.cloneDiffValues)?null===(s=this.options)||void 0===s?void 0:s.cloneDiffValues:Sb;"object"==typeof t[0]&&(t[0]=e(t[0])),"object"==typeof t[1]&&(t[1]=e(t[1]))}return t}setResult(t){return this.prepareDeltaResult(t),super.setResult(t)}};const Tb=class extends kb{constructor(t,e){super(),this.left=t,this.delta=e,this.pipe="patch"}};const Cb=class extends kb{constructor(t){super(),this.delta=t,this.pipe="reverse"}};const Pb=class{constructor(t){this.name=t,this.filters=[]}process(t){if(!this.processor)throw new Error("add this pipe to a processor before using it");const e=this.debug,i=this.filters.length,n=t;for(let t=0;t<i;t++){const i=this.filters[t];if(i&&(e&&this.log(`filter: ${i.filterName}`),i(n),"object"==typeof n&&n.exiting)){n.exiting=!1;break}}!n.next&&this.resultCheck&&this.resultCheck(n)}log(t){console.log(`[jsondiffpatch] ${this.name} pipe, ${t}`)}append(...t){return this.filters.push(...t),this}prepend(...t){return this.filters.unshift(...t),this}indexOf(t){if(!t)throw new Error("a filter name is required");for(let e=0;e<this.filters.length;e++){const i=this.filters[e];if((null==i?void 0:i.filterName)===t)return e}throw new Error(`filter not found: ${t}`)}list(){return this.filters.map(t=>t.filterName)}after(t,...e){const i=this.indexOf(t);return this.filters.splice(i+1,0,...e),this}before(t,...e){const i=this.indexOf(t);return this.filters.splice(i,0,...e),this}replace(t,...e){const i=this.indexOf(t);return this.filters.splice(i,1,...e),this}remove(t){const e=this.indexOf(t);return this.filters.splice(e,1),this}clear(){return this.filters.length=0,this}shouldHaveResult(t){return!1===t?(this.resultCheck=null,this):(this.resultCheck||(this.resultCheck=t=>{if(!t.hasResult){console.log(t);const e=new Error(`${this.name} failed`);throw e.noResult=!0,e}}),this)}};const Eb=class{constructor(t){this.selfOptions=t||{},this.pipes={}}options(t){return t&&(this.selfOptions=t),this.selfOptions}pipe(t,e){let i=e;if("string"==typeof t){if(void 0===i)return this.pipes[t];this.pipes[t]=i}if(t&&t.name){if(i=t,i.processor===this)return i;this.pipes[i.name]=i}if(!i)throw new Error(`pipe is not defined: ${t}`);return i.processor=this,i}process(t,e){let i=t;i.options=this.options();let n,s=e||t.pipe||"default";for(;s;)void 0!==i.nextAfterChildren&&(i.next=i.nextAfterChildren,i.nextAfterChildren=null),"string"==typeof s&&(s=this.pipe(s)),s.process(i),n=s,s=null,i&&i.next&&(i=i.next,s=i.pipe||n);return i.hasResult?i.result:void 0}},Ab=(t,e,i,n)=>t[i]===e[n],Mb=(t,e,i,n)=>{const s=n||{},o=((t,e,i,n)=>{var s,o,r;const a=t.length,l=e.length;let c,h;const u=new Array(a+1);for(c=0;c<a+1;c++){const t=new Array(l+1);for(h=0;h<l+1;h++)t[h]=0;u[c]=t}for(u.match=i,c=1;c<a+1;c++){const a=u[c];if(void 0===a)throw new Error("LCS matrix row is undefined");const d=u[c-1];if(void 0===d)throw new Error("LCS matrix row is undefined");for(h=1;h<l+1;h++)i(t,e,c-1,h-1,n)?a[h]=(null!==(s=d[h-1])&&void 0!==s?s:0)+1:a[h]=Math.max(null!==(o=d[h])&&void 0!==o?o:0,null!==(r=a[h-1])&&void 0!==r?r:0)}return u})(t,e,i||Ab,s);return((t,e,i,n)=>{let s=e.length,o=i.length;const r={sequence:[],indices1:[],indices2:[]};for(;0!==s&&0!==o;){if(void 0===t.match)throw new Error("LCS matrix match function is undefined");if(t.match(e,i,s-1,o-1,n))r.sequence.unshift(e[s-1]),r.indices1.unshift(s-1),r.indices2.unshift(o-1),--s,--o;else{const e=t[s];if(void 0===e)throw new Error("LCS matrix row is undefined");const i=e[o-1];if(void 0===i)throw new Error("LCS matrix value is undefined");const n=t[s-1];if(void 0===n)throw new Error("LCS matrix row is undefined");const r=n[o];if(void 0===r)throw new Error("LCS matrix value is undefined");i>r?--o:--s}}return r})(o,t,e,s)};function Qb(t,e,i,n,s){const o=t[i],r=e[n];if(o===r)return!0;if("object"!=typeof o||"object"!=typeof r)return!1;const a=s.objectHash;if(!a)return s.matchByPosition&&i===n;s.hashCache1=s.hashCache1||[];let l=s.hashCache1[i];if(void 0===l&&(s.hashCache1[i]=l=a(o,i)),void 0===l)return!1;s.hashCache2=s.hashCache2||[];let c=s.hashCache2[n];return void 0===c&&(s.hashCache2[n]=c=a(r,n)),void 0!==c&&l===c}const Db=function(t){var e,i,n,s,o;if(!t.leftIsArray)return;const r={objectHash:null===(e=t.options)||void 0===e?void 0:e.objectHash,matchByPosition:null===(i=t.options)||void 0===i?void 0:i.matchByPosition};let a,l,c,h=0,u=0;const d=t.left,f=t.right,p=d.length,m=f.length;let g,v;for(p>0&&m>0&&!r.objectHash&&"boolean"!=typeof r.matchByPosition&&(r.matchByPosition=!function(t,e,i,n){for(let s=0;s<i;s++){const i=t[s];for(let t=0;t<n;t++){const n=e[t];if(s!==t&&i===n)return!0}}return!1}(d,f,p,m));h<p&&h<m&&Qb(d,f,h,h,r);)a=h,g=new $b(d[a],f[a]),t.push(g,a),h++;for(;u+h<p&&u+h<m&&Qb(d,f,p-1-u,m-1-u,r);)l=p-1-u,c=m-1-u,g=new $b(d[l],f[c]),t.push(g,c),u++;if(h+u===p){if(p===m)return void t.setResult(void 0).exit();for(v=v||{_t:"a"},a=h;a<m-u;a++)v[a]=[f[a]],t.prepareDeltaResult(v[a]);return void t.setResult(v).exit()}if(h+u===m){for(v=v||{_t:"a"},a=h;a<p-u;a++){const e=`_${a}`;v[e]=[d[a],0,0],t.prepareDeltaResult(v[e])}return void t.setResult(v).exit()}r.hashCache1=void 0,r.hashCache2=void 0;const y=d.slice(h,p-u),O=f.slice(h,m-u),b=Mb(y,O,Qb,r),x=[];for(v=v||{_t:"a"},a=h;a<p-u;a++)if(b.indices1.indexOf(a-h)<0){const e=`_${a}`;v[e]=[d[a],0,0],t.prepareDeltaResult(v[e]),x.push(a)}let w=!0;(null===(n=t.options)||void 0===n?void 0:n.arrays)&&!1===t.options.arrays.detectMove&&(w=!1);let _=!1;(null===(o=null===(s=t.options)||void 0===s?void 0:s.arrays)||void 0===o?void 0:o.includeValueOnMove)&&(_=!0);const S=x.length;for(a=h;a<m-u;a++){const e=b.indices2.indexOf(a-h);if(e<0){let e=!1;if(w&&S>0)for(let i=0;i<S;i++){l=x[i];const n=void 0===l?void 0:v[`_${l}`];if(void 0!==l&&n&&Qb(y,O,l-h,a-h,r)){n.splice(1,2,a,3),n.splice(1,2,a,3),_||(n[0]=""),c=a,g=new $b(d[l],f[c]),t.push(g,c),x.splice(i,1),e=!0;break}}e||(v[a]=[f[a]],t.prepareDeltaResult(v[a]))}else{if(void 0===b.indices1[e])throw new Error(`Invalid indexOnArray2: ${e}, seq.indices1: ${b.indices1}`);if(l=b.indices1[e]+h,void 0===b.indices2[e])throw new Error(`Invalid indexOnArray2: ${e}, seq.indices2: ${b.indices2}`);c=b.indices2[e]+h,g=new $b(d[l],f[c]),t.push(g,c)}}t.setResult(v).exit()};Db.filterName="arrays";const Rb={numerically:(t,e)=>t-e,numericallyBy:t=>(e,i)=>e[t]-i[t]},Ib=function(t){var e;if(!t.nested)return;const i=t.delta;if("a"!==i._t)return;let n,s;const o=i,r=t.left;let a=[],l=[];const c=[];for(n in o)if("_t"!==n)if("_"===n[0]){const t=n;if(void 0===o[t]||0!==o[t][2]&&3!==o[t][2])throw new Error(`only removal or move can be applied at original array indices, invalid diff type: ${null===(e=o[t])||void 0===e?void 0:e[2]}`);a.push(Number.parseInt(n.slice(1),10))}else{const t=n;1===o[t].length?l.push({index:Number.parseInt(t,10),value:o[t][0]}):c.push({index:Number.parseInt(t,10),delta:o[t]})}for(a=a.sort(Rb.numerically),n=a.length-1;n>=0;n--){if(s=a[n],void 0===s)continue;const t=o[`_${s}`],e=r.splice(s,1)[0];3===(null==t?void 0:t[2])&&l.push({index:t[1],value:e})}l=l.sort(Rb.numericallyBy("index"));const h=l.length;for(n=0;n<h;n++){const t=l[n];void 0!==t&&r.splice(t.index,0,t.value)}const u=c.length;if(u>0)for(n=0;n<u;n++){const e=c[n];if(void 0===e)continue;const i=new Tb(r[e.index],e.delta);t.push(i,e.index)}t.children?t.exit():t.setResult(r).exit()};Ib.filterName="arrays";const Lb=function(t){if(!t||!t.children)return;if("a"!==t.delta._t)return;const e=t.left,i=t.children.length;for(let n=0;n<i;n++){const i=t.children[n];if(void 0===i)continue;e[i.childName]=i.result}t.setResult(e).exit()};Lb.filterName="arraysCollectChildren";const Nb=function(t){if(!t.nested){const e=t.delta;if(3===e[2]){const i=e;t.newName=`_${i[1]}`,t.setResult([i[0],Number.parseInt(t.childName.substring(1),10),3]).exit()}return}const e=t.delta;if("a"!==e._t)return;const i=e;for(const e in i){if("_t"===e)continue;const n=new Cb(i[e]);t.push(n,e)}t.exit()};Nb.filterName="arrays";const jb=(t,e,i)=>{if("string"==typeof e&&"_"===e[0])return Number.parseInt(e.substring(1),10);if(Array.isArray(i)&&0===i[2])return`_${e}`;let n=+e;for(const i in t){const s=t[i];if(Array.isArray(s))if(3===s[2]){const t=Number.parseInt(i.substring(1),10),o=s[1];if(o===+e)return t;t<=n&&o>n?n++:t>=n&&o<n&&n--}else if(0===s[2]){Number.parseInt(i.substring(1),10)<=n&&n++}else 1===s.length&&Number.parseInt(i,10)<=n&&n--}return n},zb=t=>{if(!t||!t.children)return;const e=t.delta;if("a"!==e._t)return;const i=e,n=t.children.length,s={_t:"a"};for(let e=0;e<n;e++){const n=t.children[e];if(void 0===n)continue;let o=n.newName;if(void 0===o){if(void 0===n.childName)throw new Error("child.childName is undefined");o=jb(i,n.childName,n.result)}s[o]!==n.result&&(s[o]=n.result)}t.setResult(s).exit()};zb.filterName="arraysCollectChildren";const Bb=function(t){t.left instanceof Date?(t.right instanceof Date?t.left.getTime()!==t.right.getTime()?t.setResult([t.left,t.right]):t.setResult(void 0):t.setResult([t.left,t.right]),t.exit()):t.right instanceof Date&&t.setResult([t.left,t.right]).exit()};Bb.filterName="dates";const Zb=t=>{if(!t||!t.children)return;const e=t.children.length;let i=t.result;for(let n=0;n<e;n++){const e=t.children[n];if(void 0!==e&&void 0!==e.result){if(i=i||{},void 0===e.childName)throw new Error("diff child.childName is undefined");i[e.childName]=e.result}}i&&t.leftIsArray&&(i._t="a"),t.setResult(i).exit()};Zb.filterName="collectChildren";const Wb=t=>{var e;if(t.leftIsArray||"object"!==t.leftType)return;const i=t.left,n=t.right,s=null===(e=t.options)||void 0===e?void 0:e.propertyFilter;for(const e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;if(s&&!s(e,t))continue;const o=new $b(i[e],n[e]);t.push(o,e)}for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&(!s||s(e,t))&&void 0===i[e]){const i=new $b(void 0,n[e]);t.push(i,e)}t.children&&0!==t.children.length?t.exit():t.setResult(void 0).exit()};Wb.filterName="objects";const Fb=function(t){if(!t.nested)return;const e=t.delta;if(e._t)return;const i=e;for(const e in i){const n=new Tb(t.left[e],i[e]);t.push(n,e)}t.exit()};Fb.filterName="objects";const Xb=function(t){if(!t||!t.children)return;if(t.delta._t)return;const e=t.left,i=t.children.length;for(let n=0;n<i;n++){const i=t.children[n];if(void 0===i)continue;const s=i.childName;Object.prototype.hasOwnProperty.call(t.left,s)&&void 0===i.result?delete e[s]:e[s]!==i.result&&(e[s]=i.result)}t.setResult(e).exit()};Xb.filterName="collectChildren";const qb=function(t){if(!t.nested)return;if(t.delta._t)return;const e=t.delta;for(const i in e){const n=new Cb(e[i]);t.push(n,i)}t.exit()};qb.filterName="objects";const Hb=t=>{if(!t||!t.children)return;if(t.delta._t)return;const e=t.children.length,i={};for(let n=0;n<e;n++){const e=t.children[n];if(void 0===e)continue;const s=e.childName;i[s]!==e.result&&(i[s]=e.result)}t.setResult(i).exit()};Hb.filterName="collectChildren";let Vb=null;function Yb(t,e){var i;if(!Vb){let n;if(!(null===(i=null==t?void 0:t.textDiff)||void 0===i?void 0:i.diffMatchPatch)){if(!e)return null;const t=new Error("The diff-match-patch library was not provided. Pass the library in through the options or use the `jsondiffpatch/with-text-diffs` entry-point.");throw t.diff_match_patch_not_found=!0,t}n=new t.textDiff.diffMatchPatch,Vb={diff:(t,e)=>n.patch_toText(n.patch_make(t,e)),patch:(t,e)=>{const i=n.patch_apply(n.patch_fromText(e),t);for(const t of i[1])if(!t){const t=new Error("text patch failed");throw t.textPatchFailed=!0,t}return i[0]}}}return Vb}const Ub=function(t){var e,i;if("string"!==t.leftType)return;const n=t.left,s=t.right,o=(null===(i=null===(e=t.options)||void 0===e?void 0:e.textDiff)||void 0===i?void 0:i.minLength)||60;if(n.length<o||s.length<o)return void t.setResult([n,s]).exit();const r=Yb(t.options);if(!r)return void t.setResult([n,s]).exit();const a=r.diff;t.setResult([a(n,s),0,2]).exit()};Ub.filterName="texts";const Gb=function(t){if(t.nested)return;const e=t.delta;if(2!==e[2])return;const i=e,n=Yb(t.options,!0).patch;t.setResult(n(t.left,i[0])).exit()};Gb.filterName="texts";const Kb=t=>{var e,i,n;const s=/^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/,o=t.split("\n");for(let t=0;t<o.length;t++){const r=o[t];if(void 0===r)continue;const a=r.slice(0,1);if("@"===a){const e=s.exec(r);if(null!==e){o[t]=`@@ -${e[3]},${e[4]} +${e[1]},${e[2]} @@`}}else if("+"===a){if(o[t]=`-${null===(e=o[t])||void 0===e?void 0:e.slice(1)}`,"+"===(null===(i=o[t-1])||void 0===i?void 0:i.slice(0,1))){const e=o[t];o[t]=o[t-1],o[t-1]=e}}else"-"===a&&(o[t]=`+${null===(n=o[t])||void 0===n?void 0:n.slice(1)}`)}return o.join("\n")},Jb=function(t){if(t.nested)return;const e=t.delta;if(2!==e[2])return;const i=e;t.setResult([Kb(i[0]),0,2]).exit()};Jb.filterName="texts";const tx=function(t){if(t.left!==t.right)if(void 0!==t.left)if(void 0!==t.right){if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType===t.rightType&&"boolean"!==t.leftType&&"number"!==t.leftType?("object"===t.leftType&&(t.leftIsArray=Array.isArray(t.left)),"object"===t.rightType&&(t.rightIsArray=Array.isArray(t.right)),t.leftIsArray===t.rightIsArray?t.left instanceof RegExp&&(t.right instanceof RegExp?t.setResult([t.left.toString(),t.right.toString()]).exit():t.setResult([t.left,t.right]).exit()):t.setResult([t.left,t.right]).exit()):t.setResult([t.left,t.right]).exit()}else t.setResult([t.left,0,0]).exit();else{if("function"==typeof t.right)throw new Error("functions are not supported");t.setResult([t.right]).exit()}else t.setResult(void 0).exit()};tx.filterName="trivial";const ex=function(t){if(void 0===t.delta)return void t.setResult(t.left).exit();if(t.nested=!Array.isArray(t.delta),t.nested)return;const e=t.delta;if(1!==e.length)if(2!==e.length)3===e.length&&0===e[2]&&t.setResult(void 0).exit();else{if(t.left instanceof RegExp){const i=/^\/(.*)\/([gimyu]+)$/.exec(e[1]);if(null==i?void 0:i[1])return void t.setResult(new RegExp(i[1],i[2])).exit()}t.setResult(e[1]).exit()}else t.setResult(e[0]).exit()};ex.filterName="trivial";const ix=function(t){if(void 0===t.delta)return void t.setResult(t.delta).exit();if(t.nested=!Array.isArray(t.delta),t.nested)return;const e=t.delta;1!==e.length?2!==e.length?3===e.length&&0===e[2]&&t.setResult([e[0]]).exit():t.setResult([e[1],e[0]]).exit():t.setResult([e[0],0,0]).exit()};ix.filterName="trivial";const nx=class{constructor(t){this.processor=new Eb(t),this.processor.pipe(new Pb("diff").append(Zb,tx,Bb,Ub,Wb,Db).shouldHaveResult()),this.processor.pipe(new Pb("patch").append(Xb,Lb,ex,Gb,Fb,Ib).shouldHaveResult()),this.processor.pipe(new Pb("reverse").append(Hb,zb,ix,Jb,qb,Nb).shouldHaveResult())}options(t){return this.processor.options(t)}diff(t,e){return this.processor.process(new $b(t,e))}patch(t,e){return this.processor.process(new Tb(t,e))}reverse(t){return this.processor.process(new Cb(t))}unpatch(t,e){return this.patch(t,this.reverse(e))}clone(t){return Sb(t)}};let sx;function ox(t,e){return sx||(sx=new nx),sx.diff(t,e)}const rx=new nx({objectHash:(t,e)=>t.id||`$$index:${e}`});function ax(t,e){return function(t,e){return _b||(_b=new Ob),_b.format(t,e)}(rx.diff(t,e),t)}class lx extends u{constructor(t,e,i,n,s,o){super("Save Configurations",function(t){const{url:e,filename:i,diff:n}=t;return`\n<div class="textae-editor__save-dialog__container">\n <div class="textae-editor__save-dialog__row">\n <label>URL</label>\n <input\n type="text" value="${e}"\n class="textae-editor__save-dialog__url-text">\n <input\n type="button"\n class="textae-editor__save-dialog__url-button"\n ${e?"":'disabled="disabled"'}\n value="Save">\n </div>\n <div class="textae-editor__save-dialog__row">\n <label>Local</label>\n <input\n type="text" value="${i||""}"\n >\n <a class="textae-editor__save-dialog__download-link" href="#">Download</a>\n </div>\n <div class="textae-editor__save-dialog__row">\n <div class="textae-editor__save-dialog__diff-title">\n Configuration differences\n <span class="textae-editor__save-dialog__diff-add-legend">added</span>\n <span class="textae-editor__save-dialog__diff-remove-legend">removed</span>\n </div>\n <div class="textae-editor__save-dialog__diff-viewer">${n}</div>\n </div>\n</div>\n`}({filename:i,url:e,diff:ax(n,s)||"nothing."}),{maxWidth:550}),this._$dialog.on("dialogopen",()=>wb()),function(t,e,i,n,s){r()(e,".textae-editor__save-dialog__url-text","input",t=>{yn(t.target.nextElementSibling,t.target.value)}),r()(e,".textae-editor__save-dialog__url-text","keyup",t=>{13===t.keyCode&&(s(t.target.value),n())}),r()(e,".textae-editor__save-dialog__url-button","click",t=>{s(t.target.previousElementSibling.value),n()}),r()(e,".textae-editor__save-dialog__download-link","click",e=>{const s=e.target,o=KO(i);s.setAttribute("href",o),s.setAttribute("download",s.previousElementSibling.value),t.emit("textae-event.resource.configuration.save",i),n()})}(t,super.el,s,()=>super.close(),o)}}async function cx(t){return new Promise(e=>{const i=new FileReader;i.onload=t=>e(t),i.readAsText(t)})}var hx=i(7975),ux=i.n(hx);const dx=Object.freeze({QUERY_PARAMETER:"parameter",INLINE:"inline",REMOTE_URL:"remote",INSTANT:"instant",LOCAL_FILE:"local file",UNKNOWN:"unknown"});class fx{#Ui;#q;#Gi;static createURLSource(t,e){return console.assert("string"==typeof t,"id must be a string when type is url."),new fx(dx.REMOTE_URL,t,e)}static createFileSource(t,e){return console.assert("string"==typeof t,"id must be a string when type is local file."),new fx(dx.LOCAL_FILE,t,e)}static createInstantSource(t){return new fx(dx.INSTANT,null,t)}static createInlineSource(t){return new fx(dx.INLINE,null,t)}static createParameterSource(t){return new fx(dx.QUERY_PARAMETER,null,t)}constructor(t,e,i){console.assert(Object.values(dx).includes(t),`type must be a member of RESOURCE_TYPE. type: ${t}`),t===dx.REMOTE_URL||t===dx.LOCAL_FILE?console.assert("string"==typeof e,"id must be a string when type is url or local file."):console.assert(null===e,"id must be null when type is not url."),this.#Ui=t,this.#q=e,this.#Gi=i}get resourceType(){return this.#Ui}get id(){return this.#q}get data(){return this.#Gi}get displayName(){switch(this.#Ui){case dx.REMOTE_URL:return new URL(this.#q,location.href).href;case dx.LOCAL_FILE:return`${this.#q}(local file)`;default:return`${this.#Ui}`}}}async function px(t,i){const n=(await cx(t)).target.result;if(s=t.name,".txt"===ux().extname(s)){const s=function(t){try{return db.parse(t)}catch{return null}}(n);if(!s){const i=fx.createFileSource(t.name);return void e().error(`Failed to load annotation from ${i.displayName}.`)}if(s.text)return void i.emit("textae-event.resource.annotation.load.success",fx.createFileSource(t.name,s))}var s;if(On(n)){const e=JSON.parse(n);if(e.text)return void i.emit("textae-event.resource.annotation.load.success",fx.createFileSource(t.name,e))}i.emit("textae-event.resource.annotation.format.error",fx.createFileSource(t.name))}function mx(t,e){return!!e.text&&(t.emit("textae-event.resource.annotation.load.success",fx.createInstantSource(e)),!0)}class gx{#Ki;#Ji;constructor(t){t.on("textae-event.original-data.annotation.reset",t=>{t.resourceType===dx.REMOTE_URL&&(this.#Ki=t.id)}).on("textae-event.original-data.configuration.reset",t=>{t.resourceType===dx.REMOTE_URL&&(this.#Ji=t.id)})}get annotation(){return this.#Ki||""}get configuration(){return this.#Ji||""}}class vx{#Ki;#Ji;constructor(t){t.on("textae-event.original-data.annotation.reset",t=>{t.resourceType===dx.LOCAL_FILE&&(this.#Ki=t.id)}).on("textae-event.original-data.configuration.reset",t=>{t.resourceType===dx.LOCAL_FILE&&(this.#Ji=t.id)})}get annotation(){return this.#Ki}get configuration(){return this.#Ji}}class yx{#Nt;#tn;#qt;#en;#in;#nn;#sn;#ii;#on;#rn;constructor(t,e,i,n,s,o,r,a){this.#Nt=t,this.#tn=e,this.#qt=i,this.#en=n,this.#in=s,this.#nn=o,this.#sn=r,this.#ii=a,this.#on=new gx(t),this.#rn=new vx(t),t.on("textae-event.pallet.import-button.click",()=>this.importConfiguration()).on("textae-event.pallet.upload-button.click",()=>this.uploadConfiguration())}importAnnotation(){new UO("Load Annotations",this.#on.annotation,t=>this.#tn.loadAnnotation(t),t=>px(t,this.#Nt),(t,i)=>function(t,i,n){if("json"===n)On(i)?mx(t,JSON.parse(i)):t.emit("textae-event.resource.annotation.format.error",fx.createInstantSource());else if("inline"===n)try{mx(t,db.parse(i))}catch{const t=fx.createInstantSource();e().error(`Failed to load annotation from ${t.displayName}.`)}}(this.#Nt,t,i),this.#sn.hasChange).open()}uploadAnnotation(){const t=this.#nn||this.#on.annotation||"https://pubannotatoin.org/annotations.json";new gb(this.#Nt,t,this.#rn.annotation,this.#an,(t,e)=>this.#tn.saveAnnotation(t,this.#an,e)).open()}saveAnnotation(){this.#tn.saveAnnotation(this.#nn||this.#on.annotation,this.#an,"json")}importConfiguration(){new GO("Load Configurations",this.#on.configuration,t=>this.#tn.loadConfiguration(t),t=>function(t,e){cx(t).then(({target:i})=>{On(i.result)?e.emit("textae-event.resource.configuration.load.success",fx.createFileSource(t.name,JSON.parse(i.result))):e.emit("textae-event.resource.configuration.format.error",fx.createFileSource(t.name))})}(t,this.#Nt),t=>{On(t)?this.#Nt.emit("textae-event.resource.configuration.load.success",fx.createInstantSource(JSON.parse(t))):this.#Nt.emit("textae-event.resource.configuration.format.error",fx.createInstantSource())},this.#ii.diffOfConfiguration).open()}uploadConfiguration(){const t={...this.#in(),...this.#qt.typeDictionary.config};new lx(this.#Nt,this.#on.configuration,this.#rn.configuration,this.#in(),t,e=>this.#tn.saveConfiguration(e,t)).open()}get#an(){const t={...this.#en(),...this.#qt.externalFormat,config:this.#qt.typeDictionary.config};return delete t.tracks,t}}function Ox(t,e,i,n,s,o){e.setPushButtons(t),i.set(t),n.reset(s,t),o.availability=t["function availability"]}function bx(t){if(!0===t)return"flag";if("number"==typeof t)return"numeric";if("string"==typeof t)return"string";throw`${JSON.stringify(t)} is an unexpected value for an Attribute.`}function xx(t){const e=t.reduce((t,e)=>t.has(e)?t.set(e,t.get(e)+1):t.set(e,1),new Map),i=Math.max(...e.values());for(const[t,n]of e.entries())if(n===i)return t}function wx(t){const e=Math.max(...t.map(t=>{const[e,i]=String(t).split(".");return i?i.length:0}));return Number(Array.from(Array(e)).reduce((t,e)=>.1*t,1).toFixed(e))}class _x{constructor({pred:t,obj:e}){this._pred=t,this._objects=[e]}push(t){this._objects.push(t)}get definition(){switch(bx(this._objects[0])){case"flag":return this._prototype;case"numeric":return this._numericAttribute;case"string":return this._stringAttribute;default:throw new Error(`prototype: ${JSON.stringify(this._prototype)}`)}}get mostFrequentObject(){return xx(this._objects)}get _prototype(){return{pred:this._pred,"value type":bx(this._objects[0])}}get _numericAttribute(){return{min:Math.min(...this._objects),max:Math.max(...this._objects),step:wx(this._objects),default:xx(this._objects),...this._prototype}}get _stringAttribute(){return{default:xx(this._objects),...this._prototype}}}function Sx(t){return t.reduce((t,e)=>(t.has(e.pred)?t.get(e.pred).push(e.obj):t.set(e.pred,new _x(e)),t),new Map)}function kx(t,e){const i=function(t){return[...Sx(t).values()].map(t=>t.definition)}(e);return function(t,e){for(const i of e){const e=t.findIndex(t=>t.pred===i.pred);-1!==e?t[e]={...i,...t[e]}:t.push(i)}return t}(t,i)}function $x(t){return t?JSON.parse(JSON.stringify(t)):{}}class Tx{constructor(t=[],e=[]){this._annotations=e,this._config=t}get configuration(){let t=kx(this._config,this._annotations);return t=function(t){t=$x(t);for(const e of t.filter(t=>"numeric"===t["value type"]))Object.prototype.hasOwnProperty.call(e,"default")||(e.default=0),Object.prototype.hasOwnProperty.call(e,"step")||(e.step=2);return t}(t),t=function(t,e){t=$x(t);const i=Sx(e);for(const e of function(t){return t.filter(t=>"selection"===t["value type"])}(t))if(e.values&&0!==e.values.length)if(e.values.find(t=>!0===t.default));else if(i.has(e.pred)){const t=i.get(e.pred);e.values.find(e=>e.id===t.mostFrequentObject).default=!0}else e.values[0].default=!0;else e.values=[{id:"default",default:!0}];return t}(t,this._annotations),t}}function Cx(t,e){if(console.assert(t),(e=$x(e))["attribute types"]=new Tx(e["attribute types"],t.attributes).configuration,t.tracks)for(const i of t.tracks)e["attribute types"]=new Tx(e["attribute types"],i.attributes).configuration;return e}const Px=new(rn())({verbose:!0});ln()(Px,["uri-reference","regex"]);const Ex=Px.compile(cn);function Ax(t){return console.assert(t,"config is required."),Ex(t)?null:(console.warn(Ex.errors),function(t){for(const e of t){if("required"===e.keyword)return`Invalid configuration: The attribute type whose predicate is '${e.data.pred}' misses a mandatory property, '${e.params.missingProperty}'.`;if(e.instancePath.includes("color"))return rt`Invalid configuration: '${e.data}' is invalid color format.`}}(Ex.errors))}function Mx(t,i){const n=function(t,e){if(console.assert(e,"If you don't have a configuration, generate a configuration from the annotation."),t.attributes){const i=e["attribute types"],n=t.attributes.filter(t=>i.some(e=>e.pred===t.pred&&"selection"===e["value type"])).filter(t=>!i.some(e=>e.pred===t.pred&&e.values.some(e=>e.id===t.obj)));if(n.length)return console.warn("selection attribute values without definition",n),`selection attribute value definition for "${n.map(t=>t.obj).join(", ")}" in configuration is missing. `}}(t,i);if(!n)return i;e().error(n)}function Qx(t,i){const n=Cx(t,i),s=Ax(n);if(!s)return Mx(t,n);e().error(s)}function Dx(t){(function(t){if(t.denotations)for(const e of t.denotations){if(e.span.begin!==parseInt(e.span.begin))return!0;if(e.span.end!==parseInt(e.span.end))return!0}})(t)&&e().warning("In the annotation file, some of the begin and end offsets of denotations were not integer values.\n TextAE converted them to integer values.\n However, to avoid a chance of unexpected rendering, please fix them.",15)}function Rx(t,i,n,s,o,r,a,l){if(!t.data.config&&i)n.loadConfiguration(i,t);else{if(Dx(t.data),t.data.config&&"object"!=typeof t.data.config)return void e().error("configuration in annotation file is invalid.");const i=Qx(t.data,t.data.config);i&&(Ox(i,s,o,r,t.data,a),l.annotation=t)}}const Ix='\n<div class="textae-editor__footer">\n <div class="textae-editor__footer__message"></div>\n</div>\n';class Lx{#Q;#ln;constructor(t,e){this.#Q=t,this.#ln=e}set status(t){var e;this.#ln&&(""!==t&&((e=this.#Q,e.querySelector(".textae-editor__footer__message")||(e.insertAdjacentHTML("beforeend",Ix.replace(/[\n\r]+/g,"")),e.querySelector(".textae-editor__footer__message"))).innerHTML=lt(t)?`Source: <a class="textae-editor__footer__message__link" href="${t}">${decodeURI(t)}</a>`:`Source: ${t}`))}}class Nx{#Nt;#cn;#Ki;#Ji;constructor(t,e,i){this.#Nt=t,this.#cn=new Lx(e,i),t.on("textae-event.resource.annotation.save",t=>{this.#hn=t}).on("textae-event.resource.configuration.save",t=>{this.#Ji=t})}get defaultAnnotation(){return{text:"Currently, the document is empty. Use the `import` button or press the key `i` to open a document with annotation."}}get defaultConfiguration(){return Cx(this.defaultAnnotation)}get annotation(){return this.#Ki?this.#Ki:this.defaultAnnotation}set annotation(t){this.#hn=t.data,this.#cn.status=t.displayName,this.#Nt.emit("textae-event.original-data.annotation.reset",t)}get configuration(){return this.#Ji?this.#Ji:{}}set configuration(t){this.#Ji=t.data,this.#Nt.emit("textae-event.original-data.configuration.reset",t)}set#hn(t){this.#Ki=t,t.config&&(this.#Ji=t.config)}}const jx="Init",zx="View",Bx="Term",Zx="Block",Wx="Relation",Fx="Text",Xx=[{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"import",title:"Import [I]"},{type:"upload",title:"Upload [U]"},{type:"upload automatically",title:"Upload Automatically",push:!0}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"view mode",title:"View Mode",push:!0},{type:"term edit mode",title:"Term Edit Mode",push:!0},{type:"block edit mode",title:"Block Edit Mode",push:!0},{type:"relation edit mode",title:"Relation Edit Mode",push:!0},{type:"text edit mode",title:"Text Edit Mode",push:!0}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"simple view",title:"Simple View",push:!0},{type:"adjust lineheight",title:"Adjust LineHeight"},{type:"auto adjust lineheight",title:"Auto Adjust LineHeight",push:!0}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"undo",title:"Undo [Z]"},{type:"redo",title:"Redo [A]"}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"replicate span annotation",title:"Replicate span annotation [R]",enableWhenSelecting:t=>t.span.single&&t.span.single.isDenotation},{type:"auto replicate",title:"Auto replicate",push:!0},{type:"boundary detection",title:"Boundary Detection [B]",push:!0}]},{usage:{"keyboard device":[],"touch device":["control bar","context menu"]},list:[{type:"create span by touch",title:"Create span",availableModes:[Bx,Zx]},{type:"expand span by touch",title:"Expand span",availableModes:[Bx,Zx]},{type:"shrink span by touch",title:"Shrink span",availableModes:[Bx,Zx]},{type:"edit text by touch",title:"Edit text",availableModes:[Fx]}]},{usage:{"keyboard device":["control bar","context menu"],"touch device":["control bar"]},list:[{type:"new entity",title:"New entity [E]",enableWhenSelecting:t=>t.span.contains(t=>t.isDenotation)},{type:"pallet"},{type:"edit properties",title:"Edit Properties [W]",enableWhenSelecting:t=>t.entity.some||t.relation.some},{type:"delete",title:"Delete [D]",enableWhenSelecting:t=>t.span.some||t.entity.some||t.relation.some}]},{usage:{"keyboard device":[],"touch device":["control bar"]},list:[{type:"copy",title:"Copy [C]",enableWhenSelecting:t=>t.span.contains(t=>t.isDenotation)||t.entity.contains(t=>t.isDenotation)},{type:"cut",title:"Cut [X]",enableWhenSelecting:t=>t.span.contains(t=>t.isDenotation)||t.entity.contains(t=>t.isDenotation)},{type:"paste",title:"Paste [V]",enableWhenSelecting:(t,e)=>e.hasCopyingItem&&t.span.some||e.hasCuttingItem&&Boolean(t.span.single)}]},{usage:{"keyboard device":["control bar"],"touch device":["control bar"]},list:[{type:"setting",title:"Setting"}]},{usage:{"keyboard device":["control bar"],"touch device":[]},list:[{type:"help",title:"Help [H]"}]}];function qx(){return/Android/.test(navigator.userAgent)}class Hx{#un;#dn;constructor(t,e){this.#un=t,this.#dn=e}isShowOnControlBar(){return qx()||/iPad/.test(navigator.userAgent)||/iPhone/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&W()?this.#un["touch device"].includes("control bar"):this.#un["keyboard device"].includes("control bar")}isShowOnContextMenu(){return W()?this.#un["touch device"].includes("context menu"):this.#un["keyboard device"].includes("context menu")}getButtonsFor(t){const e=this.#dn.filter(({availableModes:e})=>e.includes(t));return new Hx(this.#un,e)}get buttonList(){return this.#dn}get displayProperties(){return{list:this.#dn.map(t=>t.displayProperties)}}}class Vx{#Ui;#ot;#fn=!1;#pn=null;#mn=[zx,Bx,Zx,Wx,Fx];constructor(t,e,i=!1,n=null,s=null){this.#Ui=t,this.#ot=e,this.#fn=i,n&&(this.#pn=n),s&&(this.#mn=s)}get displayProperties(){return{type:this.#Ui,title:this.#ot}}get type(){return this.#Ui}get push(){return this.#fn}get enableWhenSelecting(){return this.#pn}get availableModes(){return this.#mn}}class Yx{#gn;constructor(){this.#gn=Xx.map(({usage:t,list:e})=>new Hx(t,e.map(({type:t,title:e,push:i,enableWhenSelecting:n,availableModes:s})=>new Vx(t,e,i,n,s))))}get controlBar(){return this.#gn.filter(t=>t.isShowOnControlBar()).map(t=>t.displayProperties)}getContextMenuFor(t){return this.#gn.filter(t=>t.isShowOnContextMenu()).map(e=>e.getButtonsFor(t)).map(t=>t.displayProperties)}get pasteButton(){return this.#dn.find(({type:t})=>"paste"===t)}get enableButtonsWhenSelecting(){return this.#dn.filter(t=>t.enableWhenSelecting)}get pushButtons(){return this.#dn.filter(t=>t.push).map(t=>t.type)}get#dn(){return this.#gn.flatMap(t=>t.buttonList)}}class Ux{#l;#Nt;#vn;constructor(t,e=null){this.#l=t,this.#Nt=e,this.#vn=!1}get name(){return this.#l}get isPushed(){return this.#vn}set isPushed(t){this.#vn=t,this.#yn()}toggle(){this.#vn=!this.#vn,this.#yn()}#yn(){this.#Nt&&this.#Nt.emit("textae-event.control.button.push",this)}}class Gx{#On;constructor(t){this.#On=(new Yx).pushButtons.reduce((e,i)=>(e.set(i,new Ux(i,t)),e),new Map),t.on("textae-event.edit-mode.transition",(t,e)=>this.#bn(t,!e))}get(t){return this.#On.has(t)?this.#On.get(t):new Ux(t)}get names(){return this.#On.keys()}#bn(t,e){switch(t){case zx:this.#xn(!0,!1,!1,!1,!1,e);break;case Bx:this.#xn(!1,!0,!1,!1,!1,e);break;case Zx:this.#xn(!1,!1,!0,!1,!1,e);break;case Wx:this.#xn(!1,!1,!1,!0,!1,!1);break;case Fx:this.#xn(!1,!1,!1,!1,!0,e);break;default:throw`unknown edit mode!${t}`}}#xn(t,e,i,n,s,o){this.#On.get("view mode").isPushed=t,this.#On.get("term edit mode").isPushed=e,this.#On.get("block edit mode").isPushed=i,this.#On.get("relation edit mode").isPushed=n,this.#On.get("text edit mode").isPushed=s,this.#On.get("simple view").isPushed=o}}class Kx{#wn;#Nt;#Ie;#oi;constructor(t,e,i){this.#wn=new Map([["import",!0],["upload",!0],["view mode",!0],["term edit mode",!0],["block edit mode",!0],["relation edit mode",!0],["text edit mode",!0],["simple view",!0],["setting",!0],["help",!0]]),this.#Nt=t,this.#Ie=e,this.#oi=i,t.on("textae-event.history.change",t=>{this.enable("undo",t.hasAnythingToUndo),this.enable("redo",t.hasAnythingToRedo)}).on("textae-event.selection.span.change",()=>this.#_n()).on("textae-event.selection.relation.change",()=>this.#_n()).on("textae-event.selection.entity.change",()=>this.#_n()).on("textae-event.edit-mode.transition",t=>this.#Sn(t)).on("textae-event.clip-board.change",()=>this.#kn()).on("textae-event.annotation-auto-saver.enable",t=>this.enable("upload automatically",t))}get(t){return this.#wn.get(t)}enable(t,e){this.#wn.set(t,e),this.#yn()}updateButtonsToOperateSpanWithTouchDevice(t,e,i,n){this.#wn.set("create span by touch",t),this.#wn.set("expand span by touch",e),this.#wn.set("shrink span by touch",i),this.#wn.set("edit text by touch",n),this.#yn()}#_n(){for(const{type:t,enableWhenSelecting:e}of(new Yx).enableButtonsWhenSelecting)this.enable(t,e(this.#Ie,this.#oi));this.#yn()}#kn(){this.enable("paste",(new Yx).pasteButton.enableWhenSelecting(this.#Ie,this.#oi))}#yn(){this.#Nt.emit("textae-event.control.buttons.change",this.#wn.keys())}#Sn(t){switch(t){case zx:this.#$n(!0,!1,!1,!1,!1,!1,!1);break;case Bx:this.#$n(!0,!0,!0,!0,!0,!0,!0);break;case Zx:this.#$n(!0,!1,!0,!0,!0,!0,!0);break;case Wx:this.#$n(!1,!1,!1,!0,!0,!1,!0);break;case Fx:this.#$n(!0,!1,!0,!0,!0,!1,!1);break;default:throw`unknown edit mode!${t}`}this.#yn()}#$n(t,e,i,n,s,o,r){this.#wn.set("simple view",t),this.#wn.set("auto replicate",e),this.#wn.set("boundary detection",i),this.#wn.set("adjust lineheight",n),this.#wn.set("auto adjust lineheight",s),this.#wn.set("create span by touch",o),this.#wn.set("expand span by touch",o),this.#wn.set("shrink span by touch",o),this.#wn.set("pallet",r)}}function Jx(t,e,i,n,s){for(;s(t(i,n));)n+=e;return n}const tw=function(t,e){return t.charAt(e)},ew=function(t,e,i){return Jx(tw,1,t,e,i)},iw=function(t,e,i){return Jx(tw,-1,t,e,i)};class nw{backFromBegin(t,e,i){}forwardFromEnd(t,e,i){}forwardFromBegin(t,e,i){}backFromEnd(t,e,i){}}function sw(t,e){return[t.charAt(e),t.charAt(e-1)]}function ow(t,e){return[t.charAt(e),t.charAt(e+1)]}function rw(t,e,i){return""!==i[0]&&!t(i[1])&&!e(i[1])||e(i[0])}class aw extends nw{backFromBegin(t,e,i){const n=function(t,e,i){return Jx(sw,-1,t,e,t=>t[1]&&!i(t[0])&&!i(t[1]))}(t,ew(t,e,t=>i.isBlankCharacter(t)),t=>i.isDelimiter(t));return n}forwardFromEnd(t,e,i){const n=function(t,e,i){return Jx(ow,1,t,e,t=>t[1]&&!i(t[0])&&!i(t[1]))}(t,iw(t,e,t=>i.isBlankCharacter(t)),t=>i.isDelimiter(t));return n}forwardFromBegin(t,e,i){return function(t,e,i){return Jx(sw,1,t,e,i)}(t,e,t=>rw(t=>i.isBlankCharacter(t),t=>i.isDelimiter(t),t))}backFromEnd(t,e,i){return function(t,e,i){return Jx(ow,-1,t,e,i)}(t,e,t=>rw(t=>i.isBlankCharacter(t),t=>i.isDelimiter(t),t))}}class lw extends nw{backFromBegin(t,e,i){return ew(t,e,t=>i.isBlankCharacter(t))}forwardFromEnd(t,e,i){return iw(t,e,t=>i.isBlankCharacter(t))}forwardFromBegin(t,e,i){return ew(t,e,t=>i.isBlankCharacter(t))}backFromEnd(t,e,i){return iw(t,e,t=>i.isBlankCharacter(t))}}function cw(t){switch(t){case Bx:return"Term Configuration";case Zx:return"Block Configuration";case Wx:return"Relation Configuration";default:return""}}class hw{#Tn;#Cn;#sn;#Pn;#Vt;#si;#En;constructor(t,e,i,n,s,o,r,a){this.#Tn=new Kx(t,e,i),this.#Cn=new Gx(t),this.#sn=n,this.#Pn=s,this.#Vt=o,this.#si=r,this.#En=a}get pushButtonNames(){return this.#Cn.names}isPushed(t){return this.#Cn.get(t).isPushed}push(t){this.#Cn.get(t).isPushed=!0}release(t){this.#Cn.get(t).isPushed=!1}toggleButton(t){return this.#Cn.get(t).toggle()}get textSelectionAdjuster(){return this.isPushed("boundary detection")?new aw:new lw}get controlBarButton(){return(new Yx).controlBar.map(({list:t})=>t.filter(({type:t})=>this.#si.isAvailable(t)).map(({type:t,title:e})=>this.#An(t,e)).map(({type:t,title:e})=>({type:t,title:e,pushed:this.getState(t,"pushed"),disabled:this.getState(t,"disabled")}))).filter(t=>t.length)}get contextMenuButton(){return(new Yx).getContextMenuFor(this.#En.currentState).map(({list:t})=>t.filter(({type:t})=>this.#si.isAvailable(t)).map(({type:t,title:e})=>this.#An(t,e)).reduce((t,{type:e,title:i})=>(!W()&&this.getState(e,"disabled")||t.push(this.#Mn(e,i)),t),[])).filter(t=>t.length)}getState(t,e){switch(e){case"pushed":return this.#Cn.get(t).isPushed;case"disabled":return!this.#Tn.get(t);case"transit":switch(t){case"upload":return this.#sn.hasChange;case"pallet":return this.diffOfConfiguration;default:new Error("Unknown name")}break;default:new Error("Unknown state")}}updateButtonsToOperateSpanWithTouchDevice(t,e,i,n){this.#Tn.updateButtonsToOperateSpanWithTouchDevice(t,e,i,n)}get diffOfConfiguration(){return ox(this.#Pn.configuration,{...this.#Pn.configuration,...this.#Vt.config})}setPushButtons(t){!0===t.autosave?this.push("upload automatically"):this.release("upload automatically"),!1===t.autolineheight?this.release("auto adjust lineheight"):this.push("auto adjust lineheight"),!1===t.boundarydetection?this.release("boundary detection"):this.push("boundary detection")}get detailModifierClassName(){return this.#si.isAvailable("show logo")?"textae-control-details--show-logo":"textae-control-details--hide-logo"}#An(t,e){return"pallet"==t?{type:t,title:cw(this.#En.currentState)}:{type:t,title:e}}#Mn(t,e){return{type:t,title:e,pushed:this.getState(t,"pushed"),disabled:this.getState(t,"disabled"),transit:this.getState(t,"transit")}}}class uw{#Nt;#ei;#Ie;#Qn;#Dn;#Vt;#Rn;#In;constructor(t,e,i,n,s,o){this.#Nt=t,this.#ei=e,this.#Ie=i,this.#Qn=n,this.#Dn=s,this.#Vt=o,this.#Rn=[],this.#In=R(),t.on("textae-event.annotation-data.entity.remove",t=>{this.hasCuttingItem&&this.#Ln(this.#Rn.filter(e=>e!=t))}).on("textae-event.edit-mode.transition",()=>this.#Ln())}get hasCopyingItem(){return this.#Rn[0]instanceof bt}get hasCuttingItem(){return this.#Rn[0]instanceof Vt}copyEntitiesToLocalClipboard(){this.#Ln(this.#Ie.copyingTargets)}copyEntitiesToSystemClipboard(t){if(this.#Ie.span.contains(t=>t.isBlock))return;const{copyingTargets:e}=this.#Ie;if(e.length>0){const i=this.#Qn.config.filter(({id:t})=>e.some(({typeName:e})=>e===t)),n=this.#Dn.config.filter(({pred:t})=>e.some(({attributes:e})=>e.some(e=>e.pred===t))),s=JSON.stringify({typeValues:e.map(({externalFormat:t})=>t),config:{"entity types":i,"attribute types":n}});t.clipboardData.setData("text/plain",s),t.clipboardData.setData("application/x-textae-type-values",s),t.preventDefault()}}cutEntitiesToLocalClipboard(){const{cuttingTargets:t}=this.#Ie;this.#Nn.length&&this.#Nn.every(e=>t.has(e))&&[...t].every(t=>this.#Nn.includes(t))?this.#Ln():this.#Ln([...t])}cutEntitiesToSystemClipboard(t){this.#Ie.span.contains(t=>t.isBlock)||(this.cutEntitiesToLocalClipboard(),t.clipboardData.setData("application/x-textae-editor-uuid",this.#In),this.copyEntitiesToSystemClipboard(t))}pasteEntitiesFromLocalClipboard(){if(this.#jn.length&&this.#Ie.span.single)this.#zn();else if(this.hasCopyingItem){const t=this.#ei.factory.pasteTypesToSelectedSpansCommand(this.#Rn);this.#ei.invoke(t)}}pasteEntitiesFromSystemClipboard(t){if(this.#Ie.span.contains(t=>t.isBlock))return;if(t.clipboardData.getData("application/x-textae-editor-uuid")===this.#In&&this.#jn.length&&this.#Ie.span.single)return void this.#zn();const e=t.clipboardData.getData("application/x-textae-type-values");if(e){const t=JSON.parse(e),i=new Ne;if(i.definedTypes=t.config["attribute types"],this.#Vt.isLock){const e=t.typeValues.map(({obj:t,attributes:e})=>new bt(t,e.filter(({pred:t})=>this.#Dn.get(t)&&this.#Dn.get(t).valueType===i.get(t).valueType))),n=this.#ei.factory.pasteTypesToSelectedSpansCommand(e);this.#ei.invoke(n)}else{const e=t.typeValues.map(({obj:t,attributes:e})=>new bt(t,e.filter(({pred:t})=>!this.#Dn.get(t)||this.#Dn.get(t).valueType===i.get(t).valueType))),n=t.config["entity types"].filter(({id:t})=>!this.#Qn.config.some(e=>e.id===t)),s=t.config["attribute types"].filter(({pred:t})=>!this.#Dn.get(t)),o=this.#ei.factory.pasteTypesToSelectedSpansCommand(e,n,s,this.#Bn(e,i));this.#ei.invoke(o)}return void(this.hasCuttingItem&&this.#Ln())}}#Bn(t,e){const i=[],n=t.reduce((t,i)=>t.concat(i.attributes.filter(({pred:t})=>"selection"===e.get(t).valueType)),[]);for(const{pred:t,obj:s}of n)if(this.#Dn.get(t)&&!this.#Dn.get(t).values.some(({id:t})=>t===s)){const n=e.get(t).values.find(({id:t})=>t===s);i.push({pred:t,value:n})}return i}#zn(){const t=this.#ei.factory.moveEntitiesToSelectedSpanCommand(this.#jn);this.#ei.invoke(t),this.#Ln()}#Ln(t=[]){const e=this.#Nn.filter(e=>!t.includes(e));this.#Rn=t,this.#Nt.emit("textae-event.clip-board.change",this.#Nn,e)}get#jn(){return this.#Nn.filter(t=>t.span.id!==(this.#Ie.span.single&&this.#Ie.span.single.id))}get#Nn(){return this.hasCuttingItem?this.#Rn:[]}}class dw{#ii;constructor(t,e,i,n,o){this.#ii=e;const r=s()(()=>i.saveAnnotation(),5e3);t.on("textae-event.resource.annotation.load.success",()=>this.#Zn()).on("textae-event.resource.save.error",()=>this.#Zn()).on("textae-event.resource.annotation.url.set",e=>t.emit("textae-event.annotation-auto-saver.enable",Boolean(n||e.id))).on("textae-event.control.button.push",({name:t,isPushed:e})=>{"upload automatically"===t&&!0===e&&o.hasChange&&i.saveAnnotation()}).on("textae-event.annotation-data.events-observer.unsaved-change",t=>{t&&e.isPushed("upload automatically")&&r()})}#Zn(){this.#ii.isPushed("upload automatically")&&this.#ii.toggleButton("upload automatically")}}const fw=new d;class pw{#r;constructor(t,e){const i=l().create(t);this.#r=i,function(t,e){r()(t,".textae-control-icon","touchstart",({target:t})=>{if(t.classList.contains("textae-control-icon--disabled"))return;const{buttonType:i}=t.dataset;switch(i){case"create span by touch":case"expand span by touch":case"shrink span by touch":case"edit text by touch":e.handle(i)}},{passive:!0}),r()(t,".textae-control-icon","click",({target:t})=>{if(t.classList.contains("textae-control-icon--disabled"))return;const{buttonType:i}=t.dataset;switch(i){case"help":fw.open();break;case"create span by touch":case"expand span by touch":case"shrink span by touch":case"edit text by touch":break;default:e.handle(i)}});const i=t.querySelector(".textae-control-hamburger-menu-button");i&&i.addEventListener("click",t=>t.target.closest(".textae-control").querySelector(".textae-control-details").classList.toggle("textae-control-details--force-show"))}(this.#r,e)}get el(){return this.#r}_querySelector(t){return this.#r.querySelector(t)}}function mw({type:t,title:e,classList:i}){return`\n<span \nclass="${i.join(" ")}" \ntitle="${e}" \ndata-button-type="${t}">\n</span>\n`}var gw=i(6438),vw=i.n(gw);function yw(t){return t.map(t=>{const e=[];for(const{type:i,title:n,pushed:s,disabled:o,transit:r}of t){const t=["textae-control-icon",`textae-control-${i.replaceAll(" ","-")}-button`];s&&t.push("textae-control-icon--pushed"),o&&t.push("textae-control-icon--disabled"),r&&t.push("textae-control-icon--transit"),e.push({type:i,title:n,classList:t})}return e})}function Ow(t){return`\n<div class="textae-control ${W()?"textae-touch-bar":"textae-control-bar"}">\n <div class="textae-control-summary">\n <span class="textae-control-title">\n <a href="http://textae.pubannotation.org/" target="_blank">TextAE</a>\n </span>\n <button type="button" class="textae-control-hamburger-menu-button" >\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="bi" fill="currentColor" viewBox="0 0 16 16">\n <path fill-rule="evenodd" d="M2.5 11.5A.5.5 0 0 1 3 11h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4A.5.5 0 0 1 3 3h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"></path>\n </svg>\n </button>\n </div>\n <div class="textae-control-details ${t.detailModifierClassName}">\n <span class="textae-control-title">\n <a href="http://textae.pubannotation.org/" target="_blank">TextAE</a>\n </span>\n ${yw(t.controlBarButton).map(t=>`\n <span class="textae-control-separator"></span>\n ${t.map(mw).join("\n")}\n `).join("\n")}\n </div>\n</div>\n`}class bw extends pw{#ii;constructor(t,e,i){super(Ow(e),i),this.#ii=e,W()&&Math.max(document.documentElement.clientWidth,window.innerWidth)<768&&new(vw())(".textae-touch-bar",{stickyContainer:".textae-editor"}),t.on("textae-event.control.button.push",({name:t})=>{this.#Wn(t,"pushed")}).on("textae-event.control.buttons.change",t=>{for(const e of t)this.#Wn(e,"disabled")}).on("textae-event.annotation-data.events-observer.unsaved-change",()=>{this.#Wn("upload","transit")}).on("textae-event.edit-mode.transition",t=>{const e=cw(t);super._querySelector(".textae-control-pallet-button").title=e}).on("textae-event.configuration.reset",()=>this.#Fn()).on("textae-event.type-definition.entity.change",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.entity.delete",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.entity.change-default",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.relation.change",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.relation.delete",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.relation.change-default",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.attribute.create",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.attribute.change",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.attribute.delete",()=>this.#Wn("pallet","transit")).on("textae-event.type-definition.attribute.move",()=>this.#Wn("pallet","transit"))}#Wn(t,e){const i=super._querySelector(`.textae-control-${t.replaceAll(" ","-")}-button`);i&&(this.#ii.getState(t,e)?i.classList.add(`textae-control-icon--${e}`):i.classList.remove(`textae-control-icon--${e}`))}#Fn(){super.el.innerHTML="",super.el.insertAdjacentHTML("beforeend",Ow(this.#ii))}}function xw({type:t,title:e,classList:i}){return`<p \n class="${i.join(" ")}" \n data-button-type="${t}">${e}\n </p>`}class ww extends pw{#Q;#ii;constructor(t,e,i){super(`<div class="textae-control ${W()?"textae-android-context-menu":"textae-context-menu"}"></div>`,i),this.#Q=t,this.#ii=e}show(t){const e=window.getSelection(),i=this.#Q.getBoundingClientRect();if(W()&&1===e.rangeCount){const t=e.getRangeAt(0).getBoundingClientRect(),n=this.#Q.querySelector(".textae-editor__text-box").getBoundingClientRect();this.#Xn(t.y-i.y,t.x-n.x)}else this.#qn(t.pageY-i.y,t.pageX-i.x)}hide(){this.#Hn&&(super.el.classList.remove("textae-context-menu--show"),super.el.classList.add("textae-context-menu--hide"))}get#Hn(){return super.el.classList.contains("textae-context-menu--show")}#Xn(t,e){this.#Vn();const{height:i}=this.el.getBoundingClientRect();super.el.setAttribute("style",`top: ${t-i}px; left: ${e}px`)}#qn(t,e){this.#Vn(),super.el.setAttribute("style",`top: ${t}px; left: ${e}px`)}#Vn(){const t=yw(this.#ii.contextMenuButton);if(0===t.length)return;const e=`\n <div">\n ${t.map(t=>t.map(xw).join("")).join('<p class="textae-control-separator"></p>\n')}\n </div>\n `;super.el.replaceChildren(...l().create(e).children),super.el.classList.remove("textae-context-menu--hide"),super.el.classList.add("textae-context-menu--show")}}class _w{constructor(t,e,i,n,s,o){this._map=new Map([["1",t=>s.manipulateAttribute(1,t)],["2",t=>s.manipulateAttribute(2,t)],["3",t=>s.manipulateAttribute(3,t)],["4",t=>s.manipulateAttribute(4,t)],["5",t=>s.manipulateAttribute(5,t)],["6",t=>s.manipulateAttribute(6,t)],["7",t=>s.manipulateAttribute(7,t)],["8",t=>s.manipulateAttribute(8,t)],["9",t=>s.manipulateAttribute(9,t)],["a",()=>n.isAvailable("redo")&&t.redo()],["b",()=>n.isAvailable("boundary detection")&&e.toggleButton("boundary detection")],["d",()=>n.isAvailable("delete")&&e.removeSelectedElements()],["e",()=>n.isAvailable("new entity")&&e.createEntity()],["f",()=>o.changeModeByShortcut()],["i",()=>n.isAvailable("import")&&i.importAnnotation()],["m",()=>o.changeModeByShortcut()],["q",()=>n.isAvailable("pallet")&&s.showPallet()],["r",()=>n.isAvailable("replicate span annotation")&&e.replicate()],["u",()=>n.isAvailable("upload")&&i.uploadAnnotation()],["w",()=>n.isAvailable("edit properties")&&s.editProperties()],["y",()=>n.isAvailable("redo")&&t.redo()],["z",()=>n.isAvailable("undo")&&t.undo()],["ArrowDown",()=>e.selectDown()],["ArrowLeft",t=>e.selectLeft(t)],["ArrowRight",t=>e.selectRight(t)],["ArrowUp",()=>e.selectUp()],["Backspace",()=>e.removeSelectedElements()],["Delete",()=>e.removeSelectedElements()],["Escape",()=>e.cancelSelect()]])}handle(t){const e=t.shiftKey&&48<=t.keyCode&&t.keyCode<=57?String.fromCharCode(t.keyCode):t.key;this._map.has(e)&&this._map.get(e)(t.shiftKey)}}class Sw{constructor(t,e,i,n,s,o,r){this._map=new Map([["view mode",()=>r.toViewMode()],["term edit mode",()=>r.toTermEditMode()],["block edit mode",()=>r.toBlockEditMode()],["relation edit mode",()=>r.toRelationEditMode()],["text edit mode",()=>r.toTextEditMode()],["simple view",()=>r.toggleSimpleMode()],["import",()=>i.importAnnotation()],["upload",()=>i.uploadAnnotation()],["undo",()=>t.undo()],["redo",()=>t.redo()],["replicate span annotation",()=>e.replicate()],["create span by touch",()=>o.createSpanWithTouchDevice()],["expand span by touch",()=>o.expandSpanWithTouchDevice()],["shrink span by touch",()=>o.shrinkSpanWithTouchDevice()],["edit text by touch",()=>o.editTextWithTouchDevice()],["new entity",()=>e.createEntity()],["edit properties",()=>o.editProperties()],["pallet",()=>o.showPallet()],["delete",()=>e.removeSelectedElements()],["copy",()=>e.copyEntitiesToLocalClipboard()],["cut",()=>e.cutEntitiesToLocalClipboard()],["paste",()=>e.pasteEntitiesFromLocalClipboard()],["setting",()=>e.showSettingDialog()],["adjust lineheight",()=>s.textBox.updateLineHeight()]]);for(const t of n.pushButtonNames)this._map.has(t)||this._map.set(t,()=>e.toggleButton(t))}handle(t){this._map.has(t)&&this._map.get(t)()}}function kw(t,e){return t.id<e.id?-1:t.id>e.id?1:0}function $w({text:t,denotations:e=[],attributes:i=[],relations:n=[],blocks:s=[],selectedText:o}){return{text:t,denotations:e.sort(kw),attributes:i.sort(kw),relations:n.sort(kw),blocks:s.sort(kw),selectedText:o}}function Tw(t,e){return ox($w(t),$w(e))}class Cw{#Nt;#Pn;#qt;#Yn=new(ye())(!1);constructor(t,e,i){this.#Nt=t,this.#Pn=e,this.#qt=i,t.on("textae-event.resource.annotation.save",()=>{this.#Yn.set(!1),this.#Un()}).on("textae-event.annotation-data.all.change",()=>{this.#Yn.set(!1),this.#Un()}).on("textae-event.annotation-data.span.add",()=>this.#Gn()).on("textae-event.annotation-data.span.change",()=>this.#Gn()).on("textae-event.annotation-data.span.remove",()=>this.#Gn()).on("textae-event.annotation-data.entity.add",()=>this.#Gn()).on("textae-event.annotation-data.entity.change",()=>this.#Gn()).on("textae-event.annotation-data.entity.remove",()=>this.#Gn()).on("textae-event.annotation-data.entity.move",()=>this.#Gn()).on("textae-event.annotation-data.relation.add",()=>this.#Gn()).on("textae-event.annotation-data.relation.change",()=>this.#Gn()).on("textae-event.annotation-data.relation.remove",()=>this.#Gn()).on("textae-event.annotation-data.attribute.add",()=>this.#Gn()).on("textae-event.annotation-data.attribute.remove",()=>this.#Gn()).on("textae-event.annotation-data.text.change",()=>this.#Gn()),this.#Yn(()=>t.emit("textae-event.annotation-data.events-observer.unsaved-change",this.#Yn()))}get hasChange(){return this.#Yn()}#Gn(){this.#Yn.set(Tw(this.#Pn.annotation,this.#qt.externalFormat)),this.#Un()}#Un(){this.#Nt.emit("textae-event.annotation-data.events-observer.change",this.#qt)}}async function Pw(t,e){if(function(t,e){const i=ux().extname(e),n=t.headers.get("Content-Type");return".json"===i||n&&n.includes("application/json")}(t,e))return await t.json();if(function(t,e){const i=ux().extname(e),n=t.headers.get("Content-Type");return".txt"===i||n&&n.includes("text/plain")}(t,e)){const e=await t.text();return db.parse(e)}throw new Error("The content type of the loaded content is not supported.")}class Ew extends Error{constructor(t){super(t),this.name="FormatConversionError"}}class Aw{#Nt;constructor(t){this.#Nt=t}async loadFrom(t){console.assert(t,"url is necessary!"),this.#Nt.emit("textae-event.resource.startLoad");try{const e=await fetch(t,{method:"GET",cache:"no-cache",credentials:"omit",headers:{Accept:"application/json, text/plain"},signal:AbortSignal.timeout(3e4)});if(e.ok){const i=await Pw(e,t);this.#Kn(t,i)}else 401===e.status?await this.#Jn(t):this.#ts(t)}catch(e){e instanceof Ew||console.error(e),this.#ts(t)}finally{this.#Nt.emit("textae-event.resource.endLoad")}}#Kn(t,e){const i=fx.createURLSource(t,e);e&&e.text?(this.#Nt.emit("textae-event.resource.annotation.load.success",i),this.#Nt.emit("textae-event.resource.annotation.url.set",i)):this.#Nt.emit("textae-event.resource.annotation.format.error",i)}async#Jn(t){try{const e=await fetch(t,{method:"GET",cache:"no-cache",credentials:"include",headers:{Accept:"application/json, text/plain"},signal:AbortSignal.timeout(3e4)});if(e.ok){const i=await Pw(e,t);this.#Kn(t,i)}else 401===e.status?await this.#Jn(t):this.#ts(t)}catch{this.#ts(t)}}#ts(t){e().error(`Could not load the file from the location you specified.: ${t}`),this.#Nt.emit("textae-event.resource.annotation.load.error",t)}}class Mw{#Nt;constructor(t){this.#Nt=t}loadFrom(t,e){console.assert(t,"url is necessary!"),this.#Nt.emit("textae-event.resource.startLoad"),fetch(t,{method:"GET",cache:"no-cache",credentials:"omit",headers:{Accept:"application/json","Content-Type":"application/json"},signal:AbortSignal.timeout(3e4)}).then(i=>{if(i.ok)return i.json().then(i=>this.#Kn(t,i,e));this.#ts(t)}).catch(()=>this.#ts(t)).finally(()=>this.#Nt.emit("textae-event.resource.endLoad"))}#Kn(t,e,i){this.#Nt.emit("textae-event.resource.configuration.load.success",fx.createURLSource(t,e),i)}#ts(t){e().error(`Could not load the file from the location you specified.: ${t}`),this.#Nt.emit("textae-event.resource.configuration.load.error",t)}}function Qw(t,e,i){return 401===t&&e&&"ServerPage"===e&&i?i:null}function Dw(t){return window.open(t,"_blank","width=600, height=500")}function Rw(t,e){return"json"===e?JSON.stringify(t):"inline"===e?db.generate(t):void 0}function Iw(t){return new Promise(e=>{const i=setInterval(()=>{t.closed&&(clearInterval(i),e())},1e3)})}class Lw{#es;#Nt;constructor(t,e){this.#es=t,this.#Nt=e}async saveTo(t,e){if(t){this.#Nt.emit("textae-event.resource.startSave");try{const i=Rw(e,this.#es),n=await this.#is(t,i);await this.#ns(n,t,e)}catch(t){t instanceof Ew||console.error(t),this.#ts()}finally{this.#Nt.emit("textae-event.resource.endSave")}}}async#is(t,e){const i="json"===this.#es?"application/json":"text/plain";return fetch(t,{method:"POST",headers:{"Content-Type":i,"App-Name":"TextAE"},body:e,credentials:"include"})}async#ns(t,e,i){if(t.ok)this.#ss(i);else if(401===t.status){const n=Qw(t.status,t.headers.get("WWW-Authenticate"),t.headers.get("Location"));n&&await this.#os(n,e,i)}else this.#ts()}#ss(t){e().success("annotation saved"),this.#Nt.emit("textae-event.resource.annotation.save",t)}async#os(t,e,i){const n=Dw(t);if(!n)return this.#ts();await Iw(n),await this.#rs(i,e)}async#rs(t,e){const i=Rw(t,this.#es);(await this.#is(e,i)).ok?this.#ss(t):this.#ts()}#ts(){e().error("could not save"),this.#Nt.emit("textae-event.resource.save.error")}}class Nw{#Nt;constructor(t){this.#Nt=t}async saveTo(t,e){console.assert(void 0!==t,"url is required"),this.#Nt.emit("textae-event.resource.startSave");const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"include"};try{const n=await fetch(t,i);if(n.ok)this.#ss(e);else if(401===n.status){const i=Qw(n.status,n.headers.get("WWW-Authenticate"),n.headers.get("Location"));i&&this.#os(i,t,e)}else this.#ts()}catch{this.#ts()}finally{this.#Nt.emit("textae-event.resource.endSave")}}#ss(t){e().success("configuration saved"),this.#Nt.emit("textae-event.resource.configuration.save",t)}#os(t,e,i){const n=Dw(t);return n?Iw(n).then(()=>this.#rs(i,e)):Promise.reject(new Error("failed to open pop-up window"))}#rs(t,e){const i={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include"};return fetch(e,i).then(e=>{e.ok?this.#ss(t):this.#ts()})}#ts(){e().error("could not save"),this.#Nt.emit("textae-event.resource.save.error")}}class jw{#Nt;constructor(t){this.#Nt=t}loadAnnotation(t){new Aw(this.#Nt).loadFrom(t)}loadConfiguration(t,e=null){new Mw(this.#Nt).loadFrom(t,e)}saveAnnotation(t,e,i){new Lw(i,this.#Nt).saveTo(t,e)}saveConfiguration(t,e){new Nw(this.#Nt).saveTo(t,e)}}class zw{#as;constructor(){this.#as=new Map([["logo",{name:"show logo",enabled:!0}],["read",{name:"import",enabled:!0}],["write",{name:"upload",enabled:!0}],["write-auto",{name:"upload automatically",enabled:!0}],["view",{name:"view mode",enabled:!0}],["term",{name:"term edit mode",enabled:!0}],["term-edit",{alias:"term"}],["block",{name:"block edit mode",enabled:!0}],["block-edit",{alias:"block"}],["relation",{name:"relation edit mode",enabled:!0}],["relation-edit",{alias:"relation"}],["text-edit",{name:"text edit mode",enabled:!0}],["simple",{name:"simple view",enabled:!0}],["line-height",{name:"adjust lineheight",enabled:!0}],["line-height-auto",{name:"auto adjust lineheight",enabled:!0}],["undo",{name:"undo",enabled:!0}],["redo",{name:"redo",enabled:!0}],["replicate",{name:"replicate span annotation",enabled:!0}],["replicate-auto",{name:"auto replicate",enabled:!0}],["boundary-detection",{name:"boundary detection",enabled:!0}],["create-span-by-touch",{name:"create span by touch",enabled:!0}],["expand-span-by-touch",{name:"expand span by touch",enabled:!0}],["shrink-span-by-touch",{name:"shrink span by touch",enabled:!0}],["edit-text-by-touch",{name:"edit text by touch",enabled:!0}],["entity",{name:"new entity",enabled:!0}],["pallet",{name:"pallet",enabled:!0}],["edit-properties",{name:"edit properties",enabled:!0}],["delete",{name:"delete",enabled:!0}],["copy",{name:"copy",enabled:!0}],["cut",{name:"cut",enabled:!0}],["paste",{name:"paste",enabled:!0}],["setting",{name:"setting",enabled:!0}],["help",{name:"help",enabled:!0}]])}get defaultAvailabilities(){return Array.from(this.#as.values()).filter(({name:t,enabled:e})=>void 0!==t&&void 0!==e).reduce((t,{name:e,enabled:i})=>t.set(e,i),new Map)}translateToInnerNameFrom(t){if(this.#as.has(t)){const e=this.#as.get(t);return e.alias?this.#as.get(e.alias).name:e.name}return e().warning(`'${t}' is an unknown function name for function availabilities.`),t}}class Bw{#ls;#cs;constructor(){this.#ls=new zw,this.#cs=this.#ls.defaultAvailabilities}isAvailable(t){return this.#cs.get(t)}enable(t){this.#cs.set(t,!0)}disable(t){this.#cs.set(t,!1)}get names(){return Array.from(this.#cs.keys())}set availability(t){const e=this.#ls.defaultAvailabilities;if(t)for(const[i,n]of Object.entries(t))e.set(this.#ls.translateToInnerNameFrom(i),n);this.#cs=e}}class Zw{#hs;#us;#fe;#Nt;#si;constructor(t,e,i){this.#hs=!1,this.#us=jx,this.#fe=t,this.#Nt=e,this.#si=i}get currentState(){return this.#us}toViewMode(t){this.#hs=t,this.#us=zx,this.#ds()}toTermEditMode(t){this.#hs=t,this.#us=Bx,this.#ds()}toBlockEditMode(t){this.#hs=t,this.#us=Zx,this.#ds()}toRelationEditMode(){this.#hs=!0,this.#us=Wx,this.#ds()}toTextEditMode(t){this.#hs=t,this.#us=Fx,this.#ds()}toggleSimpleMode(){switch(this.currentState){case Bx:this.toTermEditMode(!this.#hs);break;case Zx:this.toBlockEditMode(!this.#hs);break;case Fx:this.toTextEditMode(!this.#hs);break;case zx:this.toViewMode(!this.#hs);break;default:throw new Error(`Invalid state: ${this.currentState}`)}}changeModeByShortcut(){const t=this.#fs;if(t.length<=1)return;const e=t.findIndex(t=>t.name===this.currentState);e<t.length-1?this[t[e+1].funcName](this.nextShowRelation):this[t[0].funcName](this.nextShowRelation)}get nextShowRelation(){return this.#us===Wx?this.#fe.some:this.#hs}#ds(){this.#Nt.emit("textae-event.edit-mode.transition",this.#us,this.#hs)}get#fs(){return[{name:zx,availabilityName:"view mode",funcName:"toViewMode"},{name:Bx,availabilityName:"term edit mode",funcName:"toTermEditMode"},{name:Zx,availabilityName:"block edit mode",funcName:"toBlockEditMode"},{name:Wx,availabilityName:"relation edit mode",funcName:"toRelationEditMode"}].filter(t=>this.#si.isAvailable(t.availabilityName))}}class Ww{#En;#ps;#G;#ms;constructor(t,e,i,n){this.#ps=t,this.#En=e,this.#G=i,this.#ms=n}toViewMode(){this.#ms(),this.#En.toViewMode(this.#En.nextShowRelation)}toTermEditMode(){this.#ms(),this.#En.toTermEditMode(this.#En.nextShowRelation)}toBlockEditMode(){this.#ms(),this.#En.toBlockEditMode(this.#En.nextShowRelation)}toRelationEditMode(){this.#ms(),this.#En.toRelationEditMode()}toTextEditMode(){this.#ms(),this.#En.toTextEditMode(this.#En.nextShowRelation)}toggleSimpleMode(){this.#ms(),this.#En.toggleSimpleMode()}changeModeByShortcut(){this.#ms(),this.#En.changeModeByShortcut()}reset(){this.#ps.isEditTermMode?this.#En.toTermEditMode(this.#G.some):this.#ps.isEditBlockMode?this.#En.toBlockEditMode(this.#G.some):this.#ps.isEditRelationMode?this.#En.toRelationEditMode():this.#ps.isTextEditMode?this.#En.toTextEditMode(this.#G.some):this.#En.toViewMode(this.#G.some)}}function Fw(){window.getSelection().removeAllRanges()}function Xw(t,i,n,s,o,r,a,l,c){if(a){s.removeAll();const h=N(t,a),u=function(t,i,n,s,o,r,a){const{begin:l,end:c}=t.getSpan(o).getShortenInAnchorNodeToFocusNodeDirection(s,i,r);if(t.isBoundaryCrossingWithOtherSpans(l,c))return e().warning("A span cannot be shrunken to make a boundary crossing."),!1;const h=t.findDenotation(l,c);return l<c&&!h?(a(l,c),!1):(n.invoke(n.factory.removeSpanCommand(o)),!0)}(i,n,o,r,a,l,c);u&&h&&s.selectSpan(h.id)}}class qw{constructor(){this.selection=window.getSelection(),console.assert(this.parentOfAnchorNode.closest(".textae-editor__text-box")===this.parentOfFocusNode.closest(".textae-editor__text-box"),"Text selection across editors is disabled")}get isParentOfAnchorNodeTextBox(){return U(this.parentOfAnchorNode)}get isParentOfAnchorNodeDenotationSpan(){return G(this.parentOfAnchorNode)}get isParentOfAnchorNodeBlockSpan(){return J(this.parentOfAnchorNode)}get isParentOfAnchorNodeStyleSpan(){return K(this.parentOfAnchorNode)}get isParentOfFocusNodeTextBox(){return U(this.parentOfFocusNode)}get isParentOfFocusNodeDenotationSpan(){return G(this.parentOfFocusNode)}get isParentOfFocusNodeBlockSpan(){return J(this.parentOfFocusNode)}get isParentOfFocusNodeStyleSpan(){return K(this.parentOfFocusNode)}get isParentOfBothNodesSame(){return this.parentOfAnchorNode===this.parentOfFocusNode}get isParentOfBothNodesTextBox(){return this.isParentOfAnchorNodeTextBox&&this.isParentOfFocusNodeTextBox}get isParentsParentOfAnchorNodeAndFocusedNodeSame(){return this.parentOfAnchorNode.parentElement===this.parentOfFocusNode.parentElement}get isAnchorNodeParentIsDescendantOfFocusNodeParent(){return this.parentOfAnchorNode.closest(`#${this.parentOfFocusNode.id}`)}get ancestorDenotationSpanOfAnchorNode(){return this.parentOfAnchorNode.closest(".textae-editor__span")}get ancestorDenotationSpanOfFocusNode(){return this.parentOfFocusNode.closest(".textae-editor__span")}get ancestorBlockSpanOfAnchorNode(){return this.parentOfAnchorNode.closest(".textae-editor__block")}get ancestorBlockSpanOfFocusNode(){return this.parentOfFocusNode.closest(".textae-editor__block")}get doesFitInOneBlockSpan(){return this.ancestorBlockSpanOfAnchorNode===this.ancestorBlockSpanOfFocusNode}get parentOfAnchorNode(){return this.selection.anchorNode.parentElement}get parentOfFocusNode(){return this.selection.focusNode.parentElement}}class Hw{#Q;#qt;#ni;#ei;#ii;#Ie;constructor(t,e,i,n,s,o){this.#Q=t,this.#qt=e,this.#ni=i,this.#ei=n,this.#ii=s,this.#Ie=o}editFor(){const t=new qw;if(t.isParentOfAnchorNodeTextBox){if(t.isParentOfFocusNodeTextBox)return void this.#gs();if(t.isParentOfFocusNodeDenotationSpan||t.isParentOfFocusNodeStyleSpan)return void(t.ancestorBlockSpanOfFocusNode?this.#vs(t):this.#gs());if(t.isParentOfFocusNodeBlockSpan)return void this.#vs(t)}if(t.isParentOfAnchorNodeDenotationSpan||t.isParentOfAnchorNodeStyleSpan){if(t.isParentOfFocusNodeTextBox||t.isParentOfFocusNodeDenotationSpan||t.isParentOfFocusNodeStyleSpan){if(t.ancestorBlockSpanOfAnchorNode)if(t.doesFitInOneBlockSpan){const{anchor:e,focus:i}=this.#qt.textSelection,n=this.#qt.getSpan(t.parentOfAnchorNode.id),s=this.#qt.getSpan(t.ancestorBlockSpanOfAnchorNode.id);e<i&&n.begin===s.begin||i<e&&n.end===s.end?this.#vs(t):Fw()}else this.#ys(t);else t.ancestorBlockSpanOfFocusNode?this.#vs(t):this.#gs();return}if(t.isParentOfFocusNodeBlockSpan)return void this.#vs(t)}if(t.isParentOfAnchorNodeBlockSpan){if(t.isParentOfFocusNodeTextBox||t.isParentOfFocusNodeDenotationSpan||t.isParentOfFocusNodeStyleSpan)return void(t.ancestorBlockSpanOfFocusNode?this.#vs(t):this.#ys(t));if(t.isParentOfFocusNodeBlockSpan){const{anchor:e}=this.#qt.textSelection,i=this.#qt.getSpan(t.parentOfFocusNode.id);if(e===i.begin||e===i.end)return void this.#vs(t)}}Fw()}cerateSpanForTouchDevice(){(new qw).isParentOfBothNodesTextBox&&this.#gs()}expandForTouchDevice(){const t=this.#Os();if(t){const{spanID:e,begin:i,end:n}=t;this.#qt.validateNewBlockSpan(i,n,e)&&this.#ei.invoke(this.#ei.factory.moveBlockSpanCommand(e,i,n))}}shrinkForTouchDevice(){const t=this.#bs();if(t){const{spanID:i,begin:n,end:s}=t,o=N(this.#Q,i);if(this.#qt.isBoundaryCrossingWithOtherSpans(n,s))return void e().warning("A span cannot be modified to make a boundary crossing.");if(this.#qt.hasParentOf(n,s,i))return;const r=this.#qt.findBlock(n,s);n<s&&!r?this.#ei.invoke(this.#ei.factory.moveBlockSpanCommand(i,n,s)):(this.#ei.invoke(this.#ei.factory.removeSpanCommand(i)),o&&this.#Ie.selectSpan(o.id))}}#gs(){this.#qt.hasCharacters(this.#ni)&&(this.#Ie.removeAll(),function(t,e,i,n){const{begin:s,end:o}=t.getTextSelection(n,i);if(t.validateNewBlockSpan(s,o)){const t=e.factory.createBlockSpanCommand({begin:s,end:o});e.invoke(t)}}(this.#qt,this.#ei,this.#ii.textSelectionAdjuster,this.#ni)),Fw()}#ys(t){const e=t.ancestorBlockSpanOfAnchorNode.id;this.#Ie.removeAll();const{begin:i,end:n}=this.#qt.getSpan(e).getExpandedInAnchorNodeToFocusNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni);this.#qt.validateNewBlockSpan(i,n,e)&&this.#ei.invoke(this.#ei.factory.moveBlockSpanCommand(e,i,n)),Fw()}#vs(t){const e=t.ancestorBlockSpanOfFocusNode.id;Xw(this.#Q,this.#qt,this.#qt.sourceDoc,this.#Ie,this.#ei,this.#ii.textSelectionAdjuster,e,this.#ni,(t,i)=>{this.#ei.invoke(this.#ei.factory.moveBlockSpanCommand(e,t,i))}),Fw()}#Os(){const t=new qw;if(null==t.ancestorBlockSpanOfAnchorNode&&null==t.ancestorBlockSpanOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.parentOfAnchorNode.id;return{spanID:e,...this.#qt.getSpan(e).getExpandedInAnchorNodeToFocusNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.parentOfFocusNode.id;return{spanID:e,...this.#qt.getSpan(e).getExpandedInFocusNodeToAnchorNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}}#bs(){const t=new qw;if(null==t.ancestorBlockSpanOfAnchorNode&&null==t.ancestorBlockSpanOfFocusNode)return null;if(t.parentOfAnchorNode===t.parentOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.parentOfAnchorNode.id;return{spanID:e,...this.#qt.getSpan(e).getShortenInFocusNodeToAnchorNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.parentOfFocusNode.id;return{spanID:e,...this.#qt.getSpan(e).getShortenInAnchorNodeToFocusNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}}}function Vw(t,e,i,n){e.length?t.selectSpanRange(e):i.ctrlKey||i.metaKey?t.span.toggle(n):t.selectSpan(n)}function Yw(t){const e=window.getSelection();return"Range"===e.type&&t.contains(e.anchorNode)&&t.contains(e.focusNode)}function Uw(t){return t.closest(".textae-editor__signboard")}class Gw{#Q;#qt;#Ie;#xs;#ws;constructor(t,e,i,n,s){this.#Q=t,this.#qt=e,this.#Ie=i,this.#xs=n,this.#ws=s}bind(){const t=[];return t.push(r()(this.#Q,".textae-editor__text-box","click",t=>{t.target.classList.contains("textae-editor__text-box")&&this.#_s()})),t.push(r()(this.#Q,".textae-editor","click",t=>{t.target.classList.contains("textae-editor")&&this.#Ss()})),t.push(r()(this.#Q,".textae-editor__signboard","mousedown",()=>this.#ks())),t.push(r()(this.#Q,".textae-editor__signboard__type-values","click",t=>{const e=Uw(t.target).dataset.id;this.#$s(t,e)})),t.push(r()(this.#Q,".textae-editor__block","mouseup",t=>{t.target.classList.contains("textae-editor__block")&&this.#Ts()})),t.push(r()(this.#Q,".textae-editor__block-hit-area","mouseup",t=>{t.target.classList.contains("textae-editor__block-hit-area")&&this.#Cs(t)})),t.push(r()(this.#Q,".textae-editor__style","mouseup",t=>{t.target.classList.contains("textae-editor__style")&&this.#Ps(t)})),t.push(r()(this.#Q,".textae-editor__span","mouseup",t=>{t.target.classList.contains("textae-editor__span")&&this.#Es(t)})),t}#Ss(){this.#ws.hide(),this.#Ie.removeAll()}#_s(){"Caret"===window.getSelection().type&&(this.#ws.hide(),this.#Ie.removeAll()),Yw(this.#Q.querySelector(".textae-editor__text-box"))&&this.#xs.editFor()}#Ts(){"Caret"===window.getSelection().type&&(this.#ws.hide(),Fw(),this.#Ie.removeAll()),Yw(this.#Q.querySelector(".textae-editor__text-box"))&&this.#xs.editFor()}#Cs(t){2===t.button&&Fw();const e=window.getSelection();if("Caret"===e.type||"None"===e.type){const e=t.target.dataset.id;this.#As(t,e)}}#Ps(t){"Caret"===window.getSelection().type&&this.#Ie.removeAll(),Yw(this.#Q.querySelector(".textae-editor__text-box"))&&(this.#xs.editFor(),t.stopPropagation())}#Es(t){"Caret"===window.getSelection().type&&this.#Ie.removeAll(),Yw(this.#Q.querySelector(".textae-editor__text-box"))&&(this.#xs.editFor(),t.stopPropagation())}#ks(){this.#Q.focus()}#$s(t,e){if(this.#qt.entityInstanceContainer.get(e).isBlock){t.ctrlKey||t.metaKey?this.#Ie.entity.toggle(e):this.#Ie.selectEntity(e);const i=this.#Ie.entity.all.map(t=>t.span).map(t=>t.id);this.#Ie.add("span",i)}}#As(t,e){const i=this.#Ie.span.singleId,n=t.shiftKey&&i?this.#qt.spanInstanceContainer.rangeBlockSpan(i,e):[];Vw(this.#Ie,n,t,e);const s=this.#Ie.span.all.map(t=>t.entities.at(0)).map(t=>t.id);this.#Ie.add("entity",s)}}class Kw{createSpanWithTouchDevice(){}expandSpanWithTouchDevice(){}shrinkSpanWithTouchDevice(){}editTextWithTouchDevice(){}editProperties(){}relationClicked(){}relationBollardClicked(t){t.focus()}applyTextSelectionWithTouchDevice(){}manipulateAttribute(){}showPallet(){}hidePallet(){}get isPalletShown(){return!1}updateSelectedTextOffsets(){}}class Jw extends u{constructor(t,e,i,n){const s=()=>{const t=n();t&&this.resolveFunc(t),super.close()},o={text:"OK",click:s};i.buttons=i.buttons?i.buttons.concat([o]):[o],super(t,e,i),r()(super.el,".textae-editor__promise-dialog__observable-element","keyup",t=>{13===t.keyCode&&s()})}open(){return super.open(),new Promise(t=>this.resolveFunc=t)}}class t_ extends Jw{constructor(t,e,i,n,s,o){const a=[];n&&a.unshift({class:"textae-editor__edit-numeric-attribute-dialog__remove-attribute",click:()=>{this.close(),this.resolveFunc({newObj:null})}}),o&&a.unshift({text:"...",title:"configuration",click:()=>{this.close(),o.show(),o.showAttribute(e.pred)}}),super(`Attribute [${i.map(({id:t})=>t||"-").join(",")}]`,function(t){const{subjects:e,pred:i,min:n,max:s,step:o,value:r}=t;return rt`
305
- <div class="textae-editor__edit-numeric-attribute-dialog__container">
306
- <div class="textae-editor__edit-numeric-attribute-dialog__row">
307
- <label>Subject</label>
308
- <div class="textae-editor__edit-numeric-attribute-dialog__subject-row">
309
- <input
310
- class="textae-editor__edit-numeric-attribute-dialog__subject-input"
311
- value="${e}"
312
- disabled="disabled">
313
- <button
314
- class="textae-editor__edit-numeric-attribute-dialog__subject-edit-button"
315
- title="properties">...</button>
316
- </div>
317
- </div>
318
- <div class="textae-editor__edit-numeric-attribute-dialog__row">
319
- <label>Predicate</label>
320
- <input
321
- value="${i}"
322
- disabled="disabled">
323
- </div>
324
- <div class="textae-editor__edit-numeric-attribute-dialog__row ui-front">
325
- <label>Object</label>
326
- <input
327
- class="textae-editor__edit-numeric-attribute-dialog__value textae-editor__promise-dialog__observable-element"
328
- type="number"
329
- ${"number"==typeof n?`min="${n}"`:""}
330
- ${"number"==typeof s?`max="${s}"`:""}
331
- step="${o}"
332
- value="${r}"
333
- autofocus>
334
- </div>
335
- </div>`}({subjects:`${i.map(({subj:t})=>t||"-").join(", ")}`,pred:e.pred,value:e.obj,min:t.min,max:t.max,step:t.step}),{buttons:a},()=>({newObj:super.el.querySelector(".textae-editor__edit-numeric-attribute-dialog__value").value})),s&&r()(super.el,".textae-editor__edit-numeric-attribute-dialog__subject-edit-button","click",()=>{this.close(),s()})}}function e_(t,e,i,n,s,o){new t_(e,i,t.all.reduce((t,e)=>(t.push(e.attributes.find(t=>t.pred==i.pred)),t),[]),!0,s,o).open().then(({newObj:i})=>{const s=i?n.factory.changeAttributeObjOfItemsCommand(t.all,e,i):n.factory.removeAttributesFromItemsByPredCommand(t.all,e);n.invoke(s)})}class i_{#Ms;#Qs;#c;constructor(t,e){this.#Ms=t,this.#Qs=e,this.#c=document.createElement("ul"),this.#c.setAttribute("popover","manual"),this.#c.classList.add("popover-autocomplete-container"),this.#c.style.margin=0,t.parentElement.appendChild(this.#c)}get element(){return this.#c}set items(t){if(t.length>0){this.#c.innerHTML="";const e=t.map((t,e)=>function(t,e,i){const n=document.createElement("li");if(n.classList.add("popover-autocomplete-item"),"object"==typeof t&&null!==t)for(const[e,i]of Object.entries(t))n.dataset[e]=i;else n.dataset.value=t;return n.dataset.index=e,n.textContent=i(t),n}(t,e,this.#Qs));this.#c.append(...e),this.#Ds(),this.#c.showPopover()}else this.#c.hidePopover()}highlight(t){this.#Rs();const e=this.#c.querySelector(`li:nth-child(${t+1})`);e&&e.classList.add("popover-autocomplete-item-highlighted")}#Ds(){const t=this.#Ms.getBoundingClientRect();Object.assign(this.#c.style,{position:"absolute",top:`${t.bottom+window.scrollY}px`,left:`${t.left+window.scrollX}px`})}#Rs(){const t=this.#c.querySelector(".popover-autocomplete-item-highlighted");t&&t.classList.remove("popover-autocomplete-item-highlighted")}}class n_{#Is;#Ls;#Ns;#js;#zs="";#Rn=[];#Bs=-1;constructor(t,e,i,n){this.#Is=t,this.#Ls=e,this.#Ns=i,this.#js=n}get term(){return this.#zs}set term(t){this.#zs=t,this.#zs.length>=this.#js?this.#Is(this.#zs):this.clearItems()}get itemsCount(){return this.#Rn.length}get hasItems(){return this.#Rn.length>0}get hasNoItems(){return 0===this.#Rn.length}set items(t){this.#Rn=t,this.clearHighlight(),this.#Ls(this.#Rn)}get highlightedIndex(){return this.#Bs}set highlightedIndex(t){this.#Bs=t,this.#Ns(this.#Bs)}clearItems(){this.items=[]}clearHighlight(){this.highlightedIndex=-1}moveHighlightIndexPrevious(){this.highlightedIndex>=0?this.highlightedIndex--:this.highlightedIndex=this.itemsCount-1}moveHighlightIndexNext(){this.highlightedIndex<this.itemsCount-1?this.highlightedIndex++:this.clearHighlight()}}class s_{#Zs;#Ws;#Fs;constructor({inputElement:t,onSearch:e,onSelect:i,onRender:n=t=>t,minLength:s=3}){this.#Zs=i,this.#Ws=new i_(t,n),this.#Fs=new n_(t=>e(t,t=>this.#Fs.items=t),t=>this.#Ws.items=t,t=>this.#Ws.highlight(t),s),this.#Xs(t),this.#qs(this.#Ws.element),this.#Hs()}#Xs(t){const e=n(t=>{this.#Fs.term=t},300);t.addEventListener("input",({target:t})=>e(t.value)),t.addEventListener("keydown",t=>this.#Vs(t)),t.addEventListener("keyup",t=>this.#Ys(t))}#qs(t){this.#Us(t,"mousedown","li",({delegateTarget:e})=>{this.#Zs(e.dataset),t.hidePopover()}),this.#Us(t,"mouseover","li",({delegateTarget:t})=>{this.#Fs.highlightedIndex=Number(t.dataset.index)}),this.#Us(t,"mouseout","li",()=>{this.#Fs.clearHighlight()})}#Hs(){document.addEventListener("mousedown",({target:t})=>{this.#Ws.element.contains(t)||this.#Fs.clearItems()}),window.addEventListener("resize",()=>this.#Fs.clearItems())}#Us(t,e,i,n){t.addEventListener(e,({target:t})=>{const e=t.closest(i);e&&n({delegateTarget:e})})}#Vs(t){if(!this.#Fs.hasNoItems)switch(t.key){case"ArrowDown":t.preventDefault(),this.#Fs.moveHighlightIndexNext();break;case"ArrowUp":t.preventDefault(),this.#Fs.moveHighlightIndexPrevious();break;case"Tab":t.preventDefault(),t.shiftKey?this.#Fs.moveHighlightIndexPrevious():this.#Fs.moveHighlightIndexNext();break;case"Escape":t.preventDefault(),this.#Fs.clearItems()}}#Ys(t){if("Enter"===t.key&&this.#Fs.hasItems){t.stopPropagation();const e=document.querySelector(".popover-autocomplete-item-highlighted");e&&this.#Zs(e.dataset),this.#Fs.clearItems()}}}class o_ extends Jw{constructor(t,e,i,n,s,o){const a=[];n&&a.unshift({class:"textae-editor__edit-string-attribute-dialog__remove-attribute",click:()=>{this.close(),this.resolveFunc({newObj:null})}}),o&&a.unshift({text:"...",title:"configuration",click:()=>{this.close(),o.show(),o.showAttribute(e.pred)}}),super(`Attribute [${i.map(({id:t})=>t||"-").join(",")}]`,function(t){const{subjects:e,pred:i,value:n,label:s}=t;return rt`
336
- <div class="textae-editor__edit-string-attribute-dialog__container">
337
- <div class="textae-editor__edit-numeric-attribute-dialog__row">
338
- <label>Subject</label>
339
- <div class="textae-editor__edit-numeric-attribute-dialog__subject-row">
340
- <input
341
- class="textae-editor__edit-numeric-attribute-dialog__subject-input"
342
- value="${e}"
343
- disabled="disabled">
344
- <button
345
- class="textae-editor__edit-numeric-attribute-dialog__subject-edit-button"
346
- title="properties">...</button>
347
- </div>
348
- </div>
349
- <div class="textae-editor__edit-string-attribute-dialog__row">
350
- <label>Predicate</label>
351
- <input
352
- value="${i}" disabled="disabled">
353
- </div>
354
- <div class="textae-editor__edit-string-attribute-dialog__row ui-front">
355
- <label>Object</label>
356
- <input
357
- class="textae-editor__edit-string-attribute-dialog__value textae-editor__promise-dialog__observable-element"
358
- value="${n}"
359
- autofocus>
360
- </div>
361
- <div class="textae-editor__edit-string-attribute-dialog__row">
362
- <label>Label</label>
363
- <input
364
- class="textae-editor__edit-string-attribute-dialog__label"
365
- value="${s}" disabled="disabled">
366
- </div>
367
- </div>`}({subjects:`${i.map(({subj:t})=>t||"-").join(", ")}`,pred:e.pred,value:e.obj,label:t.getDisplayName(e.obj)}),{buttons:a},()=>({newObj:super.el.querySelector(".textae-editor__edit-string-attribute-dialog__value").value,newLabel:super.el.querySelector(".textae-editor__edit-string-attribute-dialog__label").value})),s&&r()(super.el,".textae-editor__edit-numeric-attribute-dialog__subject-edit-button","click",()=>{this.close(),s()});const l=super.el.querySelector(".textae-editor__edit-string-attribute-dialog__value"),c=super.el.querySelector(".textae-editor__edit-string-attribute-dialog__label");new s_({inputElement:l,onSearch:(e,i)=>{t.autocompletionWs?Se(t.autocompletionWs,e).then(i):i([])},onSelect:t=>{l.value=t.id,c.value=t.label},onRender:t=>`${t.id} ${t.label}`})}}function r_(t,e,i,n,s,o){new o_(n,e,t.all.reduce((t,i)=>(t.push(i.attributes.find(t=>t.pred==e.pred)),t),[]),!0,s,o).open().then(({newObj:e,newLabel:s})=>{e?i.invoke(i.factory.changeStringAttributeObjOfItemsCommand(t.all,n,e,s)):i.invoke(i.factory.removeAttributesFromItemsByPredCommand(t.all,n))})}class a_{#ei;#Gs;#Ks;#Vt;#Js;#to;constructor(t,e,i,n,s,o){this.#ei=t,this.#Gs=i,this.#Ks=n,this.#Vt=e,this.#Js=s,this.#to=o}manipulateAttribute(t,e){e?this.#eo(t):this.#io(t)}#eo(t){const i=this.#Vt.attribute.getAttributeAt(t);if(i)if(this.#Gs.selectedWithAttributeOf(i.pred)){const t=this.#ei.factory.removeAttributesFromItemsByPredCommand(this.#Gs.all,i);this.#ei.invoke(t)}else e().warning("None of the selected items has this attribute.");else e().warning(`Attribute No.${t} is not defined`)}#io(t){this.#Ks.hide();const i=this.#Vt.attribute.getAttributeAt(t);if(i)switch(i.valueType){case"flag":this.#ei.invoke(this.#ei.factory.toggleFlagAttributeToItemsCommand(this.#Gs.all,i));break;case"numeric":!function(t,i,n,s,o){const r=t.findSelectedAttributeWithSamePredicate(i.pred);if(r)t.onlySelectedWithJustOneAttributeOf(i.pred)?e_(t,i,r,n,s,o):e().warning("Some selected items has zero or multi this attribute.");else{const e=n.factory.createAttributeToItemsCommand(t.all,i);n.invoke(e)}}(this.#Gs,i,this.#ei,this.#Js,this.#to);break;case"selection":if(this.#Gs.selectedWithAttributeOf(i.pred))this.#Ks.show(i).then(t=>{if(this.#Gs.isDuplicatedPredAttributeSelected(i.pred))e().warning("An item among the selected has this attribute multiple times.");else{const e=this.#ei.factory.changeAttributeObjOfItemsCommand(this.#Gs.all,i,t);this.#ei.invoke(e)}});else{const t=this.#ei.factory.createAttributeToItemsCommand(this.#Gs.all,i);this.#ei.invoke(t)}break;case"string":!function(t,i,n,s,o){const r=t.findSelectedAttributeWithSamePredicate(i.pred);if(r)t.onlySelectedWithJustOneAttributeOf(i.pred)?r_(t,r,n,i,s,o):e().warning("Some selected items has zero or multi this attribute.");else{const e=n.factory.createAttributeToItemsCommand(t.all,i);n.invoke(e)}}(this.#Gs,i,this.#ei,this.#Js,this.#to);break;default:throw`${i.valueType} is unknown attribute`}else e().warning(`Attribute No.${t} is not defined`)}}function l_(t){const{values:e}=t.attrDef;return rt`
368
- <div>
369
- <table>
370
- <thead>
371
- <tr>
372
- <th>id</th>
373
- <th>label</th>
374
- <th>color</th>
375
- </tr>
376
- </thead>
377
- <tbody>
378
- ${e.map(({color:t="",id:e,default:i,label:n=""})=>function(t,e,i,n){return()=>rt`
379
- <tr class="textae-editor__pallet__row" style="background-color: ${t};">
380
- <td class="textae-editor__pallet__selection-attribute-label" data-id="${e}">
381
- ${e}
382
- ${()=>i?'<span class="textae-editor__pallet__default-icon" title="This type is set as a default type."></span>':""}
383
- </td>
384
- <td class="textae-editor__pallet__short-label">
385
- ${n}
386
- </td>
387
- <td class="textae-editor__pallet__short-label">
388
- ${t}
389
- </td>
390
- </tr>
391
- `}(t,e,i,n))}
392
- </tbody>
393
- </table>
394
- </div>
395
- `}i(1758);class c_{constructor(t,e,i){this._editorHTMLElement=t,this._title=e,this._el=this.createElement(),this._mousePoint=i,function(t,e){h()(t).draggable({containment:e})}(this._el,t),r()(this._el,'[type="button"]',"click",()=>t.focus()),r()(this._el,".textae-editor__pallet__close-button","click",()=>this.hide())}updateDisplay(){this.visibly&&this._updateDisplay()}get el(){return this._el}show(){this._el.style.display="block",this._updateDisplay(),this._moveInto()}hide(){this._el.style.display="none"}get visibly(){return"none"!==this._el.style.display}createElement(){return l().create('\n <div\n class="textae-editor__pallet ui-dialog"\n style="display: none;"\n >\n </div>')}_updateDisplay(){var t,e;this._el.innerHTML=`\n <div class="textae-editor__pallet__container">\n <div class="textae-editor__pallet__title-bar ui-widget-header ui-corner-all">\n <span class="textae-editor__pallet__title-string">${this._title}</span>\n <button\n type="button"\n class="textae-editor__pallet__close-button ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close"\n title="Close">\n <span class="ui-button-icon ui-icon ui-icon-closethick"></span>\n <span class="ui-button-icon-space"> </span>Close\n </button>\n </div>\n <div class="textae-editor__pallet__content">${this._content}</div>\n </div>\n `,t=this._el,e=this._maxWidth,t.style.width="auto",e-2<=t.offsetWidth&&(t.style.width=e-4+"px"),function(t,e){e-14<=t.offsetHeight?t.style.height=e-14+"px":t.style.height=null}(this._el.querySelector(".textae-editor__pallet__container"),this._maxHeight)}_moveInto(){this._el.style.left=`${this._left}px`,this._el.style.top=`${this._top}px`}get _left(){const{clientX:t}=this._mousePoint,e=t-this._editorHTMLElement.getBoundingClientRect().x;return this._maxWidth<e+this._el.offsetWidth?this._maxWidth-this._el.offsetWidth-2:e}get _top(){const{clientY:t}=this._mousePoint,e=this._editorHTMLElement.getBoundingClientRect().y;return this._maxHeight<t+this._el.offsetHeight?this._maxHeight-this._el.offsetHeight-e-2:t-e}get _maxWidth(){return this._editorHTMLElement.offsetWidth}get _maxHeight(){return document.documentElement.clientHeight}}class h_ extends c_{constructor(t,e){super(t,"Selection attribute",e),this._veil=l().create('<div style="position: fixed; right: 0; top: 0; bottom:0; left: 0; background-color: rgba(0, 0, 10, 0.3);"></div>'),this._el.addEventListener("keydown",t=>{"Escape"===t.code&&(t.preventDefault(),this.hide())})}show(t,e=90,i=null){return this._editorHTMLElement.appendChild(this._veil),this._editorHTMLElement.appendChild(this.el),this._veil.style["z-index"]=e+1,this._el.style["z-index"]=e+1,this._attributeDefinition=t,super.show(),this._el.querySelector(".textae-editor__pallet__close-button").focus(),this._opener=i,this._show=!0,new Promise(t=>{r()(this._el,".textae-editor__pallet__selection-attribute-label","click",e=>{this.hide(),t(e.target.dataset.id)})})}hide(){this._show&&(this._editorHTMLElement.removeChild(this._veil),this._editorHTMLElement.removeChild(this.el),this._show=!1),this._opner&&this._opener.focus()}get _content(){return l_({attrDef:this._attributeDefinition.externalFormat})}}function u_(t){const e=t.querySelector(".textae-editor__edit-type-values-dialog__type-name").value,i=t.querySelector(".textae-editor__edit-type-values-dialog__type-label").innerText,n=[];for(const e of t.querySelectorAll(".textae-editor__edit-type-values-dialog__attribute"))n.push({id:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.id,subj:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.subj,pred:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-predicate").dataset.pred,obj:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.obj,label:e.querySelector(".textae-editor__edit-type-values-dialog__attribute-value").dataset.label});return{typeName:e,label:i,attributes:n}}function d_(t,e){const{pred:i,obj:n}=t,{valueType:s}=e.get(i);switch(s){case"string":return t.label||e.getLabel(i,n)||"";case"selection":case"numeric":case"flag":return e.getLabel(i,n)||"";default:throw`unknown attribute type: ${s}`}}function f_(t,e,i,n){const{id:s,subj:o,pred:r,obj:a}=t,l=i[e-1],c=l&&l.pred,h=n.getIndexOf(r),{valueType:u}=n.get(r),d=()=>r===c?'<td class="shortcut-key" rowspan="2"></td>':`<td class="shortcut-key" rowspan="2">\n ${h<9?`<span class="textae-editor__edit-type-values-dialog__shortcut-key" title="Shortcut key for this predicate">${h+1}</span>`:""}\n </td>\n `;return()=>rt`
396
- <tr class="textae-editor__edit-type-values-dialog__attribute">
397
- ${d}
398
- <td rowspan="2">
399
- <span
400
- class="textae-editor__edit-type-values-dialog__attribute-predicate ${r===c?"":`textae-editor__edit-type-values-dialog__attribute-predicate--${u}`}"
401
- data-pred="${r}"
402
- title="${u} type"
403
- >
404
- ${r===c?"":r}
405
- </span>
406
- </td>
407
- <td>
408
- <span
409
- class="textae-editor__edit-type-values-dialog__attribute-value"
410
- data-id="${s}"
411
- data-subj="${o||""}""
412
- data-obj="${a}"
413
- data-label="${d_(t,n)}"
414
- >
415
- ${d_(t,n)||a}
416
- </span>
417
- </td>
418
- </tr>
419
- <tr>
420
- <td>
421
- <button
422
- type="button"
423
- class="textae-editor__edit-type-values-dialog__edit-attribute"
424
- data-pred="${r}"
425
- data-index="${e}"
426
- ${"flag"===u?'disabled="disabled"':""}>
427
- </button>
428
- <button
429
- type="button"
430
- class="textae-editor__edit-type-values-dialog__remove-attribute"
431
- data-index="${e}">
432
- </button>
433
- </td>
434
- </tr>
435
- `}function p_(t,e,i){const n=()=>i?'disabled="disabled" title="This predicate is already used with its default value."':rt`title="${t} type"`;return()=>rt`
436
- <button
437
- type="button"
438
- class="textae-editor__edit-type-values-dialog__add-attribute textae-editor__edit-type-values-dialog__add-attribute--${t}"
439
- data-pred="${e}"
440
- ${n}> ${e}</button>`}function m_(t,e,i,n,s){return rt`
441
- <div style="overflow-y: auto; max-height: 36em; overflow-x: hidden;">
442
- <table class="textae-editor__edit-type-values-dialog__table">
443
- <thead>
444
- <tr>
445
- <th></th>
446
- <th>Predicate</th>
447
- <th>Value/Label</th>
448
- </tr>
449
- </thead>
450
- <tbody>
451
- ${o=t,r=e,()=>rt`
452
- <tr>
453
- <td rowspan="2"></td>
454
- <td>
455
- <span class="textae-editor__edit-type-values-dialog__type-predicate">type</span>
456
- </td>
457
- <td class="ui-front">
458
- <input class="textae-editor__edit-type-values-dialog__type-name textae-editor__promise-dialog__observable-element" value="${o}">
459
- </td>
460
- </tr>
461
- <tr>
462
- <td></td>
463
- <td>
464
- <span class="textae-editor__edit-type-values-dialog__type-label">${r}</span>
465
- </td>
466
- </tr>
467
- `}
468
- ${i.map((t,e,i)=>f_(t,e,i,n))}
469
- </tbody>
470
- </table>
471
- </div>
472
- <fieldset>
473
- <legend>
474
- <span class="textae-editor__edit-type-values-dialog__open-pallet" title="${s} Configuration"></span>
475
- Available Predicates:
476
- </legend>
477
- <div class="textae-editor__edit-type-values-dialog__add-attribute-buttons">
478
- ${n.attributes.map(({pred:t,valueType:e})=>p_(e,t,function(t,e,i){return t.some(t=>t.pred===e&&String(t.obj)===String(i.get(e).default))}(i,t,n)))}
479
- </div>
480
- </fieldset>
481
- `;var o,r}class g_{#no;#pe;#so;#At;#oo;constructor(t,e,i,n,s){this.#no=t,this.#pe=e,this.#so=i,this.#At=n,this.#oo=s}onClick(t){const{pred:e}=t.target.dataset,i=this.#pe.get(e),n=parseInt(this.#At.closest(".textae-editor__dialog").style["z-index"]),{typeName:s,label:o,attributes:r}=u_(this.#At);switch(i.valueType){case"numeric":new t_(i,r[t.target.dataset.index],[r[t.target.dataset.index]]).open().then(({newObj:e})=>{r[t.target.dataset.index].obj=e,this.#oo(s,o,r)});break;case"selection":new h_(this.#no,this.#so).show(i,n,t.target).then(e=>{r[t.target.dataset.index].obj=e,this.#oo(s,o,r)});break;case"string":new o_(i,r[t.target.dataset.index],[r[t.target.dataset.index]]).open().then(({newObj:e,newLabel:i})=>{r[t.target.dataset.index].obj=e,r[t.target.dataset.index].label=i,this.#oo(s,o,r)});break;default:throw`${i.valueType} is unknown attribute.`}}}class v_ extends Jw{#pe;#J;#ft;#ro;#pt;constructor(t,e,i,n,s,o,a,l){const{typeName:c,attributes:h}=function(t){const{typeName:e}=t[t.length-1],i=[];for(const{attributes:e}of t)for(const t of e)i.some(e=>e.equalsTo(t.pred,t.obj))||i.push(t);return new bt(e,i)}(o),u=m_(c,n.getLabel(c),h,s,i);super(`${e} [${o.map(({id:t})=>t).join(",")}] Properties`,u,{maxWidth:800},()=>u_(super.el)),this.#pe=s,this.#J=n;const d=super.el,f=new g_(t,s,l,d,(t,e,i)=>{this.#ft=t,this.#ro=e,this.#pt=i,this.#oo()});r()(d,".textae-editor__edit-type-values-dialog__edit-attribute","click",t=>f.onClick(t)),r()(d,".textae-editor__edit-type-values-dialog__remove-attribute","click",t=>{const{index:e}=t.target.dataset,i=parseInt(e),{typeName:n,label:s,attributes:o}=u_(d);this.#ft=n,this.#ro=s,this.#pt=o.filter((t,e)=>e!==i),this.#oo()}),r()(d,".textae-editor__edit-type-values-dialog__open-pallet","click",()=>{super.close(),a.show()}),r()(d,".textae-editor__edit-type-values-dialog__add-attribute","click",t=>{const{pred:e}=t.target.dataset,i=s.get(e).default,{typeName:n,label:o,attributes:r}=u_(d);this.#ft=n,this.#ro=o,this.#pt=r.concat({pred:e,obj:i,id:""}).sort((t,e)=>s.attributeCompareFunction(t,e)),this.#oo()}),this.#ao(n)}#oo(){super.el.closest(".ui-dialog-content").innerHTML=this.#lo,this.#ao(this.#J)}get#lo(){return m_(this.#ft,this.#ro,this.#pt,this.#pe)}#ao(t){const e=super.el.querySelector(".textae-editor__edit-type-values-dialog__type-name"),i=super.el.querySelector(".textae-editor__edit-type-values-dialog__type-label");new s_({inputElement:e,onSearch:(e,i)=>t.searchByLabel(e,i),onSelect:t=>{e.value=t.id,i.innerText=t.label},onRender:t=>`${t.id} ${t.label}`})}}class y_{#Q;#ei;#ws;#co;#so;#J;#qt;#Oe;constructor(t,e,i,n,s,o,r,a){this.#Q=t,this.#ei=e,this.#ws=i,this.#co=n,this.#so=s,this.#J=o,this.#qt=r,this.#Oe=a}startEditing(t){t.some&&this.#ho(t.all).open().then(t=>this.#uo(t))}#uo({typeName:t,label:e,attributes:i=[]}){const n=this.#ei.factory.changeTypeValuesCommand(e,t,this.#J,i);t&&this.#ei.invoke(n)}#ho(t){return new v_(this.#Q,this.#Oe,this.#co,this.#J,this.#qt.typeDictionary.attribute,t,this.#ws,this.#so)}}class O_ extends Jw{constructor(t,e,i,n){super(t,function(t){const{id:e,label:i,color:n,isDefault:s}=t;return rt`
482
- <div class="textae-editor__type-definition-dialog__container">
483
- <div class="textae-editor__type-definition-dialog__row ui-front">
484
- <label>Id</label>
485
- <input
486
- class="textae-editor__type-definition-dialog--id textae-editor__promise-dialog__observable-element"
487
- value="${e||""}">
488
- </div>
489
- <div class="textae-editor__type-definition-dialog__row ui-front">
490
- <label>Label<span></span></label>
491
- <input
492
- class ="textae-editor__promise-dialog__observable-element"
493
- value="${i}">
494
- </div>
495
- <div class="textae-editor__type-definition-dialog__color-picker">
496
- <label><input
497
- class="textae-editor__type-definition-dialog__color-picker__input"
498
- type="color"
499
- value="${n}">
500
- Color</label>
501
- </div>
502
- <div class="textae-editor__type-definition-dialog__set-default">
503
- <label><input
504
- class="textae-editor__type-definition-dialog__set-default__input"
505
- type="checkbox" ${s?'checked="checked" disabled="disabled"':""}>
506
- Default type</label>
507
- </div>
508
- </div>`}(e),{},()=>{const t=super.el.querySelectorAll("input");return n(t[0].value,t[1].value,t[2].value,t[3].checked)});const[s,o]=super.el.querySelectorAll("input"),r=(t,e)=>i.searchByLabel(t,e),a=t=>{s.value=t.id,o.value=t.label},l=t=>`${t.id} ${t.label}`;new s_({inputElement:s,onSearch:r,onSelect:a,onRender:l}),new s_({inputElement:o,onSearch:r,onSelect:a,onRender:l})}}class b_ extends O_{constructor(t){super("New type",{id:null,label:"",color:t.defaultColor,isDefault:!1},t,(t,e,i,n)=>{if(""===t)return;const s={id:t,color:i};return""!==e&&(s.label=e),n&&(s.default=n),{newType:s}})}}class x_ extends O_{constructor(t,e,i,n){const s=t.getLabel(e)||"",o={id:e,label:s,color:i,isDefault:n};super("Edit type",o,t,(t,i,n,s)=>{const r=function(t,e){const i=new Map;return t.id!==e.id&&i.set("id",e.id),t.label!==e.label&&i.set("label",""===e.label?null:e.label),t.color!==e.color&&i.set("color",""===e.color?null:e.color),t.isDefault!==e.isDefault&&i.set("default",!!e.isDefault||null),i}(o,{id:t,label:i,color:n,isDefault:s});return{id:e,changedProperties:r}})}}function w_(t){return!t.classList.contains("textae-editor__pallet__table-button--disabled")}function __(t,e){return t.querySelector(`input${e}`)&&t.querySelector(`input${e}`).value}function S_(){return`#${k_()}${k_()}${k_()}`}function k_(){return Math.floor(155*Math.random()+100).toString(16)}function $_(t,e){const{pred:i,autocompletionWs:n,default:s,mediaHeight:o,label:r,color:a,min:l,max:c,step:h,valueType:u}=e,d="numeric"===u||"string"===u,f="string"===u,p="flag"===u,m="numeric"===u;return rt`
509
- <div class="${t}__row">
510
- <label>Predicate</label>
511
- <input
512
- value="${i||""}"
513
- class="${t}__pred textae-editor__promise-dialog__observable-element"
514
- >
515
- </div>
516
- ${"string"===u?function(t,e){return()=>rt`
517
- <div class="${t}__row">
518
- <label>Autocompletion_ws</label>
519
- <input
520
- value="${e||""}"
521
- class="${t}__autocompletion-ws"
522
- >
523
- </div>
524
- `}(t,n):""}
525
- ${d?function(t,e){return()=>rt`
526
- <div class="${t}__row">
527
- <label>Default</label>
528
- <input
529
- value="${e||""}"
530
- class="${t}__default-value"
531
- >
532
- </div>
533
- `}(t,s):""}
534
- ${f?function(t,e){return()=>rt`
535
- <div class="${t}__row">
536
- <label>Media Height</label>
537
- <input
538
- type="text"
539
- value="${e||""}"
540
- class="${t}__media-height"
541
- >
542
- </div>
543
- `}(t,o):""}
544
- ${p?function(t,e,i){return()=>rt`
545
- <div class="${t}__row">
546
- <label>Label</label>
547
- <input
548
- type="text"
549
- value="${e||""}"
550
- class="${t}__label"
551
- >
552
- </div>
553
- <div class="${t}__row">
554
- <label>Color</label>
555
- <input
556
- type="color"
557
- value="${i||S_()}"
558
- class="${t}__color"
559
- >
560
- </div>
561
- `}(t,r,a):""}
562
- ${m?function(t,e,i,n){return()=>rt`
563
- <div class="${t}__row">
564
- <label>Min</label>
565
- <input
566
- type="text"
567
- value="${e||""}"
568
- class="${t}__min"
569
- >
570
- </div>
571
- <div class="${t}__row">
572
- <label>Max</label>
573
- <input
574
- type="text"
575
- value="${i||""}"
576
- class="${t}__max"
577
- >
578
- </div>
579
- <div class="${t}__row">
580
- <label>Step</label>
581
- <input
582
- type="text"
583
- value="${n||2}"
584
- class="${t}__step"
585
- >
586
- </div>
587
- `}(t,l,c,h):""}
588
- `}function T_(t,e){const{valueType:i}=e;return rt`
589
- <div class="${t}__container">
590
- <div class="${t}__row">
591
- <label>Attribute type</label>
592
- <div class="${t}__value-type-row">
593
- <label>
594
- <input
595
- type="radio"
596
- name="${t}__value-type"
597
- value="flag"
598
- ${"flag"===i?"checked":""}
599
- >
600
- <span class="${t}__value-type--flag">
601
- flag
602
- </label>
603
- <label>
604
- <input
605
- type="radio"
606
- name="${t}__value-type"
607
- value="selection"
608
- ${"selection"===i?"checked":""}
609
- >
610
- <span class="${t}__value-type--selection">
611
- selection
612
- </label>
613
- <label>
614
- <input
615
- type="radio"
616
- name="${t}__value-type"
617
- value="string"
618
- ${"string"===i?"checked":""}
619
- >
620
- <span class="${t}__value-type--string">
621
- string
622
- </label>
623
- <label>
624
- <input
625
- type="radio"
626
- name="${t}__value-type"
627
- value="numeric"
628
- ${"numeric"===i?"checked":""}
629
- >
630
- <span class="${t}__value-type--numeric">
631
- numeric
632
- </label>
633
- </div>
634
- </div>
635
- ${()=>$_(t,e)}
636
- </div>`}const C_="textae-editor__create-attribute-definition-dialog";class P_ extends Jw{constructor(){super("New attribute",T_(C_,{valueType:"flag"}),{},()=>this._state),r()(super.el,`[name="${C_}__value-type"]`,"change",()=>{const t=T_(C_,this._state);super.el.closest(".ui-dialog-content").innerHTML=t})}get _state(){const t=super.el.querySelector(`[name="${C_}__value-type"]:checked`).value;return{pred:__(super.el,`.${C_}__pred`),label:__(super.el,`.${C_}__label`),color:__(super.el,`.${C_}__color`),default:__(super.el,`.${C_}__default-value`),"media height":__(super.el,`.${C_}__media-height`),min:__(super.el,`.${C_}__min`),max:__(super.el,`.${C_}__max`),step:__(super.el,`.${C_}__step`),valueType:t}}}function E_(t,e){return!Number.isNaN(parseFloat(e))&&t!==parseFloat(e)}const A_="textae-editor__edit-attribute-definition-dialog";class M_ extends Jw{constructor(t){super("Edit attribute",function(t,e){return`\n<div class="${t}__container">\n ${$_(t,e)}\n</div>`}(A_,t),{},()=>{const e=__(super.el,`.${A_}__pred`),i=__(super.el,`.${A_}__default-value`),n=new Map;if(t.pred!==e&&n.set("pred",e),"flag"===t.valueType){const e=__(super.el,`.${A_}__label`),i=__(super.el,`.${A_}__color`);t.label!==e&&n.set("label",e),t.color!==i&&n.set("color",i)}if("string"===t.valueType){t.default!==i&&n.set("default",i);const e=__(super.el,`.${A_}__autocompletion-ws`),s=__(super.el,`.${A_}__media-height`);t.autocompletionWs!==e&&n.set("autocompletion_ws",e),t.mediaHeight!==s&&n.set("media height",s)}if("numeric"===t.valueType){E_(t.default,i)&&n.set("default",i);const e=__(super.el,`.${A_}__min`),s=__(super.el,`.${A_}__max`),o=__(super.el,`.${A_}__step`);E_(t.min,e)&&n.set("min",e),E_(t.max,s)&&n.set("max",s),E_(t.step,o)&&n.set("step",o)}return n})}}function Q_(t){const{labelForRangeOrIdOrPattern:e,rangeOrIdOrPattern:i,showDefault:n,default:s,label:o,color:r}=t;return rt`
637
- <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__container">
638
- <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
639
- <label>${e}</label>
640
- <input
641
- value="${i||""}"
642
- class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern textae-editor__promise-dialog__observable-element"
643
- >
644
- </div>
645
- ${function(t,e){return()=>t?rt`
646
- <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
647
- <label>
648
- <input
649
- type="checkbox"
650
- ${e?'checked="checked"':""}
651
- class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__default"
652
- >
653
- default
654
- </label>
655
- </div>
656
- `:""}(n,s)}
657
- <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
658
- <label>label</label>
659
- <input
660
- value="${o||""}"
661
- class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__label textae-editor__promise-dialog__observable-element"
662
- >
663
- </div>
664
- <div class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__row">
665
- <label>
666
- <input
667
- type="color"
668
- value="${r||S_()}"
669
- class="textae-editor__create-or-edit-value-of-attribute-definition-dialog__color"
670
- >
671
- color
672
- </label>
673
- </div>
674
- </div>`}class D_ extends Jw{constructor(t,e={}){const i={label:e.label,color:e.color};switch(t){case"numeric":i.labelForRangeOrIdOrPattern="range",i.rangeOrIdOrPattern=e.range;break;case"selection":i.labelForRangeOrIdOrPattern="id",i.rangeOrIdOrPattern=e.id,i.showDefault=!0,i.default=e.default;break;case"string":i.labelForRangeOrIdOrPattern="pattern",i.rangeOrIdOrPattern=e.pattern;break;default:throw new Error(`${t} is Unknown Attribute`)}super(Object.keys(e).length?"Edit attribute values":"New attribute value",Q_(i),{},()=>{const e=__(super.el,".textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern"),i=__(super.el,".textae-editor__create-or-edit-value-of-attribute-definition-dialog__label"),n=__(super.el,".textae-editor__create-or-edit-value-of-attribute-definition-dialog__color"),s={};switch(i&&(s.label=i),n&&(s.color=n),t){case"numeric":s.range=e;break;case"selection":s.id=e,super.el.querySelector("input.textae-editor__create-or-edit-value-of-attribute-definition-dialog__default").checked&&(s.default=!0);break;case"string":s.pattern=e}return s}),"numeric"===t&&super.el.querySelector(".textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern").addEventListener("input",t=>{const{value:e}=t.target;try{new Me(e),yn(super.button,!0)}catch(t){yn(super.button,!1)}}),"string"===t&&super.el.querySelector(".textae-editor__create-or-edit-value-of-attribute-definition-dialog__range_or_id_or_pattern").addEventListener("input",t=>{const{value:e}=t.target;try{new RegExp(e),yn(super.button,!0)}catch(t){yn(super.button,!1)}}),super.el.querySelector(".textae-editor__create-or-edit-value-of-attribute-definition-dialog__color").addEventListener("input",t=>{const{value:e}=t.target;yn(super.button,!e||/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e))})}}function R_(t,i,n,s){!function(t){r()(t,".textae-editor__pallet__attribute","dragstart",t=>{t.dataTransfer.setData("application/x-textae-attribute-tab-old-index",t.target.dataset.index),function(t){t.target.closest(".textae-editor__pallet__content").classList.add("textae-editor__pallet__content--dragging")}(t)}),r()(t,".textae-editor__pallet__attribute","dragend",t=>{!function(t){t.target.closest(".textae-editor__pallet__content").classList.remove("textae-editor__pallet__content--dragging")}(t)})}(i),function(t,e){r()(t,".textae-editor__pallet__drop-target","dragover",t=>{const e=t.target.closest(".textae-editor__pallet__content").querySelector(".textae-editor__pallet__attribute").offsetWidth;t.target.innerHTML=`<div style="width: ${e}px;"></div>`,t.preventDefault()}),r()(t,".textae-editor__pallet__drop-target","dragleave",t=>{t.target.innerHTML=""}),r()(t,".textae-editor__pallet__drop-target","drop",t=>{const i=parseInt(t.dataTransfer.getData("application/x-textae-attribute-tab-old-index")),n=parseInt(t.target.dataset.index);e.invoke(e.factory.moveAttributeDefinitionCommand(i,i<n?n-1:n))})}(i,n),r()(i,".textae-editor__pallet__attribute","click",e=>{t.showAttribute(e.target.dataset.attribute)}),r()(i,".textae-editor__pallet__create-predicate","click",()=>(new P_).open().then(t=>{t.pred&&n.invoke(n.factory.createAttributeDefinitionCommand(t))})),r()(i,".textae-editor__pallet__edit-predicate","click",()=>new M_(t.attrDef).open().then(e=>{e.size&&""!==e.get("pred")&&n.invoke(n.factory.changeAttributeDefinitionCommand(t.attrDef,e))})),r()(i,".textae-editor__pallet__delete-predicate","click",()=>n.invoke(n.factory.deleteAttributeDefinitionCommand(t.attrDef))),r()(i,".textae-editor__pallet__selection-attribute-label","click",i=>{if(s.selectedWithAttributeOf(t.attrDef.pred))if(s.isDuplicatedPredAttributeSelected(t.attrDef.pred))e().warning("An item among the selected has this attribute multiple times.");else{const e=n.factory.changeAttributeObjOfItemsCommand(s.all,t.attrDef,i.target.dataset.id);n.invoke(e)}else{const e=n.factory.createAttributeToItemsCommand(s.all,t.attrDef,i.target.dataset.id);n.invoke(e)}}),r()(i,".textae-editor__pallet__add-attribute-value-button","click",()=>new D_(t.attrDef.valueType).open().then(e=>{(e.range||e.id||e.pattern)&&n.invoke(n.factory.addValueToAttributeDefinitionCommand(t.attrDef,e))})),r()(i,".textae-editor__pallet__edit-value","click",e=>{const i=t.attrDef.values[e.target.dataset.index];new D_(t.attrDef.valueType,i).open().then(s=>{if(s.range||s.id||s.pattern){const o=Object.keys(s).reduce((t,e)=>t||s[e]!==i[e],!1)||Object.keys(i).reduce((t,e)=>t||s[e]!==i[e],!1);if(!o)return;n.invoke(n.factory.changeValueOfAttributeDefinitionAndObjectOfSelectionAttributeCommand(t.attrDef.externalFormat,e.target.dataset.index,s))}})}),r()(i,".textae-editor__pallet__remove-value","click",e=>n.invoke(n.factory.removeValueFromAttributeDefinitionCommand(t.attrDef,e.target.dataset.index))),r()(i,".textae-editor__pallet__add-attribute","click",()=>n.invoke(n.factory.createAttributeToItemsCommand(s.all,t.attrDef))),r()(i,".textae-editor__pallet__edit-object","click",()=>{const e=s.findSelectedAttributeWithSamePredicate(t.attrDef.pred);switch(t.attrDef.valueType){case"numeric":e_(s,t.attrDef,e,n);break;case"string":r_(s,e,n,t.attrDef);break;default:throw new Error(`Invalid attribute valueType: ${t.attrDef.valueType}`)}}),r()(i,".textae-editor__pallet__remove-attribute","click",()=>n.invoke(n.factory.removeAttributesFromItemsByPredCommand(s.all,t.attrDef)))}function I_(t){const{isLock:e,selectionModelItems:i,selectedPred:n,attributes:s,hasDiff:o}=t,r=1===(a=i.size)?"1 item selected":a>1?`${a} items selected`:"";var a;const l=s.length<30,c=n===(s[s.length-1]&&s[s.length-1].pred);return()=>rt`
675
- <div class="textae-editor__pallet__header-first-row">
676
- <div class="textae-editor__pallet__information">
677
- <span class="textae-editor__pallet__lock-icon" style="display: ${e?"inline-block":"none"};">locked</span>
678
- ${n&&i.size>0?()=>rt`
679
- ${function(t){const{selectionModelItems:e,selectedPred:i}=t,n=e.selectedWithoutAttributeOf(i);return()=>n?'\n <button\n type="button"\n class="textae-editor__pallet__add-attribute"\n >add to</button>\n ':'\n <button\n type="button"\n class="textae-editor__pallet__add-attribute"\n disabled="disabled"\n title="All the selected items already have this attribute."\n >add to</button>\n '}(t)}
680
- ${function(t){const{attrDef:e,selectionModelItems:i,selectedPred:n}=t,{valueType:s}=e,o=i.onlySelectedWithJustOneAttributeOf(n);return()=>"string"===s||"numeric"===s?o?'\n <button\n type="button"\n class="textae-editor__pallet__edit-object"\n >edit object of\n </button>\n ':'\n <button\n type="button"\n class="textae-editor__pallet__edit-object"\n disabled="disabled"\n title="Some selected items has zero or multi this attribute."\n >edit object of\n </button>\n ':""}(t)}
681
- ${function(t){const{selectionModelItems:e,selectedPred:i}=t,n=e.selectedWithAttributeOf(i);return()=>n?'\n <button\n type="button"\n class="textae-editor__pallet__remove-attribute"\n >remove from</button>\n ':'\n <button\n type="button"\n class="textae-editor__pallet__remove-attribute"\n disabled="disabled"\n title="None of the selected items has this attribute."\n >remove from</button>\n '}(t)}
682
- the
683
- `:""}
684
- <span class="textae-editor__pallet__selected-entity-label">${r}</span>
685
- </div>
686
- <div class="textae-editor__pallet__buttons">
687
- <span class="textae-editor__pallet__button textae-editor__pallet__import-button" title="Import"></span>
688
- <span class="textae-editor__pallet__button textae-editor__pallet__upload-button ${o?"textae-editor__pallet__upload-button--transit":""}" title="Upload"></span>
689
- </div>
690
- </div>
691
- <div class="textae-editor__pallet__header-second-row">
692
- <p class="textae-editor__pallet__attribute ${n?"":"textae-editor__pallet__attribute--selected"}" data-attribute="">
693
- Type
694
- </p>
695
- ${s.map((t,e,i)=>function({pred:t},e,i,n){const s=i[e-1],o=t!==n&&(!s||s.pred!==n);return()=>rt`
696
- ${o?()=>`<span class="textae-editor__pallet__drop-target" data-index="${e}"></span>`:""}
697
- <p
698
- class="textae-editor__pallet__attribute${t===n?" textae-editor__pallet__attribute--selected":""}"
699
- data-attribute="${t}"
700
- data-index="${e}"
701
- ${t===n?"draggable=true":""}>
702
- ${e<9?`${e+1}:`:""}${t}
703
- </p>
704
- `}(t,e,i,n))}
705
- ${function(t,e,i){return()=>t?"":`\n ${e?"":'<span class="textae-editor__pallet__drop-target" data-index="-1"></span>'}\n ${i?'\n <p class="textae-editor__pallet__attribute textae-editor__pallet__create-predicate">\n <span class="textae-editor__pallet__create-predicate__button" title="Add a new attribute"></span>\n </p>\n ':""}`}(e,c,l)}
706
- </div>
707
- `}function L_(t,e,i,n,s,o,r){return()=>rt`
708
- <tr class="textae-editor__pallet__row" style="background-color: ${t};">
709
- <td class="textae-editor__pallet__label" data-id="${e}">
710
- <span title="${e}">
711
- ${e}
712
- </span>
713
- ${i?()=>rt`<a href="${i}" target="_blank"><span class="textae-editor__pallet__link"></span></a>`:""}
714
- ${n?()=>'<span class="textae-editor__pallet__default-icon" title="This type is set as a default type."></span>':""}
715
- </td>
716
- <td class="textae-editor__pallet__short-label">
717
- ${s}
718
- </td>
719
- <td class="textae-editor__pallet__use-number">
720
- ${o}
721
- </td>
722
- <td class="textae-editor__pallet__table-buttons">
723
- <button
724
- type="button"
725
- class="textae-editor__pallet__table-button textae-editor__pallet__select-all${o?"":" textae-editor__pallet__table-button--disabled"}"
726
- title="Select all the cases of this type."
727
- data-id="${e}"
728
- data-use-number="${o}">
729
- </button>
730
- ${r?"":function(t,e,i,n,s){return()=>rt`
731
- <button
732
- type="button"
733
- class="textae-editor__pallet__table-button textae-editor__pallet__edit-type"
734
- title="Edit this type." data-id="${t}"
735
- data-color="${e}"
736
- data-is-default="${i}">
737
- </button>
738
- <button
739
- type="button"
740
- class="textae-editor__pallet__table-button textae-editor__pallet__remove${s?" textae-editor__pallet__table-button--disabled":""}"
741
- title="${s?"To activate this button, remove all the annotations of this type.":"Remove this type."}"
742
- data-id="${t}"
743
- data-label="${n}">
744
- </button>
745
- `}(e,t,n,s,o)}
746
- </td>
747
- </tr>`}function N_(t){const{types:e,isLock:i}=t;return rt`
748
- ${I_(t)}
749
- <table>
750
- <tbody>
751
- <tr>
752
- <th>id</th>
753
- <th>label</th>
754
- <th title="Number of annotations.">#</th>
755
- <th>
756
- ${i?"":()=>'<span class="textae-editor__pallet__add-button" title="Add new type"></span>'}
757
- </th>
758
- </tr>
759
- ${e.length?e.map(({color:t="",id:e,uri:n,defaultType:s,label:o="",useNumber:r})=>L_(t,e,n,s,o,r,i)):()=>'\n <tr class="textae-editor__pallet__row">\n <td class="textae-editor__pallet__no-config" colspan="4">There is no Entity definition.</td>\n </tr>\n '}
760
- </tbody>
761
- </table>
762
- `}function j_(t){const{attrDef:e}=t,{pred:i}=e,{valueType:n}=e;return()=>rt`
763
- <div>
764
- Attribute
765
- <span
766
- class="textae-editor__pallet__predicate__value-type textae-editor__pallet__predicate__value-type--${n}"
767
- title="${n} type">
768
- </span>
769
- "${i}"
770
- ${function(t){const{isLock:e,numberOfItemsUsingSelectedPred:i}=t;return e?()=>'\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__table-button--disabled textae-editor__pallet__edit-predicate"\n disabled="disabled">\n </button>\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__table-button--disabled textae-editor__pallet__delete-predicate"\n disabled="disabled">\n </button>\n ':()=>`\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__edit-predicate"\n title="Edit this predicate.">\n </button>\n ${function(t){return t.size>0?`\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__table-button--disabled textae-editor__pallet__delete-predicate"\n disabled="disabled"\n title="It cannot be deleted, as this attribute is used for ${t.size} items.">\n </button>\n `:'\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__delete-predicate"\n title="Delete this predicate.">\n </button>\n '}(i)}\n `}(t)}
771
- </div>
772
- `}function z_(t){return t?"":()=>'\n <th>\n <span class="textae-editor__pallet__add-attribute-value-button" title="Add new value"></span>\n </th>'}function B_(t,e,i){return t?"":()=>`\n <td class="textae-editor__pallet__table-attribute-buttons">\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__edit-value"\n title="Edit this value." data-index="${e}">\n </button>\n <button\n type="button"\n class="textae-editor__pallet__table-button textae-editor__pallet__remove-value${i?" textae-editor__pallet__table-button--disabled":""}"\n title="${i?"To activate this button, remove all the annotations of this type.":"Remove this value."}"\n ${i?' disabled="disabled"':""}\n data-index="${e}">\n </button>\n </td>\n `}function Z_(t){const{min:e,max:i,step:n,default:s,values:o}=t.attrDef,{isLock:r}=t;return rt`
773
- ${I_(t)}
774
- <div>
775
- <div class="textae-editor__pallet__predicate">
776
- ${j_(t)}
777
- min: ${e||'""'}
778
- max: ${i||'""'}
779
- step: ${n}
780
- default: ${s}
781
- </div>
782
-
783
- <table>
784
- <thead>
785
- <tr>
786
- <th>range</th>
787
- <th>label</th>
788
- <th>color</th>
789
- ${z_(r)}
790
- </tr>
791
- </thead>
792
- <tbody>
793
- ${o.map(({color:t="",range:e,label:i="",indelible:n},s)=>function(t,e,i,n,s,o){return()=>rt`
794
- <tr class="textae-editor__pallet__row" style="background-color: ${t};">
795
- <td class="textae-editor__pallet__attribute-label">
796
- ${e}
797
- </td>
798
- <td class="textae-editor__pallet__short-label">
799
- ${i}
800
- </td>
801
- <td class="textae-editor__pallet__short-label">
802
- ${t}
803
- </td>
804
- ${B_(n,s,o)}
805
- </tr>
806
- `}(t,e,i,r,s,n))}
807
- </tbody>
808
- </table>
809
- </div>
810
- `}function W_(t,e){const{values:i}=t.attrDef,{isLock:n,selectedPred:s}=t;return rt`
811
- ${I_(t)}
812
- <div>
813
- <div class="textae-editor__pallet__predicate">
814
- ${j_(t)}
815
- </div>
816
-
817
- <table>
818
- <thead>
819
- <tr>
820
- <th>id</th>
821
- <th>label</th>
822
- <th>color</th>
823
- ${z_(n)}
824
- </tr>
825
- </thead>
826
- <tbody>
827
- ${i.map(({color:t="",id:i,default:o,label:r=""},a)=>function(t,e,i,n,s,o,r,a){return()=>rt`
828
- <tr class="textae-editor__pallet__row" style="background-color: ${t};">
829
- <td class="textae-editor__pallet__selection-attribute-label" data-id="${e}">
830
- ${e}
831
- ${()=>i?'<span class="textae-editor__pallet__default-icon" title="This type is set as a default type."></span>':""}
832
- </td>
833
- <td class="textae-editor__pallet__short-label">
834
- ${n}
835
- </td>
836
- <td class="textae-editor__pallet__short-label">
837
- ${t}
838
- </td>
839
- ${B_(s,o,r.isSelectionAttributeValueIndelible(a,e))}
840
- </tr>
841
- `}(t,i,o,r,n,a,e,s))}
842
- </tbody>
843
- </table>
844
- </div>
845
- `}function F_(t){const{default:e,mediaHeight:i,values:n}=t.attrDef,{isLock:s}=t;return rt`
846
- ${I_(t)}
847
- <div>
848
- <div class="textae-editor__pallet__predicate">
849
- ${j_(t)}
850
- media height: ${i||'""'}
851
- default: ${e}
852
- </div>
853
-
854
- <table>
855
- <thead>
856
- <tr>
857
- <th>pattern</th>
858
- <th>label</th>
859
- <th>color</th>
860
- ${z_(s)}
861
- </tr>
862
- </thead>
863
- <tbody>
864
- ${n.map(({color:t=" ",pattern:e="",label:i="",indelible:n},o)=>function(t,e,i,n,s,o){return()=>rt`
865
- <tr class="textae-editor__pallet__row" style="background-color: ${t};">
866
- <td class="textae-editor__pallet__attribute-label">
867
- ${e}
868
- </td>
869
- <td class="textae-editor__pallet__short-label">
870
- ${i}
871
- </td>
872
- <td class="textae-editor__pallet__short-label">
873
- ${t}
874
- </td>
875
- ${B_(n,s,o)}
876
- </tr>`}(t,e,i,s,o,n))}
877
- </tbody>
878
- </table>
879
- </div>
880
- `}function X_(t,e,i,n,s,o,r){const{attributes:a}=s;if(!i)return N_({isLock:r,attributes:a,hasDiff:e,types:t,selectionModelItems:n});const l=a.find(t=>t.pred===i);if(!l)return N_({isLock:r,attributes:a,hasDiff:e,types:t,selectionModelItems:n});const c={isLock:r,attributes:a,hasDiff:e,attrDef:l,selectedPred:i,selectionModelItems:n,numberOfItemsUsingSelectedPred:new Set(o.filter(t=>t.pred===i).map(t=>t.subj))};switch(l.valueType){case"flag":return function(t){const{label:e,color:i}=t.attrDef;return rt`
881
- ${I_(t)}
882
- <div>
883
- <div class="textae-editor__pallet__predicate">
884
- ${j_(t)}
885
- label: "${e||""}"
886
- color: "${i||""}"
887
- </div>
888
- </div>
889
- `}(c);case"numeric":return Z_(c);case"selection":return W_(c,s);case"string":return F_(c);default:throw"attrDef.valueType is unknown attribute"}}function q_(t){for(const e of t.querySelectorAll(".textae-editor__pallet__attribute"))e.addEventListener("mousedown",t=>{t.stopPropagation()})}class H_ extends c_{#Vt;#jt;#J;#Gs;#ii;#do;constructor(t,e,i,n,s,o,a,l,c,h){super(t,l,h),this.#Vt=i,this.#jt=n,this.#J=s,this.#Gs=o,this.#ii=c,r()(this._el,".textae-editor__pallet__import-button","click",()=>e.emit("textae-event.pallet.import-button.click")),r()(this._el,".textae-editor__pallet__upload-button","click",()=>e.emit("textae-event.pallet.upload-button.click")),R_(this,this._el,a,o),e.on("textae-event.type-definition.attribute.create",t=>{this.showAttribute(t)}).on("textae-event.type-definition.attribute.change",t=>{this.showAttribute(t)}).on("textae-event.type-definition.attribute.delete",()=>{this.showAttribute(null)}).on("textae-event.type-definition.attribute.move",()=>{this.updateDisplay()}),e.on("textae-event.annotation-data.events-observer.unsaved-change",()=>this.updateDisplay()),e.on("textae-event.selection.entity.change",()=>this.updateDisplay()),e.on("textae-event.editor.unselect",()=>this.hide()).on("textae-event.resource.configuration.save",()=>this.updateDisplay()).on("textae-event.type-definition.lock",()=>this.updateDisplay()),e.on("textae-event.type-definition.entity.change",()=>this.updateDisplay()).on("textae-event.type-definition.entity.delete",()=>this.updateDisplay()).on("textae-event.type-definition.entity.change-default",()=>this.updateDisplay()).on("textae-event.type-definition.relation.change",()=>this.updateDisplay()).on("textae-event.type-definition.relation.delete",()=>this.updateDisplay()).on("textae-event.type-definition.relation.change-default",()=>this.updateDisplay())}updateDisplay(){super.updateDisplay(),q_(this._el)}showPallet(){this.show()}hidePallet(){this.hide()}show(){this.#do=null,super.show(),q_(this._el)}showAttribute(t){this.#do=t,this.updateDisplay()}selectLeftAttributeTab(){this.#do&&(0===this.#fo?this.showAttribute():this.showAttribute(this.#po[this.#fo-1].pred))}selectRightAttributeTab(){if(this.#do){if(this.#fo===this.#po.length-1)return;this.showAttribute(this.#po[this.#fo+1].pred)}else this.#po.length&&this.showAttribute(this.#po[0].pred)}get#fo(){return this.#po.findIndex(t=>t.pred===this.#do)}get _content(){return X_(this.#J.pallet,this.#ii.diffOfConfiguration,this.#do,this.#Gs,this.#Vt.attribute,this.#jt.all,this.#Vt.isLock)}get attrDef(){return this.#Vt.attribute.get(this.#do)}get#po(){return this.#Vt.attribute.attributes}}class V_{static create(t,e,i,n,s,o,a,l,c,h,u,d,f,p){const m=new H_(t,e,i,n,s,o,a,l,c,h);return function(t,e,i,n,s,o){r()(t.el,".textae-editor__pallet__add-button","click",()=>{new b_(i).open().then(({newType:t})=>e.invoke(e.factory.createTypeDefinitionCommand(i,t)))}),r()(t.el,".textae-editor__pallet__label","click",t=>e.invoke(e.factory.changeTypeOfSelectedItemsCommand(n,t.delegateTarget.dataset.id))),r()(t.el,".textae-editor__pallet__select-all","click",t=>{if(!w_(t.target))return;s.removeAll();const e=o.getInstanceContainerFor(n).findByType(t.delegateTarget.dataset.id).map(({id:t})=>t);s.add(n,e)}),r()(t.el,".textae-editor__pallet__edit-type","click",t=>{new x_(i,t.target.dataset.id,t.target.dataset.color.toLowerCase(),"true"===t.target.dataset.isDefault).open().then(({id:t,changedProperties:s})=>{s.size&&e.invoke(e.factory.changeTypeDefinitionCommand(i,n,t,s))})}),r()(t.el,".textae-editor__pallet__remove","click",t=>{if(!w_(t.target))return;const{id:n}=t.delegateTarget.dataset,{label:s}=t.delegateTarget.dataset,o={id:n,label:s||""};if(void 0===n)throw new Error("You must set the type id to remove.");e.invoke(e.factory.removeTypeDefinitionCommand(i,o))})}(m,a,s,u,d,f),ze(p,()=>m,["showPallet","hidePallet","selectLeftAttributeTab","selectRightAttributeTab"]),this.#mo(t,m),m}static#mo(t,e){t.appendChild(e.el)}}class Y_ extends Kw{#go;#xs;#O;#vo;#qt;#Ie;#ii;#ws;constructor(t,e,i,n,s,o,r,a){super(),this.#ws=V_.create(t,e,i.typeDictionary,i.attributeInstanceContainer,i.typeDictionary.block,n.entity,o,"Block configuration",r,a,"entity",n,i,this);const l=new Hw(t,i,s,o,r,n);this.#go=new Gw(t,i,n,l,this.#ws),this.#vo=new y_(t,o,this.#ws,"Block",a,i.typeDictionary.block,i,"Entity"),this.#Ie=n,this.#xs=l,this.#O=t.querySelector(".textae-editor__text-box"),this.#qt=i,this.#ii=r;const c=new a_(o,i.typeDictionary,n.entity,new h_(t,a),()=>this.editProperties(),this.#ws);ze(this,()=>c,["manipulateAttribute"])}bindMouseEvents(){return this.#go.bind()}editProperties(){this.#vo.startEditing(this.#Ie.entity)}get isPalletShown(){return this.#ws.visibly}createSpanWithTouchDevice(){console.log("createSpanWithTouchDevice"),this.#xs.cerateSpanForTouchDevice()}expandSpanWithTouchDevice(){this.#xs.expandForTouchDevice()}shrinkSpanWithTouchDevice(){this.#xs.shrinkForTouchDevice()}applyTextSelectionWithTouchDevice(){if(Yw(this.#O)){const{begin:t,end:e}=this.#qt.textSelection,i=this.#qt.isBoundaryCrossingWithOtherSpans(t,e),{isParentOfBothNodesTextBox:n}=new qw;this.#ii.updateButtonsToOperateSpanWithTouchDevice(n,i,i,!1)}else this.#ii.updateButtonsToOperateSpanWithTouchDevice(!1,!1,!1,!1)}}class U_{#Q;#Ie;#ei;#Vt;#ws;constructor(t,e,i,n,s){this.#Q=t,this.#Ie=e,this.#ei=i,this.#Vt=n,this.#ws=s}bind(){const t=[];return t.push(r()(this.#Q,".textae-editor__text-box","click",()=>this.#Ss())),t.push(r()(this.#Q,".textae-editor","click",t=>{t.target.classList.contains("textae-editor")&&this.#Ss()})),t.push(r()(this.#Q,".textae-editor__signboard","mousedown",()=>this.#ks())),t.push(r()(this.#Q,".textae-editor__signboard__type-values","click",t=>{const e=Uw(t.target).dataset.id;this.#$s(t,e)})),t}#Ss(){this.#ws.hide(),this.#Ie.removeAll()}#ks(){this.#Q.focus()}#$s(t,e){!function(t,e,i,n,s){if(t.entity.some){const o=t.entity.singleId,r=s;o===r?t.entity.toggle(o):(e.invoke(e.factory.createRelationCommand({subj:o,obj:r,pred:i.defaultType})),function(t,e,i,n){t.ctrlKey||t.metaKey?e.remove("entity",n):t.shiftKey?(e.remove("entity",i),e.add("entity",[n])):(e.remove("entity",i),e.remove("entity",n))}(n,t,o,r))}else t.selectEntity(s)}(this.#Ie,this.#ei,this.#Vt.relation,t,e)}}class G_ extends Kw{#go;#vo;#Ie;#ws;constructor(t,e,i,n,s,o,r){super(),this.#ws=V_.create(t,e,i.typeDictionary,i.attributeInstanceContainer,i.typeDictionary.relation,n.relation,s,"Relation configuration",o,r,"relation",n,i,this),this.#go=new U_(t,n,s,i.typeDictionary,this.#ws),this.#vo=new y_(t,s,this.#ws,"Relation",r,i.typeDictionary.relation,i,"Relation"),this.#Ie=n;const a=new a_(s,i.typeDictionary,n.relation,new h_(t,r),()=>this.editProperties(),this.#ws);ze(this,()=>a,["manipulateAttribute"])}bindMouseEvents(){return this.#go.bind()}editProperties(){this.#vo.startEditing(this.#Ie.relation)}get isPalletShown(){return this.#ws.visibly}relationClicked(t,e){t.ctrlKey||t.metaKey?this.#Ie.relation.toggle(e.id):this.#Ie.selectRelation(e.id)}relationBollardClicked(t){t.span.forceRenderGrid(),this.#Ie.selectEntity(t.id)}}class K_{#Q;#qt;#Ie;#xs;#ws;constructor(t,e,i,n,s){this.#Q=t,this.#qt=e,this.#Ie=i,this.#xs=s,this.#ws=n}bind(){const t=[];let e=!1;return t.push(r()(this.#Q,".textae-editor__text-box","click",t=>{t.target.classList.contains("textae-editor__text-box")&&!e&&this.#_s()})),t.push(r()(this.#Q,".textae-editor","click",t=>{t.target.classList.contains("textae-editor")&&this.#Ss()})),t.push(r()(this.#Q,".textae-editor__signboard","mousedown",()=>this.#ks())),t.push(r()(this.#Q,".textae-editor__signboard__type-values","click",t=>{const e=Uw(t.target).dataset.id;this.#$s(t,e)})),t.push(r()(this.#Q,".textae-editor__span","mouseup",t=>{t.target.classList.contains("textae-editor__span")&&(this.#Es(t),e=!0,setTimeout(()=>e=!1,0))})),t.push(r()(this.#Q,".textae-editor__block","mouseup",t=>{t.target.classList.contains("textae-editor__block")&&this.#Ts(t)})),t.push(r()(this.#Q,".textae-editor__style","mouseup",t=>{t.target.classList.contains("textae-editor__style")&&this.#Ps(t)})),t}#Ss(){this.#ws.hide(),this.#Ie.removeAll()}#_s(){this.#ws.hide();window.getSelection();Yw(this.#Q.querySelector(".textae-editor__text-box"))?this.#xs.editFor():this.#Ie.removeAll()}#Es(t){2===t.button&&Fw();const e=window.getSelection();"Caret"!==e.type&&"None"!==e.type||this.#yo(t,t.target.id),Yw(this.#Q.querySelector(".textae-editor__text-box"))&&this.#xs.editFor()}#Ts(t){2===t.button&&Fw();"Caret"===window.getSelection().type&&this.#Ie.removeAll(),Yw(this.#Q.querySelector(".textae-editor__text-box"))&&this.#xs.editFor()}#Ps(t){2===t.button&&Fw();if("Caret"===window.getSelection().type){const e=t.target.closest(".textae-editor__span");e?this.#yo(t,e.id):this.#Ie.removeAll()}Yw(this.#Q.querySelector(".textae-editor__text-box"))&&this.#xs.editFor()}#ks(){this.#Q.focus()}#$s(t,e){this.#qt.entityInstanceContainer.get(e).isDenotation&&(t.ctrlKey||t.metaKey?this.#Ie.entity.toggle(e):this.#Ie.selectEntity(e))}#yo(t,e){const i=this.#Ie.span.singleId,n=t.shiftKey&&i?this.#qt.spanInstanceContainer.rangeDenotationSpan(i,e):[];Vw(this.#Ie,n,t,e)}}class J_{#Q;#qt;#Ie;#ei;#ii;#ni;constructor(t,e,i,n,s,o){this.#Q=t,this.#qt=e,this.#Ie=i,this.#ei=n,this.#ii=s,this.#ni=o}editFor(){const t=new qw;if(t.isParentOfAnchorNodeTextBox){if(t.isParentOfFocusNodeTextBox)return void this.#Oo();if(t.isParentOfFocusNodeDenotationSpan)return void this.#bo(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#xo(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#wo(t)}if(t.isParentOfAnchorNodeDenotationSpan){if(t.isParentOfFocusNodeTextBox)return void this.#_o(t);if(t.isParentOfFocusNodeDenotationSpan)return void this.#So(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#ko(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#$o(t)}if(t.isParentOfAnchorNodeBlockSpan){if(t.isParentOfFocusNodeTextBox)return void this.#To(t);if(t.isParentOfFocusNodeDenotationSpan)return void this.#Co(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#Po(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#Eo(t)}if(t.isParentOfAnchorNodeStyleSpan){if(t.isParentOfFocusNodeTextBox)return void this.#Ao(t);if(t.isParentOfFocusNodeDenotationSpan)return void this.#Mo(t);if(t.isParentOfFocusNodeBlockSpan)return void this.#Qo(t);if(t.isParentOfFocusNodeStyleSpan)return void this.#Do(t)}}cerateSpanForTouchDevice(){(new qw).isParentOfBothNodesSame&&this.#gs()}expandForTouchDevice(){const t=this.#Os();if(t){const{spanID:e,begin:i,end:n}=t;if(this.#qt.isBoundaryCrossingWithOtherSpans(i,n))return;if(this.#qt.findDenotation(i,n))return;this.#ei.invoke(this.#ei.factory.moveDenotationSpanCommand(e,i,n))}}shrinkForTouchDevice(){const t=this.#bs();if(t){const{spanID:i,begin:n,end:s}=t,o=N(this.#Q,i);if(this.#qt.isBoundaryCrossingWithOtherSpans(n,s))return void e().warning("A span cannot be shrunken to make a boundary crossing.");const r=this.#qt.findDenotation(n,s);n<s&&!r?this.#ei.invoke(this.#ei.factory.moveDenotationSpanCommand(i,n,s)):(this.#ei.invoke(this.#ei.factory.removeSpanCommand(i)),o&&this.#Ie.selectSpan(o.id))}}#Os(){const t=new qw;if(null==t.ancestorDenotationSpanOfAnchorNode&&null==t.ancestorDenotationSpanOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.ancestorDenotationSpanOfAnchorNode.id;return{spanID:e,...this.#qt.getSpan(e).getExpandedInAnchorNodeToFocusNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.ancestorDenotationSpanOfFocusNode.id;return{spanID:e,...this.#qt.getSpan(e).getExpandedInFocusNodeToAnchorNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}}#bs(){const t=new qw;if(null==t.ancestorDenotationSpanOfAnchorNode&&null==t.ancestorDenotationSpanOfFocusNode)return null;if(t.parentOfAnchorNode===t.parentOfFocusNode)return null;if(t.parentOfFocusNode.contains(t.parentOfAnchorNode)){const e=t.ancestorDenotationSpanOfAnchorNode.id;return{spanID:e,...this.#qt.getSpan(e).getShortenInFocusNodeToAnchorNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}if(t.parentOfAnchorNode.contains(t.parentOfFocusNode)){const e=t.ancestorDenotationSpanOfFocusNode.id;return{spanID:e,...this.#qt.getSpan(e).getShortenInAnchorNodeToFocusNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni)}}}#Oo(){this.#gs()}#bo(t){const e=this.#Ro(t);e?this.#vs(e):Fw()}#xo(){Fw()}#wo(t){const e=this.#Ro(t);e?this.#vs(e):this.#gs()}#_o(t){this.#ys(t.parentOfAnchorNode.id)}#So(t){const e=this.#Io(t);if(e)return void this.#vs(e);if(t.isParentOfBothNodesSame)return void this.#gs();const i=this.#Ro(t);i?this.#vs(i):this.#ys(t.parentOfAnchorNode.id)}#ko(t){t.parentOfFocusNode.contains(t.parentOfAnchorNode)?this.#ys(t.parentOfAnchorNode.id):Fw()}#$o(t){const e=this.#Io(t);if(e)return void this.#vs(e);if(t.parentOfAnchorNode===t.ancestorDenotationSpanOfFocusNode)return void this.#gs();const i=this.#Lo(t);if(i)return void this.#ys(i);const n=this.#Ro(t);n&&this.#vs(n)}#To(){Fw()}#Co(t){const e=this.#Ro(t);e?this.#vs(e):Fw()}#Po(t){this.#gs()}#Eo(t){const e=this.#Ro(t);e?this.#vs(e):Fw()}#Ao(t){if(t.ancestorDenotationSpanOfAnchorNode){const e=t.ancestorDenotationSpanOfAnchorNode.id;return void(e&&this.#ys(e))}this.#gs()}#Mo(t){const e=this.#Io(t);if(e)return void this.#vs(e);if(t.ancestorDenotationSpanOfAnchorNode===t.parentOfFocusNode)return void this.#gs();const i=this.#Ro(t);if(i)return void this.#vs(i);const n=this.#Lo(t);n?this.#ys(n):Fw()}#Qo(t){const e=this.#Lo(t);e?this.#ys(e):this.#gs()}#Do(t){const e=this.#Io(t);if(e)return void this.#vs(e);if(t.isParentOfBothNodesSame||t.isParentsParentOfAnchorNodeAndFocusedNodeSame)return void this.#gs();const i=this.#Lo(t);i?this.#ys(i):Fw()}#Io(t){if(t.ancestorDenotationSpanOfAnchorNode){const{anchor:e}=this.#qt.textSelection,{begin:i,end:n}=this.#qt.getDenotationSpan(t.ancestorDenotationSpanOfAnchorNode.id);if(e===i||e===n){if(t.ancestorDenotationSpanOfAnchorNode===t.ancestorDenotationSpanOfFocusNode)return t.ancestorDenotationSpanOfAnchorNode.id;if(t.ancestorDenotationSpanOfAnchorNode!==t.ancestorDenotationSpanOfFocusNode&&t.ancestorDenotationSpanOfFocusNode.contains(t.ancestorDenotationSpanOfAnchorNode))return t.ancestorDenotationSpanOfFocusNode.id}}}#Ro(t){const e=t.ancestorDenotationSpanOfFocusNode;return!e||t.ancestorDenotationSpanOfAnchorNode===e||t.ancestorDenotationSpanOfAnchorNode&&!t.ancestorDenotationSpanOfAnchorNode.contains(e)?t.isAnchorNodeParentIsDescendantOfFocusNodeParent&&(i=this.#Ie.span.single,n=this.#qt.textSelection.focus,i&&i.begin<n&&n<i.end)?this.#Ie.span.single.element.id:void 0:e.id;var i,n}#Lo(t){const e=t.ancestorDenotationSpanOfAnchorNode;if(e){const{ancestorDenotationSpanOfFocusNode:i}=t;if(!i)return e.id;if(e!==i&&(e.parentElement===i.parentElement||i.contains(e)))return e.id}}#gs(){this.#qt.hasCharacters(this.#ni)&&(this.#Ie.removeAll(),function(t,e,i,n,s,o){const{begin:r,end:a}=t.getTextSelection(s,i);if(t.validateNewDenotationSpan(r,a)){const t=e.factory.createSpanAndAutoReplicateCommand({begin:r,end:a},n,o);e.invoke(t)}}(this.#qt,this.#ei,this.#ii.textSelectionAdjuster,this.#No,this.#ni,mn(this.#ii,this.#ni))),Fw()}#ys(t){this.#Ie.removeAll();const{begin:e,end:i}=this.#qt.getSpan(t).getExpandedInAnchorNodeToFocusNodeDirection(this.#ii.textSelectionAdjuster,this.#qt.sourceDoc,this.#ni);this.#qt.validateNewDenotationSpan(e,i)&&this.#ei.invoke(this.#ei.factory.moveDenotationSpanCommand(t,e,i)),Fw()}#vs(t){Xw(this.#Q,this.#qt,this.#qt.sourceDoc,this.#Ie,this.#ei,this.#ii.textSelectionAdjuster,t,this.#ni,(e,i)=>{this.#ei.invoke(this.#ei.factory.moveDenotationSpanCommand(t,e,i))}),Fw()}get#No(){return this.#ii.isPushed("auto replicate")}}class tS extends Kw{#go;#xs;#O;#qt;#vo;#Ie;#ii;#ws;constructor(t,e,i,n,s,o,r,a){super(),this.#ws=V_.create(t,e,i.typeDictionary,i.attributeInstanceContainer,i.typeDictionary.denotation,n.entity,o,"Term configuration",r,a,"entity",n,i,this);const l=new J_(t,i,n,o,r,s);this.#go=new K_(t,i,n,this.#ws,l),this.#vo=new y_(t,o,this.#ws,"Entity",a,i.typeDictionary.denotation,i,"Denotation"),this.#Ie=n,this.#xs=l,this.#O=t.querySelector(".textae-editor__text-box"),this.#qt=i,this.#ii=r;const c=new a_(o,i.typeDictionary,n.entity,new h_(t,a),()=>this.editProperties(),this.#ws);ze(this,()=>c,["manipulateAttribute"])}bindMouseEvents(){return this.#go.bind()}editProperties(){this.#vo.startEditing(this.#Ie.entity)}get isPalletShown(){return this.#ws.visibly}createSpanWithTouchDevice(){this.#xs.cerateSpanForTouchDevice()}expandSpanWithTouchDevice(){this.#xs.expandForTouchDevice()}shrinkSpanWithTouchDevice(){this.#xs.shrinkForTouchDevice()}applyTextSelectionWithTouchDevice(){if(Yw(this.#O)){const{begin:t,end:e}=this.#qt.textSelection,i=this.#qt.isBoundaryCrossingWithOtherSpans(t,e),{isParentOfBothNodesSame:n}=new qw;this.#ii.updateButtonsToOperateSpanWithTouchDevice(n,i,i,!1)}else this.#ii.updateButtonsToOperateSpanWithTouchDevice(!1,!1,!1,!1)}}class eS{#jo;constructor(t,e){const i=document.createElement("dialog");i.classList.add("textae-editor__text-edit-dialog"),t.appendChild(i),i.addEventListener("close",t=>{const i=t.target,{returnValue:n}=i;if("OK"===n){const t=i.querySelector("form"),n=parseInt(t.begin.value),s=parseInt(t.end.value),o=t.originalText.value,r=t.editedText.value;e(n,s,o,r)}}),r()(i,".textae-editor__text-edit-dialog__close-button","click",t=>{i.close()}),r()(i,".textae-editor__text-edit-dialog__text-box","keyup",t=>{t.stopPropagation()}),this.#jo=i}open(t,e,i){this.#jo.innerHTML=this.#zo({begin:t,end:e,text:i}),this.#jo.showModal()}#zo(t){const{text:e,begin:i,end:n}=t;return rt`
890
- <div class="textae-editor__text-edit-dialog__title-bar">
891
- <h1>Edit text dialog</h1>
892
- <button class="textae-editor__text-edit-dialog__close-button">X</button>
893
- </div>
894
- <h3>Original Text</h3>
895
- <div>${e}</div>
896
- <h3>Edit text</h3>
897
- <form method="dialog">
898
- <input type="hidden" name="begin" value="${i}">
899
- <input type="hidden" name="end" value="${n}">
900
- <input type="hidden" name="originalText" value="${e}">
901
- <textarea class="textae-editor__text-edit-dialog__text-box" name="editedText" autofocus>${e}</textarea>
902
- <br>
903
- <div class="textae-editor__text-edit-dialog__button-bar">
904
- <button value="OK">OK</button>
905
- </div>
906
- </form>
907
- `}}class iS extends Kw{#Q;#qt;#ni;#ii;#ei;#jo;constructor(t,e,i,n,s){super(),this.#Q=t,this.#qt=e,this.#ni=i,this.#ii=n,this.#ei=s,this.#jo=new eS(t,(t,e,i,n)=>{if(i===n)return;const s=this.#ei.factory.changeTextAndMoveSpanCommand(t,e,n);this.#ei.invoke(s)})}bindMouseEvents(){const t=[];return t.push(r()(this.#Q,".textae-editor__text-box","click",()=>this.#Bo())),t}applyTextSelectionWithTouchDevice(){this.#ii.updateButtonsToOperateSpanWithTouchDevice(!1,!1,!1,this.#Zo)}editTextWithTouchDevice(){this.#Bo()}#Bo(){if(!this.#Zo)return;const{begin:t,end:e}=this.#qt.getTextSelection(this.#ni,this.#ii.textSelectionAdjuster);if(!this.#qt.validateEditableText(t,e))return!1;const i=this.#qt.getTextBetween(t,e);this.#jo.open(t,e,i)}get#Zo(){return!!Yw(this.#O)&&!!this.#qt.hasCharacters(this.#ni)}get#O(){return this.#Q.querySelector(".textae-editor__text-box")}}function nS(t,e){let i=0;return function t(n){for(const s of n.childNodes)if(s.nodeType===Node.TEXT_NODE){const t=s.textContent.length;if(i+t>=e)return{node:s,offset:e-i};i+=t}else if(s.nodeType===Node.ELEMENT_NODE){const e=t(s);if(e)return e}return null}(t)}class sS extends Kw{#Q;#Nt;#qt;#Wo;#Fo;#ni;#ii;#Xo=!1;constructor(t,e,i,n,s){super(),this.#Q=t,this.#Nt=e,this.#qt=i,this.#ni=n,this.#ii=s}get selectedText(){return void 0===this.#Wo||void 0===this.#Fo?{status:"unselected"}:this.#qt.isBoundaryCrossingWithOtherSpans(this.#Wo,this.#Fo)?{status:"cross boundary detected"}:{begin:this.#Wo,end:this.#Fo,status:"selected"}}updateSelectedTextOffsets(){if(this.#Xo)return;const t=document.getSelection();if(this.hasEmptySelection(t))return;const e=t.getRangeAt(0),i=this.#Q.querySelector(".textae-editor__text-box");if(!this.isSelectionInTextBox(e,i))return;this.#Xo=!0,gn(i);const{begin:n,end:s}=this.#qt.getTextSelection(this.#ni,this.#ii.textSelectionAdjuster);!function(t,e,i){const n=nS(t,e),s=nS(t,i),o=document.createRange();o.setStart(n.node,n.offset),o.setEnd(s.node,s.offset);const r=o.extractContents(),a=l().create("<mark></mark>");a.appendChild(r),o.insertNode(a)}(i,n,s),this.#Wo=n,this.#Fo=s,this.#Nt.emit("textae-event.editor.selected-text.change"),setTimeout(()=>this.#Xo=!1,600)}isSelectionInTextBox(t,e){return t.startContaine!==e&&t.endContainer!==e&&e.contains(t.startContainer)&&e.contains(t.endContainer)}hasEmptySelection(t){return!t||0===t.rangeCount||0===t.toString().replace(/\s+/g,"").length}}class oS{static createTermEditMode(t,e,i,n,s,o,r,a){return new tS(t,e,i,n,s,o,r,a)}static createBlockEditMode(t,e,i,n,s,o,r,a){return new Y_(t,e,i,n,s,o,r,a)}static createRelationEditMode(t,e,i,n,s,o,r){return new G_(t,e,i,n,s,o,r)}static createTextEditMode(t,e,i,n,s){return new iS(t,e,i,n,s)}static createViewMode(t,e,i,n,s){return new sS(t,e,i,n,s)}}class rS{#En;#qo;#Ho;#Vo;#Yo;#Uo;constructor(t,e,i,n,s,o,r){this.#En=t,this.#qo=e,this.#Ho=i,this.#Vo=n,this.#Yo=s,this.#Uo=o;const a=Gi(()=>this.#Go.updateSelectedTextOffsets());document.addEventListener("selectionchange",a),r.on("textae-event.editor.relation.click",(t,e)=>this.#Go.relationClicked(t,e)).on("textae-event.editor.relation-bollard.click",(t,e)=>this.#Go.relationBollardClicked(e)),ze(this,()=>this.#Go,["showPallet","hidePallet","selectLeftAttributeTab","selectRightAttributeTab","createSpanWithTouchDevice","expandSpanWithTouchDevice","shrinkSpanWithTouchDevice","editTextWithTouchDevice","applyTextSelectionWithTouchDevice","editProperties","manipulateAttribute"])}get isEditDenotation(){return this.#En.currentState===Bx}get isTypeValuesPalletShown(){return this.#Go.isPalletShown}get#Go(){switch(this.#En.currentState){case Bx:return this.#qo;case Zx:return this.#Ho;case Wx:return this.#Vo;case Fx:return this.#Yo;default:return this.#Uo}}}class aS{constructor(t){this._editorHTMLElement=t}clear(){for(const t of this._editorHTMLElement.classList)t.startsWith("textae-editor__mode")&&this._editorHTMLElement.classList.remove(t)}setFor(t){this._editorHTMLElement.classList.add(`textae-editor__mode--${t}`)}}class lS{#Ko;constructor(t,e,i,n,s,o,r){this.#Ko=[];const a=new aS(t);e.on("textae-event.edit-mode.transition",(t,e)=>{switch(this.#Jo(),a.clear(),t){case zx:i.typeGap.show=e,e?a.setFor("view-with-relation"):a.setFor("view-without-relation");break;case Bx:i.typeGap.show=e,this.#Ko=n.bindMouseEvents(),e?a.setFor("denotation-with-relation"):a.setFor("denotation-without-relation");break;case Zx:i.typeGap.show=e,this.#Ko=s.bindMouseEvents(),e?a.setFor("block-with-relation"):a.setFor("block-without-relation");break;case Wx:i.typeGap.show=!0,this.#Ko=o.bindMouseEvents(),a.setFor("relation");break;case Fx:i.typeGap.show=e,this.#Ko=r.bindMouseEvents(),e?a.setFor("text-with-relation"):a.setFor("text-without-relation");break;default:throw new Error(`Unknown mode: ${t}`)}})}#Jo(){for(const t of this.#Ko)t.destroy();this.#Ko=[]}}class cS{#tr;#qt;#En;#Uo;#er;constructor(t,i,n,s,o,r,a){this.#qt=o;const l=new We,c=new Vi(t,i,s,o,a),h=new uw(s,c,a,o.denotationDefinitionContainer,o.attributeDefinitionContainer,o.typeDictionary),u=new Nx(s,t,r.statusBar),d=new Cw(s,u,o),f=new Bw,p=new Zw(o.relationInstanceContainer,s,f);this.#En=p;const m=new hw(s,a,h,d,u,o.typeDictionary,f,p),g=oS.createTermEditMode(t,s,o,a,l,c,m,n),v=oS.createBlockEditMode(t,s,o,a,l,c,m,n),y=oS.createRelationEditMode(t,s,o,a,c,m,n),O=oS.createTextEditMode(t,o,l,m,c),b=oS.createViewMode(t,s,o,l,m);this.#Uo=b;const x=new rS(p,g,v,y,O,b,s),w=new Ww(r,p,o.relationInstanceContainer,()=>x.hidePallet());s.on("textae-event.annotation-data.all.change",t=>{r.isEditMode&&t&&e().success("track annotations have been merged to root annotations."),w.reset()}),this.#er=w;const _=new vn(t,s,o,a,c,l,f,h,m,x),S=new jw(s),k=new yx(s,S,o,()=>u.annotation,()=>u.configuration,r.saveTo,d,m);new dw(s,m,k,r.saveTo,d),new lS(t,s,o,g,v,y,O),function(t,i,n,s,o,r,a,l){t.on("textae-event.resource.annotation.load.success",c=>{if(!c.data.config&&i.config)n.loadConfiguration(i.config,c);else{if(Dx(c.data),c.data.config&&"object"!=typeof c.data.config)return void e().error("configuration in annotation file is invalid.");const n=Qx(c.data,c.data.config);if(n){if(Ox(n,s,o,r,c.data,a),t.emit("textae-event.configuration.reset"),i.isFocusFirstDenotation){const t=r.spanInstanceContainer.allDenotationSpans.at(0);t&&t.focus()}l.annotation=c}}}).on("textae-event.resource.configuration.load.success",(i,n=null)=>{if("object"!=typeof i.data)return void e().error(`${i.displayName} is not a configuration file or its format is invalid.`);n&&Dx(n.data);const c=n&&n.data||{...l.annotation,...r.externalFormat},h=Qx(c,i.data);h&&(Ox(h,s,o,r,c,a),t.emit("textae-event.configuration.reset"),n&&(l.annotation=n),l.configuration=i)})}(s,r,S,m,l,o,f,u);const $=new Sw(c,_,k,m,o,x,w),T=new bw(s,m,$).el;switch(t.insertBefore(T,t.childNodes[0]),r.control){case"hidden":t.classList.add("textae-editor--control-hidden");break;case"visible":t.classList.add("textae-editor--control-visible");break;default:r.isEditMode||t.classList.add("textae-editor--control-hidden")}o.toolBarHeight=T.getBoundingClientRect().height,function(t,i,n,s,o,r,a){switch(r.resourceType){case dx.QUERY_PARAMETER:{const l=r.annotation();l?Rx(fx.createParameterSource(l),r.config,n,s,t,i,a,o):e().error("failed to load annotation from query parameter.");break}case dx.INLINE:{const l=r.annotation();l?Rx(fx.createInlineSource(l),r.config,n,s,t,i,a,o):e().error("failed to load annotation from directly included in the div element.");break}case dx.REMOTE_URL:n.loadAnnotation(r.annotationURL);break;default:r.config?n.loadConfiguration(r.config):Ox(o.defaultConfiguration,s,t,i,o.defaultAnnotation,a)}}(l,o,S,m,u,r,f);const C=new ww(t,m,$);t.appendChild(C.el),t.addEventListener("keyup",t=>{C.hide(),_.isActive&&new _w(c,_,k,f,x,w).handle(t)}),ze(this,()=>_,["copyEntitiesToSystemClipboard","cutEntitiesToSystemClipboard","pasteEntitiesFromSystemClipboard","activate","deactivate","applyTextSelectionWithTouchDevice"]),this.#tr=C}showContextMenu(t){this.#tr.show(t)}hideContextMenu(){this.#tr.hide()}focusDenotation(t){this.#er.toTermEditMode(),this.#qt.focusDenotation(t)}getSelectedText(){return this.#En.currentState===zx?this.#Uo.selectedText:{status:"unselected"}}}var hS=i(7007);class uS{#Ki;#ir;constructor(t,e,i){if(i)this.#Ki=i;else if(e)this.#ir=e;else{const e=this.#nr(t);e&&(this.#Ki=e)}}get isLoaded(){return Boolean(this.#Ki)}get isRemote(){return Boolean(this.#ir)}get URL(){return this.#ir}annotation(){try{return On(this.#Ki)?JSON.parse(this.#Ki):db.parse(this.#Ki)}catch{return null}}#nr(t){const e=t.textContent;return t.innerHTML="",e}}class dS{#At;#sr;constructor(t){this.#At=t,this.#sr=new uS(this.#At,this.#ir,this.#or)}get resourceType(){return this.#or?dx.QUERY_PARAMETER:this.#sr.isLoaded?dx.INLINE:this.annotationURL?dx.REMOTE_URL:dx.UNKNOWN}get annotationURL(){return this.#sr.isRemote?this.#sr.URL:null}get config(){return this.#rr("config")}get configLock(){if(this.#ir){const t=new URLSearchParams(this.#ir.split("?")[1]);if(t.has("config_lock"))return t.get("config_lock")}return this.#ar("config_lock")}get control(){return this.#ar("control")}get inspect(){return this.#ar("inspect")}get isEditMode(){switch(this.#ar("mode")){case"edit":case"term-edit":case"block-edit":case"relation-edit":case"text-edit":return!0;default:return!1}}get isEditTermMode(){return"edit"===this.#ar("mode")||"term-edit"===this.#ar("mode")}get isEditBlockMode(){return"block-edit"===this.#ar("mode")}get isEditRelationMode(){return"relation-edit"===this.#ar("mode")}get isTextEditMode(){return"text-edit"===this.#ar("mode")}get statusBar(){return this.#ar("status_bar")}get saveTo(){return this.#rr("save_to")}get isFocusFirstDenotation(){const t="true"===this.#ar("focus_first_denotation");if(t&&this.isEditMode)throw new Error("focus_first_denotation is only available in view mode.");return t}get additionalPaddingTop(){return this.#ar("padding_top")?parseInt(this.#ar("padding_top"),10):0}get#ir(){return this.#rr("source")||this.#rr("target")}annotation(){return this.#sr.isLoaded?this.#sr.annotation():null}#ar(t){return this.#At.hasAttribute(t)?this.#At.getAttribute(t):null}#rr(t){return this.#At.hasAttribute(t)?decodeURIComponent(this.#At.getAttribute(t)):null}get#or(){if(this.#lr)return null;const t=new URLSearchParams(window.location.search);return t.has("annotation")?decodeURIComponent(t.get("annotation")):null}get#lr(){return Boolean(this.#At.getAttribute("ignore_annotation_parameter"))}}class fS{constructor(t){this._editorHTMLElement=t}startWait(){this._editorHTMLElement.classList.add("textae-editor--wait")}endWait(){this._editorHTMLElement.classList.remove("textae-editor--wait")}}function pS(t){return t.length?rt`
908
- <table>
909
- <caption>Denotations or Blocks or Typesettings with boundary-cross.</caption>
910
- <thead>
911
- <tr>
912
- <th class="id">id</th>
913
- <th class="sourceProperty">source property</th>
914
- <th class="range">begin</th>
915
- <th class="range">end</th>
916
- <th>style/obj</th>
917
- </tr>
918
- </thead>
919
- <tbody>
920
- ${t.map(({id:t,sourceProperty:e,span:i,style:n,obj:s})=>function(t,e,i,n,s){return()=>rt`
921
- <tr>
922
- <td>${t||""}</td>
923
- <td>${e}</td>
924
- <td class="alert">${i.begin}</td>
925
- <td class="alert">${i.end}</td>
926
- <td>${n||s}</td>
927
- </tr>
928
- `}(t,e,i,n,s))}
929
- </tbody>
930
- </table>
931
- `:""}function mS(t){return t.length?rt`
932
- <table>
933
- <caption>Duplicated attributes.</caption>
934
- <thead>
935
- <tr>
936
- <th class="id">id</th>
937
- <th class="referencedItem">subj</th>
938
- <th>pred</th>
939
- <th class="referencedItem">obj</th>
940
- </tr>
941
- </thead>
942
- <tbody>
943
- ${t.map(({id:t,subj:e,pred:i,obj:n})=>function(t,e,i,n){return()=>rt`
944
- <tr>
945
- <td>${t||""}</td>
946
- <td class="alert">${e}</td>
947
- <td>${i}</td>
948
- <td class="alert">${n}</td>
949
- </tr>
950
- `}(t,e,i,n))}
951
- </tbody>
952
- </table>
953
- `:""}function gS(t){return t.length?rt`
954
- <table>
955
- <caption>Duplicated IDs in Denotations and Blocks.</caption>
956
- <thead>
957
- <tr>
958
- <th class="id">id</th>
959
- <th class="sourceProperty">source property</th>
960
- <th class="range">begin</th>
961
- <th class="range">end</th>
962
- <th>obj</th>
963
- </tr>
964
- </thead>
965
- <tbody>
966
- ${t.map(({id:t,sourceProperty:e,span:i,obj:n})=>function(t,e,i,n){return()=>rt`
967
- <tr>
968
- <td>${t||""}</td>
969
- <td>${e}</td>
970
- <td class="alert">${i.begin}</td>
971
- <td class="alert">${i.end}</td>
972
- <td>${n}</td>
973
- </tr>
974
- `}(t,e,i,n))}
975
- </tbody>
976
- </table>
977
- `:""}function vS(t){return t.length?rt`
978
- <table>
979
- <caption>Duplicated range blocks.</caption>
980
- <thead>
981
- <tr>
982
- <th class="id">id</th>
983
- <th class="range">begin</th>
984
- <th class="range">end</th>
985
- <th>obj</th>
986
- </tr>
987
- </thead>
988
- <tbody>
989
- ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>rt`
990
- <tr>
991
- <td>${t||""}</td>
992
- <td class="alert">${e.begin}</td>
993
- <td class="alert">${e.end}</td>
994
- <td>${i}</td>
995
- </tr>
996
- `}(t,e,i))}
997
- </tbody>
998
- </table>
999
- `:""}function yS(t){return t.length?rt`
1000
- <table>
1001
- <caption>Out of text blocks.</caption>
1002
- <thead>
1003
- <tr>
1004
- <th class="id">id</th>
1005
- <th class="range">begin</th>
1006
- <th class="range">end</th>
1007
- <th>obj</th>
1008
- </tr>
1009
- </thead>
1010
- <tbody>
1011
- ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>rt`
1012
- <tr>
1013
- <td>${t||""}</td>
1014
- <td class="alert">${e.begin}</td>
1015
- <td class="alert">${e.end}</td>
1016
- <td>${i}</td>
1017
- </tr>
1018
- `}(t,e,i))}
1019
- </tbody>
1020
- </table>
1021
- `:""}function OS(t){return t.length?rt`
1022
- <table>
1023
- <caption>Out of text denotations.</caption>
1024
- <thead>
1025
- <tr>
1026
- <th class="id">id</th>
1027
- <th class="range">begin</th>
1028
- <th class="range">end</th>
1029
- <th>obj</th>
1030
- </tr>
1031
- </thead>
1032
- <tbody>
1033
- ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>rt`
1034
- <tr>
1035
- <td>${t||""}</td>
1036
- <td class="alert">${e.begin}</td>
1037
- <td class="alert">${e.end}</td>
1038
- <td>${i}</td>
1039
- </tr>
1040
- `}(t,e,i))}
1041
- </tbody>
1042
- </table>`:""}function bS(t){return t.length?rt`
1043
- <table>
1044
- <caption>Out of text typesettings.</caption>
1045
- <thead>
1046
- <tr>
1047
- <th class="id">id</th>
1048
- <th class="range">begin</th>
1049
- <th class="range">end</th>
1050
- <th>style</th>
1051
- </tr>
1052
- </thead>
1053
- <tbody>
1054
- ${t.map(({id:t,span:e,style:i})=>function(t,e,i){return()=>rt`
1055
- <tr>
1056
- <td>${t||""}</td>
1057
- <td class="alert">${e.begin}</td>
1058
- <td class="alert">${e.end}</td>
1059
- <td>${i}</td>
1060
- </tr>
1061
- `}(t,e,i))}
1062
- </tbody>
1063
- </table>
1064
- `:""}function xS(t){return t.length?rt`
1065
- <table>
1066
- <caption>Referenced entities do not exist.</caption>
1067
- <thead>
1068
- <tr>
1069
- <th class="id">id</th>
1070
- <th class="sourceProperty">source property</th>
1071
- <th class="referencedItem">subj</th>
1072
- <th>pred</th>
1073
- <th class="referencedItem">obj</th>
1074
- </tr>
1075
- </thead>
1076
- <tbody>
1077
- ${t.map(({id:t,sourceProperty:e,alertSubj:i,subj:n,pred:s,alertObj:o,obj:r})=>function(t,e,i,n,s,o,r){return()=>rt`
1078
- <tr>
1079
- <td>${t||""}</td>
1080
- <td>${e}</td>
1081
- <td${i?' class="alert"':""}>${n}</td>
1082
- <td>${s}</td>
1083
- <td${o?' class="alert"':""}>${r}</td>
1084
- </tr>
1085
- `}(t,e,i,n,s,o,r))}
1086
- </tbody>
1087
- </table>
1088
- `:""}function wS(t){return t.length?rt`
1089
- <table>
1090
- <caption>Wrong range blocks.</caption>
1091
- <thead>
1092
- <tr>
1093
- <th class="id">id</th>
1094
- <th class="range">begin</th>
1095
- <th class="range">end</th>
1096
- <th>obj</th>
1097
- </tr>
1098
- </thead>
1099
- <tbody>
1100
- ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>rt`
1101
- <tr>
1102
- <td>${t||""}</td>
1103
- <td class="alert">${e.begin}</td>
1104
- <td class="alert">${e.end}</td>
1105
- <td>${i}</td>
1106
- </tr>
1107
- `}(t,e,i))}
1108
- </tbody>
1109
- </table>
1110
- `:""}function _S(t){return t.length?rt`
1111
- <table>
1112
- <caption>Wrong range denotations.</caption>
1113
- <thead>
1114
- <tr>
1115
- <th class="id">id</th>
1116
- <th class="range">begin</th>
1117
- <th class="range">end</th>
1118
- <th>obj</th>
1119
- </tr>
1120
- </thead>
1121
- <tbody>
1122
- ${t.map(({id:t,span:e,obj:i})=>function(t,e,i){return()=>rt`
1123
- <tr>
1124
- <td>${t||""}</td>
1125
- <td class="alert">${e.begin}</td>
1126
- <td class="alert">${e.end}</td>
1127
- <td>${i}</td>
1128
- </tr>
1129
- `}(t,e,i))}
1130
- </tbody>
1131
- </table>`:""}class SS extends u{constructor(t){const e=t.map(({name:t,wrongRangeDenotations:e,outOfTextDenotations:i,wrongRangeBlocks:n,outOfTextBlocks:s,duplicatedRangeBlocks:o,wrongRangeTypesettings:r,outOfTextTypesettings:a,duplicatedIDs:l,boundaryCrossingSpans:c,referencedEntitiesDoNotExist:h,duplicatedAttributes:u},d)=>`\n ${1===d?'\n <div class="textae-editor__validate-dialog__content">\n <h1>Track annotations will be merged to the root annotations.</h1>\n </div>':""}\n <div class="textae-editor__validate-dialog__content">\n <h2>${t}</h2>\n ${_S(e)}\n ${OS(i)}\n ${wS(n)}\n ${yS(s)}\n ${vS(o)}\n ${function(t){return t.length?`\n <table>\n <caption>Wrong range typesettings.</caption>\n <thead>\n <tr>\n <th class="id">id</th>\n <th class="range">begin</th>\n <th class="range">end</th>\n <th>style</th>\n </tr>\n </thead>\n <tbody>\n ${t.map(({id:t,span:e,style:i})=>`\n <tr>\n <td>${t||""}</td>\n <td class="alert">${e.begin}</td>\n <td class="alert">${e.end}</td>\n <td>${i}</td>\n </tr>\n `).join("\n")}\n </tbody>\n </table>\n `:""}(r)}\n ${bS(a)}\n ${gS(l)}\n ${pS(c)}\n ${xS(h)}\n ${mS(u)}\n </div>\n `).join("\n");super("The following erroneous annotations ignored",e,{maxWidth:900})}}class kS{#Nt;#cr;#hr;constructor(t,e,i){this.#Nt=t,this.#cr=e,this.#hr=i;for(const i of e)t.on(i,this.#hr)}dispose(){for(const t of this.#cr)this.#Nt.off(t,this.#hr)}}class $S{#ur;#dr;#hr;constructor(t,e,i){this.#ur=t,this.#dr=e,this.#hr=i,this.#fr()}dispose(){this.#ur.removeEventListener(this.#dr,this.#hr)}#fr(){this.#ur.addEventListener(this.#dr,this.#hr)}}class TS{#a;#Oe;#pr;constructor(t,e,i){this.#a=t,this.#Oe=e,this.#pr=i.getInstanceContainerFor(e)}add(t){const e=this.#pr.get(t);console.assert(e,`${t} is not a instance of ${this.#Oe}.`),e.isSelected||(e.select(),this.triggerChange())}has(t){const e=this.#pr.get(t);return!!e&&e.isSelected}contains(t){for(const e of this.#pr.selectedItems)if(t(e))return!0;return!1}get all(){return this.#pr.selectedItems}get size(){return this.#pr.selectedItems.length}get some(){return this.size>0}get singleId(){const t=this.single;return t?t.id:null}get single(){return 1===this.size?this.#pr.selectedItems[0]:null}toggle(t){this.has(t)?this.remove(t):this.add(t)}remove(t){this.has(t)&&(this.#pr.get(t).deselect(),this.triggerChange())}removeInstance(t){this.remove(t.id)}removeAll(){if(0!==this.size){for(const t of this.all)t.deselect();this.triggerChange()}}triggerChange(){this.#a.emit(`textae-event.selection.${this.#Oe}.change`)}}class CS extends TS{selectedWithAttributeOf(t){return this.all.some(e=>e.attributes.some(e=>e.pred===t))}onlySelectedWithJustOneAttributeOf(t){return this.all.every(e=>1===e.attributes.filter(e=>e.pred===t).length)}selectedWithoutAttributeOf(t){return this.all.some(e=>!e.attributes.some(e=>e.pred===t))}isDuplicatedPredAttributeSelected(t){return this.all.some(e=>e.attributes.filter(e=>e.pred===t).length>1)}findSelectedWithSamePredicateAttribute(t){return this.all.find(e=>e.attributes.find(e=>e.pred===t))}findSelectedAttributeWithSamePredicate(t){const e=this.findSelectedWithSamePredicateAttribute(t);if(e)return e.attributes.find(e=>e.pred===t)}}class PS{#qt;#Nt;constructor(t,e){this.#Nt=t,this.#qt=e,this.span=new TS(t,"span",e),this.entity=new CS(t,"entity",e),this.relation=new CS(t,"relation",e),t.on("textae-event.annotation-data.span.remove",t=>this.span.removeInstance(t)).on("textae-event.annotation-data.entity.remove",t=>this.entity.removeInstance(t)).on("textae-event.annotation-data.relation.remove",t=>this.relation.removeInstance(t)).on("textae-event.annotation-data.all.change",()=>{this.span.triggerChange(),this.entity.triggerChange(),this.relation.triggerChange()})}get copyingTargets(){return[...this.#mr].map(({typeValues:t})=>t)}get cuttingTargets(){return this.#mr}add(t,e){console.assert(this[t]);for(const i of e)this[t].add(i);"entity"===t&&this.#gr(e[e.length-1])&&this.#Nt.emit("textae-event.selection-model.last-selected-denotation-id.change",e[e.length-1])}remove(t,e){console.assert(this[t]),this[t].remove(e)}removeAll(){this.span.removeAll(),this.entity.removeAll(),this.relation.removeAll()}selectSpan(t){this.removeAll(),this.span.add(t)}selectSpanRange(t){this.removeAll();for(const e of t)this.span.add(e)}selectEntity(t){this.removeAll(),this.entity.add(t),this.#gr(t)&&this.#Nt.emit("textae-event.selection-model.last-selected-denotation-id.change",t)}selectDenotation(t){if(!this.#gr(t))throw new Error(`Denotation ${t} not found`);this.selectEntity(t)}selectRelation(t){this.removeAll(),this.relation.add(t)}get#mr(){return new Set(this.span.all.map(t=>t.entities).flat().concat(this.entity.all))}#gr(t){return this.#qt.entityInstanceContainer.hasDenotation(t)}}class ES{#At;#qt;#Nt;#vr;#yr;#Or;#br;constructor(t,i,n,s,o){t.tabIndex=-1,qx()&&t.classList.add("textae-editor--android"),function(t){t.addEventListener("mousedown",t=>{t.shiftKey&&t.preventDefault()}),r()(t,".textae-editor__signboard","mousedown",t=>t.preventDefault())}(t);const a=new hS.EventEmitter;!function(t){t.on("textae-event.resource.annotation.format.error",({displayName:t})=>e().error(`${t} is not a annotation file or its format is invalid.`)).on("textae-event.resource.configuration.format.error",({displayName:t})=>e().error(`${t} is not a configuration file or its format is invalid.!`)).on("textae-event.annotation-data.all.change",(t,e)=>{e.some(t=>t.hasError)&&new SS(e).open()}).on("textae-event.annotation-data.events-observer.unsaved-change",t=>{window.onbeforeunload=qx()||t?()=>!0:null}),t.on("textae-event.clip-board.change",(t,e)=>{for(const e of t)e.startCut();for(const t of e)t.cancelCut()}),t.on("textae-event.commander.attributes.change",t=>{for(const e of t.reduce((t,e)=>t.add(e.subjectInstance),new Set))e.updateElement()})}(a);const l=new fS(t);!function(t,e){t.on("textae-event.resource.startLoad",()=>e.startWait()).on("textae-event.resource.endLoad",()=>e.endWait()).on("textae-event.resource.startSave",()=>e.startWait()).on("textae-event.resource.endSave",()=>e.endWait())}(a,l);const c=new dS(t),h=new Be(i,t,a,l,s,o,"true"===c.configLock,c.additionalPaddingTop);this.#At=t,this.#qt=h,this.#Nt=a;const u=new PS(a,h);if(this.#br=new cS(t,i,n,a,h,c,u),c.inspect){const t=t=>{const e=document.querySelector(`#${c.inspect}`);e&&(e.textContent=JSON.stringify(t,null,2))};this.#xr(t)}this.#Or=this.#wr(h,t),ze(this,()=>this.#br,["copyEntitiesToSystemClipboard","cutEntitiesToSystemClipboard","pasteEntitiesFromSystemClipboard","activate","deactivate","applyTextSelectionWithTouchDevice","showContextMenu","hideContextMenu","focusDenotation"]),ze(this,()=>u,["selectDenotation"]),ze(this,()=>h,["drawGridsInSight","reLayout"])}updateDenotationEntitiesWidth(){for(const t of this.#qt.spanInstanceContainer.allDenotationSpans)t.updateDenotationEntitiesWidth()}load(t){mx(this.#Nt,t)}setInspector(t){this.#vr&&(this.#vr.dispose(),this.#vr=null),"function"==typeof t&&(this.#vr=this.#xr(t))}setLastSelectedDenotationIDCallback(t){this.#yr&&(this.#yr.dispose(),this.#yr=null),"function"==typeof t&&(this.#yr=new kS(this.#Nt,["textae-event.selection-model.last-selected-denotation-id.change"],t))}setAutocompletionFunction(t){if("function"!=typeof t)throw new TypeError("autocompletionFunction must be a function");this.#qt.autocompletionFunction=t}get HTMLElementID(){return this.#At.id}dispose(){for(const t of this.#Or)t.dispose()}focusDenotation(t){if(!this.#qt.denotations.has(t))throw new Error(`Denotation ${t} not found`);this.#br.focusDenotation(t)}#wr(t,e){const i=new Set,n=()=>t.drawGridsInSight(),s=new $S(e,"scroll",n);i.add(s);const o=e.closest(".textae-container");if(o){const t=new $S(o,"scroll",n);i.add(t)}return i}#xr(t){const e=function(t){let e=t;return function(t,i){Tw(e,t)&&(e=t,i(t))}}(this.#_r);return new kS(this.#Nt,["textae-event.annotation-data.events-observer.change","textae-event.editor.selected-text.change"],()=>e(this.#_r,t))}get#_r(){return{...this.#qt.externalFormat,selectedText:this.#br.getSelectedText()}}}function AS(t,e){const i=function(t,e){return new ES(t,e.nextID,e.mousePoint,()=>{for(const t of document.querySelectorAll(".ui-dialog"))t.classList.add("textae-editor--wait");for(const t of document.querySelectorAll(".ui-widget-overlay"))t.classList.add("textae-editor--wait")},()=>{for(const t of document.querySelectorAll(".ui-dialog"))t.classList.remove("textae-editor--wait");for(const t of document.querySelectorAll(".ui-widget-overlay"))t.classList.remove("textae-editor--wait")})}(e,t);return t.registerEditor(e,i),e.dataset.textaeInitialized=!0,i}class MS{constructor(t){this._editor=t}set annotation(t){this._editor.load(t)}set inspectCallback(t){this._editor.setInspector(t)}set lastSelectedDenotationIDCallback(t){this._editor.setLastSelectedDenotationIDCallback(t)}set autocompletionCallback(t){this._editor.setAutocompletionFunction(t)}get id(){return this._editor.HTMLElementID}focusDenotation(t){this._editor.focusDenotation(t)}selectDenotation(t){this._editor.selectDenotation(t)}}const QS=new class{#Sr;#kr;#so;constructor(){this.#Sr=new y,this.#kr=new b,this.#so=x,window.addEventListener("load",()=>{return t=this.#Sr,document.body.addEventListener("focus",e=>{const i=e.target.closest(".textae-editor");i&&(t.selected&&t.selected!==i&&(t.selected=null),t.selected=i)},!0),document.body.addEventListener("click",e=>{null===e.target.closest(".textae-editor__dialog")&&null===e.target.closest(".ui-autocomplete")&&null===e.target.closest(".ui-widget-overlay")&&null===e.target.closest(".textae-editor__pallet__content")&&(t.has(e.target.closest(".textae-editor"))||t.selected&&(t.selected=null))}),void new MutationObserver(e=>{for(const i of e)if("childList"===i.type)for(const e of i.removedNodes)if(e instanceof HTMLElement){e.classList.contains("textae-editor")&&t.remove(e);for(const i of e.querySelectorAll(".textae-editor"))t.remove(i)}}).observe(document.body,{childList:!0,subtree:!0});var t}),window.addEventListener("resize",m()(()=>{this.#Sr.reLayout(),this.#Sr.drawGridsInSight(),this.#Sr.updateDenotationEntitiesWidth()},500))}get nextID(){return this.#Sr.nextID}get mousePoint(){return this.#so}registerEditor(t,e){this.#kr.setObserver(t),this.#Sr.set(t,e)}};function DS(){return e().set("notifier","position","top-right"),Array.from(document.querySelectorAll(".textae-editor")).filter(t=>!t.dataset.textaeInitialized).map(t=>AS(QS,t)).map(t=>new MS(t))}document.addEventListener("DOMContentLoaded",DS),window.initializeTextAEEditor=DS,console.log(`TextAE Version ${tn} loaded.`)})()})();